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

Show current page on menu #1911

Open
1 of 5 tasks
FlorianJacta opened this issue Oct 4, 2024 · 7 comments
Open
1 of 5 tasks

Show current page on menu #1911

FlorianJacta opened this issue Oct 4, 2024 · 7 comments
Assignees
Labels
🖰 GUI Related to GUI 📈 Improvement Improvement of a feature. 🟨 Priority: Medium Not blocking but should be addressed 🔒 Staff only Can only be assigned to the Taipy R&D team

Comments

@FlorianJacta
Copy link
Member

FlorianJacta commented Oct 4, 2024

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.

image

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

  • I have checked the existing issues.
  • I am willing to work on this issue (optional)
@FlorianJacta FlorianJacta added 📈 Improvement Improvement of a feature. 🖰 GUI Related to GUI 🟨 Priority: Medium Not blocking but should be addressed labels Oct 4, 2024
@heysolomon
Copy link

heysolomon commented Oct 4, 2024

Hi @FlorianJacta , I would like to work on this.

@FredLL-Avaiga FredLL-Avaiga changed the title [Refactor] Show current page on menu Show current page on menu Oct 6, 2024
@NILAY1556
Copy link

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

@heysolomon
Copy link

@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?

@FlorianJacta
Copy link
Member Author

We can do with two contributors.

@FlorianJacta
Copy link
Member Author

@namnguyen20999 is also working on it inside of our R&D.

@FredLL-Avaiga
Copy link
Member

I don't think there's enough meat on this issue for more than one especially if it is @namnguyen20999 ;-)

@jrobinAV
Copy link
Member

jrobinAV commented Oct 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖰 GUI Related to GUI 📈 Improvement Improvement of a feature. 🟨 Priority: Medium Not blocking but should be addressed 🔒 Staff only Can only be assigned to the Taipy R&D team
Projects
None yet
Development

No branches or pull requests

6 participants