Skip to content

feat(app): tab path bar, theme sync, view cycle, vim toggle, Word export + MCP parity#105

Merged
hartsock merged 2 commits into
mainfrom
feat/editor-ux-mcp-parity
May 29, 2026
Merged

feat(app): tab path bar, theme sync, view cycle, vim toggle, Word export + MCP parity#105
hartsock merged 2 commits into
mainfrom
feat/editor-ux-mcp-parity

Conversation

@hartsock

Copy link
Copy Markdown
Owner

Supersedes #104 (auto-closed when its stacked base #103 merged + deleted the base branch). Same change, now rebased directly onto main.

Five editor UX features for scrybe-app, each paired with a matching MCP tool per the project's human ↔ MCP control-parity rule.

Features

# Human control MCP equivalent
1 Path bar above the editor — active file's full path as selectable text + 📋 copy button state
3 Theme sync — the CodeMirror editor matches the preview theme (Light/Dark/Solarized) set_theme
4 View cycle — toolbar View button cycles both → edit → preview (same as the per-tab mode icon) view_mode
5 Vim toggle — toggleable Vim keybindings (@replit/codemirror-vim) set_vim
2 Export to Word — toolbar Export….docx via scrybe-docx; Mermaid blocks render to PNGs that embed the source (round-trips via scrybe_mermaid.extract) export

#2 is export-only (Markdown→.docx) by design.

Parity mechanism

scrybe-app mirrors UI state to /tmp/scrybe-state.json (publish_state, read by state); MCP set_theme/view_mode/set_vim write signal files the frontend polls and applies through the same handlers as the toolbar buttons (mirrors the existing close_tab/reload pattern). export and the Export button both shell to scrybe-docx.

Incidental fixes in scrybe-plugin-docx

  • Invalid build-backend (setuptools.backends.legacy:build) → package couldn't install / scrybe-docx was never on PATH. Switched to setuptools.build_meta.
  • Mermaid PNGs now embed their source (scrybe_mermaid.embed).
  • Fixed a monkeypatch in the mermaid-fallback test that only passed when mmdc was absent.

Verification

  • tsc + vite build ✓; cargo clippy -- -D warnings clean (app + mcp-server); cargo fmt --check clean
  • Tests: scrybe-app 16, scrybe-mcp-server 19, docx 18 (black/ruff clean) ✓
  • Live: built + installed the app, launched it, and drove the MCP signal files against the running window — state.json reflects theme/view/vim changes and tracks the active file on tab open. Confirmed a generated .docx round-trips its embedded Mermaid source via scrybe_mermaid.extract.

🤖 Generated with Claude Code

hartsock and others added 2 commits May 29, 2026 15:44
…ort + MCP parity

Five editor UX features for scrybe-app, each with a matching MCP tool per
the project's human/MCP control-parity rule:

- Path bar: selectable full-path display + copy button above the editor
  (MCP: `state` reports the active path/title/dirty).
- Theme sync: the CodeMirror editor now matches the preview theme
  (light/dark/solarized) via a theme compartment (MCP: `set_theme`).
- View cycle: the toolbar View button cycles both -> edit -> preview,
  matching the per-tab mode icon (MCP: `view_mode`).
- Vim: toggleable Vim keybindings via a compartment (MCP: `set_vim`).
- Word export: toolbar Export button + `export_docx` command shells to
  `scrybe-docx`; Mermaid blocks render to PNGs with the source embedded
  in PNG metadata, round-trippable via `scrybe_mermaid.extract`
  (MCP: `export`).

scrybe-app mirrors its UI state to /tmp/scrybe-state.json (publish_state)
and polls signal files (poll_set_theme/poll_view_mode/poll_set_vim) so the
MCP tools drive the exact controls a human clicks.

Also fixes scrybe-plugin-docx: invalid build-backend (package would not
install, so scrybe-docx was unavailable), embeds Mermaid source into the
rendered diagram PNGs, and corrects a monkeypatch in the mermaid-fallback
test that only passed when mmdc was absent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The `state` tool only reflected the active file after a theme/view/vim
change, because only those handlers called publishState — opening or
switching tabs updated the human path bar but not the agent-visible
mirror, so "what am I looking at" could diverge between the two surfaces
(violating the control-parity rule). Publish from updatePathBar, which
fires on every tab mutation, so both stay in lockstep.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hartsock hartsock merged commit 6b487a7 into main May 29, 2026
6 checks passed
@hartsock hartsock deleted the feat/editor-ux-mcp-parity branch May 29, 2026 19:46
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