From 7ae637977df8cc7330e0ebb05ff914c93e4d98a9 Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 24 Apr 2026 09:26:51 -0500 Subject: [PATCH] PAP-2118 address final greptile polish Co-Authored-By: Paperclip --- ui/src/components/InlineEditor.tsx | 2 +- ui/src/components/MarkdownBody.test.tsx | 14 +++++++++++++- ui/src/components/MarkdownBody.tsx | 3 ++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ui/src/components/InlineEditor.tsx b/ui/src/components/InlineEditor.tsx index 1d0866a9b7a..f866eecdc03 100644 --- a/ui/src/components/InlineEditor.tsx +++ b/ui/src/components/InlineEditor.tsx @@ -250,7 +250,7 @@ export function InlineEditor({ }, [autosaveState, commit, draft, markDirty, multiline, multilineFocused, nullable, reset, runSave, value]); if (multiline) { - const previewValue = autosaveState === "saved" ? draft : value; + const previewValue = autosaveState === "saved" || autosaveState === "idle" ? draft : value; const hasValue = Boolean(previewValue.trim()); const showEditor = multilineEditing || multilineFocused || !hasValue; diff --git a/ui/src/components/MarkdownBody.test.tsx b/ui/src/components/MarkdownBody.test.tsx index 08362b7f3f0..894fa8a7344 100644 --- a/ui/src/components/MarkdownBody.test.tsx +++ b/ui/src/components/MarkdownBody.test.tsx @@ -33,7 +33,7 @@ vi.mock("../api/issues", () => ({ issuesApi: mockIssuesApi, })); -function renderMarkdown(children: string, seededIssues: Array<{ identifier: string; status: string }> = []) { +function renderMarkdown(children: string, seededIssues: Array<{ identifier: string; status: string; title?: string }> = []) { const queryClient = new QueryClient({ defaultOptions: { queries: { @@ -47,6 +47,7 @@ function renderMarkdown(children: string, seededIssues: Array<{ identifier: stri id: issue.identifier, identifier: issue.identifier, status: issue.status, + title: issue.title, }); } @@ -161,6 +162,17 @@ describe("MarkdownBody", () => { expect(html).not.toContain("paperclip-mention-chip--issue"); }); + it("uses concise issue aria labels until a distinct title is available", () => { + const html = renderMarkdown("Depends on PAP-1271 and PAP-1272.", [ + { identifier: "PAP-1271", status: "done" }, + { identifier: "PAP-1272", status: "blocked", title: "Fix hover state" }, + ]); + + expect(html).toContain('aria-label="Issue PAP-1271"'); + expect(html).toContain('aria-label="Issue PAP-1272: Fix hover state"'); + expect(html).not.toContain('aria-label="Issue PAP-1271: PAP-1271"'); + }); + it("rewrites full issue URLs to internal issue links", () => { const html = renderMarkdown("See http://localhost:3100/PAP/issues/PAP-1179.", [ { identifier: "PAP-1179", status: "blocked" }, diff --git a/ui/src/components/MarkdownBody.tsx b/ui/src/components/MarkdownBody.tsx index e4f532aa2b6..6ab4ff3768e 100644 --- a/ui/src/components/MarkdownBody.tsx +++ b/ui/src/components/MarkdownBody.tsx @@ -43,6 +43,7 @@ function MarkdownIssueLink({ const identifier = data?.identifier ?? issuePathId; const title = data?.title ?? identifier; const status = data?.status; + const issueLabel = title !== identifier ? `Issue ${identifier}: ${title}` : `Issue ${identifier}`; return ( {status ? (