From 5d3cdae41472b75375cc9992badafc0e33fb36de Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 11 Nov 2026 03:23:24 -0800 Subject: [PATCH] fix(cloud): JA-30 Home actions shrink to one row in a narrow centre column design-squad: at 900 wide with both side panels open, Add project / Create workspace stacked as two large buttons over the cloud list. The row is now LandingActions (landing-layout.tsx); over the cloud list its column is an @container and below 600px both buttons take small sizing on one row (wrapping only if they still can't fit). Fixtures: landing-layout actionsOverCloudList Wide/Narrow. --- src/renderer/src/components/Landing.tsx | 32 +++++--------- .../src/components/landing-layout.fixture.tsx | 27 ++++++++++++ .../src/components/landing-layout.tsx | 42 +++++++++++++++++++ 3 files changed, 79 insertions(+), 22 deletions(-) create mode 100644 src/renderer/src/components/landing-layout.fixture.tsx diff --git a/src/renderer/src/components/Landing.tsx b/src/renderer/src/components/Landing.tsx index c7b58538848..02fe5639671 100644 --- a/src/renderer/src/components/Landing.tsx +++ b/src/renderer/src/components/Landing.tsx @@ -5,7 +5,7 @@ import { } from './cloud-workspaces/CloudWorkspacesHome' import { useCloudWorkspaceHighlight } from './cloud-workspaces/cloud-workspace-links' import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react' -import { AlertTriangle, ExternalLink, FolderPlus, GitBranchPlus, Star, X } from 'lucide-react' +import { AlertTriangle, ExternalLink, Star, X } from 'lucide-react' import { cn } from '../lib/utils' import { useAppStore } from '../store' import { isGitRepoKind } from '../../../shared/repo-kind' @@ -23,7 +23,7 @@ import { useLandingPreflightRuntime } from './landing-preflight-runtime' import { useLandingOrcaStarState, type LandingStarState } from './landing-github-star-state' import { openAppHttpLink } from '@/lib/browser/navigation/app-http-link-open' import { - LANDING_ACTION_BUTTON_CLASS, + LandingActions, LandingBrand, LandingShortcutList, type LandingShortcutItem @@ -265,7 +265,7 @@ export default function Landing(): React.JSX.Element {
-
+
)} -
- - - -
+ openModal('add-repo')} + onCreate={() => openModal('new-workspace-composer', { telemetrySource: 'unknown' })} + /> {hasProjects ? : null} diff --git a/src/renderer/src/components/landing-layout.fixture.tsx b/src/renderer/src/components/landing-layout.fixture.tsx new file mode 100644 index 00000000000..8ce7e2cb29f --- /dev/null +++ b/src/renderer/src/components/landing-layout.fixture.tsx @@ -0,0 +1,27 @@ +import { defineFixture } from '../component-fixtures/component-fixture' +import { LandingActions } from './landing-layout' + +const noop = (): void => {} + +function row(width: number): React.JSX.Element { + return ( +
+
+ +
+
+
+ ) +} + +/** JA-30: over the cloud list in a wide centre column, the full-size top row. */ +export const actionsOverCloudListWide = defineFixture({ width: 800, render: () => row(768) }) + +/** JA-30: a narrow centre column (both side panels open): small buttons, still one row. */ +export const actionsOverCloudListNarrow = defineFixture({ width: 580, render: () => row(540) }) diff --git a/src/renderer/src/components/landing-layout.tsx b/src/renderer/src/components/landing-layout.tsx index 0efcf69ae2f..b46610c6cbd 100644 --- a/src/renderer/src/components/landing-layout.tsx +++ b/src/renderer/src/components/landing-layout.tsx @@ -1,3 +1,4 @@ +import { FolderPlus, GitBranchPlus } from 'lucide-react' import { cn } from '@/lib/utils' import { ShortcutKeyCombo } from './ShortcutKeyCombo' import type { ShortcutKeyComboDetails } from '@/hooks/useShortcutLabel' @@ -63,3 +64,44 @@ export function LandingShortcutList({
) } + +/** + * Home's two primary actions. Over the cloud list they sit as a top row aligned with it; in a + * narrow centre column (both side panels open) they shrink and stay on one row instead of + * stacking large buttons (JA-30). Needs an `@container` ancestor for the narrow case. + */ +export function LandingActions({ + overCloudList, + addProjectLabel, + createLabel, + onAddProject, + onCreate +}: { + overCloudList: boolean + addProjectLabel: string + createLabel: string + onAddProject: () => void + onCreate: () => void +}): React.JSX.Element { + const buttonClass = cn( + LANDING_ACTION_BUTTON_CLASS, + overCloudList && '@max-[600px]:px-2.5 @max-[600px]:py-1 @max-[600px]:text-xs' + ) + return ( +
+ + +
+ ) +}