Changeset 0.21.6 (#92)

This commit is contained in:
2026-03-01 23:16:25 +00:00
parent aadba77887
commit 3423738286
17 changed files with 1210 additions and 74 deletions

View File

@@ -2,6 +2,52 @@
All notable changes to Chat Switchboard.
## [0.21.6] — 2026-03-01
### Added
- **Editor surface: document features merged in.** Article mode (outline, export, word count, focus mode) folded into the single Editor surface rather than shipping as a separate surface. One surface, two concerns: code files get tabs + tree, text files get word count + export. Chat panel on the right with show/hide toggle.
- **New file button** — Visible in both the file tree header (+ icon) and the editor toolbar ("+ New"). Creates files with smart defaults (markdown files get `# Title` scaffold).
- **Export dropdown** — Download file, Export as HTML (via marked.js + DOMPurify), Copy to clipboard. Available from editor toolbar for any open file.
- **Chat panel toggle** — Show/hide the right-side AI chat pane. Editor left pane expands to fill when chat is hidden. Toggle button in toolbar with active state indicator.
- **Word count + reading time** in status bar for text files (markdown, txt, rst, adoc). ~230 wpm calculation.
- **Save indicator** in status bar — shows "● Modified" with warning color for unsaved files.
- **Git status indicators in editor file tree** (closing v0.21.5 deferred) — Tree rows show M/A/U badges with color coding (modified=yellow, added=green, untracked=italic gray, deleted=red strikethrough).
- **Auto-save on tab/mode switch in editor surface** (closing v0.21.5 deferred) — Modified files auto-save when switching tabs or deactivating the editor surface.
- **Ctrl+Shift+F workspace search** (closing v0.21.5 deferred) — Maps to Quick Open file finder.
- **`SEED_PROVIDERS` env var** — Auto-creates global providers on startup from CSV format `provider:api_key[:name]`. Supports openai, anthropic, openrouter, venice, mistral, groq, together, fireworks, deepseek, perplexity with auto-filled endpoints. Idempotent. Blocked in production.
- **Mode selector labels** — Surface buttons in sidebar show icon + label text ("Chat", "Editor"). Labels hide when sidebar collapsed.
- **Hash Router (`router.js`)** — URL-driven direct-to-surface navigation:
- `#/chat` → default chat view
- `#/chat/ch_abc123` → open specific chat (bookmarkable)
- `#/editor` → editor surface (auto-picks workspace from project, or shows picker)
- `#/editor/ws_abc123` → editor with specific workspace
Browser back/forward works. Replaces `sessionStorage` chat restore. Workspace picker overlay when navigating without a workspace. Auto-selects if only one exists.
- **`openDirect(wsId)`** method on EditorMode — bypasses `check()` flow, registers surface directly with a given workspace ID. Used by Router for hash-based navigation.
### Fixed
- **`chat.switched` / `chat.created` events never emitted** — `selectChat()`, `newChat()`, and `sendMessage()` now emit these events. This was blocking EditorMode from detecting workspace bindings on channel switch.
- **`workspace_id` missing from channel responses** — Added to all SELECT/RETURNING/Scan paths for both SQLite and Postgres. Frontend chat objects now include `workspace_id`.
- **EditorMode.check() optimization** — Checks local `App.chats` data before API calls.
- **`defaultEndpoints` redeclared** — Renamed to `seedDefaultEndpoints` in `seed_providers.go` to avoid collision with `live_provider_test.go`.
### Removed
- **Article surface (`article-mode.js`, `article-mode.css`)** — Merged into Editor. Document features (export, word count, focus mode) are now part of the unified Editor surface. Article-specific AI tools (suggest_outline, expand_section) deferred to v0.22+ as editor extensions.
### Changed
- `editor-mode.js`: Rebuilt header with New/Export/ChatToggle buttons. File tree has header with + button. Chat panel show/hide. Word count + save indicator in status bar. `_createNewFile()`, `_exportActiveFile()`, `_toggleChat()` methods. `openDirect()` for Router.
- `editor-mode.css`: Header labels, export dropdown, chat toggle, file tree header, save indicator, word count styles.
- `chat.js`: Event emissions, `workspace_id` in chat objects, hash sync via `Router.update()`.
- `app.js`: Router initialization replaces sessionStorage restore.
- `projects-ui.js`: Project list mapping includes `workspace_id`.
- `channels.go`: `workspace_id` in all query/scan paths.
- `surfaces.js`: Updated comment (removed article reference).
- `styles.css`: Mode selector layout, router picker overlay.
- `index.html`: Removed `article-mode.css`/`article-mode.js`, added `router.js`.
- `config.go`: `SeedProviders` field.
- `main.go`: `SeedProviders()` call.
- `seed_providers.go`: `seedDefaultEndpoints` (renamed from `defaultEndpoints`).
- `ROADMAP.md`: Article→Editor merge documented. Go template pages added under v0.25.0.
## [0.21.5] — 2026-03-01
### Added