Skip to content

feat(web): make the memory detail panel resizable and remember its width - #728

Merged
dash0-dev[bot] merged 4 commits into
mainfrom
feat/web-resizable-memory-panel
Oct 27, 2026
Merged

dash0-dev[bot] merged 4 commits into
mainfrom
feat/web-resizable-memory-panel

Conversation

@dash0-dev

@dash0-dev dash0-dev Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

The memory detail panel was capped at 512px, which is cramped on a large monitor (tables and long lessons wrap heavily). It should be resizable, with bounds that follow the screen, and keep its width across reloads.

What changed

  • Drag the drawer's left edge to resize. You can also focus the edge and use ←/→ (Shift for bigger steps) or Home/End; double-click resets to the default. On hover, focus or drag, an orange line that fades out toward the top and bottom fades in.
  • The width is stored in localStorage as a fraction of the viewport, so it scales when you move between monitors. It renders as clamp(max(320px, 15vw), …, 70vw), and the default stays 512px (the 15vw floor lifts it only on screens wider than ~3413px).
  • The pure geometry lives in lib/lesson-panel-width.ts, with specs. The handle writes style.width during a gesture and commits once at the end, so the heavy panel doesn't re-render on every pointer move.
  • A new lore.memory_panel_resized RUM event (source plus viewport %) is documented in docs/otel.md. There's a user note in tags.mdx, and llms.txt is unchanged because its generator reads only MDX frontmatter.

How to verify

  • cd packages/web && npx vitest run src/lib/lesson-panel-width.spec.ts src/lib/persisted-preference.spec.ts src/lib/analytics/track.spec.ts
  • Storybook: Lore/LessonDetailSheet/Tests → DrawerResizesFromItsEdge, DrawerResizesByDragging (not run locally; no Playwright browser in the sandbox, CI web-test covers them)

Notes for reviewers

