feat(app-ai-native): add message transitions and stream liveness detection#558
Open
XDfield wants to merge 8 commits into
Open
feat(app-ai-native): add message transitions and stream liveness detection#558XDfield wants to merge 8 commits into
XDfield wants to merge 8 commits into
Conversation
…r payload.error Adjust error handling logic to check payload.message first before falling back to payload.error, improving error message accuracy. Co-Authored-By: claude-sonnet-4-6 <noreply@costrict.ai>
…lur handler Remove redundant working state validation that was checking and aborting operations. Simplifies the blur event handling flow. Co-Authored-By: claude-sonnet-4-6 <noreply@costrict.ai>
…dling - Add toast and language imports for future error notifications - Improve parts update logic with proper overlap handling and append logic - Add state regression prevention for completed/error states - Enhance session.error handling to support both object and string error formats - Prepare toast notification infrastructure (commented out) Co-Authored-By: claude-sonnet-4-6 <noreply@costrict.ai>
…k and bot types Split WeCom notification channels into two distinct types: - wecom-webhook: WeCom group bot via webhook (user-managed) - wecom-bot: WeCom bot via long connection (system-managed) Changes include: - Add comprehensive i18n translations for both channel types (en/zh) - Refactor notification channels UI to handle separate types - Add WeComBotChannel type and related service methods - Extend API with generic channel CRUD operations - Update channel management logic with proper type handling Co-Authored-By: claude-sonnet-4-6 <noreply@costrict.ai>
Fix race condition where AI response content disappears after SSE stream completion. **Root Cause:** - loadMessages overwrites local data with server data before SSE fully completes - 150ms reconcile delay was insufficient for backend to finish writing - No protection for completed local state being replaced by incomplete server data **Changes:** 1. Enhanced message merge logic in device-session.tsx: - Check message and parts completion status before updating - Protect running/completed states from being overwritten - Preserve local output when server data is incomplete 2. Improved Parts update logic: - Prevent completed status from reverting to running - Merge existing output when server data lacks content - State-based protection for running→completed transitions 3. Extended reconcile delay (device-session-view.tsx): - Increased from 150ms to 1000ms to allow backend completion - Reduces probability of fetching incomplete data **Impact:** - Fixes reported issue of AI responses disappearing after SSE completion - Provides more robust state synchronization between client and server - Better handling of timing-sensitive data updates Co-Authored-By: claude-sonnet-4-6 <noreply@costrict.ai>
Implement smooth transitions to eliminate visual flickering during message updates. **Features:** 1. Smart Content Detection: - Auto-detects if content actually changed before triggering animations - Compares key message fields (content, role, completion status, error) - Compares part states (status, output) to avoid unnecessary updates - Only applies transitions to genuinely changed content 2. Smooth Transition Effects: - Pure fade-in/fadeout without jarring scaling/movements - 300ms transition duration for natural feel - Conditional rendering: transitions only when needed - Performance optimized with CSS transitions 3. Visual Feedback During Updates: - Opacity change (0.6) during active updates - Prevents layout shifts with height preservation - Background highlight for parts being updated - Respects prefers-reduced-motion for accessibility **New Files:** - message-transition.css: Transition animations (87 lines) - message-transition.tsx: Components and hooks (189 lines) **Integration:** - Wrapped SessionTurn with MessageTransition in message-timeline.tsx - Added isUpdating() method to query update state - Automatic transition application based on content changes **Benefits:** - Eliminates visual flickering during loadMessages updates - Reduces unnecessary re-renders for unchanged content - Provides subtle but effective visual feedback - Maintains performance with smart detection Co-Authored-By: claude-sonnet-4-6 <noreply@costrict.ai>
… guard Add a 30s idle timeout that monitors all incoming events (including server.heartbeat) to detect half-open SSE connections. On timeout the stream is aborted and reconnected via the existing retry path. Also add max-failures guard (5 retries) that sets workspace status to "unavailable" when exceeded, preventing infinite reconnect loops. STREAM_MAX_FAILURES = 5 STREAM_ALIVE_TIMEOUT_MS = 30000 Co-Authored-By: Auto <noreply@costrict.ai>
- Fix Message union comparison in device-session.tsx - Add "robot" to NotificationChannelType icon union in notification-channels-section.tsx - Fix onEdit ternary assertion scope in notification-channels-section.tsx - Fix Icon name cast in notification-channels-section.tsx - Fix Set generic inference in message-transition.tsx Co-Authored-By: Auto <noreply@costrict.ai>
986cd8f to
310b624
Compare
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
Test plan
bun typecheck🤖 Generated with CoStrict