diff --git a/.github/pr-screenshots/2554-android/README.md b/.github/pr-screenshots/2554-android/README.md new file mode 100644 index 0000000000..61d61170d8 --- /dev/null +++ b/.github/pr-screenshots/2554-android/README.md @@ -0,0 +1,39 @@ +# PR2554 Android native evidence — PARTIAL + +Actual run: 2026-10-22, Android 16 arm64 physical phone, 1220 × 2712 screenshot pixels. This is development-native behavior, not Release performance, iOS, TalkBack or Human acceptance. + +## Exact inputs and provenance + +- Baseline main: `897e9334768baf26547eb155f9ab1b3e7a0ee61f`. +- Combined candidate: `8e09ba57d367dff346a4ab5f3c5d53e5c32c90e6`. +- PR2551: `5df949ff7fad82f128609a858277f161df484bcb` (tests/docs; streaming fixes already on baseline). +- PR2552: `a0a3f17af55af20e48a8c4bb1d47430bda7b7b99`. +- PR2554: `571b4437b4a5c323d243a56e79d25d5bf85f82b8`. +- Both independently computed native fingerprints: `2cde0026048320af2a7fdcafdc10b68875aadd75` (211 sources). Expo58.0.17 / RN0.88.0 / React19.3.0. Reused compatible arm64 development APK, SHA256 `B3A5DF7CA0D0F1C393523BE945FD49EF7263110A6DAA5B89726073759CA9ED3A`, 115259560 bytes. Historical native-build Node24.16/24.21 provenance uncertainty remains; actual Host/Metro runtime explicitly Node24.21.0. No new native build in this run. +- Preparation: 20 files / 163 tests and mobile typecheck passed. Separate baseline/candidate root builds passed; one sequential Metro and isolated QA Hosts. These source/build results are not native acceptance. +- Official provider/model: `deepseek-official` / `deepseek-flash`, verified with actual phone composer → Host → visible reply, not API-only. USB loopback QA route does not prove tailnet or QR scanning. + + +## PR2554 — sampled geometry improved; full acceptance remains PARTIAL + +Baseline and candidate share the same HarborBot/42 data for row captures. Default/intermediate1.3 and extra2.0 stress light/dark captured. Baseline2.0 places title, time and preview on separate lines. Candidate places title/time on the same horizontal line with preview/status below and real PR2552 trailing menu. At2.0 dark, title/time are still truncated; this is not a full-content-visibility pass. + +Actual OEM maximum was selected on the system font slider: label200% maps to Android `font_scale=1.45` on this phone. It is distinct from direct2.0 stress. Matched light/dark OEMmax screenshots with `HarborBot 中文长标题 Native layout` and `NoTime 无时间` show baseline header/time stacking versus candidate single-line title/time and preview second; no-time row has no blank timestamp row. Long title is visually truncated; full accessible name was sampled in XML, not through TalkBack. Baseline light screenshot also shows transient text truncation; no claim of identical animation phase. + +Live font changes produced Expo Router linking/navigation warnings in both sources. Warnings remain visible in published full-app crops, with no attribution to these PRs. Some warnings overlap bottom navigation. Long-title row opening, complete accessibility and iOS/Human acceptance remain untested. + + + + +Status/system-navigation pixels cropped for privacy. No generated/reconstructed UI. PNGs reviewed individually through labeled contact sheets; recording frames sampled every5s across their full selected interval. No personal notification or credential visible in reviewed frames. Public clips only contain designated QA journeys; raw originals remain private. This sampling is not frame-by-frame privacy certification. + +## Restoration and exclusions + +Original development APK restored with install-r and pullback SHA256 `51602EFA76CF63081C664BF9F53B857F843F91B377F99EFDCA6DC699C9809766` matching backup. All eight recorded settings and original ADB reverse list matched; own pairings removed and all three issued credentials revoked. Two original offline Host entries remain and phone preferences were all true. Pre-run drawer-host IDs were missing, so exact original-pairing ID comparison is unavailable; earlier `exactMatch=false` was an invalid empty-baseline comparison, not proof of data loss. Original offline Host copies remain pending. No uninstall, pm-clear or production app changes. + +Own Host/Metro processes, descendants, ports and recorders were stopped. Lease and heavy slot released07:53:03.733Z. Evidence: restore-device.json, cleanup-runtime.json, recorders-cleanup.json, resource-release.json and pairings-restore-qualified.json. Global ADB untouched. + +Telemetry2570 remained BLOCKED: no independent production-egress isolation or dedicated synthetic container. No analytics configuration, interception, statistics-file mutation or personal opt-out operation occurred. Hermes2565, HostSettings2564, grid2574, Video and native splash2579 were excluded. Splash2579 is accepted for a future main batch containing merge55fe0fa36669e21d343bec7e417b2387d239118f and requires a new native APK; old binary/Metro cannot verify it. + +Public images are pixel crops removing status/navigation bars only, with hashes and source binding. Raw logs, identifiers, private profiles, XML and unreviewed frames remain private. Public publication status is tracked in the sole queue; local assets alone do not complete PR evidence delivery. + diff --git a/.github/pr-screenshots/2554-android/after-dark.png b/.github/pr-screenshots/2554-android/after-dark.png new file mode 100644 index 0000000000..5dd26a82a0 Binary files /dev/null and b/.github/pr-screenshots/2554-android/after-dark.png differ diff --git a/.github/pr-screenshots/2554-android/after-light.png b/.github/pr-screenshots/2554-android/after-light.png new file mode 100644 index 0000000000..fa5c90322b Binary files /dev/null and b/.github/pr-screenshots/2554-android/after-light.png differ diff --git a/.github/pr-screenshots/2554-android/before-dark.png b/.github/pr-screenshots/2554-android/before-dark.png new file mode 100644 index 0000000000..4fc7dcc795 Binary files /dev/null and b/.github/pr-screenshots/2554-android/before-dark.png differ diff --git a/.github/pr-screenshots/2554-android/before-light.png b/.github/pr-screenshots/2554-android/before-light.png new file mode 100644 index 0000000000..4d90fd342c Binary files /dev/null and b/.github/pr-screenshots/2554-android/before-light.png differ diff --git a/.github/pr-screenshots/2554-android/hashes.json b/.github/pr-screenshots/2554-android/hashes.json new file mode 100644 index 0000000000..dab073461b --- /dev/null +++ b/.github/pr-screenshots/2554-android/hashes.json @@ -0,0 +1,50 @@ +[ + { + "file": "after-dark.png", + "bytes": 81089, + "sha256": "0831d11bc5c7f31956c4b5e4a8525492d6d97f277318fd77a2772df55fa201c4", + "processing": "Original1220x2712 crop x0/y130/w1220/h2530 only." + }, + { + "file": "after-light.png", + "bytes": 85786, + "sha256": "0de88d06dd45240075b9c9247b9e348dc4755aa9edb240a7c50b6baf76317fb4", + "processing": "Original1220x2712 crop x0/y130/w1220/h2530 only." + }, + { + "file": "before-dark.png", + "bytes": 81835, + "sha256": "75da3f6caa14890577da80afb6b8cf8f3abdf9d5a36d7466d51348f7de386680", + "processing": "Original1220x2712 crop x0/y130/w1220/h2530 only." + }, + { + "file": "before-light.png", + "bytes": 85470, + "sha256": "44e4fb8a489044a261971ffac92c589b9398596f478ac60e610b91aa08160883", + "processing": "Original1220x2712 crop x0/y130/w1220/h2530 only." + }, + { + "file": "oem-after-dark.png", + "bytes": 94632, + "sha256": "dc9e4fd58edf0facc2f5381281cdd6eacfd8761acb248d1ba14eb15b16b44c35", + "processing": "Original1220x2712 crop x0/y130/w1220/h2530 only." + }, + { + "file": "oem-after-light.png", + "bytes": 99131, + "sha256": "c8af61092c92cf5030dec22c1201578b0feea1b0a711263628ffc52abde47164", + "processing": "Original1220x2712 crop x0/y130/w1220/h2530 only." + }, + { + "file": "oem-before-dark.png", + "bytes": 96207, + "sha256": "0ac9276ea31498c7c8521dae4870d8554e1fae87184370e82cdfd91a7291d671", + "processing": "Original1220x2712 crop x0/y130/w1220/h2530 only." + }, + { + "file": "oem-before-light.png", + "bytes": 97892, + "sha256": "d88812dccacf622041125dc1d823781ec7a0ec50e354d4808442631167d0d351", + "processing": "Original1220x2712 crop x0/y130/w1220/h2530 only." + } +] diff --git a/.github/pr-screenshots/2554-android/oem-after-dark.png b/.github/pr-screenshots/2554-android/oem-after-dark.png new file mode 100644 index 0000000000..b8b3c1a6b4 Binary files /dev/null and b/.github/pr-screenshots/2554-android/oem-after-dark.png differ diff --git a/.github/pr-screenshots/2554-android/oem-after-light.png b/.github/pr-screenshots/2554-android/oem-after-light.png new file mode 100644 index 0000000000..0ad1796355 Binary files /dev/null and b/.github/pr-screenshots/2554-android/oem-after-light.png differ diff --git a/.github/pr-screenshots/2554-android/oem-before-dark.png b/.github/pr-screenshots/2554-android/oem-before-dark.png new file mode 100644 index 0000000000..9e7cc1b064 Binary files /dev/null and b/.github/pr-screenshots/2554-android/oem-before-dark.png differ diff --git a/.github/pr-screenshots/2554-android/oem-before-light.png b/.github/pr-screenshots/2554-android/oem-before-light.png new file mode 100644 index 0000000000..0f19b24228 Binary files /dev/null and b/.github/pr-screenshots/2554-android/oem-before-light.png differ diff --git a/apps/mobile/src/ui/chat/conversation-row.tsx b/apps/mobile/src/ui/chat/conversation-row.tsx index da63a3d87b..e977458fec 100644 --- a/apps/mobile/src/ui/chat/conversation-row.tsx +++ b/apps/mobile/src/ui/chat/conversation-row.tsx @@ -190,9 +190,9 @@ export function ConversationRowFrame({ > @@ -206,7 +206,8 @@ export function ConversationRowFrame({ {preview} diff --git a/apps/mobile/src/ui/chat/source-name.tsx b/apps/mobile/src/ui/chat/source-name.tsx index 8e270533fd..a004ca8f64 100644 --- a/apps/mobile/src/ui/chat/source-name.tsx +++ b/apps/mobile/src/ui/chat/source-name.tsx @@ -23,17 +23,21 @@ export function SourceName({ accessible accessibilityLabel={`${name}, ${source === 'cloud' ? t.cloudChannels.cloudChannel : t.computerChannel}`} style={{ - ...(theme.largeText ? { alignSelf: 'stretch' as const } : { flex: 1 }), + flex: 1, minWidth: 0, flexDirection: 'row', alignItems: 'center', gap: space.x2, }} > - + {name} - + {source === 'computer' && look !== undefined ? ( ({ os: 'android', scale: 1 })); +vi.mock('expo-router', () => ({ + Link: () => { + throw new Error('Navigation is outside the conversation row layout fixture'); + }, +})); +vi.mock('react-native', async () => { + const shim = await import('./react-native-shim'); + type Props = Record & { children?: ReactNode }; + const attributes = (props: Props) => ({ + 'aria-label': props.accessibilityLabel as string | undefined, + 'data-style': JSON.stringify( + shim.StyleSheet.flatten( + typeof props.style === 'function' ? props.style({ pressed: false }) : props.style, + ), + ), + }); + return { + ...shim, + Platform: { + get OS() { + return device.os; + }, + }, + useWindowDimensions: () => ({ width: 320, height: 844, scale: 3, fontScale: device.scale }), + View: (props: Props) => createElement('div', attributes(props), props.children), + Pressable: (props: Props) => + createElement( + 'button', + { + ...attributes(props), + onClick: () => (props.onPress as (() => void) | undefined)?.(), + }, + props.children, + ), + Text: (props: Props) => + createElement( + 'span', + { + ...attributes(props), + 'data-lines': props.numberOfLines, + 'data-ellipsis': props.ellipsizeMode, + 'data-scaling': String(props.allowFontScaling), + 'data-maximum': props.maxFontSizeMultiplier, + 'data-fit': String(props.adjustsFontSizeToFit), + }, + props.children, + ), + }; +}); +vi.mock('../src/ui/bot-avatar', () => ({ BotAvatar: () => null })); +vi.mock('../src/ui/chat/group-mark', () => ({ GroupMark: () => null })); +vi.mock('../src/ui/chat/conversation-swipe', () => ({ + ConversationSwipe: ({ children }: { children: ReactNode }) => children, +})); +vi.mock('../src/ui/chat/row-status-glyph', () => ({ + RowStatusGlyph: ({ status }: { status: string }) => + status === 'none' ? null : createElement('i', { 'data-status': status }), +})); +vi.mock('../src/ui/shell/host-tile', () => ({ HostGlyph: () => createElement('i') })); +vi.mock('../src/ui/shell/icons', () => ({ + CloudIcon: () => createElement('i'), + ComputerIcon: () => createElement('i'), +})); + +import { View } from 'react-native'; +import { ConversationRowFrame } from '../src/ui/chat/conversation-row'; +import { useDesignTheme } from '../src/ui/design/theme'; + +Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }); +let root: Root | undefined; +let host: HTMLDivElement | undefined; +afterEach(() => { + act(() => root?.unmount()); + host?.remove(); + root = undefined; +}); + +const title = 'HarborBot — a long conversation title with 中文'; +const preview = '42 — the complete preview remains available when the visible text truncates'; +const label = `${title}, ${preview}`; +const onPress = vi.fn(); + +function Fixture({ time = '12:39', menu = false }: { time?: string; menu?: boolean }) { + const theme = useDesignTheme(); + return ( + + + + + {menu ? ( + + ) : null} + + ); +} + +function render(time = '12:39', menu = false) { + if (!root) { + host = document.createElement('div'); + document.body.append(host); + root = createRoot(host); + } + act(() => root!.render()); + const text = (value: string) => + [...host!.querySelectorAll('span')].find((el) => el.textContent === value)!; + return { view: host!, name: text(title), preview: text(preview), time: text(time) }; +} + +function style(element: Element): Record { + return JSON.parse(element.getAttribute('data-style') ?? '{}'); +} + +describe.each(['android', 'ios'])('Chats row layout contract on %s', (os) => { + it.each([1, 1.3, 2, 3.571])('keeps two lines at scale %s, including beside an action target', (scale) => { + device.os = os; + device.scale = scale; + for (const menu of [false, true]) { + const row = render('12:39', menu); + const source = row.name.parentElement!; + const header = source.parentElement!; + const content = header.parentElement!; + expect(style(header)).toMatchObject({ flexDirection: 'row', alignItems: 'center' }); + expect(style(content)).toMatchObject({ flex: 1, minWidth: 0 }); + expect(style(source)).toMatchObject({ flex: 1, minWidth: 0 }); + expect(style(row.name)).toMatchObject({ flexShrink: 1 }); + expect(style(source.children[1]!)).toMatchObject({ flexShrink: 0 }); + expect(source.getAttribute('aria-label')).toContain(title); + expect(row.name.dataset.ellipsis).toBe('tail'); + expect(row.time.parentElement).toBe(header); + expect(style(row.time)).toMatchObject({ flexShrink: 0 }); + expect(content.children).toHaveLength(2); + expect(row.preview.parentElement).toBe(content.children[1]); + expect(row.preview.parentElement!.querySelector('[data-status="working"]')).not.toBeNull(); + for (const text of [row.name, row.time, row.preview]) { + expect(text.dataset.lines).toBe('1'); + expect(text.dataset.scaling).not.toBe('false'); + expect(text.dataset.maximum).toBeUndefined(); + expect(text.dataset.fit).not.toBe('true'); + } + expect(row.view.querySelector('button')!.getAttribute('aria-label')).toBe(label); + const target = row.view.querySelector('[aria-label="Reserved action target"]'); + expect(target === null).toBe(!menu); + if (target) expect(style(target).width).toBe(os === 'android' ? 48 : 44); + } + }); + + it('omits the timestamp slot without adding an empty metadata line', () => { + device.os = os; + device.scale = 2; + const row = render(''); + const header = row.name.parentElement!.parentElement!; + expect(header.children).toHaveLength(1); + expect(header.parentElement!.children).toHaveLength(2); + expect(row.preview.parentElement).toBe(header.nextElementSibling); + expect(row.view.textContent).not.toContain('12:39'); + onPress.mockClear(); + act(() => row.view.querySelector('button')!.click()); + expect(onPress).toHaveBeenCalledOnce(); + }); +}); diff --git a/changes/2553-chat-row-large-text.md b/changes/2553-chat-row-large-text.md new file mode 100644 index 0000000000..ef28fad5b3 --- /dev/null +++ b/changes/2553-chat-row-large-text.md @@ -0,0 +1,11 @@ +--- +section: Fixed +--- + +## en + +- Fixed mobile Chats rows stacking the timestamp below the title at large system text sizes; the title and time now share one line, with the preview on the second line and full text retained for accessibility ([#2553](https://github.com/BotHarness/BotHarness/issues/2553)). + +## zh + +- 修复手机端聊天列表在大字号下将时间排到标题下方的问题;标题与时间保持同一行,预览位于第二行,并保留完整的无障碍文本([#2553](https://github.com/BotHarness/BotHarness/issues/2553))。