-
Notifications
You must be signed in to change notification settings - Fork 50
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
Improve nav_*()
and navset_*()
function names
#546
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with aliases to the old names
cpsievert
reviewed
Apr 13, 2023
Oops, I thought I merged main into this branch before updating the articles. I'll finish this up early next week. |
#Conflicts: # vignettes/cards.Rmd # vignettes/layouts.Rmd # vignettes/sidebars.Rmd
I think this is much easier to understand! |
cpsievert
approved these changes
Apr 18, 2023
Looks a lot better to me too |
Python APIComparing the new names with the current Shiny for Python API:
👀 new R name is different from current Python |
cpsievert
reviewed
May 15, 2023
cpsievert
reviewed
May 15, 2023
cpsievert
reviewed
May 15, 2023
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
This was referenced May 16, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For #476
Overview
This is a big, wide-ranging PR with simple naming changes. There are two over-arching goals:
nav()
more descriptive.navs_
andnav_
prefixes by replacing the first withnavset_
.API Changes
Here's a short summary of the changes. In all cases, deprecation warnings are emitted unless the functions are called from Shiny (to give us time to migrate the changes where
bslib::nav()
and others are called directly).nav_panel()
nav()
tabPanel()
nav_panel_hidden()
nav_content()
tabPanelBody()
navset_tab()
navs_tab()
tabsetPanel()
navset_pill()
navs_pill()
tabsetPanel(type="pill")
navset_pill_list()
navs_pill_list()
navlistPanel()
navset_hidden()
navs_hidden()
tabSetPanel(type="hidden")
navset_bar()
navs_bar()
pageNavbar()
adjacent?navset_card_tab()
navs_tab_card()
navset_card_pill()
navs_pill_card()
In the revised API, all functions starting with
navset_*()
take items prefixed withnav_()
.Notes:
nav_content()
is nownav_panel_hidden()
(which pairs withnavset_hidden()
). The panel itself isn't hidden necessarily; the hidden refers to the fact that there isn't a<nav>
container with controls (e.g. a wizard interface)._card
part of the function name was moved in front oftab|pill
innavset_card_tab()
andnavset_card_pill()
to reflect that card is higher priority in usage.PR Notes
There's a lot of work in flight in the bslib articles, so I only made changes in the R functions, documentation, and examples. We can wait for those PRs to land or we can tackle those updates in a follow-up PR. Update: this is done now.
I also took care to ensure that the aliased functions appear at the end of any function lists in the documentation. All aliases are now collected in
R/navs-aliases.R
withTODO
items so we can deprecate them in future version of bslib. Update: these functions will be formally deprecated.I marked the deprecated functions as "renamed in v0.5.0". We're currently on v0.4.2.9000 and I'm assuming, from looking at our current NEWS situation that we'd be doing a minor version bump with the next release.
Remaining work
Need to:
For discussion or possibly a future PR:
nav_item()
? In Shiny for Python this becamenav_control()
.fillable
inpage_navbar()
tofillable_panel
?