Skip to content

Conversation

@sillanaresh
Copy link

@sillanaresh sillanaresh commented Dec 14, 2025

Summary

  • Pin/unpin conversations to keep important chats at the top of the sidebar
  • Export chats as JSON or Markdown files with proper multi-model support
  • Side-by-side format groups AI responses by conversation turns

Changes

Pin Conversations Feature

  • Added useTogglePinChat mutation in ChatAPI.ts
  • Updated chat list sorting to show pinned chats first
  • Added pin/unpin button with icon toggle in sidebar
  • Optimistic cache updates for immediate UI feedback

Export Chat Feature

  • Created ExportAPI.ts with export functionality
  • exportChatAsJSON() - Exports structured JSON with conversation turns
  • exportChatAsMarkdown() - Exports readable Markdown with side-by-side AI responses
  • Properly handles multi-model chats by grouping responses per message_set
  • Added export dropdown menu in chat sidebar (appears on hover)
  • Integrated with Tauri file dialogs for save location selection

Test Plan

  • Verify pinning a chat moves it to the top of the sidebar
  • Verify unpinning a chat returns it to chronological order
  • Verify pinned chats persist after app restart
  • Hover over any chat in sidebar and verify download icon appears
  • Click download icon and select "Export as JSON"
  • Verify JSON file is saved with proper structure (turns with user messages and AI responses)
  • Click download icon and select "Export as Markdown"
  • Verify Markdown file is readable with side-by-side AI responses
  • Test export with a multi-model chat (multiple AI responses per turn)
  • Verify export handles chats with attachments gracefully
  • Verify success/error toasts appear appropriately

🤖 Generated with Claude Code

This commit implements a conversation pinning feature that allows users to pin important chats to the top of their chat list for quick access.

Changes:
- Added useTogglePinChat mutation in ChatAPI.ts to toggle pin status
- Updated fetchChats query to sort pinned chats first (ORDER BY pinned DESC)
- Removed deprecated comment from pinned field in Chat type
- Added Pin/PinOff icons from lucide-react to AppSidebar
- Implemented pin toggle button in chat list items
- Pin icon shows as filled when chat is pinned, appears on hover when unpinned
- Added tooltip showing "Pin chat" or "Unpin chat" based on state

The pinned field already existed in the database schema but was marked as deprecated and unused. This change activates that functionality.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Additional Comments (1)

  1. src/core/chorus/api/ChatAPI.ts, line 138-140 (link)

    logic: Sort order doesn't match the query - needs to sort by pinned first, then updatedAt

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Naresh Silla and others added 2 commits December 14, 2025 12:24
Addresses code review comment from greptile-apps bot.

The useCacheUpdateChat function was sorting only by updatedAt,
which didn't match the database query sorting (pinned DESC, updated_at DESC).
Now sorts pinned chats first, then by updatedAt.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements export feature that allows users to export chats as JSON or Markdown files. Properly handles multi-model conversations by grouping AI responses side-by-side for each user message turn.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@sillanaresh sillanaresh changed the title Add pin/unpin functionality for conversations Add conversation pinning and chat export features Dec 14, 2025
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