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 — Merge remote-tracking branch 'origin/main' into fix/composer-banner-b… · pingdotgg/t3code@b95ba8f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps
    • mobile
      • modules/t3-composer-editor
        • ios
          • T3ComposerEditorView.swift
        • tests/ios
          • main.swift
      • src
        • components
          • ComposerEditor.ios.test.tsx
        • features
          • layout
            • createWorkspaceStackNavigator.ios.tsx
          • settings/appearance
            • useScaledTextRole.ts
          • threads
            • ThreadComposer.tsx
        • lib
          • appearancePreferences.test.ts
          • appearancePreferences.ts
        • native
          • T3ComposerEditor.ios.tsx
          • createV5StackNavigator.ios.test.tsx
          • createV5StackNavigator.ios.tsx
          • workspace-stack-projection.test.ts
          • workspace-stack-projection.ts
      • vite.config.ts
    • server/src
      • mcp
        • OrchestratorMcpService.test.ts
        • OrchestratorMcpService.ts
        • toolkits/orchestrator
          • tools.ts
      • orchestration-v2
        • Adapters
          • ClaudeAdapterV2.test.ts
          • ClaudeAdapterV2.ts
        • Orchestrator.ts
        • ProjectionStore.ts
        • ProviderTurnStartService.test.ts
        • ProviderTurnStartService.ts
        • QueuedRunOrder.test.ts
        • QueuedRunOrder.ts
        • RunFinalizationService.test.ts
        • RunFinalizationService.ts
        • ThreadLaunchService.test.ts
        • ThreadLaunchService.ts
        • ThreadManagementService.test.ts
        • ThreadManagementService.ts
        • ThreadTitleRegenerationService.test.ts
        • placeholderThreadTitle.ts
        • runtimeLayer.test.ts
      • persistence
        • Migrations.ts
        • Migrations
          • 086_QueuedTurnInputIndex.test.ts
          • 086_QueuedTurnInputIndex.ts
          • 092_QueuedTurnInputIndexJsonValid.ts
        • reconcileV2PreviewMigration.test.ts
      • provider
        • agentContextBudget.json
        • documentTextWorker.ts
        • userInputAttachments.test.ts
    • web/src
      • components
        • ChatMarkdown.tsx
        • ThreadTerminalDrawer.browser.test.tsx
        • chat
          • ExpandedImageDialog.browser.test.tsx
          • ExpandedImageDialog.tsx
          • MarkdownDetails.tsx
          • QueuedRunsControl.browser.test.tsx
          • threadFindHighlights.browser.test.tsx
          • threadFindHighlights.ts
        • files
          • AttachmentFilePreview.browser.test.tsx
          • FilePreviewPanel.test.ts
          • FilePreviewPanel.tsx
          • binaryPreview.worker.ts
          • fileCommentAnnotations.ts
        • ui
          • dialog.tsx
      • editorPreferences.test.ts
      • editorPreferences.ts
      • terminal-links.test.ts
      • terminal-links.ts
  • packages
    • client-runtime/src/state
      • filesystem.test.ts
      • filesystem.ts
    • contracts/src
      • orchestratorMcp.ts
    • shared
      • package.json
      • src
        • terminalOutput.test.ts
        • terminalOutput.ts
  • pnpm-lock.yaml
  • scripts/scenarios
    • thread-find-large-row.e2e.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/modules/t3-composer-editor/ios/T3ComposerEditorView.swift‎

Copy file name to clipboardExpand all lines: apps/mobile/modules/t3-composer-editor/ios/T3ComposerEditorView.swift
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ public final class T3ComposerEditorView: ExpoView, UITextViewDelegate, UITextDro
749749

750750
func setPlaceholder(_ placeholder: String) {
751751
placeholderLabel.text = placeholder
752+
textView.accessibilityLabel = placeholder
752753
setNeedsLayout()
753754
}
754755

Collapse file

‎apps/mobile/modules/t3-composer-editor/tests/ios/main.swift‎

Copy file name to clipboardExpand all lines: apps/mobile/modules/t3-composer-editor/tests/ios/main.swift
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ do {
139139
check(view.text.utf16.elementsEqual("@e\u{0301}".utf16), "A renormalized chip source kept the old text")
140140
}
141141

