Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): the sidebar no longer keeps old renders alive #19852

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/19852/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 3 changed files with 83 additions and 63 deletions.

x
0 of 3 viewed, 3 left
20 additions and 63 deletionsapps/web/src/components/Sidebar.tsxModified
View file
@@ -268,6 +268,7 @@
type ProviderInstanceEntry,
} from "../providerInstances";
import { useThreadRunningTerminalIds } from "../state/terminalSessions";
+import { useStableCallback } from "../hooks/useStableCallback";
import { stackedThreadToast, toastManager } from "./ui/toast";
import { Button, InlineButton } from "./ui/button";
import {
@@ -2628,20 +2629,19 @@
() => projectGroupsSpanEnvironments(projectGroups),
[projectGroups],
- const scratchMachineLabelFor = useCallback(
- (thread: Pick<SidebarThreadSummary, "environmentId" | "projectId">) => {
- if (!showProjectEnvironments) return null;
- const project = projectByKey.get(`${thread.environmentId}:${thread.projectId}`);
- if (
- !project ||
- !isScratchProject(project, serverConfigs.get(thread.environmentId)?.scratchWorkspaceRoot)
- ) {
- return null;
- }
- return environmentLabelById.get(thread.environmentId) ?? null;
- },
- [environmentLabelById, projectByKey, serverConfigs, showProjectEnvironments],
- );
+ const scratchMachineLabelFor = (
+ thread: Pick<SidebarThreadSummary, "environmentId" | "projectId">,
+ ) => {