Repository navigation
design: the four shadows, from the lab's own variables - #301
Merged
Merged
Conversation
`--shRaised` IS defined in the lab — line 17, and line 20 for dark. The grep behind the claim that it wasn't looked for the variable at the start of a line, and the lab's `:root` is minified onto one. So #300 shipped the selected segment flat AND added a guard asserting it stay that way. Both are corrected here; the guard is inverted rather than deleted, so the mistake cannot return quietly. Reading the whole table turned up the second divergence, which #299 introduced: the stage panel borrowed `.raised`, and `ElevationModifier` doubled every shadow on dark. The lab's `--shPanel` keeps its ring and drops its shadow outright on dark — something no blanket rule can express. Each level now carries the lab's own pair, and `panel` becomes its own level: light dark --shPanel r1.5 y1 .04 ring only, no drop --shRaised r1 y1 .14 r1 y1 .4 --shFloat r14 y10 .24 r14 y10 .7 --shOver r32 y24 .32 r32 y24 .75 CSS blur is twice SwiftUI's shadow radius. Two more were wrong on the way past: `.overlay` sat at r24/y18/.26 against the lab's r32/y24/.32, and `.floating` computed .44 on dark where the lab asks .7. Elevation had no test coverage whatsoever. It has seven tests now, including a pixel test of the modifier itself — every value test still passes with the doubling rule in place, so the values alone could never catch its return. The segment's hover fill is recorded as the app's own: the lab gives `.seg button` no `:hover` rule at all. Gated: bun test 2309/0, tsc clean, swift test 138/0, Mac and iOS both build (CI builds neither). Twelve mutations across the tokens, the modifier and the source guards; twelve killed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SfEX6bfwCGXtThk1JRNmsE
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.
Fixes a mistake this session shipped in #300, and the divergence that finding it uncovered.
--shRaisedis defined; #300 said it wasn'tworkspace-lab.html:17—--shRaised:0 0 0 .5px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.14)workspace-lab.html:20— dark:0 0 0 .5px rgba(255,255,255,.08),0 1px 2px rgba(0,0,0,.4)The grep behind the "undefined" claim searched for the variable at the start of a line; the lab's
:rootis minified onto one. So the selected segment shipped with no ring and no drop, and a guard asserted the absence. The guard is inverted, not deleted.The table, as the lab actually defines it
--shPanel.04.raised→.1, doubled to.2on dark--shRaised.14.4.1, doubled to.2--shFloat.24.7.22, doubled to.44--shOver.32.75.26, doubled to.52CSS blur is twice SwiftUI's shadow radius.
ElevationModifier's rule — "dark grounds swallow a shadow, so it doubles there" — was wrong in both directions: it painted a shadow on dark where the lab draws none, and undershot every one the lab keeps. Each level carries its own dark value now, and the stage panel moves to apanellevel instead of borrowing a selected segment's shadow (the#299divergence).Tests
Elevation had no coverage at all. Seven tests now, including a pixel test of the modifier: every value test passes with the doubling rule still in place, so the values alone could not catch its return. That test's control assertion fails if the harness renders no shadow, so it cannot pass by measuring nothing.
Gate:
bun test2309/0 ·tscclean ·swift test138/0 · Mac + iOS both build (CI builds neither) · 12 mutations, 12 killed — including both modifier reverts.🤖 Generated with Claude Code
https://claude.ai/code/session_01SfEX6bfwCGXtThk1JRNmsE