Skip to content

Comments

fix(tarko-agent-ui): prevent empty state during historical events loading#1718

Open
ulivz wants to merge 1 commit intomainfrom
fix/empty-state-loading
Open

fix(tarko-agent-ui): prevent empty state during historical events loading#1718
ulivz wants to merge 1 commit intomainfrom
fix/empty-state-loading

Conversation

@ulivz
Copy link
Member

@ulivz ulivz commented Oct 13, 2025

Problem

Users see "Start a conversation" empty state when switching to existing sessions due to async loading race condition.

Root Cause

Session navigation triggers setActiveSessionAction which checks local messages, finds none, starts async getSessionEvents, but UI shows empty state before loading completes.

Solution

Added granular loading state tracking with loadingSessionEventsAtom to handle the "loading history" intermediate state.

Technical Changes

  • State Management: New atom for per-session loading state tracking
  • Async Boundaries: try-finally pattern ensures state cleanup
  • UI Logic: Extended state priority: creating > loading > messages > empty
  • UX Enhancement: Loading spinner with contextual message

Architecture Benefits

  • Eliminates race condition between navigation and data loading
  • Provides clear visual feedback during async operations
  • Extensible foundation for future error handling and retry logic

Files Changed

  • multimodal/tarko/agent-ui/src/common/state/atoms/ui.ts - Added loading state atom
  • multimodal/tarko/agent-ui/src/common/state/actions/sessionActions.ts - Integrated loading boundaries
  • multimodal/tarko/agent-ui/src/standalone/chat/ChatPanel.tsx - Updated state logic
  • multimodal/tarko/agent-ui/src/standalone/chat/components/LoadingState.tsx - New loading component

Testing

Verified smooth navigation between sessions with proper loading indicators.

…ding

- Add loadingSessionEventsAtom to track when historical events are being loaded
- Create LoadingState component to show while events are loading
- Update ChatPanel to show LoadingState instead of EmptyState during loading
- Prevent 'Start a conversation' state from showing during session initialization
@netlify
Copy link

netlify bot commented Oct 13, 2025

Deploy Preview for tarko ready!

Name Link
🔨 Latest commit dadcb56
🔍 Latest deploy log https://app.netlify.com/projects/tarko/deploys/68ecea08c44a310008dacda2
😎 Deploy Preview https://deploy-preview-1718--tarko.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Oct 13, 2025

Deploy Preview for agent-tars-docs ready!

Name Link
🔨 Latest commit dadcb56
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/68ecea086f2fc7000816e078
😎 Deploy Preview https://deploy-preview-1718--agent-tars-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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