feat(ui): List and resume past assistant conversations#88
Merged
Conversation
The assistant's history view showed a hardcoded placeholder list that did nothing, and a chat was lost on reload with no way back to it. Opening history now loads the user's saved conversations, most recent first, and selecting one reopens its full transcript and binds further messages to its scope. Nothing new is stored client-side; the sessions were already persisted on the agent.
Code Review SummaryThis PR successfully implements the assistant's history view, moving away from hardcoded placeholders to dynamic session data. It adds support for listing and resuming past conversations with proper scope binding. 🚀 Key Improvements
💡 Minor Suggestions
🚨 Critical Issues
|
|
|
||
| export const aiApi = { | ||
| status: () => apiClient.get<AIStatus>("/ai/status"), | ||
| listSessions: () => apiClient.get<{ sessions: AISessionSummary[] }>("/ai/sessions"), |
There was a problem hiding this comment.
The getSession method is called in src/stores/assist.ts (line 206) and mocked in tests, but it has not been added to the aiApi object in this file. This will cause a runtime error when attempting to load a past session.
Suggested change
| listSessions: () => apiClient.get<{ sessions: AISessionSummary[] }>("/ai/sessions"), | |
| listSessions: () => apiClient.get<{ sessions: AISessionSummary[] }>("/ai/sessions"), | |
| getSession: (id: string) => apiClient.get<AISession>(`/ai/sessions/${id}`), |
| <div v-if="store.listing" class="history-empty"> | ||
| <p>Loading conversations</p> | ||
| </div> | ||
| <div v-else-if="!store.sessions.length" class="history-empty"> |
There was a problem hiding this comment.
The UI currently handles 'loading' and 'empty' states for history, but it doesn't display error feedback if the API call fails. Since store.listSessions catches errors and sets a ref, you should display that error to the user.
Suggested change
| <div v-else-if="!store.sessions.length" class="history-empty"> | |
| <div v-else-if="store.error" class="history-empty"> | |
| <Icon name="alert-circle" :size="28" class="text-error" /> | |
| <p>{{ store.error }}</p> | |
| </div> | |
| <div v-else-if="!store.sessions.length" class="history-empty"> |
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.
The assistant's history view was a hardcoded placeholder, and a chat was lost on reload with no way back to it.
Opening history now loads the user's saved conversations, most recent first; selecting one reopens its transcript and binds further messages to its scope. Nothing new is stored client-side; the sessions were already persisted on the agent.
Pairs with flatrun/agent#181.