Skip to content

fix(canvas): give the Add card picker a backdrop scrim (#872) - #885

Merged
h4yfans merged 2 commits into
mainfrom
canvas-add-card-dialog-scrim
Jul 22, 2026
Merged

fix(canvas): give the Add card picker a backdrop scrim (#872)#885
h4yfans merged 2 commits into
mainfrom
canvas-add-card-dialog-scrim

Conversation

@h4yfans

@h4yfans h4yfans commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #872 — the canvas Add card picker rendered without a dimmed backdrop, so the canvas behind it stayed at full contrast and the dialog read as floating rather than modal.

Root cause: cmdk 1.1.1's Command.Dialog spreads className onto the cmdk root (inside Dialog.Content) and routes the Radix parts through separate overlayClassName / contentClassName props — confirmed in the shipped bundle:

React.createElement(Dialog.Overlay, { "cmdk-overlay": "", className: overlayClassName })

So the overlay was rendering with an empty className and nothing was styling it. The dialog was already functionally modal via Radix; this was purely visual.

The fix routes the scrim through overlayClassName with the same bg-black/50 the command palette uses. Positioning and DOM structure are untouched — Radix renders Overlay before Content, so the panel still paints above it.

Also on this branch:

  • A red-first renderer test asserting [cmdk-overlay] carries the scrim class.
  • One clause in apps/docs/src/user-guide/canvas/cards-and-links.md (the docs gate flagged the file): the picker opens over a dimmed canvas, Esc or outside-click dismisses. Both are existing Radix defaults, not new behavior.

Release note

The canvas "Add card" picker now dims the canvas behind it, matching the search palette.

Test plan

  • vitest --project renderer canvas-add-card-dialog.test.tsxPASS 12 / FAIL 0 (new test failed first with expected '' to contain 'bg-black/50')
  • pnpm --filter @memry/desktop typecheck:web → clean
  • eslint on both touched files → only pre-existing set-state-in-effect warnings on the untouched effects (lines 49–53, 65–68)
  • prettier --check → clean
  • pnpm docs:impact --base origin/main --strictcovered
  • pnpm docs:build → complete

Not manually verified in the running app — the change is one Tailwind class on the Radix overlay, covered by the DOM assertion.

h4yfans added 2 commits July 22, 2026 23:32
cmdk puts Command.Dialog's className on the cmdk root, so nothing was
styling the Radix overlay and the canvas behind the picker stayed at full
contrast. Route the scrim through overlayClassName with the same bg-black/50
the command palette uses.
Copilot AI review requested due to automatic review settings July 22, 2026 20:38
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/kaan94karaca-5848s-projects?upgradeToPro=build-rate-limit

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@h4yfans
h4yfans marked this pull request as ready for review July 22, 2026 20:38
@h4yfans
h4yfans merged commit 4989be8 into main Jul 22, 2026
14 of 17 checks passed
@github-actions github-actions Bot added bug Something isn't working documentation Improvements or additions to documentation test labels Jul 22, 2026
@github-actions

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit a304b8e.

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Canvas "Add card": picker dialog has no backdrop scrim

2 participants