@devries-cameron20 / t3code Mirror · read-only / commits / ff9eb8bd0c
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 18:00 UTC

feat(web): projectless threads show their machine in the sidebar (#17022)

oliver committed Oct 7, 2026 at 23:04 UTC ff9eb8bd0c8e71f98969a58d5789889e07b57c8b
1 file changed +30 -1
apps/web/src/components/Sidebar.tsx
+30 -1
@@ -169,6 +169,7 @@ import {
169 } from "../threadRoutes";
170 import { formatRelativeTimeLabel, parseTimestampDate } from "../timestampFormat";
171 import type { SidebarThreadSummary } from "../types";
172 +import { isScratchProject } from "@t3tools/client-runtime/state/projects";
173 import type { EnvironmentProject } from "@t3tools/client-runtime/state/shell";
174 import { cn } from "~/lib/utils";
175 import { EnvironmentMachineIcon } from "./EnvironmentMachineIcon";
@@ -1141,6 +1142,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
1142 currentEnvironmentId: string | null;
1143 environmentLabel: string | null;
1144 environmentMachine: EnvironmentMachineKind;
1145 + scratchMachineLabel: string | null;
1146 project: EnvironmentProject | null;
1147 projectDisplayName: string | null;
1148 providerEntryByInstanceId: ReadonlyMap<string, ProviderInstanceEntry>;
@@ -1370,6 +1372,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
1372 // that is every thread, which is the point: the glyph is what tells rows on
1373 // different machines apart.
1374 const isRemote = thread.environmentId !== props.currentEnvironmentId;
1375 + const showsScratchMachine = !thread.branch && props.scratchMachineLabel !== null;
1376
1377 const detailsTooltip = (
1378 <SidebarThreadTooltip
@@ -2164,6 +2167,17 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
2167 <MiddleTruncate value={thread.branch} showTitle={false} />
2168 </span>
2169 </>
2170 + ) : showsScratchMachine ? (
2171 + <>
2172 + <EnvironmentMachineIcon
2173 + aria-hidden
2174 + kind={props.environmentMachine}
2175 + className="size-3 shrink-0 text-muted-foreground/40"
2176 + />
2177 + <span className="min-w-0 flex-1 truncate text-muted-foreground/40">
2178 + {props.scratchMachineLabel}
2179 + </span>
2180 + </>
2181 ) : (
2182 <span className="flex-1" />
2183 )}
@@ -2179,7 +2193,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
2193 aria-hidden
2194 className="pointer-events-none ml-auto inline-flex shrink-0 items-center gap-1"
2195 >
2182 - {isRemote ? (
2196 + {isRemote && !showsScratchMachine ? (
2197 <span className="inline-flex shrink-0 items-center text-sidebar-muted-foreground/70">
2198 <EnvironmentMachineIcon
2199 aria-hidden
@@ -2595,6 +2609,20 @@ export default function Sidebar() {
2609 () => projectGroupsSpanEnvironments(projectGroups),
2610 [projectGroups],
2611 );
2612 + const scratchMachineLabelFor = useCallback(
2613 + (thread: Pick<SidebarThreadSummary, "environmentId" | "projectId">) => {
2614 + if (!showProjectEnvironments) return null;
2615 + const project = projectByKey.get(`${thread.environmentId}:${thread.projectId}`);
2616 + if (
2617 + !project ||
2618 + !isScratchProject(project, serverConfigs.get(thread.environmentId)?.scratchWorkspaceRoot)
2619 + ) {
2620 + return null;
2621 + }
2622 + return environmentLabelById.get(thread.environmentId) ?? null;
2623 + },
2624 + [environmentLabelById, projectByKey, serverConfigs, showProjectEnvironments],
2625 + );
2626 const projectGroupByScopeKey = useMemo(
2627 () => new Map(projectGroups.map((project) => [project.projectKey, project] as const)),
2628 [projectGroups],
@@ -5299,6 +5327,7 @@ export default function Sidebar() {
5327 environmentMachine={
5328 environmentMachineById.get(thread.environmentId) ?? "server"
5329 }
5330 + scratchMachineLabel={scratchMachineLabelFor(thread)}
5331 project={
5332 projectByKey.get(`${thread.environmentId}:${thread.projectId}`) ??
5333 null