Skip to content

Commit cdb4774

Browse files
chore: remove settings lab section (#5145)
Drop Lab settings navigation and force the classic app shell by ignoring stale preview flags.
1 parent 55d0092 commit cdb4774

22 files changed

Lines changed: 32 additions & 1587 deletions

apps/desktop/src-tauri/src/ext.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,14 @@ impl<R: tauri::Runtime, T: tauri::Manager<R>> AppExt<R> for T {
117117

118118
#[tracing::instrument(skip_all)]
119119
fn get_char_v1p1_preview(&self) -> Result<bool, String> {
120-
if cfg!(feature = "new") {
121-
return Ok(true);
122-
}
123-
let store = self.desktop_store()?;
124-
store
125-
.get(StoreKey::CharV1p1Preview)
126-
.map(|opt| opt.unwrap_or(false))
127-
.map_err(|e| e.to_string())
120+
Ok(false)
128121
}
129122

130123
#[tracing::instrument(skip_all)]
131-
fn set_char_v1p1_preview(&self, v: bool) -> Result<(), String> {
124+
fn set_char_v1p1_preview(&self, _v: bool) -> Result<(), String> {
132125
let store = self.desktop_store()?;
133126
store
134-
.set(StoreKey::CharV1p1Preview, v)
127+
.set(StoreKey::CharV1p1Preview, false)
135128
.map_err(|e| e.to_string())?;
136129
store.save().map_err(|e| e.to_string())
137130
}

apps/desktop/src/routes/app/-resolve-entry-path.test.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ vi.mock("@tauri-apps/api/core", () => ({
88

99
import {
1010
getOnboardingNeeded,
11+
isExperimentalShellPath,
1112
isShellEntryPath,
1213
normalizeAppPath,
1314
resolveAppEntryPath,
@@ -46,21 +47,25 @@ describe("app entry path resolution", () => {
4647
await expect(resolveAppEntryPath()).resolves.toBe("/app/onboarding");
4748
});
4849

49-
it("routes to main2 when onboarding is complete and the flag is on", async () => {
50+
it("keeps classic main even when the old preview flag is on", async () => {
5051
vi.mocked(commands.getCharV1p1Preview).mockResolvedValue({
5152
status: "ok",
5253
data: true,
5354
});
5455

55-
await expect(resolveShellEntryPath()).resolves.toBe("/app/main2");
56-
await expect(resolveAppEntryPath()).resolves.toBe("/app/main2");
56+
await expect(resolveShellEntryPath()).resolves.toBe("/app/main");
57+
await expect(resolveAppEntryPath()).resolves.toBe("/app/main");
58+
expect(commands.getCharV1p1Preview).not.toHaveBeenCalled();
5759
});
5860

5961
it("normalizes and identifies shell entry paths", () => {
6062
expect(normalizeAppPath("/app/main2/")).toBe("/app/main2");
6163
expect(isShellEntryPath("/app")).toBe(true);
6264
expect(isShellEntryPath("/app/main/")).toBe(true);
6365
expect(isShellEntryPath("/app/main2")).toBe(true);
66+
expect(isExperimentalShellPath("/app/main2/")).toBe(true);
67+
expect(isExperimentalShellPath("/app/main2/sessions/session-1")).toBe(true);
68+
expect(isExperimentalShellPath("/app/main")).toBe(false);
6469
expect(isShellEntryPath("/app/onboarding")).toBe(false);
6570
});
6671
});

apps/desktop/src/routes/app/-resolve-entry-path.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,12 @@ export async function getOnboardingNeeded(): Promise<boolean> {
1111
return result.status === "ok" && result.data;
1212
}
1313

14-
export async function resolveShellEntryPath(): Promise<
15-
"/app/main" | "/app/main2"
16-
> {
17-
if (!isTauri()) {
18-
return "/app/main";
19-
}
20-
21-
const result = await commands.getCharV1p1Preview();
22-
return result.status === "ok" && result.data ? "/app/main2" : "/app/main";
14+
export async function resolveShellEntryPath(): Promise<"/app/main"> {
15+
return "/app/main";
2316
}
2417

2518
export async function resolveAppEntryPath(): Promise<
26-
"/app/main" | "/app/main2" | "/app/onboarding"
19+
"/app/main" | "/app/onboarding"
2720
> {
2821
if (await getOnboardingNeeded()) {
2922
return "/app/onboarding";
@@ -48,3 +41,10 @@ export function isShellEntryPath(pathname: string): boolean {
4841
normalizedPath === "/app/main2"
4942
);
5043
}
44+
45+
export function isExperimentalShellPath(pathname: string): boolean {
46+
const normalizedPath = normalizeAppPath(pathname);
47+
return (
48+
normalizedPath === "/app/main2" || normalizedPath.startsWith("/app/main2/")
49+
);
50+
}

apps/desktop/src/routes/app/route.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { TooltipProvider } from "@hypr/ui/components/ui/tooltip";
44

55
import {
66
getOnboardingNeeded,
7+
isExperimentalShellPath,
78
isShellEntryPath,
89
normalizeAppPath,
910
resolveShellEntryPath,
@@ -27,6 +28,10 @@ export const Route = createFileRoute("/app")({
2728
if (onboardingNeeded && isShellEntryPath(pathname)) {
2829
throw redirect({ to: "/app/onboarding" });
2930
}
31+
32+
if (!onboardingNeeded && isExperimentalShellPath(pathname)) {
33+
throw redirect({ to: await resolveShellEntryPath() });
34+
}
3035
},
3136
component: Component,
3237
loader: async ({ context: { listenerStore } }) => {

apps/desktop/src/settings/index.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ import {
88
SettingsNotifications,
99
SettingsPermissions,
1010
} from "./general";
11-
import { SettingsLab } from "./lab";
12-
import { AgentIntegrations } from "./lab/agent-integrations";
13-
import { DeveloperSettings } from "./lab/developer";
14-
import { SettingsTodo } from "./todo";
1511

1612
import { LLM } from "~/settings/ai/llm";
1713
import { STT } from "~/settings/ai/stt";
@@ -71,18 +67,10 @@ function SettingsView({ tab }: { tab: Extract<Tab, { type: "settings" }> }) {
7167
return <SettingsNotifications />;
7268
case "permissions":
7369
return <SettingsPermissions />;
74-
case "lab":
75-
return <SettingsLab />;
76-
case "agent":
77-
return <AgentIntegrations />;
78-
case "developer":
79-
return <DeveloperSettings />;
8070
case "transcription":
8171
return <STT />;
8272
case "intelligence":
8373
return <LLM />;
84-
case "todo":
85-
return <SettingsTodo />;
8674
}
8775
};
8876

apps/desktop/src/settings/lab/agent-integrations.tsx

Lines changed: 0 additions & 197 deletions
This file was deleted.

0 commit comments

Comments
 (0)