Skip to content

Commit 4f0b74e

Browse files
t3dotggclaude
andauthored
feat(web): first run is one Welcome page instead of a 3-step wizard (pingdotgg#33209)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 965ddc1 commit 4f0b74e

29 files changed

Lines changed: 3493 additions & 2648 deletions

‎apps/marketing/vercel.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,23 @@ export const config: VercelConfig = {
3232
destination: "https://app.t3.codes",
3333
permanent: true,
3434
},
35+
// One QR code in the desktop app serves both stores. iPadOS reports a Mac, so it gets /download.
36+
{
37+
source: "/mobile",
38+
has: [{ type: "header", key: "user-agent", value: ".*(iPhone|iPad|iPod).*" }],
39+
destination: "https://apps.apple.com/us/app/t3-code-remote-claude-more/id6787819824",
40+
permanent: false,
41+
},
42+
{
43+
source: "/mobile",
44+
has: [{ type: "header", key: "user-agent", value: ".*Android.*" }],
45+
destination: "https://play.google.com/store/apps/details?id=com.t3tools.t3code",
46+
permanent: false,
47+
},
48+
{
49+
source: "/mobile",
50+
destination: "/download",
51+
permanent: false,
52+
},
3553
],
3654
};

‎apps/web/src/branding.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ export const APP_DISPLAY_NAME =
2626
formatAppDisplayName({ baseName: APP_BASE_NAME, stageLabel: APP_STAGE_LABEL });
2727
export const APP_VERSION = import.meta.env.APP_VERSION || "0.0.0";
2828
export const DESKTOP_DOWNLOAD_URL = "https://t3.codes/download";
29+
// Redirects to the App Store or Google Play to match the phone that opens it.
30+
export const MOBILE_APP_URL = "https://t3.codes/mobile";

‎apps/web/src/components/AppSidebarLayout.tsx‎

Lines changed: 57 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ function registerAppShellCommands(router: AnyRouter, shellElement: Element): ()
312312
};
313313
}
314314

315-
function SidebarControl() {
315+
function SidebarControl({ showSidebar }: { readonly showSidebar: boolean }) {
316316
const router = useRouter();
317317
const usagePageOpen = useLocation({ select: (location) => location.pathname === "/usage" });
318318
const keybindings = useAtomValue(primaryServerKeybindingsAtom);
@@ -326,6 +326,8 @@ function SidebarControl() {
326326

327327
// oxlint-disable-next-line t3code/no-unreasoned-state-sync -- window keydown listener that toggles the sidebar on its shortcut
328328
useEffect(() => {
329+
// A hidden sidebar would still save the toggle, so the shortcut does nothing without one.
330+
if (!showSidebar) return;
329331
const onKeyDown = (event: KeyboardEvent) => {
330332
if (event.defaultPrevented) return;
331333
if (
@@ -362,7 +364,7 @@ function SidebarControl() {
362364
window.removeEventListener("keydown", onKeyDown, true);
363365
unsubscribe?.();
364366
};
365-
}, [keybindings, toggleSidebar, usagePageOpen]);
367+
}, [keybindings, showSidebar, toggleSidebar, usagePageOpen]);
366368

367369
// The control lives as long as the shell, so it carries the shell's commands. Created
368370
// once so re-renders never re-register them.
@@ -380,28 +382,36 @@ function SidebarControl() {
380382
)}
381383
data-sidebar-control=""
382384
>
383-
<Tooltip>
384-
<TooltipTrigger
385-
render={
386-
<SidebarTrigger
387-
variant={isSidebarVisible && stageBackdropVariant ? "media-navigation" : "ghost"}
388-
className={cn(
389-
"pointer-events-auto",
390-
isSidebarVisible && stageBackdropVariant && "relative top-auto translate-y-0",
391-
)}
392-
aria-label="Toggle main sidebar"
393-
/>
394-
}
395-
/>
396-
<TooltipPopup side="bottom">
397-
Toggle main sidebar{shortcutLabel ? ` (${shortcutLabel})` : ""}
398-
</TooltipPopup>
399-
</Tooltip>
385+
{showSidebar ? (
386+
<Tooltip>
387+
<TooltipTrigger
388+
render={
389+
<SidebarTrigger
390+
variant={isSidebarVisible && stageBackdropVariant ? "media-navigation" : "ghost"}
391+
className={cn(
392+
"pointer-events-auto",
393+
isSidebarVisible && stageBackdropVariant && "relative top-auto translate-y-0",
394+
)}
395+
aria-label="Toggle main sidebar"
396+
/>
397+
}
398+
/>
399+
<TooltipPopup side="bottom">
400+
Toggle main sidebar{shortcutLabel ? ` (${shortcutLabel})` : ""}
401+
</TooltipPopup>
402+
</Tooltip>
403+
) : null}
400404
</div>
401405
);
402406
}
403407

