Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.
Python agent-orchestrationaiai-agentschatopsdiscordlangchainmcpmicrosoft-teamsmulti-agentopen-sourceopenaiself-hostedslack
fix(switchdash): let the remote-host pages scroll (CHOO-1809)
Louis Amaudruze8f20ca64dc8
diff --git a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/views/remote-host-view.tsx b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/views/remote-host-view.tsxindex a0f89d4d7..a550c769e 100644--- a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/views/remote-host-view.tsx+++ b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/views/remote-host-view.tsx@@ -115,157 +115,165 @@ export const RemoteHostMainPanel = observer(function RemoteHostMainPanel() {return row ? { kind: 'agent-type', row } : null;}, [sheetTarget, prerequisites, agentTypes]);+ // The workspace gives every main panel a fixed, `overflow-hidden` box, so a+ // view that does not scroll itself simply clips. This page grows without+ // bound — the gh device-flow terminal alone is tall enough to push the agent+ // types past the bottom of the window with no way to reach them.return (- <div className="space-y-6 px-8 pb-10">- <PageHeader- sticky- title={host?.name ?? sshHost}- description={`Remote host · ${sshHost}. Auth uses your SSH agent — switchdash stores no credentials.`}- >- <div className="flex items-center gap-2">- {!blocked && (- <span className="flex items-center gap-2">- <StatusBadge tone={status.tone}>{status.label}</StatusBadge>- {status.readinessKnown && status.total > 0 && (- <span className="text-xs text-foreground-muted">- {status.done} of {status.total} prerequisites- </span>- )}- </span>- )}- <Button size="sm" variant="ghost" onClick={() => navigate('remoteHosts')}>- <ArrowLeft className="size-4" /> All hosts- </Button>- {!blocked && (- <Button- size="sm"- variant="outline"- disabled={busy}- onClick={() => recheck.mutate()}- aria-label="Re-check this host"- >- <RefreshCw className={`size-3.5 ${recheck.isPending ? 'animate-spin' : ''}`} />- Re-check+ <div className="relative z-10 flex min-h-0 flex-1 flex-col overflow-auto bg-background">+ <div className="space-y-6 px-8 pb-10">+ <PageHeader+ sticky+ title={host?.name ?? sshHost}+ description={`Remote host · ${sshHost}. Auth uses your SSH agent — switchdash stores no credentials.`}+ >+ <div className="flex items-center gap-2">+ {!blocked && (+ <span className="flex items-center gap-2">+ <StatusBadge tone={status.tone}>{status.label}</StatusBadge>+ {status.readinessKnown && status.total > 0 && (+ <span className="text-xs text-foreground-muted">+ {status.done} of {status.total} prerequisites+ </span>+ )}+ </span>+ )}+ <Button size="sm" variant="ghost" onClick={() => navigate('remoteHosts')}>+ <ArrowLeft className="size-4" /> All hosts</Button>- )}- </div>- </PageHeader>+ {!blocked && (+ <Button+ size="sm"+ variant="outline"+ disabled={busy}+ onClick={() => recheck.mutate()}+ aria-label="Re-check this host"+ >+ <RefreshCw className={`size-3.5 ${recheck.isPending ? 'animate-spin' : ''}`} />+ Re-check+ </Button>+ )}+ </div>+ </PageHeader>- {blocked ? (- <HostUnreachablePanel reachability={reachability} />- ) : (- <>- {/*+ {blocked ? (+ <HostUnreachablePanel reachability={reachability} />+ ) : (+ <>+ {/*An operation that stops because the host went away is reported asexactly that, rather than being blamed on whichever step it touched.*/}- {installStep.isError && (- <p className="text-destructive text-xs">- Could not install: {(installStep.error as Error).message}- </p>- )}- {recheck.isError && (- <p className="text-destructive text-xs">- Could not check this host: {(recheck.error as Error).message}- </p>- )}- {prepare.isError && (- <p className="text-destructive text-xs">- Could not work out what this host needs: {(prepare.error as Error).message}- </p>- )}+ {installStep.isError && (+ <p className="text-destructive text-xs">+ Could not install: {(installStep.error as Error).message}+ </p>+ )}+ {recheck.isError && (+ <p className="text-destructive text-xs">+ Could not check this host: {(recheck.error as Error).message}+ </p>+ )}+ {prepare.isError && (+ <p className="text-destructive text-xs">+ Could not work out what this host needs: {(prepare.error as Error).message}+ </p>+ )}- {plan.isLoading ? (- <div className="flex items-center gap-2 text-sm text-foreground-muted">- <Spinner /> Loading…- </div>- ) : prerequisites.length === 0 && agentTypes.length === 0 ? (- <p className="text-sm text-foreground-muted">- Nothing known about this host yet. Re-check to see what it has.- </p>- ) : (- <div className="flex flex-col">- {prerequisites.length > 0 && (- <section>- <SectionLabel count={prerequisites.length}>Prerequisites</SectionLabel>- {prerequisites.map((step) => (- <div key={step.id} className="w-full py-0.5">- <PrerequisiteRow- step={step}- plan={plan.data ?? null}- isCurrent={step.id === currentStepId}- installing={installingStepId === step.id}- activity={activityFor(step.id)}- authenticating={authenticatingGh && step.kind === 'gh-auth'}- onInstall={() => installStep.mutate(step.id)}- onAuthenticate={() => setAuthenticatingGh(true)}- onOpen={() => setSheetTarget({ kind: 'prerequisite', step })}- />- {/*+ {plan.isLoading ? (+ <div className="flex items-center gap-2 text-sm text-foreground-muted">+ <Spinner /> Loading…+ </div>+ ) : prerequisites.length === 0 && agentTypes.length === 0 ? (+ <p className="text-sm text-foreground-muted">+ Nothing known about this host yet. Re-check to see what it has.+ </p>+ ) : (+ <div className="flex flex-col">+ {prerequisites.length > 0 && (+ <section>+ <SectionLabel count={prerequisites.length}>Prerequisites</SectionLabel>+ {prerequisites.map((step) => (+ <div key={step.id} className="w-full py-0.5">+ <PrerequisiteRow+ step={step}+ plan={plan.data ?? null}+ isCurrent={step.id === currentStepId}+ installing={installingStepId === step.id}+ activity={activityFor(step.id)}+ authenticating={authenticatingGh && step.kind === 'gh-auth'}+ onInstall={() => installStep.mutate(step.id)}+ onAuthenticate={() => setAuthenticatingGh(true)}+ onOpen={() => setSheetTarget({ kind: 'prerequisite', step })}+ />+ {/*Opens against the row it belongs to rather than at thefoot of the page: the terminal is the continuation ofthat one row's Sign in, and appending it beloweverything else meant scrolling away from the thing youjust clicked to find it.*/}- {authenticatingGh && step.kind === 'gh-auth' && (- <div className="px-3 pt-2 pb-1">- <GhAuthPanel- sshHost={sshHost}- onDone={() => {- setAuthenticatingGh(false);- recheck.mutate();- }}- />- </div>- )}- </div>- ))}- </section>- )}+ {authenticatingGh && step.kind === 'gh-auth' && (+ <div className="px-3 pt-2 pb-1">+ <GhAuthPanel+ sshHost={sshHost}+ onDone={() => {+ setAuthenticatingGh(false);+ recheck.mutate();+ }}+ />+ </div>+ )}+ </div>+ ))}+ </section>+ )}- {agentTypes.length > 0 && (- <section className="pt-2">- <SectionLabel count={agentTypes.length}>Agent types</SectionLabel>- {agentTypes.map((row) => (- <div key={row.agentId} className="w-full py-0.5">- <AgentTypeRowItem- row={row}- isCurrent={row.cli.id === currentStepId || row.plugin?.id === currentStepId}- installingStepId={installingStepId}- activityFor={activityFor}- onInstall={(stepId) => installStep.mutate(stepId)}- onOpen={() => setSheetTarget({ kind: 'agent-type', row })}- />- </div>- ))}- </section>- )}- </div>- )}+ {agentTypes.length > 0 && (+ <section className="pt-2">+ <SectionLabel count={agentTypes.length}>Agent types</SectionLabel>+ {agentTypes.map((row) => (+ <div key={row.agentId} className="w-full py-0.5">+ <AgentTypeRowItem+ row={row}+ isCurrent={+ row.cli.id === currentStepId || row.plugin?.id === currentStepId+ }+ installingStepId={installingStepId}+ activityFor={activityFor}+ onInstall={(stepId) => installStep.mutate(stepId)}+ onOpen={() => setSheetTarget({ kind: 'agent-type', row })}+ />+ </div>+ ))}+ </section>+ )}+ </div>+ )}- <SetupDetailSheet- target={liveTarget}- sshHost={sshHost}- plan={plan.data ?? null}- icon={- liveTarget?.kind === 'prerequisite' ? (- <PrerequisiteIcon step={liveTarget.step} size={24} />- ) : null- }- activityFor={activityFor}- onClose={() => setSheetTarget(null)}- onInstall={(stepId) => installStep.mutate(stepId)}- installingStepId={installingStepId}- onSkip={(stepId) => skip.mutate(stepId)}- skippingStepId={skip.isPending ? (skip.variables ?? null) : null}- onAuthenticate={() => {- setSheetTarget(null);- setAuthenticatingGh(true);- }}- />- </>- )}+ <SetupDetailSheet+ target={liveTarget}+ sshHost={sshHost}+ plan={plan.data ?? null}+ icon={+ liveTarget?.kind === 'prerequisite' ? (+ <PrerequisiteIcon step={liveTarget.step} size={24} />+ ) : null+ }+ activityFor={activityFor}+ onClose={() => setSheetTarget(null)}+ onInstall={(stepId) => installStep.mutate(stepId)}+ installingStepId={installingStepId}+ onSkip={(stepId) => skip.mutate(stepId)}+ skippingStepId={skip.isPending ? (skip.variables ?? null) : null}+ onAuthenticate={() => {+ setSheetTarget(null);+ setAuthenticatingGh(true);+ }}+ />+ </>+ )}+ </div></div>);});diff --git a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/views/remote-hosts-view.tsx b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/views/remote-hosts-view.tsxindex cdb1ad98c..937719eb6 100644--- a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/views/remote-hosts-view.tsx+++ b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/views/remote-hosts-view.tsx@@ -152,85 +152,90 @@ export const RemoteHostsMainPanel = observer(function RemoteHostsMainPanel() {</div>));+ // Same reason as the host page: the workspace's main panel is a fixed+ // `overflow-hidden` box, so the list has to own its own scrolling or it clips+ // once there are more hosts than fit.return (- <div className="space-y-4 px-8 pb-10">- <PageHeader- sticky- title="Remote hosts"- description="SSH hosts that can run agents. Each host has its own page for setup and for the agent types installed on it."- >- <div className="flex items-center justify-between gap-2">- <ToggleGroup- multiple={false}- value={[filter]}- onValueChange={([value]) => {- if (value) setFilter(value as HostFilter);- }}- >- <ToggleGroupItem value="all">All</ToggleGroupItem>- <ToggleGroupItem value="ready">Ready</ToggleGroupItem>- <ToggleGroupItem value="attention">Needs setup</ToggleGroupItem>- </ToggleGroup>- <Button- size="sm"- variant="outline"- onClick={() =>- void showAddHost({- onboarded: sshHosts,- onAdded: (sshHost) => {- invalidate();- openHost(sshHost);- },- })- }- >- <Plus className="size-4" /> Add host- </Button>- </div>- </PageHeader>-- {isLoading ? (- <div className="flex items-center gap-2 text-sm text-foreground-muted">- <Spinner /> Loading hosts…- </div>- ) : list.length === 0 ? (- <p className="text-sm text-foreground-muted">- No remote hosts yet. Add one above to get started.- </p>- ) : filter === 'ready' ? (- ready.length > 0 ? (- <div>- <SectionLabel count={ready.length}>Ready</SectionLabel>- {renderRows(ready)}+ <div className="relative z-10 flex min-h-0 flex-1 flex-col overflow-auto bg-background">+ <div className="space-y-4 px-8 pb-10">+ <PageHeader+ sticky+ title="Remote hosts"+ description="SSH hosts that can run agents. Each host has its own page for setup and for the agent types installed on it."+ >+ <div className="flex items-center justify-between gap-2">+ <ToggleGroup+ multiple={false}+ value={[filter]}+ onValueChange={([value]) => {+ if (value) setFilter(value as HostFilter);+ }}+ >+ <ToggleGroupItem value="all">All</ToggleGroupItem>+ <ToggleGroupItem value="ready">Ready</ToggleGroupItem>+ <ToggleGroupItem value="attention">Needs setup</ToggleGroupItem>+ </ToggleGroup>+ <Button+ size="sm"+ variant="outline"+ onClick={() =>+ void showAddHost({+ onboarded: sshHosts,+ onAdded: (sshHost) => {+ invalidate();+ openHost(sshHost);+ },+ })+ }+ >+ <Plus className="size-4" /> Add host+ </Button></div>- ) : (- <p className="text-sm text-foreground-muted">No host is ready yet.</p>- )- ) : filter === 'attention' ? (- attention.length > 0 ? (- <div>- <SectionLabel count={attention.length}>Needs setup</SectionLabel>- {renderRows(attention)}+ </PageHeader>++ {isLoading ? (+ <div className="flex items-center gap-2 text-sm text-foreground-muted">+ <Spinner /> Loading hosts…</div>- ) : (- <p className="text-sm text-foreground-muted">Every host is ready.</p>- )- ) : (- <div className="flex flex-col">- {attention.length > 0 && (- <section>- <SectionLabel count={attention.length}>Needs setup</SectionLabel>- {renderRows(attention)}- </section>- )}- {ready.length > 0 && (- <section className="pt-2">+ ) : list.length === 0 ? (+ <p className="text-sm text-foreground-muted">+ No remote hosts yet. Add one above to get started.+ </p>+ ) : filter === 'ready' ? (+ ready.length > 0 ? (+ <div><SectionLabel count={ready.length}>Ready</SectionLabel>{renderRows(ready)}- </section>- )}- </div>- )}+ </div>+ ) : (+ <p className="text-sm text-foreground-muted">No host is ready yet.</p>+ )+ ) : filter === 'attention' ? (+ attention.length > 0 ? (+ <div>+ <SectionLabel count={attention.length}>Needs setup</SectionLabel>+ {renderRows(attention)}+ </div>+ ) : (+ <p className="text-sm text-foreground-muted">Every host is ready.</p>+ )+ ) : (+ <div className="flex flex-col">+ {attention.length > 0 && (+ <section>+ <SectionLabel count={attention.length}>Needs setup</SectionLabel>+ {renderRows(attention)}+ </section>+ )}+ {ready.length > 0 && (+ <section className="pt-2">+ <SectionLabel count={ready.length}>Ready</SectionLabel>+ {renderRows(ready)}+ </section>+ )}+ </div>+ )}+ </div></div>);});