From 12b34e83af63da05368e97b7cd0bb7719b17a62d Mon Sep 17 00:00:00 2001 From: oliver <97427849+flamboh@users.noreply.github.com> Date: Sun, 11 Oct 2026 19:45:49 -0700 Subject: [PATCH] fix(mobile): Forgejo change requests ask for the summary they require (#18455) --- .../pull-requests/PullRequestReviewSheet.tsx | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/features/pull-requests/PullRequestReviewSheet.tsx b/apps/mobile/src/features/pull-requests/PullRequestReviewSheet.tsx index c41d582e7e01c40b17063be3583f38264b6a8cf0..a1495eb19f513adddab7b1ac6646c26f61b5845e 100644 --- a/apps/mobile/src/features/pull-requests/PullRequestReviewSheet.tsx +++ b/apps/mobile/src/features/pull-requests/PullRequestReviewSheet.tsx @@ -1,5 +1,6 @@ import { useAtomRefresh } from "@effect/atom-react"; import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native"; +import { sourceControlClients } from "@t3tools/client-runtime/source-control-clients"; import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime"; import type { PullRequestReviewVerdict } from "@t3tools/contracts"; import { useCallback, useRef, useState } from "react"; @@ -84,12 +85,21 @@ export function PullRequestReviewSheet({ const verdict = offered.find((option) => option.value === requestedVerdict) ?? offered[0]; const reviewing = params.mode === "review"; const canSubmitComments = !store.draft.comments.length || permissions.canInlineComment; + // Forgejo requires a summary when requesting changes, even with inline comments. + const summaryRequired = + verdict !== undefined && result.data + ? sourceControlClients.get(result.data.provider).reviewSummaryRequired(verdict.value) + : false; const canSubmit = store.ready && (!reviewing || (!stale && canSubmitComments)) && (reviewing ? verdict !== undefined && - (verdict.value === "approve" || body.trim().length > 0 || store.draft.comments.length > 0) + (summaryRequired + ? body.trim().length > 0 + : verdict.value === "approve" || + body.trim().length > 0 || + store.draft.comments.length > 0) : permissions.canComment && body.trim().length > 0); const perform = () => submission.submit(async () => { @@ -160,7 +170,13 @@ export function PullRequestReviewSheet({