142+
// The placeholder label is hidden from VoiceOver, so the text view must carry it.
143+
do {
144+
let view = makeEditor("")
145+
view.setPlaceholder("Ask anything")
146+
check(view.editor.accessibilityLabel == "Ask anything", "VoiceOver label: \(String(describing: view.editor.accessibilityLabel))")
147+
}
148+
142149
print("composer editor tests passed")
143150

144151
private let dropEditor = ComposerTextView()
Collapse file

‎apps/mobile/src/components/ComposerEditor.ios.test.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/components/ComposerEditor.ios.test.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ vi.mock("../lib/useUniwindTheme", () => ({ useUniwindTheme: () => ({}) }));
128128
vi.mock("../lib/nativeComposerTheme", () => ({ createNativeComposerTheme: () => ({}) }));
129129
vi.mock("../lib/contextChipIconSource", () => ({ contextChipIconUri: () => "" }));
130130
vi.mock("../features/settings/appearance/useScaledTextRole", () => ({
131-
useScaledTextRole: () => ({ fontSize: 16, lineHeight: 22 }),
131+
useComposerTextRole: () => ({ fontSize: 16, lineHeight: 22 }),
132132
}));
133133
vi.mock("../lib/uuid", () => ({ uuidv4: () => "uuid", randomHex: () => "0000" }));
134134
vi.mock("../state/assets", () => ({ assetEnvironment: {} }));
Collapse file

