Fix message attribution and add timestamp support#10
Open
tassa-yoniso-manasi-karoto wants to merge 2 commits intoagarwalvishal:mainfrom
Open
Fix message attribution and add timestamp support#10tassa-yoniso-manasi-karoto wants to merge 2 commits intoagarwalvishal:mainfrom
tassa-yoniso-manasi-karoto wants to merge 2 commits intoagarwalvishal:mainfrom
Conversation
Copy buttons exist on both user messages and Claude responses, causing all messages to be captured as Claude's. This fix identifies Claude's copy buttons by checking if the Message actions group contains feedback buttons (which only appear on Claude's responses). - Distinguish Claude's copy buttons from user's by checking for feedback buttons - Fix edit button search by traversing up DOM to find Message actions group - Add messageActionsGroup and feedbackButton selectors for maintainability - Update countClaudeCopyButtons to use correct identification logic Fixes message attribution bug where user messages appeared as Claude's responses Co-Authored-By: Claude <noreply@anthropic.com>
- Fetch message timestamps from /api/organizations/.../chat_conversations/... - Display full timestamps on human messages (e.g., "Dec 27, 2025, 1:22 PM") - Skip timestamps on Claude responses (usually seconds after) - Use API response for conversation title as fallback Co-Authored-By: Claude <noreply@anthropic.com>
|
I tested the PR version, on Chrome it works fine but on Firefox it doesn't fetch the claude responses. On console, it only show "Clicked copy button x/x" but no "Captured Claude response N". |
|
In Brave, only the Human has timestamps. Claude messages don't 🙏 |
|
I build a new snippet that fixed the Firefox issue. This may help you @stdedos . Feel free to give it a try. |
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.
This PR addresses two issues:
Bug Fix: Message Attribution (Fixes #8)
All messages were incorrectly attributed to Claude because copy buttons exist on both user messages and Claude responses. The original code clicked all copy buttons, capturing everything as "Claude responses".
Solution: Distinguish Claude's copy buttons by checking if the Message Actions group contains feedback buttons:
Also fixed the edit button detection which was failing due to DOM structure changes (the edit button is in a sibling Message Actions group, not inside the same
.groupancestor).Feature: Timestamp Support (Closes #9)
Added full timestamp support for exported messages by fetching data from Claude's conversation API.
Why API? DOM-based approaches failed because:
event.isTrusted)__NEXT_DATA__or sessionStorageSolution: Fetch timestamps from
/api/organizations/{org_id}/chat_conversations/{conversation_id}which returnscreated_atfields for each message.Timestamps are displayed on human messages only (Claude responses are usually seconds after).
Output Format
Fixes #8
Closes #9