feat(site): count every PR in the chats sidebar (#29832)
Part 6 of 6. Depends on #29831. Supersedes #29547, which merged with a flattened head by mistake. The chats sidebar and search results now count every PR in `diff_statuses`, not only the primary ref. A chat with one PR shows that PR's state icon and line stats, even when the primary ref is a newer branch without a PR. A chat with several PRs shows a PR count instead of a single state icon, with no line stats. Screen readers hear "N pull requests". In the sidebar tree, the kebab menu and the right-click menu of a chat list its PRs in a group between "Copy" and "Archive agent". One PR is a direct link. Several PRs open an "N PRs" submenu. The entries use the same rows as the top bar PR menu. Viewers of a shared chat also see the links. PRs without a URL are not listed. These menus replace the hover tooltip from earlier commits. The tooltip did not open on touch and had no links to the PRs. Generated by Coder Agents.
This commit is contained in:
1 parent
051eb587d4
commit
ff3fa22f68
12 files changed
+698
-188
No files matched your search
@@ -55,6 +55,7 @@ import { clearPersistedRightPanelState } from "../utils/rightPanelTabStorage";
|
||||
import { clearPersistedSidebarTabId } from "../utils/sidebarTabStorage";
|
||||
import { ArchiveAndDeleteWorkspaceDialog } from "./ArchiveAndDeleteWorkspaceDialog";
|
||||
import { getParentChatID } from "./ChatConversation/chatHelpers";
|
||||
import { ChatPRMenuItems } from "./ChatsSidebar/tree/ChatPRMenuItems";
|
||||
|
||||
// Backend chatstate permits archive only from W, E0, and E1. Unknown status
|
||||
// stays fail-open so the server conflict response remains the backstop.
|
||||
@@ -108,8 +109,8 @@ export const canManageChat = (
|
||||
type ChatActionsMenuItemsProps = {
|
||||
readonly chat: TypesGen.Chat;
|
||||
/**
|
||||
* See {@link canManageChat}. When false, only the subagents toggle and the
|
||||
* copy actions render.
|
||||
* See {@link canManageChat}. When false, only the subagents toggle, the
|
||||
* copy actions and the PR links render.
|
||||
*/
|
||||
readonly canManage: boolean;
|
||||
readonly hasWorkspace: boolean;
|
||||
@@ -129,6 +130,8 @@ type ChatActionsMenuItemsProps = {
|
||||
readonly onArchiveAndDeleteWorkspace: () => void;
|
||||
/** When omitted, the "Rename chat" item is hidden. */
|
||||
readonly onOpenRenameDialog?: () => void;
|
||||
/** When omitted or empty, no PR links render. */
|
||||
readonly prStatuses?: readonly TypesGen.ChatDiffStatus[];
|
||||
readonly Item: ItemComponent;
|
||||
readonly Separator: SeparatorComponent;
|
||||
readonly Sub: SubComponent;
|
||||
@@ -316,6 +319,7 @@ const ChatActionsMenuItems: React.FC<ChatActionsMenuItemsProps> = ({
|
||||
onUnarchiveAgent,
|
||||
onArchiveAndDeleteWorkspace,
|
||||
onOpenRenameDialog,
|
||||
prStatuses,
|
||||
Item,
|
||||
Separator,
|
||||
Sub,
|
||||
@@ -412,6 +416,18 @@ const ChatActionsMenuItems: React.FC<ChatActionsMenuItemsProps> = ({
|
||||
) : (
|
||||
copyItems
|
||||
);
|
||||
const prLinks = prStatuses && prStatuses.length > 0 && (
|
||||
<>
|
||||
<Separator />
|
||||
<ChatPRMenuItems
|
||||
prStatuses={prStatuses}
|
||||
Item={Item}
|
||||
Sub={Sub}
|
||||
SubTrigger={SubTrigger}
|
||||
SubContent={SubContent}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
if (!canManage) {
|
||||
return (
|
||||
@@ -419,6 +435,7 @@ const ChatActionsMenuItems: React.FC<ChatActionsMenuItemsProps> = ({
|
||||
{subagentToggle}
|
||||
{hasActionsAboveCopy && <Separator />}
|
||||
{copyActions}
|
||||
{prLinks}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -465,6 +482,7 @@ const ChatActionsMenuItems: React.FC<ChatActionsMenuItemsProps> = ({
|
||||
)}
|
||||
{hasActionsAboveCopy && <Separator />}
|
||||
{copyActions}
|
||||
{prLinks}
|
||||
{showArchiveActions && (
|
||||
<>
|
||||
<Separator />
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
import { cn } from "cn";
|
||||
import type { Chat } from "#/api/typesGenerated";
|
||||
import { getChatDisplayConfig } from "./ChatsSidebar/tree/statusConfig";
|
||||
import type { Chat, ChatDiffStatus } from "#/api/typesGenerated";
|
||||
import { ChatNodePRIcon } from "./ChatsSidebar/tree/ChatNodePRIcon";
|
||||
import {
|
||||
getChatDisplayConfig,
|
||||
getPRIconConfig,
|
||||
} from "./ChatsSidebar/tree/statusConfig";
|
||||
|
||||
type ChatDiffStatsProps = {
|
||||
readonly chat: Chat;
|
||||
};
|
||||
|
||||
export const ChatPRStateIcon: React.FC<ChatDiffStatsProps> = ({ chat }) => {
|
||||
const { prIcon } = getChatDisplayConfig(chat);
|
||||
const prIcon = getPRIconConfig(chat.diff_status);
|
||||
if (!prIcon) {
|
||||
return null;
|
||||
}
|
||||
@@ -21,13 +25,12 @@ export const ChatPRStateIcon: React.FC<ChatDiffStatsProps> = ({ chat }) => {
|
||||
);
|
||||
};
|
||||
|
||||
const ChatLineStats: React.FC<ChatDiffStatsProps> = ({ chat }) => {
|
||||
const { diffStatus } = getChatDisplayConfig(chat);
|
||||
const changedFiles = diffStatus?.changed_files ?? 0;
|
||||
const additions = diffStatus?.additions ?? 0;
|
||||
const deletions = diffStatus?.deletions ?? 0;
|
||||
const ChatLineStats: React.FC<{ readonly status: ChatDiffStatus }> = ({
|
||||
status,
|
||||
}) => {
|
||||
const { changed_files: changedFiles, additions, deletions } = status;
|
||||
const hasLineStats = additions > 0 || deletions > 0 || changedFiles > 0;
|
||||
if (!diffStatus?.url || !hasLineStats) {
|
||||
if (!status.url || !hasLineStats) {
|
||||
return null;
|
||||
}
|
||||
const filesChangedLabel = `${changedFiles} ${
|
||||
@@ -45,9 +48,17 @@ const ChatLineStats: React.FC<ChatDiffStatsProps> = ({ chat }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const ChatDiffStats: React.FC<ChatDiffStatsProps> = ({ chat }) => (
|
||||
<>
|
||||
<ChatPRStateIcon chat={chat} />
|
||||
<ChatLineStats chat={chat} />
|
||||
</>
|
||||
);
|
||||
export const ChatDiffStats: React.FC<ChatDiffStatsProps> = ({ chat }) => {
|
||||
const { prStatuses } = getChatDisplayConfig(chat);
|
||||
|
||||
// The sole PR's line stats can differ from the primary row's,
|
||||
// which may be a newer branch-only ref with zeroed counts.
|
||||
const solePR = prStatuses.length === 1 ? prStatuses[0] : undefined;
|
||||
|
||||
return (
|
||||
<>
|
||||
<ChatNodePRIcon prStatuses={prStatuses} />
|
||||
{solePR && <ChatLineStats status={solePR} />}
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -35,6 +35,7 @@ import { Button } from "#/components/Button/Button";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "#/components/DropdownMenu/DropdownMenu";
|
||||
import { Popover, PopoverTrigger } from "#/components/Popover/Popover";
|
||||
@@ -346,7 +347,7 @@ export const ChatTopBar: React.FC<ChatTopBarProps> = ({
|
||||
</button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="start" className={prMenuContentClassName}>
|
||||
<PRMenuLinks prStatuses={prStatuses} />
|
||||
<PRMenuLinks prStatuses={prStatuses} Item={DropdownMenuItem} />
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
) : (
|
||||
|
||||
@@ -16,7 +16,7 @@ import { chatProjectsKey } from "#/api/queries/chatProjects";
|
||||
import { userChatProviderConfigsKey } from "#/api/queries/chats";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import type { Chat } from "#/api/typesGenerated";
|
||||
import { MockChat } from "#/testHelpers/chatEntities";
|
||||
import { MockChat, MockChatDiffStatus } from "#/testHelpers/chatEntities";
|
||||
import {
|
||||
MockChatProject,
|
||||
MockUserOwner,
|
||||
@@ -1552,61 +1552,65 @@ export const WithDiffStats: Story = {
|
||||
id: "diff-both",
|
||||
title: "Agent with additions and deletions",
|
||||
updated_at: recentTimestamp,
|
||||
diff_status: {
|
||||
chat_id: "diff-both",
|
||||
url: "https://github.com/coder/coder/pull/1",
|
||||
pull_request_title: "",
|
||||
pull_request_draft: false,
|
||||
changes_requested: false,
|
||||
additions: 42,
|
||||
deletions: 7,
|
||||
changed_files: 5,
|
||||
},
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "diff-both",
|
||||
pr_number: 1,
|
||||
url: "https://github.com/coder/coder/pull/1",
|
||||
additions: 42,
|
||||
deletions: 7,
|
||||
changed_files: 5,
|
||||
},
|
||||
],
|
||||
}),
|
||||
buildChat({
|
||||
id: "diff-add-only",
|
||||
title: "Agent with additions only",
|
||||
updated_at: recentTimestamp,
|
||||
diff_status: {
|
||||
chat_id: "diff-add-only",
|
||||
url: "https://github.com/coder/coder/pull/2",
|
||||
pull_request_title: "",
|
||||
pull_request_draft: false,
|
||||
changes_requested: false,
|
||||
additions: 120,
|
||||
deletions: 0,
|
||||
changed_files: 3,
|
||||
},
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "diff-add-only",
|
||||
pr_number: 2,
|
||||
url: "https://github.com/coder/coder/pull/2",
|
||||
additions: 120,
|
||||
deletions: 0,
|
||||
changed_files: 3,
|
||||
},
|
||||
],
|
||||
}),
|
||||
buildChat({
|
||||
id: "diff-del-only",
|
||||
title: "Agent with deletions only",
|
||||
updated_at: recentTimestamp,
|
||||
diff_status: {
|
||||
chat_id: "diff-del-only",
|
||||
url: "https://github.com/coder/coder/pull/3",
|
||||
pull_request_title: "",
|
||||
pull_request_draft: false,
|
||||
changes_requested: false,
|
||||
additions: 0,
|
||||
deletions: 35,
|
||||
changed_files: 2,
|
||||
},
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "diff-del-only",
|
||||
pr_number: 3,
|
||||
url: "https://github.com/coder/coder/pull/3",
|
||||
additions: 0,
|
||||
deletions: 35,
|
||||
changed_files: 2,
|
||||
},
|
||||
],
|
||||
}),
|
||||
buildChat({
|
||||
id: "diff-none",
|
||||
title: "Agent with no diff changes",
|
||||
updated_at: recentTimestamp,
|
||||
diff_status: {
|
||||
chat_id: "diff-none",
|
||||
url: "https://github.com/coder/coder/pull/4",
|
||||
pull_request_title: "",
|
||||
pull_request_draft: false,
|
||||
changes_requested: false,
|
||||
additions: 0,
|
||||
deletions: 0,
|
||||
changed_files: 0,
|
||||
},
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "diff-none",
|
||||
pr_number: 4,
|
||||
url: "https://github.com/coder/coder/pull/4",
|
||||
additions: 0,
|
||||
deletions: 0,
|
||||
changed_files: 0,
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
},
|
||||
@@ -1628,46 +1632,49 @@ export const WithDiffStatsLight: Story = {
|
||||
id: "diff-both-light",
|
||||
title: "Agent with additions and deletions",
|
||||
updated_at: recentTimestamp,
|
||||
diff_status: {
|
||||
chat_id: "diff-both-light",
|
||||
url: "https://github.com/coder/coder/pull/1",
|
||||
pull_request_title: "",
|
||||
pull_request_draft: false,
|
||||
changes_requested: false,
|
||||
additions: 42,
|
||||
deletions: 7,
|
||||
changed_files: 5,
|
||||
},
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "diff-both-light",
|
||||
pr_number: 1,
|
||||
url: "https://github.com/coder/coder/pull/1",
|
||||
additions: 42,
|
||||
deletions: 7,
|
||||
changed_files: 5,
|
||||
},
|
||||
],
|
||||
}),
|
||||
buildChat({
|
||||
id: "diff-add-only-light",
|
||||
title: "Agent with additions only",
|
||||
updated_at: recentTimestamp,
|
||||
diff_status: {
|
||||
chat_id: "diff-add-only-light",
|
||||
url: "https://github.com/coder/coder/pull/2",
|
||||
pull_request_title: "",
|
||||
pull_request_draft: false,
|
||||
changes_requested: false,
|
||||
additions: 120,
|
||||
deletions: 0,
|
||||
changed_files: 3,
|
||||
},
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "diff-add-only-light",
|
||||
pr_number: 2,
|
||||
url: "https://github.com/coder/coder/pull/2",
|
||||
additions: 120,
|
||||
deletions: 0,
|
||||
changed_files: 3,
|
||||
},
|
||||
],
|
||||
}),
|
||||
buildChat({
|
||||
id: "diff-del-only-light",
|
||||
title: "Agent with deletions only",
|
||||
updated_at: recentTimestamp,
|
||||
diff_status: {
|
||||
chat_id: "diff-del-only-light",
|
||||
url: "https://github.com/coder/coder/pull/3",
|
||||
pull_request_title: "",
|
||||
pull_request_draft: false,
|
||||
changes_requested: false,
|
||||
additions: 0,
|
||||
deletions: 35,
|
||||
changed_files: 2,
|
||||
},
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "diff-del-only-light",
|
||||
pr_number: 3,
|
||||
url: "https://github.com/coder/coder/pull/3",
|
||||
additions: 0,
|
||||
deletions: 35,
|
||||
changed_files: 2,
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
},
|
||||
@@ -1686,80 +1693,123 @@ export const WithPRStateIcons: Story = {
|
||||
id: "pr-open",
|
||||
title: "Open pull request",
|
||||
updated_at: recentTimestamp,
|
||||
diff_status: {
|
||||
chat_id: "pr-open",
|
||||
url: "https://github.com/coder/coder/pull/100",
|
||||
pull_request_state: "open",
|
||||
pull_request_title: "feat: add new feature",
|
||||
pull_request_draft: false,
|
||||
changes_requested: false,
|
||||
additions: 50,
|
||||
deletions: 10,
|
||||
changed_files: 4,
|
||||
},
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "pr-open",
|
||||
pr_number: 100,
|
||||
url: "https://github.com/coder/coder/pull/100",
|
||||
pull_request_title: "feat: add new feature",
|
||||
additions: 50,
|
||||
deletions: 10,
|
||||
changed_files: 4,
|
||||
},
|
||||
],
|
||||
}),
|
||||
buildChat({
|
||||
id: "pr-draft",
|
||||
title: "Draft pull request",
|
||||
updated_at: recentTimestamp,
|
||||
diff_status: {
|
||||
chat_id: "pr-draft",
|
||||
url: "https://github.com/coder/coder/pull/101",
|
||||
pull_request_state: "open",
|
||||
pull_request_title: "wip: draft changes",
|
||||
pull_request_draft: true,
|
||||
changes_requested: false,
|
||||
additions: 20,
|
||||
deletions: 5,
|
||||
changed_files: 2,
|
||||
},
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "pr-draft",
|
||||
pr_number: 101,
|
||||
url: "https://github.com/coder/coder/pull/101",
|
||||
pull_request_title: "wip: draft changes",
|
||||
pull_request_draft: true,
|
||||
additions: 20,
|
||||
deletions: 5,
|
||||
changed_files: 2,
|
||||
},
|
||||
],
|
||||
}),
|
||||
buildChat({
|
||||
id: "pr-merged",
|
||||
title: "Merged pull request",
|
||||
updated_at: recentTimestamp,
|
||||
diff_status: {
|
||||
chat_id: "pr-merged",
|
||||
url: "https://github.com/coder/coder/pull/102",
|
||||
pull_request_state: "merged",
|
||||
pull_request_title: "feat: completed feature",
|
||||
pull_request_draft: false,
|
||||
changes_requested: false,
|
||||
additions: 200,
|
||||
deletions: 80,
|
||||
changed_files: 12,
|
||||
},
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "pr-merged",
|
||||
pr_number: 102,
|
||||
url: "https://github.com/coder/coder/pull/102",
|
||||
pull_request_state: "merged",
|
||||
pull_request_title: "feat: completed feature",
|
||||
additions: 200,
|
||||
deletions: 80,
|
||||
changed_files: 12,
|
||||
},
|
||||
],
|
||||
}),
|
||||
buildChat({
|
||||
id: "pr-closed",
|
||||
title: "Closed pull request",
|
||||
updated_at: recentTimestamp,
|
||||
diff_status: {
|
||||
chat_id: "pr-closed",
|
||||
url: "https://github.com/coder/coder/pull/103",
|
||||
pull_request_state: "closed",
|
||||
pull_request_title: "fix: abandoned approach",
|
||||
pull_request_draft: false,
|
||||
changes_requested: false,
|
||||
additions: 15,
|
||||
deletions: 3,
|
||||
changed_files: 1,
|
||||
},
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "pr-closed",
|
||||
pr_number: 103,
|
||||
url: "https://github.com/coder/coder/pull/103",
|
||||
pull_request_state: "closed",
|
||||
pull_request_title: "fix: abandoned approach",
|
||||
additions: 15,
|
||||
deletions: 3,
|
||||
changed_files: 1,
|
||||
},
|
||||
],
|
||||
}),
|
||||
buildChat({
|
||||
id: "pr-no-state",
|
||||
title: "No PR state (branch only)",
|
||||
updated_at: recentTimestamp,
|
||||
diff_status: {
|
||||
chat_id: "pr-no-state",
|
||||
url: "https://github.com/coder/coder/tree/my-branch",
|
||||
pull_request_title: "",
|
||||
pull_request_draft: false,
|
||||
changes_requested: false,
|
||||
additions: 10,
|
||||
deletions: 2,
|
||||
changed_files: 1,
|
||||
},
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "pr-no-state",
|
||||
git_branch: "my-branch",
|
||||
url: "https://github.com/coder/coder/tree/my-branch",
|
||||
pr_number: undefined,
|
||||
pull_request_state: undefined,
|
||||
pull_request_title: "",
|
||||
additions: 10,
|
||||
deletions: 2,
|
||||
changed_files: 1,
|
||||
},
|
||||
],
|
||||
}),
|
||||
// A newer branch-only push becomes the primary, but the
|
||||
// sole PR still pairs its icon with its own line stats.
|
||||
buildChat({
|
||||
id: "pr-with-newer-branch",
|
||||
title: "PR with a newer branch push",
|
||||
updated_at: recentTimestamp,
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "pr-with-newer-branch",
|
||||
git_branch: "feat/newer-branch",
|
||||
url: "https://github.com/coder/coder/tree/feat/newer-branch",
|
||||
pr_number: undefined,
|
||||
pull_request_state: undefined,
|
||||
pull_request_title: "",
|
||||
additions: 0,
|
||||
deletions: 0,
|
||||
changed_files: 0,
|
||||
},
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "pr-with-newer-branch",
|
||||
git_branch: "feat/older-pr",
|
||||
pr_number: 104,
|
||||
url: "https://github.com/coder/coder/pull/104",
|
||||
pull_request_title: "feat: sole PR with newer branch",
|
||||
additions: 33,
|
||||
deletions: 4,
|
||||
changed_files: 2,
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
},
|
||||
@@ -1771,6 +1821,146 @@ export const WithPRStateIcons: Story = {
|
||||
},
|
||||
};
|
||||
|
||||
export const WithMultiplePRs: Story = {
|
||||
args: {
|
||||
chats: [
|
||||
buildChat({
|
||||
id: "multi-pr",
|
||||
title: "Agent with three pull requests",
|
||||
updated_at: recentTimestamp,
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "multi-pr",
|
||||
git_branch: "feat/one",
|
||||
pr_number: 201,
|
||||
url: "https://github.com/coder/coder/pull/201",
|
||||
pull_request_title: "feat: add login page",
|
||||
additions: 50,
|
||||
deletions: 10,
|
||||
changed_files: 4,
|
||||
},
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "multi-pr",
|
||||
git_branch: "feat/two",
|
||||
pr_number: 202,
|
||||
url: "https://github.com/coder/coder/pull/202",
|
||||
pull_request_title: "fix: correct the login redirect",
|
||||
pull_request_draft: true,
|
||||
additions: 20,
|
||||
deletions: 5,
|
||||
changed_files: 2,
|
||||
},
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "multi-pr",
|
||||
git_branch: "feat/three",
|
||||
pr_number: 203,
|
||||
url: "https://github.com/coder/coder/pull/203",
|
||||
pull_request_state: "merged",
|
||||
pull_request_title: "feat: add the login tests",
|
||||
additions: 200,
|
||||
deletions: 80,
|
||||
changed_files: 12,
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
},
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
await userEvent.click(
|
||||
canvas.getByLabelText("Open actions for Agent with three pull requests"),
|
||||
);
|
||||
// The menus portal to the body, outside the story canvas.
|
||||
const body = within(document.body);
|
||||
await userEvent.click(await body.findByRole("menuitem", { name: "3 PRs" }));
|
||||
await body.findByRole("menuitem", { name: /PR #201/ });
|
||||
},
|
||||
parameters: {
|
||||
reactRouter: reactRouterParameters({
|
||||
location: { path: "/agents" },
|
||||
routing: agentsRouting,
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
// Enough PRs to show the submenu's height limit.
|
||||
export const WithManyPRs: Story = {
|
||||
args: {
|
||||
chats: [
|
||||
buildChat({
|
||||
id: "many-prs",
|
||||
title: "Agent with fifteen pull requests",
|
||||
updated_at: recentTimestamp,
|
||||
diff_statuses: Array.from({ length: 15 }, (_, index) => ({
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "many-prs",
|
||||
git_branch: `refactor/agents-${index + 1}`,
|
||||
url: `https://github.com/coder/coder/pull/${29901 + index}`,
|
||||
pr_number: 29901 + index,
|
||||
pull_request_title: `refactor(site): split the agents page into smaller parts, step ${index + 1}`,
|
||||
})),
|
||||
}),
|
||||
],
|
||||
},
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
await userEvent.click(
|
||||
canvas.getByLabelText(
|
||||
"Open actions for Agent with fifteen pull requests",
|
||||
),
|
||||
);
|
||||
const body = within(document.body);
|
||||
await userEvent.click(
|
||||
await body.findByRole("menuitem", { name: "15 PRs" }),
|
||||
);
|
||||
await body.findByRole("menuitem", { name: /PR #29901/ });
|
||||
},
|
||||
parameters: {
|
||||
reactRouter: reactRouterParameters({
|
||||
location: { path: "/agents" },
|
||||
routing: agentsRouting,
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
export const WithOnePRMenuOpen: Story = {
|
||||
args: {
|
||||
chats: [
|
||||
buildChat({
|
||||
id: "one-pr-menu",
|
||||
title: "Agent with one pull request",
|
||||
updated_at: recentTimestamp,
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "one-pr-menu",
|
||||
pr_number: 301,
|
||||
url: "https://github.com/coder/coder/pull/301",
|
||||
pull_request_title:
|
||||
"fix(site/src/pages/AgentsPage): keep the session alive when the workspace restarts",
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
},
|
||||
parameters: {
|
||||
reactRouter: reactRouterParameters({
|
||||
location: { path: "/agents" },
|
||||
routing: agentsRouting,
|
||||
}),
|
||||
},
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
await userEvent.click(
|
||||
canvas.getByLabelText("Open actions for Agent with one pull request"),
|
||||
);
|
||||
await within(document.body).findByRole("menuitem", { name: /PR #301/ });
|
||||
},
|
||||
};
|
||||
|
||||
export const ActiveChatKebabPersistent: Story = {
|
||||
args: {
|
||||
chats: [
|
||||
|
||||
@@ -18,7 +18,7 @@ import type { Chat } from "#/api/typesGenerated";
|
||||
import { TooltipProvider } from "#/components/Tooltip/Tooltip";
|
||||
import { ThemeOverride } from "#/contexts/ThemeProvider";
|
||||
import { DashboardContext } from "#/modules/dashboard/DashboardProvider";
|
||||
import { MockChat } from "#/testHelpers/chatEntities";
|
||||
import { MockChat, MockChatDiffStatus } from "#/testHelpers/chatEntities";
|
||||
import { MockChatModel } from "#/testHelpers/chatModels";
|
||||
import {
|
||||
MockAppearanceConfig,
|
||||
@@ -1425,6 +1425,192 @@ describe("ChatsSidebar load-more behavior", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("ChatsSidebar pull requests", () => {
|
||||
const mockMultiPRChat = buildChat({
|
||||
id: "multi-pr",
|
||||
title: "Multiple pull requests",
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "multi-pr",
|
||||
git_branch: "feat/one",
|
||||
url: "https://github.com/coder/coder/pull/1",
|
||||
pr_number: 1,
|
||||
pull_request_state: "open",
|
||||
pull_request_title: "feat: add login page",
|
||||
},
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "multi-pr",
|
||||
git_branch: "feat/two",
|
||||
url: "https://github.com/coder/coder/pull/2",
|
||||
pr_number: 2,
|
||||
pull_request_state: "merged",
|
||||
pull_request_title: "feat: add login tests",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
it("announces the pull request state when the chat tracks one pull request", () => {
|
||||
render(
|
||||
<Wrapper>
|
||||
<ChatsSidebar
|
||||
{...defaultProps}
|
||||
chats={[
|
||||
buildChat({
|
||||
id: "one-pr",
|
||||
title: "One pull request",
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "one-pr",
|
||||
url: "https://github.com/coder/coder/pull/1",
|
||||
pull_request_state: "open",
|
||||
pull_request_title: "",
|
||||
additions: 0,
|
||||
deletions: 0,
|
||||
changed_files: 0,
|
||||
},
|
||||
],
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</Wrapper>,
|
||||
);
|
||||
|
||||
expect(
|
||||
screen.getByRole("img", { name: /pull request/i }),
|
||||
).toHaveAccessibleName("Pull request open");
|
||||
});
|
||||
|
||||
it("announces the tracked pull request count when the chat tracks several", () => {
|
||||
render(
|
||||
<Wrapper>
|
||||
<ChatsSidebar {...defaultProps} chats={[mockMultiPRChat]} />
|
||||
</Wrapper>,
|
||||
);
|
||||
|
||||
// The count and the glyph are one named image, so the link
|
||||
// does not announce the count twice.
|
||||
expect(
|
||||
screen.getByRole("img", { name: /pull request/i }),
|
||||
).toHaveAccessibleName("2 pull requests");
|
||||
const link = screen.getByRole("link", {
|
||||
name: /multiple pull requests/i,
|
||||
});
|
||||
expect(link).toHaveAccessibleName(
|
||||
/Multiple pull requests.*2 pull requests/,
|
||||
);
|
||||
expect(link).not.toHaveAccessibleName(/2 pull requests.*2 pull requests/);
|
||||
});
|
||||
|
||||
it("links every pull request from the actions menu of a multi-PR chat", async () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<Wrapper>
|
||||
<ChatsSidebar {...defaultProps} chats={[mockMultiPRChat]} />
|
||||
</Wrapper>,
|
||||
);
|
||||
|
||||
await user.click(
|
||||
screen.getByRole("button", {
|
||||
name: "Open actions for Multiple pull requests",
|
||||
}),
|
||||
);
|
||||
await user.click(await screen.findByRole("menuitem", { name: "2 PRs" }));
|
||||
|
||||
const links = await screen.findAllByRole("menuitem", { name: /PR #/ });
|
||||
expect(links.map((link) => link.getAttribute("href"))).toEqual([
|
||||
"https://github.com/coder/coder/pull/1",
|
||||
"https://github.com/coder/coder/pull/2",
|
||||
]);
|
||||
expect(links[1]).toHaveAccessibleName(/Pull request merged/);
|
||||
});
|
||||
|
||||
it("leaves pull requests without a URL out of the actions menu", async () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<Wrapper>
|
||||
<ChatsSidebar
|
||||
{...defaultProps}
|
||||
chats={[
|
||||
buildChat({
|
||||
id: "unlinked-pr",
|
||||
title: "Unlinked pull request",
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "unlinked-pr",
|
||||
git_branch: "feat/one",
|
||||
url: "https://github.com/coder/coder/pull/1",
|
||||
pr_number: 1,
|
||||
},
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "unlinked-pr",
|
||||
git_branch: "feat/two",
|
||||
url: "",
|
||||
pr_number: 2,
|
||||
},
|
||||
],
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</Wrapper>,
|
||||
);
|
||||
|
||||
await user.click(
|
||||
screen.getByRole("button", {
|
||||
name: "Open actions for Unlinked pull request",
|
||||
}),
|
||||
);
|
||||
|
||||
// One linkable PR is left, so the menu links it directly.
|
||||
expect(
|
||||
await screen.findByRole("menuitem", { name: /PR #1/ }),
|
||||
).toHaveAttribute("href", "https://github.com/coder/coder/pull/1");
|
||||
});
|
||||
|
||||
it("links the pull request for viewers of a shared chat", async () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
render(
|
||||
<Wrapper>
|
||||
<ChatsSidebar
|
||||
{...defaultProps}
|
||||
chats={[
|
||||
buildChat({
|
||||
id: "shared-pr",
|
||||
title: "Shared pull request",
|
||||
owner_id: "sharing-user",
|
||||
diff_statuses: [
|
||||
{
|
||||
...MockChatDiffStatus,
|
||||
chat_id: "shared-pr",
|
||||
url: "https://github.com/coder/coder/pull/7",
|
||||
pr_number: 7,
|
||||
},
|
||||
],
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</Wrapper>,
|
||||
);
|
||||
|
||||
await user.click(
|
||||
screen.getByRole("button", {
|
||||
name: "Open actions for Shared pull request",
|
||||
}),
|
||||
);
|
||||
|
||||
expect(
|
||||
await screen.findByRole("menuitem", { name: /PR #7/ }),
|
||||
).toHaveAttribute("href", "https://github.com/coder/coder/pull/7");
|
||||
});
|
||||
});
|
||||
|
||||
describe("ChatsSidebar subtitles", () => {
|
||||
const modelConfigs: TypesGen.ChatModel[] = [
|
||||
{
|
||||
|
||||
+18
-12
@@ -29,6 +29,16 @@ const mockChat: Chat = {
|
||||
updated_at: "2026-05-20T07:30:00.000Z",
|
||||
has_unread: true,
|
||||
diff_status: mockDiffStatus,
|
||||
diff_statuses: [mockDiffStatus],
|
||||
};
|
||||
|
||||
const mockChat2DiffStatus: NonNullable<Chat["diff_status"]> = {
|
||||
...mockDiffStatus,
|
||||
chat_id: "chat-2",
|
||||
pull_request_title: "Fix flaky story",
|
||||
additions: 48,
|
||||
deletions: 12,
|
||||
changed_files: 3,
|
||||
};
|
||||
|
||||
const mockChats: Chat[] = [
|
||||
@@ -42,16 +52,14 @@ const mockChats: Chat[] = [
|
||||
created_at: "2026-05-20T05:00:00.000Z",
|
||||
updated_at: "2026-05-20T08:45:00.000Z",
|
||||
has_unread: false,
|
||||
diff_status: {
|
||||
...mockDiffStatus,
|
||||
chat_id: "chat-2",
|
||||
pull_request_title: "Fix flaky story",
|
||||
additions: 48,
|
||||
deletions: 12,
|
||||
changed_files: 3,
|
||||
},
|
||||
diff_status: mockChat2DiffStatus,
|
||||
diff_statuses: [mockChat2DiffStatus],
|
||||
},
|
||||
];
|
||||
const mockOverflowDiffStatus: NonNullable<Chat["diff_status"]> = {
|
||||
...mockDiffStatus,
|
||||
chat_id: "chat-long-1",
|
||||
};
|
||||
const overflowMockChats: Chat[] = [
|
||||
{
|
||||
...MockChat,
|
||||
@@ -64,10 +72,8 @@ const overflowMockChats: Chat[] = [
|
||||
created_at: "2026-05-20T05:00:00.000Z",
|
||||
updated_at: "2026-05-20T09:30:00.000Z",
|
||||
has_unread: false,
|
||||
diff_status: {
|
||||
...mockDiffStatus,
|
||||
chat_id: "chat-long-1",
|
||||
},
|
||||
diff_status: mockOverflowDiffStatus,
|
||||
diff_statuses: [mockOverflowDiffStatus],
|
||||
},
|
||||
];
|
||||
const cappedMockChats: Chat[] = Array.from(
|
||||
|
||||
@@ -8,6 +8,7 @@ import { ScrollArea } from "#/components/ScrollArea/ScrollArea";
|
||||
import { Skeleton } from "#/components/Skeleton/Skeleton";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { shortRelativeTime } from "#/utils/time";
|
||||
import { ChatNodePRIcon } from "../tree/ChatNodePRIcon";
|
||||
import { getChatDisplayConfig } from "../tree/statusConfig";
|
||||
|
||||
type ChatSearchResultsProps = {
|
||||
@@ -256,15 +257,17 @@ const ChatSearchResultRow: React.FC<ChatSearchResultRowProps> = ({
|
||||
icon: StatusIcon,
|
||||
className: statusClassName,
|
||||
label: statusLabel,
|
||||
prIcon,
|
||||
diffStatus,
|
||||
prStatuses,
|
||||
} = getChatDisplayConfig(chat);
|
||||
const PRIcon = prIcon?.icon;
|
||||
const additions = diffStatus?.additions ?? 0;
|
||||
const deletions = diffStatus?.deletions ?? 0;
|
||||
const changedFiles = diffStatus?.changed_files ?? 0;
|
||||
// Line stats only make sense for one PR; several PRs have no
|
||||
// single set of counts, and the icon shows the count instead.
|
||||
const solePR = prStatuses.length === 1 ? prStatuses[0] : undefined;
|
||||
|
||||
const additions = solePR?.additions ?? 0;
|
||||
const deletions = solePR?.deletions ?? 0;
|
||||
const changedFiles = solePR?.changed_files ?? 0;
|
||||
const hasLineStats =
|
||||
Boolean(diffStatus?.url) &&
|
||||
Boolean(solePR?.url) &&
|
||||
(additions > 0 || deletions > 0 || changedFiles > 0);
|
||||
const subtitle = chat.last_turn_summary?.trim() || "No summary available";
|
||||
|
||||
@@ -298,13 +301,7 @@ const ChatSearchResultRow: React.FC<ChatSearchResultRowProps> = ({
|
||||
{chat.title}
|
||||
</div>
|
||||
<div className="flex min-w-0 items-center gap-1.5 text-xs">
|
||||
{PRIcon && prIcon && (
|
||||
<PRIcon
|
||||
role="img"
|
||||
aria-label={prIcon.label}
|
||||
className={cn("size-3.5 shrink-0", prIcon.className)}
|
||||
/>
|
||||
)}
|
||||
<ChatNodePRIcon prStatuses={prStatuses} />
|
||||
{hasLineStats && (
|
||||
<span className="inline-flex shrink-0 items-center gap-0.5 tabular-nums">
|
||||
<span className="text-git-added-bright">+{additions}</span>
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
import { cn } from "cn";
|
||||
import { GitPullRequestArrowIcon } from "lucide-react";
|
||||
import type { ChatDiffStatus } from "#/api/typesGenerated";
|
||||
import { getPRIconConfig } from "./statusConfig";
|
||||
|
||||
type ChatNodePRIconProps = {
|
||||
readonly prStatuses: ChatDiffStatus[];
|
||||
};
|
||||
|
||||
export const ChatNodePRIcon: React.FC<ChatNodePRIconProps> = ({
|
||||
prStatuses,
|
||||
}) => {
|
||||
// Several PRs share the count glyph: picking one state would
|
||||
// misrepresent the rest.
|
||||
if (prStatuses.length === 0) {
|
||||
return null;
|
||||
}
|
||||
if (prStatuses.length === 1) {
|
||||
const soleConfig = getPRIconConfig(prStatuses[0]);
|
||||
if (!soleConfig) {
|
||||
return null;
|
||||
}
|
||||
const SoleIcon = soleConfig.icon;
|
||||
return (
|
||||
<SoleIcon
|
||||
role="img"
|
||||
aria-label={soleConfig.label}
|
||||
className={cn("size-3.5 shrink-0", soleConfig.className)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
// One name for the whole glyph; the count and the icon carry it
|
||||
// visually only.
|
||||
return (
|
||||
<span
|
||||
role="img"
|
||||
aria-label={`${prStatuses.length} pull requests`}
|
||||
className="inline-flex shrink-0 items-center gap-0.5"
|
||||
>
|
||||
<span aria-hidden="true" className="text-[13px] leading-4 tabular-nums">
|
||||
{prStatuses.length}
|
||||
</span>
|
||||
<GitPullRequestArrowIcon
|
||||
aria-hidden="true"
|
||||
className="size-3.5 shrink-0 text-content-secondary"
|
||||
/>
|
||||
</span>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,51 @@
|
||||
import { GitPullRequestIcon } from "lucide-react";
|
||||
import type { ChatDiffStatus } from "#/api/typesGenerated";
|
||||
import type {
|
||||
ContextMenuItem,
|
||||
ContextMenuSub,
|
||||
ContextMenuSubContent,
|
||||
ContextMenuSubTrigger,
|
||||
} from "#/components/ContextMenu/ContextMenu";
|
||||
import type {
|
||||
DropdownMenuItem,
|
||||
DropdownMenuSub,
|
||||
DropdownMenuSubContent,
|
||||
DropdownMenuSubTrigger,
|
||||
} from "#/components/DropdownMenu/DropdownMenu";
|
||||
import { PRMenuLinks, prMenuContentClassName } from "../../PRMenuLinks";
|
||||
|
||||
type ChatPRMenuItemsProps = {
|
||||
readonly prStatuses: readonly ChatDiffStatus[];
|
||||
readonly Item: typeof DropdownMenuItem | typeof ContextMenuItem;
|
||||
readonly Sub: typeof DropdownMenuSub | typeof ContextMenuSub;
|
||||
readonly SubTrigger:
|
||||
| typeof DropdownMenuSubTrigger
|
||||
| typeof ContextMenuSubTrigger;
|
||||
readonly SubContent:
|
||||
| typeof DropdownMenuSubContent
|
||||
| typeof ContextMenuSubContent;
|
||||
};
|
||||
|
||||
export const ChatPRMenuItems: React.FC<ChatPRMenuItemsProps> = ({
|
||||
prStatuses,
|
||||
Item,
|
||||
Sub,
|
||||
SubTrigger,
|
||||
SubContent,
|
||||
}) => {
|
||||
const links = <PRMenuLinks prStatuses={prStatuses} Item={Item} />;
|
||||
|
||||
if (prStatuses.length === 1) {
|
||||
return links;
|
||||
}
|
||||
|
||||
return (
|
||||
<Sub>
|
||||
<SubTrigger>
|
||||
<GitPullRequestIcon />
|
||||
{prStatuses.length} PRs
|
||||
</SubTrigger>
|
||||
<SubContent className={prMenuContentClassName}>{links}</SubContent>
|
||||
</Sub>
|
||||
);
|
||||
};
|
||||
@@ -133,6 +133,7 @@ export const ChatTreeNode: React.FC<ChatTreeNodeProps> = ({
|
||||
icon: StatusIcon,
|
||||
className: statusClassName,
|
||||
label: statusLabel,
|
||||
prStatuses,
|
||||
} = getChatDisplayConfig(chat);
|
||||
const workspaceId = chat.workspace_id;
|
||||
const queryClient = useQueryClient();
|
||||
@@ -233,6 +234,7 @@ export const ChatTreeNode: React.FC<ChatTreeNodeProps> = ({
|
||||
onOpenRenameDialog: onOpenRenameDialog
|
||||
? () => onOpenRenameDialog(chat)
|
||||
: undefined,
|
||||
prStatuses: prStatuses.filter((status) => status.url),
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -240,7 +242,7 @@ export const ChatTreeNode: React.FC<ChatTreeNodeProps> = ({
|
||||
<ChatActionsMenu
|
||||
{...sharedMenuItemProps}
|
||||
variant="context"
|
||||
contentClassName="[&_[role=menuitem]]:text-[13px]"
|
||||
contentClassName="max-w-72 [&_[role=menuitem]]:text-[13px]"
|
||||
>
|
||||
<div
|
||||
data-testid={`agents-tree-node-${chat.id}`}
|
||||
@@ -383,7 +385,7 @@ export const ChatTreeNode: React.FC<ChatTreeNodeProps> = ({
|
||||
{!isArchivingThisChat && (
|
||||
<ChatActionsMenu
|
||||
{...sharedMenuItemProps}
|
||||
contentClassName="[&_[role=menuitem]]:text-[13px]"
|
||||
contentClassName="max-w-72 [&_[role=menuitem]]:text-[13px]"
|
||||
>
|
||||
<Button
|
||||
size="icon"
|
||||
|
||||
@@ -84,10 +84,6 @@ export const getPRIconConfig = (
|
||||
};
|
||||
};
|
||||
|
||||
const getChatDiffStatus = (chat: Chat): ChatDiffStatus | undefined => {
|
||||
return chat.diff_status;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the icons and styling that represent a chat's current state.
|
||||
*
|
||||
@@ -99,16 +95,16 @@ export const getChatDisplayConfig = (
|
||||
icon: LucideIcon;
|
||||
className: string;
|
||||
label: string;
|
||||
prIcon: ChatIconConfig | undefined;
|
||||
diffStatus: ChatDiffStatus | undefined;
|
||||
prStatuses: ChatDiffStatus[];
|
||||
} => {
|
||||
const diffStatus = getChatDiffStatus(chat);
|
||||
const prStatuses = (chat.diff_statuses ?? []).filter(
|
||||
(status) => status.pull_request_state,
|
||||
);
|
||||
const config = getChatStatusDisplay(chat.status);
|
||||
return {
|
||||
icon: config.icon,
|
||||
className: config.className,
|
||||
label: config.label,
|
||||
prIcon: getPRIconConfig(diffStatus),
|
||||
diffStatus,
|
||||
prStatuses,
|
||||
};
|
||||
};
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ExternalLinkIcon } from "lucide-react";
|
||||
import type { ChatDiffStatus } from "#/api/typesGenerated";
|
||||
import { DropdownMenuItem } from "#/components/DropdownMenu/DropdownMenu";
|
||||
import type { ContextMenuItem } from "#/components/ContextMenu/ContextMenu";
|
||||
import type { DropdownMenuItem } from "#/components/DropdownMenu/DropdownMenu";
|
||||
import { originRepoLabel } from "../utils/originRepoLabel";
|
||||
import { prNumber } from "../utils/pullRequest";
|
||||
import { getPRIconConfig } from "./ChatsSidebar/tree/statusConfig";
|
||||
@@ -11,9 +12,13 @@ export const prMenuContentClassName =
|
||||
|
||||
type PRMenuLinksProps = {
|
||||
readonly prStatuses: readonly ChatDiffStatus[];
|
||||
readonly Item: typeof DropdownMenuItem | typeof ContextMenuItem;
|
||||
};
|
||||
|
||||
export const PRMenuLinks: React.FC<PRMenuLinksProps> = ({ prStatuses }) => {
|
||||
export const PRMenuLinks: React.FC<PRMenuLinksProps> = ({
|
||||
prStatuses,
|
||||
Item,
|
||||
}) => {
|
||||
// PR numbers repeat across repositories, so entries name the
|
||||
// repository when the PRs span several.
|
||||
const hasMultipleOrigins =
|
||||
@@ -30,10 +35,7 @@ export const PRMenuLinks: React.FC<PRMenuLinksProps> = ({ prStatuses }) => {
|
||||
const title = status.pull_request_title.trim();
|
||||
|
||||
return (
|
||||
<DropdownMenuItem
|
||||
key={`${status.remote_origin}/${status.git_branch}`}
|
||||
asChild
|
||||
>
|
||||
<Item key={`${status.remote_origin}/${status.git_branch}`} asChild>
|
||||
<a href={status.url} target="_blank" rel="noreferrer">
|
||||
{config && (
|
||||
<config.icon
|
||||
@@ -51,7 +53,7 @@ export const PRMenuLinks: React.FC<PRMenuLinksProps> = ({ prStatuses }) => {
|
||||
)}
|
||||
<ExternalLinkIcon className="ml-auto size-3.5!" />
|
||||
</a>
|
||||
</DropdownMenuItem>
|
||||
</Item>
|
||||
);
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user