Skip to content

[Studio UI] Add Escape key to collapse sidebar panel - #4066

Merged
idaiv merged 4 commits into
2026.xfrom
fix/sidebar-collapse-keyboard
Sep 4, 2026
Merged

[Studio UI] Add Escape key to collapse sidebar panel#4066
idaiv merged 4 commits into
2026.xfrom
fix/sidebar-collapse-keyboard

Conversation

@idaiv

@idaiv idaiv commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • Expand a sidebar tab (click or Enter)
  • Tab into the sidebar content
  • Press Escape — sidebar panel collapses

Relates to https://github.com/pimcore/product-management/issues/372

🤖 Generated with Claude Code

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>
Copilot AI balanced review requested due to automatic review settings September 2, 2026 09:38
@idaiv idaiv added the Skip Milestone Check Exempts this PR from the mandatory milestone requirement label Sep 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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 Sidebar component (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('')
}
} }
@idaiv
idaiv requested a review from vin0401 September 2, 2026 10:17
idaiv and others added 2 commits September 2, 2026 10:20
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>
@idaiv idaiv added this to the 2026.3.0 milestone Sep 2, 2026
@idaiv
idaiv requested a review from martineiber September 2, 2026 10:28
@idaiv idaiv removed the Skip Milestone Check Exempts this PR from the mandatory milestone requirement label Sep 2, 2026
@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

@idaiv
idaiv removed the request for review from martineiber September 2, 2026 10:36
@idaiv
idaiv merged commit c7498b2 into 2026.x Sep 4, 2026
2 of 3 checks passed
@idaiv
idaiv deleted the fix/sidebar-collapse-keyboard branch September 4, 2026 09:29
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants