Skip to content

feat(documents): document workspaces behind an experimental flag - #271

Merged
johannesjo merged 6 commits into
mainfrom
pr-267-review
Sep 8, 2026
Merged

feat(documents): document workspaces behind an experimental flag#271
johannesjo merged 6 commits into
mainfrom
pr-267-review

Conversation

@johannesjo

Copy link
Copy Markdown
Owner

Supersedes #267 — same feature, rebuilt on a clean branch with today's
follow-up work squashed into one commit.

A new project kind for exploring problems in prose: a Git repository plus
one document. Select a passage, send the same instruction to one or more
agents, compare the proposals side by side, accept one as a single
readable commit.

Backend — dispatch snapshots the base, gives every candidate its own
worktree and runs the official CLI headlessly; the main session keeps a
persistent worktree so its cwd and prompt cache never change. Out-of-scope
files are reverted and listed. Acceptance is one squashed integration
commit carrying the run record; a base that moved is merged three-way or
marked stale.

Renderer — full-window workspace with Document, Compare and History
tabs, block-level rendering with source line mapping, selection by text,
block or heading section, and an in-place composer with agent chips.

Today's follow-ups on top of that:

  • run the workspace agent in the task terminal, keep its tab mounted and
    the session alive across tab switches and exits
  • review proposals one at a time in the compare view, with agent merge
    and follow-up questions
  • float notes and the block toolbar over the window
  • enlarge mermaid diagrams in a full-window lightbox
  • move project settings into the workspace header
  • fix the Solid crash on close and the dialog prose width cap

Also includes a CI fix: document setup lets the app create the repository
itself, so its commit has no local Git identity to fall back on and failed
on a bare runner. The workflow now configures one.

https://claude.ai/code/session_011wx6DbuYrV9qsunua6BUu3

Test added 4 commits September 7, 2026 23:29
An experimental project type for exploring problems in prose — architecture
notes, specs, ADRs, research. Several agents get the same passage and the same
base version; you read the alternatives and decide what enters the document.
Behind the Document workspaces switch in Settings → Experimental.

- Markdown documents and whole HTML pages, the latter rendered with their own
  stylesheet and their innermost elements as the blocks, matching what a
  browser shows: a page's custom properties, `rem` basis, reset and `position`
  survive, and page CSS cannot reach the app's own controls.
- A composer that is always there: it rests at the foot of the column and acts
  on the whole document until you pick a passage by text, block or heading,
  then moves under the passage and follows it.
- A task either goes to the long-running agent session, which edits the
  checkout as you watch, or runs as headless candidates in their own worktrees,
  with the agents, candidate counts, model and reasoning level chosen per
  project and remembered.
- Compare proposals against the base in a modal, accept one or reject all, or
  take a candidate's changes one at a time and preview the result before it
  lands. The columns are resizable and remember their widths.
- Refine a candidate instead of accepting it: a fresh isolated run seeded with
  that proposal's content, reviewed whole, leaving the original available.
- Edit a block's Markdown or HTML source in place from its hover pencil or the
  toolbar; the rest of the file, and its line endings, are preserved, and a
  save refuses to overwrite a document that changed meanwhile.
- Notes and agent-answered questions hang off a passage as margin markers,
  reachable with the mouse and marked while an answer is still coming.
- History is git log for the document with the Parallel-* trailers parsed,
  showing diffs, rendering older versions and reverting entries.
- A right panel with the agent terminal, the runs and the project's files;
  relative links inside a document open the file they point at.

Hardened against a multi-agent review: the watcher compares snapshots rather
than a proxy with itself, a block that parted from its file reports so in the
dialog instead of tripping the window's error boundary, page stylesheets are
brace-balanced before scoping, markup the app did not write goes through one
sanitize policy, documents are not read through symlinks, proposals on an
uncommitted document are refused, and a candidate finishing early no longer
strands its peers as running.

Also corrects `EMPTY_TREE` in electron/ipc/git.ts, which was not the empty
tree, so the pre-existing root-commit diff paths never matched.

Claude-Session: https://claude.ai/code/session_01Gso9dUvEZF5orpAwWhHACi
Claude-Session: https://claude.ai/code/session_01EQcZpLJ71Nbf7XsZPJeYeK
Claude-Session: https://claude.ai/code/session_01NZFMpgnLkK1nLq3AKf63nd
Squashes today's work on the document workspace:

- run the workspace agent in the task terminal, keep its tab mounted and
  the session alive across tab switches and exits
- review proposals one at a time in the compare view, with agent merge
  and follow-up questions
- float notes and the block toolbar over the window
- enlarge mermaid diagrams in a full-window lightbox
- fix the Solid crash on close and the dialog prose width cap
- address UI review findings

Claude-Session: https://claude.ai/code/session_011wx6DbuYrV9qsunua6BUu3
Document setup lets the app create the repository itself, so the commit it
makes has no local identity to fall back on and fails on a bare runner.

Claude-Session: https://claude.ai/code/session_011wx6DbuYrV9qsunua6BUu3
@johannesjo

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 2 commits September 8, 2026 19:32
# Conflicts:
#	src/components/TaskAITerminal.tsx
#	src/store/persistence.test.ts

Co-authored-by: johannesjo <1456265+johannesjo@users.noreply.github.com>

Copilot AI commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved the conflicts with current main and pushed the merge; follow-up typecheck fix is 48ad847.

@johannesjo
johannesjo merged commit 076eac8 into main Sep 8, 2026
2 checks passed
@johannesjo
johannesjo deleted the pr-267-review branch September 8, 2026 20:19
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.

2 participants