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 @@ -51,8 +51,14 @@ export function SettingsView() {
useAuthStore();
const isDarkMode = useThemeStore((state) => state.isDarkMode);
const toggleDarkMode = useThemeStore((state) => state.toggleDarkMode);
const { autoRunTasks, createPR, setAutoRunTasks, setCreatePR } =
useSettingsStore();
const {
autoRunTasks,
createPR,
desktopNotifications,
setAutoRunTasks,
setCreatePR,
setDesktopNotifications,
} = useSettingsStore();
const terminalLayoutMode = useTerminalLayoutStore(
(state) => state.terminalLayoutMode,
);
Expand Down Expand Up @@ -290,6 +296,30 @@ export function SettingsView() {

<Box className="border-gray-6 border-t" />

{/* Chat Section */}
<Flex direction="column" gap="3">
<Heading size="3">Chat</Heading>
<Card>
<Flex align="center" justify="between">
<Flex direction="column" gap="1">
<Text size="1" weight="medium">
Desktop notifications
</Text>
<Text size="1" color="gray">
Show notifications when the agent finishes working on a task
</Text>
</Flex>
<Switch
checked={desktopNotifications}
onCheckedChange={setDesktopNotifications}
size="1"
/>
</Flex>
</Card>
</Flex>

<Box className="border-gray-6 border-t" />

{/* Task Execution Section */}
<Flex direction="column" gap="3">
<Heading size="3">Task execution</Heading>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface SettingsStore {
createPR: boolean;
defaultModel: string;
defaultFramework: AgentFramework;
desktopNotifications: boolean;

setAutoRunTasks: (autoRun: boolean) => void;
setDefaultRunMode: (mode: DefaultRunMode) => void;
Expand All @@ -28,6 +29,7 @@ interface SettingsStore {
setCreatePR: (createPR: boolean) => void;
setDefaultModel: (model: string) => void;
setDefaultFramework: (framework: AgentFramework) => void;
setDesktopNotifications: (enabled: boolean) => void;
}

export const useSettingsStore = create<SettingsStore>()(
Expand All @@ -41,6 +43,7 @@ export const useSettingsStore = create<SettingsStore>()(
createPR: true,
defaultModel: DEFAULT_MODEL,
defaultFramework: DEFAULT_FRAMEWORK,
desktopNotifications: true,

setAutoRunTasks: (autoRun) => set({ autoRunTasks: autoRun }),
setDefaultRunMode: (mode) => set({ defaultRunMode: mode }),
Expand All @@ -51,6 +54,8 @@ export const useSettingsStore = create<SettingsStore>()(
setCreatePR: (createPR) => set({ createPR }),
setDefaultModel: (model) => set({ defaultModel: model }),
setDefaultFramework: (framework) => set({ defaultFramework: framework }),
setDesktopNotifications: (enabled) =>
set({ desktopNotifications: enabled }),
}),
{
name: "settings-storage",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
useSessionActions,
useSessionForTask,
} from "@features/sessions/stores/sessionStore";
import { useSettingsStore } from "@features/settings/stores/settingsStore";
import { useTaskViewedStore } from "@features/sidebar/stores/taskViewedStore";
import { useTaskData } from "@features/task-detail/hooks/useTaskData";
import {
Expand Down Expand Up @@ -95,7 +96,8 @@ export function TaskLogsPanel({ taskId, task }: TaskLogsPanelProps) {
}

const isWindowFocused = document.hasFocus();
if (!isWindowFocused) {
const { desktopNotifications } = useSettingsStore.getState();
if (!isWindowFocused && desktopNotifications) {
trpcVanilla.dockBadge.show.mutate();
}
} catch (error) {
Expand Down
Empty file.