fix(chat): prevent source-row clicks from opening URL twice#104
Merged
quiet-node merged 1 commit intomainfrom Apr 25, 2026
Merged
fix(chat): prevent source-row clicks from opening URL twice#104quiet-node merged 1 commit intomainfrom
quiet-node merged 1 commit intomainfrom
Conversation
The bubble container had a delegated click handler matching any `[data-citation]` ancestor. Source-row buttons in the sources footer carry `data-citation` for hover-link highlighting and own their own click handler that invokes `open_url`. Clicks on a source row therefore fired `open_url` once from the button handler and again from the delegated container handler after bubbling, opening the URL twice in the browser. Tighten the delegated selector to `a[data-citation]` so only inline citation anchors built by `wrapCitations` trigger it. Source-row buttons no longer match, eliminating the double-fire. Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ChatBubblefrom[data-citation]toa[data-citation]so source-row footer buttons no longer match the delegated handler.open_url; they were matching the container's delegated[data-citation]handler too (used for hover highlighting), causing every source click to invokeopen_urltwice and open the URL twice in the browser.wrapCitations) keep their behavior; only delegated routing changes.Test plan
bun run test(721/721 pass)bun run validate-build(lint + format + typecheck + frontend build + backend build, exit 0)/searchturn, expand the Sources footer, click a source — confirm browser opens the URL exactly once.