chore(desktop): keep status bar within size budget

Problem:
The compact SSH status change pushed StatusBar.tsx beyond its existing repolint file-size budget.

Root cause:
Equivalent status label and icon expressions were expanded across several lines in an already baselined file.

Fix:
Keep the same state-dependent rendering while expressing the small conditions compactly, without widening the repository baseline.

Verification:
- go run ./tools/repolint
- pnpm exec tsx src/__tests__/statusbar-workspace.test.tsx
- pnpm typecheck
- pnpm exec eslint src/components/StatusBar.tsx
This commit is contained in:
SivanCola committed 2026-08-10 00:44:13 +08:00
1 parent 20326ae01b
commit ecddf4802f
1 file changed
+3 -11
+3 -11
View File
@@ -674,14 +674,8 @@ function RemoteStatusBarChip({
const triggerState = isRemoteTerminalFailure(worst) ? "error" : worst.state;
const triggerStatus = isRemoteTerminalFailure(worst) ? t("remote.status.failed") : t(`remote.status.${worst.state}`);
const idleDisconnected = worst.state === "stopped" && !worst.error;
const triggerLabel = idleDisconnected
? t("remote.statusBar.disconnected")
: t("remote.statusBar.summary", { host: worstHost.label, status: triggerStatus });
const triggerText = idleDisconnected
? "SSH"
: triggerState === "connected"
? worstHost.label
: triggerLabel;
const triggerLabel = idleDisconnected ? t("remote.statusBar.disconnected") : t("remote.statusBar.summary", { host: worstHost.label, status: triggerStatus });
const triggerText = idleDisconnected ? "SSH" : triggerState === "connected" ? worstHost.label : triggerLabel;
return (
<span className="statusbar__remote-wrap">
@@ -695,9 +689,7 @@ function RemoteStatusBarChip({
aria-expanded={open}
title={triggerLabel}
>
{triggerState === "connected"
? <span className="statusbar__remote-state-dot" aria-hidden="true" />
: <Server size={11} aria-hidden="true" />}
{triggerState === "connected" ? <span className="statusbar__remote-state-dot" aria-hidden="true" /> : <Server size={11} aria-hidden="true" />}
<span className="statusbar__remote-label">{triggerText}</span>
</button>
<AnchoredPopover