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

Updated nav/navset API names #492

Closed
gadenbuie opened this issue May 16, 2023 · 4 comments · Fixed by #681 or #876
Closed

Updated nav/navset API names #492

gadenbuie opened this issue May 16, 2023 · 4 comments · Fixed by #681 or #876
Assignees

Comments

@gadenbuie
Copy link
Collaborator

gadenbuie commented May 16, 2023

In rstudio/bslib#546, we renamed many of the nav_*() and navset_*() functions in the R API. Many of these now align with the Python naming, but there are some notable differences. Here's a summary table:

bslib (new) Python (current) Changes?
nav_panel() ui.nav 👀
nav_panel_hidden() ui.nav_content 👀 ❗
navset_tab() ui.navset_tab
navset_pill() ui.navset_pill
navset_pill_list() ui.navset_pill_list
navset_hidden() ui.navset_hidden
navset_bar() ui.navset_bar
navset_card_tab() ui.navset_tab_card 👀
navset_card_pill() ui.navset_pill_card 👀

👀 new R name is different from current Python
❗ not in API refs

Note that this research also uncovered that ui.navset_bar and ui.navset_tab_card are exported but don't appear in the API reference.

### Tasks
- [x] `navset_pill_card` -> `navset_card_pill`
- [x] `navset_tab_card` -> `navset_card_tab`
- [x] ~~`nav_content` -> `nav_panel_hidden`~~
- [ ] `nav` -> `nav_panel`
- [x] document `navset_bar`
- [x] document `navset_hidden`
- [x] ~~document `nav_panel_hidden`~~
@schloerke
Copy link
Collaborator

nav_content -> nav_panel_hidden will not happen as nav_content was removed in #136

@schloerke
Copy link
Collaborator

@gadenbuie Would you be ok with leaving nav in py-shiny? This change would not be an easy transition.

Current methods (including deprecated methods):

>>> shiny.ui.n<TAB>
shiny.ui.nav(                 shiny.ui.navset_card_pill(    shiny.ui.navset_pill_list(   
shiny.ui.nav_control(         shiny.ui.navset_card_tab(     shiny.ui.navset_tab(         
shiny.ui.nav_menu(            shiny.ui.navset_hidden(       shiny.ui.navset_tab_card(    
shiny.ui.nav_spacer()         shiny.ui.navset_pill(         shiny.ui.notification_remove(
shiny.ui.navset_bar(          shiny.ui.navset_pill_card(    shiny.ui.notification_show(  

@cpsievert
Copy link
Collaborator

Reopening this as I think we should consider having a nav_panel() alias for nav() (and possibly deprecating the latter)

@cpsievert cpsievert reopened this Nov 17, 2023
@wch
Copy link
Collaborator

wch commented Nov 17, 2023

I also prefer nav_panel to nav.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment