Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/mobile/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ The shell is set by [ADR-0211](../../docs/adr/0211-the-mobile-app-has-two-tabs-w

- Header: the system navigation header of the root native stack (expo-router `Stack`), so back, the swipe back and the iOS 26 header transitions are the platform's own. It has no bar fill, title text, subtitle or state dot. Leading, from the left: Back, then right beside it the title chip (the Bot's avatar and name, leading-aligned, never centred), which opens the Bot profile. Trailing: one round button for the Bot's computer. Back is the native back button; a plain back control replaces it only when the chat is the first screen of the stack, and returns to Chats.
- iOS: the header is transparent (`headerTransparent`) with no `headerStyle.backgroundColor`, so UIKit draws the bar; a clear colour would remove its material. The chip is a native bar item of type `custom` (`unstable_headerLeftItems`), and `headerTitle` is empty. The computer button, and the plain back control when the chat is the first screen, are native bar buttons with SF Symbols (`macwindow`, `chevron.left`), so UIKit tints them. The chip's text uses the system `label` colour, not `fg`, because the bar's glass picks its own light or dark look from what is under it and from Reduce Transparency; a fixed `fg` went white on a light grey item in dark mode with Reduce Transparency on. A zero-width `spacing` item separates the chip from Back so each gets its own glass shape: a round Back and a separate capsule. iOS 26 draws that Liquid Glass behind the bar items itself, so the items carry no `glassEffect` or fill of their own (that would draw a second, skinny capsule). The chip is capped so the computer button always fits. Before iOS 26 the bar uses the system chrome blur.
- Android: the header floats over the messages like iOS's (`headerTransparent`, no bar fill, no shadow), with the same three shapes as Grok's chat header: a round Back, the title chip at the start (`headerTitleAlign: 'left'`) as its own capsule island, and a round computer button, each its own shape `space.x3` apart (the title wrapper's horizontal margin), never touching. Each shape uses the opaque-iOS fallback of the header buttons (`headerGlassFill`: frosted `raised` fill with a `raised` hairline), so the chip reads as an island, not a label in a bar. Back is always this round button (it replaces the native navigation icon; system and predictive back still work). The list pads its own top by the header height, and messages scroll under the header through the drawn top fade (see below). Android has no system scroll edge effect: Material 3 only tints the top app bar on scroll, and the View fading edge (`fadingEdgeLength`) fades content linearly at the scroll view's own bounds, so it cannot keep what passes under the floating chrome hidden.
- Android: the header floats over the messages like iOS's (`headerTransparent`, no bar fill, no shadow), with the same three shapes as Grok's chat header: a round Back, the title chip at the start (`headerTitleAlign: 'left'`) as its own capsule island, and a round computer button, each its own shape `space.x3` apart (the title wrapper's horizontal margin), never touching. Each shape uses the opaque-iOS fallback of the header buttons (`headerGlassFill`: frosted `raised` fill with a `raised` hairline), so the chip reads as an island, not a label in a bar. Back is always this round button (it replaces the native navigation icon; system and predictive back still work). The list pads its own top by the header height, and messages scroll under the header through the drawn top fade (see below). Android has no system scroll edge effect: Material 3 only tints the top app bar on scroll, and the View fading edge (`fadingEdgeLength`) fades content linearly at the scroll view's own bounds, so it cannot keep what passes under the floating chrome hidden. Back's icon is `BackIcon`: a chevron on iOS and the Material `arrow_back` on Android, as in drawer and sheet headers.
- The chip holds, in one row, the Bot's avatar (28pt, round, no state ring) and its name in `body` strong; a group shows its mark and name. It is `theme.touch` tall with padding concentric with its corners. The Bot's state is read out in its accessibility label only. Pressing shows the `raised` pressed fill. Icons in the header are `fg`, never the Bot's accent.
- iOS: messages run under the transparent header and the status bar, and UIKit's scroll edge effect (left on `automatic`) softens them there. The list uses `contentInsetAdjustmentBehavior="automatic"`, so UIKit, not a manual padding, keeps the header's height free above the oldest message at rest; the edge effect needs that automatic inset. The edge effect and React Native Screens both find the content scroll view through the first-subview chain of the screen, so the message list is the first thing in that chain: a default or colour chat background is the frame's own `backgroundColor`, not a view in front of the list. An image background still needs a view behind the list, and with one the soft edge does not reach the list. UIKit also adds the home-indicator safe area to the bottom inset while the list reaches the screen bottom (keyboard closed); the list cancels it with a negative `contentInset.bottom`, because the composer's height already includes that padding. Without this, scrolling to the very end left 34pt more space below the newest message than the resting position. There is no painted top gradient. A transparent header dimmed the whole message list on iOS 26 while the list was inverted (a scaleY flip); the list now runs top to bottom, which this header depends on.
- The list runs to the bottom of the screen, and the composer floats over it with no bar of its own; messages pass around and under its **+** button and field capsule. On iOS 26 with Reduce Transparency off both shapes are Liquid Glass, like iOS Messages; older iOS and Reduce Transparency give them an opaque `surface` fill with a `borderStrong` hairline, and Android gives the field the opaque `raised` fill, so on those nothing shows through where the Human types. The bottom of the screen fades out with the same light gradient over the composer and `edgeFade.bottom` above it. The list keeps that much space below the newest message, so at rest it sits just above the composer; scrolled up, messages pass behind the composer. Dragging the list dismisses the keyboard: interactively on iOS (the keyboard follows the finger once it reaches it), on drag on Android. On iOS and Android the bottom edge is a drawn mask layer between the list and the composer, like Grok's chat: one soft curve (`(1 − d)^edgeFade.curve`, sampled `edgeFade.samples` times) from fully opaque at the screen edge (held solid across the home-indicator or status-bar safe area, so nothing shows through in that strip on a coloured background) to clear `edgeFade.reach` above the composer's measured height, so it is nearly opaque only close to the screen edge and never a hard band at the composer's top, painted in the chat's own background colour (`base` with an image background). Android uses the same mask under its floating header. iOS 26 hides UIKit's bottom scroll edge effect for the chat (`scrollEdgeEffects.bottom: 'hidden'`) and does not use a `UIScrollEdgeElementContainerInteraction` on the composer: UIKit picked the hard style there, an opaque band in a different colour from the list with a hairline across its top, at a height that did not follow a wrapped draft, and neither re-adding the interaction nor pinning the `soft` style fixed it. The top edge stays UIKit's automatic scroll edge effect. With the keyboard open the composer's pill sits `space.x3` above it: the keyboard already covers the home indicator, so the chat frame takes the composer's safe-area padding back out of the keyboard offset instead of counting it twice.
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/ui/chat/header-chrome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Svg, { Defs, LinearGradient, Rect, Stop } from 'react-native-svg';
import { frosted, pressTint, useDesignTheme, type DesignTheme } from '../design/theme';
import { edge, radius, space } from '../design/tokens';
import { DrawerMaterial, EdgeMaterial, useLiquidGlass } from '../primitives/drawer-material';
import { ChevronLeftIcon } from '../shell/icons';
import { BackIcon } from '../shell/back-icon';
import { t } from '../strings';
import { edgeFadeStops } from './edge-fade';

Expand Down Expand Up @@ -81,7 +81,7 @@ export function HeaderBackButton({ onPress, plain }: { onPress(): void; plain?:
const theme = useDesignTheme();
return (
<HeaderCircleButton label={t.back} onPress={onPress} plain={plain === true}>
<ChevronLeftIcon color={theme.color.fg} size={ICON} />
<BackIcon color={theme.color.fg} size={ICON} />
</HeaderCircleButton>
);
}
Expand Down
5 changes: 3 additions & 2 deletions apps/mobile/src/ui/primitives/drawer-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { Pressable, View, type ViewInstance } from 'react-native';

import { radius, space } from '../design/tokens';
import { useDesignTheme } from '../design/theme';
import { CheckIcon, ChevronLeftIcon, CloseIcon } from '../shell/icons';
import { BackIcon } from '../shell/back-icon';
import { CheckIcon, CloseIcon } from '../shell/icons';
import { t } from '../strings';
import { Text } from './text';

Expand Down Expand Up @@ -65,7 +66,7 @@ export function DrawerHeader({
<View style={slot}>
{onBack !== undefined ? (
<HeaderButton label={t.back} onPress={onBack}>
<ChevronLeftIcon color={theme.color.fg} size={theme.type.title.line} />
<BackIcon color={theme.color.fg} size={theme.type.title.line} />
</HeaderButton>
) : onClose !== undefined ? (
<HeaderButton label={closeLabel} onPress={onClose}>
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/ui/shell/back-icon.android.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ArrowBackIcon as BackIcon } from './icons';
1 change: 1 addition & 0 deletions apps/mobile/src/ui/shell/back-icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ChevronLeftIcon as BackIcon } from './icons';
4 changes: 4 additions & 0 deletions apps/mobile/src/ui/shell/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ export function ChevronLeftIcon(props: IconProps) {
return <Glyph {...props} d="m15 6-6 6 6 6" />;
}

export function ArrowBackIcon(props: IconProps) {
return <Glyph {...props} d="M19 12H5m7 7-7-7 7-7" />;
}

export function ChevronRightIcon(props: IconProps) {
return <Glyph {...props} d="m9 6 6 6-6 6" />;
}
Expand Down
28 changes: 28 additions & 0 deletions apps/mobile/test/back-icon-android.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// @vitest-environment jsdom
import { act, createElement } from 'react';
import { createRoot } from 'react-dom/client';
import { expect, it, vi } from 'vitest';

vi.mock('react-native-svg', () => ({
default: ({ children }: { children?: unknown }) => children,
Circle: () => null,
Path: ({ d }: { d: string }) => createElement('i', { 'data-d': d }),
}));
import { BackIcon as AndroidBack } from '../src/ui/shell/back-icon.android';
import { BackIcon as IosBack } from '../src/ui/shell/back-icon';

Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });

async function pathOf(Icon: typeof AndroidBack) {
const host = document.createElement('div');
const root = createRoot(host);
await act(async () => root.render(<Icon color="#000000" size={24} />));
const d = host.querySelector('i')?.getAttribute('data-d');
act(() => root.unmount());
return d;
}

it('uses the Material arrow for Back on Android and the chevron on iOS', async () => {
expect(await pathOf(AndroidBack)).toBe('M19 12H5m7 7-7-7 7-7');
expect(await pathOf(IosBack)).toBe('m15 6-6 6 6 6');
});
11 changes: 11 additions & 0 deletions changes/2358-android-back-arrow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
section: Changed
---

## en

- On Android, the mobile app's Back button uses the Material arrow in chat, drawer and sheet headers ([#2358](https://github.com/BotHarness/DeepSeekBot/pull/2358)).

## zh

- Android 手机端的返回按钮改用 Material 箭头,覆盖聊天、抽屉和面板顶栏([#2358](https://github.com/BotHarness/DeepSeekBot/pull/2358))。
Loading