Skip to content

fix: modals dim the page behind them instead of covering it in black - #544

Merged
kikootwo merged 2 commits into
mainfrom
fix/539-modal-backdrop
Nov 2, 2026
Merged

kikootwo merged 2 commits into
mainfrom
fix/539-modal-backdrop

Conversation

@kikootwo

@kikootwo kikootwo commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Summary

Every modal opened over a solid black page. Tailwind v4 has no bg-opacity-* utilities, so bg-black bg-opacity-50 compiled to plain bg-black and the backdrop hid everything behind the dialog. The same removal made the admin request actions menu ring (ring-black ring-opacity-5) draw at full strength.

The backdrops now use the slash form (bg-black/50), so the page shows through dimmed, and the menu ring uses ring-black/5. A test fails if any of the removed *-opacity-<n> utilities comes back under src.

Changes

  • bg-black bg-opacity-50 to bg-black/50 in src/components/ui/Modal.tsx (the shared modal), src/app/admin/jobs/page.tsx (both dialogs), src/app/admin/users/page.tsx (Edit User Role), src/app/admin/settings/tabs/NotificationsTab/NotificationsTab.tsx and src/components/bookdate/RecommendationCard.tsx. Nothing else on those lines changed.
  • ring-black ring-opacity-5 to ring-black/5 in src/app/admin/components/RequestActionsDropdown.tsx.
  • tests/components/tailwind-opacity-utilities.test.ts (new): reads every .ts, .tsx and .css file under src and fails on bg|text|border|divide|ring|placeholder-opacity-<n> (or an arbitrary [...] value); a second case checks the pattern catches the removed forms and leaves bg-black/50, opacity-0, group-hover:opacity-100 and transition-opacity alone.
  • e2e/specs/regressions/539-modal-backdrop.spec.ts (new): reads the computed backdrop colour of the shared Modal (Profile, Add Shelf, Hardcover tab, 1280 px light) and the admin Users Edit User Role dialog (375 px dark) and expects alpha 0.5.
  • Docs: frontend/components.md (Modal backdrop), testing/e2e-harness.md (spec table).

Tests

  • tests/components/tailwind-opacity-utilities.test.ts: 2 tests. Fails on main: with the six source files at 1af0e12 the scan case fails, listing all 7 uses (6 bg-opacity-50, 1 ring-opacity-5); the pattern case passes (1 failed, 1 passed).
  • e2e/specs/regressions/539-modal-backdrop.spec.ts: on the main image (aa3841f) both backdrops read alpha 1 and the spec fails; on this branch both read 0.5 and it passes.

Screenshots

The shared modal (Add Shelf) at 1280 px. Before, the page behind is solid black:

Add Shelf before

After, the page shows through, dimmed:

Add Shelf after

The admin Users role dialog at 375 px in dark mode, before and after:

Users dialog before, 375 px dark

Users dialog after, 375 px dark

Checks

  • npm run test: 471 files, 9210 passed, 7 skipped.
  • The guard test plus the test files of the changed components (Modal, admin users, admin jobs, admin settings, RecommendationCard, RequestActionsDropdown): 7 files, 36 tests passed.
  • npx tsc --noEmit: clean.
  • npx eslint on the changed files: the same 13 errors and 10 warnings as main, all on untouched lines; the new test file is clean.
  • App image: built from this branch (dockerfile.unified) by the E2E harness.
  • E2E harness on the built image: smoke and regressions/539-modal-backdrop passed, 2 of 2.

Risk and rollback

Low. Class names only: six backdrops and one ring change colour, nothing changes layout or behaviour. Rollback is a revert of this PR; there is no migration.

Closes #539

🤖 Generated with Claude Code

kikootwo and others added 2 commits November 2, 2026 12:54
Tailwind v4 has no bg-opacity-* or ring-opacity-* utilities, so
`bg-black bg-opacity-50` drew a solid black backdrop and the Request
actions menu ring drew at full strength. Use the slash forms
(bg-black/50, ring-black/5) and add a test that fails on any
*-opacity-<n> utility under src.

Closes #539

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kikootwo
kikootwo marked this pull request as ready for review November 2, 2026 18:59
@kikootwo
kikootwo merged commit 0971d8e into main Nov 2, 2026
1 check passed
@kikootwo
kikootwo deleted the fix/539-modal-backdrop branch November 2, 2026 18:59
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.

Modal backdrops are solid black instead of dimmed

1 participant