Editor sidebar: more whitespace and tabs General, Details, Media (#126) #131

Merged
miko merged 5 commits from feature/126-editor-sidebar-spacing into development 2026-11-05 21:26:08 +01:00
Owner

Closes #126

Summary

The editor sidebar gets more whitespace and is split into three tabs. Every tab stays mounted and is only hidden, so unsaved changes survive switching and one Save saves everything.

 <aside>
   <SaveBar />
   <section> Properties
-    Owned by … · CoverImageEditor · AttachmentsEditor · GuidePropertiesForm · OwnershipForm   (all gap-4)
+    <EditorSidebarTabs>                       src/guides/components/EditorSidebarTabs.tsx
+      <SidebarTabList>  General | Details | Media   (arrow keys, Home, End; marker for unsaved changes)
+      <GuidePropertiesForm>                   display: contents
+        <SidebarTabPanel general>  visibility, category, wiki mode
+        <SidebarTabPanel details>  difficulty, estimated duration, protective equipment, license
+      <SidebarTabPanel general secondary>  Owned by …, OwnershipForm   (forms cannot nest)
+      <SidebarTabPanel media>  cover image, attachments

The pure logic is in src/guides/sidebarTabs.ts:

tabForKey(active, key)            arrow keys / Home / End -> tab
editedStillUnsaved(edited, unsaved) marker clears once its part is saved
tabAfterFailedSave(active, edited)  a failed save opens the first tab with unsaved changes

Evidence

  • Before: fields from different areas sat in one flat column at gap-4
    After: new e2e tests in e2e/guideEditor.spec.ts pass:
    • tabs keep unsaved fields, mark only their own tab, and are saved together
    • a failed save from the Media tab opens Details, marked, with the error
    • owner and ownership transfer (admin) are in General, as a second panel of the tab
  • Unit tests: 569 passed (11 new in sidebarTabs.test.ts)
  • e2e: 83 passed. The specs that use Details or Media fields now open the tab first (openSidebarTab).

Merge Danger

Door: two-way

UI only. No schema, no data, no API changes.

Blast Radius: guide editor

  • E2E tests and anyone who scripts the editor must open the tab before using fields in Details or Media.
  • After discarding changes, or after someone else saves, the sidebar opens on General again.
  • In Media, cover image and attachments are now 24px apart instead of 32px.

🤖 Generated with Claude Code

Closes #126 ## Summary The editor sidebar gets more whitespace and is split into three tabs. Every tab stays mounted and is only hidden, so unsaved changes survive switching and one Save saves everything. ```diff <aside> <SaveBar /> <section> Properties - Owned by … · CoverImageEditor · AttachmentsEditor · GuidePropertiesForm · OwnershipForm (all gap-4) + <EditorSidebarTabs> src/guides/components/EditorSidebarTabs.tsx + <SidebarTabList> General | Details | Media (arrow keys, Home, End; marker for unsaved changes) + <GuidePropertiesForm> display: contents + <SidebarTabPanel general> visibility, category, wiki mode + <SidebarTabPanel details> difficulty, estimated duration, protective equipment, license + <SidebarTabPanel general secondary> Owned by …, OwnershipForm (forms cannot nest) + <SidebarTabPanel media> cover image, attachments ``` The pure logic is in `src/guides/sidebarTabs.ts`: ```text tabForKey(active, key) arrow keys / Home / End -> tab editedStillUnsaved(edited, unsaved) marker clears once its part is saved tabAfterFailedSave(active, edited) a failed save opens the first tab with unsaved changes ``` ## Evidence - **Before:** fields from different areas sat in one flat column at gap-4 **After:** new e2e tests in `e2e/guideEditor.spec.ts` pass: - tabs keep unsaved fields, mark only their own tab, and are saved together - a failed save from the Media tab opens Details, marked, with the error - owner and ownership transfer (admin) are in General, as a second panel of the tab - Unit tests: 569 passed (11 new in `sidebarTabs.test.ts`) - e2e: 83 passed. The specs that use Details or Media fields now open the tab first (`openSidebarTab`). ## Merge Danger **Door:** two-way UI only. No schema, no data, no API changes. **Blast Radius:** guide editor - E2E tests and anyone who scripts the editor must open the tab before using fields in Details or Media. - After discarding changes, or after someone else saves, the sidebar opens on General again. - In Media, cover image and attachments are now 24px apart instead of 32px. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The cover image, attachments, properties and ownership forms stood as far
apart as the fields within them; they are now set gap-8 apart, with the
heading and owner line kept together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Difficulty, estimated duration, protective equipment and license ran
together at gap-4; the properties form now sets its fields gap-6 apart,
still closer than the gap-8 between the parts of the sidebar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The properties form fills General (visibility, category, wiki mode) and
Details (difficulty, duration, protective equipment, license); the owner
continues General outside it, since forms cannot nest, and Media holds
the cover image and attachments. Every tab stays mounted and is only
hidden, so unsaved changes survive switching and one Save saves them
all; a tab whose fields have unsaved changes is marked. The tab list
follows the ARIA tabs pattern with arrow keys, Home and End.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the review: the owner block is a second tabpanel of General, which
its tab now controls as well, so assistive technology ties it to the tab.
A failed save opens a tab with unsaved changes, where the error likely
is. Panels share one layout class, and the props read clearer
(secondary, markEdited). New e2e tests cover the failed save from the
Media tab and the owner in General.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit d537997afa into development 2026-11-05 21:26:08 +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!131
No description provided.