Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(desktop): add change default row to the composer model popup (#97280)

Vojta Bartoš3853e9ba5f87
diff --git a/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.test.tsx b/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.test.tsx
index 7af4d20427aa..67d5175e7a0e 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.test.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.test.tsx
@@ -766,6 +766,35 @@ describe("ReasoningLevelSelector", () => {
expect(onChange).not.toHaveBeenCalled();
});
+ it("opens the default settings from the Change default row", async () => {
+ const onChange = vi.fn();
+ const onModelChange = vi.fn();
+ const onOpenDefaultSettings = vi.fn();
+ const user = userEvent.setup({ pointerEventsCheck: 0 });
+ render(
+ <Theme>
+ <ReasoningLevelSelector
+ thoughtOption={thoughtOption({ currentValue: "max" })}
+ modelOption={claudeModelOption("claude-fable-5")}
+ adapter="claude"
+ onChange={onChange}
+ onModelChange={onModelChange}
+ onOpenDefaultSettings={onOpenDefaultSettings}
+ />
+ </Theme>,
+ );
+
+ // No Advanced click: the row sits under the slider face too.
+ await user.click(
+ screen.getByRole("button", { name: /Model and reasoning/ }),
+ );
+ await user.click(await screen.findByText("Change default"));
+
+ await pollUntil(() => onOpenDefaultSettings.mock.calls.length > 0);
+ expect(onModelChange).not.toHaveBeenCalled();
+ expect(onChange).not.toHaveBeenCalled();
+ });
+
it.each([
[
"shows a disabled reset on the slider face while on the default",
diff --git a/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.tsx b/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.tsx
index 363694bd6c0d..784d9045b1b7 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.tsx
@@ -1,5 +1,5 @@
import type { SessionConfigOption } from "@agentclientprotocol/sdk";
-import { ArrowCounterClockwise, Lightning } from "@phosphor-icons/react";
+import { ArrowCounterClockwise, Gear, Lightning } from "@phosphor-icons/react";
import {
getCapabilityLadder,
getReasoningEffortOptions,
@@ -107,6 +107,13 @@ interface ReasoningLevelSelectorProps {
* trigger's "Default ·" marker — the two diverge when no default applies.
*/
resetToDefaultDisabled?: boolean;
+ /**
+ * Takes the user to where the default itself is configured. Passed as a
+ * callback rather than a route so the picker stays free of the app's
+ * settings navigation. Omit and the "Change default" row is absent. Matches
+ * the web composer's row.
+ */
+ onOpenDefaultSettings?: () => void;
/**
* Position and size the popup against this element instead of the trigger.
*
@@ -160,6 +167,7 @@ export function ReasoningLevelSelector({
isDefaultSelection,
onResetToDefault,
resetToDefaultDisabled,
+ onOpenDefaultSettings,
anchor,
}: ReasoningLevelSelectorProps) {
const [internalMenuOpen, setInternalMenuOpen] = useState(false);
@@ -456,6 +464,15 @@ export function ReasoningLevelSelector({
<ArrowCounterClockwise size={12} weight="bold" />
Reset to default
</DropdownMenuItem>
+ {/* Sits under the reset row because that's where the question arises:
+ reverting to a default you disagree with is the moment you want to
+ change it. */}
+ {onOpenDefaultSettings && (
+ <DropdownMenuItem onClick={() => selectAndClose(onOpenDefaultSettings)}>
+ <Gear size={12} weight="bold" />
+ Change default
+ </DropdownMenuItem>
+ )}
</>
);
diff --git a/products/desktop/packages/ui/src/features/task-detail/components/TaskInput.tsx b/products/desktop/packages/ui/src/features/task-detail/components/TaskInput.tsx
index 6fc202ae1dd7..e51f2f4d8b08 100644
--- a/products/desktop/packages/ui/src/features/task-detail/components/TaskInput.tsx
+++ b/products/desktop/packages/ui/src/features/task-detail/components/TaskInput.tsx
@@ -1696,6 +1696,9 @@ export function TaskInput({
isDefaultSelection={isDefaultSelection}
onResetToDefault={resetToDefault}
resetToDefaultDisabled={resetToDefaultDisabled}
+ onOpenDefaultSettings={() =>
+ openSettings("task-agent-defaults")
+ }
/>
)
}