feat: add shared read-only CodeMirror viewer - #215
Merged
Conversation
Add an injected CodeMirror viewer for text, JSON, SQL, XML/HTML, and plain Markdown source. Share presentation/search extensions with the editable editor while keeping history, completions, hover, schema, drag/drop, tab state, and app synchronization isolated. Co-Authored-By: OpenAI Codex <noreply@openai.com> Claude-Session: Codex
This was referenced Jul 13, 2026
Open
Restore an explicit tab stop after editable=false removes contenteditable focusability, allowing viewer.focus(), selection/copy, and Mod-f search to work in real browsers. Co-Authored-By: OpenAI Codex <noreply@openai.com> Claude-Session: Codex
Collaborator
Author
|
CI follow-up: the first E2E run exposed that |
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.
What & why
Adds the reusable read-only CodeMirror foundation from #213 behind an injected
app.CodeViewerseam.The viewer supports complete text, JSON, SQL, XML/HTML source, and plain Markdown source with line numbers, local search, selection/copy, compartment-based wrapping/language changes, correct detached-document roots, and idempotent teardown. The editable SQL editor now shares only presentation/search extensions and existing
.sql-*token classes; history, completion, hover, schema loading, drag/drop, undo/tab parking, and app-state synchronization remain editor-only.Adds only
@codemirror/lang-jsonand@codemirror/lang-xml. Measured single-file bundle impact: +18,063 bytes raw / +7,059 bytes gzip. Production dependency audit reports 0 vulnerabilities.Closes #213
Verification
npm test— 77 files, 2,390 tests, coverage gate greennpm run build— single-file artifact succeedsSIGTRAPbefore test code; CI is the authoritative three-engine runChecklist
npm testpasses (the per-file coverage gate is non-negotiable)npm run buildsucceeds (single-filedist/sql.html)src/core/, network insrc/net/(injected fetch), DOM insrc/ui/CHANGELOG.md([Unreleased]) updated