Skip to content

Zoom: Keyboardshortcut for the plus key#33565

Merged
ndelangen merged 4 commits into
nextfrom
norbert/keyboard-plus-zoom
Jan 16, 2026
Merged

Zoom: Keyboardshortcut for the plus key#33565
ndelangen merged 4 commits into
nextfrom
norbert/keyboard-plus-zoom

Conversation

@ndelangen
Copy link
Copy Markdown
Member

@ndelangen ndelangen commented Jan 16, 2026

What I did

Added an additional zoom in keyboard shortcut

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

I manually verified this works on my local machine using my own keyboard

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • New Features
    • Added an alternative keyboard shortcut for zooming in: you can now use Alt + + in addition to Alt + = to zoom the canvas. This provides a second, equivalent key option for the same zoom-in action.

✏️ Tip: You can customize this high-level summary in your review settings.

@ndelangen ndelangen marked this pull request as ready for review January 16, 2026 14:30
@ndelangen ndelangen requested a review from ghengeveld January 16, 2026 14:30
@ndelangen ndelangen self-assigned this Jan 16, 2026
@ndelangen ndelangen added feature request a11y: zoom Accessibility issues related to typography size and zoom features ci:normal labels Jan 16, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Jan 16, 2026

View your CI Pipeline Execution ↗ for commit 6587802

Command Status Duration Result
nx run-many -t compile,check,knip,test,pretty-d... ❌ Failed 7m 43s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-16 15:52:53 UTC

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

Adds a second keyboard shortcut (Alt+Plus) for the zoom-in action in the zoom tool, registered alongside the existing Alt+= mapping. No behavioral or control-flow changes were made.

Changes

Cohort / File(s) Summary
Keyboard Shortcut Configuration
code/core/src/manager/components/preview/tools/zoom.tsx
Added an alternative keyboard shortcut (Alt+Plus) that triggers the existing zoomIn action alongside the existing Alt+= mapping; no other logic changed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad7b69d and 956e722.

📒 Files selected for processing (1)
  • code/core/src/manager/components/preview/tools/zoom.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • code/core/src/manager/components/preview/tools/zoom.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: normal-generated
  • GitHub Check: nx

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
code/core/src/manager/components/preview/tools/zoom.tsx (1)

193-204: Use unique actionName values for the two zoom-in shortcuts; currently both use 'zoomIn' and the second registration will overwrite the first.

Based on the shortcut registration pattern (key format: ${addon}-${actionName}), both calls with actionName: 'zoomIn' create the same key zoom-zoomIn, causing the second call to overwrite the first. This means only the ['alt', '+'] shortcut will be functional; ['alt', '='] will be ignored.

Rename one to 'zoomInEquals' and the other to 'zoomInPlus' to ensure both shortcuts are registered independently.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 200bad8 and ad7b69d.

📒 Files selected for processing (1)
  • code/core/src/manager/components/preview/tools/zoom.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,ts,tsx,json,md,html,css,scss}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Format code using Prettier with yarn prettier --write <file>

Files:

  • code/core/src/manager/components/preview/tools/zoom.tsx
**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Run ESLint checks using yarn lint:js:cmd <file> or the full command cross-env NODE_ENV=production eslint --cache --cache-location=../.cache/eslint --ext .js,.jsx,.json,.html,.ts,.tsx,.mjs --report-unused-disable-directives to fix linting errors before committing

Files:

  • code/core/src/manager/components/preview/tools/zoom.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Enable TypeScript strict mode across all packages

Files:

  • code/core/src/manager/components/preview/tools/zoom.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx,js,jsx}: Export functions from modules if they need to be tested
Do not use console.log, console.warn, or console.error directly unless in isolated files where importing loggers would significantly increase bundle size

Files:

  • code/core/src/manager/components/preview/tools/zoom.tsx
code/{core,lib,addons,builders,frameworks,presets}/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use logger from storybook/internal/node-logger for server-side logging in Node.js code

Files:

  • code/core/src/manager/components/preview/tools/zoom.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: normal-generated
  • GitHub Check: nx
  • GitHub Check: get-parameters
  • GitHub Check: get-branch

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@storybook-app-bot
Copy link
Copy Markdown

storybook-app-bot Bot commented Jan 16, 2026

Package Benchmarks

Commit: 6587802, ran on 16 January 2026 at 15:53:28 UTC

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

@storybook/cli

Before After Difference
Dependency count 183 183 0
Self size 775 KB 775 KB 🚨 +139 B 🚨
Dependency size 67.38 MB 67.45 MB 🚨 +68 KB 🚨
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 176 176 0
Self size 30 KB 30 KB 🎉 -4 B 🎉
Dependency size 65.95 MB 66.02 MB 🚨 +68 KB 🚨
Bundle Size Analyzer Link Link

Comment on lines +199 to +204
api.setAddonShortcut('zoom', {
label: 'Zoom in',
defaultShortcut: ['alt', '+'],
actionName: 'zoomIn',
action: zoomIn,
});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you verify this works? I would thing this is going to override the existing zoomIn action. You should probably give it an alternative name, such as zoomInAlt. Do not that it will then show up twice in the keyboard shortcuts table.

Copy link
Copy Markdown
Member Author

@ndelangen ndelangen Jan 16, 2026

Choose a reason for hiding this comment

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

I THINK it tried both, but now you're making me second guess myself, I'll re-test it locally!

Yup, good catch! I'll change it, so they both work.
I tried looking for a way for a single "action" to be linked to multiple keyboard-shortcuts, but that's not allowed by the system we have, and this is not the right time to be changing that significantly.

@ndelangen ndelangen requested a review from ghengeveld January 16, 2026 15:37
@ndelangen ndelangen merged commit 78877aa into next Jan 16, 2026
121 of 124 checks passed
@ndelangen ndelangen deleted the norbert/keyboard-plus-zoom branch January 16, 2026 16:14
@github-actions github-actions Bot mentioned this pull request Jan 16, 2026
10 tasks
@shilman shilman added the a11y: keyboard Accessibility issues related to keyboard navigation or shortcuts label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y: keyboard Accessibility issues related to keyboard navigation or shortcuts a11y: zoom Accessibility issues related to typography size and zoom features ci:normal feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants