Skip to content

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

Go

MUL-8437 feat(sidebar): change an issue's status from its sidebar icon (#9756)

Jiayuan Zhangf306f98fe2ef
diff --git a/packages/core/issues/cache-coordinator.test.ts b/packages/core/issues/cache-coordinator.test.ts
index ab126993df..b3421eec46 100644
--- a/packages/core/issues/cache-coordinator.test.ts
+++ b/packages/core/issues/cache-coordinator.test.ts
@@ -15,6 +15,7 @@ import type {
Issue,
IssueTableRowsResponse,
ListIssuesCache,
+ ListIssuesResponse,
} from "../types";
const WS_ID = "ws-1";
@@ -266,6 +267,26 @@ describe("applyIssueChange", () => {
expect(qc.getQueryData(tableRowKey)).toEqual(snapshot);
});
+ it("patches and rolls back loaded sidebar rows", () => {
+ const sidebarKey = issueKeys.sidebar(WS_ID, "project:p1", { project_id: "p1" }, 5);
+ const snapshot: ListIssuesResponse = { issues: [issue()], total: 1 };
+ qc.setQueryData(sidebarKey, snapshot);
+
+ const patch = { status: "in_progress" as const };
+ const result = applyIssueChange(qc, WS_ID, "issue-1", patch, {
+ changed: issueChangedDims(patch, issue()),
+ baseIssue: issue(),
+ });
+
+ const patched = qc.getQueryData<ListIssuesResponse>(sidebarKey)?.issues[0];
+ expect(patched?.status).toBe("in_progress");
+ expect(patched?.status_category).toBe("started");
+ expect(result.prevSidebarLists).toEqual([[sidebarKey, snapshot]]);
+
+ rollbackIssueChange(qc, WS_ID, "issue-1", result);
+ expect(qc.getQueryData(sidebarKey)).toEqual(snapshot);
+ });
+
it("marks only flat windows whose sort or facet depends on the changed field", () => {
for (const key of [
flatKey,
diff --git a/packages/core/issues/cache-coordinator.ts b/packages/core/issues/cache-coordinator.ts
index eb9344b8df..5a94f9dbbe 100644
--- a/packages/core/issues/cache-coordinator.ts
+++ b/packages/core/issues/cache-coordinator.ts
@@ -56,6 +56,7 @@ export interface IssueCacheChangeResult {
prevLists: [QueryKey, ListIssuesCache][];
prevFlatLists: [QueryKey, IssueFlatCache][];
prevTableRows: [QueryKey, IssueTableRowCache][];
+ prevSidebarLists: [QueryKey, ListIssuesResponse][];
prevDetail: Issue | undefined;
prevInboxList: InboxItem[] | undefined;
prevArchivedInboxCaches: [QueryKey, ArchivedInboxCache | undefined][] | undefined;
@@ -143,6 +144,20 @@ export function tableRowEntries(
);
}
+export function sidebarListEntries(
+ qc: QueryClient,
+ wsId: string,
+): [QueryKey, ListIssuesResponse][] {
+ return qc
+ .getQueriesData<unknown>({ queryKey: issueKeys.sidebarAll(wsId) })
+ .filter(
+ (entry): entry is [QueryKey, ListIssuesResponse] =>
+ !!entry[1] &&
+ typeof entry[1] === "object" &&
+ Array.isArray((entry[1] as ListIssuesResponse).issues),
+ );
+}
+
/** Caches under `prefix` that hold a plain `Issue[]` — per-parent children and
* the project Gantt list. */
export function issueArrayEntries(
@@ -315,6 +330,7 @@ export function applyIssueChange(
const prevLists: [QueryKey, ListIssuesCache][] = [];
const prevFlatLists: [QueryKey, IssueFlatCache][] = [];
const prevTableRows: [QueryKey, IssueTableRowCache][] = [];
+ const prevSidebarLists: [QueryKey, ListIssuesResponse][] = [];
const staleKeys: QueryKey[] = [];
let prevIssue: Issue | undefined = baseIssue;
@@ -490,6 +506,23 @@ export function applyIssueChange(
qc.setQueryData<IssueTableRowCache>(key, { ...data, rows });
}
+ // Sidebar lists are server-filtered and sorted too; their membership and
+ // order refresh through invalidateIssueDerivatives. A loaded row's entity is
+ // patched now, so a status picked from the sidebar shows at once.
+ for (const [key, data] of sidebarListEntries(qc, wsId)) {
+ let found: Issue | undefined;
+ const issues = data.issues.map((issue) => {
+ if (issue.id !== id) return issue;
+ if (!acceptCurrent(issue)) return issue;
+ found = issue;
+ return { ...issue, ...patch };
+ });
+ if (!found) continue;
+ if (!prevIssue) prevIssue = found;
+ prevSidebarLists.push([key, data]);
+ qc.setQueryData<ListIssuesResponse>(key, { ...data, issues });
+ }
+
const prevDetail = qc.getQueryData<Issue>(issueKeys.detail(wsId, id));
if (prevDetail && acceptCurrent(prevDetail)) {
qc.setQueryData<Issue>(issueKeys.detail(wsId, id), {
@@ -528,6 +561,7 @@ export function applyIssueChange(
prevLists,
prevFlatLists,
prevTableRows,
+ prevSidebarLists,
prevDetail,
prevInboxList,
prevArchivedInboxCaches,
@@ -547,6 +581,7 @@ export function rollbackIssueChange(
| "prevLists"
| "prevFlatLists"
| "prevTableRows"
+ | "prevSidebarLists"
| "prevDetail"
| "prevInboxList"
| "prevArchivedInboxCaches"
@@ -561,6 +596,9 @@ export function rollbackIssueChange(
for (const [key, snapshot] of result.prevTableRows) {
qc.setQueryData(key, snapshot);
}
+ for (const [key, snapshot] of result.prevSidebarLists) {
+ qc.setQueryData(key, snapshot);
+ }
if (result.prevDetail !== undefined) {
qc.setQueryData(issueKeys.detail(wsId, id), result.prevDetail);
}
diff --git a/packages/core/issues/mutations.ts b/packages/core/issues/mutations.ts
index 4edeb62221..51bbf6a858 100644
--- a/packages/core/issues/mutations.ts
+++ b/packages/core/issues/mutations.ts
@@ -43,6 +43,7 @@ import type {
CreateCommentSubIssueManualRequest,
CreateIssueRequest,
ListIssuesCache,
+ ListIssuesResponse,
MoveIssueRequest,
UpdateIssueRequest,
} from "../types";
@@ -507,6 +508,7 @@ interface BatchUpdateSnapshots {
prevLists?: Iterable<readonly [QueryKey, unknown]>;
prevFlatLists?: Iterable<readonly [QueryKey, unknown]>;
prevTableRows?: Iterable<readonly [QueryKey, unknown]>;
+ prevSidebarLists?: Iterable<readonly [QueryKey, unknown]>;
prevDetailById?: Iterable<readonly [string, unknown]>;
prevInboxList?: unknown;
prevArchivedInboxCaches?: Iterable<readonly [QueryKey, unknown]>;
@@ -520,6 +522,7 @@ export function useBatchUpdateIssues() {
for (const [key, snapshot] of ctx?.prevLists ?? []) qc.setQueryData(key, snapshot);
for (const [key, snapshot] of ctx?.prevFlatLists ?? []) qc.setQueryData(key, snapshot);
for (const [key, snapshot] of ctx?.prevTableRows ?? []) qc.setQueryData(key, snapshot);
+ for (const [key, snapshot] of ctx?.prevSidebarLists ?? []) qc.setQueryData(key, snapshot);
for (const [id, snapshot] of ctx?.prevDetailById ?? []) qc.setQueryData(issueKeys.detail(wsId, id), snapshot);
if (ctx?.prevInboxList !== undefined) qc.setQueryData(inboxKeys.list(wsId), ctx.prevInboxList);
for (const [key, snapshot] of ctx?.prevArchivedInboxCaches ?? []) qc.setQueryData(key, snapshot);
@@ -570,6 +573,7 @@ export function useBatchUpdateIssues() {
string,
[QueryKey, IssueTableRowCache]
>();
+ const prevSidebarListByHash = new Map<string, [QueryKey, ListIssuesResponse]>();
const prevDetailById = new Map<string, Issue>();
let prevInboxList: InboxItem[] | undefined;
let prevArchivedInboxCaches: [QueryKey, ArchivedInboxCache | undefined][] | undefined;
@@ -596,6 +600,12 @@ export function useBatchUpdateIssues() {
prevTableRowByHash.set(hash, [key, snapshot]);
}
}
+ for (const [key, snapshot] of change.prevSidebarLists) {
+ const hash = hashKey(key);
+ if (!prevSidebarListByHash.has(hash)) {
+ prevSidebarListByHash.set(hash, [key, snapshot]);
+ }
+ }
if (change.prevDetail) prevDetailById.set(id, change.prevDetail);
if (prevInboxList === undefined && change.prevInboxList !== undefined) {
prevInboxList = change.prevInboxList;
@@ -632,6 +642,7 @@ export function useBatchUpdateIssues() {
prevLists: [...prevListByHash.values()],
prevFlatLists: [...prevFlatListByHash.values()],
prevTableRows: [...prevTableRowByHash.values()],
+ prevSidebarLists: [...prevSidebarListByHash.values()],
prevDetailById,
prevInboxList,
prevArchivedInboxCaches,
diff --git a/packages/views/issues/components/pickers/status-picker.test.tsx b/packages/views/issues/components/pickers/status-picker.test.tsx
index 84e5b7056d..d3faae2fa7 100644
--- a/packages/views/issues/components/pickers/status-picker.test.tsx
+++ b/packages/views/issues/components/pickers/status-picker.test.tsx
@@ -217,7 +217,7 @@ describe("StatusPicker in a project that uses a workflow", () => {
expect(rows).toEqual(["Todo", "QAHands off to Sentinel", "Done"]);
expect(screen.getByText("Hands off to Sentinel").className).toContain("sr-only");
expect(screen.getByTestId("avatar-agent-1")).toBeTruthy();
- expect(screen.getByText("Delivery")).toBeTruthy();
+ expect(screen.queryByText("Delivery")).toBeNull();
expect(screen.queryByText("In Review")).toBeNull();
});
@@ -258,14 +258,14 @@ describe("StatusPicker on an issue outside any project (MUL-8121)", () => {
return Array.from(document.querySelectorAll("button[data-picker-item]")).map((el) => el.textContent?.trim());
}
- it("offers only the Default workflow's statuses, headed as such, without handoff hints", () => {
+ it("offers only the Default workflow's statuses, without a header or handoff hints", () => {
catalogEntries = [TODO, IN_REVIEW, QA, MERGED, DONE];
workspaceDefault = DEFAULT;
renderWithI18n(
<StatusPicker status="todo" projectId={null} onUpdate={() => {}} open onOpenChange={() => {}} />,
);
expect(rows()).toEqual(["Todo", "In Review", "Done"]);
- expect(screen.getByText("Default statuses · no project")).toBeTruthy();
+ expect(screen.queryByText(/Default statuses/)).toBeNull();
expect(screen.queryByText(/Hands off to/)).toBeNull();
});
diff --git a/packages/views/issues/components/pickers/status-picker.tsx b/packages/views/issues/components/pickers/status-picker.tsx
index e4386d7186..f1c0e1b02b 100644
--- a/packages/views/issues/components/pickers/status-picker.tsx
+++ b/packages/views/issues/components/pickers/status-picker.tsx
@@ -145,26 +145,13 @@ export function StatusPicker({
if (!v) setQuery("");
setOpen(v);
}}
- width={workflow || defaultScope ? "w-60" : "w-52"}
+ width={workflow ? "w-60" : "w-52"}
align={align}
triggerRender={triggerRender}
tooltip={tooltip}
searchable={searchable}
searchPlaceholder={t(($) => $.filters.search_status)}
onSearchChange={setQuery}
- header={
- workflow ? (
- <div className="truncate px-2 pb-1 pt-1.5 text-caption text-muted-foreground">
- {project
- ? t(($) => $.workflows.picker.header, { workflow: workflow.name, project: project.title })
- : workflow.name}
- </div>
- ) : defaultScope ? (
- <div className="truncate px-2 pb-1 pt-1.5 text-caption text-muted-foreground">
- {t(($) => $.workflows.picker.header_no_project, { workflow: defaultScope.name })}
- </div>
- ) : undefined
- }
footer={markDuplicate ?? undefined}
trigger={
customTrigger ??
diff --git a/packages/views/layout/panels/pinned-section.test.tsx b/packages/views/layout/panels/pinned-section.test.tsx
index 075ef1415d..65c5f72957 100644
--- a/packages/views/layout/panels/pinned-section.test.tsx
+++ b/packages/views/layout/panels/pinned-section.test.tsx
@@ -139,7 +139,7 @@ describe("PinnedSection", () => {
error: null,
};
renderWithI18n(<Harness pathname="/acme/issues" />);
- const row = (await screen.findByText("Keep this pin")).closest("a")!;
+ const row = (await screen.findByText("Keep this pin")).closest("a")!.parentElement!;
fireEvent.contextMenu(row);
expect(await screen.findByText("sidebar menu: Keep this pin")).toBeInTheDocument();
diff --git a/packages/views/layout/panels/pinned-section.tsx b/packages/views/layout/panels/pinned-section.tsx
index 415c3b6181..dd82bb96dc 100644
--- a/packages/views/layout/panels/pinned-section.tsx
+++ b/packages/views/layout/panels/pinned-section.tsx
@@ -18,7 +18,6 @@ import { TooltipHint } from "@multica/ui/components/common/tooltip-hint";
import { ShimmerText } from "@multica/ui/components/common/shimmer-text";
import { ApiError } from "@multica/core/api";
import { useIssueStatuses } from "@multica/core/issue-statuses/hooks";
-import { issueStatusCategory } from "@multica/core/issues";
import { issueDetailOptions } from "@multica/core/issues/queries";
import { projectDetailOptions } from "@multica/core/projects/queries";
import { pinListOptions } from "@multica/core/pins/queries";
@@ -27,13 +26,15 @@ import { useDeletePin, useReorderPins } from "@multica/core/pins/mutations";
import { useWorkspacePaths, type WorkspacePaths } from "@multica/core/paths";
import type { Issue, PinnedItem } from "@multica/core/types";
import { AppLink } from "../../navigation";
-import { StatusIcon } from "../../issues/components/status-icon";
import { IssueActionsContextMenu } from "../../issues/actions";
+import { useStatusLabel } from "../../issues/utils/status-label";
import { useT } from "../../i18n";
import { PANEL_ROW_CLASS, PanelList, PanelSection, isPathWithin, panelRowStateClass } from "../panel-nav";
import {
+ ISSUE_ROW_LINK_CLASS,
IssueAgentBadge,
SIDEBAR_SHIMMER_CLASS,
+ SidebarIssueStatus,
issueRowMenuOpenClass,
useIssueAgentState,
} from "./sidebar-tree";
@@ -214,40 +215,45 @@ function SortablePinItem({
if (isDragging) wasDragged.current = true;
}, [isDragging]);
- const link = (
- <AppLink
- href={href}
- newTabTitle={label}
- draggable={false}
- aria-current={active ? "page" : undefined}
- onClick={(event) => {
- if (wasDragged.current) {
- wasDragged.current = false;
- event.preventDefault();
- return;
- }
- onNavigate?.();
- }}
+ const row = (
+ <div
className={cn(
PANEL_ROW_CLASS,
panelRowStateClass(active),
issue && issueRowMenuOpenClass(active),
+ "relative",
trailing ? "pr-2" : "pr-8",
isDragging && "pointer-events-none",
)}
>
{iconNode}
- <ShimmerText active={running} className={cn("min-w-0 flex-1 truncate", SIDEBAR_SHIMMER_CLASS)}>
- {label}
- </ShimmerText>
- {/* Holds the same right-edge slot as a tree row's avatars, and yields
- it to the unpin button on hover. */}
- {trailing && (
- <span className="flex shrink-0 items-center group-hover/pin:invisible group-focus-within/pin:invisible">
- {trailing}
- </span>
- )}
- </AppLink>
+ <AppLink
+ href={href}
+ newTabTitle={label}
+ draggable={false}
+ aria-current={active ? "page" : undefined}
+ onClick={(event) => {
+ if (wasDragged.current) {
+ wasDragged.current = false;
+ event.preventDefault();
+ return;
+ }
+ onNavigate?.();
+ }}
+ className={cn(ISSUE_ROW_LINK_CLASS, "gap-2.5")}
+ >
+ <ShimmerText active={running} className={cn("min-w-0 flex-1 truncate", SIDEBAR_SHIMMER_CLASS)}>
+ {label}
+ </ShimmerText>
+ {/* Holds the same right-edge slot as a tree row's avatars, and yields
+ it to the unpin button on hover. */}
+ {trailing && (
+ <span className="flex shrink-0 items-center group-hover/pin:invisible group-focus-within/pin:invisible">
+ {trailing}
+ </span>
+ )}
+ </AppLink>
+ </div>
);
return (
@@ -258,7 +264,7 @@ function SortablePinItem({
{...attributes}
{...listeners}
>
- {issue ? <IssueActionsContextMenu issue={issue}>{link}</IssueActionsContextMenu> : link}
+ {issue ? <IssueActionsContextMenu issue={issue}>{row}</IssueActionsContextMenu> : row}
<TooltipHint label={t(($) => $.sidebar.unpin_tooltip)}>
<button
type="button"
@@ -303,6 +309,7 @@ function PinRow({
const isIssue = pin.item_type === "issue";
const agents = useIssueAgentState(wsId, isIssue ? pin.item_id : "");
const statusCatalog = useIssueStatuses(wsId);
+ const statusLabel = useStatusLabel(wsId);
const issueQuery = useQuery({ ...issueDetailOptions(wsId, pin.item_id), enabled: isIssue });
const projectQuery = useQuery({
...projectDetailOptions(wsId, pin.item_id),
@@ -333,12 +340,12 @@ function PinRow({
trailing={agents && <IssueAgentBadge agents={agents} />}
issue={issue}
iconNode={
- <StatusIcon
- status={issue.status}
+ <SidebarIssueStatus
+ issue={issue}
color={statusCatalog.colorOf(issue.status)}
icon={statusCatalog.iconOf(issue.status)}
- category={issueStatusCategory(issue) ?? undefined}
- className="size-3.5 shrink-0"
+ label={statusLabel(issue.status)}
+ className="size-3.5"
/>
}
/>
diff --git a/packages/views/layout/panels/sidebar-tree.test.tsx b/packages/views/layout/panels/sidebar-tree.test.tsx
index f7ee0f5fca..e950e0731c 100644
--- a/packages/views/layout/panels/sidebar-tree.test.tsx
+++ b/packages/views/layout/panels/sidebar-tree.test.tsx
@@ -1,4 +1,4 @@
-import type { ReactNode } from "react";
+import { cloneElement, type ReactNode } from "react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { fireEvent, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
@@ -16,7 +16,30 @@ vi.mock("../../issues/actions/issue-actions-menu-items", () => ({
<div>{`${variant} menu: ${issue.title}`}</div>
),
}));
-vi.mock("../../issues/actions/use-issue-actions", () => ({ useIssueActions: () => ({}) }));
+const updateField = vi.hoisted(() => vi.fn());
+vi.mock("../../issues/actions/use-issue-actions", () => ({ useIssueActions: () => ({ updateField }) }));
+vi.mock("../../issues/components/pickers/status-picker", () => ({
+ StatusPicker: ({
+ open,
+ onUpdate,
+ trigger,
+ triggerRender,
+ }: {
+ open: boolean;
+ onUpdate: (updates: { status: string }) => void;
+ trigger: ReactNode;
+ triggerRender: React.ReactElement;
+ }) => (
+ <>
+ {cloneElement(triggerRender, {}, trigger)}
+ {open && (
+ <button type="button" onClick={() => onUpdate({ status: "done" })}>
+ Pick Done
+ </button>
+ )}
+ </>
+ ),
+}));
vi.mock("@multica/core/issue-statuses/hooks", () => ({
useIssueStatuses: () => buildIssueStatusCatalog([]),
@@ -101,7 +124,7 @@ describe("SidebarIssueList", () => {
it("offers neither control when everything fits", () => {
renderList({ total: 4 });
expect(rows()).toHaveLength(4);
- expect(screen.queryByRole("button")).toBeNull();
+ expect(screen.queryByRole("button", { name: /Load more|Show less/ })).toBeNull();
});
it("shows the empty state when the settings match nothing", () => {
@@ -133,8 +156,8 @@ describe("SidebarIssueList", () => {
it("opens the sidebar issue menu on right-click and keeps the row lit while it is open", async () => {
renderList();
- const row = screen.getByRole("link", { name: "Issue 3" });
- const selected = screen.getByRole("link", { name: "Issue 2" });
+ const row = screen.getByRole("link", { name: "Issue 3" }).parentElement!;
+ const selected = screen.getByRole("link", { name: "Issue 2" }).parentElement!;
fireEvent.contextMenu(row);
expect(await screen.findByText("sidebar menu: Issue 3")).toBeInTheDocument();
@@ -143,4 +166,15 @@ describe("SidebarIssueList", () => {
// The selected row keeps its own fill.
expect(selected.className).not.toContain("data-popup-open:");
});
+
+ it("changes the status from the row's status icon without opening the issue", () => {
+ updateField.mockReset();
+ renderList({ total: 1 });
+ const status = screen.getByRole("button", { name: "Todo" });
+ expect(status.closest("a")).toBeNull();
+
+ fireEvent.click(status);
+ fireEvent.click(screen.getByRole("button", { name: "Pick Done" }));
+ expect(updateField).toHaveBeenCalledWith({ status: "done" });
+ });
});
diff --git a/packages/views/layout/panels/sidebar-tree.tsx b/packages/views/layout/panels/sidebar-tree.tsx
index 98555b6d0a..43c52a78e6 100644
--- a/packages/views/layout/panels/sidebar-tree.tsx
+++ b/packages/views/layout/panels/sidebar-tree.tsx
@@ -15,8 +15,12 @@ import type { AgentTask, Issue, ListIssuesParams } from "@multica/core/types";
import { AppLink } from "../../navigation";
import { AgentAvatarStack } from "../../agents/components/agent-avatar-stack";
import { StatusIcon } from "../../issues/components/status-icon";
+import { StatusPicker } from "../../issues/components/pickers/status-picker";
import { IssueActionsContextMenu } from "../../issues/actions";
+import { useIssueActions } from "../../issues/actions/use-issue-actions";
import { selectIssueTasks } from "../../issues/surface/activity";
+import { useStatusLabel } from "../../issues/utils/status-label";
+import { DeferredPopup } from "../../common/deferred-popup";
import { useT } from "../../i18n";
import { PANEL_ROW_CLASS, panelRowStateClass } from "../panel-nav";
@@ -181,6 +185,7 @@ export function SidebarIssueList({
const { t } = useT("layout");
const p = useWorkspacePaths();
const statusCatalog = useIssueStatuses(wsId);
+ const statusLabel = useStatusLabel(wsId);
const [limit, setLimit] = useState(SIDEBAR_FIRST_PAGE);
const query = useQuery({
...sidebarIssuesOptions(wsId, source, params ?? EMPTY_PARAMS, limit),
@@ -222,6 +227,7 @@ export function SidebarIssueList({
active={issue.id === activeIssueId}
statusColor={statusCatalog.colorOf(issue.status)}
statusIcon={statusCatalog.iconOf(issue.status)}
+ statusLabel={statusLabel(issue.status)}
onKeyDown={onKeyDown}
/>
</li>
@@ -288,6 +294,86 @@ export function IssueAgentBadge({ agents }: { agents: NonNullable<IssueAgentStat
);
}
+/** The link of an issue row whose status icon sits beside it: it stretches
+ * over the whole row, under the icon's button. */
+export const ISSUE_ROW_LINK_CLASS =
+ "flex min-w-0 flex-1 items-center gap-2 outline-none after:absolute after:inset-0 after:rounded-lg focus-visible:after:outline-2 focus-visible:after:outline-ring";
+
+/**
+ * An issue row's status icon, which opens the status picker. The picker
+ * mounts on the first click, so a long tree pays for none of them.
+ */
+export function SidebarIssueStatus({
+ issue,
+ color,
+ icon,
+ label,
+ className,
+}: {
+ issue: Issue;
+ color: string | null;
+ icon: string | null;
+ label: string;
+ className: string;
+}) {
+ const statusIcon = (
+ <StatusIcon
+ status={issue.status}
+ color={color}
+ icon={icon}
+ category={issueStatusCategory(issue) ?? undefined}
+ className={cn(className, "shrink-0")}
+ />
+ );
+ const button = (
+ <button
+ type="button"
+ aria-label={label}
+ // A pinned row is draggable; pressing its icon must not pick it up.
+ onPointerDown={(event) => event.stopPropagation()}
+ className="relative z-10 -m-1 flex shrink-0 items-center justify-center rounded-md p-1 outline-none transition-colors hover:bg-surface-selected focus-visible:outline-2 focus-visible:outline-ring data-popup-open:bg-surface-selected"
+ />
+ );
+ return (
+ <DeferredPopup trigger={statusIcon} triggerRender={button} tooltip={label}>
+ {(open, onOpenChange) => (
+ <SidebarStatusPicker
+ issue={issue}
+ open={open}
+ onOpenChange={onOpenChange}
+ trigger={statusIcon}
+ triggerRender={button}
+ tooltip={label}
+ />
+ )}
+ </DeferredPopup>
+ );
+}
+
+function SidebarStatusPicker({
+ issue,
+ ...picker
+}: {
+ issue: Issue;
+ open: boolean;
+ onOpenChange: (open: boolean) => void;
+ trigger: React.ReactNode;
+ triggerRender: React.ReactElement;
+ tooltip: string;
+}) {
+ const { updateField } = useIssueActions(issue);
+ return (
+ <StatusPicker
+ {...picker}
+ status={issue.status}
+ onUpdate={updateField}
+ projectId={issue.project_id}
+ issue={issue}
+ align="start"
+ />
+ );
+}
+
/** The title shimmers while an agent runs on the issue; queued agents show dimmed. */
const SidebarIssueRow = memo(function SidebarIssueRow({
wsId,
@@ -296,6 +382,7 @@ const SidebarIssueRow = memo(function SidebarIssueRow({
active,
statusColor,
statusIcon,
+ statusLabel,
onKeyDown,
}: {
wsId: string;
@@ -304,31 +391,34 @@ const SidebarIssueRow = memo(function SidebarIssueRow({
active: boolean;
statusColor: string | null;
statusIcon: string | null;
+ statusLabel: string;
onKeyDown: (event: React.KeyboardEvent) => void;
}) {
const agents = useIssueAgentState(wsId, issue.id);
return (
<IssueActionsContextMenu issue={issue}>
- <AppLink
- href={href}
- newTabTitle={issue.title}
- aria-current={active ? "page" : undefined}
- onKeyDown={onKeyDown}
- className={cn(TREE_CHILD_ROW_CLASS, panelRowStateClass(active), issueRowMenuOpenClass(active))}
- >
- <StatusIcon
- status={issue.status}
+ <div className={cn(TREE_CHILD_ROW_CLASS, panelRowStateClass(active), issueRowMenuOpenClass(active), "relative")}>
+ <SidebarIssueStatus
+ issue={issue}
color={statusColor}
icon={statusIcon}
- category={issueStatusCategory(issue) ?? undefined}
- className="size-3 shrink-0"
+ label={statusLabel}
+ className="size-3"
/>
- <ShimmerText active={!!agents?.running} className={cn("min-w-0 flex-1 truncate", SIDEBAR_SHIMMER_CLASS)}>
- {issue.title}
- </ShimmerText>
- {agents && <IssueAgentBadge agents={agents} />}
- </AppLink>
+ <AppLink
+ href={href}
+ newTabTitle={issue.title}
+ aria-current={active ? "page" : undefined}
+ onKeyDown={onKeyDown}
+ className={ISSUE_ROW_LINK_CLASS}
+ >
+ <ShimmerText active={!!agents?.running} className={cn("min-w-0 flex-1 truncate", SIDEBAR_SHIMMER_CLASS)}>
+ {issue.title}
+ </ShimmerText>
+ {agents && <IssueAgentBadge agents={agents} />}
+ </AppLink>
+ </div>
</IssueActionsContextMenu>
);
});
diff --git a/packages/views/locales/en/issues.json b/packages/views/locales/en/issues.json
index 52d07b5a4a..8444a1b3ef 100644
--- a/packages/views/locales/en/issues.json
+++ b/packages/views/locales/en/issues.json
@@ -1656,8 +1656,6 @@
"picker_more": "Create more workflows in Settings → Workflows."
},
"picker": {
- "header": "{{workflow}} · from project “{{project}}”",
- "header_no_project": "{{workflow}} statuses · no project",
"footer": "Only this issue’s workflow statuses are shown. The right side is who entering the status hands it to."
},
"confirm": {
diff --git a/packages/views/locales/fr/issues.json b/packages/views/locales/fr/issues.json
index 13e7e94485..db12abc471 100644
--- a/packages/views/locales/fr/issues.json
+++ b/packages/views/locales/fr/issues.json
@@ -1656,8 +1656,6 @@
"picker_more": "Créez d’autres workflows dans Paramètres → Workflows."
},
"picker": {
- "header": "{{workflow}} · selon le projet « {{project}} »",
- "header_no_project": "Statuts {{workflow}} · sans projet",
"footer": "Seuls les états du workflow de cette tâche sont affichés. À droite : à qui elle est confiée en entrant dans l’état."
},
"confirm": {
diff --git a/packages/views/locales/ja/issues.json b/packages/views/locales/ja/issues.json
index d78adcd1f8..c686b95547 100644
--- a/packages/views/locales/ja/issues.json
+++ b/packages/views/locales/ja/issues.json
@@ -1591,8 +1591,6 @@
"picker_more": "「設定 → ワークフロー」でワークフローを追加できます。"
},
"picker": {
- "header": "{{workflow}} · プロジェクト「{{project}}」に従う",
- "header_no_project": "{{workflow}} のステータス · プロジェクトなし",
"footer": "このタスクのワークフローのステータスだけを表示しています。右側はそのステータスに入ったときの引き継ぎ先です。"
},
"confirm": {
diff --git a/packages/views/locales/ko/issues.json b/packages/views/locales/ko/issues.json
index fce72a1181..f9def70f53 100644
--- a/packages/views/locales/ko/issues.json
+++ b/packages/views/locales/ko/issues.json
@@ -1591,8 +1591,6 @@
"picker_more": "설정 → 워크플로에서 워크플로를 더 만들 수 있습니다."
},
"picker": {
- "header": "{{workflow}} · 프로젝트 “{{project}}” 기준",
- "header_no_project": "{{workflow}} 상태 · 프로젝트 없음",
"footer": "이 태스크 워크플로의 상태만 표시합니다. 오른쪽은 해당 상태에 들어갈 때의 처리자입니다."
},
"confirm": {
diff --git a/packages/views/locales/zh-Hans/issues.json b/packages/views/locales/zh-Hans/issues.json
index 00ce6b9ac6..e9f5e0686f 100644
--- a/packages/views/locales/zh-Hans/issues.json
+++ b/packages/views/locales/zh-Hans/issues.json
@@ -1591,8 +1591,6 @@
"picker_more": "在「设置 → 工作流」里可以新建更多工作流。"
},
"picker": {
- "header": "{{workflow}} · 跟随项目「{{project}}」",
- "header_no_project": "{{workflow}} 状态 · 无项目",
"footer": "只显示这个任务所在工作流里的状态。右侧是进入该状态时的处理人。"
},
"confirm": {
diff --git a/packages/views/locales/zh-Hant/issues.json b/packages/views/locales/zh-Hant/issues.json
index 932cba6a93..83d32d53d8 100644
--- a/packages/views/locales/zh-Hant/issues.json
+++ b/packages/views/locales/zh-Hant/issues.json
@@ -1591,8 +1591,6 @@
"picker_more": "在「設定 → 工作流」裡可以新建更多工作流。"
},
"picker": {
- "header": "{{workflow}} · 跟隨專案「{{project}}」",
- "header_no_project": "{{workflow}} 狀態 · 無專案",
"footer": "只顯示這個任務所在工作流裡的狀態。右側是進入該狀態時的處理人。"
},
"confirm": {