Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ export function SettingsView() {
createPR,
cursorGlow,
desktopNotifications,
autoConvertLongText,
sendMessagesWith,
setAutoRunTasks,
setCreatePR,
setCursorGlow,
setDesktopNotifications,
setAutoConvertLongText,
setSendMessagesWith,
} = useSettingsStore();
const terminalLayoutMode = useTerminalLayoutStore(
Expand Down Expand Up @@ -165,6 +167,18 @@ export function SettingsView() {
[terminalLayoutMode, setTerminalLayout],
);

const handleAutoConvertLongTextChange = useCallback(
(checked: boolean) => {
track(ANALYTICS_EVENTS.SETTING_CHANGED, {
setting_name: "auto_convert_long_text",
new_value: checked,
old_value: autoConvertLongText,
});
setAutoConvertLongText(checked);
},
[autoConvertLongText, setAutoConvertLongText],
);

const handleSendMessagesWithChange = useCallback(
(value: SendMessagesWith) => {
track(ANALYTICS_EVENTS.SETTING_CHANGED, {
Expand Down Expand Up @@ -376,6 +390,23 @@ export function SettingsView() {
/>
</Flex>

<Flex align="center" justify="between">
<Flex direction="column" gap="1">
<Text size="1" weight="medium">
Auto-convert long text
</Text>
<Text size="1" color="gray">
Automatically convert pasted text over 500 characters into
an attachment
</Text>
</Flex>
<Switch
checked={autoConvertLongText}
onCheckedChange={handleAutoConvertLongTextChange}
size="1"
/>
</Flex>

<Flex align="center" justify="between">
<Flex direction="column" gap="1">
<Text size="1" weight="medium">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface SettingsStore {
defaultModel: string;
desktopNotifications: boolean;
cursorGlow: boolean;
autoConvertLongText: boolean;
sendMessagesWith: SendMessagesWith;

setAutoRunTasks: (autoRun: boolean) => void;
Expand All @@ -28,6 +29,7 @@ interface SettingsStore {
setDefaultModel: (model: string) => void;
setDesktopNotifications: (enabled: boolean) => void;
setCursorGlow: (enabled: boolean) => void;
setAutoConvertLongText: (enabled: boolean) => void;
setSendMessagesWith: (mode: SendMessagesWith) => void;
}

Expand All @@ -43,6 +45,7 @@ export const useSettingsStore = create<SettingsStore>()(
defaultModel: DEFAULT_MODEL,
desktopNotifications: true,
cursorGlow: false,
autoConvertLongText: true,
sendMessagesWith: "enter",

setAutoRunTasks: (autoRun) => set({ autoRunTasks: autoRun }),
Expand All @@ -56,6 +59,8 @@ export const useSettingsStore = create<SettingsStore>()(
setDesktopNotifications: (enabled) =>
set({ desktopNotifications: enabled }),
setCursorGlow: (enabled) => set({ cursorGlow: enabled }),
setAutoConvertLongText: (enabled) =>
set({ autoConvertLongText: enabled }),
setSendMessagesWith: (mode) => set({ sendMessagesWith: mode }),
}),
{
Expand Down
Loading