Changeset 0.37.10 (#222)

Co-authored-by: gobha <jasafpro@gmail.com>
Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
2026-03-21 23:39:23 +00:00
committed by xcaliber
parent 37b639c9c8
commit 8d8a118232
52 changed files with 3209 additions and 13811 deletions

View File

@@ -1,5 +1,141 @@
# Changelog
## [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 `<script>` tags for deleted JS files (api.js,
ui-core.js, pages.js, chat-pane.js, pane-container.js), removed `<link>`
tags for deleted CSS files (chat.css, panels.css, pane-container.css,
chat-pane.css)
- `user-menu.js` — auto-surface-filtering via `body[data-surface]`, default
navigation handler, `extraItems` prop for caller-specific menu additions
- `sw-chat-pane.css` — added styles for code block (header, language badge,
copy button), emoji picker (tabs, grid, search), markdown toolbar, error
banner, stop button, load-more pagination, message footer (time + actions),
message action buttons, task list checkboxes
- `server/version.go``0.37.9``0.37.10`
- `VERSION``0.37.9``0.37.10`
### Design Notes
- **Surface manages navigation, ChatPane renders** — ChatPane runs in
`standalone=false` mode. The surface sidebar handles chat/channel selection;
ChatPane receives `channelId` as a prop and just renders the conversation.
No duplicate history dropdowns.
- **UserMenu is self-sufficient** — every surface imports `<UserMenu>` and
gets auto-filtered surface links, RBAC-gated admin items, and navigation
handling. No per-surface routing boilerplate.
- **Features deferred by design** — Projects, KB management, extension panels,
notification panel don't belong on the chat surface. Each earns its way back
as its own surface or shell-level feature in v0.37.12+.
- **Preview panel deferred** — the old iframe preview was fragile. Needs design
discussion for proper implementation.
- **Emoji picker is a gag for the release** — but also legitimately useful for
channels. Categorized grid with recents, ~200 emoji across 7 categories.
### Known Issues
- **Tools popup empty** — requires LLM providers configured (API keys). Works
as designed; tools list populates when providers are active.
- **ES module caching** — internal module imports use bare relative paths
(`./sidebar.js`) with no version query. Browser module cache persists across
page loads. In dev, requires version bump or browser restart to pick up
changes. Production is unaffected (fresh loads on version bump).
- **base.html legacy scripts** — `sb.js`, `app-state.js`, `events.js`,
`switchboard-sdk.js` still loaded globally for extension surface compat.
Full base.html cleanup deferred to post-v0.37.13.
## [0.37.9] — 2026-03-21
### Summary