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

Implement ui.navigate functionality #2593

Merged
merged 9 commits into from
Feb 26, 2024

Conversation

ZeroCool940711
Copy link
Contributor

@ZeroCool940711 ZeroCool940711 commented Feb 22, 2024

This PR adds the ui.navigate module, which includes the ui.navigate.back(), ui.navigate.forward(), and ui.navigate.to() methods. These methods allow for programmatic navigation within the browser history and redirecting to specific URLs or page functions.


Feature request: #2575

Copy link
Member

@rodja rodja left a comment

Choose a reason for hiding this comment

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

Maybe we should implement it inside a class instead of free functions. That would allow replacing/updating the implementation for single page applications (SPAs) for example.

@falkoschindler
Copy link
Contributor

@rodja Is this what you had in mind?

I'm quite happy with the current implementation. I also deprecated ui.open, although I'm not sure if we really want to print a warning or if we should simply keep ui.open as a valid alias for now.

@falkoschindler falkoschindler requested a review from rodja February 24, 2024 15:31
@falkoschindler falkoschindler added the enhancement New feature or request label Feb 24, 2024
@falkoschindler falkoschindler added this to the 1.4.16 milestone Feb 24, 2024
@rodja
Copy link
Member

rodja commented Feb 25, 2024

@falkoschindler I think it's better to not print warnings when using ui.open because it will pollute the logs quite a bit.

I've meddled a bit with the documentation structure and internals to make sure https://nicegui.io/documentation/open is not showing a 404.

Copy link
Member

@rodja rodja left a comment

Choose a reason for hiding this comment

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

From my side it's ready to merge.

@falkoschindler falkoschindler merged commit 3e41652 into zauberzeug:main Feb 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants