Skip to content

[LKPR-141] feat: dashboard v2 visual fidelity - #344

Merged
Jessinra merged 12 commits into
mainfrom
LKPR-141-dashboard-v2-visual-fidelity
Jul 28, 2026
Merged

Jessinra merged 12 commits into
mainfrom
LKPR-141-dashboard-v2-visual-fidelity

Conversation

@jessinra-megumi-dev

Copy link
Copy Markdown
Contributor

Summary

Rebuilds all 7 Dashboard V2 pages to match the approved design mockups and resolves all visual/functional review TODO items.

Changes

Design & Visual

  • Rebuild 7 dashboard-v2 pages to match design mockups
  • Shared shell + design tokens aligned to mockups
  • Wire ScorePill/NamespaceDot + confidence % into Memories table

Functional Fixes

  • Default *_count / *_at columns to descending sort
  • Edit-drawer layout, delete confirm dialog, filter-chip counts
  • Relationship drawer, redirect, query scale, pager, refresh, align
  • Anchor Sessions search glyph inside the input
  • Restore #drawer-title id on edit-mode title input (E2E)
  • Address review TODO items 1–4

API

  • Enrich /api/health aggregate for home dashboard

Tests

  • Update E2E specs to match rebuilt dashboard-v2 UI

Checklist

  • All unit tests pass (490 passed)
  • All E2E tests pass (10 passed)
  • mypy clean
  • ruff + biome + eslint clean
  • Pre-push hook green

Diana and others added 12 commits July 28, 2026 09:32
ScorePill now follows spec §2.3 (tinted bg + saturated text, rounded-rect)
instead of a solid fill; DataTable cell snippets receive the row so columns
can render components. Memories columns render the score pill, namespace dot,
confidence as a percentage, and right-align the numeric columns.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- PageShell: drop the body <h1>/subtitle (mockups show the page name only in the
  breadcrumb; pages that need a heading render their own).
- NavRail: solid purple shield brand tile (was the ring logo.svg), add the
  border-top divider above Settings, health dot 7px.
- AppShell: page-body max-width 1280px + 24/32/40 padding.
- app.css: correct task-badge hues (+ `other`), new relation taxonomy tokens
  (neutral grey pill + relation-colored text/edges), 5-step blue heatmap ramp,
  scrim rgba(24,24,37,.34).
- primitives: relation taxonomy covers the real backend vocabulary + design set;
  relationColor() exposes edge colors. RelationPill now renders grey-bg/colored-text.
- icons: Review nav icon is the inbox tray, not a speech bubble.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Parallel rebuild of every page against the design visuals/mockups:
- Home: greeting header, Knowledge Health card (status ring + freshness/
  confidence/dup-risk bars + 2x2 substats), action stat-tiles, activity feed.
- Query: weighted signal-contribution bars, corrected colors, full-bleed
  composer band, big combined-score badge, "why it ranked" rows.
- Links: new SVG GraphView + Graph/Links toggle, relation legend, corrected
  table + sorting + client-side pagination (fixes tall-render timeout).
- Review: segmented Suggestions/Stale tabs, relation pills, per-row accept/
  reject, row->drawer.
- Sessions: two-row cards, hollow timeline nodes, task badges, drawer pills.
- Metrics: single heading, blue aggregate heatmap, per-tool tinted heatmaps,
  redesigned volume card, dark tooltip.
- Settings: 6-card layout + sticky sub-nav, weight bars + live sum badge,
  ToggleSwitches, global save bar, export/import tiles.
- app.css: define border-subtle / surface-raised / text-secondary tokens.

Features degrade gracefully pending backend (stale endpoint, suggestion
relation, session duration/memory_count).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adapt home/links/review/settings specs to the new DOM (StatTile links,
link-row selectors, segmented Review tabs, regrouped Settings sections +
single save bar). Functional suite green at 50/50; no product changes needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1. Memories sort-by-links now works — sort by a correlated link-count subquery
   in search_memory_rows (link count isn't a real column, so it previously fell
   back to updated_at).
2. Memory detail drawer view mode redesigned to match the mockup: READ-ONLY
   badge, grey conf/uses/links/updated chips, and labeled boxed Namespace/Score/
   Description/Content fields (was an inline meta row + plain text).
3. Show-deleted control is now a bordered .tbtn button that toggles an active
   state (was a toggle switch) — matches Memories.dc.html.
4. Query score bars are normalized against the actual result set (top result
   fills the list track; the strongest signal fills the inspector bar) instead
   of a fixed denominator that left every bar looking empty.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
isNumericColumn only matched an exact key list, so `links_count` (and
`usage_count`/`updated_at`) were treated as text — clicking the Links header
sorted ascending, surfacing zero-link rows and reading as "sort not working".
Add a `*_count` / `*_at` suffix heuristic so these columns default to
descending (most-linked first). Backend sort was already correct.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…p counts

