Skip to content

Phase 4: docs on web — doc tree, rich-text editor, commits with PR fallback - #16

Merged
erikgoins merged 5 commits into
mainfrom
feature/docs-web
Nov 19, 2026
Merged

erikgoins merged 5 commits into
mainfrom
feature/docs-web

Conversation

@erikgoins

Copy link
Copy Markdown
Contributor

Phase 4: docs on web. Each linked repo's docs/ folder shows as a tree, and docs open in a rich-text editor that commits to GitHub.

What ships

  • Doc tree in the sidebar (Docs). The docs folder and branch can be set per repo in Settings.
  • Rich-text view (default): CodeMirror 6 live preview. Marks hide off the cursor's line, and checkboxes, bullets, rules, and images render. A Markdown view shows the source. Toolbar, ⌘B / ⌘I / ⌘S. This is a preview over the source, not WYSIWYG (decision 037), so untouched lines stay byte-identical (decision 011).
  • Properties panel for frontmatter. Each edit changes one line; lists and maps are read-only.
  • Saves are one signed createCommitOnBranch each. The user's own token is used first; App commits carry Co-authored-by. Images commit with the doc. Rename is one commit. Delete needs Admin.
  • Conflicts: a changed file returns 409 with GitHub's text, and the editor shows a side-by-side merge view.
  • Branch protection / review mode → pull request, and the doc shows "Pending review". The pull_request webhook ends it.
  • Hide folder for Read Only (decision 012). It applies to the tree, the API, images, presence, and writes.
  • Presence ("Max is editing this doc").
  • Sync: push webhook and reconcile. The tree is cached by folder oid, text by blob sha (decision 035). Pages never call GitHub.

Decisions

035 docs cache · 036 doc writes · 037 rich text = live preview. Numbering skips 034, which PR #14 holds.

Verification

  • pnpm test: 613 passed. This includes the shared round-trip fixtures in packages/core/fixtures/docs/, run at string level and through a real CodeMirror EditorState, and docs service tests on libsql and D1 against a fake GitHub with a git model.
  • pnpm test:e2e: 35 passed (new docs.spec.ts).
  • pnpm smoke: OK on Node and workerd. pnpm lint, pnpm typecheck, and pnpm check:repo are clean.

Not verified against real GitHub

  • The exact refusal createCommitOnBranch gives on a protected branch. The fallback does not depend on it: the server re-reads the head and the file before it opens a pull request.
  • A 10 MB image in one GraphQL request.

Both belong in the live GitHub check (listed in STATE.md).

🤖 Generated with Claude Code

https://claude.ai/code/session_01T7sHyaEvdoSPjkLy7T1aaz

erikgoins and others added 5 commits November 19, 2026 15:19
…tching

Shared round-trip fixtures in packages/core/fixtures/docs for every editor (decision 011).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7sHyaEvdoSPjkLy7T1aaz
Signed-off-by: Erik Goins <erikgoins@gmail.com>
…ew mode, doc cache, pending PRs, presence

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7sHyaEvdoSPjkLy7T1aaz
Signed-off-by: Erik Goins <erikgoins@gmail.com>
Tree cache from push webhooks and reconcile; text cached by blob sha; one signed
createCommitOnBranch per write; conflict vs. branch protection by re-reading the
file; pull request fallback and review mode; image proxy with a sandbox policy;
presence heartbeats.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7sHyaEvdoSPjkLy7T1aaz
Signed-off-by: Erik Goins <erikgoins@gmail.com>
…el, conflict view

Live preview hides markdown marks off the cursor's line; the text never changes, so
the round-trip fixtures pass through a real EditorState. Images paste into
<docs>/assets/ and commit with the doc. Settings: docs folder and branch per repo,
hide folder, review mode. Cached docs open without the GitHub App.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7sHyaEvdoSPjkLy7T1aaz
Signed-off-by: Erik Goins <erikgoins@gmail.com>
…rder change

Also tests for D1's 100-parameter limit on doc sync and for hidden frontmatter in the
rich-text view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7sHyaEvdoSPjkLy7T1aaz
Signed-off-by: Erik Goins <erikgoins@gmail.com>
@erikgoins
erikgoins merged commit 89779b6 into main Nov 19, 2026
3 checks passed
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