Repository navigation
feat(mobile): match the web ui kit - #287
Merged
Merged
Conversation
Buttons, icon buttons, fields, search, select, picker rows, switch, segmented control, checkbox, alerts, empty states, settings cards, sheets, confirmations and toasts now follow apps/web/src/lib/shared/ui. The connection-lost box and full-width retry button are gone: the sidebar footer shows the web's Connected / Reconnecting… / Gateway unavailable status with a details sheet (native error code, small Reconnect now), and screens show the web's compact banners.
nixuuu
added a commit
that referenced
this pull request
Nov 6, 2026
Mobile conversations used a solid composer block that shortened the timeline. Composers now float above the feed and fold while reading history; the main screens also extend their backgrounds and scroll viewports behind the system bars while keeping controls inside safe areas. Rebased onto `dev` after the mobile UI kit landed (Related: #287). Its shared buttons, notices, search/form controls, confirmation host and sheet title/close controls are preserved. Connection banners now participate in the floating header measurement on threads, bot chats, sidebar and Settings. The extracted sidebar footer uses #287's interactive connection status with details and retry; Settings retains its density provider. Full sheets keep the kit's 20 dp content spacing inside the inset-aware modal frame. The final rebase also includes the bot-history changes that landed meanwhile (Related: #288, #289, #290). Bot chats retain the snapshot cache, incremental updates, cached bot names, loading header/avatar, syncing subtitle and live-only approval/send/stop guards beneath the floating layout. ## Composer behavior - Match web `ComposerCompaction`: fold after 96 dp of travel toward older messages, at least 192 dp from the end; expand within 8 dp of the end or on tap, focus, or typing. Only reader gestures fold it; streaming and layout changes do not. Synchronous questions keep it expanded. - Match `VirtualFeed.reservedFooter`: measure the full overlay, retain its largest reserve while reading history, and follow its height at the latest end. The changing spacer is excluded from the visible-message anchor. The latest-message action remains above the composer with an actual Android touch area. - Reuse the web surface, border, light-theme shadow and 32 dp canvas fade. Animate folding with shared 400/350 ms tokens and `smoothOut`; reduced motion uses zero duration. Inputs and folded controls stay mounted. - Mobile additionally keeps any draft, attachment or mention picker expanded, so compaction cannot hide unfinished input. Bot chats retain their native inline pill. This is a deliberate difference from web's ability to fold a draft to one line. ## Insets by screen | Screen | Layout and control insets | | --- | --- | | Thread and existing side thread | Full-window inverted feed under a translucent floating header and composer. Oldest end reserves the measured header plus top inset; latest end reserves the measured composer including bottom inset. Composer controls have side/bottom padding. | | Bot chat | Same overlay, compaction, reserve and safe-area rules as threads, with the inline bot composer. | | Sidebar and thread/bot lists | Full-height list under measured floating header/footer. Content padding makes first/last rows reachable. Footer controls sit above the home indicator. Only the outside edge of each split pane consumes a horizontal inset. | | New thread and side-thread creation | Expanded forms because there is no conversation history to compact. New thread scrolls under its floating header; side-thread creation uses the modal frame. Form content gets safe-area padding. | | Settings | Both columns scroll behind the floating header. Navigation consumes the left outside inset, details the right; a single column consumes both. Forms retain keyboard-overlap handling. | | Pairing and empty home pane | Full-window background and scroll viewport, with content padding protecting controls at both ends and sides. | | Full sheets and compact pickers | Full sheets measure their own modal safe area and scroll under the header. Bottom pickers extend their surface behind the home indicator and inset actions; centered landscape/Fold cards fit the safe rectangle. | `KeyboardArea` keeps its existing keyboard `screenY` calculation. Closed-keyboard safe-area padding now belongs to scroll content and composer controls instead of the viewport. Status-bar icons continue to follow the selected light/dark theme; translucent header surfaces maintain contrast above scrolling content. No new native dependency or native configuration change. ## Verification Reran after the final rebase onto `cf9f6be2`: `bun install`, `bun run gen:check`, `bun run typecheck`, `bun run lint`, `bun run format:check`, `bunx expo lint` from `apps/mobile`, and the web build. All passed. Expo refreshed the ignored generated route list for the newly merged exchange screen before the passing typecheck. Final `bun run check:tmp`: **1534 passed, 158 skipped, 0 failed**, 1692 tests across 274 files; no test temp directories left behind. The full test run uses a private `TMPDIR` inside the ignored worktree temp directory, with `GIT_CEILING_DIRECTORIES` set to that directory. This prevents deliberately non-Git fixture folders from discovering the checkout above them. Live/provider tests remain opt-in. Self-review and `git diff --check` are clean. Android Fold device observations before the final edge-to-edge expansion: light/dark surfaces, long history, content passing below the composer, folding on scroll, expanding on tap/focus and return to latest, functioning latest-message action, and a visible multiline draft. Screenshots are kept outside the checkout. The recording exporter failed after its documented debug retry. After the UI-kit rebase, the source launched in the free Android Fold emulator using the existing development client. Smoke-checked the edge-to-edge shell in light and dark, readable status icons, inset sidebar footer, the offline connection banner and its details/retry overlay, plus Settings search with the real keyboard open and closed. After the final bot-cache rebase, the bot-chat screen also rendered its loading header and floating composer. The old fixture gateway was offline, so live conversation behavior was not rechecked. Multiline entry could not be verified: Android's `system_server` aborted during the fill attempt, and the tool's debug retry could not find the field after the reset. No new native build or download was needed; the owned emulator and Metro session were shut down afterwards. Device QA remains incomplete: the earlier iOS development-client launch timed out twice, and its notch/Dynamic Island layouts remain unverified. Phone width, conversation keyboard handling, drafts with attachments and mention suggestions, bot/side-thread flows, reaching the bottom during streaming, reduced motion, landscape and Android three-button navigation still need device coverage. The rebase smoke check does not replace those checks. Copy audit (`docs/copy.md` §8): no new user-facing copy; existing English action labels and form text are preserved. No web UI tests or permanent verification artifacts were added. Shared mobile buttons, notices and form controls retain #287's implementation; only the shared sheet's layout delegates to the new modal frame.
nixuuu
added a commit
that referenced
this pull request
Nov 6, 2026
Stage 2 of 2 (stack: #297 → this PR). Merge the stack together. Applies the motion layer from #297 to the screens. Rebased onto #287 (UI kit) and #292 (floating composer). The composer's compact/expand is untouched. ## Transitions per screen - **Thread timeline** (inverted list held by the fold anchor): a new turn (sent or queued message) fades in; rows that arrive later inside a turn fade in (work rows, notices, the answer when it leaves the fold); an opened fold's rail fades in; fold, group, reasoning, code, file-change and failure chevrons turn; pending steers fade in and out. No height animation in the feed, so anchoring and following still hold. - **Bottom of a conversation:** approval/question cards pop in and out; "Show latest messages" pops in and out (in `FloatingComposer`, appearance only). - **Bot chat:** new messages fade in; the approval card fades its answer block out on expiry and swaps the actions for the expiry note. - **Sidebar:** the Threads/Bots lists cross-fade while the pill slides. Thread rows glide on reorder (`GlidingCell`) and fade in when new, and the row status (Working → Completed …) swaps. The "Working" section and "Archived" get chevrons, and "Archived" expands as an accordion. In the bot list, rows glide on reorder (`itemLayoutAnimation`), new bots fade in, and unread counts pop and swap. The connection label swaps and its dot eases. - **Wide layout:** the sidebar slides in from the edge and fades (`slow`) and slides out (`medium`). The column takes its width before the slide in and gives it up after the slide out, so the screen beside it lays out once, not on every frame. Rotation, folding, sign-in and Settings switch at once. Screens keep the in-place swap from #234. Screen transitions stay the native stack defaults. - **Settings:** disclosures expand and collapse; connector error details expand. The kit's `Switch` already animates its thumb. - **Lists:** composer attachment chips pop in and out and their neighbours glide. Bot approval rules resolve in when loaded, and a removed rule fades out while the rest glide up. - **In-app alert:** comes down from the top edge and leaves the same way; a newer alert replaces it. - A screen's first render and its removal do not animate (`LayoutAnimationConfig` in the Stack's `screenLayout`, sheets and overlays). ## Reduced motion Fades only (rows, sheets, alerts, cards). Slides, pill, chevrons, text swaps, layout glides and the sidebar are instant. Checked on iOS (Reduce Motion) and Android ("Remove animations"). ## Performance - Every animation runs on the UI thread (Reanimated shared values, layout animations). - Long lists: virtual lists animate only real arrivals (`useArrivals`). Rows that remount while scrolling appear at once, and virtualized rows have no exit animations. The timeline animates opacity only, never height. - The sidebar no longer animates the column width. A width animation re-laid out a 40-turn thread on every frame on the iPad and dropped the motion; the column now changes width once, outside the motion. - Checked with a 40-turn seeded thread on the iPhone 17 Pro simulator (dev and production JS bundles), the iPad Pro 13" simulator and a Pixel 7 class Android 16 emulator. ## Verification - Gates: `bun install`, `bun run gen:check`, `bun run typecheck`, `bun run lint`, `bun run format:check`, `bunx expo lint`, `bun run check:tmp` (1548 pass, 0 fail, nothing left in temp) and the web build are all clean on the rebased stack. - EAS dev builds (iOS simulator, Android APK) with the new native modules were installed. The app was paired with a throwaway local gateway that had seeded threads. - iOS (iPhone simulator), light and dark, reduced motion on and off: segmented pill, sheet open/close, live turn (rows arriving, fold closing, answer out), fold toggle with the header anchored, "Show latest", settings segments. After the rebase onto #292, a smoke test of a live turn with the floating composer passed. - iPad (wide layout): sidebar close and reopen end states, and pill. - Android emulator: pill, live turn, dark mode, reduced motion (sheet and scrim fade only). ## Unverified / known - Frame-level timing on the iPad: simulator recordings at that resolution drop frames, and frame stats need a physical device. The sidebar design avoids per-frame layout, but it was not measured on hardware. - Not checked on a physical phone or a mid-range physical Android device. - Pre-existing and not changed here: on Android, after sending in a long thread the feed stops just above the bottom and shows "Show latest messages" instead of following. It reproduces with every animation disabled, so `maintainVisibleContentPosition` on Android is the likely cause. ## Copy audit No UI text changed.
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the mobile building blocks (
apps/mobile/src/ui, shared settings and navigation pieces) in line with the web kit (apps/web/src/lib/shared/ui), and replaces the large connection-lost box and full-width "Reconnect now" button with the web's connection model.Connection notices
● Reconnecting(amber for any non-live state)● Connected/● Reconnecting…(pulsing) /● Gateway unavailable/● Offline, likeConnectionStatus.svelte. A tap opens a status sheet: one sentence,Last error: <native code>, and a small secondaryReconnect nowReconnect nowlive-source.tsthreshold), a warning banner under the header reads "The gateway is not responding. Showing the last known state; retrying automatically." (the web AppShell text), with a ghostDetailsbutton that opens the status sheet. Without network: "You’re offline…"Retry. The quietSyncing…line staysuseStreamnow returnsunavailableafter 12 s down and keeps the native code indetail, apart from user-facing text.Inventory (mobile vs web kit)
Legend: same = matched before this PR; fixed = was different, now matches; different = still differs (reason below); missing = no mobile counterpart.
bg-action,text-on-accent, medium 16/24, 40 dp, radius 8variant="primary", 40 dp (44 dp in Settings likedensity.css), medium,action-hoverwhen pressedinsetfill andlineborderrose-50/rose-500/10when pressedmd40/36,sm32/28 (text 14, gap 4, radius 6)SmallButtoniconpropicon-muted→icon-emphasis, 40/36, radius 8;sm32insetwhen pressed, icon mutedmd, 32 dpsm, web pressed fill, icon darkens when pressed,busy, variantsTouchTargethitSlopreaches 44–48 dp (phone adaptation)Field)panel+ mutedField multilineSearchField; sidebar uses a frameless variantTextInput, Settings used a labelledField, thread search aFieldui/SearchField(barefor the sidebar), brand focus ring, clear button insideSelectField)chevron-up-downzinc-500, label like Field--duration-fastaction/insettrack, borderline, thumb jumpsui/Switch, animated (still under reduced motion)insettrack, regular 13, activesurface+ border, 36 dpui/Checkbox, used thereOptionTile,ChoiceCardbannerstripNoticebox; red text for errorsui/Alertwith all tones andbanner;Notice errorrenders an error AlertNoticeis a muted paragraphactivepingactivepingProjectMark, bot avatarline, 0.5 dplinedividers, padding 12RuleAlert.alertconfirm()dialog in the kit (actions stacked likeDialogActionson phones)DropdownMenuPickerSheetwithout checkEmptyState(dashed, icon, title, description, action) or a SettingsRow inside a groupui/EmptyState, settings use SettingsRow like web, sidebar empty text shows againOpenWhat else changed
theme.ts: tokens for the web kit (ring,pressed,recess,control,track,brand,icon,iconStrong,actionPressed,dangerPressed) anduseTypography().small.ui/density.ts: Settings density (44 dp controls) and compact header actions.Buttonmoved fromsecondary/dangerflags tovariant; screens with two primaries were reduced to one (Agent environment headers, Update all, Preview marketplace once previewed, Generate new token).Restore device defaultsis an inline secondary button with an icon, as on web.SearchField.docs/mobile.md: connection states and the kit.Still different, and why
Sheet, bottom sheets for pickers and menus: the documented phone form (docs/ui-scale.md,docs/mobile.md).DialogActionson phones.color-mix), which RN cannot parse.Checks
Last error: POSIX 61, timeout, Settings → General light/dark (Switch, Select, Button, cards), confirm dialog dark; before/after for the connection box and Settings.bun install,bun run gen:check,bun run typecheck,bun run lint,bun run format:check,bunx expo lint,bun run check:tmp.Copy audit (docs/copy.md §8)
Reconnecting…; banner "Reconnecting to live updates…" (screen streams)Clear filtersOpenNo "soul" sentences added. Wrapping was checked with the long Settings descriptions and the banner text at phone width; long thread and bot names were not on the test gateway.