Skip to content

TKW: bring the repo in line with CLAUDE.md - #109

Closed
codebend3r wants to merge 51 commits into
mainfrom
claude-md-audit-fixes
Closed

codebend3r wants to merge 51 commits into
mainfrom
claude-md-audit-fixes

Conversation

@codebend3r

Copy link
Copy Markdown
Owner

Summary

  • Brings the repo in line with every CLAUDE.md rule a full audit found broken
  • Fixes real bugs the audit surfaced: tests that could never fail, untypechecked skill scripts with a runtime ReferenceError, unspaced castle prose, a reduced-motion leak, unhandled fullscreen rejections, and 104 bad house seat references
  • No cast, interface (outside module augmentation), for…of/for…in, or @ts-ignore remains in lib/, components/, app/, test/, types/, or .claude/
  • SCSS values all come from --tkw-* / --fs-* / --lh-* / --ls-* tokens

Bugs

  • content.test.ts and memoize.test.ts: .rejects now awaited; all 4 tests verified to fail when the code path breaks
  • .claude/**/*.ts added to tsconfig.json include and to the test scripts; a11y-audit/checks.ts imported lineOf it never had (runtime ReferenceError), plus 3 other type errors
  • app/castles/[slug]: prose gets the same .body grid as the other detail pages
  • WorldMap.module.scss: popBelow no longer outranks the reduced-motion guard
  • WorldMap.tsx: denied requestFullscreen / exitFullscreen caught, with tests

Content and schemas

  • Every schema is a z.strictObject; unknown frontmatter keys fail instead of being dropped
  • New SlugSchema gates houses.seat and infobox entry slugs
  • 239 houses seat: "" → seat: null; wull prose seat → null; the-arbor / the-fingers / the-paps → arbor / fingers / paps
  • Empty Seats row and "seat at ." description gone; description names the castle
  • battles.casualties and events.casualties now checked as character references
  • 86 seat slugs still point at castles not yet written; they render unlinked as before

TypeScript

  • Casts removed, incl. 60 in component tests via a shared expectElement guard in test/dom.ts
  • 11 interface → type; non-null ! in family-tree.ts replaced by a guard
  • MapMarker / TimelineChart switches exhaustively checked with never
  • Route slug params validated by lib/route-params.ts before reaching path.join
  • as const satisfies on literal tables; types derived from schemas / Collections / as const lists instead of hand-written copies
  • exhaustiveList helper keeps client-side enum lists complete without pulling zod into the browser bundle

Code style

  • Every value-producing ?. paired with ?? (~140 sites)
  • Positional helpers take one object parameter (~45 functions)
  • Booleans renamed to is / has / should / can (frontmatter keys left alone)
  • No parameter mutation in family-tree-layout, relations, prose-links; toSorted / toReversed everywhere
  • Family tree layouts and rendered prose links verified byte-identical before and after
  • useIsMobile gains a test; battles corpus tests move into content.test.ts; testNuqs moves to test/

CSS

  • New scales in globals.scss: font size, radius, line height, letter spacing, colour, motion durations and easings, house metal/ink
  • Near-duplicate values consolidated (≤1px, ≤0.05 line height, ≤40ms); notable visible changes:
    • rem-based FamilyTree, TimelineCluster, TimelineChart, SearchCombobox sizes now px tokens, so they no longer grow at the 18px mobile root
    • house words 23 → 24px; a few /design specimens shift by 1px
    • name-link color transition 120 → 150ms; menu backdrop fade 220 → 180ms
  • /design style guide reads live token values from globals.scss via lib/design-tokens.ts
  • Both :global(.subtitle) overrides replaced by module classes
  • <section> for the accordion panel; <hgroup> / <header> for detail headings
  • Unused, drifted --bp-* properties removed; globals.scss imported via @/

