Changeset 0.17.2 (#77)
This commit is contained in:
@@ -60,7 +60,7 @@ v0.16.0 User Groups v0.17.0 Persona-KB Binding
|
||||
│
|
||||
┌───────┴──────────────┐
|
||||
│ │
|
||||
v0.17.1 SQLite Backend ✅ v0.17.2 CodeMirror 6
|
||||
v0.17.1 SQLite Backend ✅ v0.17.2 CodeMirror 6 ✅
|
||||
(dual DB) (editor bundle, chat
|
||||
│ input, ext editor)
|
||||
└───────┬──────────────┘
|
||||
@@ -286,7 +286,7 @@ Depends on: v0.17.0 DB debt cleanup (store layer is sole DB interface).
|
||||
|
||||
---
|
||||
|
||||
## v0.17.2 — CodeMirror 6 Integration
|
||||
## v0.17.2 — CodeMirror 6 Integration ✅
|
||||
|
||||
Rich editor infrastructure for the frontend. CM6 is ESM-native; the build
|
||||
step runs in Docker (esbuild → single IIFE bundle). No change to dev
|
||||
@@ -296,40 +296,44 @@ Depends on: nothing (frontend-only). Prerequisite for: extension surfaces
|
||||
(v0.21.0 editor mode). See [DESIGN-CM6.md](DESIGN-CM6.md) for full spec.
|
||||
|
||||
**Build Pipeline**
|
||||
- [ ] `src/editor/` directory: `package.json`, `build.mjs`, `index.mjs`, language/theme modules
|
||||
- [ ] `scripts/build-editor.sh`: shared build script for both Dockerfiles and local dev
|
||||
- [ ] New Docker stage (`cm6-build`): `npm ci` + `node build.mjs` → `vendor/codemirror/`
|
||||
- [ ] Both `Dockerfile.frontend` and `Dockerfile` (unified) use the shared build script
|
||||
- [ ] Bundle output: `codemirror.bundle.js` (~295KB min, ~90KB gzip) + `codemirror.bundle.css`
|
||||
- [ ] Graceful degradation: all integration points check `window.CM` — falls back to `<textarea>` if bundle unavailable
|
||||
- [x] `src/editor/` directory: `package.json`, `build.mjs`, `index.mjs`, language/theme modules
|
||||
- [x] `scripts/build-editor.sh`: shared build script for both Dockerfiles and local dev
|
||||
- [x] New Docker stage (`cm6-build`): `npm ci` + `node build.mjs` → `vendor/codemirror/`
|
||||
- [x] Both `Dockerfile.frontend` and `Dockerfile` (unified) use the shared build script
|
||||
- [x] Bundle output: `codemirror.bundle.js` (~295KB min, ~90KB gzip)
|
||||
- [x] Graceful degradation: all integration points check `window.CM` — falls back to `<textarea>` if bundle unavailable
|
||||
|
||||
**Languages (bundled)**
|
||||
- [ ] Markdown, JavaScript, JSON, SQL, HTML, CSS, YAML, Go, Python, Rust
|
||||
- [ ] Additional modes: one-line import + rebuild
|
||||
- [x] Markdown, JavaScript, JSON, SQL, HTML, CSS, YAML, Go, Python, Rust
|
||||
- [x] Additional modes: one-line import + rebuild
|
||||
|
||||
**Phase 1: Extension Editor** (admin panel)
|
||||
- [ ] `CM.codeEditor()` factory: line numbers, bracket matching, auto-indent, search/replace
|
||||
- [ ] Replace manifest `<textarea>` → CM6 JSON mode
|
||||
- [ ] Replace script `<textarea>` → CM6 JavaScript mode
|
||||
- [ ] Remove manual Tab-key handler in `admin-handlers.js` (CM6 handles it)
|
||||
- [ ] Update `saveAdminExtension()` to use `.getValue()`
|
||||
- [x] `CM.codeEditor()` factory: line numbers, bracket matching, auto-indent, search/replace
|
||||
- [x] Replace manifest `<textarea>` → CM6 JSON mode
|
||||
- [x] Replace script `<textarea>` → CM6 JavaScript mode
|
||||
- [x] Remove manual Tab-key handler in `admin-handlers.js` (CM6 handles it)
|
||||
- [x] Update `saveAdminExtension()` to use `.getValue()`
|
||||
|
||||
**Phase 2: Chat Input** (markdown mode)
|
||||
- [ ] `CM.chatInput()` factory: markdown highlighting, minimal chrome (no line numbers, no gutter)
|
||||
- [ ] Enter=send, Shift+Enter=newline keybindings
|
||||
- [ ] Auto-growing height, placeholder text
|
||||
- [ ] Wire `onChange` → `updateInputTokens()`
|
||||
- [ ] Update `chat.js`, `attachments.js`, `tokens.js` to use CM API
|
||||
- [ ] Test paste handling (plain text, code, attachments) and mobile/touch input
|
||||
- [x] `CM.chatInput()` factory: markdown highlighting, minimal chrome (no line numbers, no gutter)
|
||||
- [x] Enter=send, Shift+Enter=newline keybindings
|
||||
- [x] Auto-growing height, placeholder text
|
||||
- [x] Wire `onChange` → `updateInputTokens()`
|
||||
- [x] Update `chat.js`, `attachments.js`, `tokens.js` to use CM API
|
||||
- [x] WYSIWYG fenced code block decorations (visual container matching claude.ai UX)
|
||||
- [x] Inline code shortcut (Ctrl/Cmd+E)
|
||||
|
||||
**Phase 3: Polish**
|
||||
- [ ] Theme integration: CSS variable overrides (`--bg`, `--border`, `--accent`, etc.)
|
||||
- [ ] Dark/light mode switching (listen for theme toggle event)
|
||||
- [ ] Vim/Emacs keybinding preference in appearance settings (`@replit/codemirror-vim`, `@replit/codemirror-emacs`)
|
||||
- [ ] Vim/Emacs applies to code editor + extension editor only (never chat input)
|
||||
- [ ] SW cache: exclude `vendor/codemirror/` or add to `SHELL_FILES` with version bust
|
||||
- [ ] Update `debug.js` snapshot to include CM6 version
|
||||
- [ ] Documentation in ARCHITECTURE.md
|
||||
- [x] Theme integration: CSS variable overrides (`--bg`, `--border`, `--accent`, etc.)
|
||||
- [x] Dark/light/system mode toggle in appearance settings
|
||||
- [x] Vim/Emacs keybinding preference in appearance settings (`@replit/codemirror-vim`, `@replit/codemirror-emacs`)
|
||||
- [x] Vim/Emacs applies to code editor + extension editor only (never chat input)
|
||||
- [x] SW cache: exclude `vendor/codemirror/` with version bust
|
||||
- [x] Update `debug.js` snapshot to include CM6 version
|
||||
- [x] Documentation in ARCHITECTURE.md
|
||||
|
||||
**CI/CD**
|
||||
- [x] Path-based change detection gating (FE-only → skip BE tests, docs-only → skip all)
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user