From a591b810a9dc5d5fe3930da36fd9b3b538b4f239 Mon Sep 17 00:00:00 2001 From: xcaliber Date: Sat, 28 Feb 2026 19:41:59 +0000 Subject: [PATCH] Changeset 0.18.1 (#80) --- CHANGELOG.md | 67 +- VERSION | 2 +- docs/DESIGN-0.18.1.md | 244 +++++++ docs/ROADMAP.md | 49 +- extensions/builtin/mermaid-renderer/script.js | 176 +++-- src/css/styles.css | 75 +- src/index.html | 26 +- src/js/app.js | 28 +- src/js/extensions.js | 53 +- src/js/notes.js | 42 +- src/js/panels.js | 646 ++++++++++++++++++ src/js/ui-core.js | 5 + src/js/ui-format.js | 199 ++++-- 13 files changed, 1415 insertions(+), 197 deletions(-) create mode 100644 docs/DESIGN-0.18.1.md create mode 100644 src/js/panels.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fc6160..0f9f70d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,71 @@ All notable changes to Chat Switchboard. +## [0.18.1] — 2026-02-28 + +### Added +- **Side panel architecture.** Complete rewrite of the side panel system + from shared-tab layout to independent single-slot panels. Any action + (preview, notes, diagram pop-out) fills the slot, replacing whatever + was there — no tabs, no association between panel types. +- **Panel registry** (`PanelRegistry`): named panels with independent + open/close state, scroll/state preservation across switches, keyboard + shortcuts (Ctrl+\ cycle, Ctrl+Shift+\ toggle dual-view). +- **Dual-view mode**: two panels side-by-side via CSS grid with a + drag-adjustable split ratio (0.2–0.8 range, 6px divider handle). + Toggle button in header actions area alongside fullscreen and close. +- **Live HTML preview**: streaming responses update the preview iframe + in real-time (500ms debounce). Extracts the last fenced HTML block + from partial content and renders it as the response streams in. +- **Extension pop-out**: `⧉` button on rendered extension blocks + (mermaid, KaTeX, etc.) clones the content into the preview iframe + and opens the side panel. +- **Extension UI primitives** (`ctx.ui`): seven methods exposed to + browser extensions through the scoped extension context: + - `toast(msg, type)` — toast notifications via `UI.toast()` + - `openPreview(html)` — load HTML into side panel preview iframe + - `isDark()` — theme detection without DOM sniffing + - `isMobile()` — viewport width check (≤768px) + - `isPanelOpen()` — side panel container visibility + - `confirm(msg, opts)` — modal confirm dialog (Promise\) + - `createMenu(anchor, opts)` — popup menu (unchanged from stub) +- **Mermaid context-aware expand**: single `⛶` button replaces the + previous two-button (pop-out + fullscreen) approach. When the side + panel is open, expand pops the diagram into it; when closed, expand + goes fullscreen. +- **Mermaid fullscreen close button**: 40px circular close button + overlaid top-right in fullscreen mode, 48px on mobile. Fixes the + previous Escape-key-only exit which was unusable on touch devices. +- **Mobile side panel**: swipe navigation between panels (80px + threshold, 1.5× horizontal-to-vertical ratio), tap-to-close overlay, + responsive auto-collapse of dual mode on narrow viewports, enlarged + touch targets for all panel controls. +- **Side panel header label**: simple text label showing the active + panel name, replacing the previous tab bar UI. + +### Changed +- Side panel model changed from tabbed (Preview + Notes tabs visible + simultaneously) to single-slot (one panel fills the space, actions + replace it). No user-selectable tabs — content is entirely + action-driven. +- Dual-view toggle button moved from tab bar (dynamically injected) + to static header actions area next to fullscreen and close. +- Mermaid extension refactored to use `ctx.ui` primitives exclusively. + Zero direct references to `UI.*`, `PanelRegistry.*`, or DOM class + sniffing for theme detection. Extension remains fully self-contained + in `extensions/builtin/mermaid-renderer/`. +- Mermaid source copy uses `ctx.ui.toast()` instead of inline button + text swap. Theme detection uses `ctx.ui.isDark()` instead of manual + `document.body.classList.contains('dark-theme')` check. +- Side panel outer resize minimum bumped to 480px in dual mode (vs + 280px single). + +### Removed +- Tab bar UI (`.side-panel-tabs`, `.side-panel-tab`, tab rendering + logic). Panels no longer have user-selectable tabs. +- Separate pop-out and fullscreen buttons in mermaid toolbar (collapsed + into single context-aware expand button). + ## [0.18.0] — 2026-02-28 ### Added @@ -1080,4 +1145,4 @@ All notable changes to Chat Switchboard. ### Changed - Backward-compatible API routes with v0.8 field name aliases -- User model preferences table (`user_model_settings`) +- User model preferences table (`user_model_settings`) \ No newline at end of file diff --git a/VERSION b/VERSION index 47d04a5..6b2d58c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.18.0 \ No newline at end of file +0.18.1 \ No newline at end of file diff --git a/docs/DESIGN-0.18.1.md b/docs/DESIGN-0.18.1.md new file mode 100644 index 0000000..8dc82cc --- /dev/null +++ b/docs/DESIGN-0.18.1.md @@ -0,0 +1,244 @@ +# Design — v0.18.1 Side Panel Architecture + +## Problem + +The side panel is a single `