Tooling and docs

  • CLAUDE.md lists lint:scss, lint, lint:actions (not the nonexistent lint:css) and what system-check runs
  • Skills stop pointing at the nonexistent bun run check
  • Unregistered netlify/plugins/* removed (one called a nonexistent lint:styles)
  • lint-staged.config.mjs escapes [slug] paths before passing them to Gale, which read them as globs and failed the hook
  • test scripts pass ./ ./.claude, so bun run test <filter> now runs the whole suite; call bun test <filter> directly to filter

Not addressed

  • History on main (fface13 WIP), old PR bodies, and old folder-style branch names can't be fixed without rewriting history
  • new-content-type/audit-wiring.ts already reports 28 gaps on main; its text checks have drifted from lib/
  • Judgment calls from the audit (grid-for-toolbars, padding-as-margin, browser default margins on dl/ul) left for a separate pass

- every schema in `lib/schemas.ts` is a `z.strictObject`, so a mistyped frontmatter key fails instead of being dropped
- new `SlugSchema` gates `houses.seat` and `HouseInfoEntry.slug`; display text and `""` no longer pass
- `seat` is nullable: 239 houses move from `seat: ""` to `seat: null`
- `wull.md` seat was prose, now `null` (the location stays in the body)
- `the-arbor`, `the-fingers`, `the-paps` become `arbor`, `fingers`, `paps` to match castle slugs
- `HouseInfobox` drops the empty Seats row; house page description skips "seat at" when unknown and names the castle instead of the raw slug
- `buildRelationGraph` and `findOrphanSlugs` skip null seats
- `referenceErrors` reads `battles.casualties` and `events.casualties`
- both fields named character slugs that no rule ever checked
- `CLAUDE.md` names `lint:scss` / `lint:scss:fix`, not the nonexistent `lint:css`
- add `lint` and `lint:actions`, and spell out what `system-check` runs
- `component-scaffold`, `new-content-type`, `populate-entry` skills drop `bun run check`, which doesn't exist
- none of the five `netlify/plugins/*` is listed in `netlify.toml`, so they never ran
- `lint-styles` called `bun run lint:styles`, which doesn't exist
- CI already gates format, lint, typecheck, and test on every PR and on `main`
- weekly security audit prompt no longer points at `netlify/plugins/`
- `lib/regions.ts`: `REGION_LABELS` becomes a `Map`; `isGreatHouseSlug` guard replaces the `in` check and `keyof` cast, and ignores inherited keys like `constructor`
- `lib/prose-links.ts`: mdast `Parent` children already accept `Text`/`Link`, so the `never` casts go
- `lib/family-tree.ts`: type-guard filter narrows spouse `slug` instead of `s.slug!`
- `components/MapStage/MapStage.tsx`: unmeasured pan-zoom `value` is `null` rather than `{} as Value`
- `components/FilteredHouseList/FilteredHouseList.tsx`: `isRankFilter` checks with `some` instead of widening `RANK_FILTERS`
- `components/FamilyTreeChart/FamilyTreeChart.tsx`: `currentTarget` is already an `SVGSVGElement`
- `lib/relations.test.ts`: fixtures read `slug` from the parsed frontmatter
- `test/dom.ts`: `expectElement({ element, type })` checks `instanceof` and returns the narrowed element, throwing an `Error` that names the expected and actual types
- `test/dom.test.ts` covers HTML, SVG, subclass, mismatch, and `null` cases
- replaces every `as HTMLInputElement`/`HTMLSelectElement[]`/`HTMLButtonElement[]`/`SVGGElement`/`HTMLElement` assertion across the component tests
- `FilteredCharacterList.test.tsx` locates the list with `findIndex` and reads the portrait `img` as a plain `Element`, so neither needs narrowing
- the local `asInput` in `CharacterSearchInput.test.tsx` and the inline `instanceof` throws in `SearchCombobox.test.tsx` and `CharacterPortrait.test.tsx` give way to the shared helper
- `lib/family-tree.ts`: `TreeSpouse`, `TreeNode`
- `lib/family-tree-portraits.ts`: `EnrichedTreeSpouse`, `EnrichedTreeNode` become intersections over their bases
- `lib/family-tree-layout.ts`: `LayoutPerson`, `LayoutSpouseEdge`, `LayoutChildEdge`, `LaidOutChart`, `PlacementCtx`
- `lib/relations.ts`: `ContentSet`, `RelationGraph`
- none rely on declaration merging; the module augmentations in `react-svg-pan-zoom.d.ts` and `css-custom-properties.d.ts` stay interfaces
- `MapMarker` `Glyph` switch over `MapLayer` gains a `default` that assigns to `never`
- `TimelineChart` `ChartNode` switches on `node.kind` instead of an `if` that fell through to `single`
- `nodeKey` replaces the inline `node.kind` ternary for the React `key`, with the same `never` check
- `lib/route-params.ts`: `SlugParamsSchema` requires a kebab-case `slug`; `slugFromParams` parses the awaited `params` and calls `notFound()` on failure
- `SlugPageProps` types `params` as `Promise<unknown>` until parsed; Next's `PageProps` global needs `next typegen`, which `typecheck` and CI never run
- `lib/route-params.test.ts` covers valid slugs, traversal and malformed slugs, a missing `slug`, and the `notFound` throw
- `generateMetadata` and the page component of every `app/*/[slug]/page.tsx` read the slug through `slugFromParams`, so nothing unvalidated reaches `path.join` in `lib/content.ts`
- `app/dragons/[slug]/page.tsx` and `app/weapons/[slug]/page.tsx` drop the `fm &&` re-check on frontmatter that is never nullish
- `ageAtDeath`, `formatBattleWhen`, `buildFamilyTree`, `regionForHouse`, `filterByName`, `findPortrait`, `enrichTreeWithPortraits` take one object
- `formatLabelText`, `estimateLabelWidth`, `distance`, `midpoint` follow suit
- private `loadFile`, `ref`, `probePaths`, `rankByName`, `bestAliasRank`, `lookup` too
- `renderMarkdown` flattens `opts` into `{ source, proseLinks }`, dropping the unpaired `?.`
- `FindPortrait` mirrors the new `findPortrait` shape; test mocks match
- every call site in `app/`, `components/`, `lib/` updated
- `getScreenToViewBox` takes `{ svg, bounds }`; its `point` takes `{ clientX, clientY }`
- `TimelineExplorer`'s `zoomTo` takes `{ nextIndex, focalViewportY }`
- test helpers `renderEntry`, `stubSize`, `centeredNaturalPoint`, `d`, `findNode`, `renderWith` follow suit
- every call site updated
- `TreeNode`, `TreeSpouse`, `LayoutPerson`: `placeholder`, `external`, `inHouse` to `isPlaceholder`, `isExternal`, `isInHouse`
- `isLinkable` param, `RelationRef.linkable`, `NavItem.visible`, `memoize` `enabled` to predicate names
- `EventItem.approximate`, `HouseItem.extinct`, `DragState.captured` to `isApproximate`, `isExtinct`, `isCaptured`
- props: `Accordion` `isOpen`, `Sigil` `isDecorative`, `FiligreeFlourish` `isMirrored`, `ListSearchSkeleton` `hasControls`, `MainMenuTile` `isVisible`, `CharacterSearchInput` `hasAutocomplete`
- locals and state in `SearchCombobox`, `FilteredHouseList`, `FilteredCharacterList`, `SiteHeader`, `SiteMenu`, `TimelineMinimap`, `WorldMap`, `battle-date`, `timeline`, `prose-links`, `spoilers`, `test/stubs.ts`
- drop the always-true `handled` flag in `PortraitVariants`
- `audit-wiring` parses `isVisible` from `NAV_ITEMS`; `audit-orphans` reads it
- frontmatter keys, URL query keys, storage keys, CSS classes unchanged
- Swap widening annotations for `as const satisfies` on label, class, and bounds tables in `lib/`, `components/`, and `app/`
- Key `TYPE_NOUN` and `MATERIAL_ADJ` in `app/weapons/[slug]/page.tsx` by `Weapon["type"]` and `Weapon["material"]` instead of `string`
- Key `SiteMenu` `ART` by a new `NavHref` derived from `NAV_ITEMS`, widening to `MenuArt` at the read
- Narrow `visibleNavItems` to the `NAV_ITEMS` element type
- Accept `readonly` node arrays in `TimelineModel.columns` so `EMPTY_COLUMNS` stays literal
- Export `Loaded` from `lib/content.ts` and import it in `lib/map.ts`, `lib/relations.ts`, and `lib/family-tree.ts` instead of redeclaring it
- Make `ContentSet` a `Pick` of `Collections`
- Type `sex` as `Character["sex"]` on `TreeNode`/`TreeSpouse` and `TreeNode["sex"]` in `FamilyTree`
- Build `LayoutPerson` from a `Pick` of `EnrichedTreeNode`, `NameProps` from `TreeSpouse`, and `RelationSource` from `Character`
- Drop `VariantFile` for the identical `PortraitFile`
- Type the `d()` precision in `lib/battle-date.test.ts` as `CalendarDate["precision"]`
- Key `REGION_FILE`, each list's `REGION_CARD_CLASS`, and `REGION_PORTRAIT_CLASS` with `as const satisfies Record<RegionSlug, string>`
- Type `region` as `RegionSlug | null` on `sigilFile`, `Sigil`, and the `CharacterItem`, `DragonItem`, `WeaponItem`, and `HouseItem` view models
- Drop the unmapped-region guard in `sigilFile` and its test, since an unknown region no longer type-checks
- Derive `ViewMode`, `TreeViewMode`, and `Grouping` from `as const` arrays and check `isViewMode`/`isGrouping` against them
- Move `SortDirection` next to `SORT_DIRECTIONS` in `lib/listSearchParams.ts`, so `lib/` no longer imports a type from `SortToggle`
- Import `SortDirection` from `lib/listSearchParams.ts` in `SortToggle`, `FilteredCharacterList`, and `FilteredHouseList`
- Add `exhaustiveList` in `lib/exhaustive-list.ts`, a compile-time check that a literal list names every member of a union
- Check `ALL_CASTLE_TYPES`, `LANDMASSES`, and `RANK_FILTERS` with it, so a schema enum value they omit fails to compile
- Keep those lists literal rather than reading `.options`, since client components import them and `zod` would follow
- Derive `RankFilter` as `"all" | HouseRank` instead of re-listing the ranks
- Derive `REGION_SLUGS` from `REGIONS` instead of re-listing the slugs
- Move `PAN_DIRECTIONS` into `lib/pan-zoom.ts` as `as const satisfies Record<string, Pointer>` and derive `PanDirection` with `keyof typeof`
- Import it in `FamilyTreeChart`, `MapStage`, and `WorldMap` instead of keeping three identical copies
- Build `CharacterItem`, `DragonItem`, `WeaponItem`, `HouseItem`, and `EventItem` from a `Pick` of their schema type for `slug`, `name`, and `aliases`
- Type `renderPagination` positions as `ComponentProps<typeof ListPagination>["position"]`
- Share one `CardArgs` type between `renderCard` and the `RegionAccordion` prop in `FilteredHouseList`
- `lib/content.test.ts`: await `loadCastle`, `loadWeapon`, `loadDragon` rejection checks in async tests
- `lib/memoize.test.ts`: await the `memoize` rejection propagation check
- `WorldMap`: handle `requestFullscreen()` and `exitFullscreen()` rejections instead of leaving them floating
- `WorldMap.test.tsx`: cover a denied enter and a denied exit
- `WorldMap.test.tsx`: restore the faked Fullscreen API in `afterAll`
- `lib/timeline.ts`: default `clusterColumn`'s last group to `[]` instead of chaining through it
- `SiteMenu`, `FamilyTreeChart`, `WorldMap`: give value-producing `?.` reads a `??` fallback
- `WorldMap`: compare the popover anchor through `!!prev` instead of `prev?.x`
- Tests: `?? null` for scalar matches, `?? ""` for substring matches, `?? []` for arrays, so a missing node still fails
- `portrait-variants.test.ts`, `map.test.ts`: assert absence with `toHaveProperty` so a missing entry cannot pass
- `MapLayerToggle.test.tsx`: find checkboxes by role and name instead of chaining off a label lookup
- `lib/family-tree-layout.ts`: `placeSubtree` returns its persons and edges instead of pushing into a shared `ctx`
- `lib/family-tree-layout.ts`: `placeRow` lays siblings and roots out left to right; child edges read each child's own `centerX`
- `lib/family-tree-layout.ts`: `placeSubtree` and `placePerson` take a single object parameter; `spousePositions` reduces instead of pushing
- `lib/relations.ts`: replace `pushTo` with `slugsByKey`, grouped through `Map.groupBy`
- `lib/prose-links.ts`: `scanText` takes an object, walks `matchAll`, and returns the used keys instead of adding to a passed `Set` or resetting `lastIndex`
- `lib/prose-links.ts`: `compileIndex` groups forms with `Map.groupBy` and sorts with `toSorted`; surface-form builders return arrays instead of pushing
- Laid-out charts for every house and the rendered prose for every entry match the previous output
- `lib/regions.ts`: replace the `while` loop and mutable `seen` set with a recursive `climb` that carries a fresh set
- Replace every in-place `.sort()` and `.reverse()` in `lib/`, `components/`, and `app/`, tests included
- Drop the defensive `[...x]` copies that only existed to protect an in-place sort
- `lib/battle-date.ts`: replace the `let label` if/else-if/else chain with guard-clause returns and a `const` asterisk suffix
- Remove doc comments that repeat the name they sit on: `ScreenToViewBox.point`, `PLACEHOLDER_EXTENSION`, `groupByStem`, `dateIntegrityDefects`, `ListSearchInput`, `MainMenuTile`
- `WorldMap`: move the recentring rationale from `markerScreenPoint` onto `revealMarker`, which it describes
- `ListPagination`: `noun` is singular and pluralized with `s`, not plural
- Add `lib/useIsMobile.test.ts`, driving `useIsMobile` through a stubbed `matchMedia`
- Fold the orphan `lib/battles-content.test.ts` into `lib/content.test.ts`, which owns `loadAllBattles`, reusing `absoluteYear` instead of a local copy
- Move the `testNuqs` helper from `lib/` to `test/` beside `preload.ts` and `stubs.ts`, updating its seven importers
- `personSlotWidth`, `spousePositions`, `pairMidpoint`, `placeSpouse` take one object
- `pairMidpoint` reads the last spouse with `.at(-1)` instead of indexing
- add `.claude/**/*.ts` to `tsconfig.json` `include`; the `**/*.ts` glob skips dot-directories, so `tsgo` never saw the 14 skill scripts
- point `test`, `test:watch`, and `coverage` at `./ ./.claude`; `bun test` skips hidden directories too
- import `lineOf` into `a11y-audit/checks.ts`; `checkViewport` threw a `ReferenceError` on any locked viewport
- type the `checkImages` `flatMap` callback as `Finding[]` so `"error"` and `"warn"` severities unify
- skip optional `head.slug` / `member.slug` in `audit-portraits.ts` `inboundReferences` instead of counting `undefined`
- add `a11y-audit/checks.test.ts` for the locked-viewport path, mixed severities, and multi-finding interactions
- file table in `a11y-audit/SKILL.md` gains the co-located rule tests and notes `bun run test` runs them
- `ScanState` and `advance` moved above the JSDoc so it documents `scanCharStates` again
- Gale reads each argument as a glob, so any staged `app/*/[slug]/*.scss` matched nothing and failed the pre-commit hook
- Move the `lint-staged` config from `package.json` to `lint-staged.config.mjs` so the stylesheet task can escape `[`, `]`, `{`, `}`, `*`, `?` per path
- Script and style tasks otherwise unchanged
- `app/castles/[slug]/page.tsx` rendered the markdown `<article>` unstyled, so with `globals.scss` zeroing `p`/`h*` margins the blocks ran together
- New `app/castles/[slug]/page.module.scss` with the same `.body` grid + `gap: 20px` the other detail pages use, imported via `@/`
- `[data-placement="below"] .popover { animation-name: popBelow }` (0,2,0) outranked the reduced-motion `.popover { animation: fadeIn … }` (0,1,0), so the spring pop still ran for below-placed cards
- Reduced-motion block now targets `.popover, [data-placement] .popover`, matching the placement selector so the fade wins for every placement
- Re-checked every other `transition`/`animation` guard against its compiled selector: all already match
- `--bp-xs` … `--bp-xl` in `styles/globals.scss` had no consumer in `app/`, `components/`, `lib/`, or `styles/`
- Their values had drifted from `styles/_breakpoints.scss` (`768px` vs `767.98px`), the real source of truth
- Breakpoint comment now points only at the SCSS variables
- `app/layout.tsx` imported `../styles/globals.scss` relatively; every other stylesheet import goes through `@/`
- `PageHeading` and the house plate render their own subtitle `<p>`, so the `:global()` escape was avoidable
- `components/PageHeading/PageHeading.tsx` adds `styles.lede` beside the `subtitle` primitive; `.heading .lede` keeps the old specificity
- `app/houses/[slug]/page.tsx` adds `styles.words` for the house words; `.heading .words` replaces `:global(.subtitle)`
- No `:global()` left in `app/` or `components/`
- `components/Accordion/Accordion.tsx` panel is a `<section aria-labelledby>` instead of `<div role="region">`; same implicit `region` role and name
- `.heading` wrappers on the battle, dragon, event, house, and weapon plates are `<hgroup>`, matching `PageHeading`
- Character plate `.heading` is a `<header>`: it holds the sigil link plus the existing `hgroup.titleGroup`, which an `<hgroup>` can't contain
- Class names unchanged; no selector depended on `div`
- `styles/globals.scss` gains step tokens (`--fs-micro` 9px, `--fs-tag` 10px, `--fs-eyebrow` 12px, `--fs-caption` 13px, `--fs-small` 14px, `--fs-lead` 18px, `--fs-name` 20px, `--fs-wordmark` 25px)
- Title ramps: `--fs-display-xl/lg/sm` (76/54/40px), `--fs-h1-detail` 62px, `--fs-h1-entry` 58px, `--fs-h1-lg` 44px, `--fs-h1-entry-lg` 42px, `--fs-h1-sm` 34px, `--fs-h1-entry-sm` 32px
- `/design`-only sizes: `--fs-specimen-display` 48px, `--fs-specimen-h1` 38px, `--fs-specimen-shield` 27px
- 134 module literals and the `h1` 44px override now read tokens; the `html, body` 16px/18px stay literal as the rem base
- Visible changes, consolidated within 1px: `app/design` `.bannerName` 17→18px, `.ruleTitle` 22→21px, `.pageTitle` 23→24px, `.tokens` 12.5→12px; `app/houses/[slug]` `.words` 23→24px
- rem/em sizes mapped to the step nearest their 16px-root value, so on `≤md` (18px root) they no longer scale up:
- `FamilyTree` `.name` 1.05rem→16px (was 16.8/18.9px), `.alias` 0.8rem→13px (12.8/14.4), `.cross` 0.95rem→15px (15.2/17.1), `.gender` `.king` 0.85rem→14px (13.6/15.3)
- `TimelineCluster` `.name` 1.05rem→16px; `TimelineChart` `.eventName` 1rem→16px (18 on `≤md`); `TimelineExplorer` `.zoomButton` 1.1rem→18px (17.6/19.8)
- `SearchCombobox` `.option` 1.15rem→18px and 1.25rem→21px on `≤md` (was 22.5), `.optionDetail` 0.8rem→13px
- `Infobox` `.note` 0.92em→14px (13.8); `app/design` `.inlineCode` 0.86em→14px (13.76)
- `styles/globals.scss` adds `--tkw-radius-xs` 3px, `--tkw-radius-sm` 4px, `--tkw-radius-md` 5px, `--tkw-radius-lg` 8px, and `--tkw-radius-pill` 999px around the existing `--tkw-radius` 7px
- 45 module literals now read the scale; `50%` circles and `0` resets stay literal
- Visible changes: `SiteHeader` `.wordmark` focus ring and `SiteMenu` `.linkIcon` 2→3px; `app/houses/[slug]` `.notableList li` 6→7px
- `SpoilerToggle` `.track` 9px→`--tkw-radius-pill` renders the same on its 18px track
- `styles/globals.scss` adds `--lh-dropcap` 0.78, `--lh-heading` 1.15, `--lh-compact` 1.3, `--lh-blurb` 1.45, `--lh-lede` 1.6, `--lh-code` 1.85
- Adds `--ls-kicker` 1.4px, `--ls-data` 1px, `--ls-tight` 0.6px
- 31 `line-height` and 33 `letter-spacing` literals now read tokens; `line-height: 0` resets stay literal
- Visible line-height changes (±0.05): `app/design` `.faceDisplay` 1.1→1.15, `.faceMono` 1.2→1.15, `.quoteText` `.ruleBody` 1.55→1.6; `FilteredCharacterList` `.name` 1.2→1.15; `TimelineChart` `.eventName` 1.25→1.3; `HouseInfobox` `.caption` 1.35→1.3; `SiteFooter` 1.4→1.45
- Visible letter-spacing changes (≤0.2px): `app/page` `.title`, `app/battles` `.when`, `FilteredEventList` `.when` 0.5→0.6px; `app/design` `.swatchHex` 0.8→1px; `SiteHeader` `.title` 1.5→1.6px; `TimelineChart` `.eraLabel` 2.4→2.2px
- `styles/globals.scss` adds `--tkw-wash`, `--tkw-caption-wash`, sheen (`--tkw-silver`, `--tkw-silver-bright`, `--tkw-white`, `--tkw-glint`), and shadow tokens (`--tkw-black`, `--tkw-shadow`, `--tkw-drop`, `--tkw-scrim`)
- The 0.16→0.04 caption gradient shared by `SiteMenu`, `HouseInfobox`, and `app/design` is now `--tkw-caption-wash`; the four register-row hovers use `--tkw-wash`
- One-off gold alphas become `color-mix(in srgb, var(--tkw-gold) N%, transparent)`; the map glint mixes `--tkw-gold-bright`; `SearchCombobox` `.optionActive` reads `--tkw-hairline-faint`
- `TimelineExplorer` and `TimelineMinimap` share `--tkw-drop`; `SiteMenu` and `WorldMap` shadows mix `--tkw-shadow`/`--tkw-black`; the `app/design` shield shade mixes `--tkw-black`
- `app/page` silver sweep and `SiteHeader` glint read the sheen tokens
- Atmosphere damask and compass rose in `globals.scss`, and the `app/design` `.searchDemo` glyph, are now alpha masks over `--tkw-gold` instead of `%23…` hexes in the SVG
- `components/listSearch.module.scss` `.input` keeps its data-URI glyph: an `<input>` has no pseudo-element and a mask would clip the whole field
- Visible changes: damask tile stroke `#e6c15c`→`--tkw-gold` at the layer's 4.5% opacity; vignette `rgba(8, 6, 5, 0.7)`→`--tkw-scrim` (0.72)
- Remaining matches are the `Filigree` `#000` alpha stops in `mask-image`
- `styles/globals.scss` adds `--tkw-dur-fast` 150ms, `--tkw-dur` 180ms, `--tkw-dur-slow` 240ms, `--tkw-ease`, `--tkw-ease-out`, and `--tkw-sheathe` (6.5s linear infinite)
- `--tkw-lift` and `--tkw-fade` are now composed from `--tkw-dur` + `--tkw-ease`
- Every module `transition` reads the tokens; `SpoilerToggle` `.track` reuses `--tkw-lift` for its border and shadow parts
- `SiteHeader` and `app/page` sheathe sweeps share `--tkw-sheathe`; `WorldMap` easings, the pulse/glint delay, and the reduced-motion fade read the tokens
- `WorldMap` choreography stays literal (pulse 1.1s, pop 0.52s, glint 0.9s, reveal 0.4s, 0.16–0.4s stagger): one-off timings with no step on the scale
- Visible changes: `FamilyTree` `a.name` and `app/houses/[slug]` `a.notableName` 120→150ms; `SiteMenu` `.backdrop` fade 220→180ms; `MapMarker` `.label` fade 150→180ms
- New `lib/design-tokens.ts` (`parseDesignTokens`, `loadDesignTokens`) reads the `:root` block of `styles/globals.scss` at build time and throws on an undeclared token; co-located tests
- `app/design/page.tsx` shows each swatch's value, the type-scale specs, and the token listing from that block instead of hand-copied hex strings and a stale `TOKEN_CSS` excerpt
- `styles/globals.scss` adds `--house-*-metal` / `--house-*-ink` for all ten houses; the heraldry grid, banner, and register-row demos read them instead of inline hex
- `CORE_PALETTE`, `HOUSE_PALETTE`, `FACES`, `SCALE`, `STATUSES`, `RULES`, `PAGES` are `as const satisfies readonly …[]`
- Visible changes: Stark banner metal `rgba(255,255,255,.75)`→`--house-stark-metal` (0.7); `--fs-label` spec reads `11px` instead of the hand-written `9 to 12px`; the token listing now prints the full `:root` block
- Radius check now accepts every `--tkw-radius-*` step and skips `0` resets and `50%` circles
- Line-height check skips `line-height: 0;` resets
- With both, the R9 greps print only the `Filigree` `#000` mask stops
@netlify

netlify Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for theknownworld ready!

Name Link
🔨 Latest commit fa72a60
🔍 Latest deploy log https://app.netlify.com/projects/theknownworld/deploys/6ac939448f025200088a7c6a
😎 Deploy Preview https://deploy-preview-109--theknownworld.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codebend3r

Copy link
Copy Markdown
Owner Author

Split into a stack of 10 smaller PRs, merge in order: #110 → #111 → #112 → #113 → #114 → #115 → #116 → #117 → #118 → #119. Same commits, same final tree.

@codebend3r codebend3r closed this Oct 9, 2026
@codebend3r
codebend3r deleted the claude-md-audit-fixes branch October 12, 2026 23:57
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.

1 participant