feat(ui): Library Manager — management settings screen + switcher Manage/status (LM-1/LM-2)#165
Merged
Merged
Conversation
Add a "Libraries" settings tab that lists every configured library with its icon, name, host label, and a live reachability dot, and lets you rename, re-icon, re-point the server URL (validated via isSafeServerUrl), and remove each one — plus an inline add-a-library row. The local library (this device) is guarded: its URL is locked and it can't be removed.
Add a "Manage libraries" item to the library switcher that opens the new Libraries settings tab, and a subtle per-entry connection-status dot: the active library reads Connected, others get a short, abortable GET /health probe (the always-open endpoint) that degrades to "unknown" on timeout/CORS so it never blocks or hangs the menu.
…eanup (design review) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A device can be connected to several libraries (server connections), but there was no place to manage them. Editing a library — renaming it, changing its icon, re-pointing its server URL, or removing it — was only possible through the switcher's "add" dialog or the single-server Connection tab. There was no overview of every library this device knows about, and no signal of which ones are actually reachable.
Solution
LM-1 — Libraries settings screen. A new Libraries tab under Settings that lists every library this device can open. Each row reuses
LibraryProvider's CRUD (addLibrary/updateLibrary/removeLibrary) to rename, change icon, re-point the server URL, or remove a library, plus an inline "Add a library" row. The local library ("This device") is guarded: its URL is locked and it can't be removed. Two robustness details from the design review:selectLibraryuses (setServerUrlOverride+ reload).LM-2 — Switcher Manage entry + status. The library switcher gains a "Manage libraries…" footer (opens the new tab) and a subtle, non-blocking connection-status dot per non-active row. The dot probes each remote's unauthenticated
GET /healthwith a 3s abort, degrading to a neutral "unknown" on timeout/network/CORS so it can never hang or block the menu; the local library is always "reachable" and the active library shows a checkmark instead.Before / After
Plain list: active checkmark only, no per-library status, no way to manage.
Non-active rows show a status dot (green reachable / amber unreachable), active row keeps its checkmark, and a Manage libraries… footer opens the new tab.
New Libraries tab: per-library icon/name/URL editing + add row.
All three cards: local (green, locked), active "Team server" (green + Active pill), and an amber unreachable remote with a trash button.
Icon/name editable; URL row shows the locked "This device — always available. It can't be removed or pointed at another server." hint; no trash button.
Test procedure
pnpm --filter @book.dev/sdk build && pnpm --filter @book.dev/ui build— green (build:libs).pnpm --filter @book.dev/ui typecheck/lint— green.pnpm --filter @book.dev/ui test(vitest) — green.main, after = this branch.Operational notes
localStorage; no server, migration, or account-service change./healthonly) — they never block the UI and never claim a server is "down", only "unknown", on any probe failure.title/aria-labelonly — it is not keyboard-focusable, so the status isn't reachable by keyboard-only navigation. To be tightened in a follow-up.Verify: green (build:libs + typecheck + lint + ui vitest).
Gate: design (Devon) — CLEAR WITH NITS, all nits applied (active-URL reconnect, name-on-blur, cross-ref hint, cleanup).
🤖 Generated with Claude Code
https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w