Skip to content

feat(chat): chat-launcher-button emits (clicked) output#354

Merged
blove merged 1 commit into
mainfrom
claude/chat-launcher-button-output
May 16, 2026
Merged

feat(chat): chat-launcher-button emits (clicked) output#354
blove merged 1 commit into
mainfrom
claude/chat-launcher-button-output

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 16, 2026

Summary

Adds a `clicked` output to `ChatLauncherButtonComponent`, bound directly to the inner ``'s native click. Replaces the host-bubbled `(click)` pattern with an explicit, unambiguous click target.

Why

The previous pattern bound `(click)` on the `` host element and relied on click events bubbling up from the inner `

`. This worked for real users but was fragile under hit-testing:

  • Playwright: clicks the center of a locator's bounding box. When a higher-z-index overlay (e.g. `chat-debug` panel) shares part of the launcher's host-box perimeter, the click can land on the overlay even though the visible button is unobstructed. Surfaced in PR feat(chat): chat-debug × chat-sidebar coexistence (edge-claim primitive + auto-dock) #346 CI as the `sidebar launcher remains reachable` test failure.
  • Future hit-tests (accessibility tools, pointer-event capture, programmatic UI tests) hit the same issue.

Moving the click handler to the inner `

` (where the button visually IS) eliminates the ambiguity.

Back-compat

Native `(click)` bindings on `` still work — the click event still bubbles through. External consumers don't need to migrate. The migration is opt-in for explicitness.

Internal consumers migrated

  • `chat-sidebar.component.ts:70` — `(click)` → `(clicked)`
  • `chat-popup.component.ts:62` — `(click)` → `(clicked)`

Test plan

  • `vitest run libs/chat` — 736 passed (2 new in launcher spec: emits-output + native-bubbling-still-works)
  • `npx nx build chat` — green
  • CI green

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 16, 2026 2:08pm

Request Review

The inner <button> now directly emits a `clicked` output, replacing
the previous pattern where consumers bound `(click)` to the host
element and relied on event bubbling. The bubbling approach worked
visually but was fragile under hit-testing — Playwright (and
potentially screen readers / pointer-event detection in higher
stacking contexts) could mis-target the wrapping host element when
a higher-z-index sibling overlapped the launcher's bounding box.

Migrated internal consumers (chat-sidebar, chat-popup) to (clicked).

Back-compat: native (click) bindings on the host still work — the
click event still bubbles unchanged. External consumers don't need
to migrate, but should prefer (clicked) for new code.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@blove blove force-pushed the claude/chat-launcher-button-output branch from 2d1c52c to d6ef4b1 Compare May 16, 2026 14:06
@blove blove merged commit fa069d0 into main May 16, 2026
16 checks passed
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