Skip to content

feat(ui): List and resume past assistant conversations#88

Merged
nfebe merged 1 commit into
mainfrom
feat/ai-session-list
Jul 19, 2026
Merged

feat(ui): List and resume past assistant conversations#88
nfebe merged 1 commit into
mainfrom
feat/ai-session-list

Conversation

@nfebe

@nfebe nfebe commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@sourceant

sourceant Bot commented Jul 19, 2026

Copy link
Copy Markdown

Code Review Summary

This 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

  • Dynamic session listing integrated with the backend API.
  • Session resumption capability that restores message history and context.
  • Clean relative timestamping for the history list.

💡 Minor Suggestions

  • Add explicit error handling to the UI for when history fails to load.
  • Ensure consistent API method definitions across all layers.

🚨 Critical Issues

  • Runtime failure: aiApi.getSession is referenced in the store but missing from the service definition.

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. See the overview comment for a summary.

Comment thread src/services/api.ts

export const aiApi = {
status: () => apiClient.get<AIStatus>("/ai/status"),
listSessions: () => apiClient.get<{ sessions: AISessionSummary[] }>("/ai/sessions"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">

@nfebe
nfebe merged commit 9e84bc3 into main Jul 19, 2026
5 checks passed
@nfebe
nfebe deleted the feat/ai-session-list branch July 19, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant