test(ui): re-pin the transcript rhythm contract in one file - #3437
Closed
Astro-Han wants to merge 1 commit into
Closed
test(ui): re-pin the transcript rhythm contract in one file#3437Astro-Han wants to merge 1 commit into
Astro-Han wants to merge 1 commit into
Conversation
styles.css told readers the "compact == transcript" assumption was held by `__tests__/markdown-rhythm-dom-contract.test.tsx`. That file was deleted in #2462 and its stylesheet-side sibling in #2425, so the comment has been claiming a guard that does not exist — the worst state to leave an assumption in, since the next person reads the citation and stops looking. Restore the two assertions the comment is actually about, plus the ladder order #2348 exists to protect, in ONE file. Split across two they each stayed green against the half they could not see, which is how the stylesheet half got deleted without anything noticing: - the ladder is declared on the --space-* scale in strictly increasing order (retuning a rung is a design call and stays green; list gaps meeting block gaps fails) - every rung declared is actually spent by a rule, so the ladder cannot become decoration while literals do the spacing - the runtime hooks the selectors need are really emitted by MarkdownBody — data-maka-contract, data-density, astryx-markdown-heading, data-level, astryx-list-item. These names have a single upstream owner in Astryx and appear in Maka only inside selectors, so a rename kills every rule at once with nothing failing - compact markdown still has exactly one caller, which is the bet the comment names: the table carries heading TYPOGRAPHY on a density key, and Astryx's own RFC says density must not do that Why these are not what #2425/#2462 retired. Those PRs removed markup/copy pins, duplicate presentation assertions and CSS-structure suites that asserted how a rule was written. Nothing here asserts an appearance or a rule's shape: three of the four are relations that must survive any retune, and the fourth renders the real component and checks the join between Astryx's output and Maka's selectors. Deliberately left unpinned, because they ARE how the table is written: the adjacent-sibling gap form, the `hr` rung, the ListItem padding reset, and the two heading size tiers. The stylesheet-reading half no longer revives the deleted desktop css-test-helpers module or the renderer-wide CSS aggregate it read; it reads packages/ui/src/styles.css directly, in the package that owns it. Seven mutations, each verified to fail the assertion that describes it: inverting the ladder; taking a rung off the --space-* grid; hardcoding a rung's usage; hardcoding it while naming the rung in a comment (this is why comments are stripped first); renaming the contract wrapper; cutting density off before it reaches Astryx; and adding a second compact caller. Also state in the comment what the contract does and does not hold, so the next reader does not have to open the test to find out. Generated-by: Claude Code
Contributor
Author
|
Folded into #3436 — the retune and the guard that makes it reviewable ship as one intent, per review feedback. Branch deleted; the commit is preserved verbatim there. |
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
packages/ui/src/styles.csstold readers that the "compact == transcript" assumption was held bypackages/ui/src/__tests__/markdown-rhythm-dom-contract.test.tsx. That file was deleted in #2462 and its stylesheet-side sibling (apps/desktop/src/main/__tests__/markdown-rhythm-contract.test.ts) in #2425, so the comment has been citing a guard that does not exist — the worst state to leave an assumption in, because the next person reads the citation and stops looking.This restores the two assertions the comment is actually about, plus the ladder order #2348 exists to protect, in one file. Split across two they each stayed green against the half they could not see, which is how the stylesheet half got deleted without anything noticing.
Pinned:
--space-*scale in strictly increasing order — retuning a rung is a design call and stays green; list gaps meeting block gaps failsMarkdownBody(data-maka-contract,data-density,astryx-markdown-heading,data-level,astryx-list-item). These names have a single upstream owner in Astryx and appear in Maka only inside selectors, so a rename kills every rule at once with nothing failingDeliberately not pinned, because they are how the table is written rather than what it promises: the adjacent-sibling gap form, the
hrrung, the ListItem padding reset, and the two heading size tiers. The comment now says so, so the next reader does not have to open the test to find out.Why this is not what #2425 / #2462 retired
Those PRs removed markup/copy pins, duplicate presentation assertions, and CSS-structure suites that asserted how a rule was written. Nothing here asserts an appearance or a rule's shape: three of the four assertions are relations that must survive any retune, and the fourth renders the real component and checks the join between Astryx's output and Maka's selectors.
The stylesheet-reading half does not revive the deleted
css-test-helpersmodule or the renderer-wide CSS aggregate it read — it readspackages/ui/src/styles.cssdirectly, in the package that owns it.Refs #2348, #2425, #2462
Verification
Seven mutations, each verified to fail the assertion that describes it and pass again on restore:
--md-gap-list: var(--space-4))--md-gap-block: 8px)margin-block-start: 16px)data-maka-contract="markdown"densityoff before it reaches Astryxdensity="compact"callerAlso run:
npm --workspace @maka/ui run build+ the new file undernode --test(4/4 pass),npm --workspace @maka/ui run typecheck,npm run lint,npm run format:check. Not run: the full repository suite, left to CI.AI use
Select exactly one:
Tool(s) and scope: Claude Code — read the deleted suites out of git history, chose which assertions to restore and which to drop, wrote the test and the comment correction, and ran the mutation sweep above. The scope call (restore the invariants, leave the rule-shape assertions out) was reviewed by the human contributor.
Checklist
Does this PR entail a change in behavior?