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 @@
11import { useAtomRefresh } from "@effect/atom-react";
22import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native";
3import { sourceControlClients } from "@t3tools/client-runtime/source-control-clients";
34import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
45import type { PullRequestReviewVerdict } from "@t3tools/contracts";
56import { useCallback, useRef, useState } from "react";
......@@ -84,12 +85,21 @@ export function PullRequestReviewSheet({
8485 const verdict = offered.find((option) => option.value === requestedVerdict) ?? offered[0];
8586 const reviewing = params.mode === "review";
8687 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;
8793 const canSubmit =
8894 store.ready &&
8995 (!reviewing || (!stale && canSubmitComments)) &&
9096 (reviewing
9197 ? 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)
93103 : permissions.canComment && body.trim().length > 0);
94104 const perform = () =>
95105 submission.submit(async () => {
......@@ -160,7 +170,13 @@ export function PullRequestReviewSheet({
160170 <TextInput
161171 multiline
162172 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 }
164180 placeholderTextColorClassName="accent-foreground-muted"
165181 editable={store.ready && !submission.busy}
166182 value={body}