[Chat] load latest conversation#11396
Conversation
Signed-off-by: Lin Wang <wonglam@amazon.com>
PR Reviewer Guide 🔍(Review updated until commit afb5dde)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to afb5dde Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit f6e9aba
Suggestions up to commit aa2c94e
Suggestions up to commit 344255c
Suggestions up to commit a3ba182
Suggestions up to commit 82fcd77
|
|
Persistent review updated to latest commit 0f16c17 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #11396 +/- ##
==========================================
- Coverage 61.02% 61.02% -0.01%
==========================================
Files 4897 4897
Lines 135545 135568 +23
Branches 23518 23533 +15
==========================================
+ Hits 82717 82731 +14
- Misses 46899 46901 +2
- Partials 5929 5936 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Lin Wang <wonglam@amazon.com>
|
Persistent review updated to latest commit e69f962 |
Signed-off-by: Lin Wang <wonglam@amazon.com>
|
Persistent review updated to latest commit 1c9c37e |
Signed-off-by: Lin Wang <wonglam@amazon.com>
|
Persistent review updated to latest commit 82fcd77 |
|
Persistent review updated to latest commit a3ba182 |
Signed-off-by: Lin Wang <wonglam@amazon.com>
|
Persistent review updated to latest commit 344255c |
Signed-off-by: Lin Wang <wonglam@amazon.com>
|
Persistent review updated to latest commit aa2c94e |
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
|
Persistent review updated to latest commit f6e9aba |
|
Persistent review updated to latest commit afb5dde |
| {showHistory ? ( | ||
| {isLoading ? ( | ||
| <div style={{ | ||
| display: 'flex', |
There was a problem hiding this comment.
move inline css to src/plugins/chat/public/components/chat_window.scss?
There was a problem hiding this comment.
Good point. I will update this in the next PR.
* Add load latest conversation Signed-off-by: Lin Wang <wonglam@amazon.com> * Changeset file for PR opensearch-project#11396 created/updated * Address PR comments Signed-off-by: Lin Wang <wonglam@amazon.com> * Fix unit tests Signed-off-by: Lin Wang <wonglam@amazon.com> * Abort conversation loading after go back Signed-off-by: Lin Wang <wonglam@amazon.com> * Change to page 0 Signed-off-by: Lin Wang <wonglam@amazon.com> * Increase left padding to 12px Signed-off-by: Lin Wang <wonglam@amazon.com> * Only pass toolMessage if not include full messages Signed-off-by: Lin Wang <wonglam@amazon.com> * Abort loading after show history clicked Signed-off-by: Lin Wang <wonglam@amazon.com> --------- Signed-off-by: Lin Wang <wonglam@amazon.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Signed-off-by: Mark Boyd <mark.boyd@gsa.gov>
Description
This PR implements automatic restoration of the latest conversation when the Chat window is opened. On mount,
ChatWindownow calls the asyncrestoreLatestConversation()to fetch and restore the most recent thread. A loading spinner is shown during restoration, and if it fails, an error state with a Retry button is displayed.On the persistence side,
updateCurrentMessagesis replaced bysaveConversation, triggered on every timeline update after a message is sent. Test coverage is updated throughout to reflect the new async flow and validate loading, error, and retry UI states.Screenshots
Screen.Recording.2026-03-04.at.14.39.14.mov
Changelog
Check List
yarn test:jestyarn test:jest_integration