Skip to content

feat(viewer): icon-only "Add comment" selection popover#561

Merged
yumike merged 1 commit into
mainfrom
icon-only-add-comment
Jun 22, 2026
Merged

feat(viewer): icon-only "Add comment" selection popover#561
yumike merged 1 commit into
mainfrom
icon-only-add-comment

Conversation

@yumike

@yumike yumike commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

What

The popover shown when you select text in a doc is now icon-only — the speech-bubble icon, with the visible "Add comment" text dropped — for a more compact affordance.

How

  • Switched the affordance to the shared IconButton primitive, which requires an aria-label. The accessible name "Add comment" is therefore preserved by construction — screen readers and the getByRole("button", { name: "Add comment" }) e2e selectors are unaffected.
  • Moved the floating chrome (shadow-lg) onto the button and turned the Popover wrapper into a pure positioner, dropping the hardcoded bg-white dark:bg-neutral-700 in favor of IconButton's theme tokens (better dark-mode consistency).
  • Hardened IconButton: it spread props onto a bare <button> defaulting to type="submit". Defaulted it to type="button" (matching Button.svelte) so none of its call sites can accidentally submit an enclosing form. Callers can still override. Added unit tests for the default and the override.

Verification

  • svelte-check: 0 errors; eslint: clean.
  • IconButton unit tests: 9/9 (2 new).
  • Comment e2e specs (comments.spec.ts, comment-navigation.spec.ts): 48/48, including the anchor-alignment/pending-form positioning tests — no test changes needed.

🤖 Generated with Claude Code

The popover shown when you select text in a doc is now icon-only — the
speech-bubble icon, with the visible "Add comment" text dropped — for a
more compact affordance. The button is switched to the shared IconButton
primitive, which requires an aria-label, so the accessible name
"Add comment" is preserved (screen readers and the role+name e2e
selectors are unaffected). The floating chrome (shadow-lg) moves onto the
button and the Popover wrapper becomes a pure positioner, dropping the
hardcoded light/dark colors in favor of IconButton's theme tokens.

Also hardens the shared IconButton primitive: it spread props onto a bare
<button> defaulting to type="submit"; default it to type="button" (like
Button.svelte) so none of its call sites can accidentally submit an
enclosing form. Callers can still override.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@yumike yumike merged commit 26c1cbf into main Jun 22, 2026
18 checks passed
@yumike yumike deleted the icon-only-add-comment branch June 22, 2026 08:35
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