fix(ui): clarify dashboard proposal hierarchy (#22180)

## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - An agent can propose dashboard areas and responsibilities in one
card.
> - The card put the area name above a separate “New area” row.
> - Responsibility rows had no type label and no visible parent
structure.
> - This pull request puts area changes in the heading and nests
responsibility changes below it.
> - People can see what each change creates and where it belongs before
they apply it.

## Linked Issues or Issue Description

**What existing behavior does this improve?**

The dashboard proposal card in task conversations and the dashboard edit
module.

**Subsystem affected**

The board UI and its Storybook examples.

**Current behavior**

“New area” appears in a row below the area title. New responsibilities
appear at the same level. Their type is not stated.

**Proposed behavior**

“New area” appears beside the area title. Each new responsibility has a
label and sits below its parent area. Existing areas have a separate
label. Area headings follow the heading level in the dashboard module.

**Reason and benefit**

The person can see the parent area, the change type and the text to
review in that order. Long proposals are easier to scan.

**Breaking changes**

None. Proposal inputs, indexes, dependencies and apply/decline endpoints
stay the same.

## What Changed

- Put area changes and their controls in the area heading.
- Nest responsibility rows under each area. Label additions, rewords,
moves and removals.
- Keep the drop/keep dependency behavior and the existing apply payload.
- Keep area classification and group partitions in one helper. Expose
whether each group has an existing parent area.
- Add Storybook examples for the new hierarchy, a narrow layout and a
mix of new and existing areas.
- Add focused component and browser checks for the hierarchy, responsive
layout and apply payload.

## Verification

- 24 focused unit tests passed across the proposal card, dashboard
module and dashboard helpers.
- 25 Chromium checks passed against current-source Storybook after the
review refactor, with one worker and no retries. They cover six proposal
states in light and dark themes at widths of 390 and 960 pixels, plus
the existing apply payload.
- The UI typecheck passed in low-memory mode after the review refactor.
The initial implementation also passed the static Storybook build;
current-head CI supplies broad build coverage.
- 30 map/catalog tests passed. Catalog checks, token gates and
whitespace checks passed.
- A hierarchy regression failed before the fix and passed after it. A
later hosted-story check found a skipped heading level. The fix passed
the expanded browser checks.
- Initial concurrent browser, build and typecheck runs hit the workspace
memory limit. The final browser pass used one worker and the typecheck
used low-memory mode.
- The first CI build stopped because its runner received a shutdown
signal after the UI build completed. A new CI run checks the review
fixes.
- The local verification selector returned exit 2 because the new
browser spec is a global CI input. [Current-head
CI](https://github.com/paperclipai/paperclip/actions/runs/44333497172)
passed typecheck, build, all selected test suites, E2E shards and the
final verify gate for `e71916cdde90ede313cc167ab8cfb8a5c3bb501a`. No
visual baseline comparison was run because the baseline manifest has no
published snapshots.
- [Greptile reviewed the current
head](https://github.com/paperclipai/paperclip/pull/22180#issuecomment-6982500386)
at 5/5 with no findings. Both earlier maintainability threads are
resolved; two Paperclip reviews remain pending.

## Risks

Low risk. This changes UI structure and labels. Long text and drop/keep
controls must continue to fit at narrow widths. The focused browser
checks cover those states. Storybook uses synthetic API data and does
not prove server persistence or permissions.

## Model Used

OpenAI GPT-6 through Codex, with reasoning, tool use and code execution.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-11-18 11:29:48 -06:00
1 parent adb2bcf896
commit a9dc0df9da
7 files changed
+268 -49

No files matched your search

@@ -59,14 +59,27 @@ describe("DashboardChangesCard", () => {
return match;
};
const group = (name: string) => container.querySelector<HTMLElement>(`section[aria-label="${name}"]`)!;
const rows = (name: string) => [...group(name).querySelectorAll<HTMLElement>("li")];
const rows = (name: string) => [...group(name).querySelectorAll<HTMLElement>("[data-dashboard-change]")];
it("identifies new areas in their headings and nests explicitly named new responsibilities", async () => {
await render(<DashboardChangesCard interaction={dashboardChangesFixture("create")} />);
const fundraising = group("Fundraising");
const area = fundraising.querySelector('[data-dashboard-change="add_area"]')!;
expect(area.querySelector("h3")?.textContent).toBe("Fundraising");
expect(area.textContent).toContain("New area");
const responsibilities = fundraising.querySelector('ul[aria-label="Responsibilities in Fundraising"]')!;
expect(responsibilities).not.toBeNull();
expect(responsibilities.contains(area)).toBe(false);
expect([...responsibilities.querySelectorAll("li")].map((row) => row.querySelector('[data-change-label]')?.textContent))
.toEqual(["New responsibility", "New responsibility"]);
});
it("shows a first dashboard grouped by area, in plain words, with the agent's reasons", async () => {
await render(<DashboardChangesCard interaction={dashboardChangesFixture("create")} />);
const text = container.textContent ?? "";
expect(text).toContain("Chief proposes");
expect(text).toContain("A first dashboard from your answers and your calendar.");
expect([...container.querySelectorAll("h4")].map((heading) => heading.textContent)).toEqual(["Fundraising", "Portfolio", "Team", "Board"]);
expect([...container.querySelectorAll("h3")].map((heading) => heading.textContent)).toEqual(["Fundraising", "Portfolio", "Team", "Board"]);
expect(rows("Fundraising").map((row) => row.getAttribute("data-dashboard-change"))).toEqual(["add_area", "add_responsibility", "add_responsibility"]);
expect(rows("Fundraising")[1]!.textContent).toContain("You run the weekly fundraising sync");
expect(text).not.toMatch(/\b(issue|interaction|op|areaRef)\b/i);
@@ -83,8 +96,21 @@ describe("DashboardChangesCard", () => {
expect(rows("Portfolio")[0]!.textContent).toContain("Moved from Fundraising");
const team = rows("Team");
// Area changes first: the rename, seen by others too, then the responsibility let go with its reason.
expect(team[0]!.textContent).toContain("TeamPeopleAlso renamed for 2 other people");
expect(team[1]!.textContent).toContain("Hire a second designer.Let goThat is a task that finishes");
expect(team[0]!.querySelector("h3")?.textContent).toBe("Team People");
expect(team[0]!.textContent).toContain("Rename areaAlso renamed for 2 other people");
expect(team[1]!.textContent).toContain("Let go of responsibilityHire a second designer.Let goThat is a task that finishes");
});
it("names the existing parent area when only a responsibility is added, and identifies area removal", async () => {
const interaction = dashboardChangesFixture("create");
await render(<DashboardChangesCard interaction={{ ...interaction, payload: { ...interaction.payload, changes: [
{ ...interaction.payload.changes[1]!, index: 0, groupRef: null, groupAreaId: "fundraising", dependsOn: [] },
{ ...interaction.payload.changes[3]!, index: 1, op: "remove_area", groupRef: null, groupAreaId: "portfolio", reason: "Someone else owns it now." },
] } }} />);
expect(group("Fundraising").textContent).toContain("FundraisingExisting areaNew responsibility");
expect(group("Portfolio").querySelector("h3")?.textContent?.trim()).toBe("Portfolio");
expect(group("Portfolio").textContent).toContain("Remove area");
expect(group("Portfolio").querySelector("ul")).toBeNull();
});
it("drops a new area together with what is filed under it, and keeps the area when one of them is kept", async () => {
@@ -101,6 +127,16 @@ describe("DashboardChangesCard", () => {
expect(acceptMock).toHaveBeenCalledExactlyOnceWith("issue-dashboard-conversation", "dashboard-changes-create", [0, 1, 2, 3, 5, 6, 7, 8, 9]);
});
it("does not label an unfiled responsibility as an existing area", async () => {
const interaction = dashboardChangesFixture("edit");
await render(<DashboardChangesCard interaction={{ ...interaction, payload: { ...interaction.payload, changes: [
{ ...interaction.payload.changes[0]!, groupAreaId: null, groupName: "No area" },
] } }} />);
expect(group("No area").textContent).not.toContain("Existing area");
expect(group("No area").querySelector("h3")?.textContent).toBe("No area");
expect(rows("No area")[0]!.textContent).toContain("Every prospective LP hears from us at least every two weeks.");
});
it("applies everything when nothing is dropped, and cannot apply nothing", async () => {
await render(<DashboardChangesCard interaction={dashboardChangesFixture("edit")} />);
for (const name of ["Fundraising", "Portfolio", "Team"]) {
@@ -12,6 +12,7 @@ import {
dashboardChangeGroups,
dashboardChangeWords,
droppedWithArea,
isDashboardAreaChange,
keptDashboardChanges,
lettingGoWith,
toggleDashboardChange,
@@ -58,6 +59,16 @@ export function useDashboardChangesActions(interaction: Pick<ProposeDashboardCha
return { accept, decline, busy: accept.isPending || decline.isPending, error: accept.error ?? decline.error };
}
const CHANGE_LABELS: Record<ResponsibilityDashboardChange["op"], string> = {
add_area: "New area",
rename_area: "Rename area",
remove_area: "Remove area",
add_responsibility: "New responsibility",
reword_responsibility: "Reword responsibility",
move_responsibility: "Move responsibility",
remove_responsibility: "Let go of responsibility",
};
function ChangeRow({
change,
changes,
@@ -73,25 +84,40 @@ function ChangeRow({
}) {
const isDropped = dropped.has(change.index);
const words = dashboardChangeWords(change);
const areaChange = isDashboardAreaChange(change);
const Row = areaChange ? "div" : "li";
const withArea = isDropped ? droppedWithArea(changes, dropped, change) : null;
const lettingGo = change.op === "remove_area" && !isDropped ? lettingGoWith(changes, dropped, change) : [];
return (
<li
className="flex min-w-0 items-start gap-2 py-2"
<Row
className="flex min-w-0 items-start gap-2"
data-dashboard-change={change.op}
data-dropped={isDropped ? "" : undefined}
>
<div className={cn("flex min-w-0 flex-1 flex-col gap-0.5", isDropped && "text-muted-foreground line-through")}>
{words.before ? <p className="break-words text-sm text-muted-foreground line-through">{words.before}</p> : null}
{words.after ? <p className={cn("break-words text-sm", !isDropped && "text-foreground")}>{words.after}</p> : null}
<div className={cn("flex min-w-0 flex-1 flex-col gap-1", isDropped && "text-muted-foreground")}>
{areaChange ? (
<div className="flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1">
<h3 className={cn("min-w-0 break-words text-base font-semibold", isDropped ? "line-through" : "text-foreground")}>
{words.before ? <span className="text-muted-foreground line-through">{words.before}{" "}</span> : null}
{words.after}
</h3>
<span data-change-label="" className="text-xs text-muted-foreground">{CHANGE_LABELS[change.op]}</span>
</div>
) : (
<>
<span data-change-label="" className="text-xs text-muted-foreground">{CHANGE_LABELS[change.op]}</span>
{words.before ? <p className="break-words text-sm text-muted-foreground line-through">{words.before}</p> : null}
{words.after ? <p className={cn("break-words text-sm", isDropped ? "line-through" : "text-foreground")}>{words.after}</p> : null}
</>
)}
{words.note ? <p className="text-xs text-muted-foreground">{words.note}</p> : null}
{lettingGo.length > 0 ? (
<p className="text-xs text-muted-foreground">Also lets go of: {lettingGo.join("; ")}</p>
) : null}
{change.reason ? <p className="text-xs text-muted-foreground">{change.reason}</p> : null}
{change.reason ? <p className="break-words text-xs text-muted-foreground">{change.reason}</p> : null}
</div>
{isDropped ? (
<div className="flex shrink-0 items-center gap-2">
<div className="flex max-w-1/3 shrink-0 flex-col items-end gap-1">
{withArea ? <span className="text-xs text-muted-foreground">Goes with {withArea}</span> : null}
<Button type="button" size="xs" variant="ghost" disabled={busy} onClick={onToggle}>Keep</Button>
</div>
@@ -110,7 +136,7 @@ function ChangeRow({
<X aria-hidden="true" />
</Button>
)}
</li>
</Row>
);
}
@@ -179,24 +205,35 @@ export function DashboardChangesCard({
<p className="text-xs text-muted-foreground">{agentName} proposes</p>
{payload.message ? <p className="text-sm text-foreground">{payload.message}</p> : null}
</div>
<div className="flex flex-col gap-3">
{groups.map((group) => (
<section key={group.key} aria-label={group.name} data-dashboard-change-group={group.key}>
<h4 className="text-sm font-semibold text-foreground">{group.name}</h4>
<ul className="flex flex-col divide-y divide-border">
{group.changes.map((change) => (
<ChangeRow
key={change.index}
change={change}
changes={changes}
dropped={dropped}
busy={busy}
onToggle={() => setDropped((current) => toggleDashboardChange(changes, current, change.index))}
/>
))}
</ul>
</section>
))}
<div className="flex flex-col gap-6">
{groups.map((group) => {
const { areaChanges, responsibilityChanges } = group;
const row = (change: ResponsibilityDashboardChange) => (
<ChangeRow
key={change.index}
change={change}
changes={changes}
dropped={dropped}
busy={busy}
onToggle={() => setDropped((current) => toggleDashboardChange(changes, current, change.index))}
/>
);
return (
<section key={group.key} aria-label={group.name} data-dashboard-change-group={group.key} className="flex min-w-0 flex-col gap-3">
{areaChanges.length > 0 ? areaChanges.map(row) : (
<div className="flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1">
<h3 className="min-w-0 break-words text-base font-semibold text-foreground">{group.name}</h3>
{group.hasExistingArea ? <span className="text-xs text-muted-foreground">Existing area</span> : null}
</div>
)}
{responsibilityChanges.length > 0 ? (
<ul aria-label={`Responsibilities in ${group.name}`} className="flex min-w-0 flex-col gap-3 pl-4 sm:pl-6">
{responsibilityChanges.map(row)}
</ul>
) : null}
</section>
);
})}
</div>
{error ? <p role="alert" className="text-sm text-destructive">{describeError(error).body}</p> : null}
{notRight ? (
@@ -209,15 +246,17 @@ export function DashboardChangesCard({
placeholder="e.g. Keep Hiring, and fewer responsibilities under Fundraising"
/>
) : (
<div className="flex flex-wrap items-center justify-end gap-2">
{showConversationLink ? (
<Button asChild type="button" variant="ghost" size="sm">
<Link to={`/issues/${interaction.issueId}`}>Open the conversation</Link>
<div className="flex flex-wrap items-center justify-between gap-2">
<div className="flex flex-wrap items-center gap-2">
{showConversationLink ? (
<Button asChild type="button" variant="ghost" size="sm">
<Link to={`/issues/${interaction.issueId}`}>Open the conversation</Link>
</Button>
) : null}
<Button type="button" variant="ghost" size="sm" disabled={busy} onClick={() => setNotRight(true)}>
Not right
</Button>
) : null}
<Button type="button" variant="ghost" size="sm" disabled={busy} onClick={() => setNotRight(true)}>
Not right
</Button>
</div>
<Button
type="button"
size="sm"