From 997f8a7a7ab3319e5a8ed2050cf768a17176838e Mon Sep 17 00:00:00 2001 From: 137 <113233555+caezium@users.noreply.github.com> Date: Mon, 23 Nov 2026 09:49:36 +0800 Subject: [PATCH] feat(web): open project imports from Projects settings --- .../src/components/onboarding/WelcomePage.tsx | 19 +++++++++++----- .../components/settings/ProjectsSettings.tsx | 22 +++++++++++++++++-- apps/web/src/routes/welcome.tsx | 18 ++++++++++----- docs/user/welcome-page.md | 4 ++++ 4 files changed, 49 insertions(+), 14 deletions(-) diff --git a/apps/web/src/components/onboarding/WelcomePage.tsx b/apps/web/src/components/onboarding/WelcomePage.tsx index 5c1b4218117fc..6daf34cbe0e47 100644 --- a/apps/web/src/components/onboarding/WelcomePage.tsx +++ b/apps/web/src/components/onboarding/WelcomePage.tsx @@ -129,9 +129,11 @@ const SCAN_LIMIT_MESSAGE = msg( export function WelcomePage({ environmentId, onDone, + reviewProjects = false, }: { readonly environmentId: EnvironmentId; readonly onDone: (projectRef?: ScopedProjectRef) => void | Promise; + readonly reviewProjects?: boolean; }) { const { environments } = useEnvironments(); const gt = useGT(); @@ -298,11 +300,14 @@ export function WelcomePage({ isPrimary={isPrimary} onImportSourceEnabled={() => scans[0]?.refresh()} /> - +
+ +
{showPhone ? : null}
@@ -799,15 +804,17 @@ function ProjectsSection({ scan, projectImport, isImporting, + initiallyReviewing, }: { readonly scan: ReturnType[number] | undefined; readonly projectImport: ReturnType; readonly isImporting: boolean; + readonly initiallyReviewing: boolean; }) { const gt = useGT(); const m = useMessages(); const importSourcesLabel = useImportSourcesLabel(); - const [reviewing, setReviewing] = useState(false); + const [reviewing, setReviewing] = useState(initiallyReviewing); const { canWrite, candidates, diff --git a/apps/web/src/components/settings/ProjectsSettings.tsx b/apps/web/src/components/settings/ProjectsSettings.tsx index ee88e39b98213..fbdfc83a0b2ac 100644 --- a/apps/web/src/components/settings/ProjectsSettings.tsx +++ b/apps/web/src/components/settings/ProjectsSettings.tsx @@ -1,4 +1,5 @@ import { EnvironmentId } from "@t3tools/contracts"; +import { Link } from "@tanstack/react-router"; import { T, useGT } from "gt-react"; import { LayersIcon } from "lucide-react"; @@ -6,12 +7,12 @@ import { Button } from "../ui/button"; import { ProjectSettingsPanel } from "./ProjectSettingsPanel"; import { useSettingsScope } from "./SettingsScopeContext"; import { SettingsScopeNotice } from "./SettingsScopeNotice"; -import { SettingsPageContainer } from "./settingsLayout"; +import { SettingsPageContainer, SettingsRow } from "./settingsLayout"; import { ALL_ENVIRONMENTS_VALUE, selectEnvironmentAxis } from "./settingsScopeAxis"; export function ProjectsSettings() { const gt = useGT(); - const { search: value, scope, selectScope } = useSettingsScope(); + const { search: value, scope, selectScope, environment } = useSettingsScope(); const unavailable = scope.kind === "unavailable" ? ( @@ -38,6 +39,23 @@ export function ProjectsSettings() { (scope.reason === "project-missing" || scope.reason === "checkout-missing")); return (
+ {environment ? ( +
+ } + > + Open + + } + /> +
+ ) : null} {value.project && projectScope ? ( location.hash }); - // A ChatGPT sign-in returns here with the computer it set up. - const resumeEnvironmentId = hash.startsWith("agents:") - ? Option.getOrUndefined(decodeEnvironmentId(hash.slice("agents:".length))) - : undefined; + const reviewProjects = hash.startsWith("projects:"); + // Sign-in and project import shortcuts carry the computer they were opened for. + const resumeEnvironmentId = + hash.startsWith("agents:") || reviewProjects + ? Option.getOrUndefined(decodeEnvironmentId(hash.slice(hash.indexOf(":") + 1))) + : undefined; const primaryEnvironmentId = usePrimaryEnvironmentId(); const { environments, isReady } = useEnvironments(); - // Trust the id only once the catalog has it; an unknown computer falls back to this one. + // Trust the id only once the catalog has it. const waitingForCatalog = !isReady && (resumeEnvironmentId !== undefined || primaryEnvironmentId === null); const resumeKnown = resumeEnvironmentId !== undefined && environments.some((environment) => environment.environmentId === resumeEnvironmentId); - const environmentId = (resumeKnown ? resumeEnvironmentId : undefined) ?? primaryEnvironmentId; + // An import shortcut must never silently switch to a different computer. + const environmentId = + (resumeKnown ? resumeEnvironmentId : undefined) ?? + (reviewProjects ? null : primaryEnvironmentId); // The root can remount this pending outlet after navigation; do not reopen setup. const isWelcomeRoute = useLocation({ select: (location) => location.pathname === "/welcome" }); const [dismissed, setDismissed] = useState(false); @@ -47,6 +52,7 @@ function WelcomeRouteView() { { setDismissed(true); if (projectRef !== undefined) { diff --git a/docs/user/welcome-page.md b/docs/user/welcome-page.md index ed8e75c28c74c..6b3d11b324539 100644 --- a/docs/user/welcome-page.md +++ b/docs/user/welcome-page.md @@ -8,6 +8,10 @@ and the phone app. Only an agent is needed to start chatting. To see the page again, go to **Settings → About → Welcome page** and select **Open**. Direct links, such as Settings, open normally before setup is done. +To import more projects and conversations, open **Settings → Projects → Import projects +and their threads**. The shortcut shows the computer whose history will be scanned and opens +the full project list for review. Select another environment in Settings to import from it. + The hosted app at app.t3.codes does not open the page. With no computer connected, it asks you to sign in to T3 Connect, then to install T3 Code and run `t3 connect` on your computer. From home, it adds compatible computers linked to your account and