feat(staged): surface chat updates after linked notes#681
Open
feat(staged): surface chat updates after linked notes#681
Conversation
Signed-off-by: Test <test@example.com>
…pdatedAt missing Resolve code review comments on 2f3ef35: - Replace client-side fetch of all session messages in NoteModal with a new count_assistant_messages_after Tauri command that performs a SQL COUNT(role='assistant' AND created_at > timestamp) query, avoiding transferring the full message payload just to count. - Change BranchTimeline noteUpdatedAt fallback from `?? 0` to `undefined`, so notes without a populated updatedAt field skip the freshness feature entirely rather than showing a misleading count. - Update onNoteClick type signature and BranchCard handler to accept number | undefined for noteUpdatedAt. Signed-off-by: Test <test@example.com>
- Extract singular/plural chat button label logic from NoteModal into formatChatButtonLabel() in noteFreshness.ts, co-locating all note-freshness display logic. - Fix recurring CTA loop: after the user clicks the note-followup button, the CTA would reappear because the new assistant response has a createdAt after the updated note's updatedAt. Now shouldAskForNoteUpdate checks hasNoteFollowupBeenSent() which detects the marker text in any prior user message, suppressing the CTA once a followup has already been sent. - Refactor onNoteClick callback from 5 positional parameters to a single NoteClickInfo object parameter for readability and safer future additions. - Add tests for formatChatButtonLabel and hasNoteFollowupBeenSent. Signed-off-by: Test <test@example.com>
…ote update hasNoteFollowupBeenSent previously scanned all user messages in the session, so a single earlier note-followup would suppress the CTA forever — even after the note was successfully updated and new assistant messages arrived. Now the function accepts a noteUpdatedAt parameter and only considers marker messages with createdAt > noteUpdatedAt. This allows the CTA to reappear when the note is updated (advancing updatedAt) and subsequent assistant turns make it stale again. Add test covering the case where a followup sent before the note update does not suppress the CTA. Signed-off-by: Test <test@example.com>
Rebase the branch onto origin/main after fetching origin and using the requested merge-base flow. Main now carries migrations through 0014-add-pipeline; this branch has no migration diff remaining to renumber. Signed-off-by: Matt Toohey <contact@matttoohey.com> Signed-off-by: Test <test@example.com>
1c41b4a to
3cfaae9
Compare
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.
🤖 Summary:
Tests: