Skip to content

Commit 63628e6

Browse files
authored
Merge branch 'main' into fix/opencode-preview-url-schema
2 parents a9be6ba + 5192f77 commit 63628e6

178 files changed

Lines changed: 12739 additions & 3483 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/mobile-showcase-screenshots.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
args:
5353
- --filter=@t3tools/mobile...
5454
- --filter=@t3tools/scripts...
55+
- --filter=t3...
5556
5657
- name: Expose pnpm
5758
run: |
@@ -100,6 +101,7 @@ jobs:
100101
args:
101102
- --filter=@t3tools/mobile...
102103
- --filter=@t3tools/scripts...
104+
- --filter=t3...
103105
104106
- name: Expose pnpm
105107
run: |

‎apps/desktop/src/electron/ElectronProtocol.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe("ElectronProtocol", () => {
5757
assert.equal(yield* Effect.promise(() => response.text()), "ok");
5858
assert.include(
5959
response.headers.get("content-security-policy") ?? "",
60-
"script-src 'self' 'unsafe-inline' https://clerk.t3.codes https://challenges.cloudflare.com",
60+
"script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval' https://clerk.t3.codes https://challenges.cloudflare.com",
6161
);
6262
assert.include(
6363
response.headers.get("content-security-policy") ?? "",
@@ -212,6 +212,7 @@ describe("ElectronProtocol", () => {
212212
assert.deepEqual(directives["script-src"], [
213213
"'self'",
214214
"'unsafe-inline'",
215+
"'wasm-unsafe-eval'",
215216
"https://clerk.t3.codes",
216217
"https://challenges.cloudflare.com",
217218
]);

‎apps/desktop/src/electron/ElectronProtocol.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export function makeDesktopContentSecurityPolicy(input: DesktopProtocolRegistrat
7171
const scriptSources = [
7272
"'self'",
7373
"'unsafe-inline'",
74+
"'wasm-unsafe-eval'",
7475
...(clerkOrigin ? [clerkOrigin] : []),
7576
"https://challenges.cloudflare.com",
7677
];

‎apps/mobile/app.config.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ const config: ExpoConfig = {
181181
ios: {
182182
icon: variant.assets.iosIcon,
183183
supportsTablet: true,
184+
// Multitasking-capable iPad apps cannot rotate programmatically, so the
185+
// showcase capture build requires full screen (see infoPlist below).
186+
requireFullScreen: process.env.T3_SHOWCASE_CAPTURE_BUILD === "1",
184187
bundleIdentifier: iosBundleIdentifier,
185188
// Pin code signing to the T3 Tools team so non-interactive `expo run:ios`
186189
// does not fall back to a personal team (which cannot sign app groups,
@@ -197,6 +200,21 @@ const config: ExpoConfig = {
197200
NSLocalNetworkUsageDescription:
198201
"Allow T3 Code to connect to T3 Code servers on your local network or tailnet.",
199202
ITSAppUsesNonExemptEncryption: false,
203+
// The App Store screenshot harness rotates the iPad interface from
204+
// inside the app (CI denies osascript the Accessibility access that
205+
// Simulator menu scripting needs), and iPadOS ignores programmatic
206+
// orientation requests for multitasking-capable apps — so the capture
207+
// build opts out of multitasking and declares landscape support.
208+
...(process.env.T3_SHOWCASE_CAPTURE_BUILD === "1"
209+
? {
210+
"UISupportedInterfaceOrientations~ipad": [
211+
"UIInterfaceOrientationPortrait",
212+
"UIInterfaceOrientationPortraitUpsideDown",
213+
"UIInterfaceOrientationLandscapeLeft",
214+
"UIInterfaceOrientationLandscapeRight",
215+
],
216+
}
217+
: {}),
200218
},
201219
},
202220
android: {

‎apps/mobile/modules/t3-native-controls/ios/T3NativeControlsModule.swift‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import ExpoModulesCore
22
import Security
3+
import UIKit
34

45
public final class T3NativeControlsModule: Module {
56
public func definition() -> ModuleDefinition {
@@ -32,6 +33,50 @@ public final class T3NativeControlsModule: Module {
3233
return arguments[flagIndex + 1]
3334
}
3435

36+
Function("getShowcaseOrientation") { () -> String? in
37+
let arguments = ProcessInfo.processInfo.arguments
38+
guard
39+
let flagIndex = arguments.firstIndex(of: "--showcaseOrientation"),
40+
arguments.indices.contains(flagIndex + 1)
41+
else {
42+
return nil as String?
43+
}
44+
return arguments[flagIndex + 1]
45+
}
46+
47+
// Rotates the interface without Simulator menu UI scripting, which CI
48+
// runners cannot perform (osascript is denied Accessibility access there).
49+
AsyncFunction("applyShowcaseOrientation") { (orientation: String) in
50+
guard #available(iOS 16.0, *) else { return }
51+
let mask: UIInterfaceOrientationMask = orientation == "landscape" ? .landscapeRight : .portrait
52+
for case let windowScene as UIWindowScene in UIApplication.shared.connectedScenes {
53+
windowScene.requestGeometryUpdate(.iOS(interfaceOrientations: mask)) { error in
54+
NSLog("T3NativeControls applyShowcaseOrientation(\(orientation)) failed: \(error)")
55+
}
56+
for window in windowScene.windows {
57+
window.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations()
58+
}
59+
}
60+
}.runOnQueue(.main)
61+
62+
// The geometry request above can fail transiently (for example before the
63+
// scene is foreground-active), so callers poll this until it settles.
64+
// Screen bounds — not the scene's interface orientation — decide the
65+
// answer because they match the captured framebuffer: with iPadOS
66+
// windowing active, a floating landscape window still reports a portrait
67+
// screen, and screenshots would come out portrait.
68+
AsyncFunction("getInterfaceOrientation") { () -> String in
69+
guard
70+
let windowScene = UIApplication.shared.connectedScenes
71+
.compactMap({ $0 as? UIWindowScene })
72+
.first
73+
else {
74+
return "unknown"
75+
}
76+
let bounds = windowScene.screen.coordinateSpace.bounds
77+
return bounds.width > bounds.height ? "landscape" : "portrait"
78+
}.runOnQueue(.main)
79+
3580
Function("prepareShowcaseCapture") {
3681
for itemClass in [kSecClassGenericPassword, kSecClassInternetPassword] {
3782
SecItemDelete([kSecClass as String: itemClass] as CFDictionary)

‎apps/mobile/modules/t3-terminal/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fails, run `xcodebuild -downloadComponent MetalToolchain`.
4040
## Rebuilding libghostty-vt for Android
4141

4242
The checked-in Android shared libraries and headers are pinned to the revision recorded in
43-
`Vendor/libghostty-vt/VERSION`. Set `ANDROID_NDK_HOME` and run:
43+
`native/libghostty-vt/VERSION` at the repository root. Set `ANDROID_NDK_HOME` and run:
4444

4545
```bash
4646
apps/mobile/modules/t3-terminal/scripts/build-libghostty-android.sh

‎apps/mobile/modules/t3-terminal/THIRD_PARTY_NOTICES.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ Ghostty's MIT license applies to the vendored framework. Keep this notice in syn
1818
## Ghostty / libghostty-vt
1919

2020
The Android terminal renderer vendors upstream `libghostty-vt` shared libraries and C headers.
21+
The web terminal vendors a WebAssembly build from the same revision and uses the same C ABI.
2122

2223
- Upstream project: https://github.com/ghostty-org/ghostty
2324
- Vendored revision: `9f62873bf195e4d8a762d768a1405a5f2f7b1697`
2425
- License: MIT
2526

26-
Ghostty's MIT license applies to the vendored Android libraries. Keep this notice in sync when
27-
updating `Vendor/libghostty-vt`.
27+
Ghostty's MIT license applies to the vendored Android and web libraries. Keep this notice and both
28+
artifacts in sync when updating the repository-root `native/libghostty-vt`.
2829

2930
## MesloLGS NF (Android terminal font)
3031

‎apps/mobile/modules/t3-terminal/android/src/main/cpp/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ add_library(t3terminal SHARED t3_terminal_jni.cpp)
1313

1414
target_include_directories(
1515
t3terminal
16-
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../../../Vendor/libghostty-vt/include"
16+
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../../../native/libghostty-vt/include"
1717
)
1818

1919
target_link_options(

‎apps/mobile/modules/t3-terminal/scripts/build-libghostty-android.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -euo pipefail
44

55
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
66
MODULE_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
7-
VENDOR_DIR="${MODULE_DIR}/Vendor/libghostty-vt"
7+
VENDOR_DIR="${MODULE_DIR}/../../../../native/libghostty-vt"
88
PATCH_DIR="${SCRIPT_DIR}/libghostty-android-patches"
99

1010
GHOSTTY_REVISION="${GHOSTTY_REVISION:-9f62873bf195e4d8a762d768a1405a5f2f7b1697}"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
IconChevronUp,
2323
IconCircleCheck,
2424
IconCircleXFilled,
25+
IconClock,
2526
IconCopy,
2627
IconDeviceDesktop,
2728
IconDots,
@@ -96,6 +97,7 @@ const ANDROID_ICON_BY_SF_SYMBOL: Partial<Record<SFSymbol, Icon>> = {
9697
camera: IconCamera,
9798
checkmark: IconCheck,
9899
"checkmark.circle": IconCircleCheck,
100+
clock: IconClock,
99101
"chevron.down": IconChevronDown,
100102
"chevron.left": IconChevronLeft,
101103
"chevron.left.forwardslash.chevron.right": IconCode,

0 commit comments

Comments
 (0)