authorgravatar for 97427849+flamboh@users.noreply.github.comoliver <97427849+flamboh@users.noreply.github.com> 2026-10-11 19:45:49-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-11 19:45:49-07:00
log12b34e83af63da05368e97b7cd0bb7719b17a62d
tree6d022d8114c8fb7c5d1de658d7aba0175726ee05
parent397a46123999ada6b9ddcbe85534631a241bb0ed
signature Signed by PGP key B5690EEEBB952194

fix(mobile): Forgejo change requests ask for the summary they require (#18455)


1 files changed, 18 insertions(+), 2 deletions(-)

apps/mobile/src/features/pull-requests/PullRequestReviewSheet.tsx+18-2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1import { useAtomRefresh } from "@effect/atom-react";1import { useAtomRefresh } from "@effect/atom-react";
2import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native";2import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native";
3import { sourceControlClients } from "@t3tools/client-runtime/source-control-clients";
3import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";4import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
4import type { PullRequestReviewVerdict } from "@t3tools/contracts";5import type { PullRequestReviewVerdict } from "@t3tools/contracts";
5import { useCallback, useRef, useState } from "react";6import { useCallback, useRef, useState } from "react";
...@@ -84,12 +85,21 @@ export function PullRequestReviewSheet({...@@ -84,12 +85,21 @@ export function PullRequestReviewSheet({
84 const verdict = offered.find((option) => option.value === requestedVerdict) ?? offered[0];85 const verdict = offered.find((option) => option.value === requestedVerdict) ?? offered[0];
85 const reviewing = params.mode === "review";86 const reviewing = params.mode === "review";
86 const canSubmitComments = !store.draft.comments.length || permissions.canInlineComment;87 const canSubmitComments = !store.draft.comments.length || permissions.canInlineComment;
88 // Forgejo requires a summary when requesting changes, even with inline comments.
89 const summaryRequired =
90 verdict !== undefined && result.data
91 ? sourceControlClients.get(result.data.provider).reviewSummaryRequired(verdict.value)
92 : false;
87 const canSubmit =93 const canSubmit =
88 store.ready &&94 store.ready &&
89 (!reviewing || (!stale && canSubmitComments)) &&95 (!reviewing || (!stale && canSubmitComments)) &&
90 (reviewing96 (reviewing
91 ? verdict !== undefined &&97 ? verdict !== undefined &&
92 (verdict.value === "approve" || body.trim().length > 0 || store.draft.comments.length > 0)98 (summaryRequired
99 ? body.trim().length > 0
100 : verdict.value === "approve" ||
101 body.trim().length > 0 ||
102 store.draft.comments.length > 0)
93 : permissions.canComment && body.trim().length > 0);103 : permissions.canComment && body.trim().length > 0);
94 const perform = () =>104 const perform = () =>
95 submission.submit(async () => {105 submission.submit(async () => {
...@@ -160,7 +170,13 @@ export function PullRequestReviewSheet({...@@ -160,7 +170,13 @@ export function PullRequestReviewSheet({
160 <TextInput170 <TextInput
161 multiline171 multiline
162 accessibilityLabel={reviewing ? "Review summary" : "Comment"}172 accessibilityLabel={reviewing ? "Review summary" : "Comment"}
163 placeholder={reviewing ? "Summarize your review…" : "Write a comment…"}173 placeholder={
174 reviewing
175 ? summaryRequired
176 ? "Summary required to request changes…"
177 : "Summarize your review…"
178 : "Write a comment…"
179 }
164 placeholderTextColorClassName="accent-foreground-muted"180 placeholderTextColorClassName="accent-foreground-muted"
165 editable={store.ready && !submission.busy}181 editable={store.ready && !submission.busy}
166 value={body}182 value={body}