Steps: edit route and step list (#9) #23

Merged
miko merged 2 commits from feature/9-steps into development 2026-11-02 08:52:07 +01:00
Owner

Closes #9.

What

  • Step model (guideId, position, optional title, Editor.js content, searchText, per-step version) with migration 20261101300000_add_step; cascade-deleted with the guide.
  • /guides//edit: step list on the left (add, delete, drag & drop reorder plus up/down buttons), the active step's editor on the right (?step=<id>).
  • Explicit save per step with optimistic locking via version; conflicts show a reload prompt.
  • Unsaved changes: switching, adding or deleting steps, following links, submitting the guide form and closing/reloading the page ask first. Browser back/forward within the app is not intercepted.
  • Reading view lists steps in order, numbered; an untitled step shows "Step n".
  • Shared rich-text submission parsing (src/richText/submission.ts) for guide descriptions and step content; the Editor.js wrapper moves to src/richText/RichTextEditor.tsx.

Notes

  • "Step n" isn't translated yet: Lingui isn't set up (#3). The fallback lives in src/steps/stepTitle.ts with a TODO.
  • Tests: step title fallback, step order (move + validating a submitted order), rich-text submission, reading-view rendering. Server actions and the editor UI aren't covered by unit tests (that's Playwright, #15) and weren't checked in the browser.

🤖 Generated with Claude Code

Closes #9. ## What - **Step model** (`guideId`, `position`, optional `title`, Editor.js `content`, `searchText`, per-step `version`) with migration `20261101300000_add_step`; cascade-deleted with the guide. - **/guides/<id>/edit**: step list on the left (add, delete, drag & drop reorder plus up/down buttons), the active step's editor on the right (`?step=<id>`). - **Explicit save per step** with optimistic locking via `version`; conflicts show a reload prompt. - **Unsaved changes**: switching, adding or deleting steps, following links, submitting the guide form and closing/reloading the page ask first. Browser back/forward within the app is not intercepted. - **Reading view** lists steps in order, numbered; an untitled step shows "Step n". - Shared rich-text submission parsing (`src/richText/submission.ts`) for guide descriptions and step content; the Editor.js wrapper moves to `src/richText/RichTextEditor.tsx`. ## Notes - "Step n" isn't translated yet: Lingui isn't set up (#3). The fallback lives in `src/steps/stepTitle.ts` with a TODO. - Tests: step title fallback, step order (move + validating a submitted order), rich-text submission, reading-view rendering. Server actions and the editor UI aren't covered by unit tests (that's Playwright, #15) and weren't checked in the browser. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Step model and migration (position, optional title, Editor.js content,
searchText, per-step version). The guide editor gets a step list (add,
delete, reorder by drag and drop or arrow buttons) and an editor for the
active step, saved explicitly with optimistic locking; leaving a step with
unsaved changes asks first. The reading view lists the steps in order,
numbered, falling back to "Step n" without a title.

Submitted rich text is parsed by a shared helper for guide descriptions
and step content; the Editor.js wrapper moves to src/richText.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Step actions run in one transaction each and tolerate a step deleted
concurrently; addStep reports errors like the other actions. The editor
loads its content once per step, so a save no longer rebuilds it and drops
what was typed meanwhile; "unsaved" clears only if nothing changed during
the save. Unsaved step changes also ask before following a link or
submitting the guide form. A failed reorder shows the server's order again,
and a thrown action no longer leaves the list disabled. Shared helpers for
storing and reporting rich text submissions and for the step sort order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit e52a397677 into development 2026-11-02 08:52:07 +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!23
No description provided.