Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): copy chat and terminal selections automatically, Herdr-style #9409

ClosedSotoAugusto(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromrefs/pull/9409/headopened View on GitHub

Showing 12 changed files with 71 additions and 0 deletions (loading 9).

x
0 of 12 viewed, 12 left
2 additions and 0 deletionsapps/desktop/src/settings/DesktopClientSettings.test.tsModified
View file
@@ -60,6 +60,8 @@
legacySidebarEnabled: false,
timestampFormat: "24-hour",
wordWrap: true,
+ copyOnSelect: false,
+ copyOnSelectToast: true,
};
​
const decodeClientSettingsJson = Schema.decodeEffect(Schema.fromJsonString(ClientSettingsSchema));
4 additions and 0 deletionsapps/web/src/components/chat/MessagesTimeline.tsxModified
View file
@@ -116,6 +116,7 @@
import { MessageCopyButton } from "./MessageCopyButton";
import { PierreEntryIcon } from "./PierreEntryIcon";
import { AssistantSelectionToolbar } from "./AssistantSelectionToolbar";
+import { useCopyOnSelect } from "../../hooks/useCopyOnSelect";
import type { AssistantCitationSourceAnchor } from "~/lib/assistantTextSelection";
import {
AssistantCitationSource,
@@ -551,6 +552,9 @@
const [timelineViewportElement, setTimelineViewportElement] = useState<HTMLDivElement | null>(
null,
+ // Herdr-style copy-on-select for chat text; the cite toolbar keeps working
+ // alongside it (a selection both copies and offers Cite).
+ useCopyOnSelect(timelineViewportElement);
const {