Skip to content

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

Go

fix(issues): keep Display popover ordering controls inside the popover (MUL-7296) (#8320)

Bohan Jiangada7ed164168
diff --git a/e2e/issue-display-popover.spec.ts b/e2e/issue-display-popover.spec.ts
new file mode 100644
index 0000000000..f5f9a8fb0c
--- /dev/null
+++ b/e2e/issue-display-popover.spec.ts
@@ -0,0 +1,44 @@
+import { expect, test, type Locator } from "@playwright/test";
+import { loginAsDefault } from "./helpers";
+
+/**
+ * MUL-7296: the sort-direction toggle became a text label inside a row sized
+ * for an icon, so "Newest first" rendered past the Display popover's edge and
+ * squeezed the field select down to "Created c".
+ */
+test("keeps the Display popover's ordering controls inside the popover", async ({
+ page,
+}) => {
+ await loginAsDefault(page);
+ await page.getByRole("button", { name: "Display", exact: true }).click();
+ const popover = page.locator("[data-slot=popover-content]");
+ const field = popover.locator("[aria-label=Ordering]");
+ await expect(field).toBeVisible();
+
+ async function expectFits(direction: Locator) {
+ const bounds = await popover.boundingBox();
+ const fieldBox = await field.boundingBox();
+ const directionBox = await direction.boundingBox();
+ if (!bounds || !fieldBox || !directionBox) {
+ throw new Error("Could not measure the ordering controls");
+ }
+ const right = bounds.x + bounds.width;
+ expect(fieldBox.x + fieldBox.width).toBeLessThanOrEqual(right);
+ expect(directionBox.x + directionBox.width).toBeLessThanOrEqual(right);
+ const clipped = await field
+ .locator("[data-slot=select-value]")
+ .evaluate((el) => el.scrollWidth > el.clientWidth);
+ expect(clipped).toBe(false);
+ }
+
+ // The reported default: Created date, newest first.
+ await expectFits(popover.getByRole("button", { name: "Newest first", exact: true }));
+
+ // The widest direction label.
+ await field.click();
+ await page.getByRole("option", { name: "Status", exact: true }).click();
+ await popover.getByRole("button", { name: "Workflow order", exact: true }).click();
+ await expectFits(
+ popover.getByRole("button", { name: "Reverse workflow order", exact: true }),
+ );
+});
diff --git a/packages/views/issues/components/issues-header.tsx b/packages/views/issues/components/issues-header.tsx
index fd00806d8e..388f6d7fd3 100644
--- a/packages/views/issues/components/issues-header.tsx
+++ b/packages/views/issues/components/issues-header.tsx
@@ -2115,9 +2115,10 @@ export function IssueDisplayControls({
/>
<TooltipContent side="bottom">{t(($) => $.display.tooltip)}</TooltipContent>
</Tooltip>
- <PopoverContent align="end" className="w-64 p-3">
+ <PopoverContent align="end" className="w-72 p-3">
<div className="space-y-3">
- {/* Uniform rows: caption label left, control right. Spacing
+ {/* Caption label left, control right; multi-control sections
+ (Ordering, Card properties) stack the label on top. Spacing
separates sections — no dividers (see UI rules). */}
{viewMode === "board" && (
<div className="flex items-center justify-between gap-3">
@@ -2207,11 +2208,15 @@ export function IssueDisplayControls({
/>
</label>
)}
- <div className="flex items-center justify-between gap-3">
+ <div>
<span className="text-caption font-medium text-muted-foreground">
{t(($) => $.display.ordering_section)}
</span>
- <div className="flex items-center gap-1.5">
+ {/* Direction labels run up to "Reverse workflow order", so the
+ pair gets the full popover width (w-72 keeps "Status" beside
+ it untruncated): the field select absorbs the slack and
+ truncates, the direction label never does. */}
+ <div className="mt-2 flex items-center gap-1.5">
<Select
items={[
...availableSortOptions.map((opt) => ({
@@ -2228,7 +2233,7 @@ export function IssueDisplayControls({
if (v) act.setSortBy(v as SortField);
}}
>
- <SelectTrigger size="sm" className="w-26" aria-label={t(($) => $.display.ordering_section)}>
+ <SelectTrigger size="sm" className="min-w-0 flex-1" aria-label={t(($) => $.display.ordering_section)}>
<SelectValue>{sortLabel}</SelectValue>
</SelectTrigger>
<SelectContent align="end">