Файли
openidea/src/features/agents/selection.ts
T
l0ng-ai 9474af4de1 fix(agents): steadier tool-call runs, working row in the stream, selection and scroll fixes
- Reasoning and tool calls fold into one run including running calls, so a run
  keeps its place while a call finishes. Its summary names what runs now; it no
  longer leads with "Reasoning". A folded thought shows its first line. An open
  run is bounded and follows its latest call.
- The working / starting / retrying row with its timer ends the conversation
  instead of sitting above the composer, for sessions and subagents alike.
- Selecting text no longer pops up a Quote button; Quote stays in the context menu.
- A selection clamped to the conversation ends in its last selectable text, not on
  its edge: WebKit painted a selection ending there into the composer, as a
  triple-click on the last paragraph showed.
- Sending a message while scrolled up returns to the end, where it shows.
2026-11-11 15:20:09 +08:00

7 рядки
323 B
TypeScript

/** Text selected in `stream`, or "" when the selection is elsewhere. */
export function selectionIn(stream: HTMLElement): string {
const sel = window.getSelection();
if (!sel || sel.isCollapsed || !sel.rangeCount) return "";
return stream.contains(sel.getRangeAt(0).commonAncestorContainer) ? sel.toString() : "";
}