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(web,mobile): approval cards show characters a screen would not dr… · patroza/t3code@d5d5c17

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps
    • mobile/src
      • features/threads
        • PendingApprovalCard.tsx
      • i18n/translations
        • de.json
        • en.json
        • es.json
        • fr.json
        • ja.json
        • ko.json
        • pt-BR.json
        • ru.json
        • sv.json
        • zh.json
    • web/src
      • components/chat
        • ApprovalText.tsx
        • ChildThreadApprovals.tsx
        • MessagesTimeline.browser.test.tsx
        • TimelinePendingApprovalRow.tsx
      • i18n/translations
        • de.json
        • en.json
        • es.json
        • fr.json
        • ja.json
        • ko.json
        • pt-BR.json
        • ru.json
        • sv.json
        • zh.json
  • packages
    • client-runtime/src/state
      • threadRequests.test.ts
      • threadRequests.ts
    • provider-acp/src/server
      • runtimeModel.test.ts
      • runtimeModel.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/mobile/src/features/threads/PendingApprovalCard.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/PendingApprovalCard.tsx
+65-6Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ import type {
55
RuntimeRequestId,
66
} from "@t3tools/contracts";
77
import {
8+
type ApprovalTextPart,
9+
approvalTextParts,
810
FULL_ACCESS_OVERRIDE_QUESTION,
911
fullAccessOverrideExplanation,
1012
PUSH_HOOKS_APPROVAL_QUESTION,
1113
pushHooksApprovalRows,
1214
} from "@t3tools/client-runtime/state/thread-requests";
1315
import { T, useGT, useMessages } from "gt-react-native";
14-
import { useState } from "react";
15-
import { Pressable, View } from "react-native";
16+
import { type ComponentRef, useRef, useState } from "react";
17+
import { Pressable, ScrollView, View } from "react-native";
1618

