Feat v0.4.1 folders (#23)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-go-pg (push) Successful in 2m38s
CI/CD / test-sqlite (push) Successful in 2m48s
CI/CD / build-and-deploy (push) Successful in 28s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #23.
This commit is contained in:
2026-03-29 12:23:47 +00:00
committed by xcaliber
parent 2c8dc59284
commit 03c182b9d1
7 changed files with 521 additions and 23 deletions

View File

@@ -2,6 +2,40 @@
All notable changes to Switchboard Core are documented here.
## v0.4.1 — Folders + Navigation Tree
### Added
- **Folders table** (`ext_notes_folders`): name, parent_id, creator_id,
sort_order. Indexed on parent_id and creator_id. Nested hierarchy via
parent_id foreign key (empty string = root).
- **Folder CRUD API**: 5 new Starlark handlers — list, create, update, delete
folders plus a dedicated move-note endpoint (`POST /notes/move`).
- **Navigation tree**: `FolderTree` + `FolderNode` Preact components in the
sidebar. Flat API response built into a nested tree client-side via `useMemo`.
Expand/collapse toggles, depth-based indentation, inline rename via
right-click context menu.
- **Folder filtering**: Clicking a folder filters notes by `folder_id` query
param. "All Notes" clears the filter. "Unfiled" shows notes with empty
folder_id (client-side filter).
- **Editor folder select**: Dropdown in the editor header moves notes between
folders. Shows nested hierarchy with `└` prefix indentation.
- **Folder-aware note creation**: New notes inherit the active folder's ID.
- **Delete cascade**: Deleting a folder orphans its notes (moves to Unfiled)
and reparents child folders to the deleted folder's parent.
- **Updated stats**: `/stats` response now includes `unfiled` and `folders`
counts.
### Data model
| Table | Columns |
|-------|---------|
| `ext_notes_folders` | name, parent_id, creator_id, sort_order |
### Notes package version
Bumped from 0.1.0 → 0.2.0. 12 API routes (7 existing + 5 new).
## v0.4.0 — Notes Surface
### Added