fix(app): contain triple-click selection to one message bubble
Triple-clicking a message extended the document Range across the sibling composer and into the textarea, copying both on Cmd+C. Mark the messages region non-selectable on web and re-enable selection on each bubble's outer container so triple-click stays scoped.
This commit is contained in:
@@ -318,6 +318,7 @@ const userMessageStylesheet = StyleSheet.create((theme) => ({
|
|||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "flex-end",
|
justifyContent: "flex-end",
|
||||||
paddingHorizontal: theme.spacing[2],
|
paddingHorizontal: theme.spacing[2],
|
||||||
|
userSelect: isWeb ? "text" : "auto",
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
alignItems: "flex-end",
|
alignItems: "flex-end",
|
||||||
@@ -492,6 +493,7 @@ export const assistantMessageStylesheet = StyleSheet.create((theme) => ({
|
|||||||
container: {
|
container: {
|
||||||
paddingHorizontal: theme.spacing[2],
|
paddingHorizontal: theme.spacing[2],
|
||||||
paddingVertical: theme.spacing[3],
|
paddingVertical: theme.spacing[3],
|
||||||
|
userSelect: isWeb ? "text" : "auto",
|
||||||
},
|
},
|
||||||
containerCompactTop: {
|
containerCompactTop: {
|
||||||
paddingTop: 0,
|
paddingTop: 0,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { FileDropZone } from "@/components/file-drop-zone";
|
|||||||
import type { ImageAttachment } from "@/components/message-input";
|
import type { ImageAttachment } from "@/components/message-input";
|
||||||
import { getProviderIcon } from "@/components/provider-icons";
|
import { getProviderIcon } from "@/components/provider-icons";
|
||||||
import { ToastViewport, useToastHost } from "@/components/toast-host";
|
import { ToastViewport, useToastHost } from "@/components/toast-host";
|
||||||
import { isNative } from "@/constants/platform";
|
import { isNative, isWeb } from "@/constants/platform";
|
||||||
import { useAgentAttentionClear } from "@/hooks/use-agent-attention-clear";
|
import { useAgentAttentionClear } from "@/hooks/use-agent-attention-clear";
|
||||||
import { useAgentInitialization } from "@/hooks/use-agent-initialization";
|
import { useAgentInitialization } from "@/hooks/use-agent-initialization";
|
||||||
import { useAgentInputDraft } from "@/hooks/use-agent-input-draft";
|
import { useAgentInputDraft } from "@/hooks/use-agent-input-draft";
|
||||||
@@ -1349,6 +1349,7 @@ const styles = StyleSheet.create((theme) => ({
|
|||||||
contentContainer: {
|
contentContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
|
...(isWeb ? { userSelect: "none" as const } : {}),
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user