Skip to content

v0.3.0 — Read-only frontend (Reader/Graph/Ops/Ask) + relations endpoint fix#8

Merged
dimknaf merged 4 commits into
mainfrom
feat/wiki-frontend
May 25, 2026
Merged

v0.3.0 — Read-only frontend (Reader/Graph/Ops/Ask) + relations endpoint fix#8
dimknaf merged 4 commits into
mainfrom
feat/wiki-frontend

Conversation

@dimknaf
Copy link
Copy Markdown
Owner

@dimknaf dimknaf commented May 25, 2026

Summary

  • Read-only frontend under frontend/ — vanilla-JS, no build step, no npm. Three views (Reader / Graph / Ops) + an Ask drawer that talks to the agent endpoint.
  • Universal entity-chip resolver so no raw UUID surfaces in normal user flow — every UI render that previously showed a UUID now resolves to a [type-pill] canonical-name chip.
  • Graph tab with deterministic ring expansion, one-shot physics (graph never drifts under the mouse), type-shaped nodes, retired-wiki badge in the seed search.
  • Ops tab rewritten: actor pills (Maintainer / Writer / Scheduler / Watcher), readable target-wiki + entity chips, zebra stripes, NOTE column that distinguishes benign rationale from real errors.
  • README embeds the new YouTube walkthrough at the top.
  • Merges @WarGloom's relations-endpoint fix (PR #5) that landed on main after v0.2.0 was cut.

Walkthrough video

https://youtu.be/AJ7iMOj4vvA

Test plan

  • Reader: open a wiki, click citation chips, search the rail (debounced) and confirm the type-pill breakdown bar appears
  • Graph: seed from a wiki, click to expand, scroll/drag-pan, zoom buttons, retired-wiki badge appears in the search dropdown
  • Ops: pipeline queue + activity log render with actor pills and readable chips (no UUIDs visible)
  • Drawer: "Open full wiki" navigates correctly; "Load more" pages a big datasource body; file_path renders as copy-able code (no broken file:// link)
  • Backend untouched — agent endpoint and /memory/* calls still respond as before

dimknaf added 4 commits May 25, 2026 15:16
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.
@dimknaf dimknaf merged commit bcb94da into main May 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant