@devries-cameron20 / t3code Mirror · read-only / commits / 9ef259e517
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 22:15 UTC

fix(mobile): sidebar empty states and repeated usage notices (#33188)

maria committed Nov 11, 2026 at 20:36 UTC 9ef259e5173646c30f4f862c6fccce7bcb9217c2
4 files changed +66 -25
apps/mobile/src/features/home/HomeScreen.tsx
+7 -1
@@ -748,7 +748,13 @@ export function HomeScreen(props: HomeScreenProps) {
748 );
749
750 const v2ListEmpty =
751 - hasSearchQuery && threadSearch.isPending ? undefined : hasSearchQuery ? (
751 + hasSearchQuery && threadSearch.isPending ? (
752 + <EmptyState
753 + title="Searching thread messages…"
754 + detail={`Looking for "${props.searchQuery}" in messages.`}
755 + variant={Platform.OS === "android" ? "plain" : undefined}
756 + />
757 + ) : hasSearchQuery ? (
758 <EmptyState
759 title="No results"
760 detail={`No threads matching "${props.searchQuery}".`}
apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
+37 -19
@@ -25,6 +25,7 @@ import { FLOATING_TABS } from "../layout/workspace/floating-workspace-tabs";
25 import { useSafeAreaInsets } from "react-native-safe-area-context";
26
27 import { AppText as Text } from "../../components/ui/AppText";
28 +import { Button } from "../../components/ui/Button";
29 import { scopedProjectKey, scopedThreadKey } from "../../lib/scopedEntities";
30 import { useProjects, useNavigationThreadShells } from "../../state/entities";
31 import { useThreadSearch } from "../../state/queries";
@@ -556,26 +557,43 @@ function ThreadNavigationSidebarPane(props: ThreadNavigationSidebarProps) {
557 }}
558 />
559 );
560 + const showAddEnvironment =
561 + !catalogState.isLoadingConnections &&
562 + !catalogState.hasReadyEnvironment &&
563 + !catalogState.hasConnectingEnvironment;
564 const listEmpty = (
560 - <Text
561 - className={
562 - Platform.OS === "android"
563 - ? "px-4 py-4 text-center text-sm text-drawer-foreground-muted"
564 - : "px-2 py-4 text-sm text-drawer-foreground-muted"
565 - }
566 - >
567 - {catalogState.isLoadingConnections
568 - ? "Loading threads…"
569 - : Platform.OS === "android" && !catalogState.hasConnections
570 - ? "No environments connected"
571 - : props.searchQuery.trim().length > 0
572 - ? threadSearch.isPending
573 - ? "Searching thread messages…"
574 - : "No matching threads"
575 - : selectedProjectScope !== null
576 - ? `No threads in ${selectedProjectScope.title}`
577 - : "No threads yet"}
578 - </Text>
565 + <View>
566 + <Text
567 + className={
568 + Platform.OS === "android"
569 + ? "px-4 py-4 text-center text-sm text-drawer-foreground-muted"
570 + : "px-2 py-4 text-sm text-drawer-foreground-muted"
571 + }
572 + >
573 + {catalogState.isLoadingConnections
574 + ? "Loading threads…"
575 + : showAddEnvironment
576 + ? "No environments connected"
577 + : props.searchQuery.trim().length > 0
578 + ? threadSearch.isPending
579 + ? "Searching thread messages…"
580 + : "No matching threads"
581 + : selectedProjectScope !== null
582 + ? `No threads in ${selectedProjectScope.title}`
583 + : "No threads yet"}
584 + </Text>
585 + {showAddEnvironment ? (
586 + <View className={Platform.OS === "android" ? "self-center" : "px-2"}>
587 + <Button
588 + tone="primary"
589 + size="compact"
590 + icon="plus"
591 + label="Add environment"
592 + onPress={props.onOpenEnvironmentSettings}
593 + />
594 + </View>
595 + ) : null}
596 + </View>
597 );
598
599 if (Platform.OS === "ios") {
packages/shared/src/usageLimits.test.ts
+17
@@ -1540,6 +1540,23 @@ describe("external usage settings", () => {
1540 expect(collectLimitAccounts(presentations)).toEqual([]);
1541 expect(collectLimitNotices(presentations)).toEqual([]);
1542 });
1543 +
1544 + it("shows a notice once when environments with one label report the same failure", () => {
1545 + const failing = provider({
1546 + usageLimits: {
1547 + checkedAt: "2026-09-03T11:00:00.000Z",
1548 + windows: [],
1549 + unavailable: { reason: "probeFailed" },
1550 + },
1551 + });
1552 + const host = { entry: { target: { label: "Host" } }, serverConfig: { providers: [failing] } };
1553 + const presentations = new Map([
1554 + [EnvironmentId.make("a"), host],
1555 + [EnvironmentId.make("b"), host],
1556 + [EnvironmentId.make("c"), host],
1557 + ]);
1558 + expect(collectLimitNotices(presentations)).toEqual(["Host · codex: Could not read limits."]);
1559 + });
1560 });
1561
1562 describe("ChatGPT sharing presentation", () => {
packages/shared/src/usageLimits.ts
+5 -5
@@ -401,24 +401,24 @@ export function collectLimitAccounts(presentations: LimitPresentations): readonl
401 export function collectLimitNotices(presentations: LimitPresentations): readonly string[] {
402 const label = (environmentLabel: string, subject: string) =>
403 presentations.size > 1 ? `${environmentLabel} · ${subject}` : subject;
404 - const notices: string[] = [];
404 + const notices = new Set<string>();
405 for (const presentation of presentations.values()) {
406 const environmentLabel = presentation.entry.target.label;
407 for (const provider of providersWithLimits(presentation.serverConfig?.providers ?? [])) {
408 if (provider.usageLimits?.unavailable?.reason === "unsupported") continue;
409 const notice = provider.usageLimits ? limitsNotice(provider.usageLimits) : null;
410 const name = provider.displayName?.trim() || String(provider.driver);
411 - if (notice) notices.push(`${label(environmentLabel, name)}: ${notice}`);
411 + if (notice) notices.add(`${label(environmentLabel, name)}: ${notice}`);
412 }
413 for (const source of presentation.serverConfig?.usageLimitSources ?? []) {
414 if (source.error) {
415 - notices.push(`${label(environmentLabel, source.label)}: ${source.error}`);
415 + notices.add(`${label(environmentLabel, source.label)}: ${source.error}`);
416 } else if (source.accounts.length === 0) {
417 - notices.push(`${label(environmentLabel, source.label)}: No accounts reported.`);
417 + notices.add(`${label(environmentLabel, source.label)}: No accounts reported.`);
418 }
419 }
420 }
421 - return notices;
421 + return [...notices];
422 }
423
424 export interface LimitPoolMember {