Skip to content

feat(ui): an icon is edited by hovering it, with a corner button to remove it - #852

Open
Yifan Lin (linyifan1024) wants to merge 3 commits into
canaryfrom
feature/core-2019-tandem-icons-use-activate-s-icon-editor
Open

Yifan Lin (linyifan1024) wants to merge 3 commits into
canaryfrom
feature/core-2019-tandem-icons-use-activate-s-icon-editor

Conversation

@linyifan1024

@linyifan1024 Yifan Lin (linyifan1024) commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • New EditableIcon: an icon someone can change. Hovering or focusing it dims it and shows the edit text in the middle; clicking it, or Enter, calls onEdit. A round button on its top-right corner calls onRemove, shown only while there's an image. It takes the image's URL (or renderImage), a fallbackIcon, a circle or square shape, border and bgColor, and its text from the shared strings or props.
  • ImageUpload uses it: the separate "Edit image" menu button beside the tile is gone. Clicking the tile opens the file picker and the crop dialog as before; the corner button removes the image.
  • ImageUpload saves an animated GIF as it is, skipping the crop that would keep only its first frame, and passes onUpload a second argument that makes the GIF's centered square as a PNG, for a server that won't take GIFs. A GIF upload that fails shows its message in a toast.
  • imageUpload.upload and imageUpload.replace are gone from the strings, since nothing shows them now. A host that passes them drops them.

Testing

  • New EditableIcon.test.tsx; ImageUpload.test.tsx covers the corner button and the GIF path. The stories smoke test includes the new stories: 738 passed.
  • Biome and tsc --noEmit pass.
  • In Storybook: hover and keyboard focus both show the overlay, Enter opens the editor, the corner button removes the image and then hides, and clicking the upload tile opens the file picker.

At rest:
At rest

Hovered:
Hovered

Keyboard focus:
Keyboard focus

After removing the image (hovered, no corner button):
Removed

Image upload tile, hovered:
Image upload hovered

Checklist

  • make check passes (ran biome, tsc --noEmit and the ui tests above; CI runs the rest)
  • A new or changed shared message is in every language in problem/messages/ (none changed)
  • No code, rule or param was renamed (they are API contract)

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph benchmark

Medians of 3 runs in headless Chrome on a shared runner; lower is better. Base and head run in turn on the same machine. ⚠️ marks a result more than 25% slower than the base, beyond its usual noise.

thousand

Base Head Change
Mount 228 ms 236 ms +4%
Hover, median frame 17 ms 17 ms +0%
Hover, p90 frame 33 ms 33 ms +0%
Hover, slowest frame 233 ms 233 ms +0%
Wheel zoom, median frame 17 ms 17 ms +0%
Wheel zoom, p90 frame 17 ms 17 ms +0%
Page elements 8,058 8,058 +0%

three-thousand

Base Head Change
Mount 542 ms 565 ms +4%
Hover, median frame 133 ms 133 ms +0%
Hover, p90 frame 567 ms 545 ms −4%
Hover, slowest frame 667 ms 667 ms −0%
Wheel zoom, median frame 17 ms 17 ms +0%
Wheel zoom, p90 frame 17 ms 17 ms −1%
Page elements 24,023 24,023 +0%

nested

Base Head Change
Mount 12 ms 11 ms −8%
Hover, median frame 17 ms 17 ms +0%
Hover, p90 frame 17 ms 17 ms +0%
Hover, slowest frame 17 ms 17 ms +0%
Wheel zoom, median frame 17 ms 17 ms +0%
Wheel zoom, p90 frame 17 ms 17 ms +0%
Page elements 140 140 +0%

@linyifan1024
Yifan Lin (linyifan1024) marked this pull request as ready for review November 25, 2026 20:11
@linyifan1024
Yifan Lin (linyifan1024) marked this pull request as draft November 25, 2026 20:12
@linyifan1024
Yifan Lin (linyifan1024) marked this pull request as ready for review November 25, 2026 20:13

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