‎apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx
+9-5Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ function ColumnScreen(props: {
107107
readonly selectedThreadKey?: string | null;
108108
readonly selectedPullRequestKey?: string | null;
109109
readonly onDismiss: (routeKey: string, native: boolean) => void;
110-
readonly onAppearance: (type: "willAppear" | "didAppear" | "willDisappear", key: string) => void;
110+
readonly onAppearance: (
111+
type: "willAppear" | "didAppear" | "willDisappear" | "didDisappear",
112+
key: string,
113+
) => void;
111114
readonly onCompose?: () => void;
112115
readonly navigation: ViewProps["navigation"];
113116
readonly footer?: ReactNode;
@@ -152,9 +155,10 @@ function ColumnScreen(props: {
152155
props.onAppearance("willDisappear", key);
153156
props.navigation.emit({ type: "transitionStart", target: key, data: { closing: true } });
154157
}}
155-
onDidDisappear={() =>
156-
props.navigation.emit({ type: "transitionEnd", target: key, data: { closing: true } })
157-
}
158+
onDidDisappear={() => {
159+
props.onAppearance("didDisappear", key);
160+
props.navigation.emit({ type: "transitionEnd", target: key, data: { closing: true } });
161+
}}
158162
>
159163
<PaneContext value={sidebar ? "sidebar" : "content"}>
160164
<NavigationContext value={descriptor.navigation}>
@@ -307,7 +311,7 @@ function WorkspaceColumns(
307311
}
308312
};
309313
const followCollapsedSplit = (
310-
type: "willAppear" | "didAppear" | "willDisappear",
314+
type: "willAppear" | "didAppear" | "willDisappear" | "didDisappear",
311315
key: string,
312316
) => {
313317
if (!collapsed.current || layout.usesSplitView) return;
Collapse file

‎apps/mobile/src/features/settings/appearance/useScaledTextRole.ts‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/settings/appearance/useScaledTextRole.ts
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { resolveScaledTextRole } from "../../../lib/appearancePreferences";
1+
import { Platform, useWindowDimensions } from "react-native";
2+
3+
import { resolveComposerTextRole, resolveScaledTextRole } from "../../../lib/appearancePreferences";
24
import { MOBILE_TYPOGRAPHY } from "../../../lib/typography";
35
import { useAppearancePreferences } from "./AppearancePreferencesProvider";
46

@@ -12,3 +14,9 @@ export function useScaledTextRole(role: keyof typeof MOBILE_TYPOGRAPHY): ScaledT
1214
const { appearance } = useAppearancePreferences();
1315
return resolveScaledTextRole(role, appearance.baseFontSize);
1416
}
17+
18+
export function useComposerTextRole(): ScaledTextRole {
19+
const body = useScaledTextRole("body");
20+
const { fontScale } = useWindowDimensions();
21+
return resolveComposerTextRole(body, fontScale, Platform.OS);
22+
}
Collapse file

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

Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/ThreadComposer.tsx
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ import {
9696
isModelSelectionUnavailable,
9797
serverConfigForCwd,
9898
} from "../../lib/modelOptions";
99-
import { useScaledTextRole, type ScaledTextRole } from "../settings/appearance/useScaledTextRole";
99+
import { useComposerTextRole, type ScaledTextRole } from "../settings/appearance/useScaledTextRole";
100100
import type { RemoteClientConnectionState } from "../../lib/connection";
101101
import { MOBILE_TYPOGRAPHY } from "../../lib/typography";
102102
import { Menu } from "../../components/ui/Menu";
@@ -432,7 +432,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
432432
const composerPanel = materialTheme["--color-composer-panel"];
433433
const navigation = useNavigation();
434434
const foregroundColor = useUniwindTheme()["--color-foreground"];
435-
const bodyText = useScaledTextRole("body");
435+
const bodyText = useComposerTextRole();
436436
const fallbackInputRef = useRef<ComposerEditorHandle>(null);
437437
const inputRef = props.editorRef ?? fallbackInputRef;
438438
const [isFocused, setIsFocused] = useState(false);
Collapse file

‎apps/mobile/src/lib/appearancePreferences.test.ts‎

Copy file name to clipboard
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "vite-plus/test";
22

3-
import { resolveAppearancePreferences } from "./appearancePreferences";
3+
import { resolveAppearancePreferences, resolveComposerTextRole } from "./appearancePreferences";
44

55
describe("appearancePreferences", () => {
66
it("migrates the legacy markdownFontSize key to baseFontSize", () => {
@@ -9,4 +9,14 @@ describe("appearancePreferences", () => {
99
resolveAppearancePreferences({ baseFontSize: 16, markdownFontSize: 18 }).baseFontSize,
1010
).toBe(16);
1111
});
12+
13+
it("scales the iOS composer text with the system text size", () => {
14+
const body = { fontSize: 16, lineHeight: 23 };
15+
expect(resolveComposerTextRole(body, 1, "ios")).toEqual(body);
16+
expect(resolveComposerTextRole(body, 2.643, "ios")).toEqual({
17+
fontSize: 16 * 2.643,
18+
lineHeight: 23 * 2.643,
19+
});
20+
expect(resolveComposerTextRole(body, 2.643, "android")).toEqual(body);
21+
});
1222
});
Collapse file

‎apps/mobile/src/lib/appearancePreferences.ts‎

Copy file name to clipboardExpand all lines: apps/mobile/src/lib/appearancePreferences.ts
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,17 @@ export function resolveScaledTextRole(role: keyof typeof MOBILE_TYPOGRAPHY, base
205205
};
206206
}
207207

208+
// React Native text applies the system text size itself, but the iOS composer sets a fixed
209+
// UIFont, so it needs pre-scaled metrics. Android's editor already sizes text in sp.
210+
export function resolveComposerTextRole(
211+
role: { readonly fontSize: number; readonly lineHeight: number },
212+
fontScale: number,
213+
os: string,
214+
) {
215+
if (os !== "ios") return role;
216+
return { fontSize: role.fontSize * fontScale, lineHeight: role.lineHeight * fontScale };
217+
}
218+
208219
export function resolveNativeMarkdownTypography(baseFontSize: number): NativeMarkdownTypography {
209220
const fontSizes = resolveMarkdownFontSizes(baseFontSize);
210221
return {
Collapse file

‎apps/mobile/src/native/T3ComposerEditor.ios.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/native/T3ComposerEditor.ios.tsx
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { contextChipIconUri, modelChipIcon, modelChipIconUri } from "../lib/cont
2727
import { useUniwindTheme } from "../lib/useUniwindTheme";
2828
import { createNativeComposerTheme } from "../lib/nativeComposerTheme";
2929
import { FONT_FAMILIES } from "../lib/fontFamilies";
30-
import { useScaledTextRole } from "../features/settings/appearance/useScaledTextRole";
30+
import { useComposerTextRole } from "../features/settings/appearance/useScaledTextRole";
3131
import {
3232
acknowledgeComposerNativeEvent,
3333
assumeComposerControlledState,
@@ -176,7 +176,7 @@ export function ComposerEditor({
176176
});
177177
setConfirmedTokens({ value: props.value, tokens });
178178
}
179-
const bodyText = useScaledTextRole("body");
179+
const bodyText = useComposerTextRole();
180180
const theme = useUniwindTheme();
181181
const fontFamily = FONT_FAMILIES.regular;
182182

Collapse file

‎apps/mobile/src/native/createV5StackNavigator.ios.test.tsx‎

Copy file name to clipboard
+95Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import type { ParamListBase, StackNavigationState } from "@react-navigation/native";
2+
import { act, createContext, type ComponentProps, type ReactNode } from "react";
3+
import { createRoot } from "react-dom/client";
4+
import type { Stack as NativeStack } from "react-native-screens";
5+
import { expect, it, vi } from "vite-plus/test";
6+
7+
type ScreenProps = ComponentProps<typeof NativeStack.Screen>;
8+
const screens = vi.hoisted(() => new Map<string, ScreenProps>());
9+
10+
vi.mock("react-native", () => ({
11+
StyleSheet: { flatten: (style: unknown) => style },
12+
View: ({ children }: { children?: ReactNode }) => children,
13+
}));
14+
vi.mock("react-native-screens", () => ({
15+
Stack: {
16+
Host: ({ children }: { children?: ReactNode }) => children,
17+
Screen: (props: ScreenProps) => {
18+
screens.set(props.screenKey, props);
19+
return null;
20+
},
21+
},
22+
}));
23+
vi.mock("@react-navigation/native", () => ({
24+
NavigationContext: createContext(undefined),
25+
NavigationRouteContext: createContext(undefined),
26+
usePreventRemoveContext: () => ({ preventedRoutes: {} }),
27+
}));
28+
vi.mock("@react-navigation/native-stack", () => ({ NativeStackView: () => null }));
29+
vi.mock("./V5StackHeader.ios", () => ({ V5StackHeader: () => null }));
30+
vi.mock("./NativeColumnContent.ios", () => ({ NativeColumnContent: () => null }));
31+
vi.mock("./NativeScrollViewMarker", () => ({
32+
NativeScrollEdgeEffectsContext: createContext(undefined),
33+
}));
34+
35+
import { V5CardStackView, type V5StackViewProps } from "./createV5StackNavigator.ios";
36+
37+
const home = { key: "home", name: "Home" };
38+
const thread = { key: "thread", name: "Thread" };
39+
40+
function fire(key: string, event: "onWillAppear" | "onWillDisappear" | "onDidDisappear") {
41+
const handler = screens.get(key)?.[event] as (() => void) | undefined;
42+
if (!handler) throw new Error(`No ${event} for ${key}`);
43+
act(() => handler());
44+
}
45+
46+
it("forgets native Back when a full-screen presentation covers the top card", () => {
47+
vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);
48+
const state: StackNavigationState<ParamListBase> = {
49+
key: "stack",
50+
type: "stack",
51+
stale: false,
52+
index: 1,
53+
routeNames: ["Home", "Thread"],
54+
routes: [home, thread],
55+
preloadedRoutes: [],
56+
};
57+
const navigation = { getState: () => state, emit: vi.fn(), dispatch: vi.fn() };
58+
const descriptor = (route: typeof home) => ({
59+
route,
60+
navigation,
61+
options: {},
62+
render: () => null,
63+
});
64+
const onNativePopChange = vi.fn();
65+
const root = createRoot(document.createElement("div"));
66+
try {
67+
act(() =>
68+
root.render(
69+
<V5CardStackView
70+
{...({
71+
state,
72+
navigation,
73+
descriptors: { home: descriptor(home), thread: descriptor(thread) },
74+
describe: () => descriptor(home),
75+
} as unknown as V5StackViewProps)}
76+
onNativePopChange={onNativePopChange}
77+
/>,
78+
),
79+
);
80+
81+
// A presentation covers the thread: nothing in the stack appears beneath it.
82+
fire("thread", "onWillDisappear");
83+
fire("thread", "onDidDisappear");
84+
expect(onNativePopChange).toHaveBeenLastCalledWith(null);
85+
86+
// Native Back reveals Home, so the thread stays the card being popped.
87+
fire("thread", "onWillDisappear");
88+
fire("home", "onWillAppear");
89+
fire("thread", "onDidDisappear");
90+
expect(onNativePopChange).toHaveBeenLastCalledWith("thread");
91+
} finally {
92+
act(() => root.unmount());
93+
vi.unstubAllGlobals();
94+
}
95+
});

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.