Step lines: coloured and icon list per step (#10) #24

Merged
miko merged 2 commits from feature/10-step-lines into development 2026-11-02 09:36:33 +01:00
Owner

Closes #10. The image area left of the step lines (iFixit layout) moves to #11, since steps have no step images yet.

Summary

A step now has a list of step lines: coloured bullets (palette colour by name, ADR-0004) or icon lines (caution, note, reminder), indented 0–2.

 Step
+  StepLine[] (position, indent 0–2, kind, color?, text: sanitised inline HTML)
saveStep(form)
  stepLinesFromSubmission(lines)   # bold/italic/safe links only, blank lines dropped,
                                   # bullets get a palette colour (black default), icon lines none,
                                   # indent ≤ previous + 1, max 50 lines × 1000 chars
  transaction
    update step (version check), searchText += line text
    replace the step's lines
 <StepEditor>
   Title
+  <StepLinesEditor>          # add/remove/move/indent/outdent, B/I/link toolbar
+    <MarkerSelect>           # listbox showing each bullet colour / icon
   Content
 <GuideSteps>
   <h2>
+  <StepLines>                # nested by indent, sr-only colour / kind labels
   <RichText>

Evidence

  • Before: stepLines.test.ts, StepLines.test.tsx red (module missing).
    After: npm test → 19 files, 122 tests pass; tsc --noEmit and eslint clean.
  • Not checked in a browser (the local session had expired), so the editor and listbox still need a manual look.

Merge Danger

Door: two-way

New table StepLine (additive migration, cascades with its step); no existing data changes.

Blast Radius: steps

The step form now always submits a lines field; a form without it is rejected rather than erasing lines. The reading view puts the lines above the content; the image column comes with #11.

🤖 Generated with Claude Code

Closes #10. The image area left of the step lines (iFixit layout) moves to #11, since steps have no step images yet. ## Summary A step now has a list of step lines: coloured bullets (palette colour by name, ADR-0004) or icon lines (caution, note, reminder), indented 0–2. ```diff Step + StepLine[] (position, indent 0–2, kind, color?, text: sanitised inline HTML) ``` ```text saveStep(form) stepLinesFromSubmission(lines) # bold/italic/safe links only, blank lines dropped, # bullets get a palette colour (black default), icon lines none, # indent ≤ previous + 1, max 50 lines × 1000 chars transaction update step (version check), searchText += line text replace the step's lines ``` ```diff <StepEditor> Title + <StepLinesEditor> # add/remove/move/indent/outdent, B/I/link toolbar + <MarkerSelect> # listbox showing each bullet colour / icon Content <GuideSteps> <h2> + <StepLines> # nested by indent, sr-only colour / kind labels <RichText> ``` ## Evidence - **Before:** `stepLines.test.ts`, `StepLines.test.tsx` red (module missing). **After:** `npm test` → 19 files, 122 tests pass; `tsc --noEmit` and eslint clean. - Not checked in a browser (the local session had expired), so the editor and listbox still need a manual look. ## Merge Danger **Door:** two-way New table `StepLine` (additive migration, cascades with its step); no existing data changes. **Blast Radius:** steps The step form now always submits a `lines` field; a form without it is rejected rather than erasing lines. The reading view puts the lines above the content; the image column comes with #11. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- StepLine model (position, indent 0–2, kind, colour name, sanitised text)
  with migration; lines are saved with their step and replaced atomically.
- stepLines module: submission normalising/sanitising (bold, italic, links
  only), limits, and editor list ops (add, remove, move, indent, outdent).
- StepLinesEditor in the step form; StepLines in the reading view, nested by
  indent, with palette bullets and caution/note/reminder icons.
- Inline renderer extracted to InlineNodes; moveStep generalised to moveItem.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the native select, whose options cannot show coloured bullets in
every browser, with an accessible listbox (arrow keys, Home/End, Enter,
Escape) that shows each option's bullet or icon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit f65a9de9b0 into development 2026-11-02 09:36:33 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba!24
No description provided.