Skip to content

Enhance citation handling and implement copy message feature - #148

Merged
ritwikshanker merged 3 commits into
mainfrom
bugfix/chat-citation-fixes
Sep 9, 2026
Merged

ritwikshanker merged 3 commits into
mainfrom
bugfix/chat-citation-fixes

Conversation

@ritwikshanker

Copy link
Copy Markdown
Collaborator

This pull request introduces several improvements to the user experience around dataset citations in AI answers, along with a new feature for copying messages. The most significant changes merge the citation number and dataset name into a single clickable pill, streamline navigation between citations and their details, and add a copy button for user messages. The update also refines event tracking and fixes issues with citation state when switching conversations.

Citation and Reference UI/UX Improvements:

  • The citation in AI answers is now a single pill containing both the bracketed number and dataset name. Clicking anywhere on the pill jumps to the corresponding dataset in the "Datasets cited in this answer" list, which now opens with its description already expanded. Modifier clicks (Ctrl/Cmd/middle/right) still open the dataset's page in a new tab as before. [1] [2] [3] [4] [5] [6]
  • The reference list (CitedDatasets) now opens the relevant row and expands its details when navigated to from a citation, and allows the user to collapse it again. The logic for expansion is managed at the list level, not the row level, ensuring a consistent experience. [1] [2] [3] [4] [5]

New Features:

  • Added a copy button beside user messages. This button is always visible on touch screens and appears on hover elsewhere, allowing users to easily copy their own messages. [1] [2]

Event Tracking and Bug Fixes:

  • Updated Matomo analytics: a plain citation click is now tracked as citation_clicked under the Chat category, while opening a source from a citation is tracked as citation_source_clicked under the Dataset category. The obsolete citation_marker_clicked event has been removed. [1] [2] [3]
  • Fixed a bug where an open citation would remain open after switching conversation threads, ensuring that citation state does not leak between threads.

Testing Improvements:

  • Added and updated tests for the new citation pill behavior, expanded/collapsed reference rows, and the copy message button. [1] [2] [3] [4]

These changes collectively make dataset citations more intuitive, unify their behavior, and improve usability for both desktop and mobile users.

@ritwikshanker
ritwikshanker merged commit 06e1c3f into main Sep 9, 2026
6 checks passed
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