Skip to content

Commit 66a0df1

Browse files
feat: restore project thread trees and align desktop updates
1 parent 3d74474 commit 66a0df1

12 files changed

Lines changed: 103 additions & 16 deletions

File tree

‎apps/desktop/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@t3tools/desktop",
3-
"version": "0.0.32",
3+
"version": "0.0.33",
44
"private": true,
55
"type": "module",
66
"main": "dist-electron/main.cjs",

‎apps/desktop/src/main.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,23 @@ const resolveDesktopSshCliRunner = (
9191
nodeEngineRange: serverPackageJson.engines.node,
9292
};
9393
}
94+
const remoteDesktopAppContents = `/Applications/${environment.displayName}.app/Contents`;
9495
return {
9596
packageSpec: resolveRemoteT3CliPackageSpec({
9697
appVersion: environment.appVersion,
9798
updateChannel: settings.updateChannel,
9899
isDevelopment: environment.isDevelopment,
99100
}),
100101
nodeEngineRange: serverPackageJson.engines.node,
102+
...(environment.isPackaged && environment.platform === "darwin"
103+
? {
104+
desktopCli: {
105+
executablePath: `${remoteDesktopAppContents}/MacOS/${environment.displayName}`,
106+
entryPath: `${remoteDesktopAppContents}/Resources/app.asar/apps/server/dist/bin.mjs`,
107+
version: environment.appVersion,
108+
},
109+
}
110+
: {}),
101111
};
102112
};
103113

