feat: add ft web browser dashboard#155
Open
mrkpatchaa wants to merge 9 commits into
Open
Conversation
Add a browser-based bookmark observatory accessible via `ft web`. Uses Node.js built-in HTTP — no new npm dependencies. - src/web.ts: HTTP server with REST API (/api/overview, /api/bookmarks, /api/count, /api/bookmarks/:id) and an inline SPA (Tailwind + Chart.js + Alpine.js via CDN). Binds to 127.0.0.1 only. Exports createWebServer() for testing. - src/bookmarks-viz.ts: export buildVizData() and VizData interface so the web server can reuse the terminal viz aggregation logic. - src/cli.ts: register `ft web [--port <n>] [--no-open]` command. - tests/web.test.ts: 18 integration tests covering all routes, filters, pagination, and error paths. - tests/bookmarks-viz.test.ts: add buildVizData() unit test. - README.md: document ft web in quick start and commands table.
Add /api/suggestions?field=author|category|domain&q=prefix endpoint backed by getFilterSuggestions() in bookmarks-db.ts (prefix-match, ordered by frequency). Wire Alpine.js custom dropdowns to each filter input so suggestions appear as the user types (debounced 300ms) and disappear on blur. Selecting a suggestion fills the input and triggers a search. Tests: 30/30 pass (11 new)
Author, category, and domain filters are now button-triggered dropdowns with a search input inside the panel and a scrollable option list. Key changes: - Click the trigger button to open; click outside to close - Search input inside panel filters list via /api/suggestions in real-time - Active selection highlighted; 'Clear selection' row shown when set - toggleDropdown() closes sibling dropdowns, fetches initial list, and auto-focuses the search input - fetchSuggestions() always loads (empty prefix = top-N by freq) - Tests renamed and assertions updated for the dropdown pattern
…ling bookmarksLoading
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.
Add a browser-based bookmark observatory accessible via
ft web. Uses Node.js built-in HTTP — no new npm dependencies.ft web [--port <n>] [--no-open]command.