fix updating title of sessions#164
fix updating title of sessions#164DinaLaptii wants to merge 6 commits intoNVIDIA-AI-Blueprints:developfrom
Conversation
Greptile SummaryThis PR fixes session title generation when a file is uploaded before the first chat message — previously the title was never set because the old check saw the Confidence Score: 5/5Safe to merge — the logic change is small, targeted, and fully covered by a new regression test. All findings are P2 (test completeness and a theoretical divider edge case); the core bug fix is correct and the new hasNoUserChatMessages predicate makes the intent explicit. No security, data-integrity, or runtime-error concerns. DataSourcesPanel.spec.tsx has an incomplete useAuth mock that leaves the auth-required banner branch untested, but this does not affect production behavior. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User uploads file] --> B[file_upload_status banner\nadded to messages]
B --> C[User types first chat message]
C --> D[addUserMessage called]
D --> E{messages.some\nm.messageType === 'user'?}
E -- No user messages yet --> F[shouldUpdateTitle = true]
E -- User message exists --> G[shouldUpdateTitle = false]
F --> H[generateTitle from message content]
H --> I[conversation.title updated in store]
G --> J[conversation.title unchanged]
I --> K[AppBar renders session title]
J --> K
B --> L{User navigates away\nwithout chatting?}
L -- Yes --> M[maybeDiscardAbandonedUploadOnlySession]
M --> N[discardSessionDocumentsResources]
N --> O[Backend collection deleted]
N --> P[Session removed from store]
Reviews (6): Last reviewed commit: "revert text fix test" | Re-trigger Greptile |
frontends/ui/src/features/layout/components/DataSourcesPanel.tsx
Outdated
Show resolved
Hide resolved
|
When trying this i faced a weird edge case:
|
I agree that these sessions are invisible, but I believe that is the correct behavior. If a user hasn't sent a message, the session has no functional use for them yet. We only create the session in the backend because it's a prerequisite for the file upload API; however, we shouldn't clutter the UI with it until a conversation actually begins. |
In that case, since there will be no way to go back to this invisible session, can we just remove that session instead of hiding it? |
|
|
@AjayThorve please check |
Resolve conflicts in DataSourcesPanel.tsx (comment) and store.spec.ts (layout mock: knowledge_base vs confluence; keep discard + deep-research mocks). Made-with: Cursor
facing another issue. When uploading a file: a new session toggle (if no message has been posted), should not work period.
THat's the behavior in gemini or any of the chat apps. We only allow new session if a message has been typed and sent. Currently uploading a file and creating a new session by clicking the logo, just gets rid of the file, which is expected as per the changes, but does not feel intuitive.
|
@DinaLaptii can you look at my above comment |
I think this is the case for llamaIndex but for fRAG - the file uploads successfully async the few times I tried it. I think the behavior is tolerable for now. In the next refactor we can revisit. |
Uploading a file at the start of a conversation currently prevents the session title from updating correctly. Additionally, following the merge of my previous PRs, I need to add the feature toggle logic for the new UI.