Skip to content

Commit de978df

Browse files
committed
merge: preserve marketing star lookup behavior from main
2 parents e3b6e1a + 71646e0 commit de978df

217 files changed

Lines changed: 10872 additions & 1218 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/release-desktop.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,14 @@ jobs:
203203
native/hyprland-snap-shot/target/${{ inputs.rust_target }}/release/t3-hyprland-snap-shot
204204
key: linux-capture-helpers-${{ inputs.rust_target }}-${{ hashFiles('native/kde-snap-shot/Cargo.lock', 'native/kde-snap-shot/Cargo.toml', 'native/kde-snap-shot/src/**', 'native/hyprland-snap-shot/Cargo.lock', 'native/hyprland-snap-shot/Cargo.toml', 'native/hyprland-snap-shot/src/**', 'native/hyprland-snap-shot/protocols/**') }}
205205

206+
- name: Ensure Rosetta for macOS x64 bytecode generation
207+
if: inputs.platform == 'mac' && inputs.arch == 'x64'
208+
shell: bash
209+
run: |
210+
if [[ "$(uname -m)" == "arm64" ]] && ! /usr/bin/arch -x86_64 /usr/bin/true; then
211+
sudo /usr/sbin/softwareupdate --install-rosetta --agree-to-license
212+
fi
213+
206214
- name: Setup Rust
207215
if: steps.resource_monitor_cache.outputs.cache-hit != 'true' || (inputs.platform == 'linux' && steps.capture_helper_cache.outputs.cache-hit != 'true')
208216
uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# T3 Code
22

3-
T3 Code is a minimal GUI for coding agents. A Node WebSocket server wraps provider CLIs and agents (Codex, Claude Code, Cursor, Grok, OpenCode, Antigravity) and serves web, desktop, and mobile clients.
3+
T3 Code is a minimal GUI for coding agents. A Node WebSocket server wraps provider CLIs and agents (Codex, Claude Code, Cursor, Grok, OpenCode, Antigravity, Kiro) and serves web, desktop, and mobile clients.
44

55
You can think of T3 Code as an open source "bring-your-own-subscription" alternative to apps like Claude Desktop, Codex App, Cursor Glass and Conductor.
66

@@ -68,7 +68,7 @@ The most common defect in this repo is a change that works on the path you teste
6868

6969
- **Entry points.** A behavior reachable from the chat view is usually also reachable from Settings, the command palette, and a keybinding. Fixing one is not fixing the feature.
7070
- **Clients.** Web, desktop (wraps web, adds Electron shell/IPC), and mobile (React Native, separate navigation). Shared logic lives in `packages/client-runtime`
71-
- **Providers.** Codex, Claude, Cursor, Grok, OpenCode, and Antigravity each have an adapter. Provider-shaped features need a decision per adapter, even if the decision is "not supported here".
71+
- **Providers.** Codex, Claude, Cursor, Grok, OpenCode, Antigravity, and Kiro each have an adapter. Provider-shaped features need a decision per adapter, even if the decision is "not supported here".
7272
- **Agents.** A capability a user can trigger is usually one an agent should reach through MCP tools, and scheduled tasks run the same paths. That only works when it is a service method, not handler code.
7373
- **Contracts.** Anything crossing the wire is typed in `packages/contracts`. Change the schema and the server, web, mobile, and desktop all follow.
7474
- **Reverse states.** If you added a way in, add the way out and the way to see it. Snooze needs unsnooze. Close needs reopen. A one-way door is a bug.

‎apps/marketing/src/lib/githubStars.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,19 @@ const FALLBACK = "38.9k";
77
afterEach(() => {
88
vi.restoreAllMocks();
99
vi.unstubAllGlobals();
10+
vi.unstubAllEnvs();
1011
});
1112

