Skip to content

Conversation

@jeevanpillay
Copy link
Collaborator

Summary

Added backward compatibility for displaying messages that use the deprecated/legacy format (pre-parts array).

Problem

After the merge, legacy messages stored with deprecated fields (like body, thinkingContent, streamChunks) were not displaying in the UI because the conversion function only handled the new parts array format.

Solution

Updated convertDbMessagesToUIMessages to handle both formats:

  • New format: Messages with parts array (current standard)
  • Legacy format: Messages with deprecated fields

Legacy field mappings:

  • body → text part
  • thinkingContent → reasoning part
  • streamChunks → combined into text/reasoning parts based on isThinking flag
  • messageType → role (fallback for missing role field)
  • timestamp → createdAt (fallback for _creationTime)

Testing

  • ✅ Build passes
  • ✅ Linting passes
  • ✅ Both new and legacy message formats are handled
  • ✅ No breaking changes to existing functionality

Impact

This ensures all historical chat messages are displayed correctly in the UI, regardless of which format they were stored in.

🤖 Generated with Claude Code

jeevanpillay and others added 2 commits August 8, 2025 10:12
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Added backward compatibility for messages using deprecated fields (body, thinkingContent, streamChunks).
The UI now converts legacy message format to the new parts array format for proper display.

Changes:
- Handle legacy body field as text part
- Convert thinkingContent to reasoning part
- Process streamChunks into appropriate text/reasoning parts
- Support deprecated messageType field for role determination
- Handle deprecated timestamp field for message creation time

This ensures all historical messages are displayed correctly in the UI.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@vercel
Copy link

vercel bot commented Aug 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lightfast-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2025 1:28am
lightfast-auth ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2025 1:28am
lightfast-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2025 1:28am
lightfast-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2025 1:28am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
darkarmy-www ⬜️ Ignored (Inspect) Aug 8, 2025 1:28am
lightfast-experimental ⬜️ Ignored (Inspect) Aug 8, 2025 1:28am

@vercel vercel bot temporarily deployed to Preview – lightfast-app August 8, 2025 01:25 Inactive
jeevanpillay added a commit that referenced this pull request Sep 3, 2025
- Update skeleton structure to match ServerSidebarImplementation layout
- Add proper logo placeholder with correct dimensions
- Match ActiveMenuItem and ThreadItem styling in skeleton
- Improve user dropdown skeleton to show avatar and username placeholders
- Use consistent overflow and width classes across all elements
- Add two-line thread item skeletons for more realistic appearance

This fixes the visual inconsistency during hard reloads by ensuring the skeleton
closely matches the actual rendered sidebar components.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <[email protected]>
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.

2 participants