diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css index 513cacd7229..002681f6dbf 100644 --- a/src/renderer/src/assets/main.css +++ b/src/renderer/src/assets/main.css @@ -152,6 +152,17 @@ --color-jira-priority-low: var(--jira-priority-low); --color-status-warning-background: var(--status-warning-background); --color-status-warning-border: var(--status-warning-border); + /* GA-P3t: strips, banners and notices by severity (fill, 1px border, icon, body text). */ + --color-banner-warning-fill: var(--banner-warning-fill); + --color-banner-warning-border: var(--banner-warning-border); + --color-banner-warning-icon: var(--banner-warning-icon); + --color-banner-error-fill: var(--banner-error-fill); + --color-banner-error-border: var(--banner-error-border); + --color-banner-error-icon: var(--banner-error-icon); + --color-banner-info-fill: var(--banner-info-fill); + --color-banner-info-border: var(--banner-info-border); + --color-banner-info-icon: var(--banner-info-icon); + --color-banner-body: var(--banner-body); --color-callout-note: var(--callout-note); --color-callout-important: var(--callout-important); --color-workspace-status-done: var(--workspace-status-done); @@ -467,6 +478,18 @@ --jira-priority-low: var(--callout-note); --status-warning-background: color-mix(in srgb, var(--status-warning) 10%, transparent); --status-warning-border: color-mix(in srgb, var(--status-warning) 25%, transparent); + /* GA-P3t (Neil): banners must stand out on white panes. Border >=3:1 on the surface; icon >=3:1 + and text >=4.5:1 on the fill (measured on #fff and #fafafa). */ + --banner-warning-fill: color-mix(in srgb, #f59e0b 14%, var(--background)); + --banner-warning-border: #b45309; + --banner-warning-icon: #b45309; + --banner-error-fill: color-mix(in srgb, var(--destructive) 8%, var(--background)); + --banner-error-border: #c20012; + --banner-error-icon: #c20012; + --banner-info-fill: color-mix(in srgb, var(--foreground) 7.5%, var(--background)); + --banner-info-border: color-mix(in srgb, var(--foreground) 47%, var(--background)); + --banner-info-icon: color-mix(in srgb, var(--foreground) 65%, var(--background)); + --banner-body: color-mix(in srgb, var(--foreground) 70%, var(--background)); /* GitHub's own hues for the two callout kinds no status token covers. */ --callout-note: #0969da; --callout-important: #8250df; @@ -504,6 +527,17 @@ --jira-priority-low: var(--callout-note); --status-warning-background: color-mix(in srgb, var(--status-warning) 10%, transparent); --status-warning-border: color-mix(in srgb, var(--status-warning) 25%, transparent); + /* GA-P3t: dark keeps its fills and icons; borders raised to >=3:1 on #0a0a0a (error, info failed). */ + --banner-warning-fill: color-mix(in srgb, var(--status-warning) 10%, var(--card)); + --banner-warning-border: color-mix(in srgb, var(--status-warning) 45%, var(--card)); + --banner-warning-icon: var(--status-warning); + --banner-error-fill: color-mix(in srgb, var(--destructive) 10%, var(--card)); + --banner-error-border: color-mix(in srgb, var(--destructive) 62%, var(--card)); + --banner-error-icon: var(--destructive); + --banner-info-fill: var(--card); + --banner-info-border: color-mix(in srgb, var(--foreground) 36%, var(--card)); + --banner-info-icon: var(--muted-foreground); + --banner-body: var(--muted-foreground); --callout-note: #4493f8; --callout-important: #ab7df8; --git-decoration-added: #81b88b; diff --git a/src/renderer/src/components/agent-sign-in-strip/CloudAgentSignInStrip.tsx b/src/renderer/src/components/agent-sign-in-strip/CloudAgentSignInStrip.tsx index 13fb0dc77e3..6bd05240a37 100644 --- a/src/renderer/src/components/agent-sign-in-strip/CloudAgentSignInStrip.tsx +++ b/src/renderer/src/components/agent-sign-in-strip/CloudAgentSignInStrip.tsx @@ -24,6 +24,7 @@ import { } from '@/components/ui/dropdown-menu' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { cn } from '@/lib/utils' +import { BANNER_BODY_TEXT, BANNER_TONE, type BannerSeverity } from '@/components/ui/banner-tone' import { useReservePaneTopSpace } from '../terminal-pane/appearance/pane-top-banner/PaneTopWarningBanner' import type { CloudStripModel, @@ -97,27 +98,32 @@ export type CloudStripActions = { cancel: () => void } +/** GA-P3t: the strip's severity look; anything that isn't a warning or an error reads as info. */ +export function stripSeverity(status: CloudStripStatus): BannerSeverity { + return status === 'warning' ? 'warning' : status === 'error' ? 'error' : 'info' +} + function StatusSlot({ status }: { status: CloudStripStatus }): React.JSX.Element { const base = 'size-4 shrink-0' switch (status) { case 'need': - return + return // Not set up yet (or pasting the setup token): neutral, like the agent sheet; nothing is loading. case 'setup': - return + return case 'warning': - return + return case 'busy': return ( ) case 'error': - return + return case 'done': - return + return } } @@ -200,7 +206,11 @@ export function CloudAgentSignInStrip({ } }} className={cn( - 'grid gap-2.5 border-b border-border bg-card px-3 text-foreground outline-none', + // GA-P3t: a severity fill and a 1px bottom border that clear contrast on white panes and + // separate the strip from the terminal below it. + 'grid gap-2.5 border-b px-3 text-foreground outline-none', + BANNER_TONE[stripSeverity(model.status)].surface, + BANNER_TONE[stripSeverity(model.status)].border, wraps ? 'min-h-14 items-start py-2.5 [&>svg]:mt-0.5' : 'h-14 items-center', setupCode ? 'grid-cols-[16px_minmax(0,1fr)_auto]' : GRID[width] )} @@ -221,7 +231,8 @@ export function CloudAgentSignInStrip({ id={detailId} className={cn( lineFit, - 'text-xs leading-4 text-muted-foreground', + 'text-xs leading-4', + BANNER_BODY_TEXT, quietDetail && 'sr-only' )} > diff --git a/src/renderer/src/components/orca-cloud/CloudWorkspaceNotice.tsx b/src/renderer/src/components/orca-cloud/CloudWorkspaceNotice.tsx index 1ac33d3a00b..7f12d63c216 100644 --- a/src/renderer/src/components/orca-cloud/CloudWorkspaceNotice.tsx +++ b/src/renderer/src/components/orca-cloud/CloudWorkspaceNotice.tsx @@ -13,6 +13,8 @@ import { } from 'lucide-react' import { Button } from '@/components/ui/button' import { useTranslate } from '@/i18n/use-translate' +import { cn } from '@/lib/utils' +import { BANNER_BODY_TEXT, BANNER_TONE } from '@/components/ui/banner-tone' import type { CloudOomEvent } from '../../../../shared/hosted-sandbox/cloud-workspace-api' export type CloudNoticeKind = { kind: 'unresponsive' } | { kind: 'oom'; oom: CloudOomEvent } @@ -43,20 +45,26 @@ function CloudNoticeCard({ }): React.JSX.Element { const t = useTranslate() const titleId = useId() + // GA-P3t: trouble now reads as a warning; news from a background check as info. + const tone = BANNER_TONE[role === 'alert' ? 'warning' : 'info'] return (
-
{} +const ACTIONS = { + primary: noop, + submitCode: noop, + pasteCode: noop, + useCode: noop, + useApiKey: noop, + cancel: noop +} + +function stripModel(status: CloudStripStatus, title: string, detail: string): CloudStripModel { + return { + status, + title, + detail, + description: null, + primary: { + label: status === 'warning' ? 'Renew' : 'Set up once', + action: { kind: 'setUpOnce' } + }, + code: null, + paste: null, + otherWays: false, + announcement: title + } +} + +const STRIPS: [CloudStripStatus, string, string][] = [ + ['warning', 'Your Claude sign-in expired', 'Renew to keep working. Your conversation is kept.'], + ['setup', 'Claude isn’t set up for Orca Cloud', 'Set up once. Every cloud workspace uses it.'], + ['error', 'Couldn’t restart Claude', 'Try again. Your conversation is kept.'], + ['busy', 'Restarting…', 'Your files are kept, and Orca resumes your agents once it is back.'] +] + +function Variants(): React.JSX.Element { + return ( +
+ {STRIPS.map(([status, title, detail]) => ( +
+ +
+ ))} +
+ Show} + onDismiss={noop} + /> +
+
+ Open} + /> +
+
+ + +
+
+ + +
+
+
+ +
+
+ +
+
+
+ ) +} + +/** On the app background (#fff in light: the default and a white pane are the same surface). */ +export const onBackground = defineFixture({ + width: 900, + render: () => ( +
+ +
+ ) +}) + +/** On the lighter-grey surfaces (#fafafa: sidebar, cards); the worst case for fills. */ +export const onLightGrey = defineFixture({ + width: 900, + render: () => ( +
+ +
+ ) +}) diff --git a/src/renderer/src/components/ui/banner-tone.ts b/src/renderer/src/components/ui/banner-tone.ts new file mode 100644 index 00000000000..023a31d446e --- /dev/null +++ b/src/renderer/src/components/ui/banner-tone.ts @@ -0,0 +1,27 @@ +// GA-P3t (Neil): one look for strips, banners and notices by severity, so none blends into a white +// pane. The colours live in main.css (--banner-*), measured for contrast in light and dark. +export type BannerSeverity = 'warning' | 'error' | 'info' + +export const BANNER_TONE: Record< + BannerSeverity, + { surface: string; border: string; icon: string } +> = { + warning: { + surface: 'bg-banner-warning-fill', + border: 'border-banner-warning-border', + icon: 'text-banner-warning-icon' + }, + error: { + surface: 'bg-banner-error-fill', + border: 'border-banner-error-border', + icon: 'text-banner-error-icon' + }, + info: { + surface: 'bg-banner-info-fill', + border: 'border-banner-info-border', + icon: 'text-banner-info-icon' + } +} + +/** Body and detail text inside a banner: darker than muted, so it clears 4.5:1 on any fill. */ +export const BANNER_BODY_TEXT = 'text-banner-body'