Repository navigation
feat: history panel and saved figures in restored chats and the pop-out (E1.4, E1.5) - #689
Conversation
#658) Reads figure-1.. of each run found by call id, bounded by the operation deadline; a call id two runs share is left out. Bundle rebuilt. Tested: bun frontend/test-workspace.js (in-memory dbFactory), real IndexedDB write/read phases in the Chrome harness (exact PNG bytes after reload).
…ored chats (#658, closes #493) A run stores figureCount (0..3) beside images: [], written from the images in memory and kept when there are none. hydrateFigures reads them from the workspace once the runtime is ready, after load and after opening a chat, into memory only; a missing figure shows a one-line note. The pop-out reads the same IndexedDB through its own init. Tested: bun frontend/test-widget-history-store.js; panel suite in the next commit.
Header History button, a bottom sheet with scrim (dialog, Escape, focus return, inert chat behind), rows with dataset, step and figure counts and a lazy thumbnail, Open/Delete/+ New chat, two-click Clear all (clearAllConversations), off while a reply loads, hidden on the notebook tab. Tested: bun frontend/test-widget-history-panel.js (161 checks, in-memory IndexedDB under the real WorkspaceStore).
…CI (#657, #658) history-check.mjs runs a figure through the real controller and IndexedDB, reloads, and finds it in the restored chat, the opened chat, the History thumbnail and the pop-out at 390x844, light and dark. The widget header title now wraps so the extra button does not overlap the badge. Both new scripts run in the frontend-tests job. Tested: history-check.mjs, chrome.js, run-card-check.mjs, popout-check.mjs.
Preview Deployment
This preview will be updated automatically when you push new commits. |
…ids; test on the shared in-memory IndexedDB (tested: test-workspace.js, bundle rebuilt)
…y on the next hydrate (tested: test-widget-history-panel.js)
…gure 1 only; no object URL for a read the sheet outlived (tested: test-widget-history-panel.js)
… keep the scrim below a header that changes height (tested: test-widget-history-panel.js)
…ain disclosure, busy reason reachable without a tooltip (tested: test-widget-history-panel.js)
…ace; cap from MAX_CONVERSATIONS (tested: test-widget-history-panel.js)
… likeliest low-contrast controls, uploads screenshots on CI failure (tested: history-check.mjs in Chrome)
…er's locale; rewrite the seed comment (tested: test-widget-history-panel.js, also under LC_ALL=de_DE)
…t (tested: tests/test_frontend)
|
Review round 1: outcome for each finding. Fixes are commits on this branch (afbbb5c to 792eb71).
Nothing rejected and nothing filed as a new issue; every finding concerned code this PR touches. Verification: all |
…a failing database factory, not a hand-written store (tested: test-widget-history-panel.js)
…like the other header buttons (tested: widget frontend tests, tests/test_frontend)
|
Review round 2: outcomes
Tested: |
… only conflict; tested: runtime bundle check, frontend suites)
|
PM verdict: all acceptance criteria met (history panel suite, workspace harness PNG bytes, history-check.mjs, both workflow steps, runtime bundle check passes). Both review rounds have outcomes in comments. The branch conflicted with develop in CHANGELOG.md only; merged develop in (both entries kept) and re-ran CI, all checks green. Squash-merged. |
Summary
E1.4 and E1.5 of the NEMAR AI experience plan.
aria-pressed,aria-controls, hidden on the notebook tab) opens a bottom sheet with a scrim over the chat (role=dialog, Escape closes, focus enters and returns to the button, the chat behind isinert). Chats are listed by day (Today, Yesterday, Earlier) with title, dataset id, step and figure counts, time, and a lazily loaded thumbnail of the first figure (object URLs revoked on close). A row or the menu's Open makes the chat live (activateConversationthenevaluateContextSwitch, so a chat of another dataset shows the A1 notice); Delete, + New chat and a two-click Clear all history (newclearAllConversations) are there too. Everything is off, with a note, while a reply loads. Footer: "Saved in this browser only, the last 30 chats with their figures."WorkspaceStore.figuresForCalls(callIds)readsfigure-1..of each run by call id from the real IndexedDB. A run now storesfigureCount(0..3) whilesaveHistorykeeps dropping the images;hydrateFigures()reads them back into memory once the runtime is ready, after load and after opening a chat. A figure the workspace no longer has shows a one-line note. The pop-out reads the same IndexedDB through its own init; no bytes pass throughopenPopout.Closes #657
Closes #658
Closes #493
Commits
WorkspaceStore.figuresForCalls(bundle rebuilt with Bun 1.4.3).figureCountpersistence andhydrateFigures.Commands run
bun frontend/test-widget-history-panel.js: 161 passed, 0 failed (new; a real v3 record of three chats, realWorkspaceStorefrom the real bundle over an in-memory IndexedDB)bun frontend/test-widget-history-store.js(212),test-widget-fresh-return.js(59),test-widget-context-switch.js(160),test-widget-run-card.js(261),test-widget-popout.js(141),test-workspace.js(95): all pass. Also run: notebook-tab, capsule, first-paint, color-scheme, tools, settings, controller: all passbun scripts/build-runtime-bundle.js --checkandbun frontend/test-runtime-bundle.js(32): passbun frontend/browser-harness/history-check.mjs: 30 checks pass in real Chrome 157 (figure drawn, saved, reload, found in the restored chat, the opened chat, the History thumbnail and the pop-out at 390x844; dark scheme; Escape returns focus)bun frontend/browser-harness/chrome.js: pass, includingfiguresForCallsreturning the exact PNG bytes after the reload (workspace write 44 checks, read 16 checks)bun frontend/browser-harness/run-card-check.mjsandpopout-check.mjs --serve: passnode --check frontend/osa-chat-widget.js: okuv run --all-extras pytest tests/test_frontend -q: 144 passeduv run ruff check .: all checks passeduv run ruff format --check .: reports 8 Markdown files under.context/and.rules/that this branch does not touch (code blocks in docs); no Python file is affectedNotes
person-run-Ncall ids restart with every page load, sofiguresForCallsleaves out a call id that two run records share rather than show the wrong run's figures; such a run shows the missing-figure note.flex-wrap) so the added button does not overlap the Experimental badge at phone width.