From 04c9f99b2c67424102a1056e60a2d17dd0612a25 Mon Sep 17 00:00:00 2001 From: Alejandro Perez Date: Fri, 3 Jul 2026 12:42:10 +0100 Subject: [PATCH] app: state-routed open for table rows and rail (comments regression) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Row double-click/Enter and the rail's Open review called navigateToDiff directly, skipping the Pending -> InReview transition the card action performs — and DiffView only enables click-to-comment while InReview, so reviews opened from the table landed silently read-only. Opens now route by gate state exactly like the action button; the rail's finding jump does the same since jumping to a line is a prelude to commenting. --- app/src/App.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/src/App.tsx b/app/src/App.tsx index 412be8e..2220612 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -717,13 +717,17 @@ function App() { [restackPr], ); - // Open a review's workspace directly (row double-click / Enter, rail footer). - // The Briefing-vs-Diff landing decision lives in the workspace itself. + // Open a review's workspace (row double-click / Enter, rail footer). Routes + // by gate state exactly like the action button: an actionable review opens + // FOR REVIEW (Pending/Reworked → InReview — commenting is only enabled while + // InReview, so a bare navigate would land in a silently read-only diff); + // everything else just navigates. The Briefing-vs-Diff landing decision + // lives in the workspace itself. const handleOpenReview = useCallback( (pr: string) => { - void navigateToDiff(pr); + handleReviewAction(pr); }, - [navigateToDiff], + [handleReviewAction], ); const clearSelection = useCallback(() => { @@ -735,9 +739,11 @@ function App() { const handleRailJump = useCallback( (pr: string, path: string, side: DiffSide, line: number) => { requestDiffJump(pr, path, side, line); - void navigateToDiff(pr); + // Same state-routed open as handleOpenReview: jumping to a finding's + // line is a prelude to commenting on it, which needs InReview. + handleReviewAction(pr); }, - [requestDiffJump, navigateToDiff], + [requestDiffJump, handleReviewAction], ); // Opening a project always routes to its plan gate. When the project has no