Repository navigation
Document Activity history and Contents outline - #594
Merged
Merged
Conversation
MaggieAppleton
marked this pull request as ready for review
October 15, 2026 11:53
Contents shows margin ticks that peek each section's prose. History opens a sidebar over the document listing editing sessions one line each, with model-written summaries; choosing a session shows a read-only copy under a version bar that can restore it.
A restore opens its own history session, so the session before it stays restorable. Summary prompts trim each session's changes until twenty fit, and a finished summary job reports unavailable instead of pending. History's viewed version belongs to its document, a late restore result is ignored, and History and the Contents peek close on Escape with focus kept. Buttons use the shared btn-sm size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaggieAppleton
force-pushed
the
activity-and-contents
branch
from
October 16, 2026 14:16
8d1b811 to
3379ee0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Document History (version history in the spirit of Apple Notes' Activity panel) and Contents (an outline for navigating the document). Each History entry is one editing session; choosing one shows the document as that session left it, and writers can restore it.
Screenshots
Contents: one tick per heading in the right margin. Hovering a tick peeks at that section's prose.
History: slides over the views bar and document from the right, under the title bar. One line per session with a terse age; spacing grows with the time between sessions.
Summaries arriving: rows show at once; missing summaries are skeletons until the model writes them.
Viewing an earlier session: the views bar becomes Current, whose edits, the exact time, and Restore.
Contents
@container (width < 53rem)hides them): expanded documents and wide screens. History hides them while open.MutationObserver).ContentsIconand its design-contract exception are gone.History
[data-history-scroll]joins the existing list intheme.css).now,2m,3h,4d,2w, then the date). Space before a row grows withlog2of the hours since the newer one, up to a cap. Lingering 0.9 s shows the full line and the exact time ("Oct 11 at 11:17 AM") just left of the row.Restore
POST /api/channels/:id/versions/:versionId/restorechecks push access, refuses archived documents and active builds, and callsrestoreDocumentVersioninmain.ts.edit.restoration(current, earlier)takes the earlier prose and carries today's Questionnaire, Decision, Research and Investigation projections across unchanged, each after the block it follows now (or after the projection before it), because the records own them andreplacerefuses to drop, alter or author them.Service.rewrite, credited to whoever pressed Restore.rewrite's MCP idempotency record is now optional for this path.Summaries
AGENT=off, background jobs off). A paused job resumes when an owner appears, so the next History open has them.version-summaryjob uses the active Planner's credential (opening History never claims ownership) and the newHISTORY_MODEL(defaults toMODEL; set a small fast model).unavailable, notpending.025_document_version_summariesaddssummaryandsummary_hash. A session that grows keeps no stale summary.Server (unchanged from the first pass)
024_document_versionsandDocumentVersionStore(Postgres and memory, with a storage contract test) record the canonical MDX after a commit changes the source, viaDocumentHistoryinonDocumentPersisted.DocumentTarget.author; Planner and other server edits have no author.GET /api/channels/:id/versions(up to 200 sessions plus creation) andGET /api/channels/:id/versions/:versionId, with the same pull-access check asGET /api/channels/:id. The store gainspreviousandsummarize.Not done yet / questions
HISTORY_MODEL. It falls back toMODEL; we should pick a small default per harness.Review fixes (rebase onto main)
Rebased onto main (migrations renumbered to 024/025 after main's 021–023;
StaticPlanEditorkeeps main'sclassNamealongsidelabel/presentation; MCP title receipts only finalize when a rewrite has a receipt). Then:unavailable, so History stops showing skeletons for rows the same key will never retry.role="alert"; buttons usebtn-sm(main retiredbtn-compact).Still open: any reader can trigger a summary job billed to the Planner owner (idempotent per session set, no per-channel throttle).
Checks
bun run types,bun run ci(dprint, oxlint, tokens, design contract, design record, impeccable) pass.bun test: 6,195 tests; the only failures are connector/installer tests that also fail onmainfrom the same/tmpworktree.bun run test:postgrespasses, including the version contract (summaries,previous) and the migration list.edit.test.ts(restoration),routes.test.ts(restore and summaries routes),version-summary.test.ts,document-history.test.ts(ages, exact times, gaps).🤖 Generated with Claude Code