@devries-cameron20 / t3code Mirror · read-only / commits / 55fc13ff68
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 14:15 UTC

fix(web): Cite button stays anchored to the selected text (#17650)

oliver committed Oct 11, 2026 at 16:19 UTC 55fc13ff68d2598b0613721041533dd1160bc5bd
1 file changed +10 -1
apps/web/src/components/chat/AssistantSelectionToolbar.tsx
+10 -1
@@ -61,6 +61,15 @@ export function AssistantSelectionToolbar({
61 return;
62 }
63 const rects = captured.range.getClientRects();
64 + const pointerOnText =
65 + pointer !== null &&
66 + Array.from(rects).some(
67 + (line) =>
68 + pointer.x >= line.left - 8 &&
69 + pointer.x <= line.right + 8 &&
70 + pointer.y >= line.top - 8 &&
71 + pointer.y <= line.bottom + 8,
72 + );
73 setSelection({
74 sourceAnchor: { source: captured.source, range: captured.range, viewport },
75 citation: {
@@ -72,7 +81,7 @@ export function AssistantSelectionToolbar({
81 position: resolveSelectionActionPosition({
82 bounds: viewportRect,
83 selectionRect: rects.item(rects.length - 1) ?? rect,
75 - pointer,
84 + pointer: pointerOnText ? pointer : null,
85 viewport: { width: window.innerWidth, height: window.innerHeight },
86 }),
87 });