Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser navigation integration #1621

Merged
merged 11 commits into from
Oct 9, 2024
Merged

Browser navigation integration #1621

merged 11 commits into from
Oct 9, 2024

Conversation

terrakok
Copy link
Member

@terrakok terrakok commented Oct 7, 2024

Add window.bindToNavigation(navController, getBackStackEntryPath) method for web targets to show a current route in a browser and enable browser navigation calls.

Screen.Recording.2024-10-08.at.18.02.46.mov

Fixes https://youtrack.jetbrains.com/issue/CMP-6818

Common code
image

JS/wasmJS code
image

Testing

  • Unit tests
  • Demo app

Release Notes

Features - Navigation

  • New API to configure browser navigation buttons and the address line.

…rent route in a browser and enable browser navigation calls.
@terrakok terrakok requested a review from MatkovIvan October 7, 2024 14:52
@terrakok terrakok force-pushed the k.tskh/browser-nav branch from 2aff1a9 to 0424c64 Compare October 7, 2024 15:20
@terrakok terrakok requested review from MatkovIvan and eymar October 8, 2024 16:00

localWindow.addEventListener("popstate", callback)
awaitClose {
localWindow.removeEventListener("popstate", callback)
Copy link
Member

@eymar eymar Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: in wasmJs target removeEventListener will work correctly only with kotlin 2.0.20 (https://youtrack.jetbrains.com/issue/KT-64565)

__

No actions required here.
It's just a note.

@terrakok terrakok requested a review from eymar October 9, 2024 10:11
@terrakok terrakok requested a review from eymar October 9, 2024 12:01
@terrakok terrakok force-pushed the k.tskh/browser-nav branch from dc62db9 to 6d8fa1a Compare October 9, 2024 12:55
@terrakok terrakok merged commit 68dfb7b into jb-main Oct 9, 2024
1 check passed
@terrakok terrakok deleted the k.tskh/browser-nav branch October 9, 2024 13:09
@eygraber
Copy link

eygraber commented Oct 9, 2024

It looks like the functions are all internal . Was that intentional?

@MatkovIvan
Copy link
Member

No, it was the last-minute incorrect change. @terrakok will address it. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants