Skip to content

Show each annotation as its own chat message with element context - #4828

Open
shaunandrews wants to merge 1 commit into
trunkfrom
show-annotation-details-in-chat
Open

Show each annotation as its own chat message with element context#4828
shaunandrews wants to merge 1 commit into
trunkfrom
show-annotation-details-in-chat

Conversation

@shaunandrews

@shaunandrews shaunandrews commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Claude Code ported the transcript changes from #4411 onto trunk and adapted the element summary to trunk's annotation shape. Reviewed and tested manually in the Desktop app.

Proposed Changes

  • Submitting preview annotations used to show a single "2 annotations submitted" bubble in the chat. Each note now appears as its own user message, with a chip underneath naming the element (h1.hero-title) and its nearby text.
  • The agent prompt is unchanged; only the transcript display gains the per-note summaries, which are persisted on the user-prompt entry so they survive reload.
  • The summary travels through every backend that starts a run (Desktop IPC, studio ui server, hosted) and is validated on the way in.

⚠️ Visual change: needs human review in light + dark mode.

Screenshots

Light Dark
Two annotation notes as separate chat messages with element chips, light Two annotation notes as separate chat messages with element chips, dark

Testing Instructions

  • Open a site preview, click Annotate, save two notes on different elements, click Submit.
  • The chat shows two user messages, each with an element chip under it. Reload the session; they persist.
  • Check the chip in light and dark.
  • npm test -- apps/ui/src/ui-classic/components/session-view apps/ui/src/data/queries/use-agent-run.test.tsx apps/cli/commands/ai/sessions/tests/resume.test.ts packages/common/ai/visual-annotations.test.ts

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 6423c3f vs trunk

app-size

Metric trunk 6423c3f Diff Change
App Size (Mac) 1458.03 MB 1458.04 MB +0.01 MB ⚪ 0.0%

site-editor

Metric trunk 6423c3f Diff Change
load 1171 ms 1209 ms +38 ms ⚪ 0.0%

site-startup

Metric trunk 6423c3f Diff Change
siteCreation 7513 ms 7526 ms +13 ms ⚪ 0.0%
siteStartup 3402 ms 3389 ms 13 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

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