From 69cea9096b7aa545657c814122e524897993be51 Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Sun, 1 Nov 2026 14:45:19 -0500 Subject: [PATCH 1/3] feat(mobile): an Inbox bell with the open count in the thread list's header The thread list's header gets a bell (#830, part 4 of 4) with the open count across every connected server, marked when a server could not be read, that opens the Inbox: beside the filter on Android, in the right toolbar on an iPhone, and beside the filter in the split view's sidebar. It counts open asks only; Crew requests join it with Crews. The bell's text is now one shared function, used by web's bell too. Co-Authored-By: Claude Opus 5.5 --- FORK.md | 5 ++ .../src/features/home/ThreadListToolbar.tsx | 9 +++- .../threads/ThreadNavigationSidebar.tsx | 3 ++ .../workspace/WorkspaceToolbar.ios.tsx | 7 +++ apps/mobile/src/j5/inbox/BellGlyph.ios.tsx | 9 ++++ apps/mobile/src/j5/inbox/BellGlyph.tsx | 10 ++++ apps/mobile/src/j5/inbox/InboxBell.tsx | 48 +++++++++++++++++++ apps/mobile/src/j5/inbox/inboxSources.ts | 5 ++ apps/mobile/src/j5/upstreamSeams.test.ts | 18 +++++++ apps/web/src/j5/a2a/HumanInboxBell.test.ts | 9 ---- apps/web/src/j5/a2a/HumanInboxBell.tsx | 10 ++-- packages/client-runtime/src/j5/inbox.test.ts | 23 +++++++++ packages/client-runtime/src/j5/inbox.ts | 20 ++++++++ 13 files changed, 160 insertions(+), 16 deletions(-) create mode 100644 apps/mobile/src/j5/inbox/BellGlyph.ios.tsx create mode 100644 apps/mobile/src/j5/inbox/BellGlyph.tsx create mode 100644 apps/mobile/src/j5/inbox/InboxBell.tsx delete mode 100644 apps/web/src/j5/a2a/HumanInboxBell.test.ts diff --git a/FORK.md b/FORK.md index e47070021ac3..b0ee92c99f1f 100644 --- a/FORK.md +++ b/FORK.md @@ -519,6 +519,8 @@ migrations after upstream migrations. 101. Mobile has a J5 Inbox screen ([#830](https://github.com/Jacksondr5/j5code/issues/830)), landing the reserved Route registration seam for it. `apps/mobile/src/Stack.tsx` imports J5-owned `j5InboxRoutes` (`apps/mobile/src/j5/inbox/routes.ts`) and spreads it before `SETTINGS_SCREENS`, adding a root `Inbox` screen at `inbox` (`apps/mobile/src/j5/inbox/InboxScreen.tsx`). It reads every connected server's open and answered asks through J5-owned source atoms (`apps/mobile/src/j5/inbox/inboxSources.ts`, built as web's are, with `writesNowhere` for a person who can answer nothing), merges and orders them with `client-runtime/src/j5/inbox.ts`, and shows an older server's source notice. It rereads when it comes into view and on the server's inbox revision, with no timer. On a pin advance: if upstream reshapes `Stack.tsx`'s root screens, spread `j5InboxRoutes` among them again. +102. Mobile's thread list has an Inbox bell with the open count ([#830](https://github.com/Jacksondr5/j5code/issues/830)), as web's rail does. J5-owned `apps/mobile/src/j5/inbox/InboxBell.tsx` reads every connected server's open count (`inboxCountSourcesAtom`, case 101), says it through `inboxBellPresentation` (`packages/client-runtime/src/j5/inbox.ts`, shared with web's bell), and opens the `Inbox` screen. It counts open asks only; web's also counts Crew requests and seat approvals, which come to mobile with Crews. Each header that holds the thread list's filter mounts it with one import and one or two lines: `apps/mobile/src/features/home/ThreadListToolbar.tsx` (Android) adds it beside `filterButton` in the toolbar row's `filter` slot when a server is saved; `apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx` adds it as a `Toolbar.Custom` in the right toolbar on a phone's thread list; and `apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx` (split view) puts it before the filter menu. Upstream's symbol set has no plain bell on Android, so J5's `BellGlyph` draws Tabler's there and the SF Symbol on iOS. On a pin advance: if upstream moves the thread list's filter, move the bell with it. + ## Pin and upstream advance runbook Current pin: `d2c440312e5f39d59827ed466838a623516454d6`, upstream's stable release tag `v0.1.3` on `main` (frozen 2026-10-27). The previous pin was `70d60e03a7a35c6fa131825bbfa05ec893e69912`, upstream's nightly tag `v0.1.1-nightly.20261017.3238`. @@ -737,6 +739,9 @@ explicitly marked. | `apps/mobile/src/features/settings/components/SettingsScreen.tsx` | N | 72 | | `apps/mobile/src/features/settings/settings-environment-filter.tsx` | N | 72 | | `apps/mobile/src/Stack.tsx` | A | 72, 98, 101, Role library | +| `apps/mobile/src/features/home/ThreadListToolbar.tsx` | N | 102 | +| `apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx` | N | 102 | +| `apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx` | N | 102 | | `apps/mobile/src/features/archive/ArchivedThreadsRouteScreen.tsx` | N | 72 | | `apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx` | N | 90 | | `apps/mobile/src/features/threads/ThreadFeed.tsx` | N | 90 | diff --git a/apps/mobile/src/features/home/ThreadListToolbar.tsx b/apps/mobile/src/features/home/ThreadListToolbar.tsx index 4081bd654ae9..c9dc6f3bbe87 100644 --- a/apps/mobile/src/features/home/ThreadListToolbar.tsx +++ b/apps/mobile/src/features/home/ThreadListToolbar.tsx @@ -18,6 +18,7 @@ import { useHardwareKeyboardCommand } from "../keyboard/hardwareKeyboardCommands import { WorkspaceListToolbarRow } from "../workspace/WorkspaceListToolbarRow"; import { useWorkspaceConnectionState } from "../../state/workspace"; import { useToolbarLayout } from "../../components/ui/useToolbarLayout"; +import { InboxBell } from "../../j5/inbox/InboxBell"; export function ThreadListToolbar(props: { readonly searchQuery: string; @@ -113,7 +114,13 @@ export function ThreadListToolbar(props: { searchAccessibilityLabel="Search threads" titleAccessibilityLabel="J5 Code, Threads" onOpenEnvironments={props.onOpenEnvironments} - filter={filterButton} + // J5: the Inbox bell beside the filter (FORK.md case 102). + filter={ + <> + {filterButton} + {connectionState.hasConnections ? : null} + + } /> ); diff --git a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx index ce5ad0b6e8f7..ec33575c9ca1 100644 --- a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx +++ b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx @@ -56,6 +56,7 @@ import { ThreadListToolbar } from "../home/ThreadListToolbar"; import { useToolbarLayout } from "../../components/ui/useToolbarLayout"; import { useFabScroll } from "../home/FabScrollContext"; import { SidebarFilterButton } from "./sidebar-filter-button"; +import { InboxBell } from "../../j5/inbox/InboxBell"; import { createSidebarHeaderItems } from "./sidebar-native-header-items"; import { SidebarNavigationShell } from "./sidebar-navigation-shell"; import { @@ -881,6 +882,8 @@ function ThreadNavigationSidebarPane( } /> + {/* J5: the Inbox bell beside the filter (FORK.md case 102). */} + diff --git a/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx b/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx index 2278ee9ba7c8..c1bbe5947e20 100644 --- a/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx +++ b/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx @@ -9,6 +9,7 @@ import type { SearchBarCommands } from "react-native-screens"; import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass"; import { NativeStackScreenOptions } from "../../native/StackHeader"; +import { InboxBell } from "../../j5/inbox/InboxBell"; import { NativePrimaryColumnContext, NativeWorkspaceTabActivityContext, @@ -189,6 +190,12 @@ export function WorkspaceToolbar(props: { {workspace.settingsOpen && !foldedSearch ? null : ( {searchButton} + {/* J5: the Inbox bell on a phone's thread list; iPad's sidebar has its own (case 102). */} + {selectedTab === "threads" && deviceType === "phone" ? ( + + + + ) : null} {nativeToolbarCompose && foldedSearch ? : null} {composeButton} {selectedTab !== "threads" || diff --git a/apps/mobile/src/j5/inbox/BellGlyph.ios.tsx b/apps/mobile/src/j5/inbox/BellGlyph.ios.tsx new file mode 100644 index 000000000000..a5aade2932ae --- /dev/null +++ b/apps/mobile/src/j5/inbox/BellGlyph.ios.tsx @@ -0,0 +1,9 @@ +import { SymbolView } from "expo-symbols"; +import type { ColorValue } from "react-native"; +import { withUniwind } from "uniwind"; + +function Bell(props: { readonly size: number; readonly tintColor?: ColorValue }) { + return ; +} + +export const BellGlyph = withUniwind(Bell); diff --git a/apps/mobile/src/j5/inbox/BellGlyph.tsx b/apps/mobile/src/j5/inbox/BellGlyph.tsx new file mode 100644 index 000000000000..c4195324e3d4 --- /dev/null +++ b/apps/mobile/src/j5/inbox/BellGlyph.tsx @@ -0,0 +1,10 @@ +import IconBell from "@tabler/icons-react-native/IconBell"; +import type { ColorValue } from "react-native"; +import { withUniwind } from "uniwind"; + +// Upstream's symbol set has no plain bell on Android, so the Inbox draws its own. +function Bell(props: { readonly size: number; readonly tintColor?: ColorValue }) { + return ; +} + +export const BellGlyph = withUniwind(Bell); diff --git a/apps/mobile/src/j5/inbox/InboxBell.tsx b/apps/mobile/src/j5/inbox/InboxBell.tsx new file mode 100644 index 000000000000..93d7687801b2 --- /dev/null +++ b/apps/mobile/src/j5/inbox/InboxBell.tsx @@ -0,0 +1,48 @@ +import { useAtomValue } from "@effect/atom-react"; +import { inboxBellPresentation, mergeOpenInboxCounts } from "@t3tools/client-runtime/j5/inbox"; +import { useNavigation } from "@react-navigation/native"; +import { Pressable, View } from "react-native"; + +import { AppText as Text } from "../../components/ui/AppText"; +import { cn } from "../../lib/cn"; +import { BellGlyph } from "./BellGlyph"; +import { inboxCountSourcesAtom } from "./inboxSources"; + +/** + * The Inbox bell in the thread list's header, with the open count across every connected server. + * It counts open asks only: Crew requests and seat approvals join it with Crews on mobile. + * `header` sits among the header's icon buttons, `sidebar` beside the split view's filter. + */ +export function InboxBell(props: { readonly variant: "header" | "sidebar" }) { + const navigation = useNavigation(); + const sources = useAtomValue(inboxCountSourcesAtom); + const { badge, label } = inboxBellPresentation(mergeOpenInboxCounts(sources)); + const sidebar = props.variant === "sidebar"; + return ( + navigation.navigate("Inbox")} + className={cn( + "items-center justify-center active:opacity-70", + sidebar ? "size-11 rounded-full bg-subtle" : "size-12", + )} + > + + {badge === null ? null : ( + + + {badge} + + + )} + + ); +} diff --git a/apps/mobile/src/j5/inbox/inboxSources.ts b/apps/mobile/src/j5/inbox/inboxSources.ts index 47199a9c53ad..09397d7a7ed4 100644 --- a/apps/mobile/src/j5/inbox/inboxSources.ts +++ b/apps/mobile/src/j5/inbox/inboxSources.ts @@ -44,6 +44,11 @@ export const answeredInboxSourcesAtom = createJ5ReadSourcesAtom({ label: "mobile-j5:inbox-answered-sources", queryAtom: answeredInboxQueryAtom, }); +export const inboxCountSourcesAtom = createJ5ReadSourcesAtom({ + ...sourcesInput, + label: "mobile-j5:inbox-count-sources", + queryAtom: inboxCountQueryAtom, +}); /** * Reads each connected server's source again, as the Inbox screen does when it comes into view. diff --git a/apps/mobile/src/j5/upstreamSeams.test.ts b/apps/mobile/src/j5/upstreamSeams.test.ts index 48621f160714..8bf11be0361f 100644 --- a/apps/mobile/src/j5/upstreamSeams.test.ts +++ b/apps/mobile/src/j5/upstreamSeams.test.ts @@ -199,6 +199,24 @@ const SEAMS: ReadonlyArray = [ from: "./j5/inbox/routes", reaches: ["...j5InboxRoutes(GLASS_HEADER_OPTIONS)"], }, + { + file: "features/home/ThreadListToolbar.tsx", + record: "case 102: the Inbox bell", + from: "../../j5/inbox/InboxBell", + reaches: [''], + }, + { + file: "features/workspace/WorkspaceToolbar.ios.tsx", + record: "case 102: the Inbox bell", + from: "../../j5/inbox/InboxBell", + reaches: [''], + }, + { + file: "features/threads/ThreadNavigationSidebar.tsx", + record: "case 102: the Inbox bell", + from: "../../j5/inbox/InboxBell", + reaches: [''], + }, { file: "App.tsx", record: "case 21: archive preflight", diff --git a/apps/web/src/j5/a2a/HumanInboxBell.test.ts b/apps/web/src/j5/a2a/HumanInboxBell.test.ts deleted file mode 100644 index 460300331b09..000000000000 --- a/apps/web/src/j5/a2a/HumanInboxBell.test.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { assert, it } from "@effect/vitest"; - -import { shouldShowOpenInboxCount } from "./HumanInboxBell"; - -it("shows only positive known open counts", () => { - assert.equal(shouldShowOpenInboxCount(null), false); - assert.equal(shouldShowOpenInboxCount(0), false); - assert.equal(shouldShowOpenInboxCount(3), true); -}); diff --git a/apps/web/src/j5/a2a/HumanInboxBell.tsx b/apps/web/src/j5/a2a/HumanInboxBell.tsx index 48fb9e56281e..c1404a5658b7 100644 --- a/apps/web/src/j5/a2a/HumanInboxBell.tsx +++ b/apps/web/src/j5/a2a/HumanInboxBell.tsx @@ -1,7 +1,7 @@ import { Link } from "@tanstack/react-router"; import { InboxIcon } from "lucide-react"; import { useAtomValue } from "@effect/atom-react"; -import { mergeOpenInboxCounts } from "@t3tools/client-runtime/j5/inbox"; +import { inboxBellPresentation, mergeOpenInboxCounts } from "@t3tools/client-runtime/j5/inbox"; import { useSidebar } from "../../components/ui/sidebar"; import { cn } from "../../lib/utils"; @@ -22,8 +22,6 @@ const useCountRefresh = createVisibleRefreshHook(() => { void refreshJ5Sources(inboxCountSourcesAtom, inboxCountQueryAtom); }); -export const shouldShowOpenInboxCount = (count: number | null) => count !== null && count > 0; - export function HumanInboxBell({ onBackdrop }: { readonly onBackdrop: boolean }) { const { isMobile, setOpenMobile } = useSidebar(); const sources = useAtomValue(inboxCountSourcesAtom); @@ -49,7 +47,7 @@ export function HumanInboxBell({ onBackdrop }: { readonly onBackdrop: boolean }) if (isMobile) setOpenMobile(false); }; - const label = `${count === null ? "Open inbox" : `Open inbox, ${incomplete ? "last known " : ""}${count} open`}${incomplete ? "; some environments could not be refreshed" : ""}`; + const { badge, label } = inboxBellPresentation({ count, incomplete }); return ( - {shouldShowOpenInboxCount(count) || incomplete ? ( + {badge !== null ? ( - {incomplete ? (count !== null && count > 0 ? `${count}*` : "?") : count} + {badge} ) : null} diff --git a/packages/client-runtime/src/j5/inbox.test.ts b/packages/client-runtime/src/j5/inbox.test.ts index ade24a2f3dfb..da4178ca732f 100644 --- a/packages/client-runtime/src/j5/inbox.test.ts +++ b/packages/client-runtime/src/j5/inbox.test.ts @@ -11,6 +11,7 @@ import type { J5ReadSource } from "./readSources.ts"; import { answeredByLine, closedLine, + inboxBellPresentation, mergeHumanInboxSources, mergeOpenInboxCounts, nextKeptItems, @@ -378,3 +379,25 @@ describe("who has an inbox", () => { expect(writesNowhere(null)).toBe(false); }); }); + +describe("what the inbox bell says", () => { + it("shows the open count, and nothing when none is open", () => { + expect(inboxBellPresentation({ count: 3, incomplete: false })).toEqual({ + badge: "3", + label: "Open inbox, 3 open", + }); + expect(inboxBellPresentation({ count: 0, incomplete: false }).badge).toBeNull(); + expect(inboxBellPresentation({ count: null, incomplete: false })).toEqual({ + badge: null, + label: "Open inbox", + }); + }); + + it("marks a count some server could not refresh", () => { + expect(inboxBellPresentation({ count: 2, incomplete: true })).toEqual({ + badge: "2*", + label: "Open inbox, last known 2 open; some environments could not be refreshed", + }); + expect(inboxBellPresentation({ count: null, incomplete: true }).badge).toBe("?"); + }); +}); diff --git a/packages/client-runtime/src/j5/inbox.ts b/packages/client-runtime/src/j5/inbox.ts index 22c00d4e3046..5b7a6985006f 100644 --- a/packages/client-runtime/src/j5/inbox.ts +++ b/packages/client-runtime/src/j5/inbox.ts @@ -53,6 +53,26 @@ export function mergeOpenInboxCounts( }; } +/** + * What an inbox bell says: its badge, if any, and its spoken label. A count some server could not + * refresh is marked: `3*` when it is a last-known count, `?` when nothing is known. + */ +export function inboxBellPresentation(input: { + readonly count: number | null; + readonly incomplete: boolean; +}): { readonly badge: string | null; readonly label: string } { + const { count, incomplete } = input; + const badge = incomplete + ? count !== null && count > 0 + ? `${count}*` + : "?" + : count !== null && count > 0 + ? String(count) + : null; + const label = `${count === null ? "Open inbox" : `Open inbox, ${incomplete ? "last known " : ""}${count} open`}${incomplete ? "; some environments could not be refreshed" : ""}`; + return { badge, label }; +} + export function j5SourceNotice(source: J5ReadSource): string | null { switch (source.status) { case "ready": From dfa49be1e161ad9a75b7bec92d82b15d812bc169 Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Sun, 1 Nov 2026 17:38:01 -0500 Subject: [PATCH 2/3] fix(mobile): the Inbox bell shows on iPad too iOS draws its split view's sidebar header natively, through the workspace toolbar, so the bell there was limited to phones and the sidebar's own bell never rendered on iPad. The toolbar now shows it on every iOS thread list; the sidebar's bell is Android's split view. Co-Authored-By: Claude Opus 5.5 --- FORK.md | 2 +- apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx | 2 +- apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FORK.md b/FORK.md index b0ee92c99f1f..dd7751b3e739 100644 --- a/FORK.md +++ b/FORK.md @@ -519,7 +519,7 @@ migrations after upstream migrations. 101. Mobile has a J5 Inbox screen ([#830](https://github.com/Jacksondr5/j5code/issues/830)), landing the reserved Route registration seam for it. `apps/mobile/src/Stack.tsx` imports J5-owned `j5InboxRoutes` (`apps/mobile/src/j5/inbox/routes.ts`) and spreads it before `SETTINGS_SCREENS`, adding a root `Inbox` screen at `inbox` (`apps/mobile/src/j5/inbox/InboxScreen.tsx`). It reads every connected server's open and answered asks through J5-owned source atoms (`apps/mobile/src/j5/inbox/inboxSources.ts`, built as web's are, with `writesNowhere` for a person who can answer nothing), merges and orders them with `client-runtime/src/j5/inbox.ts`, and shows an older server's source notice. It rereads when it comes into view and on the server's inbox revision, with no timer. On a pin advance: if upstream reshapes `Stack.tsx`'s root screens, spread `j5InboxRoutes` among them again. -102. Mobile's thread list has an Inbox bell with the open count ([#830](https://github.com/Jacksondr5/j5code/issues/830)), as web's rail does. J5-owned `apps/mobile/src/j5/inbox/InboxBell.tsx` reads every connected server's open count (`inboxCountSourcesAtom`, case 101), says it through `inboxBellPresentation` (`packages/client-runtime/src/j5/inbox.ts`, shared with web's bell), and opens the `Inbox` screen. It counts open asks only; web's also counts Crew requests and seat approvals, which come to mobile with Crews. Each header that holds the thread list's filter mounts it with one import and one or two lines: `apps/mobile/src/features/home/ThreadListToolbar.tsx` (Android) adds it beside `filterButton` in the toolbar row's `filter` slot when a server is saved; `apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx` adds it as a `Toolbar.Custom` in the right toolbar on a phone's thread list; and `apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx` (split view) puts it before the filter menu. Upstream's symbol set has no plain bell on Android, so J5's `BellGlyph` draws Tabler's there and the SF Symbol on iOS. On a pin advance: if upstream moves the thread list's filter, move the bell with it. +102. Mobile's thread list has an Inbox bell with the open count ([#830](https://github.com/Jacksondr5/j5code/issues/830)), as web's rail does. J5-owned `apps/mobile/src/j5/inbox/InboxBell.tsx` reads every connected server's open count (`inboxCountSourcesAtom`, case 101), says it through `inboxBellPresentation` (`packages/client-runtime/src/j5/inbox.ts`, shared with web's bell), and opens the `Inbox` screen. It counts open asks only; web's also counts Crew requests and seat approvals, which come to mobile with Crews. Each header that holds the thread list's filter mounts it with one import and one or two lines: `apps/mobile/src/features/home/ThreadListToolbar.tsx` (Android) adds it beside `filterButton` in the toolbar row's `filter` slot when a server is saved; `apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx` adds it as a `Toolbar.Custom` in the right toolbar of the thread list on iPhone and iPad alike (iOS draws its sidebar's header natively, through this toolbar); and `apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx` puts it before the filter menu in the sidebar Android draws itself in split view (`nativeChrome={false}`). Upstream's symbol set has no plain bell on Android, so J5's `BellGlyph` draws Tabler's there and the SF Symbol on iOS. On a pin advance: if upstream moves the thread list's filter, move the bell with it. ## Pin and upstream advance runbook diff --git a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx index ec33575c9ca1..95e221c84ece 100644 --- a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx +++ b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx @@ -882,7 +882,7 @@ function ThreadNavigationSidebarPane( } /> - {/* J5: the Inbox bell beside the filter (FORK.md case 102). */} + {/* J5: the Inbox bell beside the filter in Android's split view (FORK.md case 102). */} diff --git a/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx b/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx index c1bbe5947e20..3aaf8d0d9cd1 100644 --- a/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx +++ b/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx @@ -190,8 +190,8 @@ export function WorkspaceToolbar(props: { {workspace.settingsOpen && !foldedSearch ? null : ( {searchButton} - {/* J5: the Inbox bell on a phone's thread list; iPad's sidebar has its own (case 102). */} - {selectedTab === "threads" && deviceType === "phone" ? ( + {/* J5: the Inbox bell on the thread list, iPhone and iPad alike (case 102). */} + {selectedTab === "threads" ? ( From 143628ecb1fb2f96db3b59d3bff787d1efc28722 Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Sun, 1 Nov 2026 17:40:12 -0500 Subject: [PATCH 3/3] fix(mobile): drop the Inbox bell from the sidebar branch no device draws Android's split view takes ThreadListToolbar and iOS draws the sidebar header natively, so the sidebar's own bell never rendered. Two seams remain. Co-Authored-By: Claude Opus 5.5 --- FORK.md | 3 +-- .../src/features/home/ThreadListToolbar.tsx | 2 +- .../features/threads/ThreadNavigationSidebar.tsx | 3 --- .../features/workspace/WorkspaceToolbar.ios.tsx | 2 +- apps/mobile/src/j5/inbox/InboxBell.tsx | 15 +++------------ apps/mobile/src/j5/upstreamSeams.test.ts | 10 ++-------- 6 files changed, 8 insertions(+), 27 deletions(-) diff --git a/FORK.md b/FORK.md index dd7751b3e739..71528164db1a 100644 --- a/FORK.md +++ b/FORK.md @@ -519,7 +519,7 @@ migrations after upstream migrations. 101. Mobile has a J5 Inbox screen ([#830](https://github.com/Jacksondr5/j5code/issues/830)), landing the reserved Route registration seam for it. `apps/mobile/src/Stack.tsx` imports J5-owned `j5InboxRoutes` (`apps/mobile/src/j5/inbox/routes.ts`) and spreads it before `SETTINGS_SCREENS`, adding a root `Inbox` screen at `inbox` (`apps/mobile/src/j5/inbox/InboxScreen.tsx`). It reads every connected server's open and answered asks through J5-owned source atoms (`apps/mobile/src/j5/inbox/inboxSources.ts`, built as web's are, with `writesNowhere` for a person who can answer nothing), merges and orders them with `client-runtime/src/j5/inbox.ts`, and shows an older server's source notice. It rereads when it comes into view and on the server's inbox revision, with no timer. On a pin advance: if upstream reshapes `Stack.tsx`'s root screens, spread `j5InboxRoutes` among them again. -102. Mobile's thread list has an Inbox bell with the open count ([#830](https://github.com/Jacksondr5/j5code/issues/830)), as web's rail does. J5-owned `apps/mobile/src/j5/inbox/InboxBell.tsx` reads every connected server's open count (`inboxCountSourcesAtom`, case 101), says it through `inboxBellPresentation` (`packages/client-runtime/src/j5/inbox.ts`, shared with web's bell), and opens the `Inbox` screen. It counts open asks only; web's also counts Crew requests and seat approvals, which come to mobile with Crews. Each header that holds the thread list's filter mounts it with one import and one or two lines: `apps/mobile/src/features/home/ThreadListToolbar.tsx` (Android) adds it beside `filterButton` in the toolbar row's `filter` slot when a server is saved; `apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx` adds it as a `Toolbar.Custom` in the right toolbar of the thread list on iPhone and iPad alike (iOS draws its sidebar's header natively, through this toolbar); and `apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx` puts it before the filter menu in the sidebar Android draws itself in split view (`nativeChrome={false}`). Upstream's symbol set has no plain bell on Android, so J5's `BellGlyph` draws Tabler's there and the SF Symbol on iOS. On a pin advance: if upstream moves the thread list's filter, move the bell with it. +102. Mobile's thread list has an Inbox bell with the open count ([#830](https://github.com/Jacksondr5/j5code/issues/830)), as web's rail does. J5-owned `apps/mobile/src/j5/inbox/InboxBell.tsx` reads every connected server's open count (`inboxCountSourcesAtom`, case 101), says it through `inboxBellPresentation` (`packages/client-runtime/src/j5/inbox.ts`, shared with web's bell), and opens the `Inbox` screen. It counts open asks only; web's also counts Crew requests and seat approvals, which come to mobile with Crews. Two headers mount it, each with one import and one or two lines: `apps/mobile/src/features/home/ThreadListToolbar.tsx` (Android) adds it beside `filterButton` in the toolbar row's `filter` slot when a server is saved, and `apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx` adds it as a `Toolbar.Custom` in the right toolbar of the thread list on iPhone and iPad alike (iOS draws its sidebar's header natively, through this toolbar). Android's split view draws its sidebar header with the same `ThreadListToolbar`, so it gets the bell there; no other header holds the thread list's filter. Upstream's symbol set has no plain bell on Android, so J5's `BellGlyph` draws Tabler's there and the SF Symbol on iOS. On a pin advance: if upstream moves the thread list's filter, move the bell with it. ## Pin and upstream advance runbook @@ -741,7 +741,6 @@ explicitly marked. | `apps/mobile/src/Stack.tsx` | A | 72, 98, 101, Role library | | `apps/mobile/src/features/home/ThreadListToolbar.tsx` | N | 102 | | `apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx` | N | 102 | -| `apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx` | N | 102 | | `apps/mobile/src/features/archive/ArchivedThreadsRouteScreen.tsx` | N | 72 | | `apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx` | N | 90 | | `apps/mobile/src/features/threads/ThreadFeed.tsx` | N | 90 | diff --git a/apps/mobile/src/features/home/ThreadListToolbar.tsx b/apps/mobile/src/features/home/ThreadListToolbar.tsx index c9dc6f3bbe87..e0e7d7b8582a 100644 --- a/apps/mobile/src/features/home/ThreadListToolbar.tsx +++ b/apps/mobile/src/features/home/ThreadListToolbar.tsx @@ -118,7 +118,7 @@ export function ThreadListToolbar(props: { filter={ <> {filterButton} - {connectionState.hasConnections ? : null} + {connectionState.hasConnections ? : null} } /> diff --git a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx index 95e221c84ece..ce5ad0b6e8f7 100644 --- a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx +++ b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx @@ -56,7 +56,6 @@ import { ThreadListToolbar } from "../home/ThreadListToolbar"; import { useToolbarLayout } from "../../components/ui/useToolbarLayout"; import { useFabScroll } from "../home/FabScrollContext"; import { SidebarFilterButton } from "./sidebar-filter-button"; -import { InboxBell } from "../../j5/inbox/InboxBell"; import { createSidebarHeaderItems } from "./sidebar-native-header-items"; import { SidebarNavigationShell } from "./sidebar-navigation-shell"; import { @@ -882,8 +881,6 @@ function ThreadNavigationSidebarPane( } /> - {/* J5: the Inbox bell beside the filter in Android's split view (FORK.md case 102). */} - diff --git a/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx b/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx index 3aaf8d0d9cd1..e06b56d73852 100644 --- a/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx +++ b/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx @@ -193,7 +193,7 @@ export function WorkspaceToolbar(props: { {/* J5: the Inbox bell on the thread list, iPhone and iPad alike (case 102). */} {selectedTab === "threads" ? ( - + ) : null} {nativeToolbarCompose && foldedSearch ? : null} diff --git a/apps/mobile/src/j5/inbox/InboxBell.tsx b/apps/mobile/src/j5/inbox/InboxBell.tsx index 93d7687801b2..cc8d36a5cb00 100644 --- a/apps/mobile/src/j5/inbox/InboxBell.tsx +++ b/apps/mobile/src/j5/inbox/InboxBell.tsx @@ -4,35 +4,26 @@ import { useNavigation } from "@react-navigation/native"; import { Pressable, View } from "react-native"; import { AppText as Text } from "../../components/ui/AppText"; -import { cn } from "../../lib/cn"; import { BellGlyph } from "./BellGlyph"; import { inboxCountSourcesAtom } from "./inboxSources"; /** * The Inbox bell in the thread list's header, with the open count across every connected server. * It counts open asks only: Crew requests and seat approvals join it with Crews on mobile. - * `header` sits among the header's icon buttons, `sidebar` beside the split view's filter. */ -export function InboxBell(props: { readonly variant: "header" | "sidebar" }) { +export function InboxBell() { const navigation = useNavigation(); const sources = useAtomValue(inboxCountSourcesAtom); const { badge, label } = inboxBellPresentation(mergeOpenInboxCounts(sources)); - const sidebar = props.variant === "sidebar"; return ( navigation.navigate("Inbox")} - className={cn( - "items-center justify-center active:opacity-70", - sidebar ? "size-11 rounded-full bg-subtle" : "size-12", - )} + className="size-12 items-center justify-center active:opacity-70" > - + {badge === null ? null : ( = [ file: "features/home/ThreadListToolbar.tsx", record: "case 102: the Inbox bell", from: "../../j5/inbox/InboxBell", - reaches: [''], + reaches: [""], }, { file: "features/workspace/WorkspaceToolbar.ios.tsx", record: "case 102: the Inbox bell", from: "../../j5/inbox/InboxBell", - reaches: [''], - }, - { - file: "features/threads/ThreadNavigationSidebar.tsx", - record: "case 102: the Inbox bell", - from: "../../j5/inbox/InboxBell", - reaches: [''], + reaches: [""], }, { file: "App.tsx",