fix(edit-content): side panel feedback — click-outside, 80% width, sidebar polish (#36631) - #36965
Conversation
…debar polish (#36631) Follow-up feedback on the Edit Content slide-in panel: - Click outside the panel now closes it through the same unsaved-changes guard as ESC and the X button. PrimeNG's `dismissible` is deliberately left off: it tears the drawer down immediately, bypassing the guard and desyncing the one-way `[visible]` binding. The mask click is matched at document level (the drawer is `appendTo="body"`) and only the frontmost stacked panel reacts. - Default panel width 70% -> 80%. - Nav collapse threshold 1800px -> 2560px: at 80% the leftover strip left only ~90px of content beside the expanded nav, so the nav stayed expanded for no benefit. - Binary field preview: the narrow-layout action buttons dropped from `z-index: 100` to `2`, matching their siblings. 100 was the only value in the lib able to paint over the form's sticky tab list (z-index 10), which carries the status chip and permissions/references. - Sidebar toggle now uses the `dock_to_left` Material Symbol instead of the two mirrored UVE SVGs. Single glyph, so the open/closed cue moved to the button's aria-label and the icon is `aria-hidden`. - Actions tab section order is now Details, Locales, Workflow. The shared bottom-border override moved to Workflow, which is last. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Claude finished @adrianjm-dotCMS's task in 3m 7s —— View job Code Review — side panel feedback (#36631)I reviewed the 10 changed files against New Issues
Resolved
The traceability questions raised in review (add click-outside to AC11, amend AC2 to 80%, confirm the icon swap and section reorder were in-scope) are for #36631 / product, not code correctness — I can't resolve those here. Nothing blocking from a code-correctness standpoint; the three Mediums are worth a look but don't gate merge. |
There was a problem hiding this comment.
Pull request overview
Refines the Edit Content side panel based on QA feedback.
Changes:
- Adds guarded click-outside closing and increases panel width to 80%.
- Updates navigation behavior, sidebar ordering/icon, and overlay stacking.
- Expands related unit tests.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
dot-side-panel-nav.service.ts |
Raises nav-collapse threshold. |
dot-side-panel-nav.service.spec.ts |
Updates threshold coverage. |
dot-file-field-preview.component.scss |
Fixes action stacking. |
dot-edit-content-sidebar.component.html |
Reorders sidebar sections. |
dot-edit-content-sidebar.component.spec.ts |
Verifies section order. |
dot-edit-content-side-panel.component.ts |
Adds guarded mask-click handling. |
dot-edit-content-side-panel.component.html |
Updates width and shadow. |
dot-edit-content-side-panel.component.spec.ts |
Tests outside-click and width behavior. |
dot-edit-content-form.component.html |
Replaces sidebar SVGs with one glyph. |
dot-edit-content-form.component.spec.ts |
Verifies the new glyph. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ibility - Refactor sidebar toggle button to use PrimeNG's `[ariaLabel]` input for better accessibility, ensuring the button's accessible name is correctly assigned to the native `<button>` element. - Update side panel buttons to follow the same accessibility pattern, replacing `[attr.aria-label]` with `[ariaLabel]` to ensure screen readers can properly identify the buttons. - Enhance tests to verify the correct aria-label assignment based on the sidebar's open/closed state and ensure that the click-outside functionality respects the active overlay state. This change improves the overall accessibility of the edit content interface, aligning with best practices for ARIA attributes.
Parent Issue
#36631 — the panel itself shipped in #36732; this PR addresses the review/QA feedback on top of it.
What changed
1. Click outside closes the panel (through the unsaved-changes guard)
Clicking the area behind the panel now behaves exactly like ESC and the X button: it routes through the editor's unsaved-changes guard, so a dirty form prompts and "Keep editing" cancels the close.
PrimeNG's own
dismissibleis deliberately left off — it callsclose()on mask click, which hides the drawer and emitsvisibleChange(false)immediately. That both bypasses the guard (unsaved edits lost silently) and desyncs the one-way[visible]="!!data()"binding. The mask click is matched at document level instead, sinceappendTo="body"moves the mask out of the component's subtree.Edge cases covered: a click inside the panel is ignored; a drag that starts inside and ends on the mask resolves to a different target and is ignored; with stacked panels (relationship field) only the frontmost reacts, same as ESC.
2. Default width 70% → 80%
3. Nav collapse threshold 1800px → 2560px
At 80% the leftover strip is 20% of the viewport. Against the 270px expanded nav that left ~90px of content at 1800px — a useless sliver, so the nav stayed expanded for no benefit. At 2560 the strip is ~242px.
4. Binary field preview: narrow-layout buttons no longer paint over the sticky tab bar
.dot-file-field-preview__actions--responsivewent fromz-index: 100to2, in line with its siblings (1for the wide variant,2for remove — nothing in the component needs more than 2).100was the only value in the wholeedit-contentlib able to beat the form's sticky.p-tablist(z-index: 10), which carries the status chip and the permissions/references actions. Only reproduced on narrow containers, because that is the only layout where these filled blue/red variants render.5. Sidebar toggle icon →
dock_to_leftReplaces the two mirrored UVE SVGs (
left_panel_open.svg/left_panel_close.svg) with a single Material Symbol. Since one glyph now covers both states, the open/closed cue moved to the button'saria-labeland the icon isaria-hiddenso screen readers don't announce the ligature text.6. Actions tab section order → Details, Locales, Workflow
The shared
.dot-sectionbottom-border override moved to Workflow (now last) so there is no divider dangling at the end of the tab. Persistence keys are unchanged, so each user's saved expand/collapse state carries over.Testing
Updated specs alongside each change:
dot-edit-content-side-panel.component.spec.ts— 4 new tests for click-outside (closes via guard; does not close when the guard cancels; ignored when not frontmost; ignored on a click inside), plus the width assertions.dot-side-panel-nav.service.spec.ts—setWideViewport()pinned to the 2560 threshold (the comparison is exclusive, so the boundary must count as wide; bumping the threshold fails here on purpose).dot-edit-content-form.component.spec.ts— replaced the two-SVG test with one for the singledock_to_leftglyph.dot-edit-content-sidebar.component.spec.ts— section-key order updated; noted thatqueryAllreturns DOM order, so that test guards the order too.Manual verification of the visual changes was done by the author.
🤖 Generated with Claude Code
This PR fixes: #36631
This PR fixes: #36631