* feat(app): add pull request panel context actions Attach pull request comments, reviews, and failed check details to chat context. The PR panel now lives in its own module so the activity, query, and context policies have one home. * fix(server): mark capped check details as truncated * fix(app): preserve concurrent PR panel attachments * fix(server): preserve annotation truncation state * fix(app): keep matrix check attachments distinct * fix(app): streamline pull request context attachments * fix(app): simplify pull request feedback rendering * feat(app): group pull request review threads * fix(app): tidy pull request panel boundaries * fix: use worktree cwd for dev services * fix(app): keep git query keys UI-free * feat(app): collapse resolved comments and add chat actions to headers * fix: address PR feedback and Playwright flakes * fix(app): hide check chat action without attachment scope * fix(server): dedupe inline review timeline comments
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { formatPullRequestActivityLocation } from "./activity-location";
|
|
import type { PrPaneActivity } from "./data";
|
|
|
|
function activity(location: PrPaneActivity["location"]): PrPaneActivity {
|
|
return {
|
|
id: "comment-1",
|
|
provider: "github",
|
|
kind: "comment",
|
|
author: "octocat",
|
|
avatarColor: "#0ea5e9",
|
|
body: "Looks good.",
|
|
age: "3d ago",
|
|
url: "https://github.com/getpaseo/paseo/pull/42#discussion_r1",
|
|
location,
|
|
};
|
|
}
|
|
|
|
describe("pull request activity location labels", () => {
|
|
it("includes inline thread state and concise thread IDs", () => {
|
|
expect(
|
|
formatPullRequestActivityLocation(
|
|
activity({
|
|
path: "packages/app/src/panel.tsx",
|
|
startLine: 10,
|
|
line: 12,
|
|
threadId: "PRRT_1",
|
|
isResolved: false,
|
|
isOutdated: true,
|
|
}),
|
|
),
|
|
).toBe("packages/app/src/panel.tsx:10-12 · unresolved · outdated · thread PRRT_1");
|
|
});
|
|
|
|
it("includes current/resolved state without noisy long thread IDs", () => {
|
|
expect(
|
|
formatPullRequestActivityLocation(
|
|
activity({
|
|
path: "packages/app/src/panel.tsx",
|
|
line: 12,
|
|
threadId: "PRRT_kwDOAReallyLongOpaqueThreadIdentifier",
|
|
isResolved: true,
|
|
isOutdated: false,
|
|
}),
|
|
),
|
|
).toBe("packages/app/src/panel.tsx:12 · resolved · current");
|
|
});
|
|
});
|