From 0bd79a438e0a15cb166da3ee3207422f8faebe21 Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 13 Feb 2026 02:31:01 +0800 Subject: [PATCH] feat: add hub persistence to config for CLI and Web UI Hub sources are now saved in config.yaml (both global and project), replacing the Web UI's localStorage-based approach. This allows CLI and UI to share the same hub list. - Add HubConfig/HubEntry types and helper methods (resolve, add, remove) - Add CLI subcommands: hub add/list/remove/default - Search --hub now resolves saved labels (e.g. --hub team) - Add REST API endpoints for hub CRUD (GET/PUT/POST/DELETE /api/hub/saved) - Migrate SearchPage from localStorage to server API calls --- CHANGELOG.md | 25 +++ cmd/skillshare/hub.go | 84 +++++++- cmd/skillshare/hub_manage.go | 283 +++++++++++++++++++++++++ cmd/skillshare/main.go | 2 +- cmd/skillshare/search.go | 88 +++++++- internal/config/config.go | 14 ++ internal/config/hub.go | 81 +++++++ internal/config/hub_test.go | 211 ++++++++++++++++++ internal/config/project.go | 1 + internal/server/handler_hub_saved.go | 161 ++++++++++++++ internal/server/server.go | 4 + tests/integration/hub_manage_test.go | 171 +++++++++++++++ tests/integration/search_index_test.go | 62 ++++++ ui/src/api/client.ts | 27 +++ ui/src/pages/SearchPage.tsx | 128 +++++++---- website/docs/commands/hub.md | 97 ++++++++- website/docs/commands/search.md | 25 ++- 17 files changed, 1409 insertions(+), 55 deletions(-) create mode 100644 cmd/skillshare/hub_manage.go create mode 100644 internal/config/hub.go create mode 100644 internal/config/hub_test.go create mode 100644 internal/server/handler_hub_saved.go create mode 100644 tests/integration/hub_manage_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 77045a7c2..edf7da573 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## [0.12.1] - 2026-02-13 + +### Added +- **Hub persistence** — saved hubs stored in `config.yaml` (both global and project), shared between CLI and Web UI + - `hub add ` — save a hub source (`--label` to name it; first add auto-sets as default) + - `hub list` — list saved hubs (`*` marks default) + - `hub remove