fix: dashboard hints how to populate an empty session #83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/dashboard-empty-thoughts-hint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
session_id, a copy-pasteablethink()example, and a note explaining that calls withoutsession_idland in the default session (the silent-fallback that users kept reporting as "my thoughts disappeared").e2e/dashboard/dashboard.spec.tsthat asserts the rendered hint text, the exact example formatting, and theget_thoughtsRPC was invoked against the selected session.0139fe8): re-nestedrenderEmptyThoughtsHintinsideinitSessions(un-exported), dropped a CSS class that had no rules, and removed a dynamic-import test that was exercising an unreachable branch.Phase
N/A — UX fix.
Test Plan
cargo build -p cognix-servernpx playwright test dashboard.spec.ts— 33 passed, 0 failedsessions.jsto confirmrenderEmptyThoughtsHintis still reachable fromrenderThoughtCardsvia closure after the un-export.Self-Review Checklist
unwrap()in library code (no Rust changes)println!/dbg!session_id) and assert RPC contractNotes
The no-
session_idbranch inrenderEmptyThoughtsHintis kept as a defensive guard with a comment —schema.js:assertSessionShapethrows schema-drift when bothidandsession_idare missing, so production callers always pass a populated session.Pre-fix, a freshly created session rendered a flat "No thoughts have been recorded yet." with no guidance, leaving users to guess why their think() calls hadn't attached. The cause is almost always the scoping rule: think() without session_id stores under the caller's default session, not the one they just created via create_session. Replace the flat marker with a copy-ready think({ session_id: "<id>", thought: "..." }) example and a one-line note explaining the scoping. Threads `session` into renderThoughtCards so the example can render the actual id.