Skip to content

The open-source app everyone uses to manage agents at work

feat(ui): hide task priority from the UI (keep data model) (#11024)

scotttongd84c5eae7a2b
diff --git a/ui/src/components/IssueFiltersPopover.test.tsx b/ui/src/components/IssueFiltersPopover.test.tsx
index 4fe6a11c12..718041bd66 100644
--- a/ui/src/components/IssueFiltersPopover.test.tsx
+++ b/ui/src/components/IssueFiltersPopover.test.tsx
@@ -81,4 +81,29 @@ describe("IssueFiltersPopover", () => {
expect(layoutGrid?.className).toContain("grid-cols-1");
expect(popoverContent?.textContent).toContain("Live runs only");
});
+
+ it("hides the Priority filter section while priority UI is off (PAP-411)", () => {
+ const root = createRoot(container);
+
+ act(() => {
+ root.render(
+ <IssueFiltersPopover
+ state={defaultIssueFilterState}
+ onChange={vi.fn()}
+ activeFilterCount={0}
+ agents={[{ id: "agent-1", name: "Agent One" }]}
+ projects={[{ id: "project-1", name: "Project One" }]}
+ labels={[{ id: "label-1", name: "Bug", color: "#ff0000" }]}
+ workspaces={[{ id: "workspace-1", name: "Workspace One" }]}
+ enableRoutineVisibilityFilter
+ />,
+ );
+ });
+
+ const popoverContent = container.querySelector("[data-testid='popover-content']");
+ expect(popoverContent).not.toBeNull();
+ // Status section still renders, Priority section is gated off (PAP-411).
+ expect(popoverContent?.textContent).toContain("Status");
+ expect(popoverContent?.textContent).not.toContain("Priority");
+ });
});
diff --git a/ui/src/components/IssueFiltersPopover.tsx b/ui/src/components/IssueFiltersPopover.tsx
index d702bad7b5..d491c74c1e 100644
--- a/ui/src/components/IssueFiltersPopover.tsx
+++ b/ui/src/components/IssueFiltersPopover.tsx
@@ -6,6 +6,7 @@ import { Input } from "@/components/ui/input";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import { Bot, Filter, HardDrive, Search, User, X } from "lucide-react";
import { PriorityIcon } from "./PriorityIcon";
+import { SHOW_TASK_PRIORITY_UI } from "../lib/ui-flags";
import { StatusIcon } from "./StatusIcon";
import {
defaultIssueFilterState,
@@ -191,6 +192,8 @@ export function IssueFiltersPopover({
</div>
</div>
+ {/* PAP-411: Priority filter section hidden behind SHOW_TASK_PRIORITY_UI (filter state stays intact). */}
+ {SHOW_TASK_PRIORITY_UI && (
<div className="space-y-1">
<span className="text-xs text-muted-foreground">Priority</span>
<div className="space-y-0.5">
@@ -206,6 +209,7 @@ export function IssueFiltersPopover({
))}
</div>
</div>
+ )}
</div>
<div className="min-w-0 space-y-3">
diff --git a/ui/src/components/IssueProperties.test.tsx b/ui/src/components/IssueProperties.test.tsx
index 5d795de7ce..40d8a2be4d 100644
--- a/ui/src/components/IssueProperties.test.tsx
+++ b/ui/src/components/IssueProperties.test.tsx
@@ -515,6 +515,25 @@ describe("IssueProperties", () => {
act(() => root.unmount());
});
+ it("hides the Priority property row while priority UI is off (PAP-411)", async () => {
+ const root = renderProperties(container, {
+ issue: createIssue({ priority: "high" }),
+ childIssues: [],
+ onUpdate: vi.fn(),
+ inline: true,
+ });
+ await flush();
+
+ await waitForAssertion(() => {
+ // The Triage section still renders the Status row...
+ expect(container.querySelector('[data-property-label="Status"]')).not.toBeNull();
+ // ...but the Priority row is gated behind SHOW_TASK_PRIORITY_UI (off).
+ expect(container.querySelector('[data-property-label="Priority"]')).toBeNull();
+ });
+
+ act(() => root.unmount());
+ });
+
it("shows assignee and originating without responsible wording", async () => {
mockAgentsApi.list.mockResolvedValue([{ id: "agent-1", name: "CodexCoder", status: "active", adapterType: "codex_local" }]);
const root = renderProperties(container, {
diff --git a/ui/src/components/IssueThreadInteractionCard.tsx b/ui/src/components/IssueThreadInteractionCard.tsx
index 633f2f650b..d705484268 100644
--- a/ui/src/components/IssueThreadInteractionCard.tsx
+++ b/ui/src/components/IssueThreadInteractionCard.tsx
@@ -32,6 +32,7 @@ import { Button } from "./ui/button";
import { Checkbox } from "./ui/checkbox";
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible";
import { PriorityIcon } from "./PriorityIcon";
+import { SHOW_TASK_PRIORITY_UI } from "../lib/ui-flags";
import { Textarea } from "./ui/textarea";
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
import { Badge } from "@/components/ui/badge";
@@ -512,7 +513,8 @@ function TaskTreeNode({
) : null}
<div className="min-w-0 flex-1">
<div className="flex min-w-0 items-center gap-1.5">
- {node.task.priority ? (
+ {/* PAP-411: priority UI hidden behind SHOW_TASK_PRIORITY_UI. */}
+ {SHOW_TASK_PRIORITY_UI && node.task.priority ? (
<PriorityIcon
priority={node.task.priority}
className="mt-px"
diff --git a/ui/src/components/IssuesList.test.tsx b/ui/src/components/IssuesList.test.tsx
index 5838bff996..00b9cc7a19 100644
--- a/ui/src/components/IssuesList.test.tsx
+++ b/ui/src/components/IssuesList.test.tsx
@@ -773,6 +773,54 @@ describe("IssuesList", () => {
});
});
+ it("hides the Priority option from the Sort and Group menus while priority UI is off (PAP-411)", async () => {
+ const { root } = renderWithQueryClient(
+ <IssuesList
+ issues={[createIssue({ id: "issue-1", identifier: "PAP-1", title: "Task one" })]}
+ agents={[]}
+ projects={[]}
+ viewStateKey="paperclip:test-issues"
+ onUpdateIssue={() => undefined}
+ />,
+ container,
+ );
+
+ await waitForAssertion(() => {
+ expect(container.querySelectorAll('[data-testid="issue-row"]').length).toBeGreaterThan(0);
+ });
+
+ const sortButton = Array.from(container.querySelectorAll("button")).find(
+ (button) => button.getAttribute("title") === "Sort",
+ );
+ expect(sortButton).toBeTruthy();
+ act(() => {
+ sortButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
+ });
+ await waitForAssertion(() => {
+ const labels = Array.from(document.body.querySelectorAll("button")).map((b) => b.textContent ?? "");
+ // Status sort option renders, but the Priority option is gated off (PAP-411).
+ expect(labels.some((text) => text.includes("Status"))).toBe(true);
+ expect(labels.some((text) => text.includes("Priority"))).toBe(false);
+ });
+
+ const groupButton = Array.from(container.querySelectorAll("button")).find(
+ (button) => button.getAttribute("title") === "Group",
+ );
+ expect(groupButton).toBeTruthy();
+ act(() => {
+ groupButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
+ });
+ await waitForAssertion(() => {
+ const labels = Array.from(document.body.querySelectorAll("button")).map((b) => b.textContent ?? "");
+ expect(labels.some((text) => text.includes("Status"))).toBe(true);
+ expect(labels.some((text) => text.includes("Priority"))).toBe(false);
+ });
+
+ act(() => {
+ root.unmount();
+ });
+ });
+
it("hides the workflow blocker chip when a sub-issue is blocked only by its previous sibling", async () => {
const firstChild = createIssue({
id: "issue-first-child",
diff --git a/ui/src/components/IssuesList.tsx b/ui/src/components/IssuesList.tsx
index 2aeb017322..d463691c55 100644
--- a/ui/src/components/IssuesList.tsx
+++ b/ui/src/components/IssuesList.tsx
@@ -46,6 +46,7 @@ import {
type InboxIssueColumn,
} from "../lib/inbox";
import { cn, formatDurationMs, formatTokens } from "../lib/utils";
+import { SHOW_TASK_PRIORITY_UI } from "../lib/ui-flags";
import { collectSubtreeLiveCounts } from "../lib/liveIssueIds";
import {
InboxIssueMetaLeading,
@@ -1827,6 +1828,7 @@ export function IssuesList({
</PopoverTrigger>
<PopoverContent align="end" className="w-48 p-0">
<div className="p-2 space-y-0.5">
+ {/* PAP-411: "priority" sort option hidden behind SHOW_TASK_PRIORITY_UI (comparator stays dormant). */}
{([
["workflow", "Workflow"],
["status", "Status"],
@@ -1834,7 +1836,9 @@ export function IssuesList({
["title", "Title"],
["created", "Created"],
["updated", "Updated"],
- ] as const).map(([field, label]) => (
+ ] as const)
+ .filter(([field]) => SHOW_TASK_PRIORITY_UI || field !== "priority")
+ .map(([field, label]) => (
<button
key={field}
className={`flex items-center justify-between w-full px-2 py-1.5 text-sm rounded-sm ${
@@ -1871,6 +1875,7 @@ export function IssuesList({
</PopoverTrigger>
<PopoverContent align="end" className="w-44 p-0">
<div className="p-2 space-y-0.5">
+ {/* PAP-411: "priority" group-by option hidden behind SHOW_TASK_PRIORITY_UI (group logic stays dormant). */}
{([
["status", "Status"],
["priority", "Priority"],
@@ -1879,7 +1884,9 @@ export function IssuesList({
["workspace", "Workspace"],
["parent", "Parent Task"],
["none", "None"],
- ] as const).map(([value, label]) => (
+ ] as const)
+ .filter(([value]) => SHOW_TASK_PRIORITY_UI || value !== "priority")
+ .map(([value, label]) => (
<button
key={value}
className={`flex items-center justify-between w-full px-2 py-1.5 text-sm rounded-sm ${
diff --git a/ui/src/components/KanbanBoard.tsx b/ui/src/components/KanbanBoard.tsx
index abe0eff2c6..f251729e34 100644
--- a/ui/src/components/KanbanBoard.tsx
+++ b/ui/src/components/KanbanBoard.tsx
@@ -19,6 +19,7 @@ import {
} from "@dnd-kit/sortable";
import { StatusIcon } from "./StatusIcon";
import { PriorityIcon } from "./PriorityIcon";
+import { SHOW_TASK_PRIORITY_UI } from "../lib/ui-flags";
import { Identity } from "./Identity";
import type { Issue, IssueStatus } from "@paperclipai/shared";
import { AlertTriangle } from "lucide-react";
@@ -361,7 +362,8 @@ function KanbanCard({
</div>
<p className={`${compact ? "mb-1.5 text-xs" : "mb-2 text-sm"} leading-snug line-clamp-2`}>{issue.title}</p>
<div className="flex items-center gap-2 min-w-0">
- <PriorityIcon priority={issue.priority} />
+ {/* PAP-411: priority UI hidden behind SHOW_TASK_PRIORITY_UI. */}
+ {SHOW_TASK_PRIORITY_UI && <PriorityIcon priority={issue.priority} />}
{issue.assigneeAgentId && (() => {
const name = agentName(issue.assigneeAgentId);
return name ? (
diff --git a/ui/src/components/NewIssueDialog.test.tsx b/ui/src/components/NewIssueDialog.test.tsx
index b103b7eedd..5b11679b0f 100644
--- a/ui/src/components/NewIssueDialog.test.tsx
+++ b/ui/src/components/NewIssueDialog.test.tsx
@@ -1111,24 +1111,49 @@ describe("NewIssueDialog", () => {
act(() => root.unmount());
});
- it("keeps priority under the mobile overflow menu", async () => {
+ it("hides the priority chip and mobile priority option (PAP-411)", async () => {
const { root } = renderDialog(container);
await flush();
+ // PAP-411: priority UI is hidden behind SHOW_TASK_PRIORITY_UI (off). Neither the
+ // desktop priority chip nor the mobile overflow priority option should render.
const priorityChip = container.querySelector('[data-testid="new-issue-priority-chip"]');
- expect(priorityChip?.className).toContain("hidden");
- expect(priorityChip?.className).toContain("sm:inline-flex");
+ expect(priorityChip).toBeNull();
const highPriorityOption = container.querySelector('[data-testid="new-issue-more-priority-high"]');
- expect(highPriorityOption?.textContent).toContain("High");
+ expect(highPriorityOption).toBeNull();
+
+ act(() => root.unmount());
+ });
+
+ it("still submits the default priority when the priority UI is hidden (PAP-411)", async () => {
+ dialogState.newIssueDefaults = {
+ title: "Priority default persists",
+ };
+
+ const { root } = renderDialog(container);
+ await flush();
+
+ const submitButton = Array.from(container.querySelectorAll("button"))
+ .find((button) => button.textContent?.includes("Create Task"));
+ expect(submitButton).not.toBeUndefined();
+ await vi.waitFor(() => {
+ expect(submitButton?.hasAttribute("disabled")).toBe(false);
+ });
await act(async () => {
- highPriorityOption?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
+ submitButton!.dispatchEvent(new MouseEvent("click", { bubbles: true }));
});
await flush();
- const selectedHighPriorityOption = container.querySelector('[data-testid="new-issue-more-priority-high"]');
- expect(selectedHighPriorityOption?.className).toContain("bg-accent");
+ // PAP-411: the priority control is hidden, but the data-model default must survive.
+ expect(mockIssuesApi.create).toHaveBeenCalledWith(
+ "company-1",
+ expect.objectContaining({
+ title: "Priority default persists",
+ priority: "medium",
+ }),
+ );
act(() => root.unmount());
});
diff --git a/ui/src/components/NewIssueDialog.tsx b/ui/src/components/NewIssueDialog.tsx
index cfe630b871..35d1f627ba 100644
--- a/ui/src/components/NewIssueDialog.tsx
+++ b/ui/src/components/NewIssueDialog.tsx
@@ -73,6 +73,7 @@ import { Textarea } from "@/components/ui/textarea";
import { cn } from "../lib/utils";
import { extractProviderIdWithFallback } from "../lib/model-utils";
import { issueStatusText, issueStatusTextDefault, priorityColor, priorityColorDefault } from "../lib/status-colors";
+import { SHOW_TASK_PRIORITY_UI } from "../lib/ui-flags";
import { MarkdownEditor, type MarkdownEditorRef, type MentionOption } from "./MarkdownEditor";
import { AgentIcon } from "./AgentIconPicker";
import { InlineEntitySelector, type InlineEntityOption } from "./InlineEntitySelector";
@@ -2072,7 +2073,8 @@ export function NewIssueDialog() {
</PopoverContent>
</Popover>
- {/* Priority chip */}
+ {/* Priority chip — PAP-411: hidden behind SHOW_TASK_PRIORITY_UI. */}
+ {SHOW_TASK_PRIORITY_UI && (
<Popover open={priorityOpen} onOpenChange={setPriorityOpen}>
<PopoverTrigger asChild>
<button
@@ -2109,6 +2111,7 @@ export function NewIssueDialog() {
))}
</PopoverContent>
</Popover>
+ )}
{/* Labels chip — disabled, not wired up yet */}
{/* <button className="inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-xs hover:bg-accent/50 transition-colors text-muted-foreground">
@@ -2187,6 +2190,8 @@ export function NewIssueDialog() {
</button>
</PopoverTrigger>
<PopoverContent className="w-44 p-1" align="start" data-testid="new-issue-more-menu">
+ {/* PAP-411: mobile priority section hidden behind SHOW_TASK_PRIORITY_UI. */}
+ {SHOW_TASK_PRIORITY_UI && (
<div className="sm:hidden">
<div className="px-2 py-1 text-(length:--text-nano) font-medium uppercase text-muted-foreground">
Priority
@@ -2211,6 +2216,7 @@ export function NewIssueDialog() {
))}
<div className="my-1 border-t border-border" />
</div>
+ )}
<button className="flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-accent/50 text-muted-foreground">
<Calendar className="h-3 w-3" />
Start date
diff --git a/ui/src/components/issue-properties/IssueProperties.tsx b/ui/src/components/issue-properties/IssueProperties.tsx
index 45a115beb7..48112bd8f3 100644
--- a/ui/src/components/issue-properties/IssueProperties.tsx
+++ b/ui/src/components/issue-properties/IssueProperties.tsx
@@ -44,6 +44,7 @@ import { useRetryNowMutation } from "../../hooks/useRetryNowMutation";
import { RetryErrorBand } from "../IssueScheduledRetryCard";
import { StatusIcon } from "../StatusIcon";
import { PriorityIcon } from "../PriorityIcon";
+import { SHOW_TASK_PRIORITY_UI } from "../../lib/ui-flags";
import { Identity } from "../Identity";
import { IssueReferencePill } from "../IssueReferencePill";
import { formatDate, formatDateTime, cn, projectUrl } from "../../lib/utils";
@@ -2026,13 +2027,16 @@ export function IssueProperties({
/>
</PropertyRow>
- <PropertyRow label="Priority">
- <PriorityIcon
- priority={issue.priority}
- onChange={(priority) => onUpdate({ priority })}
- showLabel
- />
- </PropertyRow>
+ {/* PAP-411: priority UI is hidden behind SHOW_TASK_PRIORITY_UI. Revive by flipping the flag. */}
+ {SHOW_TASK_PRIORITY_UI && (
+ <PropertyRow label="Priority">
+ <PriorityIcon
+ priority={issue.priority}
+ onChange={(priority) => onUpdate({ priority })}
+ showLabel
+ />
+ </PropertyRow>
+ )}
<PropertyPicker
inline={inline}
diff --git a/ui/src/components/search/SearchFilterBar.tsx b/ui/src/components/search/SearchFilterBar.tsx
index 3c75fb5c0b..9dfd16631a 100644
--- a/ui/src/components/search/SearchFilterBar.tsx
+++ b/ui/src/components/search/SearchFilterBar.tsx
@@ -10,6 +10,7 @@ import {
} from "@paperclipai/shared";
import { StatusIcon } from "@/components/StatusIcon";
import { PriorityIcon } from "@/components/PriorityIcon";
+import { SHOW_TASK_PRIORITY_UI } from "@/lib/ui-flags";
import { SearchFilterMenu, type FilterMenuOption } from "./SearchFilterMenu";
import { SearchSortMenu } from "./SearchSortMenu";
import {
@@ -197,6 +198,8 @@ export function SearchFilterBar({
searchPlaceholder="Search labels…"
emptyMessage="No labels"
/>
+ {/* PAP-411: Priority filter menu hidden behind SHOW_TASK_PRIORITY_UI (search DSL stays intact). */}
+ {SHOW_TASK_PRIORITY_UI && (
<SearchFilterMenu
label="Priority"
multi
@@ -205,6 +208,7 @@ export function SearchFilterBar({
onToggle={(value) => toggleMulti("priority", value)}
onClear={() => onChange({ ...filters, priority: [] })}
/>
+ )}
<SearchFilterMenu
label="Updated"
options={options.updated}
diff --git a/ui/src/components/search/SearchFilterSheet.tsx b/ui/src/components/search/SearchFilterSheet.tsx
index b1b3946a61..602bd1ff24 100644
--- a/ui/src/components/search/SearchFilterSheet.tsx
+++ b/ui/src/components/search/SearchFilterSheet.tsx
@@ -11,6 +11,7 @@ import {
SheetTitle,
} from "@/components/ui/sheet";
import { cn } from "@/lib/utils";
+import { SHOW_TASK_PRIORITY_UI } from "@/lib/ui-flags";
import {
applyAssigneeToken,
assigneeToken,
@@ -154,12 +155,15 @@ export function SearchFilterSheet({
selected={draft.status ?? []}
onToggle={(value) => toggleMulti("status", value)}
/>
+ {/* PAP-411: Priority filter group hidden behind SHOW_TASK_PRIORITY_UI (search DSL stays intact). */}
+ {SHOW_TASK_PRIORITY_UI && (
<ChipToggleGroup
title="Priority"
options={options.priority}
selected={draft.priority ?? []}
onToggle={(value) => toggleMulti("priority", value)}
/>
+ )}
<ChipToggleGroup
title="Assignee"
options={options.assignee}
diff --git a/ui/src/lib/search-filters.ts b/ui/src/lib/search-filters.ts
index b08302ba14..f0fb139cc3 100644
--- a/ui/src/lib/search-filters.ts
+++ b/ui/src/lib/search-filters.ts
@@ -136,6 +136,11 @@ export function buildFilterChips(filters: SearchFilters, lookups: FilterChipLook
},
});
}
+ // PAP-411: priority controls are hidden from the UI, but the priority filter
+ // DSL (`priority:high`) stays functional at the data layer per board decision.
+ // A priority filter can therefore still enter the query via URL round-trip or
+ // typed DSL, so we always render a removable chip for it — otherwise a restored
+ // priority filter would silently narrow results with no way to see or clear it.
for (const priority of filters.priority ?? []) {
chips.push({
id: `priority:${priority}`,
diff --git a/ui/src/lib/ui-flags.ts b/ui/src/lib/ui-flags.ts
new file mode 100644
index 0000000000..8f5c4f80d0
--- /dev/null
+++ b/ui/src/lib/ui-flags.ts
@@ -0,0 +1,22 @@
+/**
+ * Product UI feature flags.
+ *
+ * These are compile-time constants that gate presentation-only surfaces. They
+ * deliberately do NOT touch the data model, API, validation, or filter DSL — a
+ * gated feature stays fully functional at the data layer and can be revived by
+ * flipping the flag back to `true`.
+ */
+
+/**
+ * Controls whether task/issue **priority** indicators and controls are shown in
+ * the product UI.
+ *
+ * Set to `false` for PAP-411 ("remove task priority level from the UI"). The
+ * priority data model, API params, Zod validation (including the `"medium"`
+ * default), and filter DSL are intentionally left intact so priority can be
+ * revived by flipping this single boolean back to `true`.
+ *
+ * Typed as `boolean` (not the literal `false`) on purpose: this keeps
+ * TypeScript and lint from flagging the gated branches as unreachable/dead code.
+ */
+export const SHOW_TASK_PRIORITY_UI: boolean = false;
diff --git a/ui/src/pages/AgentDetail.tsx b/ui/src/pages/AgentDetail.tsx
index 5a7202b908..4f7a21986c 100644
--- a/ui/src/pages/AgentDetail.tsx
+++ b/ui/src/pages/AgentDetail.tsx
@@ -14,6 +14,7 @@ import { heartbeatsApi } from "../api/heartbeats";
import { instanceSettingsApi } from "../api/instanceSettings";
import { ApiError } from "../api/client";
import { ChartCard, RunActivityChart, PriorityChart, IssueStatusChart, SuccessRateChart } from "../components/ActivityCharts";
+import { SHOW_TASK_PRIORITY_UI } from "../lib/ui-flags";
import { activityApi } from "../api/activity";
import { accessApi } from "../api/access";
import { issuesApi } from "../api/issues";
@@ -1542,9 +1543,12 @@ function AgentOverview({
<ChartCard title="Run Activity" subtitle="Last 14 days">
<RunActivityChart runs={runs} />
</ChartCard>
- <ChartCard title="Tasks by Priority" subtitle="Last 14 days">
- <PriorityChart issues={assignedIssues} />
- </ChartCard>
+ {/* PAP-411: "Tasks by Priority" chart hidden behind SHOW_TASK_PRIORITY_UI. */}
+ {SHOW_TASK_PRIORITY_UI && (
+ <ChartCard title="Tasks by Priority" subtitle="Last 14 days">
+ <PriorityChart issues={assignedIssues} />
+ </ChartCard>
+ )}
<ChartCard title="Tasks by Status" subtitle="Last 14 days">
<IssueStatusChart issues={assignedIssues} />
</ChartCard>
diff --git a/ui/src/pages/Dashboard.tsx b/ui/src/pages/Dashboard.tsx
index 5146c19191..f3ff724def 100644
--- a/ui/src/pages/Dashboard.tsx
+++ b/ui/src/pages/Dashboard.tsx
@@ -21,6 +21,7 @@ import { ActivityRow } from "../components/ActivityRow";
import { Identity } from "../components/Identity";
import { timeAgo } from "../lib/timeAgo";
import { cn, formatCents } from "../lib/utils";
+import { SHOW_TASK_PRIORITY_UI } from "../lib/ui-flags";
import { Bot, CircleDot, DollarSign, ShieldCheck, LayoutDashboard, PauseCircle } from "lucide-react";
import { ActiveAgentsPanel } from "../components/ActiveAgentsPanel";
import { ChartCard, RunActivityChart, PriorityChart, IssueStatusChart, SuccessRateChart } from "../components/ActivityCharts";
@@ -316,9 +317,12 @@ export function Dashboard() {
<ChartCard title="Run Activity" subtitle="Last 14 days">
<RunActivityChart activity={data.runActivity} />
</ChartCard>
- <ChartCard title="Tasks by Priority" subtitle="Last 14 days">
- <PriorityChart issues={issues ?? []} />
- </ChartCard>
+ {/* PAP-411: "Tasks by Priority" chart hidden behind SHOW_TASK_PRIORITY_UI. */}
+ {SHOW_TASK_PRIORITY_UI && (
+ <ChartCard title="Tasks by Priority" subtitle="Last 14 days">
+ <PriorityChart issues={issues ?? []} />
+ </ChartCard>
+ )}
<ChartCard title="Tasks by Status" subtitle="Last 14 days">
<IssueStatusChart issues={issues ?? []} />
</ChartCard>
diff --git a/ui/src/pages/DesignGuide.tsx b/ui/src/pages/DesignGuide.tsx
index f54ae6c2cc..d62334bef0 100644
--- a/ui/src/pages/DesignGuide.tsx
+++ b/ui/src/pages/DesignGuide.tsx
@@ -125,6 +125,7 @@ import { StatusIcon } from "@/components/StatusIcon";
import { EnforcementBanner } from "@/components/EnforcementBanner";
import { ActionCard, ActionCardMobile, BindingsTable } from "@/components/actions/ActionCard";
import { PriorityIcon } from "@/components/PriorityIcon";
+import { SHOW_TASK_PRIORITY_UI } from "@/lib/ui-flags";
import { agentStatusDot, agentStatusDotDefault } from "@/lib/status-colors";
import { EntityRow } from "@/components/EntityRow";
import { EmptyState } from "@/components/EmptyState";
@@ -384,7 +385,10 @@ export function DesignGuide() {
);
const [filters, setFilters] = useState<FilterValue[]>([
{ key: "status", label: "Status", value: "Active" },
- { key: "priority", label: "Priority", value: "High" },
+ // PAP-411: priority filter demo row suppressed while SHOW_TASK_PRIORITY_UI is off.
+ ...(SHOW_TASK_PRIORITY_UI
+ ? [{ key: "priority", label: "Priority", value: "High" } as FilterValue]
+ : []),
]);
const [allowExternal, setAllowExternal] = useState(false);
const [allowUnpinned, setAllowUnpinned] = useState(false);
@@ -637,6 +641,8 @@ export function DesignGuide() {
</div>
</SubSection>
+ {/* PAP-411: PriorityIcon showcase gated behind SHOW_TASK_PRIORITY_UI per board decision. */}
+ {SHOW_TASK_PRIORITY_UI && (
<SubSection title="PriorityIcon (interactive)">
<div className="flex items-center gap-3 flex-wrap">
{["critical", "high", "medium", "low"].map((p) => (
@@ -651,6 +657,7 @@ export function DesignGuide() {
<span className="text-sm">Click the icon to change (current: {priority})</span>
</div>
</SubSection>
+ )}
<SubSection title="Agent status dots">
<div className="flex items-center gap-4 flex-wrap">
@@ -1123,7 +1130,8 @@ export function DesignGuide() {
leading={
<>
<StatusIcon status="in_progress" />
- <PriorityIcon priority="high" />
+ {/* PAP-411: PriorityIcon hidden behind SHOW_TASK_PRIORITY_UI. */}
+ {SHOW_TASK_PRIORITY_UI && <PriorityIcon priority="high" />}
</>
}
identifier="PAP-001"
@@ -1136,7 +1144,7 @@ export function DesignGuide() {
leading={
<>
<StatusIcon status="done" />
- <PriorityIcon priority="medium" />
+ {SHOW_TASK_PRIORITY_UI && <PriorityIcon priority="medium" />}
</>
}
identifier="PAP-002"
@@ -1149,7 +1157,7 @@ export function DesignGuide() {
leading={
<>
<StatusIcon status="todo" />
- <PriorityIcon priority="low" />
+ {SHOW_TASK_PRIORITY_UI && <PriorityIcon priority="low" />}
</>
}
identifier="PAP-003"
@@ -1161,7 +1169,7 @@ export function DesignGuide() {
leading={
<>
<StatusIcon status="blocked" />
- <PriorityIcon priority="critical" />
+ {SHOW_TASK_PRIORITY_UI && <PriorityIcon priority="critical" />}
</>
}
identifier="PAP-004"
@@ -1249,7 +1257,10 @@ export function DesignGuide() {
onClick={() =>
setFilters([
{ key: "status", label: "Status", value: "Active" },
- { key: "priority", label: "Priority", value: "High" },
+ // PAP-411: priority filter demo row suppressed while SHOW_TASK_PRIORITY_UI is off.
+ ...(SHOW_TASK_PRIORITY_UI
+ ? [{ key: "priority", label: "Priority", value: "High" } as FilterValue]
+ : []),
])
}
>
@@ -1429,10 +1440,13 @@ export function DesignGuide() {
<span className="text-xs text-muted-foreground">Status</span>
<StatusBadge status="active" />
</div>
- <div className="flex items-center justify-between py-1.5">
- <span className="text-xs text-muted-foreground">Priority</span>
- <PriorityIcon priority="high" />
- </div>
+ {/* PAP-411: priority metadata row hidden behind SHOW_TASK_PRIORITY_UI. */}
+ {SHOW_TASK_PRIORITY_UI && (
+ <div className="flex items-center justify-between py-1.5">
+ <span className="text-xs text-muted-foreground">Priority</span>
+ <PriorityIcon priority="high" />
+ </div>
+ )}
<div className="flex items-center justify-between py-1.5">
<span className="text-xs text-muted-foreground">Responsible</span>
<div className="flex items-center gap-1.5">
@@ -1500,14 +1514,15 @@ export function DesignGuide() {
<span className="text-xs text-muted-foreground ml-1">2</span>
</div>
<div className="border border-border rounded-b-md">
+ {/* PAP-411: leading PriorityIcon hidden behind SHOW_TASK_PRIORITY_UI. */}
<EntityRow
- leading={<PriorityIcon priority="high" />}
+ leading={SHOW_TASK_PRIORITY_UI ? <PriorityIcon priority="high" /> : undefined}
identifier="PAP-101"
title="Build agent heartbeat system"
onClick={() => {}}
/>
<EntityRow
- leading={<PriorityIcon priority="medium" />}
+ leading={SHOW_TASK_PRIORITY_UI ? <PriorityIcon priority="medium" /> : undefined}
identifier="PAP-102"
title="Add cost tracking dashboard"
onClick={() => {}}
diff --git a/ui/src/pages/IssueDetail.test.tsx b/ui/src/pages/IssueDetail.test.tsx
index fa0d1b5c4a..8ef40448e7 100644
--- a/ui/src/pages/IssueDetail.test.tsx
+++ b/ui/src/pages/IssueDetail.test.tsx
@@ -1108,7 +1108,7 @@ describe("IssueDetail", () => {
expect(mockDecisionsApi.list).not.toHaveBeenCalled();
});
- it("updates status and priority from the task header controls", async () => {
+ it("updates status from the task header control and hides the priority control (PAP-411)", async () => {
const issue = createIssue({ status: "todo", priority: "medium" });
mockIssuesApi.get.mockResolvedValue(issue);
mockIssuesApi.update.mockImplementation(async (_issueId: string, data: Record<string, unknown>) => ({
@@ -1133,7 +1133,9 @@ describe("IssueDetail", () => {
'button[aria-label="Change priority (current: medium)"]',
);
expect(statusButton).not.toBeNull();
- expect(priorityButton).not.toBeNull();
+ // PAP-411: priority UI is hidden behind SHOW_TASK_PRIORITY_UI (off), so the header
+ // priority control must not render.
+ expect(priorityButton).toBeNull();
await act(async () => {
statusButton!.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true }));
@@ -1141,13 +1143,10 @@ describe("IssueDetail", () => {
await waitForAssertion(() => {
expect(mockIssuesApi.update).toHaveBeenCalledWith(issue.identifier, { status: "done" });
});
-
- await act(async () => {
- priorityButton!.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true }));
- });
- await waitForAssertion(() => {
- expect(mockIssuesApi.update).toHaveBeenCalledWith(issue.identifier, { priority: "high" });
- });
+ expect(mockIssuesApi.update).not.toHaveBeenCalledWith(
+ issue.identifier,
+ expect.objectContaining({ priority: expect.anything() }),
+ );
mockIssuesApi.update.mockReset();
});
diff --git a/ui/src/pages/IssueDetail.tsx b/ui/src/pages/IssueDetail.tsx
index 483fb2860d..1c632986e4 100644
--- a/ui/src/pages/IssueDetail.tsx
+++ b/ui/src/pages/IssueDetail.tsx
@@ -135,6 +135,7 @@ import { ArtifactFileChip } from "../components/ArtifactFileChip";
import { ScrollToBottom } from "../components/ScrollToBottom";
import { StatusIcon } from "../components/StatusIcon";
import { PriorityIcon } from "../components/PriorityIcon";
+import { SHOW_TASK_PRIORITY_UI } from "../lib/ui-flags";
import { ProductivityReviewBadge } from "../components/ProductivityReviewBadge";
import { Identity } from "../components/Identity";
import { PluginSlotMount, PluginSlotOutlet, usePluginSlots } from "@/plugins/slots";
@@ -706,7 +707,8 @@ function IssueDetailLoadingState({
{headerSeed ? (
<>
<StatusIcon status={headerSeed.status} blockerAttention={headerSeed.blockerAttention} />
- <PriorityIcon priority={headerSeed.priority} />
+ {/* PAP-411: priority UI hidden behind SHOW_TASK_PRIORITY_UI. */}
+ {SHOW_TASK_PRIORITY_UI && <PriorityIcon priority={headerSeed.priority} />}
{identifier ? (
<span className="text-sm font-mono text-muted-foreground shrink-0">{identifier}</span>
) : null}
@@ -4195,10 +4197,13 @@ export function IssueDetail() {
blockerAttention={issue.blockerAttention}
onChange={(status) => updateIssue.mutate({ status })}
/>
- <PriorityIcon
- priority={issue.priority}
- onChange={(priority) => updateIssue.mutate({ priority })}
- />
+ {/* PAP-411: priority UI hidden behind SHOW_TASK_PRIORITY_UI. */}
+ {SHOW_TASK_PRIORITY_UI && (
+ <PriorityIcon
+ priority={issue.priority}
+ onChange={(priority) => updateIssue.mutate({ priority })}
+ />
+ )}
<span className="text-sm font-mono text-muted-foreground shrink-0">{issue.identifier ?? issue.id.slice(0, 8)}</span>
{hasLiveRuns && (