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

UI: Fix tab display when there is only one tab #14790

Conversation

Tomastomaslol
Copy link
Member

@Tomastomaslol Tomastomaslol commented May 4, 2021

Issue: #14598

What I did

  • Only use option isToolshown to set isToolshown
  • Render tabs if there only is one tab

How to test

Scenarios

Canvas disabled, docs panels enbaled

Screen Shot 2021-05-04 at 6 20 39 pm

Canvas enbaled, docs panels disabled

Screen Shot 2021-05-04 at 6 20 11 pm

Canvas enbaled, docs panels enbaled

Screen Shot 2021-05-04 at 6 04 09 pm

Canvas disabled, docs panels disabled

Screen Shot 2021-05-04 at 6 18 48 pm

@nx-cloud
Copy link

nx-cloud bot commented May 4, 2021

Nx Cloud Report

CI ran the following commands for commit 2789a64. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 💌 from NxCloud.

@Tomastomaslol Tomastomaslol force-pushed the issue-14598-tabs-controlling-appearance-of-the-toolbar branch 2 times, most recently from c4ed885 to 6f7e302 Compare May 4, 2021 04:18
@Tomastomaslol Tomastomaslol force-pushed the issue-14598-tabs-controlling-appearance-of-the-toolbar branch from 6f7e302 to c735c90 Compare May 4, 2021 08:28
@Tomastomaslol Tomastomaslol marked this pull request as ready for review May 4, 2021 08:34
@shilman shilman changed the title Fix: Tabs controlling appearance of the toolbar UI: Fix tab display when there is only one tab May 5, 2021
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

LGTM -- great stuff @Tomastomaslol 🥇. @ndelangen ?

@ndelangen
Copy link
Member

I'm fine with this. Though I do wonder what's the use-case of having a tab interface, if there's only 1 option?

@Tomastomaslol
Copy link
Member Author

I guess it could valuable to know the name of the tab you are on currently.

There is also this "soft 404" scenario:

Scenario

 previewTabs: {
    canvas: { hidden: true },
},

Request: ?path=/story/addons-a11y-basebutton--default

Screen Shot 2021-05-11 at 11 08 17 am

You can still request the canvas view when the tab hidden in the configuration. To be able to navigate to an active tab you would need the tabs menu.

Is being able to visit a hidden tab by requesting the URL a bug?

I have seen some issues logged for it:

I'm not sure that hidden should equal inaccessible and I can see some value in separating the concepts.

@shilman shilman merged commit a843373 into storybookjs:next May 11, 2021
@ndelangen
Copy link
Member

Another contribution merged @Tomastomaslol 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants