Skip to content

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

Go

MUL-7755: feat(issues): configurable side peek in every issue view (#8886)

Jiayuan Zhang4054d57802c1
diff --git a/packages/core/issues/stores/issue-opening-store.test.ts b/packages/core/issues/stores/issue-opening-store.test.ts
new file mode 100644
index 0000000000..5ace3c5345
--- /dev/null
+++ b/packages/core/issues/stores/issue-opening-store.test.ts
@@ -0,0 +1,37 @@
+// @vitest-environment node
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+const storage = vi.hoisted(() => new Map<string, string>());
+vi.mock("../../platform/storage", () => ({
+ defaultStorage: {
+ getItem: (key: string) => storage.get(key) ?? null,
+ setItem: (key: string, value: string) => storage.set(key, value),
+ removeItem: (key: string) => storage.delete(key),
+ },
+}));
+
+import { useIssueOpeningStore } from "./issue-opening-store";
+
+beforeEach(() => {
+ storage.clear();
+ useIssueOpeningStore.setState({ openMode: "page" });
+});
+
+describe("issue opening preference", () => {
+ it("restores the saved choice on rehydration", async () => {
+ useIssueOpeningStore.getState().setOpenMode("peek");
+ const saved = storage.get("multica_issue_opening")!;
+ expect(JSON.parse(saved).state).toEqual({ openMode: "peek" });
+ useIssueOpeningStore.getState().setOpenMode("page");
+ storage.set("multica_issue_opening", saved);
+ await useIssueOpeningStore.persist.rehydrate();
+ expect(useIssueOpeningStore.getState().openMode).toBe("peek");
+ });
+
+ it.each([null, {}, { openMode: "unknown" }])("defaults to full pages for missing or invalid preferences: %j", async (state) => {
+ useIssueOpeningStore.getState().setOpenMode("peek");
+ storage.set("multica_issue_opening", JSON.stringify({ state, version: 0 }));
+ await useIssueOpeningStore.persist.rehydrate();
+ expect(useIssueOpeningStore.getState().openMode).toBe("page");
+ });
+});
diff --git a/packages/core/issues/stores/issue-opening-store.ts b/packages/core/issues/stores/issue-opening-store.ts
new file mode 100644
index 0000000000..76f92f70ad
--- /dev/null
+++ b/packages/core/issues/stores/issue-opening-store.ts
@@ -0,0 +1,34 @@
+import { create } from "zustand";
+import { createJSONStorage, persist } from "zustand/middleware";
+import { defaultStorage } from "../../platform/storage";
+
+export type IssueOpenMode = "page" | "peek";
+
+interface IssueOpeningState {
+ openMode: IssueOpenMode;
+ setOpenMode: (openMode: IssueOpenMode) => void;
+}
+
+// Like theme and comment-composer preferences, this personal navigation habit
+// is saved on this device across workspaces. Existing users keep full pages.
+export const useIssueOpeningStore = create<IssueOpeningState>()(
+ persist(
+ (set) => ({
+ openMode: "page",
+ setOpenMode: (openMode) => set({ openMode }),
+ }),
+ {
+ name: "multica_issue_opening",
+ storage: createJSONStorage(() => defaultStorage),
+ partialize: ({ openMode }) => ({ openMode }),
+ merge: (persisted, current) => ({
+ ...current,
+ openMode:
+ persisted && typeof persisted === "object" &&
+ "openMode" in persisted && persisted.openMode === "peek"
+ ? "peek"
+ : "page",
+ }),
+ },
+ ),
+);
diff --git a/packages/ui/components/ui/data-table.tsx b/packages/ui/components/ui/data-table.tsx
index 5d2b5d4401..b3389d2a47 100644
--- a/packages/ui/components/ui/data-table.tsx
+++ b/packages/ui/components/ui/data-table.tsx
@@ -32,6 +32,12 @@ import { cn } from "@multica/ui/lib/utils";
// header behave alike, and keeps a plain click from committing a width.
const RESIZE_DRAG_THRESHOLD = 4;
+// Extra per-row presentation: a class and data attributes for the standard
+// data row (custom rows from `renderRow` carry their own).
+export type DataTableRowProps = {
+ className?: string;
+} & { [attribute: `data-${string}`]: string | undefined };
+
interface DataTableProps<TData> extends React.ComponentProps<"div"> {
table: TanstackTable<TData>;
// Optional bar shown below the table when ≥1 row is selected. We
@@ -51,6 +57,8 @@ interface DataTableProps<TData> extends React.ComponentProps<"div"> {
// Optional escape hatch for semantic rows such as collapsible group
// headers. Return null/undefined to use the standard data row renderer.
renderRow?: (row: Row<TData>) => React.ReactNode;
+ // Marks a standard data row, e.g. the one a side panel is showing.
+ getRowProps?: (row: Row<TData>) => DataTableRowProps | undefined;
// A caller-supplied <tfoot> (summary / quick-create rows, for example).
footer?: React.ReactNode;
// Render only the visible row window for large tables. Callers should use
@@ -84,6 +92,7 @@ export function DataTable<TData>({
emptyMessage = "No results.",
onRowClick,
renderRow,
+ getRowProps,
footer,
virtualizeRows = false,
virtualRowHeight = 41,
@@ -373,6 +382,7 @@ export function DataTable<TData>({
emptyMessage,
onRowClick,
renderRow,
+ getRowProps,
hasExplicitSize,
measureRow: rowVirtualizer.measureElement,
virtualizeRows,
@@ -587,6 +597,7 @@ interface DataTableBodyProps<TData> {
emptyMessage: React.ReactNode;
onRowClick?: (row: Row<TData>, event: React.MouseEvent) => void;
renderRow?: (row: Row<TData>) => React.ReactNode;
+ getRowProps?: (row: Row<TData>) => DataTableRowProps | undefined;
hasExplicitSize: (columnId: string) => boolean;
// The virtualizer's own measuring ref; rows report their height through it.
measureRow: (element: HTMLElement | null) => void;
@@ -602,6 +613,7 @@ function DataTableBody<TData>({
emptyMessage,
onRowClick,
renderRow,
+ getRowProps,
hasExplicitSize,
measureRow,
virtualizeRows,
@@ -628,9 +640,11 @@ function DataTableBody<TData>({
)
: <React.Fragment key={row.id}>{customRow}</React.Fragment>;
}
+ const { className: rowClassName, ...rowAttributes } = getRowProps?.(row) ?? {};
return (
<TableRow
key={row.id}
+ {...rowAttributes}
{...measured}
data-state={row.getIsSelected() && "selected"}
onClick={
@@ -655,7 +669,7 @@ function DataTableBody<TData>({
// `group` lets pinned cells track row hover via group-hover (their bg
// is in className, not on the row, so they stay opaque enough to cover
// content scrolling beneath them).
- className={cn("group", onRowClick && "cursor-pointer")}
+ className={cn("group", onRowClick && "cursor-pointer", rowClassName)}
>
{row.getVisibleCells().map((cell) => {
const isPinned = cell.column.getIsPinned();
diff --git a/packages/views/issues/components/board-card-peek.test.tsx b/packages/views/issues/components/board-card-peek.test.tsx
new file mode 100644
index 0000000000..7084228bba
--- /dev/null
+++ b/packages/views/issues/components/board-card-peek.test.tsx
@@ -0,0 +1,202 @@
+import { useIssueOpeningStore } from "@multica/core/issues/stores/issue-opening-store";
+import { act, fireEvent, render, screen } from "@testing-library/react";
+import type { ReactNode } from "react";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+import { DndContext } from "@dnd-kit/core";
+import { SortableContext } from "@dnd-kit/sortable";
+import type { Issue } from "@multica/core/types";
+import { NavigationProvider, type NavigationAdapter } from "../../navigation";
+import {
+ IssuePeekActionsContext,
+ IssuePeekIdContext,
+ type IssuePeekActions,
+} from "../surface/peek-context";
+import { DraggableBoardCard } from "./board-card";
+
+vi.mock("@tanstack/react-query", async (importOriginal) => ({
+ ...(await importOriginal<typeof import("@tanstack/react-query")>()),
+ useQuery: () => ({ data: [] }),
+}));
+
+vi.mock("@multica/core/hooks", () => ({
+ useWorkspaceId: () => "ws-1",
+}));
+
+vi.mock("@multica/core/properties", () => ({
+ propertyListOptions: () => ({ queryKey: ["properties"] }),
+}));
+
+vi.mock("@multica/core/paths", () => ({
+ useWorkspacePaths: () => ({ issueDetail: (id: string) => `/acme/issues/${id}` }),
+}));
+
+vi.mock("@multica/core/issues/stores/view-store-context", () => ({
+ useViewStore: (selector: (state: unknown) => unknown) =>
+ selector({
+ viewMode: "board",
+ grouping: "status",
+ swimlaneGrouping: "assignee",
+ cardProperties: {},
+ cardPropertyIds: [],
+ }),
+}));
+
+vi.mock("@multica/core/workspace/hooks", () => ({
+ useActorName: () => ({ getActorName: () => "Someone" }),
+}));
+
+vi.mock("../../i18n", () => ({
+ useLocale: () => "en",
+ useT: () => ({ t: () => "Translated" }),
+ useTimeAgo: () => () => "now",
+}));
+
+vi.mock("../actions", () => ({
+ IssueActionsContextMenu: ({ children }: { children: ReactNode }) => children,
+}));
+
+vi.mock("./issue-agent-activity-indicator", () => ({
+ IssueAgentActivityIndicator: () => null,
+}));
+
+vi.mock("./custom-status-chip", () => ({
+ CustomStatusChip: () => null,
+ useIsCustomStatus: () => false,
+}));
+
+const navigation: NavigationAdapter = {
+ push: vi.fn(),
+ replace: vi.fn(),
+ back: vi.fn(),
+ pathname: "/acme/issues",
+ searchParams: new URLSearchParams(),
+ hash: "",
+ getShareableUrl: (path) => `https://app.example${path}`,
+};
+
+const peek: IssuePeekActions = {
+ open: vi.fn(),
+ toggle: vi.fn(),
+ close: vi.fn(),
+ publishColumns: vi.fn(),
+};
+
+const issue = {
+ id: "issue-1",
+ identifier: "MUL-1",
+ title: "Peekable card",
+ description: null,
+ status: "todo",
+ priority: "none",
+ assignee_type: null,
+ assignee_id: null,
+ labels: [],
+ properties: {},
+ start_date: null,
+ due_date: null,
+ updated_at: "2026-09-27T00:00:00Z",
+} as unknown as Issue;
+
+function renderCard({ withPeek = true, peekedId = null as string | null } = {}) {
+ const card = (
+ <DndContext>
+ <SortableContext items={[issue.id]}>
+ <DraggableBoardCard issue={issue} />
+ </SortableContext>
+ </DndContext>
+ );
+ return render(
+ <NavigationProvider value={navigation}>
+ {withPeek ? (
+ <IssuePeekActionsContext.Provider value={peek}>
+ <IssuePeekIdContext.Provider value={peekedId}>{card}</IssuePeekIdContext.Provider>
+ </IssuePeekActionsContext.Provider>
+ ) : (
+ card
+ )}
+ </NavigationProvider>,
+ );
+}
+
+const link = () => screen.getByRole("link");
+const cardRoot = (container: HTMLElement) =>
+ container.querySelector<HTMLElement>('[data-peek-target="issue-1"]')!;
+
+describe("DraggableBoardCard side peek", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ useIssueOpeningStore.setState({ openMode: "page" });
+ });
+
+ it("opens the peek on Shift+Click instead of navigating", () => {
+ renderCard();
+ expect(fireEvent.click(link(), { shiftKey: true })).toBe(false);
+ expect(peek.toggle).toHaveBeenCalledWith("issue-1");
+ expect(navigation.push).not.toHaveBeenCalled();
+ });
+
+ it("still navigates on a plain click", () => {
+ renderCard();
+ fireEvent.click(link());
+ expect(navigation.push).toHaveBeenCalledWith("/acme/issues/issue-1");
+ expect(peek.toggle).not.toHaveBeenCalled();
+ });
+
+ it("leaves Cmd/Ctrl+Shift+Click to the new-tab behavior", () => {
+ renderCard();
+ fireEvent.click(link(), { shiftKey: true, metaKey: true });
+ fireEvent.click(link(), { shiftKey: true, ctrlKey: true });
+ expect(peek.toggle).not.toHaveBeenCalled();
+ });
+
+ it("peeks the focused card on Space", () => {
+ const { container } = renderCard();
+ expect(fireEvent.keyDown(cardRoot(container), { key: " " })).toBe(false);
+ fireEvent.keyDown(link(), { key: " " });
+ expect(peek.toggle).toHaveBeenCalledTimes(2);
+ });
+
+ it("reacts immediately to the preference and keeps repeated plain clicks open", () => {
+ renderCard();
+ act(() => useIssueOpeningStore.getState().setOpenMode("peek"));
+ fireEvent.click(link());
+ fireEvent.click(link());
+ expect(peek.open).toHaveBeenCalledTimes(2);
+ expect(peek.open).toHaveBeenCalledWith("issue-1");
+ expect(peek.toggle).not.toHaveBeenCalled();
+ expect(navigation.push).not.toHaveBeenCalled();
+ act(() => useIssueOpeningStore.getState().setOpenMode("page"));
+ fireEvent.click(link());
+ expect(navigation.push).toHaveBeenCalledWith("/acme/issues/issue-1");
+ });
+
+ it("opens the full page in place on Shift+Click when the preference is peek", () => {
+ useIssueOpeningStore.getState().setOpenMode("peek");
+ renderCard();
+ // Handled here, not left to the browser (a new window on web).
+ expect(fireEvent.click(link(), { shiftKey: true })).toBe(false);
+ expect(navigation.push).toHaveBeenCalledWith("/acme/issues/issue-1");
+ expect(peek.open).not.toHaveBeenCalled();
+ expect(peek.toggle).not.toHaveBeenCalled();
+ });
+
+ it("still navigates without a peek host when the preference is peek", () => {
+ useIssueOpeningStore.getState().setOpenMode("peek");
+ renderCard({ withPeek: false });
+ fireEvent.click(link());
+ expect(navigation.push).toHaveBeenCalledWith("/acme/issues/issue-1");
+ expect(peek.open).not.toHaveBeenCalled();
+ });
+
+ it("marks the peeked card", () => {
+ const { container } = renderCard({ peekedId: "issue-1" });
+ expect(cardRoot(container)).toHaveAttribute("data-peeked");
+ });
+
+ it("keeps the browser's shift-click outside a peek host", () => {
+ renderCard({ withPeek: false });
+ // No handler claims the gesture: AppLink leaves it to the browser.
+ expect(fireEvent.click(link(), { shiftKey: true })).toBe(true);
+ expect(navigation.push).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/views/issues/components/board-card.tsx b/packages/views/issues/components/board-card.tsx
index 573460a07f..41b79d7bd9 100644
--- a/packages/views/issues/components/board-card.tsx
+++ b/packages/views/issues/components/board-card.tsx
@@ -31,6 +31,12 @@ import { IssueAgentActivityIndicator } from "./issue-agent-activity-indicator";
import { CustomStatusChip, useIsCustomStatus } from "./custom-status-chip";
import { IssueDuplicateOfMarker } from "./issue-duplicates";
import { useIssueSurfaceActionsOptional } from "../surface/actions-context";
+import {
+ PEEK_TARGET_ATTR,
+ useIsIssuePeeked,
+ useIssuePeekActions,
+ useIssuePeekLinkProps,
+} from "../surface/peek-context";
function formatDate(date: string, locale: string): string {
return formatDateOnly(date, { month: "short", day: "numeric" }, locale);
}
@@ -191,7 +197,7 @@ export const BoardCardContent = memo(function BoardCardContent({
const showRightMeta = !!showStartDate || !!showDueDate || !!showChildProgress || showUpdatedHint;
return (
- <div className="rounded-lg border-[0.5px] border-surface-border bg-surface py-3 px-2.5 shadow-[var(--surface-shadow)] transition-colors group-hover/card:border-foreground/15 group-hover/card:bg-surface-hover group-data-[popup-open]/card:border-foreground/15 group-data-[popup-open]/card:bg-surface-hover">
+ <div className="rounded-lg border-[0.5px] border-surface-border bg-surface py-3 px-2.5 shadow-[var(--surface-shadow)] transition-colors group-hover/card:border-foreground/15 group-hover/card:bg-surface-hover group-data-[popup-open]/card:border-foreground/15 group-data-[popup-open]/card:bg-surface-hover group-data-[peeked]/card:ring-2 group-data-[peeked]/card:ring-brand/50">
{/* Row 1: priority + identifier (left), agent activity + assignee (right) */}
<div className="flex items-center justify-between gap-2">
<div className="flex items-center gap-1.5 min-w-0">
@@ -352,6 +358,9 @@ export const DraggableBoardCard = memo(function DraggableBoardCard({
disableSorting?: boolean;
}) {
const p = useWorkspacePaths();
+ const peek = useIssuePeekActions();
+ const peeked = useIsIssuePeeked(issue.id);
+ const peekLinkProps = useIssuePeekLinkProps(issue.id);
const {
attributes,
listeners,
@@ -377,14 +386,30 @@ export const DraggableBoardCard = memo(function DraggableBoardCard({
ref={setNodeRef}
style={style}
data-board-card=""
+ {...{ [PEEK_TARGET_ATTR]: issue.id }}
+ data-peeked={peeked ? "" : undefined}
{...attributes}
{...listeners}
className={`group/card ${isDragging ? "opacity-30" : ""}`}
+ onKeyDown={
+ peek
+ ? (e) => {
+ // Space peeks the focused card (the card itself or its link,
+ // never a picker button inside it). The board registers no
+ // keyboard drag sensor, so Space is free here.
+ if (e.key !== " " || e.repeat) return;
+ if (e.target !== e.currentTarget && (e.target as HTMLElement).tagName !== "A") return;
+ e.preventDefault();
+ peek.toggle(issue.id);
+ }
+ : undefined
+ }
>
<AppLink
href={p.issueDetail(issue.id)}
newTabTitle={issue.identifier}
className={`group block transition-colors ${isDragging ? "pointer-events-none" : ""}`}
+ {...peekLinkProps}
>
<BoardCardContent
issue={issue}
diff --git a/packages/views/issues/components/board-view.tsx b/packages/views/issues/components/board-view.tsx
index b83bb7ed2d..7b9c6801a4 100644
--- a/packages/views/issues/components/board-view.tsx
+++ b/packages/views/issues/components/board-view.tsx
@@ -1,6 +1,7 @@
"use client";
import { useIssueStatuses } from "@multica/core/issue-statuses/hooks";
+import { cn } from "@multica/ui/lib/utils";
import { useState, useCallback, useMemo, useEffect, useRef, memo } from "react";
import { useQuery } from "@tanstack/react-query";
@@ -45,6 +46,7 @@ import type {
IssueGroupPageState,
} from "../surface/use-issue-group-branches";
import { useDragSettle } from "./use-drag-settle";
+import { useIssuePeekActions } from "../surface/peek-context";
import { useBoardDragPan } from "./use-board-drag-pan";
import { useT } from "../../i18n";
import {
@@ -512,6 +514,13 @@ function BoardViewImpl({
})
);
+ // Side peek steps through a column with J / K, in the order shown here.
+ const peek = useIssuePeekActions();
+ useEffect(() => {
+ peek?.publishColumns(groups.map((group) => columns[group.id] ?? EMPTY_IDS));
+ }, [peek, groups, columns]);
+ useEffect(() => () => peek?.publishColumns(null), [peek]);
+
// #6700: drag empty board background with the left button to pan horizontally
// (Trello/Linear). Card drags start on `[data-board-card]` and are ignored.
const pan = useBoardDragPan<HTMLDivElement>();
@@ -708,7 +717,13 @@ function BoardViewImpl({
onPointerUp={pan.onPointerUp}
onPointerCancel={pan.onPointerCancel}
onLostPointerCapture={pan.onLostPointerCapture}
- className="flex flex-1 min-h-0 gap-4 overflow-x-auto p-2"
+ data-board-scroller=""
+ className={cn(
+ "flex flex-1 min-h-0 gap-4 overflow-x-auto p-2",
+ // While a side peek is open, a trailing spacer as wide as the panel
+ // lets every column scroll clear of it (IssuePeekHost).
+ "group-data-[peek-open]/peek:after:w-(--issue-peek-width) group-data-[peek-open]/peek:after:shrink-0 group-data-[peek-open]/peek:after:content-['']",
+ )}
>
{groups.length === 0 ? (
groupBranches?.isError ? (
diff --git a/packages/views/issues/components/gantt-view.tsx b/packages/views/issues/components/gantt-view.tsx
index d626f67d5e..a0f74b86b7 100644
--- a/packages/views/issues/components/gantt-view.tsx
+++ b/packages/views/issues/components/gantt-view.tsx
@@ -19,6 +19,12 @@ import {
} from "@multica/ui/components/ui/tooltip";
import { Button } from "@multica/ui/components/ui/button";
import { AppLink } from "../../navigation";
+import {
+ PEEK_TARGET_ATTR,
+ useIsIssuePeeked,
+ useIssuePeekActions,
+ useIssuePeekLinkProps,
+} from "../surface/peek-context";
import { ActorAvatar } from "../../common/actor-avatar";
import { ProjectIcon } from "../../projects/components/project-icon";
import { StatusIcon } from "./status-icon";
@@ -328,6 +334,8 @@ function ScheduledRow({
enabled: !!issue.project_id,
});
const project = issue.project_id ? projects.find((pr) => pr.id === issue.project_id) : undefined;
+ const peeked = useIsIssuePeeked(issue.id);
+ const peekLinkProps = useIssuePeekLinkProps(issue.id);
const start = parseDay(issue.start_date);
const due = parseDay(issue.due_date);
@@ -365,15 +373,22 @@ function ScheduledRow({
return (
<IssueActionsContextMenu issue={issue}>
<div
+ {...{ [PEEK_TARGET_ATTR]: issue.id }}
className="flex border-b border-foreground/5 hover:bg-accent/30 transition-colors"
style={{ height: ROW_HEIGHT }}
>
- {/* Sticky label cell */}
+ {/* Sticky label cell — it also carries the peeked mark, since its
+ opaque background covers the row's own. */}
<AppLink
href={p.issueDetail(issue.id)}
newTabTitle={issue.identifier}
- className="sticky left-0 z-[1] flex shrink-0 items-center gap-2 border-r bg-background px-3 text-body min-w-0"
+ className={cn(
+ "sticky left-0 z-[1] flex shrink-0 items-center gap-2 border-r bg-background px-3 text-body min-w-0",
+ peeked &&
+ "bg-[color-mix(in_oklab,var(--brand)_6%,var(--background))] shadow-[inset_2px_0_0_var(--brand)]",
+ )}
style={{ width: LEFT_COL_WIDTH }}
+ {...peekLinkProps}
>
<StatusIcon
status={issue.status}
@@ -409,6 +424,7 @@ function ScheduledRow({
<AppLink
href={p.issueDetail(issue.id)}
newTabTitle={issue.identifier}
+ {...peekLinkProps}
className={cn(
"absolute top-1/2 -translate-y-1/2 transition-opacity hover:opacity-90",
bar.isMarker
@@ -480,6 +496,13 @@ export function GanttView({ issues }: { issues: Issue[] }) {
return sortIssues(issues, sortField, sortDirection, statusOrder);
}, [issues, sortBy, sortDirection, statusOrder]);
+ // Side peek steps through the rows top to bottom.
+ const peek = useIssuePeekActions();
+ useEffect(() => {
+ peek?.publishColumns([scheduled.map((issue) => issue.id)]);
+ }, [peek, scheduled]);
+ useEffect(() => () => peek?.publishColumns(null), [peek]);
+
const range = useMemo(
() => computeRange(scheduled, today, zoom),
[scheduled, today, zoom],
diff --git a/packages/views/issues/components/issue-detail.test.tsx b/packages/views/issues/components/issue-detail.test.tsx
index 0223fa1617..f0522b4321 100644
--- a/packages/views/issues/components/issue-detail.test.tsx
+++ b/packages/views/issues/components/issue-detail.test.tsx
@@ -1149,6 +1149,74 @@ describe("IssueDetail (shared)", () => {
expect(screen.queryByText("Properties")).not.toBeInTheDocument();
});
+ // The peek's close button lives in the host's trailing controls, so every
+ // state the peek can show must carry them (review of #8886).
+ function renderPeek(issueId = "issue-1") {
+ const queryClient = createTestQueryClient();
+ return render(
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ <QueryClientProvider client={queryClient}>
+ <IssueDetail
+ issueId={issueId}
+ variant="peek"
+ onDelete={() => {}}
+ leadingAction={<span data-testid="peek-nav" />}
+ trailingActions={<button type="button">Close preview</button>}
+ />
+ </QueryClientProvider>
+ </I18nProvider>,
+ );
+ }
+
+ it("keeps the peek's host controls while the issue is loading", () => {
+ mockApiObj.getIssue.mockReturnValue(new Promise(() => {}));
+ renderPeek();
+ expect(screen.getByTestId("peek-nav")).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: "Close preview" })).toBeInTheDocument();
+ });
+
+ it("keeps the peek's host controls when the issue cannot be loaded", async () => {
+ mockApiObj.getIssue.mockRejectedValue(new Error("Not found"));
+ renderPeek("nonexistent-id");
+ await waitFor(() => {
+ expect(
+ screen.getByText("This issue does not exist or has been deleted in this workspace."),
+ ).toBeInTheDocument();
+ });
+ expect(screen.getByRole("button", { name: "Close preview" })).toBeInTheDocument();
+ });
+
+ it("renders the peek variant as one column with property pills and host actions", async () => {
+ const queryClient = createTestQueryClient();
+ render(
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ <QueryClientProvider client={queryClient}>
+ <IssueDetail
+ issueId="issue-1"
+ variant="peek"
+ leadingAction={<span data-testid="peek-nav" />}
+ trailingActions={<button type="button">Close preview</button>}
+ />
+ </QueryClientProvider>
+ </I18nProvider>,
+ );
+
+ await waitFor(() => {
+ expect(screen.getByText("Implement authentication")).toBeInTheDocument();
+ });
+
+ // No resizable sidebar: the properties become pills under the title.
+ expect(screen.queryByTestId("panel-group")).not.toBeInTheDocument();
+ expect(screen.queryByText("Properties")).not.toBeInTheDocument();
+ expect(screen.getByTestId("project-picker")).toBeInTheDocument();
+ expect(screen.getByText("High")).toBeInTheDocument();
+ // The host's controls replace the sidebar toggle.
+ expect(screen.getByTestId("peek-nav")).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: "Close preview" })).toBeInTheDocument();
+ // The header leaf names the issue by identifier only — the title is right below.
+ expect(screen.getByRole("link", { name: mockIssue.identifier })).toBeInTheDocument();
+ });
+
it("pins the comment composer to the scroll viewport on a wide screen", async () => {
const { container } = renderIssueDetail();
diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsx
index 2794723582..0632b95f4a 100644
--- a/packages/views/issues/components/issue-detail.tsx
+++ b/packages/views/issues/components/issue-detail.tsx
@@ -85,6 +85,7 @@ import { LabelChip } from "../../labels/label-chip";
import { IssueAgentActivityIndicator } from "./issue-agent-activity-indicator";
import { SubIssuesAgentWorkingChip } from "./sub-issues-agent-working-chip";
import { ProjectPicker } from "../../projects/components/project-picker";
+import { IssuePropertyPills } from "./issue-property-pills";
import { LocalDirectoryHint } from "../../projects/components/local-directory-hint";
import { useNewRunIds } from "./use-run-comment-motion";
import { AgentRunComment, CommentCard } from "./comment-card";
@@ -1133,6 +1134,14 @@ interface IssueDetailProps {
* the surface the reader arrived from, so only the host can spell that trip.
*/
leadingAction?: ReactNode;
+ /**
+ * `"peek"` renders the detail inside the board's side peek (`IssuePeekHost`):
+ * a single column with the core properties as pills under the title, no
+ * properties sidebar, and `trailingActions` where the sidebar toggle sits.
+ */
+ variant?: "page" | "peek";
+ /** Peek only: host controls at the end of the header (open full page, close). */
+ trailingActions?: ReactNode;
}
// ---------------------------------------------------------------------------
@@ -1148,6 +1157,7 @@ interface IssueDetailProps {
export function IssueNotFound({
showBackLink = true,
leading,
+ trailing,
}: {
showBackLink?: boolean;
/**
@@ -1157,6 +1167,8 @@ export function IssueNotFound({
* there is none.
*/
leading?: ReactNode;
+ /** Host controls at the end of the bar — the side peek's close button. */
+ trailing?: ReactNode;
}) {
const { t } = useT("issues");
const backOrReplace = useBackOrReplace();
@@ -1164,8 +1176,11 @@ export function IssueNotFound({
return (
<div className="flex flex-1 min-h-0 flex-col">
- {leading && (
- <div className={cn("flex h-12 shrink-0 items-center gap-2 border-b", PAGE_GUTTER)}>{leading}</div>
+ {(leading || trailing) && (
+ <div className={cn("flex h-12 shrink-0 items-center gap-2 border-b", PAGE_GUTTER)}>
+ {leading}
+ {trailing && <div className="ml-auto flex shrink-0 items-center gap-1">{trailing}</div>}
+ </div>
)}
<div className="flex flex-1 min-h-0 flex-col items-center justify-center gap-3 text-body text-muted-foreground">
<p>{t(($) => $.detail.not_found)}</p>
@@ -1189,7 +1204,11 @@ export function IssueNotFound({
* an identifier URL to its issue — the two waits are indistinguishable to the
* user, and rendering the same skeleton keeps them that way.
*/
-export function IssueDetailSkeleton({ leading }: { leading?: ReactNode } = {}) {
+export function IssueDetailSkeleton({
+ leading,
+ trailing,
+ sidebar = true,
+}: { leading?: ReactNode; trailing?: ReactNode; sidebar?: boolean } = {}) {
return (
<div className="flex flex-1 min-h-0 flex-col">
{/* The way back is real from the first frame, not once the issue lands:
@@ -1203,6 +1222,7 @@ export function IssueDetailSkeleton({ leading }: { leading?: ReactNode } = {}) {
<Skeleton className="h-4 w-24" />
</>
)}
+ {trailing && <div className="ml-auto flex shrink-0 items-center gap-1">{trailing}</div>}
</div>
<div className="flex flex-1 min-h-0">
{/* Same scrollbar-gutter as the loaded scroller below, so the skeleton
@@ -1230,21 +1250,23 @@ export function IssueDetailSkeleton({ leading }: { leading?: ReactNode } = {}) {
</div>
</div>
</div>
- <div className="hidden md:block w-80 border-l p-4 space-y-5">
- {Array.from({ length: 4 }).map((_, i) => (
- <div key={i} className="flex items-center gap-2">
- <Skeleton className="h-3 w-16 shrink-0" />
- <Skeleton className="h-5 w-24" />
- </div>
- ))}
- <Skeleton className="h-px w-full" />
- {Array.from({ length: 3 }).map((_, i) => (
- <div key={i} className="flex items-center gap-2">
- <Skeleton className="h-3 w-16 shrink-0" />
- <Skeleton className="h-4 w-28" />
- </div>
- ))}
- </div>
+ {sidebar && (
+ <div className="hidden md:block w-80 border-l p-4 space-y-5">
+ {Array.from({ length: 4 }).map((_, i) => (
+ <div key={i} className="flex items-center gap-2">
+ <Skeleton className="h-3 w-16 shrink-0" />
+ <Skeleton className="h-5 w-24" />
+ </div>
+ ))}
+ <Skeleton className="h-px w-full" />
+ {Array.from({ length: 3 }).map((_, i) => (
+ <div key={i} className="flex items-center gap-2">
+ <Skeleton className="h-3 w-16 shrink-0" />
+ <Skeleton className="h-4 w-28" />
+ </div>
+ ))}
+ </div>
+ )}
</div>
</div>
);
@@ -1254,7 +1276,8 @@ export function IssueDetailSkeleton({ leading }: { leading?: ReactNode } = {}) {
// IssueDetail
// ---------------------------------------------------------------------------
-export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = true, layoutId = "multica_issue_detail_layout", highlightCommentId, highlightRequestToken, leadingAction }: IssueDetailProps) {
+export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = true, layoutId = "multica_issue_detail_layout", highlightCommentId, highlightRequestToken, leadingAction, variant = "page", trailingActions }: IssueDetailProps) {
+ const isPeek = variant === "peek";
const { t } = useT("issues");
const locale = useLocale();
const timeAgo = useTimeAgo();
@@ -1357,7 +1380,9 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
// in the query string while memento entries key by pathname — a bare
// "main" would restore notification A's offset into notification B's
// detail.
- const scrollContainerKey = `main:${id}`;
+ // The peek gets its own key: it is an overlay on the board's route, and
+ // must neither restore the full page's offset nor leave one behind for it.
+ const scrollContainerKey = `${isPeek ? "peek" : "main"}:${id}`;
const restoredScrollTop = useRestoredScrollOffset(scrollContainerKey);
const restoreScrollRef = useRestoredScrollRef(scrollContainerKey);
// Whether this issue's comment-highlight deep link already landed here
@@ -1379,11 +1404,12 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
const rightSidebarShortcutTargetRef = useRef<HTMLDivElement | null>(null);
const attachScrollContainer = useCallback(
(el: HTMLDivElement | null) => {
- rightSidebarShortcutTargetRef.current = el;
+ // The peek has no sidebar, so it must not claim the toggle shortcut.
+ rightSidebarShortcutTargetRef.current = isPeek ? null : el;
setScrollContainerEl(el);
restoreScrollRef(el);
},
- [restoreScrollRef],
+ [isPeek, restoreScrollRef],
);
const [pendingPostedCommentId, setPendingPostedCommentId] = useState<string | null>(null);
const scrollToTimelineBottom = useCallback((commentId: string) => {
@@ -2519,7 +2545,8 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
// switch back), this hook's retry loop IS the restore: the one-shot
// ref-attach assignment clamps against a container whose async content
// (markdown, images) hasn't reached its captured height yet.
- disabled: !!highlightCommentId && consumedHighlightId !== highlightCommentId,
+ // A peek always opens at the top: it is a glance, not a place to return to.
+ disabled: isPeek || (!!highlightCommentId && consumedHighlightId !== highlightCommentId),
// The tab memento's offset, when the platform serves one. It must win
// over this hook's module-level map — see the parameter doc.
overrideTop: restoredScrollTop,
@@ -2538,11 +2565,13 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
);
if (loading) {
- return <IssueDetailSkeleton leading={leadingAction} />;
+ // The host's trailing controls hold the peek's only close button, so the
+ // waiting and missing states carry them too.
+ return <IssueDetailSkeleton leading={leadingAction} trailing={trailingActions} sidebar={!isPeek} />;
}
if (!issue) {
- return <IssueNotFound showBackLink={!onDelete} leading={leadingAction} />;
+ return <IssueNotFound showBackLink={!onDelete} leading={leadingAction} trailing={trailingActions} />;
}
const persistDescriptionSave = (
@@ -3051,6 +3080,8 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
]
: [];
+ const titleSizeClass = isPeek ? "text-title-lg font-semibold" : "text-display-sm font-bold";
+
const detailContent = (
<CurrentIssueRenderContextProvider value={currentIssueRenderContext}>
<div className="relative flex h-full min-w-0 flex-1 flex-col">
@@ -3078,7 +3109,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
className="flex min-w-0 transition-opacity hover:opacity-80"
>
<span className="truncate font-medium text-foreground">
- {issue.identifier} {issue.title}
+ {isPeek ? issue.identifier : `${issue.identifier} ${issue.title}`}
</span>
</AppLink>
}
@@ -3150,21 +3181,25 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
</Button>
}
/>
- <Tooltip>
- <TooltipTrigger
- render={
- <Button
- variant={sidebarOpen ? "secondary" : "ghost"}
- size="icon-sm"
- className={sidebarOpen ? "" : "text-muted-foreground"}
- onClick={handleToggleSidebar}
- >
- <PanelRight />
- </Button>
- }
- />
- <TooltipContent side="bottom">{t(($) => $.detail.sidebar_tooltip)}</TooltipContent>
- </Tooltip>
+ {isPeek ? (
+ trailingActions
+ ) : (
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant={sidebarOpen ? "secondary" : "ghost"}
+ size="icon-sm"
+ className={sidebarOpen ? "" : "text-muted-foreground"}
+ onClick={handleToggleSidebar}
+ >
+ <PanelRight />
+ </Button>
+ }
+ />
+ <TooltipContent side="bottom">{t(($) => $.detail.sidebar_tooltip)}</TooltipContent>
+ </Tooltip>
+ )}
</>
}
/>
@@ -3177,7 +3212,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
nothing and render unchanged. */}
<div
ref={attachScrollContainer}
- data-tab-scroll-root={scrollContainerKey}
+ data-tab-scroll-root={isPeek ? undefined : scrollContainerKey}
className="relative flex-1 overflow-y-auto [scrollbar-gutter:stable_both-edges]"
>
{/* Gutters: 32px is a comfortable reading margin on a desktop column
@@ -3186,7 +3221,14 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
of the scroll: below `md` the composer is not pinned (see
`useStickyComposer`), so it lands here — right where the launcher
floats — once the reader scrolls to the bottom. */}
- <div className="mx-auto w-full max-w-4xl px-3 py-6 max-md:pb-chat-launcher md:px-8 md:py-8">
+ <div
+ className={cn(
+ "mx-auto w-full",
+ // The peek is already a narrow column, so it takes a tighter gutter
+ // and never reaches the chat launcher's corner (see IssuePeekHost).
+ isPeek ? "px-6 py-5" : "max-w-4xl px-3 py-6 max-md:pb-chat-launcher md:px-8 md:py-8",
+ )}
+ >
<IssueDuplicateBanner
issue={issue}
onUnmark={() =>
@@ -3203,7 +3245,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
ref={titleEditorRef}
defaultValue={titleConflictDraft ?? issue.title}
placeholder={t(($) => $.detail.title_placeholder)}
- className="w-full text-display-sm font-bold leading-snug tracking-tight"
+ className={cn("w-full leading-snug tracking-tight", titleSizeClass)}
onReady={titleLazy.onReady}
onBlur={(value) => {
const trimmed = value.trim();
@@ -3231,7 +3273,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
<div
role="button"
tabIndex={0}
- className="w-full cursor-text text-display-sm font-bold leading-snug tracking-tight"
+ className={cn("w-full cursor-text leading-snug tracking-tight", titleSizeClass)}
onClick={(e) => {
// A drag-selection (copying the title) must not summon the editor.
const sel = window.getSelection();
@@ -3331,6 +3373,17 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
</AppLink>
)}
+ {isPeek && (
+ <div className="mt-3">
+ <IssuePropertyPills
+ issue={issue}
+ onUpdate={handleUpdateField}
+ onMarkDuplicate={actions.openMarkDuplicate}
+ isDuplicate={isDuplicateIssue(issue)}
+ />
+ </div>
+ )}
+
{issue.source_context && (
<SourceContextBadge
context={issue.source_context}
@@ -3792,7 +3845,7 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
the resize handle's 4px drag strip at the panel edge. Hover
previews a comment, click jumps to it. Hidden on mobile: no
hover, and the gutter is too tight. */}
- {!isMobile && (
+ {!isMobile && !isPeek && (
<ThreadMinimap
threads={minimapThreads}
scrollContainerEl={scrollContainerEl}
@@ -3828,6 +3881,12 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
</PreviewSequenceProvider>
);
+ // The peek has no room for the properties sidebar: its core properties are
+ // the pills under the title, and the rest is one click away on the page.
+ if (isPeek) {
+ return withPreview(<div className="flex flex-1 min-h-0">{detailContent}</div>);
+ }
+
if (isMobile) {
return withPreview(
<div className="flex flex-1 min-h-0">
diff --git a/packages/views/issues/components/issue-peek.test.tsx b/packages/views/issues/components/issue-peek.test.tsx
new file mode 100644
index 0000000000..389636f81e
--- /dev/null
+++ b/packages/views/issues/components/issue-peek.test.tsx
@@ -0,0 +1,328 @@
+import { act, fireEvent, screen, waitFor } from "@testing-library/react";
+import { useEffect, type ReactNode } from "react";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+import { renderWithI18n } from "../../test/i18n";
+import { NavigationProvider, type NavigationAdapter } from "../../navigation";
+import {
+ useIsIssuePeeked,
+ useIssuePeekActions,
+ type IssuePeekColumns,
+} from "../surface/peek-context";
+import { IssuePeekHost } from "./issue-peek";
+
+vi.mock("@multica/core/paths", () => ({
+ useWorkspacePaths: () => ({ issueDetail: (id: string) => `/acme/issues/${id}` }),
+}));
+
+// The panel's job is hosting; IssueDetail itself is covered by its own suite.
+vi.mock("./issue-detail", () => ({
+ IssueDetail: ({
+ issueId,
+ variant,
+ leadingAction,
+ trailingActions,
+ onDelete,
+ }: {
+ issueId: string;
+ variant: string;
+ leadingAction: ReactNode;
+ trailingActions: ReactNode;
+ onDelete: () => void;
+ }) => {
+ if (issueId === "boom") throw new Error("Could not render this issue");
+ return (
+ <div data-testid="detail" data-variant={variant}>
+ {issueId}
+ {leadingAction}
+ {trailingActions}
+ <button type="button" onClick={onDelete}>
+ delete
+ </button>
+ </div>
+ );
+ },
+}));
+
+const navigation: NavigationAdapter = {
+ push: vi.fn(),
+ replace: vi.fn(),
+ back: vi.fn(),
+ pathname: "/acme/issues",
+ searchParams: new URLSearchParams(),
+ hash: "",
+ getShareableUrl: (path) => `https://app.example${path}`,
+};
+
+const COLUMNS: IssuePeekColumns = [["i-1", "i-2", "i-3"], ["i-4"]];
+
+/** Stands in for the board: publishes columns and renders peekable cards. */
+function FakeBoard({ columns = COLUMNS }: { columns?: IssuePeekColumns }) {
+ const peek = useIssuePeekActions();
+ useEffect(() => {
+ peek?.publishColumns(columns);
+ }, [peek, columns]);
+ // One container per column, like the board: moving a card between columns
+ // remounts its element.
+ return (
+ <>
+ {columns.map((column, c) => (
+ <div key={c}>
+ {column.map((id) => (
+ <FakeCard key={id} id={id} />
+ ))}
+ </div>
+ ))}
+ </>
+ );
+}
+
+function FakeCard({ id }: { id: string }) {
+ const peek = useIssuePeekActions();
+ const peeked = useIsIssuePeeked(id);
+ return (
+ <button
+ type="button"
+ data-peek-target={id}
+ data-peeked={peeked ? "" : undefined}
+ onClick={() => peek?.toggle(id)}
+ >
+ {`card ${id}`}
+ </button>
+ );
+}
+
+function renderHost(columns: IssuePeekColumns = COLUMNS) {
+ const ui = (cols: IssuePeekColumns) => (
+ <NavigationProvider value={navigation}>
+ <IssuePeekHost>
+ <FakeBoard columns={cols} />
+ </IssuePeekHost>
+ </NavigationProvider>
+ );
+ const result = renderWithI18n(ui(columns));
+ return { ...result, setColumns: (cols: IssuePeekColumns) => result.rerender(ui(cols)) };
+}
+
+const panel = () => screen.queryByRole("complementary", { name: "Issue preview" });
+// Closing plays a short exit animation before the panel unmounts.
+const waitForClosed = () => waitFor(() => expect(panel()).toBeNull());
+const openCard = (id: string) => fireEvent.click(screen.getByText(`card ${id}`));
+
+describe("IssuePeekHost", () => {
+ beforeEach(() => vi.clearAllMocks());
+
+ it("opens the peeked issue as a peek-variant detail and marks its card", () => {
+ renderHost();
+ expect(panel()).toBeNull();
+
+ openCard("i-2");
+
+ expect(panel()).not.toBeNull();
+ expect(screen.getByTestId("detail")).toHaveAttribute("data-variant", "peek");
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-2");
+ expect(screen.getByText("card i-2")).toHaveAttribute("data-peeked");
+ expect(screen.getByText("card i-1")).not.toHaveAttribute("data-peeked");
+ });
+
+ it("switches to another card, and closes when the peeked card is toggled again", async () => {
+ renderHost();
+ openCard("i-1");
+ openCard("i-4");
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-4");
+
+ openCard("i-4");
+ await waitForClosed();
+ });
+
+ it("shows the position in the column and steps with J / K", () => {
+ renderHost();
+ openCard("i-2");
+ expect(panel()).toHaveTextContent("2 / 3");
+
+ fireEvent.keyDown(document.body, { key: "j" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-3");
+ expect(panel()).toHaveTextContent("3 / 3");
+ // Past the end of the column J does nothing.
+ fireEvent.keyDown(document.body, { key: "j" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-3");
+
+ fireEvent.keyDown(document.body, { key: "k" });
+ fireEvent.keyDown(document.body, { key: "k" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-1");
+ });
+
+ it("disables the step buttons at the ends of the column", () => {
+ renderHost();
+ openCard("i-1");
+ expect(screen.getByRole("button", { name: "Previous issue" })).toBeDisabled();
+ fireEvent.click(screen.getByRole("button", { name: "Next issue" }));
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-2");
+ });
+
+ it("closes on Escape, but not while typing or inside a popup", async () => {
+ renderHost();
+ openCard("i-1");
+
+ const input = document.createElement("input");
+ document.body.appendChild(input);
+ fireEvent.keyDown(input, { key: "Escape" });
+ expect(panel()).not.toBeNull();
+
+ const menu = document.createElement("div");
+ menu.setAttribute("role", "menu");
+ document.body.appendChild(menu);
+ fireEvent.keyDown(menu, { key: "Escape" });
+ expect(panel()).not.toBeNull();
+
+ fireEvent.keyDown(document.body, { key: "Escape" });
+ await waitForClosed();
+
+ input.remove();
+ menu.remove();
+ });
+
+ it("ignores J / K typed into an editor", () => {
+ renderHost();
+ openCard("i-1");
+ const editor = document.createElement("div");
+ editor.setAttribute("contenteditable", "true");
+ document.body.appendChild(editor);
+ fireEvent.keyDown(editor, { key: "j" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-1");
+ editor.remove();
+ });
+
+ it("closes from the close button and when the issue is deleted", async () => {
+ renderHost();
+ openCard("i-1");
+ fireEvent.click(screen.getByRole("button", { name: "Close preview" }));
+ await waitForClosed();
+
+ openCard("i-1");
+ fireEvent.click(screen.getByRole("button", { name: "delete" }));
+ await waitForClosed();
+ });
+
+ it("links to the full issue page", () => {
+ renderHost();
+ openCard("i-3");
+ expect(screen.getByRole("link", { name: "Open full page" })).toHaveAttribute(
+ "href",
+ "/acme/issues/i-3",
+ );
+ });
+
+ it("stays open when the view changes, stepping in the new view's order", () => {
+ const { setColumns } = renderHost();
+ openCard("i-2");
+ // e.g. board → list: one column in display order.
+ act(() => setColumns([["i-4", "i-2", "i-1", "i-3"]]));
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-2");
+ expect(panel()).toHaveTextContent("2 / 4");
+ fireEvent.keyDown(document.body, { key: "j" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-1");
+ });
+
+ it("brings the peeked card back into view when it moves to another column", () => {
+ const scrollIntoView = vi.fn();
+ const original = Element.prototype.scrollIntoView;
+ Element.prototype.scrollIntoView = scrollIntoView;
+ try {
+ // i-4 is alone in its column; the column to its right is empty.
+ const { setColumns } = renderHost([["i-1", "i-2", "i-3"], ["i-4"], []]);
+ openCard("i-4");
+ expect(scrollIntoView.mock.contexts.at(-1)).toBe(screen.getByText("card i-4"));
+
+ // Its status changes: it lands alone in the empty column. Its neighbours
+ // (none on either side) are unchanged, but its element is a new one.
+ scrollIntoView.mockClear();
+ act(() => setColumns([["i-1", "i-2", "i-3"], [], ["i-4"]]));
+ expect(scrollIntoView).toHaveBeenCalledTimes(1);
+ expect(scrollIntoView.mock.contexts[0]).toBe(screen.getByText("card i-4"));
+
+ // A reorder elsewhere leaves its element in place: no scroll.
+ scrollIntoView.mockClear();
+ act(() => setColumns([["i-3", "i-2", "i-1"], [], ["i-4"]]));
+ expect(scrollIntoView).not.toHaveBeenCalled();
+ } finally {
+ Element.prototype.scrollIntoView = original;
+ }
+ });
+
+ it("keeps a way to close the panel when the issue fails to render", async () => {
+ vi.spyOn(console, "error").mockImplementation(() => {});
+ renderHost([["i-1", "boom"]]);
+ openCard("boom");
+ expect(panel()).toHaveTextContent("Could not render this issue");
+ fireEvent.click(screen.getByRole("button", { name: "Close preview" }));
+ await waitForClosed();
+ vi.mocked(console.error).mockRestore();
+ });
+
+ it("steps across columns with H / L, keeping the row where it can", () => {
+ renderHost([["a1", "a2", "a3"], [], ["c1"], ["d1", "d2", "d3"]]);
+ openCard("a3");
+ // The empty column is skipped; the short one clamps to its last card.
+ fireEvent.keyDown(document.body, { key: "l" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("c1");
+ fireEvent.keyDown(document.body, { key: "l" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("d1");
+ fireEvent.keyDown(document.body, { key: "j" });
+ fireEvent.keyDown(document.body, { key: "h" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("c1");
+ fireEvent.keyDown(document.body, { key: "h" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("a1");
+ });
+
+ it("steps with the arrow keys, unless the reader clicked into the panel", () => {
+ renderHost();
+ openCard("i-1");
+ expect(fireEvent.keyDown(document.body, { key: "ArrowDown" })).toBe(false);
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-2");
+ fireEvent.keyDown(document.body, { key: "ArrowRight" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-4");
+ fireEvent.keyDown(document.body, { key: "ArrowLeft" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-1");
+
+ // After a click inside the panel the arrows scroll it instead.
+ fireEvent.pointerDown(screen.getByTestId("detail"));
+ expect(fireEvent.keyDown(document.body, { key: "ArrowDown" })).toBe(true);
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-1");
+ // J still steps, and a click back on the view hands the arrows back.
+ fireEvent.keyDown(document.body, { key: "j" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-2");
+ fireEvent.pointerDown(screen.getByText("card i-4"));
+ fireEvent.keyDown(document.body, { key: "ArrowDown" });
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-3");
+ });
+
+ it("peeks the card under the pointer on Space, and closes it on a second Space", async () => {
+ renderHost();
+ fireEvent.pointerOver(screen.getByText("card i-3"));
+ expect(fireEvent.keyDown(document.body, { key: " " })).toBe(false);
+ expect(screen.getByTestId("detail")).toHaveTextContent("i-3");
+
+ fireEvent.keyDown(document.body, { key: " " });
+ await waitForClosed();
+ });
+
+ it("leaves Space alone with no card under the pointer, or a control focused", () => {
+ renderHost();
+ fireEvent.keyDown(document.body, { key: " " });
+ expect(panel()).toBeNull();
+
+ // Focus on a control keeps Space for that control, even over a card.
+ fireEvent.pointerOver(screen.getByText("card i-3"));
+ const button = document.createElement("button");
+ document.body.appendChild(button);
+ expect(fireEvent.keyDown(button, { key: " " })).toBe(true);
+ expect(panel()).toBeNull();
+ button.remove();
+
+ // Leaving the view forgets the hovered card.
+ // (FakeBoard renders its cards straight into the host wrapper.)
+ fireEvent.pointerLeave(screen.getByText("card i-3").parentElement!);
+ fireEvent.keyDown(document.body, { key: " " });
+ expect(panel()).toBeNull();
+ });
+});
diff --git a/packages/views/issues/components/issue-peek.tsx b/packages/views/issues/components/issue-peek.tsx
new file mode 100644
index 0000000000..685ffdbfa5
--- /dev/null
+++ b/packages/views/issues/components/issue-peek.tsx
@@ -0,0 +1,392 @@
+"use client";
+
+import { memo, useEffect, useMemo, useRef, useState, type ReactNode, type RefObject } from "react";
+import { AnimatePresence, motion, useIsPresent, useReducedMotion } from "motion/react";
+import { ChevronDown, ChevronUp, Maximize2, X } from "lucide-react";
+import { Button, buttonVariants } from "@multica/ui/components/ui/button";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from "@multica/ui/components/ui/tooltip";
+import { ErrorBoundary } from "@multica/ui/components/common/error-boundary";
+import { cn } from "@multica/ui/lib/utils";
+import { UI_EASE_OUT, UI_MOTION_DURATION } from "@multica/ui/lib/motion";
+import { useModalStore } from "@multica/core/modals";
+import { useWorkspacePaths } from "@multica/core/paths";
+import {
+ createShortcutChord,
+ isEditableShortcutTarget,
+ isPortalLayerShortcutTarget,
+} from "@multica/core/shortcuts";
+import { isImeComposing } from "@multica/core/utils";
+import { AppLink } from "../../navigation";
+import { PAGE_GUTTER } from "../../layout/page-header";
+import { ShortcutKeycaps } from "../../common/shortcut-keycaps";
+import { useT } from "../../i18n";
+import { IssueDetail } from "./issue-detail";
+import {
+ IssuePeekActionsContext,
+ IssuePeekIdContext,
+ IssuePeekPositionContext,
+ PEEK_TARGET_ATTR,
+ locateInColumns,
+ useIssuePeekActions,
+ useIssuePeekPosition,
+ type IssuePeekActions,
+ type IssuePeekColumns,
+} from "../surface/peek-context";
+
+const NEXT_KEY = createShortcutChord("J");
+const PREV_KEY = createShortcutChord("K");
+const CLOSE_KEY = createShortcutChord("Escape");
+
+type Step = "prevId" | "nextId" | "leftId" | "rightId";
+// Vim keys work wherever focus is not in a text field; the arrows mirror them
+// unless the panel is being read (see IssuePeekFollow).
+const LETTER_STEPS: Record<string, Step> = { K: "prevId", J: "nextId", H: "leftId", L: "rightId" };
+const ARROW_STEPS: Record<string, Step> = {
+ ArrowUp: "prevId",
+ ArrowDown: "nextId",
+ ArrowLeft: "leftId",
+ ArrowRight: "rightId",
+};
+
+/**
+ * Owns the surface's side peek: which issue is open, the current view's order
+ * for keyboard stepping, and the floating panel itself. Wraps the surface
+ * content so the panel can position against it — it floats over the view,
+ * below the page header and toolbar, which stay usable while it is open.
+ *
+ * Every view hosts it, so switching views keeps the peeked issue open; the new
+ * view publishes its own order.
+ *
+ * Besides a focused card's own Space (see DraggableBoardCard), Space peeks the
+ * issue under the pointer, so mouse users need not Tab to it first.
+ */
+export function IssuePeekHost({ children }: { children: ReactNode }) {
+ const [peekId, setPeekId] = useState<string | null>(null);
+ const [columns, setColumns] = useState<IssuePeekColumns | null>(null);
+
+ const actions = useMemo<IssuePeekActions>(
+ () => ({
+ open: (issueId) => setPeekId(issueId),
+ toggle: (issueId) => setPeekId((current) => (current === issueId ? null : issueId)),
+ close: () => setPeekId(null),
+ publishColumns: setColumns,
+ }),
+ [],
+ );
+ const openId = peekId;
+ const position = useMemo(() => locateInColumns(columns, openId), [columns, openId]);
+
+ // Tracked from pointer events rather than queried with `:hover`, so the
+ // card under a stationary pointer is known without a layout read.
+ const hoveredCardRef = useRef<string | null>(null);
+ useEffect(() => {
+ const onKeyDown = (event: KeyboardEvent) => {
+ if (event.key !== " " || event.defaultPrevented || event.repeat || isImeComposing(event)) return;
+ if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
+ // A focused control keeps its own Space: buttons press, inputs type.
+ if (isEditableShortcutTarget(event.target) || isControlTarget(event.target)) return;
+ if (isPortalLayerShortcutTarget(event.target)) return;
+ if (useModalStore.getState().modal) return;
+ const hovered = hoveredCardRef.current;
+ if (!hovered) return;
+ event.preventDefault();
+ actions.toggle(hovered);
+ };
+ document.addEventListener("keydown", onKeyDown);
+ return () => document.removeEventListener("keydown", onKeyDown);
+ }, [actions]);
+
+ return (
+ <IssuePeekActionsContext.Provider value={actions}>
+ <IssuePeekIdContext.Provider value={openId}>
+ <IssuePeekPositionContext.Provider value={position}>
+ <div
+ data-peek-open={openId ? "" : undefined}
+ className="group/peek relative flex min-h-0 flex-1 flex-col [--issue-peek-width:520px]"
+ onPointerOver={(event) => {
+ hoveredCardRef.current =
+ (event.target as Element).closest(`[${PEEK_TARGET_ATTR}]`)?.getAttribute(PEEK_TARGET_ATTR) ||
+ null;
+ }}
+ onPointerLeave={() => {
+ hoveredCardRef.current = null;
+ }}
+ >
+ {children}
+ {/* One stable key: switching issues swaps the content in place
+ (J / K is keyboard navigation — it must not animate); only
+ opening and closing the panel does. */}
+ <AnimatePresence initial={false}>
+ {openId && <IssuePeekPanel key="issue-peek" issueId={openId} />}
+ </AnimatePresence>
+ </div>
+ </IssuePeekPositionContext.Provider>
+ </IssuePeekIdContext.Provider>
+ </IssuePeekActionsContext.Provider>
+ );
+}
+
+// Memoized, and blind to the column order: the host re-renders on every board
+// reorder (a drag publishes columns on each hover), and none of that may reach
+// IssueDetail. What does follow the order lives in IssuePeekFollow.
+const IssuePeekPanel = memo(function IssuePeekPanel({ issueId }: { issueId: string }) {
+ const { t } = useT("issues");
+ const actions = useIssuePeekActions()!;
+ const panelRef = useRef<HTMLElement>(null);
+ // False while the exit animation plays: the closing panel no longer takes
+ // clicks or keys, so the board is usable the moment the peek is dismissed.
+ const isPresent = useIsPresent();
+ const reduceMotion = useReducedMotion() ?? false;
+
+ return (
+ <motion.aside
+ ref={panelRef}
+ aria-label={t(($) => $.peek.panel_label)}
+ data-issue-peek=""
+ className={cn(
+ "absolute right-2 top-2 z-30 flex w-[min(var(--issue-peek-width),calc(100%-1rem))] flex-col overflow-hidden",
+ "rounded-xl bg-background shadow-[var(--floating-shadow)] ring-1 ring-surface-border",
+ // Stops above the chat launcher, which owns the dashboard's
+ // bottom-right corner — the panel's composer would sit under it.
+ "above-chat-launcher",
+ !isPresent && "pointer-events-none",
+ )}
+ // Slides in from the edge it is anchored to; the exit is shorter and
+ // travels half as far. Reduced motion keeps only the fade.
+ initial={{ opacity: 0, transform: reduceMotion ? "translateX(0)" : "translateX(16px)" }}
+ animate={{
+ opacity: 1,
+ transform: "translateX(0)",
+ transition: { duration: UI_MOTION_DURATION.standard, ease: UI_EASE_OUT },
+ }}
+ exit={{
+ opacity: 0,
+ transform: reduceMotion ? "translateX(0)" : "translateX(8px)",
+ transition: { duration: UI_MOTION_DURATION.fast, ease: UI_EASE_OUT },
+ }}
+ >
+ {isPresent && <IssuePeekFollow issueId={issueId} panelRef={panelRef} />}
+ <ErrorBoundary
+ resetKeys={[issueId]}
+ // The default fallback is a bare message card; here it would be a
+ // panel with no way to close it but Esc.
+ fallback={({ error }) => (
+ <div className="flex flex-1 min-h-0 flex-col">
+ <div className={cn("flex h-12 shrink-0 items-center justify-end gap-1 border-b", PAGE_GUTTER)}>
+ <IssuePeekTrailingActions issueId={issueId} />
+ </div>
+ <div className="flex flex-1 min-h-0 items-center justify-center px-4 text-center text-body text-muted-foreground">
+ {error.message}
+ </div>
+ </div>
+ )}
+ >
+ <IssueDetail
+ key={issueId}
+ issueId={issueId}
+ variant="peek"
+ defaultSidebarOpen={false}
+ leadingAction={<IssuePeekNav />}
+ trailingActions={<IssuePeekTrailingActions issueId={issueId} />}
+ onDelete={actions.close}
+ />
+ </ErrorBoundary>
+ </motion.aside>
+ );
+});
+
+/** The panel's keyboard (Esc, J / K / H / L, arrows) and keeping the peeked issue in view. */
+function IssuePeekFollow({
+ issueId,
+ panelRef,
+}: {
+ issueId: string;
+ panelRef: RefObject<HTMLElement | null>;
+}) {
+ const actions = useIssuePeekActions()!;
+ const position = useIssuePeekPosition();
+ const reduceMotion = useReducedMotion() ?? false;
+
+ // Read through a ref so the listener is bound once, not on every step.
+ const positionRef = useRef(position);
+ positionRef.current = position;
+
+ useEffect(() => {
+ // Whether the reader's last click landed in the panel. Clicking panel text
+ // moves no focus, so this — not the key's target — is what says the arrows
+ // should scroll the panel rather than step through the view.
+ let readingPanel = false;
+ const onPointerDown = (event: PointerEvent) => {
+ readingPanel = !!panelRef.current?.contains(event.target as Node);
+ };
+ const onKeyDown = (event: KeyboardEvent) => {
+ if (event.defaultPrevented || event.repeat || isImeComposing(event)) return;
+ if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
+ if (isEditableShortcutTarget(event.target)) return;
+ if (isPortalLayerShortcutTarget(event.target)) return;
+ if (useModalStore.getState().modal) return;
+
+ if (event.key === "Escape") {
+ event.preventDefault();
+ actions.close();
+ return;
+ }
+ let step = LETTER_STEPS[event.key.toUpperCase()];
+ if (!step && event.key in ARROW_STEPS) {
+ const inPanel =
+ readingPanel || !!panelRef.current?.contains(event.target as Node);
+ // Composite widgets (tabs, radios, sliders) own their arrow keys.
+ if (inPanel || isArrowWidgetTarget(event.target)) return;
+ step = ARROW_STEPS[event.key];
+ }
+ const target = step ? positionRef.current?.[step] : null;
+ if (!target) return;
+ event.preventDefault();
+ actions.open(target);
+ };
+ document.addEventListener("pointerdown", onPointerDown, true);
+ document.addEventListener("keydown", onKeyDown);
+ return () => {
+ document.removeEventListener("pointerdown", onPointerDown, true);
+ document.removeEventListener("keydown", onKeyDown);
+ };
+ }, [actions, panelRef]);
+
+ // Keep the peeked issue in sight: scroll it into its column, then scroll the
+ // board sideways if the panel covers it (the board reserves room for this
+ // while a peek is open — see BoardView).
+ //
+ // Checked on every order change, but acted on only when the element standing
+ // for the issue is a new one: another issue, the same card remounted in
+ // another column (an edit made here moved it), or another view. Reorders
+ // that leave the element in place never scroll, so a reader who scrolled
+ // the peeked card away is not pulled back by an unrelated update.
+ const revealedRef = useRef<HTMLElement | null>(null);
+ useEffect(() => {
+ const panel = panelRef.current;
+ const host = panel?.parentElement;
+ if (!panel || !host) return;
+ const card = host.querySelector<HTMLElement>(
+ `[${PEEK_TARGET_ATTR}="${CSS.escape(issueId)}"]`,
+ );
+ if (!card || card === revealedRef.current) return;
+ revealedRef.current = card;
+ card.scrollIntoView?.({ block: "nearest", inline: "nearest" });
+ const scroller = card.closest<HTMLElement>("[data-board-scroller]");
+ // offsetLeft, not the panel's rect: on the first frame the rect is still
+ // shifted by the slide-in animation.
+ const panelLeft = host.getBoundingClientRect().left + panel.offsetLeft;
+ const covered = card.getBoundingClientRect().right - (panelLeft - 16);
+ if (scroller && covered > 0) {
+ scroller.scrollBy?.({ left: covered, behavior: reduceMotion ? "auto" : "smooth" });
+ }
+ }, [issueId, position, panelRef, reduceMotion]);
+
+ return null;
+}
+
+function isArrowWidgetTarget(target: EventTarget | null) {
+ return (
+ target instanceof Element &&
+ target.closest("[role='tab'], [role='radio'], [role='slider'], [role='spinbutton'], select") !== null
+ );
+}
+
+/** A focused control whose own Space must win over the hovered-card peek. */
+function isControlTarget(target: EventTarget | null) {
+ return (
+ target instanceof Element &&
+ target.closest("a, button, select, summary, [role='button'], [role='menuitem'], [role='option'], [role='tab']") !== null
+ );
+}
+
+/** Previous / next card in the peeked issue's board column. */
+function IssuePeekNav() {
+ const { t } = useT("issues");
+ const actions = useIssuePeekActions()!;
+ const position = useIssuePeekPosition();
+ const steps = [
+ { label: t(($) => $.peek.previous), shortcut: PREV_KEY, icon: ChevronUp, target: position?.prevId },
+ { label: t(($) => $.peek.next), shortcut: NEXT_KEY, icon: ChevronDown, target: position?.nextId },
+ ];
+
+ return (
+ <div className="flex shrink-0 items-center">
+ {steps.map(({ label, shortcut, icon: Icon, target }) => (
+ <Tooltip key={shortcut.key}>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ className="text-muted-foreground"
+ aria-label={label}
+ disabled={!target}
+ onClick={() => target && actions.open(target)}
+ >
+ <Icon />
+ </Button>
+ }
+ />
+ <TooltipContent side="bottom">
+ {label}
+ <ShortcutKeycaps shortcut={shortcut} decorative className="ml-1.5" />
+ </TooltipContent>
+ </Tooltip>
+ ))}
+ {position && (
+ <span className="ml-1 text-caption tabular-nums text-muted-foreground">
+ {`${position.index} / ${position.total}`}
+ </span>
+ )}
+ </div>
+ );
+}
+
+function IssuePeekTrailingActions({ issueId }: { issueId: string }) {
+ const { t } = useT("issues");
+ const actions = useIssuePeekActions()!;
+ const paths = useWorkspacePaths();
+
+ return (
+ <>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <AppLink
+ href={paths.issueDetail(issueId)}
+ aria-label={t(($) => $.peek.open_full_page)}
+ className={cn(buttonVariants({ variant: "ghost", size: "icon-sm" }), "text-muted-foreground")}
+ />
+ }
+ >
+ <Maximize2 />
+ </TooltipTrigger>
+ <TooltipContent side="bottom">{t(($) => $.peek.open_full_page)}</TooltipContent>
+ </Tooltip>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ className="text-muted-foreground"
+ aria-label={t(($) => $.peek.close)}
+ onClick={actions.close}
+ />
+ }
+ >
+ <X />
+ </TooltipTrigger>
+ <TooltipContent side="bottom">
+ {t(($) => $.peek.close)}
+ <ShortcutKeycaps shortcut={CLOSE_KEY} decorative className="ml-1.5" />
+ </TooltipContent>
+ </Tooltip>
+ </>
+ );
+}
diff --git a/packages/views/issues/components/issue-property-pills.tsx b/packages/views/issues/components/issue-property-pills.tsx
new file mode 100644
index 0000000000..3a960bfe4a
--- /dev/null
+++ b/packages/views/issues/components/issue-property-pills.tsx
@@ -0,0 +1,80 @@
+"use client";
+
+import type { Issue, UpdateIssueRequest } from "@multica/core/types";
+import { PillButton } from "../../common/pill-button";
+import { ProjectPicker } from "../../projects/components/project-picker";
+import {
+ AssigneePicker,
+ DueDatePicker,
+ LabelPicker,
+ PriorityPicker,
+ StartDatePicker,
+ StatusPicker,
+} from "./pickers";
+
+/**
+ * The issue's core properties as one wrapping row of pills, each opening the
+ * same picker the detail sidebar uses. Used where there is no room for the
+ * sidebar — the board's side peek — so triage stays one click per field.
+ *
+ * Start date is shown only once set: it is the least-used field, and an empty
+ * pill for it would push the rest onto a second line. Custom properties stay
+ * on the full page.
+ */
+export function IssuePropertyPills({
+ issue,
+ onUpdate,
+ onMarkDuplicate,
+ isDuplicate,
+}: {
+ issue: Issue;
+ onUpdate: (updates: Partial<UpdateIssueRequest>) => void;
+ onMarkDuplicate?: () => void;
+ isDuplicate?: boolean;
+}) {
+ return (
+ <div className="flex flex-wrap items-center gap-1.5">
+ <StatusPicker
+ status={issue.status}
+ onUpdate={onUpdate}
+ triggerRender={<PillButton />}
+ align="start"
+ onMarkDuplicate={onMarkDuplicate}
+ isDuplicate={isDuplicate}
+ />
+ <PriorityPicker
+ priority={issue.priority}
+ onUpdate={onUpdate}
+ triggerRender={<PillButton />}
+ align="start"
+ />
+ <AssigneePicker
+ assigneeType={issue.assignee_type}
+ assigneeId={issue.assignee_id}
+ onUpdate={onUpdate}
+ triggerRender={<PillButton />}
+ align="start"
+ />
+ <ProjectPicker
+ projectId={issue.project_id}
+ onUpdate={onUpdate}
+ triggerRender={<PillButton />}
+ />
+ {issue.start_date && (
+ <StartDatePicker
+ startDate={issue.start_date}
+ onUpdate={onUpdate}
+ triggerRender={<PillButton />}
+ align="start"
+ />
+ )}
+ <DueDatePicker
+ dueDate={issue.due_date}
+ onUpdate={onUpdate}
+ triggerRender={<PillButton />}
+ align="start"
+ />
+ <LabelPicker issueId={issue.id} triggerRender={<PillButton />} align="start" />
+ </div>
+ );
+}
diff --git a/packages/views/issues/components/list-row-peek.test.tsx b/packages/views/issues/components/list-row-peek.test.tsx
new file mode 100644
index 0000000000..a95f22afb5
--- /dev/null
+++ b/packages/views/issues/components/list-row-peek.test.tsx
@@ -0,0 +1,121 @@
+import { useIssueOpeningStore } from "@multica/core/issues/stores/issue-opening-store";
+import { fireEvent, render, screen } from "@testing-library/react";
+import type { ReactNode } from "react";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+import type { Issue } from "@multica/core/types";
+import { NavigationProvider, type NavigationAdapter } from "../../navigation";
+import {
+ IssuePeekActionsContext,
+ IssuePeekIdContext,
+ type IssuePeekActions,
+} from "../surface/peek-context";
+import { ListRow } from "./list-row";
+
+vi.mock("@tanstack/react-query", async (importOriginal) => ({
+ ...(await importOriginal<typeof import("@tanstack/react-query")>()),
+ useQuery: () => ({ data: [] }),
+}));
+
+vi.mock("@multica/core/hooks", () => ({
+ useWorkspaceId: () => "ws-1",
+}));
+
+vi.mock("@multica/core/properties", () => ({
+ propertyListOptions: () => ({ queryKey: ["properties"] }),
+}));
+
+vi.mock("@multica/core/paths", () => ({
+ useWorkspacePaths: () => ({ issueDetail: (id: string) => `/acme/issues/${id}` }),
+}));
+
+vi.mock("@multica/core/issues/stores/view-store-context", () => ({
+ useViewStore: (selector: (state: unknown) => unknown) =>
+ selector({ cardProperties: {}, cardPropertyIds: [] }),
+}));
+
+vi.mock("../../i18n", () => ({
+ useLocale: () => "en",
+ useT: () => ({ t: () => "Translated" }),
+}));
+
+vi.mock("../actions", () => ({
+ IssueActionsContextMenu: ({ children }: { children: ReactNode }) => children,
+}));
+
+vi.mock("./issue-agent-activity-indicator", () => ({
+ IssueAgentActivityIndicator: () => null,
+}));
+
+vi.mock("./custom-status-chip", () => ({
+ CustomStatusChip: () => null,
+}));
+
+const navigation: NavigationAdapter = {
+ push: vi.fn(),
+ replace: vi.fn(),
+ back: vi.fn(),
+ pathname: "/acme/issues",
+ searchParams: new URLSearchParams(),
+ hash: "",
+ getShareableUrl: (path) => `https://app.example${path}`,
+};
+
+const peek: IssuePeekActions = {
+ open: vi.fn(),
+ toggle: vi.fn(),
+ close: vi.fn(),
+ publishColumns: vi.fn(),
+};
+
+const issue = {
+ id: "issue-1",
+ identifier: "MUL-1",
+ title: "Peekable row",
+ status: "todo",
+ priority: "none",
+ labels: [],
+ properties: {},
+} as unknown as Issue;
+
+function renderRow(peekedId: string | null = null) {
+ return render(
+ <NavigationProvider value={navigation}>
+ <IssuePeekActionsContext.Provider value={peek}>
+ <IssuePeekIdContext.Provider value={peekedId}>
+ <ListRow issue={issue} />
+ </IssuePeekIdContext.Provider>
+ </IssuePeekActionsContext.Provider>
+ </NavigationProvider>,
+ );
+}
+
+describe("ListRow side peek", () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ useIssueOpeningStore.setState({ openMode: "page" });
+ });
+
+ it("opens the peek on Shift+Click and still navigates on a plain click", () => {
+ renderRow();
+ expect(fireEvent.click(screen.getByRole("link"), { shiftKey: true })).toBe(false);
+ expect(peek.toggle).toHaveBeenCalledWith("issue-1");
+ expect(navigation.push).not.toHaveBeenCalled();
+
+ fireEvent.click(screen.getByRole("link"));
+ expect(navigation.push).toHaveBeenCalledWith("/acme/issues/issue-1");
+ });
+
+ it("opens on a plain click when side preview is preferred", () => {
+ useIssueOpeningStore.getState().setOpenMode("peek");
+ renderRow();
+ fireEvent.click(screen.getByRole("link"));
+ expect(peek.open).toHaveBeenCalledWith("issue-1");
+ expect(navigation.push).not.toHaveBeenCalled();
+ });
+
+ it("marks the peeked row as the peek target", () => {
+ const { container } = renderRow("issue-1");
+ const row = container.querySelector('[data-peek-target="issue-1"]');
+ expect(row).toHaveAttribute("data-peeked");
+ });
+});
diff --git a/packages/views/issues/components/list-row.tsx b/packages/views/issues/components/list-row.tsx
index 1e23b9e03d..9b146c4abe 100644
--- a/packages/views/issues/components/list-row.tsx
+++ b/packages/views/issues/components/list-row.tsx
@@ -26,6 +26,12 @@ import { CustomStatusChip } from "./custom-status-chip";
import { IssueDuplicateOfMarker } from "./issue-duplicates";
import { IssueAgentActivityIndicator } from "./issue-agent-activity-indicator";
import { useIssueSurfaceSelection } from "../surface/selection-context";
+import {
+ PEEKED_ROW_CLASS,
+ PEEK_TARGET_ATTR,
+ useIsIssuePeeked,
+ useIssuePeekLinkProps,
+} from "../surface/peek-context";
import { useLocale } from "../../i18n";
export interface ChildProgress {
@@ -58,6 +64,8 @@ function ListRowContent({
}) {
const locale = useLocale();
const selection = useIssueSurfaceSelection();
+ const peeked = useIsIssuePeeked(issue.id);
+ const peekLinkProps = useIssuePeekLinkProps(issue.id);
const selected = selection.selectedIds.has(issue.id);
const toggle = selection.toggle;
const p = useWorkspacePaths();
@@ -82,13 +90,15 @@ function ListRowContent({
<div
ref={containerRef}
data-slot="issue-list-row"
+ {...{ [PEEK_TARGET_ATTR]: issue.id }}
+ data-peeked={peeked ? "" : undefined}
style={containerStyle}
{...containerProps}
className={`group/row flex h-[var(--issue-row-height)] items-center gap-2 px-4 text-body transition-colors ${
selected
? "bg-surface-selected hover:not-data-[popup-open]:bg-surface-selected data-[popup-open]:bg-surface-selected"
: "hover:not-data-[popup-open]:bg-surface-hover data-[popup-open]:bg-surface-hover"
- } ${isDragging ? "opacity-30" : ""}`}
+ } ${PEEKED_ROW_CLASS} ${isDragging ? "opacity-30" : ""}`}
>
<div
className="relative flex shrink-0 items-center justify-center w-4 h-4"
@@ -113,6 +123,7 @@ function ListRowContent({
href={p.issueDetail(issue.id)}
newTabTitle={issue.identifier}
className={`flex flex-1 items-center gap-2 min-w-0 ${isDragging ? "pointer-events-none" : ""}`}
+ {...peekLinkProps}
>
<span className="min-w-16 shrink-0 text-caption text-muted-foreground">
{issue.identifier}
diff --git a/packages/views/issues/components/list-view.tsx b/packages/views/issues/components/list-view.tsx
index 21cfa2dfca..caa014085b 100644
--- a/packages/views/issues/components/list-view.tsx
+++ b/packages/views/issues/components/list-view.tsx
@@ -41,6 +41,7 @@ import {
} from "../utils/drag-utils";
import type { BoardColumnGroup } from "./board-column";
import { useIssueSurfaceSelection } from "../surface/selection-context";
+import { useIssuePeekActions } from "../surface/peek-context";
import type { IssueCreateDefaults } from "../surface/types";
import type {
IssueStatusPageState,
@@ -119,6 +120,9 @@ function ListViewImpl({
const dragEnabled = !!onMoveIssue;
+ // Side peek steps through the list top to bottom, skipping collapsed groups.
+ const peek = useIssuePeekActions();
+
const groups = useMemo(
() => buildListGroups(visibleStatuses),
[visibleStatuses],
@@ -164,6 +168,13 @@ function ListViewImpl({
issueMapRef.current = issueMap;
}
+ useEffect(() => {
+ peek?.publishColumns([
+ expandedStatuses.flatMap((status) => columns[statusGroupId(status)] ?? EMPTY_IDS),
+ ]);
+ }, [peek, expandedStatuses, columns]);
+ useEffect(() => () => peek?.publishColumns(null), [peek]);
+
const collisionDetection = useMemo(
() => makeKanbanCollision(groupIds),
[groupIds],
diff --git a/packages/views/issues/components/swimlane-view.tsx b/packages/views/issues/components/swimlane-view.tsx
index 8696237c1a..b7960edf05 100644
--- a/packages/views/issues/components/swimlane-view.tsx
+++ b/packages/views/issues/components/swimlane-view.tsx
@@ -5,6 +5,8 @@ import {
statusColumnKeys,
} from "@multica/core/issues";
import { memo, useState, useCallback, useMemo, useEffect, useRef } from "react";
+import { cn } from "@multica/ui/lib/utils";
+import { useIssuePeekActions } from "../surface/peek-context";
import {
DndContext,
DragOverlay,
@@ -1032,6 +1034,21 @@ function SwimLaneViewImpl({
return () => cancelAnimationFrame(id);
}, [localCells]);
+ // Side peek: a status column runs down through every expanded lane, so J / K
+ // cross lane boundaries the way the eye reads the grid, and H / L change
+ // status.
+ const peek = useIssuePeekActions();
+ useEffect(() => {
+ peek?.publishColumns(
+ sortedStatuses.map((status) =>
+ laneGroups.flatMap((lane) =>
+ collapsedLanes.has(lane.key) ? [] : (localCells[lane.key]?.[status] ?? []),
+ ),
+ ),
+ );
+ }, [peek, sortedStatuses, laneGroups, collapsedLanes, localCells]);
+ useEffect(() => () => peek?.publishColumns(null), [peek]);
+
const collisionDetection = useMemo(
() => makeSwimLaneCollision(cellSet),
[cellSet],
@@ -1410,7 +1427,16 @@ function SwimLaneViewImpl({
onDragEnd={handleDragEnd}
onDragCancel={handleDragCancel}
>
- <div ref={attachScroller} data-tab-scroll-root="swimlane" className="flex flex-1 min-h-0 gap-4 overflow-auto p-4">
+ <div
+ ref={attachScroller}
+ data-tab-scroll-root="swimlane"
+ data-board-scroller=""
+ className={cn(
+ "flex flex-1 min-h-0 gap-4 overflow-auto p-4",
+ // Room to scroll the last status clear of an open side peek (see BoardView).
+ "group-data-[peek-open]/peek:after:w-(--issue-peek-width) group-data-[peek-open]/peek:after:shrink-0 group-data-[peek-open]/peek:after:content-['']",
+ )}
+ >
<div className="flex shrink-0 flex-col" style={{ width: `${trackWidth}px` }}>
{groupBranches?.isError && laneGroups.length === 0 && (
<button
diff --git a/packages/views/issues/components/table-view-editing.test.tsx b/packages/views/issues/components/table-view-editing.test.tsx
index c7a3b2fde4..7ee95e8023 100644
--- a/packages/views/issues/components/table-view-editing.test.tsx
+++ b/packages/views/issues/components/table-view-editing.test.tsx
@@ -8,6 +8,8 @@
* the column defs' render closures — flexRender treats those as component
* TYPES, so React remounted every cell and the just-opened picker closed.
*/
+import { useIssueOpeningStore } from "@multica/core/issues/stores/issue-opening-store";
+import { IssuePeekActionsContext } from "../surface/peek-context";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import {
act,
@@ -278,6 +280,7 @@ describe("TableView cell editors under data refresh", () => {
let queryClient: QueryClient;
beforeEach(() => {
+ useIssueOpeningStore.setState({ openMode: "page" });
navigationMocks.push.mockReset();
navigationMocks.openInNewTab.mockReset();
navigationMocks.getShareableUrl.mockReset();
@@ -431,6 +434,33 @@ describe("TableView cell editors under data refresh", () => {
});
});
+ it("uses the preferred peek for both titles and row space; Shift opens the full page instead", async () => {
+ useIssueOpeningStore.getState().setOpenMode("peek");
+ serverIssues = [makeIssue("a", "Alpha task", "todo")];
+ const peek = { open: vi.fn(), toggle: vi.fn(), close: vi.fn(), publishColumns: vi.fn() };
+ renderWithI18n(
+ <QueryClientProvider client={queryClient}>
+ <IssuePeekActionsContext.Provider value={peek}>
+ <Harness childProgressMap={new Map()} surfaceKey="test-preferred-peek" />
+ </IssuePeekActionsContext.Provider>
+ </QueryClientProvider>,
+ );
+ const row = (await screen.findByText("MUL-a")).closest("tr")!;
+ const title = within(row).getByRole("button", { name: "Alpha task" });
+ fireEvent.click(title);
+ fireEvent.click(row);
+ expect(peek.open).toHaveBeenCalledTimes(2);
+ expect(peek.open).toHaveBeenCalledWith("a");
+ expect(navigationMocks.push).not.toHaveBeenCalled();
+ // In preview mode Shift+Click opens the other target: the full page, in place.
+ fireEvent.click(title, { shiftKey: true });
+ expect(navigationMocks.push).toHaveBeenCalledWith("/test/issues/a");
+ expect(peek.toggle).not.toHaveBeenCalled();
+ fireEvent.click(row, { metaKey: true });
+ expect(navigationMocks.openInNewTab).toHaveBeenCalledWith("/test/issues/a", "MUL-a");
+ expect(peek.open).toHaveBeenCalledTimes(2);
+ });
+
it("navigates in place on plain title and row clicks; modifiers open tabs", async () => {
const user = userEvent.setup({ delay: null, pointerEventsCheck: 0 });
serverIssues = [makeIssue("a", "Alpha task", "todo")];
diff --git a/packages/views/issues/components/table-view.tsx b/packages/views/issues/components/table-view.tsx
index 0f6840fc6c..3badfbc229 100644
--- a/packages/views/issues/components/table-view.tsx
+++ b/packages/views/issues/components/table-view.tsx
@@ -128,6 +128,17 @@ import { ProjectPicker } from "../../projects/components/project-picker";
import { useT } from "../../i18n";
import { useIssueSurfaceActionsOptional } from "../surface/actions-context";
import { useIssueSurfaceSelection } from "../surface/selection-context";
+import {
+ PEEK_TARGET_ATTR,
+ useIssuePeekClick,
+ useIssuePeekActions,
+ useIssuePeekId,
+} from "../surface/peek-context";
+
+// A peeked table row: the same tint and leading bar as a peeked list row, on
+// the cells, because pinned cells paint an opaque background over the row.
+const PEEKED_TABLE_ROW_CLASS =
+ "[&>td]:bg-[color-mix(in_oklab,var(--brand)_6%,var(--background))] [&>td:first-child]:shadow-[inset_2px_0_0_var(--brand)]";
import type { IssueCreateDefaults } from "../surface/types";
import { ProgressRing } from "./progress-ring";
import {
@@ -2085,6 +2096,14 @@ export function TableView({
useEffect(() => {
onLoadedIssuesChange(loadedIssues);
}, [loadedIssues, onLoadedIssuesChange]);
+ // Side peek steps through the loaded rows top to bottom.
+ const peek = useIssuePeekActions();
+ const peekedId = useIssuePeekId();
+ const handlePeekClick = useIssuePeekClick();
+ useEffect(() => {
+ peek?.publishColumns([visibleIssueIds]);
+ }, [peek, visibleIssueIds]);
+ useEffect(() => () => peek?.publishColumns(null), [peek]);
const selectedIssues = useMemo(
() => loadedIssues.filter((issue) => selection.selectedIds.has(issue.id)),
[loadedIssues, selection.selectedIds],
@@ -2142,6 +2161,11 @@ export function TableView({
const openIssue = useCallback(
(issue: Issue, event?: React.MouseEvent) => {
+ // Match card links, including the preferred default and modifier keys.
+ if (handlePeekClick(issue.id, event)) {
+ if (event?.shiftKey) window.getSelection()?.removeAllRanges();
+ return;
+ }
// Standard link semantics: plain click navigates in place; modifier /
// middle clicks open tabs. Callbacks without an event (keyboard
// affordances) count as plain clicks.
@@ -2151,7 +2175,7 @@ export function TableView({
issue.identifier,
);
},
- [intentNavigate, paths],
+ [intentNavigate, paths, handlePeekClick],
);
const createSubIssue = useCallback(
@@ -2478,6 +2502,15 @@ export function TableView({
openIssue(row.original.issue, event);
}
}}
+ getRowProps={(row) =>
+ row.original.kind === "issue"
+ ? {
+ [PEEK_TARGET_ATTR]: row.original.issue.id,
+ className:
+ row.original.issue.id === peekedId ? PEEKED_TABLE_ROW_CLASS : undefined,
+ }
+ : undefined
+ }
renderRow={(row) => {
if (row.original.kind === "group") {
return (
diff --git a/packages/views/issues/surface/issue-surface.tsx b/packages/views/issues/surface/issue-surface.tsx
index 6a0bf2e232..1c58345efc 100644
--- a/packages/views/issues/surface/issue-surface.tsx
+++ b/packages/views/issues/surface/issue-surface.tsx
@@ -40,6 +40,7 @@ import { TableView } from "../components/table-view";
import { useT } from "../../i18n";
import { IssueContextMenuProvider } from "../actions";
import { IssueSurfaceActionsProvider } from "./actions-context";
+import { IssuePeekHost } from "../components/issue-peek";
import { IssueSurfaceSelectionProvider } from "./selection-context";
import type { IssueCreateDefaults, IssueSurfaceProps } from "./types";
import {
@@ -282,6 +283,10 @@ function IssueSurfaceContent({
}
/>
)}
+ {/* Every view opens the side peek on Shift+Click. The host wraps the
+ loading and empty states too, so a view switch that briefly shows
+ a skeleton keeps the peek open. */}
+ <IssuePeekHost>
{/* A failed status catalog precedes loading/empty/content on purpose.
Row fetching is suspended while it is down (a custom status filter
cannot be routed without it), so every branch below would render an
@@ -382,6 +387,7 @@ function IssueSurfaceContent({
)}
</div>
)}
+ </IssuePeekHost>
{shouldShowBatchToolbar && (
<BatchActionToolbar
issues={
diff --git a/packages/views/issues/surface/peek-context.test.ts b/packages/views/issues/surface/peek-context.test.ts
new file mode 100644
index 0000000000..cdd2796088
--- /dev/null
+++ b/packages/views/issues/surface/peek-context.test.ts
@@ -0,0 +1,59 @@
+// @vitest-environment node
+import { describe, expect, it } from "vitest";
+import { locateInColumns, resolveIssueClick } from "./peek-context";
+
+describe("locateInColumns", () => {
+ const columns = [["a", "b", "c"], [], ["d"]];
+
+ it("reports the 1-based position and neighbours inside the issue's column", () => {
+ expect(locateInColumns(columns, "b")).toMatchObject({
+ index: 2,
+ total: 3,
+ prevId: "a",
+ nextId: "c",
+ });
+ });
+
+ it("has no neighbour past either end of the column", () => {
+ expect(locateInColumns(columns, "a")).toMatchObject({ prevId: null, nextId: "b" });
+ expect(locateInColumns(columns, "c")).toMatchObject({ prevId: "b", nextId: null });
+ expect(locateInColumns(columns, "d")).toMatchObject({ index: 1, total: 1, prevId: null, nextId: null });
+ });
+
+ it("never steps across columns with J / K", () => {
+ expect(locateInColumns(columns, "c")?.nextId).toBeNull();
+ });
+
+ it("steps sideways to the nearest non-empty column, at the same row or its last card", () => {
+ // columns: [a b c] [] [d]
+ expect(locateInColumns(columns, "c")).toMatchObject({ leftId: null, rightId: "d" });
+ expect(locateInColumns(columns, "d")).toMatchObject({ leftId: "a", rightId: null });
+ const wide = [["x1", "x2"], ["y1", "y2", "y3"]];
+ expect(locateInColumns(wide, "y3")?.leftId).toBe("x2");
+ expect(locateInColumns(wide, "x2")?.rightId).toBe("y2");
+ });
+
+ it("is null for an issue outside every column or without published columns", () => {
+ expect(locateInColumns(columns, "zzz")).toBeNull();
+ expect(locateInColumns(null, "a")).toBeNull();
+ expect(locateInColumns(columns, null)).toBeNull();
+ });
+});
+
+describe("resolveIssueClick", () => {
+ const plain = { button: 0, shiftKey: false, metaKey: false, ctrlKey: false, altKey: false };
+ it("opens the preferred target on a plain click and the other one on Shift", () => {
+ expect(resolveIssueClick(plain, "page")).toBe("page");
+ expect(resolveIssueClick(plain, "peek")).toBe("peek");
+ expect(resolveIssueClick({ ...plain, shiftKey: true }, "page")).toBe("peek");
+ expect(resolveIssueClick({ ...plain, shiftKey: true }, "peek")).toBe("page");
+ });
+ it.each([{ metaKey: true }, { ctrlKey: true }, { altKey: true }, { button: 1 }, { button: 2 }])(
+ "leaves modified clicks native: %j", (modifier) => {
+ for (const openMode of ["page", "peek"] as const) {
+ expect(resolveIssueClick({ ...plain, ...modifier }, openMode)).toBeNull();
+ expect(resolveIssueClick({ ...plain, shiftKey: true, ...modifier }, openMode)).toBeNull();
+ }
+ },
+ );
+});
diff --git a/packages/views/issues/surface/peek-context.tsx b/packages/views/issues/surface/peek-context.tsx
new file mode 100644
index 0000000000..067f0dc54a
--- /dev/null
+++ b/packages/views/issues/surface/peek-context.tsx
@@ -0,0 +1,193 @@
+"use client";
+
+import { createContext, useCallback, useContext, useMemo } from "react";
+import { useIssueOpeningStore, type IssueOpenMode } from "@multica/core/issues/stores/issue-opening-store";
+import { useWorkspacePaths } from "@multica/core/paths";
+import { useNavigation } from "../../navigation";
+
+/**
+ * Side peek: Shift+Click (or Space) on an issue — a board or swimlane card, a
+ * list, table or gantt row — opens it in a floating panel over the view, so it
+ * can be triaged without leaving the view. The surface owns one peek at a
+ * time; see `IssuePeekHost`.
+ *
+ * State is split across three contexts so each consumer re-renders only for
+ * what it reads: cards and rows read the peeked id (to paint their peeked
+ * state), views publish their order through the stable actions, and only the
+ * panel's navigation reads the derived position.
+ */
+
+/**
+ * The element that stands for an issue in a view carries this attribute with
+ * the issue id: the host finds it to keep the peeked issue in view, and reads
+ * it to peek the issue under the pointer.
+ */
+export const PEEK_TARGET_ATTR = "data-peek-target";
+
+/**
+ * The peeked state of a row (list, gantt): a brand tint plus a leading bar.
+ * The bar is a shadow, so it stays visible under the row's hover background.
+ * The tint is opaque, for rows that sit over sticky or scrolling content.
+ */
+export const PEEKED_ROW_CLASS =
+ "data-[peeked]:bg-[color-mix(in_oklab,var(--brand)_6%,var(--background))] data-[peeked]:shadow-[inset_2px_0_0_var(--brand)]";
+
+/**
+ * Ordered issue ids per visible column, left to right. Views without columns
+ * (list, table, gantt) publish a single column in display order.
+ */
+export type IssuePeekColumns = readonly (readonly string[])[];
+
+export interface IssuePeekActions {
+ /** Open the peek on `issueId`, replacing whatever is peeked. */
+ open: (issueId: string) => void;
+ /** Open on `issueId`, or close when it is already the peeked issue. */
+ toggle: (issueId: string) => void;
+ close: () => void;
+ /**
+ * The view's current order, used to step with J / K (within a column) and
+ * H / L (across columns). `null` when the view has no order to offer.
+ */
+ publishColumns: (columns: IssuePeekColumns | null) => void;
+}
+
+export interface IssuePeekPosition {
+ /** 1-based position inside the peeked issue's column. */
+ index: number;
+ total: number;
+ prevId: string | null;
+ nextId: string | null;
+ /**
+ * The nearest non-empty column on either side, at the same row (clamped to
+ * that column's length) — the card a sideways step lands on.
+ */
+ leftId: string | null;
+ rightId: string | null;
+}
+
+/**
+ * Where `issueId` sits in the published columns, or `null` when it is in none
+ * of them (a filtered-out issue, or a view that published no order).
+ */
+export function locateInColumns(
+ columns: IssuePeekColumns | null,
+ issueId: string | null,
+): IssuePeekPosition | null {
+ if (!columns || !issueId) return null;
+ for (let c = 0; c < columns.length; c++) {
+ const column = columns[c]!;
+ const i = column.indexOf(issueId);
+ if (i === -1) continue;
+ const across = (step: 1 | -1) => {
+ for (let n = c + step; n >= 0 && n < columns.length; n += step) {
+ const neighbour = columns[n]!;
+ if (neighbour.length > 0) return neighbour[Math.min(i, neighbour.length - 1)]!;
+ }
+ return null;
+ };
+ return {
+ index: i + 1,
+ total: column.length,
+ prevId: i > 0 ? column[i - 1]! : null,
+ nextId: i < column.length - 1 ? column[i + 1]! : null,
+ leftId: across(-1),
+ rightId: across(1),
+ };
+ }
+ return null;
+}
+
+/**
+ * What a click on an issue card or row opens: a plain click opens the preferred
+ * target (Settings → Preferences), Shift+Click the other one, so either is one
+ * click away in both modes. `null` for clicks that keep their native link
+ * meaning: Cmd/Ctrl (+Shift) open tabs, Alt and non-primary buttons are the
+ * browser's.
+ */
+export function resolveIssueClick(
+ event: Pick<MouseEvent, "button" | "shiftKey" | "metaKey" | "ctrlKey" | "altKey">,
+ openMode: IssueOpenMode = "page",
+): IssueOpenMode | null {
+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.altKey) return null;
+ if (!event.shiftKey) return openMode;
+ return openMode === "peek" ? "page" : "peek";
+}
+
+export const IssuePeekActionsContext = createContext<IssuePeekActions | null>(null);
+export const IssuePeekIdContext = createContext<string | null>(null);
+export const IssuePeekPositionContext = createContext<IssuePeekPosition | null>(null);
+
+/** `null` outside a surface that hosts a peek (e.g. a board inside a dialog). */
+export function useIssuePeekActions() {
+ return useContext(IssuePeekActionsContext);
+}
+
+/** The peeked issue id, for views that mark rows without a per-row hook. */
+export function useIssuePeekId() {
+ return useContext(IssuePeekIdContext);
+}
+
+export function useIsIssuePeeked(issueId: string) {
+ return useContext(IssuePeekIdContext) === issueId;
+}
+
+export function useIssuePeekOpen() {
+ return useContext(IssuePeekIdContext) !== null;
+}
+
+export function useIssuePeekPosition() {
+ return useContext(IssuePeekPositionContext);
+}
+
+/**
+ * Shared by card/row links and the table's non-link click targets. Returns
+ * whether it handled the click; when it did not, the caller's own navigation
+ * (a plain full-page open, or a tab) proceeds.
+ */
+export function useIssuePeekClick() {
+ const peek = useIssuePeekActions();
+ const openMode = useIssueOpeningStore((s) => s.openMode);
+ const { push } = useNavigation();
+ const paths = useWorkspacePaths();
+ return useCallback((issueId: string, event?: React.MouseEvent) => {
+ if (!peek || event?.defaultPrevented) return false;
+ const target = event ? resolveIssueClick(event, openMode) : openMode;
+ if (target === "peek") {
+ event?.preventDefault();
+ // A plain click opens (or keeps open) the issue. Shift+Click is the
+ // explicit preview gesture and toggles it closed again, like Space.
+ if (event?.shiftKey) peek.toggle(issueId);
+ else peek.open(issueId);
+ return true;
+ }
+ if (target === "page" && event?.shiftKey) {
+ // Shift+Click in preview mode opens the full page in place. Left alone,
+ // a link would hand Shift to the browser — a new window on web.
+ event.preventDefault();
+ push(paths.issueDetail(issueId));
+ return true;
+ }
+ return false;
+ }, [peek, openMode, push, paths]);
+}
+
+/** Empty outside a peek host, so other issue links retain normal navigation. */
+export function useIssuePeekLinkProps(issueId: string) {
+ const peek = useIssuePeekActions();
+ const handlePeekClick = useIssuePeekClick();
+ return useMemo(
+ () =>
+ peek
+ ? {
+ // Keep the shift-click from extending the text selection.
+ onMouseDown: (event: React.MouseEvent) => {
+ if (event.shiftKey) event.preventDefault();
+ },
+ onClick: (event: React.MouseEvent) => {
+ handlePeekClick(issueId, event);
+ },
+ }
+ : {},
+ [peek, handlePeekClick, issueId],
+ );
+}
diff --git a/packages/views/locales/en/issues.json b/packages/views/locales/en/issues.json
index 5fb8ae7218..bacc007b0b 100644
--- a/packages/views/locales/en/issues.json
+++ b/packages/views/locales/en/issues.json
@@ -370,6 +370,13 @@
"ordered_by": "Board ordered by {{field}}",
"manual_reorder_hint": "Switch to Manual ordering to rearrange issues within a column."
},
+ "peek": {
+ "panel_label": "Issue preview",
+ "previous": "Previous issue",
+ "next": "Next issue",
+ "open_full_page": "Open full page",
+ "close": "Close preview"
+ },
"detail": {
"not_found": "This issue does not exist or has been deleted in this workspace.",
"breadcrumb_project_unknown": "Unknown project",
diff --git a/packages/views/locales/en/settings.json b/packages/views/locales/en/settings.json
index cb14e47c16..b3fe8fdd39 100644
--- a/packages/views/locales/en/settings.json
+++ b/packages/views/locales/en/settings.json
@@ -315,6 +315,13 @@
"floating_hint": "Show the floating chat button on every page."
},
"issue": {
+ "opening": {
+ "title": "Opening issues",
+ "click": "Clicking a card or row opens",
+ "page": "Full page",
+ "peek": "Side preview",
+ "hint": "Shift+Click opens the other one."
+ },
"description": "Choose which fields each create dialog keeps on its toolbar. Hidden fields stay available from the ⋯ menu and reappear while they hold a value.",
"fields": {
"status": "Status",
diff --git a/packages/views/locales/fr/issues.json b/packages/views/locales/fr/issues.json
index c201d7fb2c..cc592abe38 100644
--- a/packages/views/locales/fr/issues.json
+++ b/packages/views/locales/fr/issues.json
@@ -370,6 +370,13 @@
"ordered_by": "Tableau trié par {{field}}",
"manual_reorder_hint": "Passez au tri Manuel pour réorganiser les tâches dans une colonne."
},
+ "peek": {
+ "panel_label": "Aperçu de la tâche",
+ "previous": "Tâche précédente",
+ "next": "Tâche suivante",
+ "open_full_page": "Ouvrir la page complète",
+ "close": "Fermer l'aperçu"
+ },
"detail": {
"not_found": "Cette tâche n'existe pas ou a été supprimée dans cet espace de travail.",
"breadcrumb_project_unknown": "Projet inconnu",
diff --git a/packages/views/locales/fr/settings.json b/packages/views/locales/fr/settings.json
index 3acca4aea9..bc76570bbf 100644
--- a/packages/views/locales/fr/settings.json
+++ b/packages/views/locales/fr/settings.json
@@ -315,6 +315,13 @@
"floating_hint": "Afficher le bouton de chat flottant sur chaque page."
},
"issue": {
+ "opening": {
+ "title": "Ouverture des tâches",
+ "click": "Un clic sur une carte ou une ligne ouvre",
+ "page": "La page complète",
+ "peek": "L'aperçu latéral",
+ "hint": "Maj+clic ouvre l'autre."
+ },
"description": "Choisissez les champs que chaque fenêtre de création garde dans sa barre d'outils. Les champs masqués restent accessibles depuis le menu ⋯ et réapparaissent tant qu'ils contiennent une valeur.",
"fields": {
"status": "Statut",
diff --git a/packages/views/locales/ja/issues.json b/packages/views/locales/ja/issues.json
index 530db07008..f974f65156 100644
--- a/packages/views/locales/ja/issues.json
+++ b/packages/views/locales/ja/issues.json
@@ -366,6 +366,13 @@
"ordered_by": "{{field}} 順に並べたボード",
"manual_reorder_hint": "列内の順序を変更するには、並び順を「手動」に切り替えてください。"
},
+ "peek": {
+ "panel_label": "タスクのプレビュー",
+ "previous": "前のタスク",
+ "next": "次のタスク",
+ "open_full_page": "ページ全体で開く",
+ "close": "プレビューを閉じる"
+ },
"detail": {
"not_found": "このタスクはこのワークスペースに存在しないか、削除されています。",
"breadcrumb_project_unknown": "不明なプロジェクト",
diff --git a/packages/views/locales/ja/settings.json b/packages/views/locales/ja/settings.json
index 2a58419fab..1580efbfc7 100644
--- a/packages/views/locales/ja/settings.json
+++ b/packages/views/locales/ja/settings.json
@@ -315,6 +315,13 @@
"floating_hint": "すべてのページにフローティングチャットボタンを表示します。"
},
"issue": {
+ "opening": {
+ "title": "タスクを開く",
+ "click": "カードや行をクリックしたときに開く画面",
+ "page": "ページ全体",
+ "peek": "サイドプレビュー",
+ "hint": "Shift+クリックでもう一方で開きます。"
+ },
"description": "各作成ダイアログのツールバーに常時表示するフィールドを選択します。非表示のフィールドは ⋯ メニューから引き続き使用でき、値がある間は自動的に表示されます。",
"fields": {
"status": "ステータス",
diff --git a/packages/views/locales/ko/issues.json b/packages/views/locales/ko/issues.json
index 5fe70ea15c..40e917938d 100644
--- a/packages/views/locales/ko/issues.json
+++ b/packages/views/locales/ko/issues.json
@@ -366,6 +366,13 @@
"ordered_by": "{{field}} 기준으로 정렬된 보드",
"manual_reorder_hint": "열 안의 순서를 바꾸려면 정렬을 '수동'으로 전환하세요."
},
+ "peek": {
+ "panel_label": "태스크 미리보기",
+ "previous": "이전 태스크",
+ "next": "다음 태스크",
+ "open_full_page": "전체 페이지로 열기",
+ "close": "미리보기 닫기"
+ },
"detail": {
"not_found": "이 워크스페이스에 해당 태스크가 없거나 삭제되었습니다.",
"breadcrumb_project_unknown": "알 수 없는 프로젝트",
diff --git a/packages/views/locales/ko/settings.json b/packages/views/locales/ko/settings.json
index 9d10d04bdc..5b12a18254 100644
--- a/packages/views/locales/ko/settings.json
+++ b/packages/views/locales/ko/settings.json
@@ -315,6 +315,13 @@
"floating_hint": "모든 페이지에 플로팅 채팅 버튼을 표시합니다."
},
"issue": {
+ "opening": {
+ "title": "태스크 열기",
+ "click": "카드나 행을 클릭하면 열리는 곳",
+ "page": "전체 페이지",
+ "peek": "사이드 미리보기",
+ "hint": "Shift+클릭하면 다른 쪽으로 열립니다."
+ },
"description": "각 생성 방식의 툴바에 항상 표시할 필드를 선택합니다. 숨긴 필드는 ⋯ 메뉴에서 계속 사용할 수 있으며, 값이 있는 동안에는 자동으로 표시됩니다.",
"fields": {
"status": "상태",
diff --git a/packages/views/locales/zh-Hans/issues.json b/packages/views/locales/zh-Hans/issues.json
index fe9484539a..d21e989384 100644
--- a/packages/views/locales/zh-Hans/issues.json
+++ b/packages/views/locales/zh-Hans/issues.json
@@ -366,6 +366,13 @@
"ordered_by": "按{{field}}排序",
"manual_reorder_hint": "切换到“手动”排序后,才能调整同一列内的顺序。"
},
+ "peek": {
+ "panel_label": "任务预览",
+ "previous": "上一个任务",
+ "next": "下一个任务",
+ "open_full_page": "打开完整页面",
+ "close": "关闭预览"
+ },
"detail": {
"not_found": "这个任务不存在或已在该工作区被删除。",
"breadcrumb_project_unknown": "未知项目",
diff --git a/packages/views/locales/zh-Hans/settings.json b/packages/views/locales/zh-Hans/settings.json
index b3bd96a98a..9787aa0cb4 100644
--- a/packages/views/locales/zh-Hans/settings.json
+++ b/packages/views/locales/zh-Hans/settings.json
@@ -315,6 +315,13 @@
"floating_hint": "在每个页面显示悬浮聊天按钮。"
},
"issue": {
+ "opening": {
+ "title": "打开任务",
+ "click": "点击卡片或行时打开",
+ "page": "详情页",
+ "peek": "悬浮预览",
+ "hint": "按住 Shift 点击会打开另一种。"
+ },
"description": "选择各创建方式的工具栏中常驻显示的字段。隐藏的字段仍可从 ⋯ 菜单使用,有值时会自动显示。",
"fields": {
"status": "状态",
diff --git a/packages/views/settings/components/preferences-tab.test.tsx b/packages/views/settings/components/preferences-tab.test.tsx
index 3ffe3bb404..dbac627eb1 100644
--- a/packages/views/settings/components/preferences-tab.test.tsx
+++ b/packages/views/settings/components/preferences-tab.test.tsx
@@ -105,6 +105,7 @@ vi.mock("@multica/core/auth", async () => {
import { PreferencesTab } from "./preferences-tab";
import { useCommentComposerStore } from "@multica/core/issues/stores";
+import { useIssueOpeningStore } from "@multica/core/issues/stores/issue-opening-store";
import {
DEFAULT_MANUAL_CREATE_FIELDS,
DEFAULT_QUICK_CREATE_FIELDS,
@@ -429,6 +430,22 @@ describe("PreferencesTab — Scope", () => {
it("labels where each group of settings is stored", () => {
render(<PreferencesTab />, { wrapper: I18nWrapper });
expect(screen.getByText("Account · synced")).toBeInTheDocument();
- expect(screen.getAllByText("This device only")).toHaveLength(2);
+ // Appearance, opening issues, comments & chat.
+ expect(screen.getAllByText("This device only")).toHaveLength(3);
+ });
+
+ it("switches what clicking a card or row opens, and says what Shift does", async () => {
+ useIssueOpeningStore.setState({ openMode: "page" });
+ const user = userEvent.setup();
+ render(<PreferencesTab />, { wrapper: I18nWrapper });
+ const group = screen.getByRole("group", { name: "Clicking a card or row opens" });
+ const fullPage = within(group).getByRole("button", { name: "Full page" });
+ const preview = within(group).getByRole("button", { name: "Side preview" });
+ expect(fullPage).toHaveAttribute("aria-pressed", "true");
+ expect(screen.getByText("Shift+Click opens the other one.")).toBeInTheDocument();
+
+ await user.click(preview);
+ expect(useIssueOpeningStore.getState().openMode).toBe("peek");
+ expect(preview).toHaveAttribute("aria-pressed", "true");
});
});
diff --git a/packages/views/settings/components/preferences-tab.tsx b/packages/views/settings/components/preferences-tab.tsx
index ca7e20238a..fe9c0cf3a1 100644
--- a/packages/views/settings/components/preferences-tab.tsx
+++ b/packages/views/settings/components/preferences-tab.tsx
@@ -37,6 +37,10 @@ import {
useCommentComposerStore,
type RunningAgentReply,
} from "@multica/core/issues/stores";
+import {
+ useIssueOpeningStore,
+ type IssueOpenMode,
+} from "@multica/core/issues/stores/issue-opening-store";
import {
MANUAL_CREATE_FIELDS,
QUICK_CREATE_FIELDS,
@@ -99,6 +103,16 @@ export function PreferencesTab() {
</SettingsCard>
</SettingsSection>
+ <SettingsSection
+ title={t(($) => $.issue.opening.title)}
+ scope="device"
+ anchor="issue-opening"
+ >
+ <SettingsCard>
+ <IssueOpeningRow />
+ </SettingsCard>
+ </SettingsSection>
+
<SettingsSection
title={t(($) => $.preferences.issue_fields_title)}
description={t(($) => $.issue.description)}
@@ -283,6 +297,37 @@ function RunningAgentReplyRow() {
);
}
+/**
+ * What a plain click on an issue card or row opens across the issue views.
+ * The hint carries the one non-obvious part: Shift+Click opens the other one,
+ * so both stay one click away whichever is chosen.
+ */
+function IssueOpeningRow() {
+ const { t } = useT("settings");
+ const value = useIssueOpeningStore((s) => s.openMode);
+ const setValue = useIssueOpeningStore((s) => s.setOpenMode);
+ const label = t(($) => $.issue.opening.click);
+ return (
+ <SettingsRow
+ anchor="issue-opening"
+ label={label}
+ description={t(($) => $.issue.opening.hint)}
+ >
+ <div role="group" aria-label={label}>
+ <SegmentedToggle<IssueOpenMode>
+ value={value}
+ onChange={setValue}
+ buttonClassName="px-3 py-1 text-label"
+ options={[
+ ["page", t(($) => $.issue.opening.page)],
+ ["peek", t(($) => $.issue.opening.peek)],
+ ]}
+ />
+ </div>
+ </SettingsRow>
+ );
+}
+
/**
* When off, the FAB / overlay never mount and Chat is reachable only from its
* dedicated tab. A persisted client setting, so it applies immediately.
diff --git a/packages/views/settings/components/settings-page.test.tsx b/packages/views/settings/components/settings-page.test.tsx
index 4dcb348c4a..85002cb247 100644
--- a/packages/views/settings/components/settings-page.test.tsx
+++ b/packages/views/settings/components/settings-page.test.tsx
@@ -338,6 +338,20 @@ describe("SettingsPage search", () => {
expect(screen.queryByRole("listbox")).toBeNull();
});
+ it("finds the issue-opening preference by the name of its options", () => {
+ renderWithI18n(<SettingsPage />);
+ fireEvent.change(screen.getByRole("searchbox", { name: "Search settings" }), {
+ target: { value: "side preview" },
+ });
+ const results = screen.getByRole("listbox", { name: "Search settings" });
+ const option = within(results).getByRole("option", { name: /Opening issues/ });
+ expect(within(results).getAllByRole("option")).toHaveLength(1);
+ fireEvent.click(option);
+ expect(push).toHaveBeenCalledWith(
+ "/acme/settings?tab=preferences&section=issue-opening",
+ );
+ });
+
it("does not offer pages hidden by feature flags", () => {
renderWithI18n(<SettingsPage />);
fireEvent.change(
diff --git a/packages/views/settings/components/use-settings-search-index.ts b/packages/views/settings/components/use-settings-search-index.ts
index 519dd4238c..a83cc6e73c 100644
--- a/packages/views/settings/components/use-settings-search-index.ts
+++ b/packages/views/settings/components/use-settings-search-index.ts
@@ -68,6 +68,21 @@ export function useSettingsSearchIndex(
title: t(($) => $.chat.floating_label),
description: t(($) => $.chat.floating_hint),
},
+ {
+ tab: "preferences",
+ anchor: "issue-opening",
+ title: t(($) => $.issue.opening.click),
+ description: t(($) => $.issue.opening.hint),
+ },
+ // Same row, found by its section title or its options: someone looking
+ // for "side preview" searches for the choice, not the row's label. Only
+ // consulted when the entry above did not match (results dedupe by anchor).
+ {
+ tab: "preferences",
+ anchor: "issue-opening",
+ title: t(($) => $.issue.opening.title),
+ description: `${t(($) => $.issue.opening.page)} · ${t(($) => $.issue.opening.peek)}`,
+ },
{
tab: "preferences",
anchor: "issue",