Skip to content

fix: keep inline tool call open while selecting text#2216

Open
thmsobrmlr wants to merge 1 commit into
mainfrom
posthog-code/fix-tool-toggle-text-selection
Open

fix: keep inline tool call open while selecting text#2216
thmsobrmlr wants to merge 1 commit into
mainfrom
posthog-code/fix-tool-toggle-text-selection

Conversation

@thmsobrmlr
Copy link
Copy Markdown
Contributor

@thmsobrmlr thmsobrmlr commented May 19, 2026

TL;DR: I want to be able to select text from AskUserQuestion, but can't because it toggles when i release the mouse button

Summary

  • Drag-selecting text inside an expanded ToolCallView or ExecuteToolView released on the outer <Box>, which fired the toggle's onClick and collapsed the card before the user could copy.
  • Guard handleClick with window.getSelection() — matches the existing pattern in SessionView.tsx:408-411.
  • Only these two views are affected; the other expandable tool views (Read/Fetch/Search) already scope their onClick to the header <Flex> so the expanded content is a sibling, and Edit/Think/Subagent use dedicated <button> / IconButton for the toggle.

Test plan

  • pnpm --filter code typecheck
  • pnpm --filter code test (1244 tests pass)
  • Manual: trigger an ExecuteToolView (any Bash) or ToolCallView (unrecognized agent tool), expand it, drag-select text in the body — card stays open.
  • Manual: click on the header (no selection) — card still toggles as before.

Drag-selecting text inside an expanded ToolCallView or ExecuteToolView
released on the outer Box, which fired the toggle's onClick and
collapsed the card before the selection could be copied. Guard the
handler with window.getSelection(), matching the existing pattern in
SessionView.

Generated-By: PostHog Code
Task-Id: ee883416-a83f-4b1d-b097-6164d01f04fe
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 19, 2026

Reviews (1): Last reviewed commit: "fix: keep inline tool call open while se..." | Re-trigger Greptile

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