Skip to content

fix(palette): clip the panel to its own rounded corners - #415

Merged
umputun merged 1 commit into
masterfrom
fix/palette-corner-clip
Aug 9, 2026
Merged

fix(palette): clip the panel to its own rounded corners#415
umputun merged 1 commit into
masterfrom
fix/palette-corner-clip

Conversation

@umputun

@umputun umputun commented Aug 9, 2026

Copy link
Copy Markdown
Owner

the palette panel drew a RoundedRectangle(cornerRadius: 12) background and a radius-12 stroked overlay but never clipped to either, so a selected row was free to fill its full square bounds. When the selection sat on the bottom row, Color.accentColor.opacity(0.25) painted straight over the corner arc and squared it off.

results is the panel VStack's last child with no bottom padding, and its .frame(maxHeight:) always fills, so the scroll bottom edge is the panel bottom edge. The pick free-text path shows it every time: when nothing matches, filtered becomes one synthetic row that is always both selected and last.

fix is the chain the rest of the app already uses - background, clip, stroke, shadow - as at WindowContentView.swift:568, WindowContentView+Detail.swift:218 and DashboardView.swift:128. Palette.swift was that chain with the clip line missing. It covers both mount points, the command palette and caller-supplied pickers, and any future filled content that reaches a corner.

Rounding the row background instead would not fix it. A radius-6 row corner still sits outside a radius-12 panel arc unless the panel also gains padding, which is what SessionSwitcher does with its 6pt inset - a different look, not a fix for this.

one accepted side effect: the overlay scroller's bottom tip is now shaved by the corner radius. That is what clipping does.

not verified visually - SwiftUI views do not render in hosted tests and there are no snapshot tests, so this rests on the modifier chain and the three sites it copies. Worth an eyeball on key-repeat scrolling under translucency, since Palette.swift:281-283 records an earlier compositing flash in this view (its cause, an animated center-anchored scrollTo, was removed).

Fix #409

Copilot AI lite review requested due to automatic review settings August 9, 2026 18:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes the command palette/picker panel so its content is clipped to the same rounded rectangle that is already drawn as the panel’s background and outline, preventing selected-row fills from squaring off the bottom corners (Fix #409).

Changes:

  • Add a .clipShape(RoundedRectangle(cornerRadius: 12)) to the palette panel modifier chain between the background and stroke/shadow.
  • Document why the clip is required and why it must appear before .shadow in the modifier order.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@umputun
umputun force-pushed the fix/palette-corner-clip branch from c32b320 to 1b4363c Compare August 9, 2026 18:35
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 9, 2026

Copy link
Copy Markdown

Deploying agterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7c03e40
Status: ✅  Deploy successful!
Preview URL: https://6aecdc81.agterm.pages.dev
Branch Preview URL: https://fix-palette-corner-clip.agterm.pages.dev

View logs

The panel drew a radius-12 background and a radius-12 stroke but never clipped to
either, so a selected bottom row filled its full square bounds and painted over
the corner arc. The same panel backs every palette mode and every caller-supplied
picker, where an unmatched --allow-custom query leaves one synthetic row that is
always both selected and last.

Uses the chain already shared by the quick terminal, the overlay panel, and the
dashboard cells: background, clip, stroke, shadow.

Fix #409
@umputun
umputun force-pushed the fix/palette-corner-clip branch from 1b4363c to 7c03e40 Compare August 9, 2026 18:42
@umputun
umputun merged commit 210b1fe into master Aug 9, 2026
8 checks passed
@umputun
umputun deleted the fix/palette-corner-clip branch August 9, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Command palette does not clip its content to the panel's rounded corners

2 participants