feat(ui): add "See All" link to agent detail Recent Issues section
Remove the issue count from the Recent Issues heading and add a
"See All →" link that navigates to /issues?assignee={agentId}.
The Issues page now reads the assignee query param and pre-filters
the list to show that agent's issues.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -125,6 +125,7 @@ interface IssuesListProps {
|
|||||||
liveIssueIds?: Set<string>;
|
liveIssueIds?: Set<string>;
|
||||||
projectId?: string;
|
projectId?: string;
|
||||||
viewStateKey: string;
|
viewStateKey: string;
|
||||||
|
initialAssignees?: string[];
|
||||||
onUpdateIssue: (id: string, data: Record<string, unknown>) => void;
|
onUpdateIssue: (id: string, data: Record<string, unknown>) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,11 +137,17 @@ export function IssuesList({
|
|||||||
liveIssueIds,
|
liveIssueIds,
|
||||||
projectId,
|
projectId,
|
||||||
viewStateKey,
|
viewStateKey,
|
||||||
|
initialAssignees,
|
||||||
onUpdateIssue,
|
onUpdateIssue,
|
||||||
}: IssuesListProps) {
|
}: IssuesListProps) {
|
||||||
const { openNewIssue } = useDialog();
|
const { openNewIssue } = useDialog();
|
||||||
|
|
||||||
const [viewState, setViewState] = useState<IssueViewState>(() => getViewState(viewStateKey));
|
const [viewState, setViewState] = useState<IssueViewState>(() => {
|
||||||
|
if (initialAssignees) {
|
||||||
|
return { ...defaultViewState, assignees: initialAssignees, statuses: [] };
|
||||||
|
}
|
||||||
|
return getViewState(viewStateKey);
|
||||||
|
});
|
||||||
|
|
||||||
const updateView = useCallback((patch: Partial<IssueViewState>) => {
|
const updateView = useCallback((patch: Partial<IssueViewState>) => {
|
||||||
setViewState((prev) => {
|
setViewState((prev) => {
|
||||||
|
|||||||
@@ -708,7 +708,12 @@ function AgentOverview({
|
|||||||
|
|
||||||
{/* Recent Issues */}
|
{/* Recent Issues */}
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<h3 className="text-sm font-medium">Recent Issues ({assignedIssues.length})</h3>
|
<div className="flex items-center justify-between">
|
||||||
|
<h3 className="text-sm font-medium">Recent Issues</h3>
|
||||||
|
<Link to={`/issues?assignee=${agentId}`} className="text-xs text-muted-foreground hover:text-foreground transition-colors">
|
||||||
|
See All →
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
{assignedIssues.length === 0 ? (
|
{assignedIssues.length === 0 ? (
|
||||||
<p className="text-sm text-muted-foreground">No assigned issues.</p>
|
<p className="text-sm text-muted-foreground">No assigned issues.</p>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { useEffect, useMemo } from "react";
|
import { useEffect, useMemo } from "react";
|
||||||
|
import { useSearchParams } from "react-router-dom";
|
||||||
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
||||||
import { issuesApi } from "../api/issues";
|
import { issuesApi } from "../api/issues";
|
||||||
import { agentsApi } from "../api/agents";
|
import { agentsApi } from "../api/agents";
|
||||||
@@ -13,6 +14,7 @@ import { CircleDot } from "lucide-react";
|
|||||||
export function Issues() {
|
export function Issues() {
|
||||||
const { selectedCompanyId } = useCompany();
|
const { selectedCompanyId } = useCompany();
|
||||||
const { setBreadcrumbs } = useBreadcrumbs();
|
const { setBreadcrumbs } = useBreadcrumbs();
|
||||||
|
const [searchParams] = useSearchParams();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const { data: agents } = useQuery({
|
const { data: agents } = useQuery({
|
||||||
@@ -66,6 +68,7 @@ export function Issues() {
|
|||||||
agents={agents}
|
agents={agents}
|
||||||
liveIssueIds={liveIssueIds}
|
liveIssueIds={liveIssueIds}
|
||||||
viewStateKey="paperclip:issues-view"
|
viewStateKey="paperclip:issues-view"
|
||||||
|
initialAssignees={searchParams.get("assignee") ? [searchParams.get("assignee")!] : undefined}
|
||||||
onUpdateIssue={(id, data) => updateIssue.mutate({ id, data })}
|
onUpdateIssue={(id, data) => updateIssue.mutate({ id, data })}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user