mirror of
https://github.com/paperclipai/paperclip
synced 2026-04-25 17:25:15 +02:00
PAP-2118 address final greptile polish
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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" },
|
||||
|
||||
@@ -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 (
|
||||
<Link
|
||||
@@ -50,7 +51,7 @@ function MarkdownIssueLink({
|
||||
data-mention-kind="issue"
|
||||
className="paperclip-markdown-issue-ref"
|
||||
title={title}
|
||||
aria-label={`Issue ${identifier}: ${title}`}
|
||||
aria-label={issueLabel}
|
||||
>
|
||||
{status ? (
|
||||
<StatusIcon status={status} className="mr-1 h-3 w-3 align-[-0.125em]" />
|
||||
|
||||
Reference in New Issue
Block a user