Repository navigation
fix: modals dim the page behind them instead of covering it in black - #544
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every modal opened over a solid black page. Tailwind v4 has no
bg-opacity-*utilities, sobg-black bg-opacity-50compiled to plainbg-blackand 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 usesring-black/5. A test fails if any of the removed*-opacity-<n>utilities comes back undersrc.Changes
bg-black bg-opacity-50tobg-black/50insrc/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.tsxandsrc/components/bookdate/RecommendationCard.tsx. Nothing else on those lines changed.ring-black ring-opacity-5toring-black/5insrc/app/admin/components/RequestActionsDropdown.tsx.tests/components/tailwind-opacity-utilities.test.ts(new): reads every.ts,.tsxand.cssfile undersrcand fails onbg|text|border|divide|ring|placeholder-opacity-<n>(or an arbitrary[...]value); a second case checks the pattern catches the removed forms and leavesbg-black/50,opacity-0,group-hover:opacity-100andtransition-opacityalone.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.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 (6bg-opacity-50, 1ring-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:
After, the page shows through, dimmed:
The admin Users role dialog at 375 px in dark mode, before and after:
Checks
npm run test: 471 files, 9210 passed, 7 skipped.npx tsc --noEmit: clean.npx eslinton the changed files: the same 13 errors and 10 warnings as main, all on untouched lines; the new test file is clean.dockerfile.unified) by the E2E harness.smokeandregressions/539-modal-backdroppassed, 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