GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(clients): change requests use their host's own term · pingdotgg/t3code@fd44c38

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps
    • mobile/src
      • components
        • ComposerContextSheet.tsx
      • features
        • pull-requests
          • PullRequestControls.tsx
          • PullRequestFiles.tsx
          • PullRequestListRow.tsx
          • PullRequestMergeControls.tsx
          • PullRequestPresentation.tsx
          • PullRequestReviewSheet.tsx
          • PullRequestReviewersScreen.tsx
          • PullRequestRouteScreen.tsx
          • PullRequestStatusRows.tsx
          • guide
            • PullRequestGuideScreen.tsx
          • pullRequestActions.test.ts
          • pullRequestActions.ts
          • pullRequestAgentTasks.test.ts
          • pullRequestAgentTasks.ts
          • pullRequestDiffPages.test.ts
          • pullRequestDiffPages.ts
          • pullRequestLink.ts
          • pullRequestStack.test.ts
          • pullRequestStack.ts
          • usePullRequestAction.ts
          • usePullRequestDiff.ts
          • usePullRequestListActions.ts
          • usePullRequestThreads.ts
        • threads
          • GitActionProgressOverlay.tsx
          • LinkedPullRequestList.tsx
          • ThreadGitControls.tsx
          • ThreadPullRequestsSheet.tsx
          • git
            • GitConfirmSheet.tsx
            • GitOverviewSheet.tsx
            • gitSheetComponents.tsx
          • new-task-context-presentation.test.ts
          • new-task-context-presentation.ts
          • use-open-thread-pull-requests.ts
          • useLinkedPullRequestActions.ts
      • lib
        • composerContext.test.ts
        • composerContext.ts
      • state
        • thread-pr-presentation.ts
        • use-thread-outbox-drain.ts
        • use-thread-pr.test.ts
    • web/src
      • components
        • BranchToolbarBranchSelector.tsx
        • CommandPalette.tsx
        • GitActionsControl.logic.test.ts
        • GitActionsControl.logic.ts
        • GitActionsControl.tsx
        • PullRequestContextDetails.tsx
        • PullRequestThreadDialog.tsx
        • ThreadStatusIndicators.tsx
        • chat
          • ThreadDetailsPrRow.tsx
        • pullRequest
          • PullRequestActionsMenu.tsx
          • PullRequestActivityUnavailableState.tsx
          • PullRequestCodeTab.tsx
          • PullRequestCommentForm.tsx
          • PullRequestComposer.tsx
          • PullRequestDetailActions.tsx
          • PullRequestDetailCrumbs.tsx
          • PullRequestDetailPanel.tsx
          • PullRequestDiffUnavailableState.tsx
          • PullRequestGhosts.tsx
          • PullRequestReviewForm.tsx
          • PullRequestRow.tsx
          • PullRequestSpeedActions.tsx
          • PullRequestStackMenu.tsx
          • PullRequestSummaryTab.tsx
          • PullRequestThreadLinks.tsx
          • PullRequestTimelineTab.tsx
          • PullRequestTitleEditor.tsx
          • PullRequestsPage.tsx
          • ThreadPullRequestsPanel.tsx
          • pullRequestCheckoutToast.ts
          • pullRequestDetail.logic.test.ts
          • pullRequestDetail.logic.ts
          • pullRequestDiffError.test.ts
          • pullRequestDiffError.ts
          • usePullRequestActions.ts
      • lib
        • composerContextRecords.test.ts
        • composerContextRecords.ts
  • packages
    • client-runtime/src
      • pullRequestLinkInput.test.ts
      • pullRequestLinkInput.ts
      • sourceControlClients.ts
      • state
        • gitActions.test.ts
        • gitActions.ts
      • work-log
        • presentation.test.ts
        • presentation.ts
    • source-control-azure-devops/src/client
      • definition.ts
    • source-control-bitbucket/src/client
      • definition.ts
    • source-control-core/src/client
      • definition.ts
    • source-control-forgejo/src/client
      • definition.ts
    • source-control-gitcafe/src/client
      • definition.ts
    • source-control-github/src/client
      • definition.ts
    • source-control-gitlab/src/client
      • definition.ts

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/mobile/src/components/ComposerContextSheet.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/components/ComposerContextSheet.tsx
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import type {
1111
ScopedThreadRef,
1212
} from "@t3tools/contracts";
1313
import { formatAttachmentSize } from "@t3tools/client-runtime/state/attachments";
14+
import { sourceControlClients } from "@t3tools/client-runtime/source-control-clients";
1415
import { videoMimeType } from "@t3tools/shared/video";
1516
import { Platform, Pressable, ScrollView, View } from "react-native";
1617
import { useSafeAreaInsets } from "react-native-safe-area-context";
@@ -182,6 +183,10 @@ export function ComposerContextSheet(props: {
182183
record?.kind === "review-comment" && "pullRequest" in record
183184
? record.pullRequest?.url
184185
: undefined;
186+
const changeRequestTerm = (
187+
(pullRequestUrl ? sourceControlClients.findByChangeRequestUrl(pullRequestUrl) : undefined) ??
188+
sourceControlClients.get(undefined)
189+
).changeRequest.singular;
185190
const terminal = record?.kind === "terminal" && !("payload" in record) ? record : null;
186191
return (
187192
<Sheet title={terminal?.terminalLabel ?? props.label} onClose={props.onClose}>
@@ -354,12 +359,12 @@ export function ComposerContextSheet(props: {
354359
onPress={() => {
355360
props.onClose();
356361
void openPullRequest(pullRequestUrl).catch(() =>
357-
Dialog.alert("Could not open pull request", "Try again when connected."),
362+
Dialog.alert(`Could not open ${changeRequestTerm}`, "Try again when connected."),
358363
);
359364
}}
360365
className="rounded-xl bg-subtle p-4"
361366
>
362-
<Text className="text-foreground">Open pull request</Text>
367+
<Text className="text-foreground">Open {changeRequestTerm}</Text>
363368
</Pressable>
364369
) : null}
365370
{props.onOpenAttachment ? (
@@ -372,7 +377,7 @@ export function ComposerContextSheet(props: {
372377
) : null}
373378
{props.onOpenPullRequest && !pullRequestUrl ? (
374379
<Button
375-
label="Open pull request"
380+
label={`Open ${changeRequestTerm}`}
376381
tone="secondary"
377382
onPress={props.onOpenPullRequest}
378383
fullWidth
Collapse file

‎apps/mobile/src/features/pull-requests/PullRequestControls.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestControls.tsx
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { sourceControlClients } from "@t3tools/client-runtime/source-control-clients";
12
import Animated from "react-native-reanimated";
23
import { PR_ROW_LAYOUT } from "./pullRequestAnimations";
34
import { useNavigation } from "@react-navigation/native";
@@ -122,7 +123,10 @@ export function PullRequestActionToolbar(props: {
122123
const pendingReview = canReview && draft.comments.length > 0;
123124
const showAgentControls = agent.canAsk || !permissions.connected;
124125
const canOpenThread = agent.threads.length > 0 || showAgentControls;
125-
const threadLabel = agent.threads.length ? "Continue thread" : "Work on PR";
126+
const { shortLabel } = sourceControlClients.get(
127+
(props.pr ?? props.params.initialSummary)?.provider,
128+
).changeRequest;
129+
const threadLabel = agent.threads.length ? "Continue thread" : `Work on ${shortLabel}`;
126130
const primaryLabel = pendingReview ? `Submit review · ${draft.comments.length}` : threadLabel;
127131
const chooseThread = agent.threads.length > 1;
128132
const agentActions = agent.actions.filter((action) => action.task !== "ask");
@@ -162,7 +166,7 @@ export function PullRequestActionToolbar(props: {
162166
<View pointerEvents="none">
163167
<IconButton
164168
icon="sparkles"
165-
accessibilityLabel="PR agent actions"
169+
accessibilityLabel={`${shortLabel} agent actions`}
166170
disabled={agent.disabled}
167171
/>
168172
</View>
@@ -245,7 +249,7 @@ export function PullRequestActionToolbar(props: {
245249
identifier="pull-request-agent"
246250
icon="sparkles"
247251
title="AI helpers"
248-
accessibilityLabel="PR agent actions"
252+
accessibilityLabel={`${shortLabel} agent actions`}
249253
disabled={agent.disabled}
250254
separateBackground
251255
>
Collapse file

‎apps/mobile/src/features/pull-requests/PullRequestFiles.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestFiles.tsx
+12-3Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { sourceControlClients } from "@t3tools/client-runtime/source-control-clients";
12
import { AnimatedLegendList } from "@legendapp/list/reanimated";
23
import {
34
StackActions,
@@ -49,10 +50,13 @@ function fileDirectory(path: string) {
4950
}
5051

5152
function useChangedFiles(params: PullRequestDiffParams) {
52-
const diff = usePullRequestDiff(params);
5353
const detail = useEnvironmentQuery(composerPullRequests.detail(pullRequestTarget(params)));
5454
// A commit's diff is part of the pull request, so the PR's file counts and viewed state don't apply.
5555
const pr = params.commit ? null : detail.data;
56+
const terminology = sourceControlClients.get(
57+
(detail.data ?? params.initialSummary)?.provider,
58+
).changeRequest;
59+
const diff = usePullRequestDiff(params, terminology);
5660
const viewed = usePullRequestFilesViewed(params, pr);
5761
const filter = usePullRequestFileFilter(diff.parsed);
5862
const parsed = filter.parsed;
@@ -61,6 +65,7 @@ function useChangedFiles(params: PullRequestDiffParams) {
6165
filter,
6266
viewed,
6367
pr,
68+
terminology,
6469
parsed,
6570
loading: diff.isPending && parsed.kind === "empty" && !diff.error,
6671
};
@@ -261,7 +266,7 @@ export function usePullRequestFilesSection(params: PullRequestParams) {
261266
refresh: diff.refresh,
262267
header: (
263268
<>
264-
<PullRequestReadStatus pending={false} error={diff.error} />
269+
<PullRequestReadStatus pending={false} error={diff.error} terminology={files.terminology} />
265270
{loading ? (
266271
<View
267272
accessibilityLabel="Loading changed files"
@@ -474,7 +479,11 @@ export function PullRequestFilesSheet({ route }: StaticScreenProps<PullRequestDi
474479
estimatedItemSize={64}
475480
ListHeaderComponent={
476481
<>
477-
<PullRequestReadStatus pending={false} error={diff.error} />
482+
<PullRequestReadStatus
483+
pending={false}
484+
error={diff.error}
485+
terminology={files.terminology}
486+
/>
478487
{parsed.kind === "files" ? (
479488
<View className="flex-row items-center gap-2 py-2">
480489
<Text textRole="caption" className="min-w-0 flex-1 text-foreground-muted">
Collapse file

‎apps/mobile/src/features/pull-requests/PullRequestListRow.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestListRow.tsx
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import {
2+
capitalizeTerm,
3+
sourceControlClients,
4+
} from "@t3tools/client-runtime/source-control-clients";
15
import { memo } from "react";
26
import { Pressable, View } from "react-native";
37
import { AppText as Text } from "../../components/ui/AppText";
@@ -70,7 +74,7 @@ export const PullRequestListRow = memo(
7074
<Pressable
7175
accessibilityRole="button"
7276
accessibilityState={{ selected: props.selected, busy: props.busy }}
73-
accessibilityLabel={`Pull request ${item.number}, ${item.title}, ${status.label}${conflict ? `, ${conflict.label.toLowerCase()}` : ""}, by ${item.author?.login ?? "unknown author"}${review ? `, ${review.accessibleLabel}` : ""}${item.checksState ? `, checks ${item.checksState}` : ""}${item.stack ? `, stack ${item.stack.position} of ${item.stack.size}` : ""}${item.labels.length ? `, ${item.labels.map((label) => label.name).join(", ")}` : ""}, ${item.additions} additions, ${item.deletions} deletions`}
77+
accessibilityLabel={`${capitalizeTerm(sourceControlClients.get(item.provider).changeRequest.singular)} ${item.number}, ${item.title}, ${status.label}${conflict ? `, ${conflict.label.toLowerCase()}` : ""}, by ${item.author?.login ?? "unknown author"}${review ? `, ${review.accessibleLabel}` : ""}${item.checksState ? `, checks ${item.checksState}` : ""}${item.stack ? `, stack ${item.stack.position} of ${item.stack.size}` : ""}${item.labels.length ? `, ${item.labels.map((label) => label.name).join(", ")}` : ""}, ${item.additions} additions, ${item.deletions} deletions`}
7478
accessibilityHint="Double tap to open. Touch and hold for quick actions."
7579
onPress={() => props.onSelect(item)}
7680
disabled={props.busy}
Collapse file

‎apps/mobile/src/features/pull-requests/PullRequestMergeControls.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestMergeControls.tsx
+8-5Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
22
import * as Dialog from "../../components/ui/Dialog";
33
import { useAtomRefresh, useAtomSet, useAtomValue } from "@effect/atom-react";
44
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
5+
import { sourceControlClients } from "@t3tools/client-runtime/source-control-clients";
56
import type { PullRequestDetail, PullRequestMergeMethod } from "@t3tools/contracts";
67
import { AsyncResult } from "effect/reactivity";
78
import { useRef, useState } from "react";
@@ -20,6 +21,7 @@ import {
2021
mergeUnavailableReason,
2122
MERGE_CONFLICT_REASON,
2223
MERGE_METHODS,
24+
pullRequestActionLabel,
2325
} from "./pullRequestActions";
2426
import { pullRequestStackMerge, singlePullRequestMergeAllowed } from "./pullRequestStack";
2527
import { pullRequestTarget, type PullRequestParams } from "./usePullRequestDiff";
@@ -33,6 +35,7 @@ export function PullRequestMergeControls(props: {
3335
readonly stack: PullRequestStackState;
3436
}) {
3537
const { pr, stack } = props;
38+
const terminology = sourceControlClients.get(pr.provider).changeRequest;
3639
const target = pullRequestTarget(props.params);
3740
const permissions = usePullRequestPermissions(props.params, pr);
3841
const preferences = useAtomValue(mobilePreferencesAtom);
@@ -53,7 +56,7 @@ export function PullRequestMergeControls(props: {
5356
: methods.includes("squash")
5457
? "squash"
5558
: methods[0];
56-
const scope = stack.stack ? pullRequestStackMerge(stack.stack, pr.number) : null;
59+
const scope = stack.stack ? pullRequestStackMerge(stack.stack, pr.number, terminology) : null;
5760
const canMergeSingle = singlePullRequestMergeAllowed({
5861
supportsStackActions: stack.supportsStackActions,
5962
hasStack: stack.stack !== null,
@@ -64,7 +67,7 @@ export function PullRequestMergeControls(props: {
6467
const reason =
6568
(!permissions.connected
6669
? "Reconnect to merge."
67-
: mergeUnavailableReason(pr, permissions.canWrite)) ??
70+
: mergeUnavailableReason(pr, permissions.canWrite, terminology)) ??
6871
(stack.stack
6972
? !stack.supportsStackActions
7073
? "This environment can display stacks but cannot merge them."
@@ -116,7 +119,7 @@ export function PullRequestMergeControls(props: {
116119
!canPerformPullRequestAction(fresh, "merge") ||
117120
!allowedMergeMethods(fresh).includes(method)
118121
)
119-
throw new Error("The pull request changed. Refresh before merging.");
122+
throw new Error(`The ${terminology.singular} changed. Refresh before merging.`);
120123
return method;
121124
},
122125
}
@@ -144,7 +147,7 @@ export function PullRequestMergeControls(props: {
144147
action === "merge"
145148
? scope && scope.layers.length > 1
146149
? `Merge ${scope.layers.length} stack layers?`
147-
: "Merge pull request?"
150+
: `${pullRequestActionLabel("merge", terminology)}?`
148151
: action === "enable-auto-merge"
149152
? "Enable auto-merge?"
150153
: "Disable auto-merge?";
@@ -154,7 +157,7 @@ export function PullRequestMergeControls(props: {
154157
: action === "enable-auto-merge"
155158
? `Merge #${pr.number} using ${method} when its requirements are met. This may happen immediately.`
156159
: action === "disable-auto-merge"
157-
? "Stop the provider from automatically merging this pull request."
160+
? `Stop the provider from automatically merging this ${terminology.singular}.`
158161
: `Merge #${pr.number} into ${pr.baseBranch} using ${method}.`;
159162
Dialog.alert(title, message, [
160163
{ text: "Cancel", style: "cancel" },
Collapse file

‎apps/mobile/src/features/pull-requests/PullRequestPresentation.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestPresentation.tsx
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
2+
import type { ChangeRequestTerminology } from "@t3tools/client-runtime/source-control-clients";
23
import type { PullRequestActor } from "@t3tools/contracts";
34
import IconAlertTriangle from "@tabler/icons-react-native/IconAlertTriangle";
45
import { Image } from "expo-image";
@@ -12,11 +13,16 @@ import { EmptyState } from "../../components/ui/EmptyState";
1213
export function PullRequestReadStatus(props: {
1314
readonly pending: boolean;
1415
readonly error: string | null;
16+
readonly terminology: ChangeRequestTerminology;
1517
}) {
1618
return props.pending ? (
1719
<AppActivityIndicator className="my-12" colorClassName="accent-icon" />
1820
) : props.error ? (
19-
<EmptyState title="Couldn't load this pull request" detail={props.error} variant="plain" />
21+
<EmptyState
22+
title={`Couldn't load this ${props.terminology.singular}`}
23+
detail={props.error}
24+
variant="plain"
25+
/>
2026
) : null;
2127
}
2228

Collapse file

‎apps/mobile/src/features/pull-requests/PullRequestReviewSheet.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestReviewSheet.tsx
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,9 @@ export function PullRequestReviewSheet({
241241
) : null}
242242
{reviewing && !canSubmitComments ? (
243243
<Text className="text-sm text-danger-foreground">
244-
You can no longer submit line comments on this pull request. Your drafts are kept here.
244+
You can no longer submit line comments on this{" "}
245+
{sourceControlClients.get(result.data?.provider).changeRequest.singular}. Your drafts are
246+
kept here.
245247
</Text>
246248
) : null}
247249
{submission.error || result.error || store.error ? (
Collapse file

‎apps/mobile/src/features/pull-requests/PullRequestReviewersScreen.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/pull-requests/PullRequestReviewersScreen.tsx
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { usePullRequestConnected } from "./usePullRequestConnected";
55
import { useAtomValue } from "@effect/atom-react";
66
import { useNavigation, type StaticScreenProps } from "@react-navigation/native";
77
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
8+
import { sourceControlClients } from "@t3tools/client-runtime/source-control-clients";
89
import type { PullRequestReviewerCandidate } from "@t3tools/contracts";
910
import { useEffect, useRef, useState } from "react";
1011
import {
@@ -61,6 +62,9 @@ export function PullRequestReviewersScreen({ route }: StaticScreenProps<PullRequ
6162
const target = pullRequestTarget(route.params);
6263
const detail = useEnvironmentQuery(composerPullRequests.detail(target));
6364
const pr = detail.data;
65+
const { singular } = sourceControlClients.get(
66+
(pr ?? route.params.initialSummary)?.provider,
67+
).changeRequest;
6468
const canWrite = useAtomValue(
6569
composerPullRequests.requestReviewers.permissionAtom(target.environmentId),
6670
);
@@ -194,7 +198,7 @@ export function PullRequestReviewersScreen({ route }: StaticScreenProps<PullRequ
194198
) : null}
195199
{!allowed ? (
196200
<Text className="text-xs text-foreground-muted">
197-
Requesting reviews requires write access and an open pull request.
201+
Requesting reviews requires write access and an open {singular}.
198202
</Text>
199203
) : null}
200204
{error ? (
@@ -279,7 +283,7 @@ export function PullRequestReviewersScreen({ route }: StaticScreenProps<PullRequ
279283
<AppActivityIndicator />
280284
) : (
281285
<Text className="text-danger-foreground">
282-
{detail.error ?? "Couldn't load this pull request."}
286+
{detail.error ?? `Couldn't load this ${singular}.`}
283287
</Text>
284288
)
285289
) : (

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.