‎apps/server/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "t3",
3-
"version": "0.0.32",
3+
"version": "0.0.33",
44
"license": "MIT",
55
"repository": {
66
"type": "git",

‎apps/web/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@t3tools/web",
3-
"version": "0.0.32",
3+
"version": "0.0.33",
44
"private": true,
55
"type": "module",
66
"scripts": {

‎apps/web/src/components/settings/SettingsPanels.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ function LegacyFeaturesSection() {
16491649
/>
16501650
<SettingsRow
16511651
{...searchableSetting("legacy-sidebar")}
1652-
description="Brings back the original sidebar with per-project thread trees. The default sidebar shows one flat list: active work as rich cards, settled threads as compact rows."
1652+
description="Groups threads into expandable project trees. Turn this off to use one flat list with active work as rich cards and settled threads as compact rows."
16531653
control={
16541654
<Switch
16551655
checked={settings.legacySidebarEnabled}

‎packages/contracts/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@t3tools/contracts",
3-
"version": "0.0.32",
3+
"version": "0.0.33",
44
"private": true,
55
"files": [
66
"dist"

‎packages/contracts/src/settings.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ describe("ClientSettings environment identification", () => {
6868
});
6969

7070
describe("ClientSettings sidebar", () => {
71-
it("defaults to the current sidebar with a three-day auto-settle threshold", () => {
71+
it("defaults to the expandable project sidebar with a three-day auto-settle threshold", () => {
7272
const settings = decodeClientSettings({});
73-
expect(settings.legacySidebarEnabled).toBe(false);
73+
expect(settings.legacySidebarEnabled).toBe(true);
7474
expect(settings.sidebarAutoSettleAfterDays).toBe(3);
7575
});
7676

@@ -79,7 +79,7 @@ describe("ClientSettings sidebar", () => {
7979
sidebarV2Enabled: false,
8080
sidebarV2ConfiguredByUser: true,
8181
});
82-
expect(decoded.legacySidebarEnabled).toBe(false);
82+
expect(decoded.legacySidebarEnabled).toBe(true);
8383
expect(decoded).not.toHaveProperty("sidebarV2Enabled");
8484
expect(decoded).not.toHaveProperty("sidebarV2ConfiguredByUser");
8585
});

‎packages/contracts/src/settings.ts‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,10 @@ export const ClientSettingsSchema = Schema.Struct({
172172
// default UI; this beta flag restores it (plus the /plan and /default slash
173173
// commands) for users who still rely on the old workflow.
174174
planModeEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
175-
// Legacy sidebar (the original per-project tree). Deliberately a fresh key
176-
// (was `sidebarV2Enabled` + `sidebarV2ConfiguredByUser`): decoding drops the
177-
// old keys, so everyone, including prior beta opt-outs, resets to the new
178-
// default sidebar.
179-
legacySidebarEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
175+
// The original per-project tree remains the default because it preserves
176+
// project context and lets users expand each project into its threads. The
177+
// flat sidebar stays available as an explicit opt-out through this setting.
178+
legacySidebarEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
180179
sidebarAutoSettleAfterDays: Schema.NullOr(SidebarAutoSettleAfterDays).pipe(
181180
Schema.withDecodingDefault(Effect.succeed(DEFAULT_SIDEBAR_AUTO_SETTLE_AFTER_DAYS)),
182181
),

‎packages/ssh/src/tunnel.test.ts‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ describe("ssh tunnel scripts", () => {
9393
const script = buildRemoteT3RunnerScript({ nodeEngineRange: TEST_NODE_ENGINE_RANGE });
9494

9595
assert.include(script, "T3_NODE_SCRIPT_PATH=''");
96+
assert.include(script, "T3_DESKTOP_CLI_EXECUTABLE=''");
9697
assert.include(script, 'exec t3 "$@"');
9798
assert.include(script, "exec npx --yes 't3@latest' \"$@\"");
9899
assert.include(script, "exec npm exec --yes 't3@latest' -- \"$@\"");
@@ -115,6 +116,33 @@ describe("ssh tunnel scripts", () => {
115116
assert.notInclude(script, "ensure $NVM_DIR/nvm.sh is available");
116117
});
117118

119+
it("prefers a matching installed desktop CLI before the package fallback", () => {
120+
const script = buildRemoteT3RunnerScript({
121+
packageSpec: "[email protected]",
122+
desktopCli: {
123+
executablePath: "/Applications/T3 Code (Alpha).app/Contents/MacOS/T3 Code (Alpha)",
124+
entryPath:
125+
"/Applications/T3 Code (Alpha).app/Contents/Resources/app.asar/apps/server/dist/bin.mjs",
126+
version: "0.0.33",
127+
},
128+
});
129+
130+
assert.include(
131+
script,
132+
"T3_DESKTOP_CLI_EXECUTABLE='/Applications/T3 Code (Alpha).app/Contents/MacOS/T3 Code (Alpha)'",
133+
);
134+
assert.include(script, 'T3_INSTALLED_DESKTOP_CLI_VERSION="$(env ELECTRON_RUN_AS_NODE=1');
135+
assert.include(
136+
script,
137+
'if [ "$T3_INSTALLED_DESKTOP_CLI_VERSION" = "t3 v$T3_DESKTOP_CLI_VERSION" ]; then',
138+
);
139+
assert.include(
140+
script,
141+
'exec env ELECTRON_RUN_AS_NODE=1 "$T3_DESKTOP_CLI_EXECUTABLE" "$T3_DESKTOP_CLI_ENTRY" "$@"',
142+
);
143+
assert.include(script, "exec npx --yes '[email protected]' \"$@\"");
144+
});
145+
118146
it("does not hard-code a remote node engine range", () => {
119147
const script = buildRemoteT3RunnerScript();
120148

‎packages/ssh/src/tunnel.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ export interface RemoteT3RunnerOptions {
6161
readonly packageSpec?: string;
6262
readonly nodeScriptPath?: string | null;
6363
readonly nodeEngineRange?: string | null;
64+
readonly desktopCli?: {
65+
readonly executablePath: string;
66+
readonly entryPath: string;
67+
readonly version: string;
68+
} | null;
6469
}
6570

6671
export interface SshEnvironmentManagerOptions {
@@ -422,6 +427,15 @@ if [ -n "$T3_NODE_SCRIPT_PATH" ]; then
422427
fi
423428
exec node "$T3_NODE_SCRIPT_PATH" "$@"
424429
fi
430+
T3_DESKTOP_CLI_EXECUTABLE=@@T3_DESKTOP_CLI_EXECUTABLE@@
431+
T3_DESKTOP_CLI_ENTRY=@@T3_DESKTOP_CLI_ENTRY@@
432+
T3_DESKTOP_CLI_VERSION=@@T3_DESKTOP_CLI_VERSION@@
433+
if [ -n "$T3_DESKTOP_CLI_EXECUTABLE" ] && [ -x "$T3_DESKTOP_CLI_EXECUTABLE" ]; then
434+
T3_INSTALLED_DESKTOP_CLI_VERSION="$(env ELECTRON_RUN_AS_NODE=1 "$T3_DESKTOP_CLI_EXECUTABLE" "$T3_DESKTOP_CLI_ENTRY" --version 2>/dev/null || true)"
435+
if [ "$T3_INSTALLED_DESKTOP_CLI_VERSION" = "t3 v$T3_DESKTOP_CLI_VERSION" ]; then
436+
exec env ELECTRON_RUN_AS_NODE=1 "$T3_DESKTOP_CLI_EXECUTABLE" "$T3_DESKTOP_CLI_ENTRY" "$@"
437+
fi
438+
fi
425439
if command -v t3 >/dev/null 2>&1; then
426440
exec t3 "$@"
427441
fi
@@ -633,10 +647,14 @@ fi
633647
export function buildRemoteT3RunnerScript(input?: RemoteT3RunnerOptions): string {
634648
const packageSpec = shellSingleQuote(input?.packageSpec?.trim() || "t3@latest");
635649
const nodeScriptPath = input?.nodeScriptPath?.trim() || "";
650+
const desktopCli = input?.desktopCli;
636651
return stripTrailingNewlines(
637652
applyScriptPlaceholders(REMOTE_RUNNER_SCRIPT, {
638653
T3_PACKAGE_SPEC: packageSpec,
639654
T3_NODE_SCRIPT_PATH: shellSingleQuote(nodeScriptPath),
655+
T3_DESKTOP_CLI_EXECUTABLE: shellSingleQuote(desktopCli?.executablePath.trim() || ""),
656+
T3_DESKTOP_CLI_ENTRY: shellSingleQuote(desktopCli?.entryPath.trim() || ""),
657+
T3_DESKTOP_CLI_VERSION: shellSingleQuote(desktopCli?.version.trim() || ""),
640658
T3_NODE_ENV_SCRIPT: buildRemoteNodeEnvScript(input),
641659
}),
642660
);

0 commit comments

Comments
 (0)