Skip to content

feat: bookmark sessions, double-click to Logs, and Ask progress feedback#67

Open
castellotti wants to merge 4 commits into
mainfrom
feature/dashboard-logs-investigation-ux
Open

feat: bookmark sessions, double-click to Logs, and Ask progress feedback#67
castellotti wants to merge 4 commits into
mainfrom
feature/dashboard-logs-investigation-ux

Conversation

@castellotti
Copy link
Copy Markdown
Owner

Summary

  • Bookmark current session — Added a 🔖 button to Dashboard session cards and to the Logs view header. Clicking opens an inline name input pre-filled with the session name; confirming snapshots the session to SQLite and creates a named bookmark. Works from both views.
  • Double-click session name → open in Logs — Double-clicking a session name in the Dashboard navigates directly to the Logs view for that session without selecting a specific event (new navigateToLogsForSession store action).
  • Ask a Question live progress — After submitting a question in Investigation, the question appears immediately with a live elapsed-time counter and phase labels ("Connecting..." → "Waiting for response...") so users see feedback before the answer arrives.
  • Blank/error LLM response detection — Empty responses are replaced with an explanatory message; HTTP errors surface the status code and server error; network failures show the actual error message.

Files changed

File Change
stores/sessionStore.ts Added navigateToLogsForSession action
components/dashboard/SessionCard.tsx Bookmark button + inline name input; double-click session name handler
components/dashboard/DashboardView.tsx Wired handleOpenInLogs and handleBookmark into SessionCard
components/layout/Header.tsx Bookmark button + inline name form in Logs view
components/layout/InvestigationPanel.tsx Live pending Q&A card with elapsed timer; blank/error response handling

Test plan

  • Start a session, open Dashboard — verify 🔖 button appears on each card; click it, confirm name input appears pre-filled; submit and check the session appears in Session History (bookmarks panel)
  • Double-click a session name in Dashboard — confirm navigates to Logs view with that session active
  • Switch to Logs view with an active session — verify bookmark button appears in header; click, name, confirm
  • Open Investigation on an event, ask a question — confirm question text and "Connecting..." appear immediately; verify elapsed timer ticks; confirm answer replaces placeholder
  • Test with a model that returns an empty response (or mock) — confirm explanatory blank-response message appears
  • Confirm typecheck and build pass (pnpm -r typecheck && pnpm build)

- Add bookmark button to Dashboard session cards and Logs header;
  clicking opens an inline name input, then snapshots the session to
  SQLite and creates a named bookmark via the existing bookmarks API.

- Double-clicking a session name in the Dashboard navigates directly
  to the Logs view for that session (new navigateToLogsForSession
  store action, no specific event selected).

- Investigation Ask a Question now shows the submitted question
  immediately with a live elapsed-time counter and phase indicators
  ("Connecting..." → "Waiting for response...") before the answer
  arrives, so users can see progress in real time.

- Blank/empty LLM responses are detected and replaced with an
  explanatory message; HTTP errors and network failures surface the
  actual status code or error message instead of a generic string.
- Move AskPhase type to module scope (was inside component body)
- Move startPendingTimer/clearPendingTimer useCallbacks before early
  returns — placing hooks after early returns violates the rules of
  hooks and can cause inconsistent hook call order
- Add useEffect cleanup to cancel the tick interval on unmount,
  preventing setState calls on unmounted components
- Remove dead 'error' phase from AskPhase and its unreachable render
  branch (catch blocks clear pendingAsk immediately; errors surface
  through addInvestigationQuestion instead)
- Reset showBookmarkInput/bookmarkName in Header when activeSessionId
  changes, preventing stale session name from being submitted
- Guard bookmark button in Header with bookmarks.some() check — hides
  it when the session is already bookmarked
- Guard onBookmark prop in DashboardView with bookmarkedSessionIds set
  — passes undefined (hides button) when already bookmarked
- Chain snapshot and bookmark fetches: only create the bookmark if the
  save-current snapshot succeeded, preventing orphaned bookmarks when
  session recording is disabled or the snapshot otherwise fails
- Extract shared saveAndBookmarkSession utility (bookmarks-api.ts) used
  by both DashboardView and Header, removing duplicated fetch sequences
- Add submitBookmark callback in SessionCard to deduplicate Enter/click
  confirm paths
- Replace Header .some() bookmark check with memoized Set for O(1) lookup
- Use getSessionName in Header bookmark button instead of hand-rolled logic
- Fix broken handleOpenInLogs reference in DashboardView (now uses
  navigateToLogsForSession directly)
- Simplify onBookmark inline expression in DashboardView
- Reduce pending-ask timer interval from 100ms to 200ms
- Remove trivial handleBookmark wrapper in DashboardView; pass
  saveAndBookmarkSession directly as the onBookmark prop
- navigateToLogsForSession: only set returnToDashboard when coming from
  dashboard, not unconditionally
- InvestigationPanel: move clearPendingTimer/setPendingAsk into finally
  block so they always run, even if response.json() throws
- Render pendingAsk card before existing Q&A entries so it's always
  visible at the top of the list
- bookmarks-api: check bookmarkRes.ok and return false if second fetch
  fails (previously always returned true)
- Replace 🔖 emoji and inline style mutation in SessionCard bookmark
  button with SVG icon and Tailwind hover class, matching Header style
- Add comment explaining the 800ms connecting→waiting phase threshold
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