mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-18 06:03:49 +00:00
## Summary Changes the highlight "Chat" button behavior: - **Before**: Clicking "Chat" immediately opened the chat view with "Tell me more about XYZ" sent as the user's first message - **After**: Clicking "Chat" reveals an inline reply input right under the highlight card. The user types their response, and when they submit: - The highlight content appears as the **assistant's first message** (prefixed with "Here is a highlight from your memories:") - The user's reply appears as the second message - A fresh chat thread is created (no overwriting existing conversations) ### Files Changed - **`apps/web/components/highlights-card.tsx`** - Added inline reply input UI with send/cancel buttons, keyboard handling (Enter/Escape), auto-focus, and state reset on item navigation or items refresh - **`apps/web/components/chat/index.tsx`** - Added `queuedHighlightContent` prop, fresh thread creation for highlight chats, deferred `setMessages` to ensure correct Chat instance targeting, and `awaitingHighlightInjectionRef` for safe reply dispatch - **`apps/web/app/(app)/page.tsx`** - Added `queuedHighlightContent` state, updated `handleHighlightsChat` to accept highlight content + user reply, cleared stale highlight content in `handleHomeChatStart` - **`apps/web/components/dashboard-view.tsx`** - Updated `onHighlightsChat` type signature - **`apps/web/components/memories-grid.tsx`** - Updated `HighlightsProps.onChat` type signature ## Testing ### TypeScript - `npx tsc --noEmit` — no new type errors (all errors are pre-existing in unrelated files) ### Biome - `bunx biome check --write` — clean on all changed files (pre-existing warnings only in dashboard-view.tsx) ### Automated Tests (via testing subagent) - **25 passed / 0 failed / 1 skipped** (26 total) - Tests covered: inline reply input visibility, keyboard handling (Enter/Escape), reply state reset on navigation, highlight content injection as assistant message, user reply dispatch, fresh thread creation, stale highlight content prevention, pagination dot handler - The testing agent discovered and fixed a race condition where `setMessages` was called before `useChat` had recreated its internal Chat object after `setFallbackChatId` — the fix defers `setMessages` to a separate effect gated on `currentChatId` matching the target - 1 test skipped (T12): Nova FAB button not separately visible from highlights card button at 1440px viewport — expected structural behavior --- **Session Details** - Session: [View Session](https://supermemory.us1.vorflux.com/agent-sessions/9cbf2106-b7b9-4d7c-b275-2a7e72417793) - Requested by: Soham Daga (soham@supermemory.com) - Address comments on this PR. Add `(aside)` to your comment to have me ignore it. |
||
|---|---|---|
| .. | ||
| add-document | ||
| chat | ||
| document-cards | ||
| document-modal | ||
| integrations | ||
| mcp-modal | ||
| memory-graph | ||
| nova | ||
| onboarding | ||
| settings | ||
| text-editor | ||
| add-space-modal.tsx | ||
| animated-gradient-background.tsx | ||
| connect-ai-modal.tsx | ||
| dashboard-view.tsx | ||
| document-icon.tsx | ||
| documents-command-palette.tsx | ||
| ensure-workspace.tsx | ||
| error-boundary.tsx | ||
| feedback-modal.tsx | ||
| fullscreen-note-modal.tsx | ||
| graph-layout-view.tsx | ||
| header.tsx | ||
| highlights-card.tsx | ||
| initial-header.tsx | ||
| integration-icons.tsx | ||
| integrations-view.tsx | ||
| memories-grid.tsx | ||
| mobile-banner.tsx | ||
| next-app-research-cta.tsx | ||
| query-client.tsx | ||
| quick-note-card.tsx | ||
| remove-connection-dialog.tsx | ||
| select-spaces-modal.tsx | ||
| share-modal.tsx | ||
| space-selector.tsx | ||
| spinner.tsx | ||
| superloader.tsx | ||
| timeline-view.tsx | ||
| user-profile-menu.tsx | ||
| utils.ts | ||