feat(app): tab path bar, theme sync, view cycle, vim toggle, Word export + MCP parity#105
Merged
Conversation
…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>
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.
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
stateset_themeboth → edit → preview(same as the per-tab mode icon)view_mode@replit/codemirror-vim)set_vim.docxviascrybe-docx; Mermaid blocks render to PNGs that embed the source (round-trips viascrybe_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 bystate); MCPset_theme/view_mode/set_vimwrite signal files the frontend polls and applies through the same handlers as the toolbar buttons (mirrors the existingclose_tab/reloadpattern).exportand the Export button both shell toscrybe-docx.Incidental fixes in
scrybe-plugin-docxbuild-backend(setuptools.backends.legacy:build) → package couldn't install /scrybe-docxwas never on PATH. Switched tosetuptools.build_meta.scrybe_mermaid.embed).monkeypatchin the mermaid-fallback test that only passed whenmmdcwas absent.Verification
tsc+vite build✓;cargo clippy -- -D warningsclean (app + mcp-server);cargo fmt --checkcleanstate.jsonreflects theme/view/vim changes and tracks the active file on tab open. Confirmed a generated.docxround-trips its embedded Mermaid source viascrybe_mermaid.extract.🤖 Generated with Claude Code