Changeset 0.19.0.1 (#82)

This commit is contained in:
2026-02-28 23:46:23 +00:00
parent 091ce2af6a
commit 748f49bedd
30 changed files with 3873 additions and 151 deletions

View File

@@ -2,6 +2,68 @@
All notable changes to Chat Switchboard.
## [0.19.0] — 2026-02-28
### Added
- **Projects / Workspaces.** Organizational containers that group related
conversations, knowledge bases, and notes into a single workspace.
Projects provide a scope-aware organizational layer above individual
channels, with support for personal, team, and global visibility.
- **Project data model.** Four new tables: `projects` (with scope, owner,
team, color, icon, settings JSONB), `project_channels` (ordered
membership with UNIQUE constraint), `project_knowledge_bases` (with
auto_search flag), and `project_notes`. Channels gain a denormalized
`project_id` FK for efficient filtering.
- **Project API.** 17 new endpoints under `/api/v1/projects`: full CRUD,
channel add/remove/list/reorder, KB add/remove/list, note
add/remove/list. Access checks enforce owner-or-team-member visibility
with owner-only delete.
- **Project KB resolution.** Knowledge bases bound to a project are
automatically available to all channels within that project. Resolution
chain extended: Persona KBs → **Project KBs** → Channel KBs →
Personal KBs. Both `BuildKBHint` (system prompt injection) and
`kbsearch` (tool-time retrieval) updated.
- **Note auto-association.** Notes created from a channel that belongs to
a project are automatically added to that project's note collection.
- **Sidebar project groups.** Projects appear as collapsible groups in the
sidebar above the existing time-based "Recent" section. Each group shows
a color dot, chat count, and an options menu (⋯) for rename, color
picker, and delete.
- **Drag-and-drop.** Drag chat items between project groups or back to
Recent. Visual feedback with outline and background highlight on valid
drop targets.
- **Right-click context menu.** Right-click any chat to move it to a
project, remove it from its current project, or create a new project
and assign in one step.
- **New Project button.** Added to the New Chat split-button dropdown for
quick project creation.
- **Channel project_id filter.** `GET /api/v1/channels` accepts
`?project_id=<uuid>` to filter by project, or `?project_id=none` for
unassigned channels. Response includes `project_id` field.
### Changed
- `renderChatList()` rewritten to support project grouping while
preserving the original time-based layout when no projects exist.
Chat items now include `draggable`, `oncontextmenu`, and drag event
handlers.
- Channel response struct, SELECT queries, and scan calls updated across
`ListChannels`, `GetChannel`, and `CreateChannel` (both Postgres and
SQLite paths) to include `project_id`.
- `resource_grants` CHECK constraint extended to include `'project'` as a
valid resource type.
- `db-validate.sh` updated: former "Dropped tables" assertions for
`projects` and `project_channels` replaced with positive checks for all
four project tables plus `channels.project_id` column check.
- Test helper truncation list updated with project junction tables.
### Fixed
- **JSON corruption defense** (hotfix carry-forward from 0.18.2):
`SafeJSON` wrapper with `scanJSON` and `scanTags` hardened helpers that
replace bare `json.RawMessage` / `pq.Array` scanning. Prevents
`encoding/json: invalid character` panics from NULL or empty columns.
- **Service worker** (hotfix carry-forward): `chrome-extension://` URL
filtering to avoid opaque response cache errors.
## [0.18.1] — 2026-02-28
### Added