The mobile bottom sheet is unchanged. max-w-full on the drawer keeps it inside containing blocks narrower than the vw bounds (the stories' 360px device frames), so existing drawer baselines should not move.

mthines and others added 2 commits October 27, 2026 08:56
Drag the drawer's left edge (or focus it and use the arrow keys, Home/End)
to resize; double-click resets. The width is stored per browser as a
fraction of the viewport and rendered through a CSS clamp() whose bounds
are viewport-relative (max(320px, 15vw) to 70vw), so it scales when moving
between monitors. Default stays 512px.

Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
…p resizes

- max-w-full on the drawer so a containing block narrower than the vw
  bounds (the stories' 360px device frames) still holds it
- measure drags from the start width via a pure dragPanelWidth, with a
  spec and a pointer-drag interaction story
- no storage write or event when a gesture ends at the same width, or on
  a reset that is already the default
- ignore Alt/Ctrl/Cmd+arrow and a second pointer mid-drag
- rely on the global Storybook preference reset; document Home/End

Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

The dashboard preview for this PR — redeployed on each push that changes the web app.

Project Deployment Actions Updated
lorekit Ready Ready Preview Oct 27, 2026 10:59am UTC

Preview always points at this PR's latest commit; Deployment is the immutable build of a16b90a. · Comment /web-preview to force a redeploy. · Workflow logs

The hover/focus/drag indicator was a hard full-height accent bar. It is now
a transparent -> accent -> transparent vertical gradient (the TopBar
ActivityIndicator's stops) that fades in via opacity.

Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
@dash0-dev

dash0-dev Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ No issues found

The follow-up commit qualifies the 512px default in the code comments and key-files row, closing the prior finding. Nothing new cleared the bar; one test-coverage note stays advisory.

1 advisory finding below the confidence bar — see Less certain below.

Less certain (1) — advisory, below the confidence bar
Finding Where
1 suggestion: No story fires pointercancel mid-drag or blurs the handle mid-hold, so a broken revert() would leave the drawer at an uncommitted width with CI green.
Confidence 78
packages/web/src/components/lore/LessonPanelResizeHandle.tsx:228
Review details
Gate Details
Description vs. code ✅ Description matches the diff; its 'default stays 512px' predates the >3413px qualifier the code now states.
Prior review feedback ✅ Earlier review comments are resolved.
Documentation ✅ JSDoc, docs/otel.md, docs/key-files.md and a tags.mdx user note cover the resize behaviour and its event.
Self-review signals ✅ No debug logs, leftover TODOs, or unreviewed stubs.
Code review ✅ The multi-lens review found no blocking issues.
Run Details
Mode full · 12 lines in delta · tier deep · depth checkout
Anomaly ⚠️ impact image not drawn (tool budget); knowledge index read 1 of 2+ pages — no sub-agent dispatch available — the intent finder ran in-context with the other finders at effective thoroughness 0.95, instead of as its own sub-agent
Progress open review threads 1 → 0 across the last 2 reviews
Checked 14 of 14 changed files read · 6 possible issues → 0 confirmed → 0 posted
Reach 21 changed exports · 14 dependent files · 1 checked · 13 not checked · 2 changed files imported by 24 files, not traced
PREFERENCE_KEYS — 10 consumer files · 3 checked
parseEnumPreference — 4 consumer files · 0 checked
MemoryContentTabSource — 1 consumer file · 0 checked
panelFractionFromWidth — 3 consumer files · 3 checked
panelWidthBounds — 3 consumer files · 3 checked
+16 more
packages/web/src/lib/analytics/track.ts — imported by 22 files
packages/web/src/components/lore/LessonDetailSheet.tsx — imported by 3 files
Found produced 6 → posted inline 0 · cleared 0 · carried forward 0 · deferred 0 · below-bar 1
Dropped 2 below-bar
Standards ran · 2 governing docs · 65 bullets · 2 candidates (contradicted) · 0 findings
Measurability ran · 14 paths classified · 0 missing · 1 unlinked (repo-wide pattern, dropped at 2.7)
CI still pending: Web — Playwright e2e (local build + local Supabase), Typecheck, Test & Lint (affected), Web — Storybook interaction + visual tests (changed), Web — Vercel preview (changed) / Deploy Vercel preview · 2 passed
Memories 74 indexed · 6 used (4 knowledge · 1 hotspot · 1 lesson)

Memories used

  • knowledge knowledge::PANEL_DEFAULT_WIDTH_PX@packages/web/src/lib/lesson-panel-width.ts — finder pointer (re-verified at a16b90a: the >3413px lift its history recorded is now stated at lesson-panel-width.ts:34)
  • knowledge knowledge::LessonPanelResizeHandle@packages/web/src/components/lore/LessonPanelResizeHandle.tsx — finder pointer (re-verified: gesture commit/revert facts hold; pointed the test-gap check)
  • knowledge knowledge::PREFERENCE_KEYS@packages/web/src/lib/persisted-preference.ts — consumer-impact pointer (setup reset and prefix/uniqueness spec cover the new key)
  • knowledge knowledge::AnalyticsEvent@packages/web/src/lib/analytics/track.ts — checklist line (header list, union, toAttributes, spec and docs/otel.md all updated)
  • hotspot hotspot::packages/web/src/lib/lesson-panel-width.ts — checklist line (prior maintainability catch here; delta re-checked against it)
  • lesson otel::omit-the-attribute-rather-than-emit-a-placeholder-outside-the-semconv-enum — consideration: panel_resize_source emits only drag|keyboard|reset, no placeholder

Nothing to report — integrations (not activated), severity, 0 files skipped.

pr-reviewer · commit a16b90a · full review · how these findings are produced · updated Oct 27, 2026 11:07am UTC

Comment thread packages/web/src/lib/lesson-panel-width.ts Outdated
Addresses review comment by dash0-dev[bot]:
#728 (comment)

Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
@dash0-dev
dash0-dev Bot marked this pull request as ready for review October 27, 2026 11:10
@dash0-dev
dash0-dev Bot requested a review from mthines as a code owner October 27, 2026 11:10
@dash0-dev
dash0-dev Bot merged commit 4ec4fd7 into main Oct 27, 2026
19 checks 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