One Save button in the guide editor (#125) #129

Merged
miko merged 2 commits from feature/125-guide-save into development 2026-11-05 21:03:53 +01:00
Owner

Closes #125.

What changed

  • "Save step", "Save guide" and "Save properties" become one Save button at the top of the editor's sidebar (a bar along the bottom edge on narrow screens). It saves the parts with unsaved changes in order: step, guide, properties. A declined confirmation stops the rest; a failed part keeps its changes and error while the others are saved. Enter in a field saves too.
  • Saving stays in the editor; only publishing leads to the reading view. A status line says whether all changes are saved.
  • Publishing from the editor saves first and publishes nothing if that fails.
  • Discarding forgets the unsaved changes and mounts the editor afresh, so discarded text can no longer be saved back. The editor tells a working copy replaced elsewhere apart from its own saves by the guide versions they produce.
  • Forms save against the version they were loaded with or last saved, so a conflict stays a conflict on the next save instead of overwriting someone else's changes.
  • Leaving the editor with unsaved changes anywhere in it asks first.
  • "Transfer ownership" and the attachment dialogs keep their own buttons.

Structure

  • src/guides/editorSave.ts: pure save coordinator (unit-tested).
  • src/guides/components/GuideEditor.tsx: provider, body, useEditorPartForm shared by the three forms, SaveBar.
  • src/richText/useRichTextEdits.ts, src/forms/components/ImplicitSubmit.tsx.

Tests

  • Unit: 558 passed.
  • e2e: 80 passed; the specs use a new saveEditor helper, and e2e/guideEditor.spec.ts covers the issue, failed parts, publish-saves-first, discard and conflicts.

Follow-up

ADR-0020 still says the editor saves "per step"; GLOSSARY.md lacks "Guide Editor" / "Save Bar".

🤖 Generated with Claude Code

Closes #125. ## What changed - "Save step", "Save guide" and "Save properties" become one **Save** button at the top of the editor's sidebar (a bar along the bottom edge on narrow screens). It saves the parts with unsaved changes in order: step, guide, properties. A declined confirmation stops the rest; a failed part keeps its changes and error while the others are saved. Enter in a field saves too. - **Saving stays in the editor**; only publishing leads to the reading view. A status line says whether all changes are saved. - **Publishing from the editor saves first** and publishes nothing if that fails. - **Discarding** forgets the unsaved changes and mounts the editor afresh, so discarded text can no longer be saved back. The editor tells a working copy replaced elsewhere apart from its own saves by the guide versions they produce. - Forms save against the version they were loaded with or last saved, so a conflict stays a conflict on the next save instead of overwriting someone else's changes. - Leaving the editor with unsaved changes anywhere in it asks first. - "Transfer ownership" and the attachment dialogs keep their own buttons. ## Structure - `src/guides/editorSave.ts`: pure save coordinator (unit-tested). - `src/guides/components/GuideEditor.tsx`: provider, body, `useEditorPartForm` shared by the three forms, `SaveBar`. - `src/richText/useRichTextEdits.ts`, `src/forms/components/ImplicitSubmit.tsx`. ## Tests - Unit: 558 passed. - e2e: 80 passed; the specs use a new `saveEditor` helper, and `e2e/guideEditor.spec.ts` covers the issue, failed parts, publish-saves-first, discard and conflicts. ## Follow-up ADR-0020 still says the editor saves "per step"; GLOSSARY.md lacks "Guide Editor" / "Save Bar". 🤖 Generated with [Claude Code](https://claude.com/claude-code)
"Save step", "Save guide" and "Save properties" become one Save button at
the top of the editor's sidebar (along the bottom edge on narrow screens).
It saves the dirty parts in order, step, guide, properties: a declined
confirmation stops the rest, a failed part shows its own error while the
others are saved. Saving the guide or its properties no longer leads to the
reading view; only publishing does. Enter in a field saves too, a status
line tells whether all changes are saved, and leaving the editor with
unsaved changes anywhere in it asks first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Publishing from the editor saves its unsaved changes first and publishes
nothing if that fails. Discarding forgets them and, like any working copy
replaced elsewhere, mounts the editor's body afresh, so discarded text can
no longer be saved back. The editor tells that apart from its own saves by
the guide versions they produce, so the properties form no longer remounts
(and loses its changes and error) when the guide content is saved.

The forms save against the version they were loaded with or last saved,
not the one a refresh brings, so a conflict stays a conflict on the next
save instead of overwriting someone else's changes.

The three forms share useEditorPartForm; rich text edit counting moves to
src/richText, ImplicitSubmit to src/forms, and the editor speaks of
"unsaved" parts throughout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit 3dfc3655de into development 2026-11-05 21:03:53 +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!129
No description provided.