[Studio UI] Add Escape key to collapse sidebar panel - #4066
Merged
Conversation
When focus is inside the sidebar content panel, pressing Escape collapses it (sets active tab to empty). Completes the sidebar keyboard accessibility alongside PR #4046 which added Enter/Space tab activation and arrow key navigation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Focus must return to the active sidebar tab before the content is hidden.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds Escape-key support for collapsing the shared sidebar content panel.
Changes:
- Handles bubbling Escape events within expanded sidebar content.
- Stops propagation and clears the active tab.
Review contract:
- Root cause/boundary: Correctly implemented in the owning
Sidebarcomponent (sidebar.tsx:170-174), covering direct and provider-backed usage. - Compatibility: No public API changes.
- Coverage/docs: No regression test or documentation update included.
- Risk: Focus remains inside content that becomes hidden after collapse (
sidebar.tsx:173).
File summaries
| File | Description |
|---|---|
assets/js/src/core/components/sidebar/sidebar.tsx |
Adds Escape-key collapse handling. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+170
to
+175
| onKeyDown={ (event) => { | ||
| if (event.key === 'Escape' && isExpanded) { | ||
| event.stopPropagation() | ||
| setActiveTab('') | ||
| } | ||
| } } |
When Escape collapses the sidebar, focus was left on the now-hidden content. Move focus to the previously active tab via rAF so the keyboard user's position continues from the sidebar navigation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
vin0401
approved these changes
Sep 3, 2026
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Summary
Test plan
Relates to https://github.com/pimcore/product-management/issues/372
🤖 Generated with Claude Code