Skip to content

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

Go

MUL-9233: top-align property rows so wrapped labels sit beside their key (#10577)

Jiayuan Zhang1da5c5e68ded
diff --git a/packages/views/common/prop-row.tsx b/packages/views/common/prop-row.tsx
index e1cf232291..c4f4488732 100644
--- a/packages/views/common/prop-row.tsx
+++ b/packages/views/common/prop-row.tsx
@@ -18,6 +18,12 @@ import { cn } from "@multica/ui/lib/utils";
* that broke whenever a label (e.g. "Concurrency") rendered wider than 64px
* — the label would overflow into the gap and collide with the value.
*
+ * Both cells are at least one row tall (`min-h-8`) and centre their content,
+ * and the row aligns them to the top. A single-line value therefore sits on
+ * the label's line exactly as before, while a value that wraps (several label
+ * chips) keeps the label beside its first line instead of drifting to the
+ * middle of the block.
+ *
* `interactive` (default `true`) controls whether the row gets a hover
* highlight. Most rows wrap a Picker/Popover trigger and are clickable
* anywhere across the row, so the highlight tells users "this is one
@@ -43,15 +49,15 @@ export function PropRow({
return (
<div
className={cn(
- "-mx-2 col-span-2 grid min-h-8 grid-cols-subgrid items-center rounded-md px-2",
+ "-mx-2 col-span-2 grid min-h-8 grid-cols-subgrid items-start rounded-md px-2",
interactive && "transition-colors hover:bg-accent/50",
className,
)}
>
- <span className="flex min-w-0 items-center gap-1.5 text-label text-muted-foreground">
+ <span className="flex min-h-8 min-w-0 items-center gap-1.5 text-label text-muted-foreground">
{label}
</span>
- <div className="flex min-w-0 items-center gap-1.5 truncate text-label">
+ <div className="flex min-h-8 min-w-0 items-center gap-1.5 truncate text-label">
{children}
</div>
</div>
diff --git a/packages/views/issues/components/pickers/label-picker.tsx b/packages/views/issues/components/pickers/label-picker.tsx
index f393411945..b2709da068 100644
--- a/packages/views/issues/components/pickers/label-picker.tsx
+++ b/packages/views/issues/components/pickers/label-picker.tsx
@@ -240,11 +240,13 @@ export function LabelPicker({
// In a custom trigger (PillButton) the trigger is itself a button, so the
// chips can't carry their own remove button. Otherwise fall back to the
- // chip-wrap div used by the issue-detail sidebar.
+ // chip-wrap div used by the issue-detail sidebar. Its `py-1.5` puts the
+ // first line of 20px chips at the centre of a 32px property row, level with
+ // the row's label, however many lines the chips wrap onto.
const resolvedTriggerRender =
triggerRender ??
(hasLabels ? (
- <div className="flex flex-wrap items-center gap-1 cursor-pointer rounded-xs px-1 -mx-1 hover:bg-accent/30 transition-colors" />
+ <div className="flex flex-wrap items-center gap-1 cursor-pointer rounded-xs px-1 -mx-1 py-1.5 hover:bg-accent/30 transition-colors" />
) : undefined);
return (
diff --git a/packages/views/layout/object-page.tsx b/packages/views/layout/object-page.tsx
index 5855af6b6e..ef4ea79062 100644
--- a/packages/views/layout/object-page.tsx
+++ b/packages/views/layout/object-page.tsx
@@ -361,14 +361,20 @@ export function ObjectPanelSection({
);
}
-/** One label and value in the properties panel; the value may be a picker. */
+/**
+ * One label and value in the properties panel; the value may be a picker.
+ *
+ * Top-aligned like `PropRow`: the label is one 32px line and the value centres
+ * within at least that height, so a value that wraps (several label chips)
+ * keeps the label beside its first line.
+ */
export function ObjectProperty({ label, children }: { label: ReactNode; children: ReactNode }) {
return (
- <div className="-mx-2 flex min-h-8 items-center gap-2 rounded-md px-2 transition-colors hover:bg-accent/50">
+ <div className="-mx-2 flex min-h-8 items-start gap-2 rounded-md px-2 transition-colors hover:bg-accent/50">
<TruncatedTooltip content={label} focusable>
- <span className="w-20 shrink-0 truncate text-caption text-muted-foreground">{label}</span>
+ <span className="w-20 shrink-0 truncate text-caption leading-8 text-muted-foreground">{label}</span>
</TruncatedTooltip>
- <div className="flex min-w-0 flex-1 items-center gap-1.5 truncate text-caption">{children}</div>
+ <div className="flex min-h-8 min-w-0 flex-1 items-center gap-1.5 truncate text-caption">{children}</div>
</div>
);
}
diff --git a/packages/views/skills/components/skill-properties-panel.tsx b/packages/views/skills/components/skill-properties-panel.tsx
index f39ace37a6..f3f55aded2 100644
--- a/packages/views/skills/components/skill-properties-panel.tsx
+++ b/packages/views/skills/components/skill-properties-panel.tsx
@@ -31,7 +31,7 @@ function ReadOnlySkillLabels({ skillId }: { skillId: string }) {
const { data: labels = [] } = useQuery(resourceLabelsOptions(wsId, "skill", skillId));
if (labels.length === 0) return <span className="text-muted-foreground">—</span>;
return (
- <div className="flex min-w-0 flex-wrap gap-1">
+ <div className="flex min-w-0 flex-wrap gap-1 py-1.5">
{labels.map((label) => (
<LabelChip key={label.id} label={label} />
))}