1213
describe("fetchGitHubStars", () => {
14+
it("rejects a failed production lookup instead of publishing a fallback", async () => {
15+
vi.stubEnv("PROD", true);
16+
vi.stubGlobal("fetch", async () => new Response(null, { status: 403 }));
17+
18+
await expect(fetchGitHubStars()).rejects.toThrow("Could not fetch GitHub stars");
19+
});
20+
1321
it.each([
22+
[999, "999"],
1423
[38_947, "38.9k"],
1524
[40_199, "40.1k"],
1625
[39_000, "39k"],

‎apps/marketing/src/lib/githubStars.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
const REPOSITORY_API_URL = "https://api.github.com/repos/pingdotgg/t3code";
2-
// Shown when a build can't read the count, such as a rate limit on a shared builder IP.
2+
// Offline development can still render without publishing a stale production count.
33
const FALLBACK_STARS = "38.9k";
44
const REQUEST_TIMEOUT_MS = 5_000;
55

66
// Rounds down so the site never claims more stars than the repository has.
77
function formatStars(count: number) {
8-
return `${Math.floor(count / 100) / 10}k`;
8+
return count < 1000 ? String(count) : `${Math.floor(count / 100) / 10}k`;
99
}
1010

1111
export async function fetchGitHubStars() {
12+
const token = process.env.GITHUB_TOKEN;
1213
try {
1314
const response = await fetch(REPOSITORY_API_URL, {
15+
headers: token ? { Authorization: `Bearer ${token}` } : {},
1416
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
1517
});
1618
if (!response.ok) throw new Error(`GitHub API responded ${response.status}`);
1719
const { stargazers_count: count } = await response.json();
1820
if (typeof count !== "number") throw new Error("GitHub API response has no star count");
1921
return formatStars(count);
2022
} catch (error) {
23+
if (import.meta.env.PROD) throw new Error("Could not fetch GitHub stars", { cause: error });
2124
console.warn(`Using fallback GitHub star count ${FALLBACK_STARS}:`, error);
2225
return FALLBACK_STARS;
2326
}

‎apps/mobile/src/components/ScrollComposeButton.android.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ import { resolveScaledTextRole } from "../lib/appearancePreferences";
1717
export function ScrollComposeButton(props: {
1818
readonly expanded: boolean;
1919
readonly onPress: () => void;
20+
readonly size?: number;
2021
readonly className?: string;
2122
readonly style?: StyleProp<ViewStyle>;
2223
}) {
2324
const { appearance, themeVariables: colors } = useAppearancePreferences();
2425
const typography = resolveScaledTextRole("footnote", appearance.baseFontSize);
25-
const { iconSize, fabSize } = useAndroidControlSizing();
26+
const { iconSize, fabSize: scaledFabSize } = useAndroidControlSizing();
27+
const fabSize = props.size ?? scaledFabSize;
2628
const nativeSize = Math.max(56, fabSize);
2729
const scale = fabSize / nativeSize;
2830
const nativeIconSize = Math.round(iconSize / scale);

‎apps/mobile/src/features/home/AndroidHomeFab.android.tsx‎

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
type NativeSyntheticEvent,
77
} from "react-native";
88
import { useSafeAreaInsets } from "react-native-safe-area-context";
9-
import { NewThreadButton } from "../../components/NewThreadButton";
9+
import { ScrollComposeButton } from "../../components/ScrollComposeButton.android";
1010
import {
1111
androidHomeFabPosition,
1212
type AndroidHomeFabLayout as SharedAndroidHomeFabLayout,
@@ -15,9 +15,9 @@ import { useWorkspaceState } from "../../state/workspace";
1515
import { FabScrollContext } from "./FabScrollContext";
1616
import { updateFabScroll } from "./fab-scroll";
1717
import { useAndroidControlSizing } from "../../components/ui/useAndroidControlSizing";
18-
import { useEnabledNavigationTabs } from "../workspace/navigation-tabs";
1918
import { WorkspaceTabsContext, useWorkspaceTabs } from "../workspace/WorkspaceTabsContext";
2019
import { FLOATING_TABS, floatingTabsMetrics } from "../workspace/floating-workspace-tabs";
20+
import { useEnabledNavigationTabs } from "../workspace/navigation-tabs";
2121
import {
2222
useAppearancePreferences,
2323
useAndroidFloatingTabs,
@@ -32,19 +32,16 @@ export function AndroidHomeFabLayout(props: ComponentProps<typeof SharedAndroidH
3232
const { state } = useWorkspaceState();
3333
const [expanded, setExpanded] = useState(true);
3434
const { scale, fabSize } = useAndroidControlSizing();
35-
const tabs = useEnabledNavigationTabs();
36-
const floating = floatingTabsMetrics(
37-
tabs.length + 1,
38-
scale,
39-
fabSize,
40-
props.paneWidth ?? layoutWidth ?? undefined,
41-
);
35+
const enabledTabs = useEnabledNavigationTabs();
36+
const barWidth =
37+
layoutWidth === null
38+
? undefined
39+
: layoutWidth - (Math.max(insets.left, FLOATING_TABS.edge) - FLOATING_TABS.edge);
40+
const size = floatingTabsEnabled
41+
? floatingTabsMetrics(enabledTabs.length + 1, scale, fabSize, barWidth).height
42+
: fabSize;
4243
const workspace = useWorkspaceTabs();
43-
const bottomClearance =
44-
insets.bottom +
45-
FLOATING_TABS.bottom +
46-
FLOATING_TABS.edge +
47-
Math.max(floating.height, floating.fabOffset + fabSize);
44+
const bottomClearance = insets.bottom + FLOATING_TABS.bottom + FLOATING_TABS.edge + size;
4845
const context = floatingTabsEnabled && workspace ? { ...workspace, bottomClearance } : workspace;
4946
const scrollState = useRef({ anchor: 0, expanded: true });
5047
const onScroll = (event: NativeSyntheticEvent<NativeScrollEvent>) => {
@@ -69,17 +66,17 @@ export function AndroidHomeFabLayout(props: ComponentProps<typeof SharedAndroidH
6966
(!props.sidebar || floatingTabsEnabled) &&
7067
state.hasConnections &&
7168
layoutWidth !== null ? (
72-
<NewThreadButton
69+
<ScrollComposeButton
7370
key={`${appearance.baseFontSize}:${fontScale}:${layoutWidth}`}
74-
extended
71+
size={size}
7572
expanded={floatingTabsEnabled ? false : expanded}
7673
onPress={props.onStartNewTask}
7774
className="absolute"
7875
style={
7976
floatingTabsEnabled
8077
? {
8178
right: FLOATING_TABS.edge,
82-
bottom: insets.bottom + FLOATING_TABS.bottom + floating.fabOffset,
79+
bottom: insets.bottom + FLOATING_TABS.bottom,
8380
}
8481
: androidHomeFabPosition(insets.bottom, props.sidebar)
8582
}

‎apps/mobile/src/features/home/AndroidHomeFab.shared.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export function AndroidHomeFabLayout(props: {
55
readonly children: ReactNode;
66
readonly sidebar?: boolean;
77
readonly disabled?: boolean;
8-
readonly paneWidth?: number;
98
}) {
109
return <>{props.children}</>;
1110
}

‎apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx‎

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -825,10 +825,22 @@ function AdaptiveWorkspaceLayoutContent(
825825
0,
826826
viewportWidth -
827827
renderedRailWidth.value -
828-
renderedSidebarWidth.value -
828+
(workspacePage ? 0 : renderedSidebarWidth.value) -
829829
renderedInspectorWidth.value,
830830
),
831831
);
832+
// Android can resize the native row before React removes its split panes on a fold.
833+
const androidSplit = Platform.OS === "android" && layout.usesSplitView;
834+
const androidContentSlotStyle = useAnimatedStyle(() => ({
835+
width: androidSplit ? renderedContentWidth.value : ("100%" as const),
836+
}));
837+
// While the sidebar animates, clip the settled navigator instead of reflowing its text every frame.
838+
const androidNavigatorLimit = useAnimatedStyle(() => ({
839+
maxWidth:
840+
androidSplit && contentTargetWidth !== null && renderedContentWidth.value < contentTargetWidth
841+
? contentTargetWidth
842+
: ("100%" as const),
843+
}));
832844

833845
const handleSelectThread = (thread: EnvironmentThreadShell) => {
834846
handleSelectThreadRoute({
@@ -899,11 +911,11 @@ function AdaptiveWorkspaceLayoutContent(
899911
>
900912
<AndroidHingeObserver onChange={handleHingeChange} />
901913
{shouldRenderNavigationRail ? (
902-
<Animated.View className="self-stretch" style={railAnimatedStyle} />
914+
<Animated.View className="shrink self-stretch" style={railAnimatedStyle} />
903915
) : null}
904916
{shouldRenderPrimarySidebar && layout.listPaneWidth !== null ? (
905917
<Animated.View
906-
className="self-stretch overflow-hidden"
918+
className="self-stretch overflow-hidden android:shrink"
907919
accessibilityElementsHidden={workspacePage || !panes.primarySidebarVisible}
908920
collapsable={false}
909921
importantForAccessibility={
@@ -935,7 +947,6 @@ function AdaptiveWorkspaceLayoutContent(
935947
<AndroidHomeFabLayout
936948
sidebar
937949
disabled={workspacePage}
938-
paneWidth={layout.listPaneWidth}
939950
onStartNewTask={handleStartNewTask}
940951
>
941952
<ThreadNavigationSidebar
@@ -967,26 +978,28 @@ function AdaptiveWorkspaceLayoutContent(
967978
</Animated.View>
968979
</Animated.View>
969980
) : null}
970-
<View
981+
<Animated.View
971982
className={
972983
Platform.OS === "android"
973-
? "flex-1 overflow-hidden bg-header"
984+
? "max-w-full shrink-0 overflow-hidden bg-header"
974985
: "flex-1 overflow-hidden bg-screen"
975986
}
987+
style={Platform.OS === "android" ? androidContentSlotStyle : undefined}
976988
collapsable={false}
977989
>
978-
<View
990+
<Animated.View
979991
collapsable={false}
980-
style={
992+
style={[
981993
contentTargetWidth !== null
982994
? {
983995
flex: 1,
984996
width: contentTargetWidth,
985997
alignSelf: contentAnchor.end ? "flex-end" : "flex-start",
986998
marginRight: contentAnchor.end ? contentEndGap : 0,
987999
}
988-
: { flex: 1 }
989-
}
1000+
: { flex: 1 },
1001+
Platform.OS === "android" ? androidNavigatorLimit : undefined,
1002+
]}
9901003
>
9911004
{/* Android holds the content still, so its floating controls keep its width. */}
9921005
<WorkspaceContentWidthContext
@@ -1029,8 +1042,8 @@ function AdaptiveWorkspaceLayoutContent(
10291042
) : null}
10301043
</WorkspaceSettledContentWidthContext>
10311044
</WorkspaceContentWidthContext>
1032-
</View>
1033-
</View>
1045+
</Animated.View>
1046+
</Animated.View>
10341047
<WorkspaceInspectorPane
10351048
pathname={props.pathname}
10361049
renderedInspectorWidth={renderedInspectorWidth}
@@ -1041,11 +1054,14 @@ function AdaptiveWorkspaceLayoutContent(
10411054
onClosed={handleWorkspaceInspectorClosed}
10421055
/>
10431056
{shouldRenderNavigationRail && navigationRailWidth > 0 ? (
1044-
// The rail reserves its slot above and draws over the panes, so it can widen over
1045-
// the list in place. It takes the whole workspace only while it is open.
1057+
// Its trailing inset clips the old rail as soon as Android fits the workspace to a cover display.
10461058
<View
1047-
className="absolute inset-y-0 left-0"
1048-
style={railOverlay ? { right: 0 } : { width: navigationRailWidth }}
1059+
className="absolute inset-y-0 left-0 overflow-hidden"
1060+
style={
1061+
railOverlay
1062+
? { right: 0 }
1063+
: { right: viewportWidth - navigationRailWidth, maxWidth: navigationRailWidth }
1064+
}
10491065
>
10501066
<AndroidWorkspaceNavigation
10511067
onNewThread={handleStartNewTask}

0 commit comments

Comments
 (0)