v0.3.0 — Read-only frontend (Reader/Graph/Ops/Ask) + relations endpoint fix#8
Merged
Conversation
Adds a thin, zero-dependency browser frontend that talks to the existing BrainDB API via fetch — no new endpoint, no router edit, no schema migration, no Python dependency. All five files live under a new `frontend/` directory; nothing in `braindb/` is touched. Three views in one SPA: - Reader — wiki index in the left rail (canonical_name parsed from the existing preview, so no N+1 over the index), the wiki body in the centre (purpose-built renderer for the project's body grammar: meta header, headings, > **Summary:** / **Disambiguation:** callouts, <!-- section:slug --> dividers, GFM tables, lists, [[ref:UUID]] and [[ref:UUID|display]] citation chips including the grouped form), and a relations panel on the right grouping every relation the entity has (summarises / tagged_with / derived_from / refers_to / ...). A citation chip or relation row opens a slide-over drawer with the cited entity's content plus its own relations (drill-down). - Ops — sober dashboard surfacing live pipeline state: counts from /memory/stats, the wiki_job queue from /wiki/jobs (pending consolidate rows highlighted so duplicate-draining is visible), recent activity from /memory/log (auto-refreshes every 30s), and the always-on rules from /memory/rules. - Ask drawer — thin pass-through to POST /api/v1/agent/query (the same backend the agent skill uses). Spinner with elapsed-seconds counter; markdown rendering of the answer including ref-chip resolution. The drawer flags that the agent may save / relate when asked to, matching skill behaviour. Pure-read except where intentional: only POSTs are /memory/context (search) and /agent/query (Ask). No /memory/sql, no direct DB access. Design language: Wikipedia-serious, 2026-professional — near-monochrome palette with one restrained encyclopedic-blue accent, refined serif (Charter/Georgia) for body, clean grotesque for UI, hairline rules, no candy, light/dark via `data-theme` on <html>. Fully keyboard navigable (/ to focus search, Cmd/Ctrl+K to open Ask, Esc to close drawers). Run locally: python -m http.server 8080 -d frontend # then open http://localhost:8080
…e-pill results Locks in the working vis-network-based graph view and the Reader-side search refactor as a baseline on a new branch (feat/wiki-frontend-2), so subsequent improvements can be reverted easily. Frontend changes (no backend touched): - Graph tab: replaces the earlier Cytoscape attempt with vis-network. Wiki = blue rounded-rectangle (label inside), fact = grey ellipse, thought = dashed ellipse, keyword = amber diamond, source/datasource = teal database glyph, rule = purple box. Edges colour-coded by relation_type, labels hidden by default and revealed on hover or when a node is selected. IntersectionObserver-driven mount centres the graph correctly even when the Graph tab starts hidden. 300-node soft cap with toast on overflow. - Reader rail search: refactored to runReaderSearch() called directly from both submit and a 180 ms input-debounce (no requestSubmit indirection that silently failed). Each result row shows a coloured type-pill (WIKI / FACT / KEYWORD / etc.) and a clean preview snippet (strips wiki:meta comments + leading # Title before display). A breakdown bar at the top shows the type mix (e.g. "wiki 8 · fact 4"). - Round-2 fixes carried over: [hidden] !important rule, previewCanonical- Name fallback to # Title, loadStats reads entity_counts, console.error on every Ops catch, callout no longer escapes its own <strong>.
…pills - Graph: physics one-shot then off (no drift, no jiggle on click), expandNode places new nodes in a deterministic ring around the expand center (no stacking), explicit zoom-in/out buttons, click = open drawer + auto-expand, source/datasource node capped to a small cylinder via widthConstraint. - Universal entity resolver: chip placeholders + resolveAndPatch in renderRelations, the entity drawer, loadJobs, loadLog, and the graph search dropdown. No raw UUIDs visible in normal flow. - Drawer: title uses canonical name, "Open full wiki" link for wikis, "Load more" pagination for big bodies, file_path shown as copy-able code (browsers block file:// from http:// pages — the link was inert). - Ops: jobs and activity-log tables rewritten with actor pills (Maintainer / Writer / Scheduler / Watcher), readable target-wiki and entity chips, zebra stripes, and a NOTE column that distinguishes benign rationale from real errors. - Reader: elastic-debounced search with type-pill breakdown bar, full half-page (50vh) results dropdown, retired-tag in the graph search results too.
- README.md: embed the YT walkthrough thumbnail (same pattern as knowledge-robot) at the very top, and add a "Frontend (optional, read-only)" section pointing at frontend/README.md. - CHANGELOG.md: new [0.3.0] section enumerating the Reader / Graph / Ops / Ask views, the universal entity-chip resolver, the YouTube walkthrough, and crediting @WarGloom's relations-endpoint fix (PR #5) that landed since v0.2.0. - CLAUDE.md: one-line pointer to frontend/ in the project tree so future agents know it exists. Primary instructions unchanged.
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.
Summary
frontend/— vanilla-JS, no build step, no npm. Three views (Reader / Graph / Ops) + an Ask drawer that talks to the agent endpoint.[type-pill] canonical-namechip.mainafter v0.2.0 was cut.Walkthrough video
▶ https://youtu.be/AJ7iMOj4vvA
Test plan
file://link)/memory/*calls still respond as before