Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

feat(desktop): move New issue and Search to the rail, matching web (MUL-9348) (#10684)

Jiayuan Zhangee5bbf9f5444
diff --git a/apps/desktop/src/renderer/src/components/desktop-layout.test.tsx b/apps/desktop/src/renderer/src/components/desktop-layout.test.tsx
index 4f5905545c..251860df13 100644
--- a/apps/desktop/src/renderer/src/components/desktop-layout.test.tsx
+++ b/apps/desktop/src/renderer/src/components/desktop-layout.test.tsx
@@ -72,8 +72,6 @@ vi.mock("@multica/views/layout", () => ({
CompactNavSheet: () => null,
GlobalShortcuts: () => null,
NavigationProgress: () => null,
- NewIssueButton: () => null,
- SearchButton: () => null,
ShellRouteDataPrefetch: ({ children }: { children: ReactNode }) => <>{children}</>,
SpacePanel: () => null,
// In a panel space the shell's toggleNav is the sidebar toggle.
diff --git a/apps/desktop/src/renderer/src/components/desktop-layout.tsx b/apps/desktop/src/renderer/src/components/desktop-layout.tsx
index dcfabe5f72..911a7c14f3 100644
--- a/apps/desktop/src/renderer/src/components/desktop-layout.tsx
+++ b/apps/desktop/src/renderer/src/components/desktop-layout.tsx
@@ -18,8 +18,6 @@ import {
CompactNavSheet,
GlobalShortcuts,
NavigationProgress,
- NewIssueButton,
- SearchButton,
ShellRouteDataPrefetch,
SpacePanel,
} from "@multica/views/layout";
@@ -48,8 +46,6 @@ import { WindowToolbar, WINDOW_TOOLBAR_CLEARANCE } from "./window-toolbar";
const TOP_BAR_HEIGHT_CLASS = "h-10";
const RAIL_WIDTH = 56;
-const TITLE_BAR_ACTION_CLASS =
- "flex size-7 items-center justify-center rounded-md text-faint-foreground transition-colors duration-150 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-2 focus-visible:outline-offset-2 [&_svg]:size-4";
function RailTopSpacer() {
return <div className={cn("shrink-0", TOP_BAR_HEIGHT_CLASS)} />;
@@ -73,8 +69,7 @@ function useNativeNavigationGestures() {
// The main area's top bar doubles as a window drag region. The window
// toolbar (traffic lights, history, panel toggle) floats over the rail and
// the start of this bar, so the tabs start past whatever the rail leaves of
-// its width. New issue and search hold the far end; the tabs give way to
-// them.
+// its width.
function MainTopBar({ railMounted }: { railMounted: boolean }) {
const { isCompact } = useSidebar();
const toolbarClearance =
@@ -105,20 +100,6 @@ function MainTopBar({ railMounted }: { railMounted: boolean }) {
>
<TabBar />
</div>
- {/* The right padding is the canvas's mr-2 plus the page header's
- PAGE_GUTTER, and gap-1 is the page header's action gap, so each icon
- here stands on the same column as a trailing icon of the page header
- below. */}
- {railMounted && (
- <div
- data-slot="title-bar-actions"
- className="relative z-10 ml-auto flex shrink-0 items-center gap-1 pr-[calc(var(--page-padding-x,var(--space-md,1rem))+0.5rem)]"
- style={{ WebkitAppRegion: "no-drag" } as React.CSSProperties}
- >
- <NewIssueButton className={TITLE_BAR_ACTION_CLASS} tooltipSide="bottom" />
- <SearchButton className={TITLE_BAR_ACTION_CLASS} tooltipSide="bottom" />
- </div>
- )}
</header>
);
}
@@ -288,13 +269,12 @@ export function DesktopShell() {
{slug && (
<AppRail
topSlot={<RailTopSpacer />}
- globalActions={false}
// The card starts right under the top bar; the 7px
// centres the workspace tile on its header band.
className="hidden pt-[7px] md:flex"
/>
)}
- {slug && <CompactNavSheet globalActions={false} />}
+ {slug && <CompactNavSheet />}
{/* Right side: header + content card */}
<div className="flex flex-1 min-w-0 flex-col">
<MainTopBar railMounted={Boolean(slug)} />
diff --git a/apps/desktop/src/renderer/src/components/desktop-layout.workspace-gate.test.tsx b/apps/desktop/src/renderer/src/components/desktop-layout.workspace-gate.test.tsx
index 23c4aadc3b..f0d3884cf6 100644
--- a/apps/desktop/src/renderer/src/components/desktop-layout.workspace-gate.test.tsx
+++ b/apps/desktop/src/renderer/src/components/desktop-layout.workspace-gate.test.tsx
@@ -85,8 +85,6 @@ vi.mock("@multica/views/layout", () => ({
CompactNavSheet: () => null,
GlobalShortcuts: () => <div data-testid="global-shortcuts" />,
NavigationProgress: () => <div data-testid="navigation-progress" />,
- NewIssueButton: () => <div data-testid="title-bar-new-issue" />,
- SearchButton: () => <div data-testid="title-bar-search" />,
ShellRouteDataPrefetch: ({ children }: { children: ReactNode }) => <>{children}</>,
SpacePanel: () => <div data-testid="space-panel" />,
useAppShell: () => ({ hasPanel: true }),
@@ -169,8 +167,6 @@ describe("DesktopShell workspace gating", () => {
expect(queryByTestId("app-bottom-bar")).not.toBeNull();
expect(queryByTestId("space-panel")).not.toBeNull();
expect(queryByTestId("search-command")).not.toBeNull();
- expect(queryByTestId("title-bar-new-issue")).not.toBeNull();
- expect(queryByTestId("title-bar-search")).not.toBeNull();
expect(queryByTestId("global-shortcuts")).not.toBeNull();
expect(queryByTestId("modal-registry")).not.toBeNull();
expect(queryByTestId("floating-chat")).not.toBeNull();
@@ -207,7 +203,6 @@ describe("DesktopShell workspace gating", () => {
expect(queryByTestId("app-bottom-bar")).toBeNull();
expect(queryByTestId("space-panel")).toBeNull();
expect(queryByTestId("search-command")).toBeNull();
- expect(queryByTestId("title-bar-new-issue")).toBeNull();
expect(queryByTestId("global-shortcuts")).toBeNull();
expect(queryByTestId("modal-registry")).toBeNull();
expect(queryByTestId("floating-chat")).toBeNull();
@@ -243,6 +238,5 @@ describe("DesktopShell workspace gating", () => {
expect(queryByTestId("app-rail")).toBeNull();
expect(queryByTestId("search-command")).toBeNull();
- expect(queryByTestId("title-bar-new-issue")).toBeNull();
});
});
diff --git a/apps/web/features/landing/site/demo/desktop-visuals.tsx b/apps/web/features/landing/site/demo/desktop-visuals.tsx
index c8d2ad2fc8..5067c56365 100644
--- a/apps/web/features/landing/site/demo/desktop-visuals.tsx
+++ b/apps/web/features/landing/site/demo/desktop-visuals.tsx
@@ -16,8 +16,6 @@ import {
Pin,
Plus,
RotateCw,
- Search,
- SquarePen,
type IconComponent,
} from "@multica/ui/icons";
import { cn } from "@multica/ui/lib/utils";
@@ -135,8 +133,7 @@ function TabStrip({ tabs, active, tabClassName }: { tabs: Tab[]; active: number;
/**
* Desktop's window: the rail runs the full height under the window toolbar,
- * the title bar holds the tabs and, at its far end, New issue and search, and
- * the page sits on the content card. A window that runs off its frame passes
+ * the title bar holds the tabs, and the page sits on the content card. A window that runs off its frame passes
* `bleed` so the page keeps its content out of the cropped strip.
*/
function NativeWindow({
@@ -163,16 +160,6 @@ function NativeWindow({
<div className="flex min-w-0 flex-1 flex-col">
<div className="flex h-10 shrink-0 items-center gap-2" style={{ paddingLeft: TOOLBAR_CLEARANCE - RAIL_WIDTH }}>
<TabStrip tabs={tabs} active={activeTab} tabClassName={compact ? "w-32 shrink-0" : "w-56"} />
- {compact ? null : (
- <span className="flex shrink-0 items-center gap-2" style={{ marginRight: bleed + 12 }}>
- <span className={TITLE_BAR_ACTION}>
- <SquarePen className="size-4" />
- </span>
- <span className={TITLE_BAR_ACTION}>
- <Search className="size-4" />
- </span>
- </span>
- )}
</div>
<div className={cn(APP_CARD, "mr-2 mb-2")}>
<div className="relative flex min-w-0 flex-1 flex-col" style={{ marginRight: bleed, marginBottom: bleed }}>
diff --git a/apps/web/features/landing/site/demo/mock-kit.tsx b/apps/web/features/landing/site/demo/mock-kit.tsx
index 47ff313639..53217fa97e 100644
--- a/apps/web/features/landing/site/demo/mock-kit.tsx
+++ b/apps/web/features/landing/site/demo/mock-kit.tsx
@@ -200,8 +200,7 @@ function RailButton({ icon: Icon, active }: { icon: IconComponent; active?: bool
/**
* The app rail on the grey shell: the workspace, New issue and search, the
* five spaces with their labels, then help, settings and the account. Desktop
- * moves New issue and search to its title bar and leaves room for the window
- * controls at the top.
+ * leaves room for the window controls at the top.
*/
export function AppRail({ active, inbox = 3, desktop }: { active: Space; inbox?: number; desktop?: boolean }) {
const labels = useDemoCopy().app.spaces;
@@ -210,14 +209,10 @@ export function AppRail({ active, inbox = 3, desktop }: { active: Space; inbox?:
<span className="flex size-[34px] shrink-0 items-center justify-center rounded-lg border border-surface-border bg-surface-raised text-body font-semibold shadow-[var(--surface-shadow)]">
A
</span>
- {desktop ? (
- <span className="h-2 shrink-0" />
- ) : (
- <span className="my-2 flex flex-col items-center gap-1">
- <RailButton icon={SquarePen} />
- <RailButton icon={Search} />
- </span>
- )}
+ <span className="my-2 flex flex-col items-center gap-1">
+ <RailButton icon={SquarePen} />
+ <RailButton icon={Search} />
+ </span>
<span className="flex flex-col items-center gap-0.5">
{RAIL_SPACES.map((space) => {
const current = space.key === active;
diff --git a/packages/views/layout/app-rail.test.tsx b/packages/views/layout/app-rail.test.tsx
index 9b8e8f1d9e..c7388db5a7 100644
--- a/packages/views/layout/app-rail.test.tsx
+++ b/packages/views/layout/app-rail.test.tsx
@@ -139,17 +139,11 @@ const railOrder = () =>
Array.from(document.querySelectorAll<HTMLElement>("[data-rail-item]"), (item) => item.dataset.railItem);
describe("AppRail global actions", () => {
- it("carries New issue and search by default", () => {
+ it("carries New issue and search", () => {
renderRail();
expect(screen.getByRole("button", { name: /^new issue$/i })).toBeTruthy();
expect(screen.getByRole("button", { name: "Search..." })).toBeTruthy();
});
-
- it("leaves them to the desktop title bar when turned off", () => {
- renderRail(undefined, <AppRail globalActions={false} />);
- expect(screen.queryByRole("button", { name: /^new issue$/i })).toBeNull();
- expect(screen.queryByRole("button", { name: "Search..." })).toBeNull();
- });
});
describe("AppRail order", () => {
diff --git a/packages/views/layout/app-rail.tsx b/packages/views/layout/app-rail.tsx
index 4676ee28f4..fb7a44e0ae 100644
--- a/packages/views/layout/app-rail.tsx
+++ b/packages/views/layout/app-rail.tsx
@@ -321,16 +321,13 @@ const DRAG_MODIFIERS = [restrictToVerticalAxis, restrictToFirstScrollableAncesto
* The app rail: workspaces, New issue and search, the four spaces in the
* user's order (drag to reorder), then help, settings and the account. It
* sits on the app shell, outside the content card, and stays put while the
- * panel beside it collapses. Desktop passes `globalActions={false}`: its
- * title bar carries New issue and search.
+ * panel beside it collapses.
*/
export function AppRail({
topSlot,
- globalActions = true,
className,
}: {
topSlot?: React.ReactNode;
- globalActions?: boolean;
className?: string;
}) {
const { t } = useT("layout");
@@ -402,14 +399,10 @@ export function AppRail({
>
{topSlot}
<RailWorkspaces />
- {globalActions ? (
- <div className="my-2 flex flex-col items-center gap-1">
- <NewIssueButton className={RAIL_ICON_BUTTON_CLASS} tooltipSide="right" />
- <SearchButton className={RAIL_ICON_BUTTON_CLASS} tooltipSide="right" />
- </div>
- ) : (
- <div className="h-2 shrink-0" />
- )}
+ <div className="my-2 flex flex-col items-center gap-1">
+ <NewIssueButton className={RAIL_ICON_BUTTON_CLASS} tooltipSide="right" />
+ <SearchButton className={RAIL_ICON_BUTTON_CLASS} tooltipSide="right" />
+ </div>
<DndContext
sensors={sensors}
collisionDetection={closestCenter}
diff --git a/packages/views/layout/compact-nav-sheet.tsx b/packages/views/layout/compact-nav-sheet.tsx
index 3f7b972ecd..6a493b2ea2 100644
--- a/packages/views/layout/compact-nav-sheet.tsx
+++ b/packages/views/layout/compact-nav-sheet.tsx
@@ -19,7 +19,7 @@ import { SpacePanelContent } from "./space-panel";
* Below `md` the rail and the current space's panel move into one sheet,
* opened by the page header's nav trigger.
*/
-export function CompactNavSheet({ globalActions = true }: { globalActions?: boolean }) {
+export function CompactNavSheet() {
const { t } = useT("layout");
const { isCompact, openMobile, setOpenMobile } = useSidebar();
const { pathname } = useNavigation();
@@ -50,7 +50,7 @@ export function CompactNavSheet({ globalActions = true }: { globalActions?: bool
<SheetTitle>{t(($) => $.rail.label)}</SheetTitle>
<SheetDescription>{t(($) => $.rail.sheet_description)}</SheetDescription>
</SheetHeader>
- <AppRail globalActions={globalActions} />
+ <AppRail />
{hasPanel && (
<div className="my-2 mr-2 flex w-[260px] min-w-0 flex-col overflow-hidden rounded-xl bg-page-canvas shadow-[var(--surface-shadow)] ring-1 ring-surface-border">
<SpacePanelContent space={shell?.space ?? null} />