Skip to content

Design Exploration: Improve visual annotation workflows - #4411

Open
shaunandrews wants to merge 9 commits into
trunkfrom
iterate-annotation-workflows
Open

Design Exploration: Improve visual annotation workflows#4411
shaunandrews wants to merge 9 commits into
trunkfrom
iterate-annotation-workflows

Conversation

@shaunandrews

@shaunandrews shaunandrews commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Built through an iterative Codex session with continuous human UX feedback. Codex implemented the feature, hardened the data flow, and added tests; the interaction design was manually reviewed in an isolated Electron build.

Proposed Changes

  • Makes Studio preview annotations a focused batch workflow: select an element, write a note, save and continue, then send the batch to chat.
  • Adds a compact draggable composer, scrim, persistent outlines and numbered markers, overlapping-layer selection, keyboard controls, scroll locking, and viewport-safe markers.
  • Keeps unsent annotations across page navigation while rendering markers and outlines only on the page where each note was created.
  • Sends each annotation as its own chat message with an attached element chip containing useful tag, ID/class, and nearby-text context.
  • Uses one shared inspector runtime for Studio and the standalone CLI browser, with thin host adapters for Studio's secure bridge and the CLI's local handoff.
  • Adds payload validation, size/count limits, safer browser lifecycle handling, and bounded persisted state.

Screenshots

1. Enter annotation mode — light

The preview toolbar exposes a clear Annotate action before any element is selected.

Studio preview with the Annotate toolbar action in light mode

2. Select an element and compose a note — light and dark

The selected element stays isolated by the scrim while the composer exposes element context, overlapping-layer navigation, cancel, save, and send actions.

Light Dark
Annotation composer and selected headline in light mode Annotation composer and selected headline in dark mode

3. Save several notes and keep annotating — dark

Saved elements retain numbered outlines while annotation mode stays active and Send to chat becomes available.

Two saved annotations with persistent outlines and numbered markers in dark mode

4. Keep edge markers visible — light

When the selected element extends beyond the viewport, its numbered marker clamps into view.

Annotation marker kept visible against the top viewport edge in light mode

5. Send annotations to chat — light

Each submitted note becomes a separate user message with its element context attached underneath.

Two annotation notes rendered as separate chat messages with element attachments

Review guide

Please focus on the shared inspector lifecycle, cross-page batch persistence, structured annotation payload, and the security boundary between previewed pages and Studio. Transcript styling and screenshots are comparatively self-contained.

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

Testing Instructions

  1. In Studio, annotate normal and overlapping elements, drag the composer, save several notes across multiple pages, and send them to chat.
  2. Confirm only the current page's saved elements are outlined and each note appears as a separate chat message with element context.
  3. Build the CLI, open its standalone annotation browser, and repeat the select/save/navigate/send flow.
  4. Run:
    • npm run typecheck
    • npm test -- apps/ui/src/components/site-preview/inspector-script.test.ts apps/ui/src/components/site-preview/index.test.tsx apps/ui/src/ui-classic/components/session-view/annotations.test.ts apps/ui/src/ui-classic/components/session-view/conversation/index.test.ts apps/ui/src/data/queries/use-agent-run.test.tsx apps/cli/ai/inspector/annotation-result.test.ts apps/cli/commands/ai/sessions/tests/resume.test.ts packages/common/ai/inspector-annotations.test.ts packages/common/ai/visual-annotations.test.ts
    • npm run cli:build
    • npm run build --workspace @studio/ui

Pre-merge Checklist

  • Typecheck passes
  • Focused tests pass
  • CLI and production UI builds pass
  • Human visual review in light and dark mode
  • Full CI passes

@shaunandrews
shaunandrews marked this pull request as ready for review July 31, 2026 21:32
@wpmobilebot

wpmobilebot commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 651a413 vs trunk

app-size

Metric trunk 651a413 Diff Change
App Size (Mac) 1406.61 MB 1406.74 MB +0.13 MB ⚪ 0.0%

site-editor

Metric trunk 651a413 Diff Change
load 1074 ms 1070 ms 4 ms ⚪ 0.0%

site-startup

Metric trunk 651a413 Diff Change
siteCreation 7544 ms 7539 ms 5 ms ⚪ 0.0%
siteStartup 2871 ms 2872 ms +1 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

@shaunandrews
shaunandrews requested review from a team and bcotrim August 5, 2026 02:12
@shaunandrews shaunandrews changed the title Improve visual annotation workflows Agentic UI: Improve visual annotation workflows Aug 6, 2026
@shaunandrews shaunandrews changed the title Agentic UI: Improve visual annotation workflows Design Exploration: Improve visual annotation workflows Aug 6, 2026
…orkflows

# Conflicts:
#	apps/studio/src/ipc-handlers.ts
#	apps/ui/src/components/site-preview/index.tsx
#	apps/ui/src/components/site-preview/inspector-script.ts
#	apps/ui/src/components/site-preview/types.ts
#	apps/ui/src/ui-classic/components/session-view/conversation/index.tsx
#	apps/ui/src/ui-classic/components/session-view/index.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants