GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): Cite button stays anchored to the selected text · pingdotgg/t3code@ad11d97

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/web/src/components/chat
    • AssistantSelectionToolbar.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/web/src/components/chat/AssistantSelectionToolbar.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/chat/AssistantSelectionToolbar.tsx
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ export function AssistantSelectionToolbar({
6161
return;
6262
}
6363
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+
);
6473
setSelection({
6574
sourceAnchor: { source: captured.source, range: captured.range, viewport },
6675
citation: {
@@ -72,7 +81,7 @@ export function AssistantSelectionToolbar({
7281
position: resolveSelectionActionPosition({
7382
bounds: viewportRect,
7483
selectionRect: rects.item(rects.length - 1) ?? rect,
75-
pointer,
84+
pointer: pointerOnText ? pointer : null,
7685
viewport: { width: window.innerWidth, height: window.innerHeight },
7786
}),
7887
});

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.