Show current page on menu
Description
The menu needs to show the proper current page when not navigating directly through the menu.
A code to replicate the issue:
from taipy import Gui, navigate
import taipy.gui.builder as tgb
def menu_option_selected(state, action, info):
page = info["args"][0]
navigate(state, to=page)
with tgb.Page() as root_page:
tgb.menu(label="Menu",
lov=[('home', 'Page 1'), ('about', 'Page 2')],
on_action=menu_option_selected)
tgb.text("# Multi-page application", mode="md")
with tgb.Page() as home_page:
tgb.text("# Home", mode="md")
with tgb.Page() as about_page:
tgb.text("# About", mode="md")
pages = {
"/": root_page,
"home": home_page,
"about": about_page
}
Gui(pages=pages).run()
Here, if the user manually enters the URL or page name, the menu will not show which page we are on.
This is an expected behavior, as the menu should not normally be used for navigation but for actions (like buttons). We could have a mode for the menu to be used in the context of navigation so that the menu recognizes on which we are.
The menu should be updated depending on the actual current page I am in.
Acceptance Criteria
- [ ] Ensure new code is unit tested, and check code coverage is at least 90%.
- [ ] Propagate any change on the demos and run all of them to ensure there is no breaking change.
- [ ] Ensure any change is well documented.
Code of Conduct
- [X] I have checked the existing issues.
- [ ] I am willing to work on this issue (optional)
Hi @FlorianJacta , I would like to work on this.
hey @heysolomon , are you still working on this issue nuh! ? 'cause there no assignee on this issue and also i am a beginner contributor so if you like to i would love to work on this issue with you and i also get a context of the project
@NILAY1556 I haven’t started working on this issue yet as I haven’t been assigned to it yet. I have no problem collaborating with you on the issue. @FlorianJacta @FredLL-Avaiga is it possible for two contributors to be assigned on an issue?
We can do with two contributors.
@namnguyen20999 is also working on it inside of our R&D.
I don't think there's enough meat on this issue for more than one especially if it is @namnguyen20999 ;-)
This current issue has not been reviewed by the maintainer team and is not open to external contribution.
Please look for issues labeled "good first issue" or "help wanted," as they are opened for external contributions.
Thank you for your understanding.
This issue has been labelled as "🥶Waiting for contributor" because it has been inactive for more than 14 days. If you would like to continue working on this issue, please add another comment or create a PR that links to this issue. If a PR has already been created which refers to this issue, then you should explicitly mention this issue in the relevant PR. Otherwise, you will be unassigned in 14 days. For more information please refer to the contributing guidelines.