Skip to content

Dim the preview around the element being annotated - #4825

Merged
wojtekn merged 2 commits into
trunkfrom
dim-preview-around-annotated-element
Sep 14, 2026
Merged

wojtekn merged 2 commits into
trunkfrom
dim-preview-around-annotated-element

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 scrim from #4411 onto trunk's inspector script and wrote the test. Reviewed and tested manually in the Desktop app.

Proposed Changes

  • While a preview annotation note is open, the rest of the page dims and only the selected element stays clear, so it is obvious what the note is about.
  • The cut-out follows the element on scroll and reflow, and clears when the note is saved, cancelled, or escaped.
  • Markers for other saved notes sit under the scrim; the highlight and note popup sit above it.

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

Screenshots

Site preview dimmed around a selected headline while its note is open

Testing Instructions

  • Open a site preview, click Annotate, click an element.
  • Everything but that element dims. Scroll and resize the pane; the hole stays on the element.
  • Esc, Save, or Cancel restores the page.
  • npm test -- apps/ui/src/components/site-preview/inspector-script.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

wpmobilebot commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing fe0e84d vs trunk

app-size

Metric trunk fe0e84d Diff Change
App Size (Mac) 1458.21 MB 1458.21 MB 0.00 MB ⚪ 0.0%

site-editor

Metric trunk fe0e84d Diff Change
load 1186 ms 1214 ms +28 ms ⚪ 0.0%

site-startup

Metric trunk fe0e84d Diff Change
siteCreation 7544 ms 7533 ms 11 ms ⚪ 0.0%
siteStartup 3364 ms 3379 ms +15 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@wojtekn
wojtekn merged commit d4766de into trunk Sep 14, 2026
13 checks passed
@wojtekn
wojtekn deleted the dim-preview-around-annotated-element branch September 14, 2026 10:34
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.

3 participants