Skip to content

fix(core): picker labels honour data-label, then an image's alt - #4727

Open
vanceingalls wants to merge 1 commit into
mainfrom
vance/picker-label-data-label
Open

vanceingalls wants to merge 1 commit into
mainfrom
vance/picker-label-data-label

Conversation

@vanceingalls

@vanceingalls vanceingalls commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

What

The element picker's label for a picked element now uses the element's own data-label first, and an <img>'s alt text before falling back to "Image".

Why

The desktop app's new Cut out / Remove from picture feature writes cutout layers named in data-label (e.g. "Player cutout") and pictures with alt text. Picking one of them in Studio or the desktop preview showed a bare "Image", while the timeline already shows the author's name. The picker and the timeline now agree.

Related work

How

buildElementLabel reads data-label (whitespace-collapsed, trimmed to the existing 56-character cap) before any tag-based rule; for img it uses alt the same way, then "Image".

Test plan

  • Unit tests added/updated: packages/core/src/runtime/picker.test.ts (data-label wins for any tag, alt names an image, blank values fall back, long values are trimmed) — 47/47 pass
  • Manual testing performed
  • Documentation updated (if applicable)
  • Comments follow CONTRIBUTING.md "Comments"

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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