fix(cloud): status popover footer never clips: Move to this computer on its own row, actions wrap (DS-l); test the card's host row (JA-13)

This commit is contained in:
Neil
2026-11-10 21:01:52 -08:00
parent 27baa26cc6
commit c2bcbf8529
2 changed files with 113 additions and 12 deletions
@@ -325,6 +325,20 @@ export function CloudWorkspaceStatusPanel({
</>
) : null}
{showFooter && actions.onMoveToComputer && canArchive && !restarting ? (
// Its own row (DS-l): beside Sleep, Archive and Restart it pushed them out of the popover.
<div className="-mb-1 flex">
<Button
size="xs"
variant="ghost"
className="-ml-2 text-muted-foreground"
{...busyProps(false, anyBusy, actions.onMoveToComputer)}
>
<Monitor />
{t('orcaCloudWorkspace.moveToComputer', 'Move to this computer')}
</Button>
</div>
) : null}
{showFooter ? (
<div className="flex min-h-6 items-center justify-between gap-2 whitespace-nowrap">
{/* Not a live region: a ticking "ago" would announce itself every few seconds. */}
@@ -335,18 +349,8 @@ export function CloudWorkspaceStatusPanel({
})
: null}
</span>
<div className="flex shrink-0 items-center gap-1">
{actions.onMoveToComputer && canArchive && !restarting ? (
<Button
size="xs"
variant="ghost"
className="text-muted-foreground"
{...busyProps(false, anyBusy, actions.onMoveToComputer)}
>
<Monitor />
{t('orcaCloudWorkspace.moveToComputer', 'Move to this computer')}
</Button>
) : null}
{/* Wraps rather than clips: every action stays reachable at any panel width (DS-l). */}
<div className="flex min-w-0 flex-wrap items-center justify-end gap-1">
{actions.onSleep && state === 'running' && !restarting ? (
<Button
size="xs"
@@ -0,0 +1,97 @@
import { describe, expect, it } from 'vitest'
import { renderToStaticMarkup } from 'react-dom/server'
import { CARD_PRIMITIVES } from './card-primitives'
import { cardElement, compileCardTemplate } from './card-template-compiler'
import { DEFAULT_WORKSPACE_CARD_TEMPLATE } from './default-workspace-card'
// The default card's own vars, read through a probe that prints the two JA-13 decisions.
const probe = compileCardTemplate(
{
...DEFAULT_WORKSPACE_CARD_TEMPLATE,
defs: undefined,
root: {
el: 'Probe',
props: { host: '=vars.hostLabel', identity: '=vars.identityInMeta' }
}
},
{
...CARD_PRIMITIVES,
Probe: cardElement<null>(['host', 'identity'], (props) => (
<i>{`${String(props.host)}|${String(props.identity)}`}</i>
))
}
)
function facts(host: { kind: string; contextLabel: string | null }, title: string) {
return {
ws: {
id: 'w',
name: title,
title,
kind: 'git',
path: '/p',
branch: 'ja-hello',
identity: 'ja-hello',
isMain: false,
isSparse: false,
detachedHead: false,
comment: ''
},
repo: { id: 'r', name: 'Hello-World', ssh: false },
host: { ...host, runtimeDisconnected: false },
git: { conflictOperation: null, remoteBranchConflict: null, cacheTimerActive: false },
review: null,
links: { count: 0, issue: false, linearIssue: false, jiraIssue: false },
provenance: { automation: false, cli: false },
ports: { count: 0 },
lineage: { childCount: 0, collapsed: false, toggleable: false },
place: {
isActive: false,
inPinnedSection: false,
hideRepoBadge: false,
showProjectName: false,
affiliateList: false,
deleteQuickAction: false
},
options: {
style: 'new',
show: {
host: true,
branch: true,
status: true,
ports: true,
issue: true,
linearIssue: true,
jiraIssue: true,
pr: true,
comment: true,
automation: true,
cli: true,
inlineAgents: false
},
agentRows: 'full'
},
env: { projectGroups: false }
}
}
const read = (f: ReturnType<typeof facts>): string =>
renderToStaticMarkup(<>{probe.render(f, null).content}</>)
describe('default workspace card host row (JA-13)', () => {
it('names the host only on the exception: Orca Cloud yes, this computer no', () => {
expect(read(facts({ kind: 'runtime', contextLabel: 'Orca Cloud' }, 'x'))).toContain(
'Orca Cloud|'
)
expect(read(facts({ kind: 'local', contextLabel: 'Local Mac' }, 'x'))).toContain('null|')
})
it('does not repeat the name as the branch line', () => {
expect(read(facts({ kind: 'runtime', contextLabel: 'Orca Cloud' }, 'ja-hello'))).toContain(
'|false'
)
expect(read(facts({ kind: 'runtime', contextLabel: 'Orca Cloud' }, 'Fix login'))).toContain(
'|true'
)
})
})