1719
import { AppText as Text } from "../../components/ui/AppText";
1820
import type { PendingApproval } from "../../lib/threadActivity";
@@ -44,6 +46,8 @@ export function PendingApprovalCard(props: PendingApprovalCardProps) {
4446
const [explanationOpen, setExplanationOpen] = useState(false);
4547
// T3 Code's own question reads as the app asking: a plain sentence, then what it names.
4648
const { pushHooks } = props.approval;
49+
const detail =
50+
!pushHooks && props.approval.detail ? approvalTextParts(props.approval.detail) : null;
4751
return (
4852
<View className="gap-2.5 rounded-[20px] border border-border bg-card-alt p-4">
4953
<Text className="font-t3-bold text-2xs uppercase tracking-[1.1px] text-foreground-secondary">
@@ -67,10 +71,23 @@ export function PendingApprovalCard(props: PendingApprovalCardProps) {
6771
</View>
6872
))}
6973
</View>
70-
) : props.approval.detail ? (
71-
<Text className="font-sans text-sm leading-normal text-foreground-secondary">
72-
{props.approval.detail}
73-
</Text>
74+
) : detail ? (
75+
<>
76+
{detail.hiddenLength > 0 ? (
77+
<>
78+
<ApprovalTextScroll parts={detail.parts} />
79+
<Text className="font-sans text-xs leading-normal text-warning-foreground">
80+
{gt(
81+
"{count, plural, one {… {hidden} character in the middle is not shown.} other {… {hidden} characters in the middle are not shown.}} The text ends with:",
82+
{ count: detail.hiddenLength, hidden: detail.hiddenLength.toLocaleString() },
83+
)}
84+
</Text>
85+
<ApprovalTextScroll parts={detail.tail} fromEnd />
86+
</>
87+
) : (
88+
<ApprovalTextParts parts={detail.parts} />
89+
)}
90+
</>
7491
) : null}
7592
{props.approval.reason ? (
7693
<Text className="font-sans text-xs leading-normal text-warning-foreground">
@@ -130,3 +147,45 @@ export function PendingApprovalCard(props: PendingApprovalCardProps) {
130147
</View>
131148
);
132149
}
150+
151+
/**
152+
* One end of text too long to show in full, in a box that scrolls on its own, so the note, the
153+
* other end and the buttons stay within reach. The end opens on its last line.
154+
*/
155+
function ApprovalTextScroll(props: {
156+
readonly parts: ReadonlyArray<ApprovalTextPart>;
157+
readonly fromEnd?: boolean;
158+
}) {
159+
const box = useRef<ComponentRef<typeof ScrollView>>(null);
160+
return (
161+
<ScrollView
162+
ref={box}
163+
className="max-h-40"
164+
nestedScrollEnabled
165+
onContentSizeChange={
166+
props.fromEnd ? () => box.current?.scrollToEnd({ animated: false }) : undefined
167+
}
168+
>
169+
<ApprovalTextParts parts={props.parts} />
170+
</ScrollView>
171+
);
172+
}
173+
174+
function ApprovalTextParts(props: { readonly parts: ReadonlyArray<ApprovalTextPart> }) {
175+
return (
176+
<Text className="font-sans text-sm leading-normal text-foreground-secondary">
177+
{props.parts.map((part, index) =>
178+
part.named ? (
179+
// Tinted only: a second font inside wrapped lines makes Android lay the text out shorter
180+
// than it draws, which cuts off its last lines.
181+
// oxlint-disable-next-line react/no-array-index-key -- parts never reorder and two may read alike
182+
<Text key={index} className="text-warning-foreground">
183+
{part.text}
184+
</Text>
185+
) : (
186+
part.text
187+
),
188+
)}
189+
</Text>
190+
);
191+
}
Collapse file

‎apps/mobile/src/i18n/translations/de.json‎

Copy file name to clipboardExpand all lines: apps/mobile/src/i18n/translations/de.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"035aab5e99159bd8": "{count, plural, one {… {hidden} Zeichen in der Mitte wird nicht angezeigt.} other {… {hidden} Zeichen in der Mitte werden nicht angezeigt.}} Der Text endet mit:",
23
"4bcfa3b976a421cf": "Nebenchat",
34
"23be753133ae6950": "Thread",
45
"0001ae5846061bb6": "Thread auf {machine}",
Collapse file

‎apps/mobile/src/i18n/translations/en.json‎

Copy file name to clipboardExpand all lines: apps/mobile/src/i18n/translations/en.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"035aab5e99159bd8": "{count, plural, one {… {hidden} character in the middle is not shown.} other {… {hidden} characters in the middle are not shown.}} The text ends with:",
23
"4bcfa3b976a421cf": "Side chat",
34
"23be753133ae6950": "Thread",
45
"0001ae5846061bb6": "Thread on {machine}",
Collapse file

‎apps/mobile/src/i18n/translations/es.json‎

Copy file name to clipboardExpand all lines: apps/mobile/src/i18n/translations/es.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"035aab5e99159bd8": "{count, plural, one {… No se muestra {hidden} carácter del medio.} other {… No se muestran {hidden} caracteres del medio.}} El texto termina con:",
23
"4bcfa3b976a421cf": "Chat lateral",
34
"23be753133ae6950": "Hilo",
45
"0001ae5846061bb6": "Hilo en {machine}",
Collapse file

‎apps/mobile/src/i18n/translations/fr.json‎

Copy file name to clipboardExpand all lines: apps/mobile/src/i18n/translations/fr.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"035aab5e99159bd8": "{count, plural, one {… {hidden} caractère au milieu n’est pas affiché.} other {… {hidden} caractères au milieu ne sont pas affichés.}} Le texte se termine par :",
23
"4bcfa3b976a421cf": "Discussion annexe",
34
"23be753133ae6950": "Fil",
45
"0001ae5846061bb6": "Fil sur {machine}",
Collapse file

‎apps/mobile/src/i18n/translations/ja.json‎

Copy file name to clipboardExpand all lines: apps/mobile/src/i18n/translations/ja.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"035aab5e99159bd8": "{count, plural, other {… 途中の {hidden} 文字は表示されていません。}} テキストの末尾:",
23
"4bcfa3b976a421cf": "サイドチャット",
34
"23be753133ae6950": "スレッド",
45
"0001ae5846061bb6": "{machine} 上のスレッド",
Collapse file

‎apps/mobile/src/i18n/translations/ko.json‎

Copy file name to clipboardExpand all lines: apps/mobile/src/i18n/translations/ko.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"035aab5e99159bd8": "{count, plural, other {… 중간의 {hidden}자는 표시되지 않습니다.}} 텍스트의 끝부분:",
23
"4bcfa3b976a421cf": "사이드 채팅",
34
"23be753133ae6950": "스레드",
45
"0001ae5846061bb6": "{machine}의 스레드",
Collapse file

‎apps/mobile/src/i18n/translations/pt-BR.json‎

Copy file name to clipboardExpand all lines: apps/mobile/src/i18n/translations/pt-BR.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"035aab5e99159bd8": "{count, plural, one {… {hidden} caractere do meio não é exibido.} other {… {hidden} caracteres do meio não são exibidos.}} O texto termina com:",
23
"4bcfa3b976a421cf": "Chat paralelo",
34
"23be753133ae6950": "Thread",
45
"0001ae5846061bb6": "Thread em {machine}",
Collapse file

‎apps/mobile/src/i18n/translations/ru.json‎

Copy file name to clipboardExpand all lines: apps/mobile/src/i18n/translations/ru.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"035aab5e99159bd8": "{count, plural, one {… {hidden} символ в середине не показан.} few {… {hidden} символа в середине не показаны.} many {… {hidden} символов в середине не показаны.} other {… {hidden} символа в середине не показаны.}} Текст заканчивается так:",
23
"4bcfa3b976a421cf": "Боковой чат",
34
"23be753133ae6950": "Тред",
45
"0001ae5846061bb6": "Тред на {machine}",
Collapse file

‎apps/mobile/src/i18n/translations/sv.json‎

Copy file name to clipboardExpand all lines: apps/mobile/src/i18n/translations/sv.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"035aab5e99159bd8": "{count, plural, one {… {hidden} tecken i mitten visas inte.} other {… {hidden} tecken i mitten visas inte.}} Texten slutar med:",
23
"4bcfa3b976a421cf": "Sidochatt",
34
"23be753133ae6950": "Tråd",
45
"0001ae5846061bb6": "Tråd på {machine}",

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.