feat: add Save to space button in Nova chat#991
Open
vorflux[bot] wants to merge 3 commits into
Open
Conversation
added 2 commits
May 22, 2026 14:04
Add a 'Save to [space name]' button in the ChatSidebar component:
- saveState useState to track idle/saving/saved states
- useEffect to reset saveState to idle when new assistant messages arrive
- handleSaveToSpace callback that POSTs to /chat/save-as-document endpoint
- Save button rendered in chatToolbarActions, visible only when messages
exist and not in auto-space mode
The button shows contextual text: 'Save to {space}', 'Saving...', or
'Saved to space' based on the current save state.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-mcp | 27a74ce | May 22 2026, 03:15 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-app | 27a74ce | Commit Preview URL Branch Preview URL |
May 22 2026, 03:16 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: add "Save to space" button in Nova chat
Adds a "Save to [space name]" button in the Nova chat toolbar. When clicked, the full conversation transcript is saved as a document in the current space. Re-clicking after more messages updates the same document (upsert by chat ID via the new
/chat/save-as-documentbackend endpoint).Depends on: supermemoryai/mono —
POST /chat/save-as-documentendpointWhat changed
apps/web/components/chat/index.tsxsaveState("idle" | "saving" | "saved") andsaveStateRef— tracks button state. Ref pattern (matching existingchatIdRef,selectedProjectRef) avoids stale closure in the callback.handleSaveToSpace— POSTs{ chatId, projectId, messages }to${chatApiBase}/chat/save-as-document(uses the existing fallback constant, not rawNEXT_PUBLIC_BACKEND_URL). Sets state to"saving"→"saved"on success, reverts to"idle"on error.saveStateresets to"idle"when:messages)handleNewChat)chatProject)This prevents the button from getting stuck in "Saved to space" across context switches.
messages.length > 0 && !isAutoChatSpace. Disabled whilesaveState === "saving"orisResponding(prevents saving mid-stream). Shows "Save to [space]" / "Saving..." / "Saved to space".analytics.chatSavedToSpace({ chat_id, project_id })on success.apps/web/lib/analytics.tschatSavedToSpaceevent (matches the pattern of other chat analytics events).Testing
Unit tests
No existing unit test framework for this Next.js frontend. The component logic was validated through the build + review cycle.
Biome / lint
N/A for supermemory repo (different toolchain from mono).
Integration/browser testing (attempted — timed out)
Manual verification checklist (for reviewer)
Session Details
(aside)to your comment to have me ignore it.