Repository navigation
fix(textbox): the OrnateTextBox header fails AA over the warm band - #269
Conversation
`OrnateTextBox`'s title and subtitle spanned the full container above the floated image, so in the left-image layout their glyphs crossed the warm band's brightest edge. The title measured 2.47:1 against a 3:1 bar. A float only affects what follows it, so `flow-root` on the header where it stood would have done nothing: it sat above the image. The image now comes first among the `Container`'s children and the header takes the `lg:flow-root` the body already carried, which is what keeps a box out of a float's margin box whichever way the float points. Below `lg` nothing floats and source order would read image, title, body. A wrapper that is `flex flex-col` there, with `order-*` on the three children, restores title, image, body; at `lg` the wrapper is `flow-root` instead, so `order-*` goes inert and the float's height is contained. The band's own classes do not move, so the figures its comment carries stand. Refs #262 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWCTYyhbAo6PSC3jLJ
`text-base text-white/80` left the subtitle at 3.94:1 against a 4.5:1 bar even in the right-image layout, which the warm band is clear of. The root paints `text-white` already, so the subtitle needs no colour of its own. This alone takes the right-image layout — 122 of the 123 imported ornate blocks — from 3.94 to 5.12 at 1024px and clears the bar at every width. In the left-image layout it is the header's move that carries it. Refs #262 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWCTYyhbAo6PSC3jLJ
Fold the layout wrapper into the `Container` it was the only child of. The atom renders one element and appends `className`, so the flex column and the `lg:flow-root` sit on it directly: one node and one indent level fewer, for the same float containment. Extract the "class attribute containing this marker" idiom as `classFor`, beside `anchorFor` in the shared markup helpers. It was hand-rolled seven times across two specs, in two spellings, and the empty-string hazard that makes `not.toContain` pass vacuously is now stated once, where `anchorFor` already states it. Fold the two assertions that duplicated an existing test's render into that test, and cut the comment prose the class lists already show. The measured contrast figures are unchanged, cell for cell, at all seven widths in both alignments. Refs #262 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWCTYyhbAo6PSC3jLJ
A marker `renderToStaticMarkup` never emitted indexes as -1, which is less than every other index, so the source-order assertions held whether or not the float class was there at all. The `subtitle` prop's JSDoc still described the alpha this branch removed, which reads as an instruction to put it back. Refs #262 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWCTYyhbAo6PSC3jLJ
Refs #262 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWCTYyhbAo6PSC3jLJ
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is the size of its ticket: a CSS-only reorder on order-* and flow-root, no runtime code, no dependency, no contract surface. The classFor extraction lands in files this PR already edits, so the join rule holds it.
The before table is internally implausible. At 1024px s0's subtitle reads 4.73 while the opaque title 40px above it in the same header reads 2.63. Text at 80% alpha cannot beat opaque text over one backdrop. The after figures are cross-validated — s1's 5.12 / 5.42 / 5.95 reproduce #262's predicted alpha-dropped cells exactly — so the outcome holds. The flagged before rows measure something else.
sidetext ships an English literal. OrnateTextBox.tsx:104 defaults it to 'Ancient Wisdom' and RichText/blockConverters.tsx:171 passes none, so all 123 ornate blocks render it untranslated. no-restricted-syntax selects JSXText and copy props, so a default parameter reaching {sidetext} is invisible to it.
Findings
consider—docs/rules/testing.md:70states a rule twoHeader.test.tsxsites already break (thread).consider—OrnateTextBox.test.tsx:130anchors on the class adjacency that rule forbids (thread).
What was checked
#262's Approach and its seven criteria. OrnateTextBox.tsx whole, both specs, markup.ts, eslint.config.js, and Container.tsx, which sets no display class, so both flex and lg:flow-root apply.
Ladder on the one new piece: tests/_helpers/ holds no sibling, and DOMParser needs jsdom this lane opts out of, so classFor earns its place across eleven calls. The file-as-a-whole pass found the sidetext literal, and nothing more.
git merge-tree origin/main is clean; #265's no-array-index-key disable survives it. No server/, payload-types.ts or embed surface, and no preview link beyond a Ladle story path.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | 4822524 | Commit Preview URL Branch Preview URL |
Nov 19 2026, 03:48 AM |
`classFor` matched its marker as a substring of the class attribute, so `order-1` also took `order-10`, and the subtitle — which carries no class naming it alone — was keyed on `mt-2 text-base`, the adjacency the rule this PR adds forbids. It now matches a whole class, which makes an adjacency marker answer the empty string rather than a class list. `classOf` takes the element itself, by its opening tag or by a run of its own text, the way `anchorFor` takes the href the test passed in. `classesWith` answers every such list, so a count is assertable without pairing two classes to dodge a substring. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjV3aja4zoxGk2YCve3
Nothing does. The rule cited `prettier-plugin-tailwindcss`, which this repo does not install — `perfectionist` sorts JSX props, not the classes inside one. The hazard is real either way: any edit to a class list reorders it, so an adjacency breaks. The line now says that, and names the element-keyed primitive for an element no single class identifies. Header's seven hand-rolled matches move onto those primitives. Two were anchored on the adjacency the rule forbids; the rest re-derived the same `<nav class="…">` narrowing five times. The `opacity-0 invisible` pair goes with them: it paired two classes only because a substring match reached `after:opacity-0`, which a whole-class match does not. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjV3aja4zoxGk2YCve3
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Revision
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | 4822524 | Commit Preview URL Branch Preview URL |
Nov 19 2026, 03:48 AM |
`order-*` moved the header above the image for the eye and never for a screen reader, which reads source order: image alt, then title, subtitle, body. The float forced that split, because a float only moves what follows it, so the header could only share the text column by coming after the image. Two grid columns remove the choice. Source order is title, subtitle, image, body, and it is the reading order at every width — below `lg` as ordinary block flow, at `lg` as explicit row and column placement. Placement is explicit because auto-placement would follow source order, which is the one thing this layout must not do. The composition is unchanged: measured at the seven widths, every title clears 3:1, every subtitle 4.5:1 and every body cell the 5.19:1 floor #263 set, reproducing the float's figures. At 1440px the header is 391px wide, the body column's own width, and at 390px the painted order is title, subtitle, image, body with the header at the full content width. Answers the reading-order question thread on #269 — option C (Ardnived). Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWeWiKL7xNtsm4C7Pt
Revision
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
`sidetext` defaulted to `'Ancient Wisdom'` in a default parameter, and the block converter passes none, so all 123 ornate blocks rendered that English word on every locale. `no-restricted-syntax` selects `JSXText` and copy props, so a default parameter reaching the markup was invisible to it. The label now reads `blocks.general.wisdom_sidetext`. `??` rather than `||`, so an explicit empty string still suppresses the decoration rather than falling through to the translation. The two generated files carry the key by hand, because neither generator can see a key that is not on SahajCloud's `main` yet: sydevs/SahajCloud#1218 adds it, and the contract sync re-derives `server/payload-types.ts` when that merges. Answers the sidetext question thread on #269 — option B (Ardnived). Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXXxqsPdZ6LuTSTsiY
Revision
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
…skip-link-nav-names Both sides replaced the same hand-written `<nav class="([^"]*)"` regexes in Header.test.tsx with a shared helper, so every hunk was one intent spelled twice. `main` (#269) is the stronger spelling: its `classOf` keys on a marker rather than a tag name, and it splits a class list before asserting membership, which `toContain` over the string does not do — `opacity-0` passes on `after:opacity-0`. So the test takes main's side, and `tests/_helpers/markup.ts` keeps main's four primitives plus this branch's `openTag`, which answers a whole opening tag and is the only one that can carry an assertion about an attribute other than `class` (Dropdown's `aria-expanded`, Heading's `text-lg`). PageTemplate's two `classOf` calls move to the marker signature. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXUht6jJ9xQcVoDYA3
`pnpm types:cms` re-derives this file from SahajCloud `main`, and `blocks.general.wisdom_sidetext` is not there yet: sydevs/SahajCloud#1218 declares it and is still open. #269 typed the key into this file and into `lib/translations.en.json` by hand for exactly that reason, and said so. This sync fired on an unrelated producer merge (SahajCloud#1208, the table-of-contents `occurrence` field) and took the hand-typed entry with it, so `OrnateTextBox` and three specs stopped compiling against `TranslationKey`. The entry is restored verbatim, now carrying a comment naming the blocker, because nothing else in the file says a line of it was typed rather than generated. The sync's own content is untouched: `occurrence` and `common.a11y.menu` land as generated. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYZUupj9Z7JP7GfoSx
main's only textual conflict was blockConverters.test.tsx's import block. main dropped `enT`, because #269 removed the ornate sidetext its one caller asserted. This branch widened the markup-helper import beside it. Both are kept: the helpers stay, `enT` goes, and nothing in the merged file reads it. The silent conflict was in lib/content-blocks.ts. main (#294) deleted the hand-written `*BlockFields` interfaces and moved every consumer to the generated `*Block` types, while this branch added `splashTitle` over `Pick<SplashBlockFields, 'layout' | 'title'>`. git merged both cleanly into a file naming a type that no longer exists. `splashTitle` now takes `Pick<SplashBlock, 'layout' | 'title'>`, the same move main made for `splashSurface` and `getLeadSplash`. The generated interface carries both fields with the same union, so the behaviour is unchanged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVNeCVXMGgzzZjZ4n9
Summary
lgthe component is two grid columns: the header and the body share the column beside the image, clear of the warm band's bright edge in both alignments.order-*reorder are gone — a screen reader reads source order, whichorder-*never changes.text-white/80; the root already paints white.blocks.general.wisdom_sidetextinstead of an English default parameter, so it is translated. Blocked on feat(translations): declare a key's English in the schema, reconciled on boot SahajCloud#1218, which adds the key.order-1no longer takesorder-10.Header.test.tsx's seven hand-rolled matches move onto the primitives.Change outline
Components — one order for the eye and the screen reader
A float only affects what follows it, so the header could share the text column only by coming after the image in source order. That is what
order-*was undoing, and it undoes it only visually. Two grid columns remove the conflict: placement is a property of the box, not of its position in the document.Below
lgtheContaineris ordinary block flow, so the three children stack in the order they are written. Atlgplacement is explicit on all three, because grid auto-placement follows source order — the one thing this layout must not do. Thelg:gap-x-12is the gutter the image's ownlg:mr-12used to hold, and the 44% column the width itslg:w-[44%]used to set, so the composition is unchanged.RichText/blockConverters.test.tsxasserted the image side throughlg:float-right. It reads the grid's column pair now.Copy — the side label stops being English
All 123 ornate blocks render this label, and
blockConverters.tsx'ssidePropspasses none — so every locale showed the English word.The key does not exist upstream yet, and neither generator can see one that is not on SahajCloud's
main, so this branch types both entries in by hand:server/payload-types.ts(whichTranslationKeyis derived from, sotscis the first gate) andlib/translations.en.json(whichtests/guards/translation-keys.test.tsrequires populated, because a missing key renders as its own path). sydevs/SahajCloud#1218 adds the schema key, the seed value and the data migration; the dispatcher's contract sync re-derivesserver/payload-types.tson this PR when it merges.Files — one vocabulary, not fourteen hand-rolled matches
OrnateTextBox.test.tsx,layouts/tailwind.test.tsandHeader.test.tsxhand-rolled the same narrowing fourteen times in three spellings. Each class is matched whole, soopacity-0no longer reachesafter:opacity-0andorder-1no longer reachesorder-10— the two tests that paired classes to dodge that are now single-class assertions.Nothing in this repo sorts a class list: there is no
prettier-plugin-tailwindcsshere, andperfectionistsorts JSX props rather than the classes inside one. The hazard is still real — any edit to a list reorders it — somax-w-3xl flex-1is still the wrong key, andclassOfis the right one where no single class names the element.docs/rules/testing.mdnow says that instead.Preview
The change is visible only in the playground:
/?story=organisms--ornate-text-box&mode=preview— all four sections. s1 is the right-image layout, which is 122 of the 123 imported ornate blocks (fix(textbox): the ornate treatment ignores a right-image choice #198); s2 is the only one shipping a subtitle. The vertical side label on the right edge of each section now comes fromlib/translations.en.json, which is the fixture Ladle renders with, so it still readsAncient Wisdomthere.Cloudflare posts a fresh commit preview for
wemeditate-webandwemeditate-designonce the builds for this push finish.Test results
.claude/skills/pr-prep/check.sh— lint,tsc --noEmit,vitest run(125 files, 1190 tests), onorigin/mainmerged incomponents/organisms/OrnateTextBox,components/organisms/RichText,components/organisms/Header,layouts/tailwind.test.ts,tests/guards/translation-keys.test.ts,tests/guards/jsx-literals.test.tsserver/payload-types.tsmatching^server/; the added line is one optional field on a generated interface, and the string it names is rendered as JSX text content.build,serveror Wrangler changed in a way the bundle sees; CI builds both previewsEach new assertion was watched failing against a mutation before it was kept: the column pair collapsed to
lg:grid-cols-2, anorder-1put back on the header,??swapped for||(which fails the empty-label case), and the mirror entry removed (which fails the translation-keys guard).Manual verification
lgand above: the title and subtitle sit beside the image, in the column opposite it, in both alignments.order-*anywhere in the component.lgand at mobile width. Its classes are unchanged.Ancient Wisdom.Notes for reviewer
main, the two generated entries here are hand-typed rather than generated, and nothing re-derives them. Both threads this PR asked are now answered and resolved: option C for the reading order (6369cfe) and option B for the side label (4822524). fix(textbox): the OrnateTextBox header fails AA over the warm band #262 carries both as review criteria.lib/translations.en.jsonby hand, whichAGENTS.mdsays never to do. The rule assumes the key is already on SahajCloud'smain, and the producer-first sequence it prescribes cannot be followed in one sitting:pnpm sync:translationsreads a live SahajCloud, so the mirror is only regenerable after #1218 merges, deploys and is seeded. feat(components): add a mobile menu, and make the compact bar the phone's header #283 took the same hand edit for the same reason. The guide does not record that exception, and this run did not add it — a write to a repo-instruction file was refused in an unattended session, so it is flagged here rather than made. Worth one line inAGENTS.mdif you agree it is the sanctioned path.tests/guards/theme-utilities.test.tsmatches the literalclassNameanywhere in a non-spec.ts, so a helper that only reads a class list fails it by naming a parameterclassName. The parameter iscssClass, and the guard now says so.layouts/tailwind.test.tscannot reach any of this: itscontrast()helper takes two opaque hex values and does no alpha compositing, so it cannot express a ground + graphic + band stack. The guard is the measurement below, as in fix(textbox): body text sits 0.07 above the AA bar at lg #263.6369cfe, before the side-label commit. That commit changes no class and no laid-out box — the label isaria-hiddendecoration outside SC 1.4.3, as fix(textbox): the OrnateTextBox header fails AA over the warm band #262's Approach records — so the figures stand.text-whiteon the root,text-whiteon the body wrapper,text-white/75on the decorative sidetext). Onsurface-darkboth--surface-fgand--surface-fg-mutedresolve to#fff, so routing them through the token is a rename with no rendered change — it could not have fixed this bug. It would have made it unwritable, though, which is the argument for the follow-up the ticket's Notes describe.Measured contrast, before and after
Method as #205's and #263's checklist — headless Chromium,
deviceScaleFactor1, viewport height 800,pnpm ladle:buildserved statically, storyorganisms--ornate-text-boxat?mode=preview, full-page capture, the measured text hidden, 50 columns × 13 rows per sample box, the text colour composited over each sample, worst taken — with the same one change #262 records: the sample boxes are the text's own line boxes fromRange.getClientRects(), not the element box.s0, s2 and s3 are the left-image layout; s1 is the right-image layout. Sections 0, 1 and 3 ship no subtitle, so a clone of section 2's was appended to the same header before measuring, leaving the geometry the component's own. A bold cell is below its bar.
Before,
mainate868c42:After, the grid at
6369cfe— title against 3:1, subtitle against 4.5:1:Body copy, against the 5.19:1 floor #263 set — unchanged where the layout did not move it, and never below the floor:
The right-image layout's title is identical before and after, which is the expected control: the band was already clear of the header there, and the header's left-aligned text was already over the body column's ground.
The grid reproduces the float's own after figures to within 0.4 on every cell, which is the second control: the two layouts differ in how the boxes are placed, not in where they land.
The rendered order and the box geometry were read from the live layout rather than eyeballed. At 390px, 768px and 1023px every section paints title, subtitle, image, body with the header at the full content width, and the
Container's computeddisplayisblock. At 1440px the header and the body both sit at x=681 and measure 391px — the text column's own width — with the image at x=288 and 345px wide, mirrored to x=727 underalign="right". In every case the DOM order is header, image, body.Rejected alternative
The ticket's fallback — leaving the DOM alone and sizing the header to the body column with
lg:w-[calc(56%-3rem)]and an auto margin — was not built. A block before a float is not moved beside it, so the header would have kept a full row of its own above the image, with the top-left of the block empty. It states the column geometry a second time, as the ticket notes, and it leaves the float in place, which is what forced the source order the reviewer rejected.Closes #262
Generated by Claude Code