Skip to content

feat: local-first editor#615

Draft
NagariaHussain wants to merge 6 commits into
frappe:developfrom
NagariaHussain:feat/local-first-editor-step-1
Draft

feat: local-first editor#615
NagariaHussain wants to merge 6 commits into
frappe:developfrom
NagariaHussain:feat/local-first-editor-step-1

Conversation

@NagariaHussain
Copy link
Copy Markdown
Collaborator

Frontend draft workspace store that makes sidebar edits, reorder, and content saves feel local-first while still persisting through the existing CR RPCs. Spec: specs/local_first_editor_migration_step_1.md.

🤖 Generated with Claude Code

Introduce draftWorkspace Pinia store that owns optimistic tree, page draft
state, and a per-mutation queue backed by the existing CR RPCs. Sidebar
create/rename/delete/reorder, content save, and metadata edits all flow
through the store with immediate local feedback; submit/merge are gated
on pending/failed mutations. See specs/local_first_editor_migration_step_1.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NagariaHussain NagariaHussain changed the title feat: local-first editor migration (step 1) feat: local-first editor Apr 29, 2026
NagariaHussain and others added 5 commits April 30, 2026 16:48
Move "View changes" and "Archive" into a three-dot dropdown so the header
only surfaces the primary actions (Merge, Submit for Review). Soften the
Draft state banner from blue to gray.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the spinning icon and reuse the frappe-ui Badge for the sync
state pill. Less visual noise next to the header actions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add three Playwright specs against the local-first draft workspace:
delayed create_cr_page, failed update_cr_page, and delayed reorder.
A new mock helper wraps page.route() to inject latency and 500s on
specific Frappe methods, and SpaceDetails exposes the draft store on
window for deterministic optimistic-action testing.

Fix a real bug surfaced while writing these: the sidebar's root_node
fallback to space.doc.root_group passes a Frappe document name where
the store expects a doc_key, silently no-oping the optimistic insert
when the dialog opens before hydration completes. Drop the wrong
fallback and let createNode default to rootKey when empty.

Cleanup: remove leftover console.log calls from ordering and
public-pages specs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The .or() locator tripped Playwright strict-mode when both the toolbar
"New Page" button and the empty-state "Create First Page" button are
visible simultaneously, which is the normal state on an empty space
since the local-first migration. Add .first() so either match passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant