perf(sidebar): skip Hidden projects host labels while collapsed (#41788)

This commit is contained in:
Neil
2026-11-12 20:17:55 -08:00
committed by GitHub
parent 955186a43c
commit f3c8ef86b8
@@ -36,8 +36,10 @@ const HiddenProjectsSection = React.memo(function HiddenProjectsSection() {
const [expanded, setExpanded] = useState(false)
const [pendingKeys, setPendingKeys] = useState<ReadonlySet<string>>(new Set())
// Name hosts only when one is not this computer; a local-only list needs no host column.
// Why: this selector reruns on every store write; skip it while the list is collapsed.
const hostLabels = useAppStore(
useShallow((state) =>
expanded &&
hiddenRepos.some((repo) => getRepoExecutionHostId(repo) !== LOCAL_EXECUTION_HOST_ID)
? hiddenRepos.map((repo) =>
selectExecutionHostDisplayLabel(state, getRepoExecutionHostId(repo))