# Changelog ## [0.37.11] — 2026-03-22 ### Summary Notes surface built as full Preact surface, replacing the v0.37.9 template mount. Sidebar with folder tree, tag cloud, search, and UserMenu. NotesPane runs `standalone=false` — the surface sidebar owns filter controls. Cross-surface fixes: Menu primitive CSS was never loaded (now added to base.html), Avatar initials fixed for single-word names. ### New - `src/js/sw/surfaces/notes/index.js` — NotesSurface root, self-mounts at `#notes-mount` - `src/js/sw/surfaces/notes/use-workspace.js` — sidebar toggle + active note (sessionStorage) - `src/js/sw/surfaces/notes/use-sidebar.js` — folders, tags, search, WS live updates - `src/js/sw/surfaces/notes/sidebar.js` — search input, folder/tag sections, UserMenu footer - `src/js/sw/surfaces/notes/sidebar-folders.js` — collapsible folder tree with counts - `src/js/sw/surfaces/notes/sidebar-tags.js` — collapsible tag cloud with active state - `src/js/sw/surfaces/notes/notes-workspace.js` — workspace header + NotesPane - `src/css/sw-notes-surface.css` — surface layout (sidebar + workspace + mobile responsive) ### Changed - `src/js/sw/components/notes-pane/index.js` — handleRef expanded with `setFolder`, `setTagFilter`, `setSearchQuery`, `getFolder`, `getTagFilter`; threads `standalone` prop to NoteList - `src/js/sw/components/notes-pane/note-list.js` — `standalone=false` hides search row, folder dropdown, tag cloud (surface sidebar owns these) - `src/js/sw/primitives/avatar.js` — single-word names show first letter only ("admin" → "A" not "AD"); multi-word unchanged ("John Doe" → "JD") - `server/pages/templates/surfaces/notes.html` — full rewrite: crash catcher + `#notes-mount` + Preact boot (mirrors chat.html pattern) - `server/pages/templates/base.html` — added `sw-primitives.css` link (Menu primitive was unstyled on all surfaces); added `css-notes` conditional - `src/css/surfaces.css` — deleted `.surface-notes*` rules (9 lines, replaced by `sw-notes-surface.css`) ### Design Notes - **Sidebar ↔ NotesPane coordination:** write-only via handleRef. Sidebar sets folder/tag/search on the kit; kit reloads its own list. No bidirectional sync needed because `standalone=false` hides the kit's own filter controls. - **Menu primitive bug:** `sw-primitives.css` was never loaded in `base.html`. The Menu component (`sw-menu__item`) had no hover, no cursor, no background. Chat surface masked this by using its own `.sw-chat-surface__context-menu` styles. Fixed globally — all surfaces now get proper Menu styles. - **Kit enhancements deferred:** markdown toolbar, wikilink hover preview, breadcrumbs, split view, templates, slash commands, graph minimap all moved to v0.37.14 pane audit. ### Cumulative Layer Status | Layer | Version | Status | |-------|---------|--------| | Preact+htm vendor | v0.37.2 | ✅ | | Layer 0: Primitives | v0.37.11 | ✅ (Menu CSS fix, Avatar fix) | | Layer 1: SDK | v0.37.10 | ✅ (8 modules) | | Layer 1.5: ChatPane | v0.37.10 | ✅ (13 files) | | Layer 1.5: NotesPane | v0.37.11 | ✅ (10 files, standalone prop) | | Layer 2: Shell | v0.37.4 | ✅ (5 components) | | Surface: Login | v0.37.5 | ✅ | | Surface: Settings | v0.37.7 | ✅ | | Surface: Admin | v0.37.6 | ✅ | | Surface: Team Admin | v0.37.7 | ✅ | | Surface: Chat | v0.37.10 | ✅ | | Surface: Notes | v0.37.11 | ✅ | ## [0.37.10] — 2026-03-21 ### Summary Scorched earth rebuild of the Chat surface. The old 16-file imperative SPA (~11,500 lines of `app.js`, `chat.js`, `ui-core.js`, `projects-ui.js`, etc.) is replaced by a focused Preact surface (8 files) composing the ChatPane kit. ChatPane kit upgraded with error display, stop generation, regenerate, code block copy, markdown toolbar, emoji picker, and message pagination. Features that don't belong on the chat surface (projects, KB management, extensions, notifications) are deferred — each earns its way back as its own surface or shell-level feature. 32 files changed. +774 / −13,615. **Net: −12,841 lines.** ### New - **Chat Surface** (`src/js/sw/surfaces/chat/`) — 8 files: - `ChatSurface` root — sidebar + workspace + ToastContainer + DialogStack - `useWorkspace` — active conversation coordinator, sessionStorage restore - `useSidebar` — channels, chats, folders data; search filter; WS live updates; CRUD (rename, delete, move-to-folder, create folder) - `Sidebar` — search bar, "New Chat" button, collapsible Channels section, collapsible Chats section with folder grouping, context menus, desktop collapse toggle - `SidebarChannels` — DMs + named channels, unread badges - `SidebarChats` — personal AI chats, folder grouping, context menus (rename, delete, move to folder) - `ChatWorkspace` — workspace header (sidebar toggle, tools button) + ChatPane in `standalone=false` mode (surface manages navigation) - `ToolsPopup` — scrollable category-based tool toggles with persistence, `useTools` hook loads from API - **ChatPane Kit enhancements** (4 new components in `chat-pane/`): - `CodeBlock` — language badge + copy button, code block extraction from rendered markdown HTML - `MessageActions` — per-message toolbar: regenerate, copy text, delete. Appears on hover/focus - `MarkdownToolbar` — bold, italic, code, code block, link, bullet list, numbered list, heading, blockquote. Wraps selection with markdown syntax. Keyboard shortcuts: Ctrl+B, Ctrl+I, Ctrl+E - `EmojiPicker` — categorized grid (7 categories), search, recently used (localStorage). Inserts at cursor position - **ChatPane Kit upgrades** (6 modified files): - `index.js` — error banner rendered from `error` state, stop button wiring, new kit re-exports - `use-chat.js` — `regenerate(msgId)`, `deleteMessage(msgId)`, `loadMore()` pagination, `hasMore`/`loadingMore` state - `message-list.js` — "Load older messages" pagination button, scroll position preservation on prepend, ARIA `role="log"`, regenerate/delete wiring per message - `message-bubble.js` — CodeBlock rendering with copy+language badge, MessageActions toolbar (regenerate/copy/delete), relative timestamps - `message-input.js` — MarkdownToolbar, EmojiPicker, stop button (replaces send during streaming), ARIA labels, keyboard format shortcuts - `markdown.js` — `marked.setOptions()` with GFM+breaks, task list checkbox rendering via custom renderer - **UserMenu auto-surface-filtering** — reads `body[data-surface]`, auto- includes links to all other surfaces (Notes, extensions), filters out the current surface. Default `handleSelect` navigates via `location.href`. Every surface gets the same menu minus itself. - **`sw-chat-surface.css`** — sidebar + workspace flex layout, responsive mobile overlay, sidebar collapse, tools popup, context menus (~600 lines) ### Deleted **16 JS files (~11,500 lines):** - `src/js/app.js` (589) — SPA bootstrap, sidebar, init - `src/js/api.js` (995) — REST client, auth, token management - `src/js/chat.js` (1,344) — message rendering, streaming, CM6 input - `src/js/chat-pane.js` (160) — legacy ChatPane wrapper - `src/js/channel-models.js` (437) — channel model management UI - `src/js/extensions.js` (506) — extension panel, package management - `src/js/files.js` (857) — file upload/staging UI - `src/js/knowledge-ui.js` (556) — knowledge base toggle popup - `src/js/notifications.js` (431) — notification bell + dropdown - `src/js/pages.js` (349) — admin page rendering - `src/js/pane-container.js` (589) — split pane resize manager - `src/js/panels.js` (454) — side panel registration + lifecycle - `src/js/projects-ui.js` (2,090) — project sidebar section - `src/js/tokens.js` (167) — token count display - `src/js/tools-toggle.js` (245) — tools toggle popup - `src/js/ui-core.js` (1,699) — core UI: sidebar, messages, context menus **5 CSS files (~1,650 lines):** - `src/css/chat.css` (648) — old chat area, sidebar, workspace, input - `src/css/chat-pane.css` — legacy chat pane styles - `src/css/panels.css` — side panel styles - `src/css/pane-container.css` — split pane layout - `src/css/notifications.css` — notification bell + dropdown ### Changed - `chat.html` — rewritten from ~387-line SPA scaffold to ~50-line Preact boot (same pattern as settings/admin/team-admin surfaces) - `base.html` — removed `