docs: add task 10b, locale-paired props on the six full-guide blocks
Task 15d stopped on a real blocker rather than working around it: the blocks it assembles from take plain string props, so /full-guide/ cannot render both locales without either duplicating blocks or changing a component interface, and both are outside page-migrator scope. Tasks 07-11 predate the language contract task 15c wrote, which is why none of the 19 blocks is locale-aware. This narrows the fix to the six blocks full-guide actually uses and makes the change additive, so the already-merged call sites that pass plain strings are unaffected. Records that /rules/ is already fully bilingual via client-side swapping from a content collection, and that the other five pages have no language toggle today and must not gain one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,72 @@
|
|||||||
|
# Task 10b — Locale-paired props on the six full-guide blocks
|
||||||
|
|
||||||
|
**Agent**: `component-builder` · **Model**: **Codex** **Depends on**: 10 ·
|
||||||
|
**Blocks**: 15d **Worktree**:
|
||||||
|
`.agents/scripts/worktree.sh start 10b bilingual-blocks`
|
||||||
|
|
||||||
|
## Why this task exists
|
||||||
|
|
||||||
|
It is not in the original plan. Tasks 07–11 built the primitives and blocks
|
||||||
|
before task 15c wrote the language contract, so every prose prop on all 19
|
||||||
|
blocks is a plain `string`. Task 15d then stopped, correctly, when it found it
|
||||||
|
could not render `/full-guide/` in both languages: the brief forbids it from
|
||||||
|
duplicating a block to get a second locale, and changing a block's interface is
|
||||||
|
component-builder work, not page-migrator work.
|
||||||
|
|
||||||
|
`/full-guide/` is one of only two pages with a language toggle (the other is
|
||||||
|
`/rules/`, which is already fully bilingual — all 23 of its Portuguese strings
|
||||||
|
reach the built page, because `RulesInteractive` reads them from
|
||||||
|
`src/content/rules/stages.json` and swaps client-side). The five remaining pages
|
||||||
|
have no toggle today and must not gain one.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
Exactly six files, all in `src/components/blocks/`:
|
||||||
|
|
||||||
|
`FleetDiagram.astro`, `HandoffTable.astro`, `PhasePanel.astro`,
|
||||||
|
`RouteTable.astro`, `SkillPackage.astro`, `WorktreeMap.astro`.
|
||||||
|
|
||||||
|
These are the six that `src/pages/full-guide.astro` uses. Do not touch the other
|
||||||
|
13 blocks, any primitive, any island, or any page.
|
||||||
|
|
||||||
|
## What to change
|
||||||
|
|
||||||
|
Every **prose** prop on those six accepts `Localized` as well as `string`:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
type Localized = { en: string; pt: string };
|
||||||
|
```
|
||||||
|
|
||||||
|
- Given a `string`, render exactly what it renders today. Every existing call
|
||||||
|
site keeps working untouched — this is additive.
|
||||||
|
- Given a `Localized`, render the fragment twice per
|
||||||
|
`.agents/context/content-i18n.md`: `data-language-content="en"` on one and
|
||||||
|
`"pt"` on the other, English visible, Portuguese `hidden`.
|
||||||
|
|
||||||
|
Prose only. Do not widen `href`, `id`, `code`, numeric or enum props — several
|
||||||
|
are deliberately unlocalized, and task 05b recorded which (`trees.path`,
|
||||||
|
`trees.command`, `routes.score`, `commonSkills.source`).
|
||||||
|
|
||||||
|
`FleetDiagram`'s `orchestrator.title` is rendered with `set:html` because it
|
||||||
|
carries inline `<br>`. Keep that, on both locales.
|
||||||
|
|
||||||
|
## Do not
|
||||||
|
|
||||||
|
- Do not change what a block renders for a `string` prop. A diff in the built
|
||||||
|
output for the existing call sites means you got it wrong.
|
||||||
|
- Do not add a language toggle to any block. `LanguageToggle` is a separate
|
||||||
|
island and the page mounts it.
|
||||||
|
- Do not edit `scripts/verify.mjs`. 42 assertions, and you are not the
|
||||||
|
verification-engineer.
|
||||||
|
- Do not touch `src/pages/full-guide.astro`. That is 15d's file; it will pass
|
||||||
|
the `Localized` values once you land.
|
||||||
|
|
||||||
|
## Done when
|
||||||
|
|
||||||
|
- [ ] All six blocks accept `Localized` on every prose prop and `string` still
|
||||||
|
behaves identically
|
||||||
|
- [ ] Built output byte-identical for pages that pass only strings — check
|
||||||
|
`dist/` before and after for the pages that use these blocks
|
||||||
|
- [ ] `pnpm run gate` green, 42 assertions intact
|
||||||
|
- [ ] Report lists, per block, which props became locale-aware and which you
|
||||||
|
deliberately left unlocalized and why
|
||||||
Reference in New Issue
Block a user