From 29390ecd9979f6e2200cb7f588deff33206c98c3 Mon Sep 17 00:00:00 2001 From: R-Hart80 Date: Mon, 13 Apr 2026 17:27:41 -0300 Subject: [PATCH 1/2] feat: unify suggestions and PRs views with mode-aware labels In standard mode, the PR list and actions now use suggestion-friendly language: tabs show "Accepted"/"Rejected" instead of "Merged"/"Closed", action buttons say "Accept"/"Reject" instead of "Merge"/"Close", and confirmation dialogs and empty-state messages follow suit. The editor toolbar now shows a single mode-aware button: - Standard mode (isSuggestionMode): "My Suggestions" in amber, linking to /pull-requests with suggestion labels - Developer mode: "My Pull Requests" with open-PR count badge The pull-requests list page and detail breadcrumb also adapt their titles and icons based on the active editor mode. Closes #65 Co-Authored-By: Claude Sonnet 4.6 --- app/projects/[id]/editor/page.tsx | 38 +++++++++---------- .../[id]/pull-requests/[prNumber]/page.tsx | 6 ++- app/projects/[id]/pull-requests/page.tsx | 19 +++++++--- components/pr/PRActions.tsx | 28 +++++++++----- components/pr/PRDetail.tsx | 4 ++ components/pr/PRList.tsx | 24 +++++++++--- components/pr/PRListItem.tsx | 11 ++++-- 7 files changed, 84 insertions(+), 46 deletions(-) diff --git a/app/projects/[id]/editor/page.tsx b/app/projects/[id]/editor/page.tsx index 186e3773..541035d7 100644 --- a/app/projects/[id]/editor/page.tsx +++ b/app/projects/[id]/editor/page.tsx @@ -927,12 +927,25 @@ export default function EditorPage() { )} - {/* Suggestions link */} - {isSuggestionMode && ( - - )} @@ -1022,19 +1035,6 @@ export default function EditorPage() { )} - {/* PR Link */} - - - - )} {/* PR List */} - + {/* Create Modal */} {session?.accessToken && ( diff --git a/components/pr/PRActions.tsx b/components/pr/PRActions.tsx index e36afe09..d2f6ba01 100644 --- a/components/pr/PRActions.tsx +++ b/components/pr/PRActions.tsx @@ -22,12 +22,14 @@ import { } from "lucide-react"; import Link from "next/link"; import { branchesApi } from "@/lib/api/revisions"; +import type { EditorMode } from "@/lib/stores/editorModeStore"; interface PRActionsProps { projectId: string; pr: PullRequest; accessToken: string; userRole?: string; + mode?: EditorMode; onUpdate: (pr: PullRequest) => void; className?: string; } @@ -37,9 +39,11 @@ export function PRActions({ pr, accessToken, userRole, + mode = "developer", onUpdate, className, }: PRActionsProps) { + const isSuggestionMode = mode === "standard"; const [isSubmitting, setIsSubmitting] = useState(false); const [error, setError] = useState(null); const [showReviewForm, setShowReviewForm] = useState(false); @@ -341,7 +345,7 @@ export function PRActions({ Review - {/* Merge button */} + {/* Merge / Accept button */} {canMerge && ( )} - {/* Close button */} + {/* Close / Reject button */} )} @@ -382,9 +386,11 @@ export function PRActions({ open={showMergeDialog} onOpenChange={setShowMergeDialog} onConfirm={handleMerge} - title="Merge Pull Request" - description={`Are you sure you want to merge "${pr.title}" into ${pr.target_branch}?`} - confirmLabel="Merge" + title={isSuggestionMode ? "Accept Suggestion" : "Merge Pull Request"} + description={isSuggestionMode + ? `Are you sure you want to accept "${pr.title}" into ${pr.target_branch}?` + : `Are you sure you want to merge "${pr.title}" into ${pr.target_branch}?`} + confirmLabel={isSuggestionMode ? "Accept" : "Merge"} variant="default" >