404-
export function AppSidebarLayout({ children }: { children: ReactNode }) {
408+
export function AppSidebarLayout({
409+
children,
410+
showSidebar = true,
411+
}: {
412+
children: ReactNode;
413+
showSidebar?: boolean;
414+
}) {
405415
const sidebarArea = workspaceAreaProps("sidebar", 0, "Threads");
406416
const [sidebarRouteReveal] = useState<SidebarRouteReveal>(() => ({
407417
observedKey: null,
@@ -450,31 +460,35 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
450460
storageKey="chat_thread_sidebar_open"
451461
style={sidebarProviderStyle}
452462
>
453-
<SidebarBrandWidthProbe isElectron={isElectron} onWidthChange={setBrandWidth} />
454-
<Sidebar
455-
side="left"
456-
collapsible="offcanvas"
457-
data-app-sidebar=""
458-
{...sidebarArea}
459-
role="navigation"
460-
aria-label="Threads"
461-
resizable={{
462-
maxWidth: sidebarMaximumWidth,
463-
minWidth: sidebarMinimumWidth,
464-
shouldAcceptWidth: ({ currentWidth, nextWidth, wrapper }) =>
465-
nextWidth <= currentWidth ||
466-
wrapper.clientWidth - nextWidth >= THREAD_MAIN_CONTENT_MIN_WIDTH,
467-
storageKey: THREAD_SIDEBAR_WIDTH_STORAGE_KEY,
468-
onResize: setSidebarWidth,
469-
}}
470-
style={windowControlsInsetStyle}
471-
>
472-
<ThreadSidebar routeReveal={sidebarRouteReveal} />
473-
<SidebarRail onDoubleClick={resetSidebarWidth} />
474-
</Sidebar>
463+
{showSidebar ? (
464+
<>
465+
<SidebarBrandWidthProbe isElectron={isElectron} onWidthChange={setBrandWidth} />
466+
<Sidebar
467+
side="left"
468+
collapsible="offcanvas"
469+
data-app-sidebar=""
470+
{...sidebarArea}
471+
role="navigation"
472+
aria-label="Threads"
473+
resizable={{
474+
maxWidth: sidebarMaximumWidth,
475+
minWidth: sidebarMinimumWidth,
476+
shouldAcceptWidth: ({ currentWidth, nextWidth, wrapper }) =>
477+
nextWidth <= currentWidth ||
478+
wrapper.clientWidth - nextWidth >= THREAD_MAIN_CONTENT_MIN_WIDTH,
479+
storageKey: THREAD_SIDEBAR_WIDTH_STORAGE_KEY,
480+
onResize: setSidebarWidth,
481+
}}
482+
style={windowControlsInsetStyle}
483+
>
484+
<ThreadSidebar routeReveal={sidebarRouteReveal} />
485+
<SidebarRail onDoubleClick={resetSidebarWidth} />
486+
</Sidebar>
487+
</>
488+
) : null}
475489
{children}
476490
<BackgroundThreadAnnouncer />
477-
<SidebarControl />
491+
<SidebarControl showSidebar={showSidebar} />
478492
{isElectron ? <HistorySwipeNavigation /> : null}
479493
</SidebarProvider>
480494
</PanelAnimationSuppressionProvider>

0 commit comments

Comments
 (0)