@devries-cameron20 / t3code Mirror · read-only / commits / 3c1be119b9
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 21, 16:00 UTC

fix(web): middle-clicking empty chat space on Linux no longer pastes into the composer (#36436)

Julius Marminge committed Nov 13, 2026 at 15:15 UTC 3c1be119b9c55e0c9d7406cf1601573bf8200c0f
1 file changed +16 -1
apps/web/src/components/ChatView.tsx
+16 -1
@@ -123,7 +123,15 @@ import { orchestrationV2WorktreePending } from "@t3tools/shared/orchestrationV2T
123 import { resolveThreadReferenceCopyTarget } from "@t3tools/client-runtime/thread-reference";
124 import { resolveTerminalSessionLabel } from "@t3tools/shared/terminalLabels";
125 import { useAtomValue } from "@effect/atom-react";
126 -import { type SetStateAction, use, useEffect, useLayoutEffect, useRef, useState } from "react";
126 +import {
127 + type MouseEvent as ReactMouseEvent,
128 + type SetStateAction,
129 + use,
130 + useEffect,
131 + useLayoutEffect,
132 + useRef,
133 + useState,
134 +} from "react";
135 import { BackgroundThreadContext } from "./chat/backgroundThread";
136 import { WorkspaceMutationIdContext } from "./chat/ChatMarkdownMedia";
137 import { useLocation, useNavigate } from "@tanstack/react-router";
@@ -3318,6 +3326,7 @@ export default function ChatView(props: ChatViewProps) {
3326 data-chat-column-maximized-away={rightPanelMaximized ? "true" : "false"}
3327 data-chat-column
3328 inert={rightPanelMaximized}
3329 + onMouseUp={preventMiddleClickPasteOutsideEditable}
3330 >
3331 {embedded ? null : (
3332 <header
@@ -4045,6 +4054,12 @@ export default function ChatView(props: ChatViewProps) {
4054 );
4055 }
4056
4057 +// Chromium on Linux pastes PRIMARY into the focused editable unless the middle mouseup is cancelled.
4058 +function preventMiddleClickPasteOutsideEditable(event: ReactMouseEvent) {
4059 + if (event.button !== 1 || isEditableFocused(event.target)) return;
4060 + event.preventDefault();
4061 +}
4062 +
4063 function PreviewSessionSync(props: { readonly threadRef: ScopedThreadRef }) {
4064 usePreviewSession(props.threadRef);
4065 return null;