Feat v0.4.2 tags search
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 3s
CI/CD / test-frontend (pull_request) Successful in 6s
CI/CD / test-go-pg (pull_request) Successful in 2m37s
CI/CD / test-sqlite (pull_request) Successful in 2m40s
CI/CD / build-and-deploy (pull_request) Successful in 1m53s

Tags table (ext_notes_tags), tag CRUD API, tag filtering in sidebar,
tag pills on note cards, drag-and-drop note-to-folder moves, folder
context menu replacing prompt() hack. Notes package bumped to v0.3.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 13:42:03 +00:00
parent 03c182b9d1
commit f8b42187e7
7 changed files with 661 additions and 48 deletions

View File

@@ -2,6 +2,45 @@
All notable changes to Switchboard Core are documented here.
## v0.4.2 — Tags + Search
### Added
- **Tags table** (`ext_notes_tags`): note_id, tag columns with indexes on
both for bidirectional lookup. Many-to-many relationship via join table.
- **Tag CRUD API**: 3 new Starlark handlers — list all unique tags, get tags
for a note, replace tags for a note (delete-all + reinsert). Tags are
normalized to lowercase, trimmed, and deduplicated on save.
- **Tags in list/get/search**: `_list_notes` batch-fetches all tags in a
single query and attaches a `tags` array to each note item. `_get_note`
includes tags. `_search_notes` now matches search terms against tags.
- **Tag cascade delete**: Hard-deleting a note also removes its tag rows.
- **Tag input in editor**: `TagInput` component with removable pills, text
input (comma or Enter to add), and autocomplete dropdown populated from
all existing tags.
- **Tag pills on note cards**: `NoteCard` renders up to 3 tag pills with
"+N" overflow indicator for notes with many tags.
- **Tag filter in sidebar**: `TagFilter` component displays all unique tags
as clickable pills. Clicking toggles client-side filtering of the note
list by that tag.
- **Drag-and-drop note moves**: `NoteCard` is draggable (HTML5 drag/drop).
`FolderNode`, "All Notes", and "Unfiled" items are drop targets. On drop,
calls the existing move-note API.
- **Folder context menu**: Replaced `prompt()` hack with a proper right-click
popup menu showing "Add subfolder", "Rename", and "Delete" actions. Positioned
at click coordinates, dismissed on outside click.
- **Updated stats**: `/stats` response now includes `tags` count (unique).
### Data model
| Table | Columns |
|-------|---------|
| `ext_notes_tags` | note_id, tag |
### Notes package version
Bumped from 0.2.0 → 0.3.0. 15 API routes (12 existing + 3 new).
## v0.4.1 — Folders + Navigation Tree
### Added