Skip to content

Conversation

@Spielboerg
Copy link
Contributor

Related issue #23351

What I did

Currently, if keyboard shortcuts are disabled via the manager config

import React from 'react';
import { addons } from '@storybook/addons';

addons.setConfig({
  enableShortcuts: false,
});

the shortcut page can still be accessed via the menu:

Enabled

The changes in this PR will hide the shortcuts entry when shortcuts are disabled:
Disabled

⚠️ Disclaimer: I was not able to generate a sandbox locally with a different config than the default one (I wanted to disable the shortcuts). So I was not able to test if my changes actually work. If you can help me to set up a sandbox with disabled shortcuts I can test it myself, otherwise, I kindly ask if you can test it yourself.

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@yannbf
Copy link
Member

yannbf commented Jul 17, 2023

Thanks a lot for this PR! Let's hold this off until the discussions in #23351 are sorted.

@MichaelArestad
Copy link
Contributor

MichaelArestad commented Nov 25, 2024

@yannbf I think the discussions are resolved. I think this PR could use another look.

@nx-cloud
Copy link

nx-cloud bot commented Jun 24, 2025

View your CI Pipeline Execution ↗ for commit 2ced0e9.

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 1m 17s View ↗

☁️ Nx Cloud last updated this comment at 2025-06-25 09:24:27 UTC

@ghengeveld ghengeveld force-pushed the hide-shortcut-page-when-disabled branch from 67ef945 to 28fb35a Compare June 24, 2025 14:10
@storybook-app-bot
Copy link

storybook-app-bot bot commented Jun 24, 2025

Package Benchmarks

Commit: 2ced0e9, ran on 25 July 2025 at 13:45:46 UTC

The following packages have significant changes to their size or dependencies:

storybook

Before After Difference
Dependency count 56 49 🎉 -7 🎉
Self size 41.37 MB 31.87 MB 🎉 -9.50 MB 🎉
Dependency size 18.22 MB 17.44 MB 🎉 -785 KB 🎉
Bundle Size Analyzer Link Link

@storybook/ember

Before After Difference
Dependency count 203 205 🚨 +2 🚨
Self size 28 KB 28 KB 🎉 -5 B 🎉
Dependency size 28.05 MB 28.86 MB 🚨 +810 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-native-web-vite

Before After Difference
Dependency count 163 161 🎉 -2 🎉
Self size 32 KB 35 KB 🚨 +3 KB 🚨
Dependency size 23.66 MB 23.60 MB 🎉 -62 KB 🎉
Bundle Size Analyzer Link Link

@storybook/vue3-vite

Before After Difference
Dependency count 105 104 🎉 -1 🎉
Self size 34 KB 34 KB 🎉 -14 B 🎉
Dependency size 42.79 MB 42.74 MB 🎉 -51 KB 🎉
Bundle Size Analyzer Link Link

sb

Before After Difference
Dependency count 57 50 🎉 -7 🎉
Self size 1 KB 1 KB 🎉 -2 B 🎉
Dependency size 59.59 MB 49.31 MB 🎉 -10.28 MB 🎉
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 221 215 🎉 -6 🎉
Self size 585 KB 582 KB 🎉 -3 KB 🎉
Dependency size 103.99 MB 93.75 MB 🎉 -10.24 MB 🎉
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 190 184 🎉 -6 🎉
Self size 31 KB 31 KB 🎉 -2 B 🎉
Dependency size 88.08 MB 77.89 MB 🎉 -10.20 MB 🎉
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 1 1 0
Self size 12.51 MB 12.47 MB 🎉 -41 KB 🎉
Dependency size 98 KB 98 KB 🎉 -2 B 🎉
Bundle Size Analyzer Link Link

@ghengeveld ghengeveld moved this from Empathy Queue (prioritized) to In Progress in Core Team Projects Jun 24, 2025
@ghengeveld ghengeveld added bug and removed ci: do not merge maintenance User-facing maintenance tasks labels Jun 25, 2025
@ghengeveld ghengeveld merged commit a3274ac into storybookjs:next Jun 25, 2025
50 of 52 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Core Team Projects Jun 25, 2025
@github-actions github-actions bot mentioned this pull request Jun 25, 2025
71 tasks
@ghengeveld ghengeveld added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Jun 25, 2025
@github-actions github-actions bot mentioned this pull request Jun 25, 2025
8 tasks
ghengeveld added a commit that referenced this pull request Jun 27, 2025
…abled

UI: Hide keyboard shortcuts entry from menu when shortcuts are disabled
(cherry picked from commit a3274ac)
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jun 27, 2025
@Spielboerg Spielboerg deleted the hide-shortcut-page-when-disabled branch June 30, 2025 09:47
@ghengeveld ghengeveld added the needs qa Indicates that this needs manual QA during the upcoming minor/major release label Jul 25, 2025
@yannbf yannbf removed the needs qa Indicates that this needs manual QA during the upcoming minor/major release label Jul 28, 2025
@ndelangen ndelangen removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug ci:normal patch:done Patch/release PRs already cherry-picked to main/release branch ui

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants