Skip to content

feat(chat-messages): add citation popover#2126

Open
robertwilde wants to merge 2 commits into
mainfrom
feat/ai/source-chip
Open

feat(chat-messages): add citation popover#2126
robertwilde wants to merge 2 commits into
mainfrom
feat/ai/source-chip

Conversation

@robertwilde

@robertwilde robertwilde commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Related to #2064

Depends on #2099 to be merged first.

This branch adds a hover-triggered popover to SiCitationPillComponent that shows the citation's title, an optional description, and a "View source" link. Placement adapts to available viewport space, and a short hide delay keeps the popover open when moving the cursor onto it. The hover logic had to be wired manually because SiPopoverDirective does not support hover triggers, unlike the deprecated SiPopoverLegacyDirective which did. A follow-up worth considering is either adding hover trigger support to SiPopoverDirective or using SiTooltipDirective, which already handles this natively.


Documentation.
Examples.
Dashboards Demo.
Playwright report.

Coverage Reports:

Code Coverage

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new si-citation-pill component to display inline source citations within AI-generated chat messages, supporting pre-segmented annotated text (SiChatAnnotatedText). Feedback on these changes focuses on ensuring citation pills flow inline by removing trailing line breaks, adhering to strict type checking for the label input, and avoiding hardcoded user-facing strings to support internationalization. Additionally, recommendations are made to improve Server-Side Rendering (SSR) compatibility by avoiding direct window references, and to prevent memory leaks by properly tracking and disconnecting the MutationObserver on component destruction.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread projects/element-ng/chat-messages/si-ai-message.component.html
Comment thread projects/element-ng/chat-messages/si-citation-pill.component.ts
Comment thread projects/element-ng/chat-messages/si-citation-pill.component.ts
Comment thread projects/element-ng/chat-messages/si-citation-pill.component.ts
Comment thread projects/element-ng/translate/si-translatable-keys.interface.ts
Comment thread projects/element-ng/chat-messages/si-citation-pill.component.ts
Comment thread projects/element-ng/chat-messages/si-citation-pill.component.ts
Comment thread projects/element-ng/chat-messages/si-citation-pill.component.ts
Comment thread projects/element-ng/chat-messages/si-citation-pill.component.ts
@robertwilde robertwilde force-pushed the feat/ai/source-chip branch 9 times, most recently from 89ac9f7 to 698a226 Compare June 8, 2026 09:26
@robertwilde robertwilde force-pushed the feat/ai/source-chip branch from 698a226 to 5489317 Compare June 8, 2026 10:21
@robertwilde robertwilde force-pushed the feat/ai/source-chip branch from 5489317 to b6daf80 Compare June 8, 2026 10:44
@robertwilde robertwilde marked this pull request as ready for review June 8, 2026 12:03
@robertwilde robertwilde requested review from a team as code owners June 8, 2026 12:03
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