Skip to content

Use Pierre Diffs edit mode for in-app file editing and persist unsaved drafts - #91

Closed
danielss-dev wants to merge 4 commits into
mainfrom
codex/update-strand-to-use-new-edit-feature
Closed

Use Pierre Diffs edit mode for in-app file editing and persist unsaved drafts#91
danielss-dev wants to merge 4 commits into
mainfrom
codex/update-strand-to-use-new-edit-feature

Conversation

@danielss-dev

Copy link
Copy Markdown
Owner

Motivation

  • Integrate the new Pierre / diffs.com edit mode so the File view uses the library's built-in editor surface instead of the legacy textarea-based HighlightedEditor for working-tree edits.
  • Preserve users' unsaved changes while navigating the app (tabs, panes, repos) but keep writes explicit (save button / Mod+S) to avoid implicit disk writes.
  • Align package metadata and docs with the new edit-mode integration.

Description

  • Reworked ui/src/views/FileView.tsx to mount Pierre's edit surface: wrapped the file surface in an EditProvider and render an editable Pierre File when canEditFileContent is true, removing the in-repo HighlightedEditor implementation.
  • Added in-memory draft persistence keyed per working-tree file via ui/src/lib/fileEditing.ts::fileDraftKey and a sessionFileDrafts map so unsaved drafts survive navigation but are not auto-saved.
  • Wire the editor's onChange and save flow to maintain/delete the session draft map on edits and successful saves (keeps explicit save semantics).
  • Added a small ambient declaration ui/src/vite-pierre-edit.d.ts to type the @pierre/diffs/edit entry used at build time.
  • Bumped UI dependency on @pierre/diffs to ^1.3.2 and updated pnpm-lock.yaml.
  • Updated tests and docs: ui/src/lib/fileEditing.test.ts extended to cover fileDraftKey; updated README.md, TASKS.md, ROADMAP.md, and website/docs/work.md to describe edit-mode and unsaved-draft behavior.
  • Kept the previous save API (tauri.repoFileWrite) and stale-write rejection behavior unchanged.

Testing

  • Ran TypeScript checks with pnpm --filter ./ui exec tsc --noEmit and the UI typecheck passed.
  • Ran unit tests with pnpm --filter ./ui exec vitest run src/lib/fileEditing.test.ts and the added test passed (1 file, 3 tests).
  • Ran git diff --check (no whitespace/errors).
  • Attempted cargo check -p strand-core -p strand-tauri; the Rust build failed in this environment due to missing system glib-2.0 pkg-config dependency (environment issue), not code regressions.

Codex Task

@danielss-dev
danielss-dev deleted the codex/update-strand-to-use-new-edit-feature branch August 6, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant