fix(cli): fix preview opening wrong project in dev mode

The dev mode preview URL used `#/project/<name>` (with leading
slash) but the studio's App.tsx route parser expects `#project/`
(no leading slash). The hash never matched, so the studio fell
through to auto-selecting the first project from /api/projects
instead of the one specified on the command line.

Removes the leading slash to match the studio's expected format,
which local-studio and embedded modes already use correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Miguel Ángel
2026-04-07 15:38:25 +00:00
committed by Miguel Ángel
co-authored by Claude Opus 4.6
parent ef2f646c90
commit 6c4549cbb7
+1 -1
View File
@@ -173,7 +173,7 @@ async function runDevMode(dir: string, projectName?: string): Promise<void> {
console.log(` ${c.dim("Press Ctrl+C to stop")}`);
console.log();
const urlToOpen = `${frontendUrl}#/project/${pName}`;
const urlToOpen = `${frontendUrl}#project/${pName}`;
import("open").then((mod) => mod.default(urlToOpen)).catch(() => {});
child.stdout?.removeListener("data", handleOutput);