- Memory drawer edit mode now matches the mockup: title becomes a bordered
  input in the header, a Namespace dropdown + Score row (replacing Source type),
  and a clean "Delete this memory" section (label/desc left, Soft-delete +
  Delete buttons right) — no red box.
- Delete / soft-delete route through the styled ConfirmDialog modal instead of
  the browser's native confirm() (which "didn't show").
- Filter-chip counts render as muted text (mockup .chip .n), not filled dark
  badges; active-chip colors aligned to the mockup tokens.
- Namespace is now an editable field (added to MemoryUpdate + repository
  whitelist) so the drawer dropdown persists.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…fresh, align

- RelationshipDrawer is now vertical (Source card → ↓ + relation → Target card)
  with Source/Target role labels, matching the mockup (was side-by-side).
- Clicking a memory card in the relationship drawer redirects to
  /memories?open=<id> and opens that memory's drawer. Bridged id→lore_id on the
  Links/Review pages (the API serializes `id`, so lore_id was undefined and the
  nav hit ?open=undefined).
- Query result bars are relative to a perfect 1.0 (a 0.16 result fills ~16%),
  not to the top result; the bar fills to the combined score.
- Memories pagination matches the mockup: "1–50 of N" left, chevron buttons +
  "Page X of Y" right, comma-formatted, no page-size dropdown.
- Added the refresh icon button to the memories toolbar.
- Fixed the search bar / table alignment (removed the toolbar/chip horizontal
  inset so they're flush with the table card).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

  • Total: 78%
  • Workflow run: 30334035139
  • HTML artifact: coverage-html

The report is also available in the GitHub Actions job summary.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR (LKPR-141) rebuilds the seven dashboard-v2 (Svelte 5) pages to match the approved mockups, resolves a batch of visual/functional review TODOs, and enriches the /api/health endpoint with portfolio-level aggregates and composite sub-scores to feed the new home dashboard. It fits into the dashboard-v2 effort layered on the existing 6-layer backend (routes → handler → processor → domain service → repository), touching only presentation/API-shaping code plus one new read-only aggregate query.

Changes:

  • Rebuild all 7 dashboard-v2 pages (home/memories/links/query/metrics/sessions + review/settings strings), add graph view, delete-confirm dialogs, filter-chip counts, and fix default descending sort for *_count/*_at columns.
  • Enrich get_health with composite/status/freshness/confidence/dup_risk and aggregate fields backed by a new MemoryStore.get_aggregate_stats(); add links_count sort via correlated subquery and allow editing namespace.
  • Update E2E specs to match the rebuilt UI selectors/tabs.

Reviewed changes

Copilot reviewed 46 out of 46 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/lorekeeper/dashboard/handler.py Enriches get_health aggregate; verified variables defined and math bounded.
src/lorekeeper/domains/memory/repository.py New get_aggregate_stats, links_count sort subquery (injection-safe), namespace added to update allowlist.
src/lorekeeper/dashboard/routes/memories.py Adds namespace to MemoryUpdate; edit path wired end-to-end.
src/dashboard_v2/src/routes/query/+page.svelte Query page rewrite; double-applies weights to already-weighted signal scores and has a dangling comment.
src/dashboard_v2/src/routes/sessions/+page.svelte Timeline card/toolbar restyle; search glyph anchored inside input.
src/dashboard_v2/src/lib/sort.ts _count/_at suffix heuristic; used only for default direction, so timestamp sort is unaffected.
src/dashboard_v2/tests/*.spec.ts E2E selector/tab updates for rebuilt UI (.stat-tile, .toast-pill, tr.link-row, new tab names).
Comments suppressed due to low confidence (1)

src/dashboard_v2/src/routes/query/+page.svelte:88

  • The debug endpoint already returns per-signal weighted contributions: query.py maps result.w_semantic/w_keyword/w_memory/w_usage (computed in ranking.py as settings.w_* * raw * decay, and documented to sum ≈ combined_score) onto the semantic_score/keyword_score/memory_score/usage_score fields. Multiplying them again by WEIGHTS here double-applies the weights, so the per-signal split rendered by stackSeg/barWidth no longer reflects each signal's true share of the combined score. Use the fields directly instead, and drop the now-unused WEIGHTS constant and its comment block (lines 20–29). This also removes the separate problem that the hardcoded WEIGHTS (keyword 0.25, memory 0.2) don't match the backend defaults (keyword 0.30, memory 0.15) and can't track the env-configurable LORE_W_* overrides.

Comment thread src/dashboard_v2/src/routes/query/+page.svelte
@Jessinra Jessinra added the skip_size_check whitelist certain big PR to whitelist the pipeline label Jul 28, 2026
@Jessinra
Jessinra merged commit d4eb1e1 into main Jul 28, 2026
17 of 19 checks passed
@Jessinra
Jessinra deleted the LKPR-141-dashboard-v2-visual-fidelity branch July 28, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip_size_check whitelist certain big PR to whitelist the pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants