feat(frontend): AI suggestion history in app state#156
Open
briwitched wants to merge 5 commits into
Open
Conversation
Store generated note text per SG versionId in React state only; remove AISuggestionManager and related types from @dna/core. Call generateNote from useAISuggestion with debounced transcript regeneration. Keep Assistant version navigation; expose prompt/context for Prompt Debug only when viewing the newest note. Restore localStorage/sessionStorage polyfill in Vitest setup for ThemeModeProvider. Signed-off-by: Briana Johnson <brianajohnsxn@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Re-export AISuggestionManager from core with shared app singleton beside apiHandler for pipeline consumers. Delegate generation and debounced transcript regeneration to the manager while keeping per-version suggestion history in the hook. Signed-off-by: Briana Johnson <brianajohnsxn@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Restore the prior hook layout (notesByVersionId, runGenerate, regenerate). Delegate generate and transcript debounce to aiSuggestionManager; subscribe once to mirror loading, errors, and history updates when scheduled runs finish. Signed-off-by: Briana Johnson <brianajohnsxn@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
Note: the pink box is just to highlight the change, it is NOT visible in the interface! |
Collaborator
|
Dropping note here but talked in person! We should not remove the module from the core. It should contain the fetch logic in core then store in the state hook in the app package. |
AISuggestionManager now only orchestrates generate-note calls and tracks loading/error. useAISuggestion stores note snapshots and history navigation in React state. Signed-off-by: Briana Johnson <brianajohnsxn@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
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
Store generated note text per SG versionId in React state only; remove AISuggestionManager and related types from @dna/core.
Call generateNote from useAISuggestion with debounced transcript regeneration. Keep Assistant version navigation; expose prompt/context for Prompt Debug only when viewing the newest note.
Restore localStorage/sessionStorage polyfill in Vitest setup for ThemeModeProvider.
Testing
How I Tested
npm run test-cilocalhost:5173Navigation between the notes of that session is shown below. When at max/min, the corresponding chevron is greyed out.