Files
orca/mobile/src/mobile-web-shell/ShellDevFacts.tsx
Kelvin Amoaba a079f51991 feat(mobile): unify corner radii across the app (#36437)
* feat(mobile): give every corner one of three shapes

Corners had drifted to 17 different radii, so a screen mixed 6 pt
buttons, 14 pt cards, 12 pt groups and 4 pt badges. Every corner now
comes from the shape of what it is:

- control (12): anything you tap — buttons, icon buttons, fields,
  pickers, segmented controls, key caps.
- surface (16): anything that holds content — cards, groups, sheets,
  banners, code boxes. Dialogs and the composer box use floating (24).
- pill: badges, chips, status pills, dots, avatars and the composer's
  own round buttons.
- tile (10) for icon squares and mark (4) for inline code and check
  squares; nested shapes take the parent's radius minus the gap.

Every rounded style also asks for the continuous (squircle) corner
curve; iOS draws it, Android and the web ignore it.

* fix(mobile): keep circles and pills on the circular corner curve

The continuous curve squares off a corner radius that reaches half the element's size, so the FAB, dots, avatars and the composer's round buttons stopped being round on iOS.

* fix(mobile): put the anchored detail card on the surface radius

* fix(mobile): keep the circular curve on unclipped bordered styles

React Native strokes an unclipped visible border on a circular path while it fills the background with the continuous curve, so the two edges drifted apart at the corners.
2026-10-30 21:27:30 +00:00

48 lines
1.4 KiB
TypeScript

import { Text, View } from 'react-native'
import { colors, radii, spacing, typography } from '../theme/mobile-theme'
import { themedStyleSheet } from '../theme/themed-styles'
import { useMobileColorScheme } from '../theme/use-mobile-color-scheme'
import type { MobileWebShellSessionState } from './mobile-web-shell-session-contract'
import { formatMobileWebShellDevFacts, isDevelopmentBuild } from './mobile-web-shell-dev-facts'
export function ShellDevFacts({
state,
droppedBinaryFrames
}: {
state: Extract<MobileWebShellSessionState, { kind: 'ready' }>
droppedBinaryFrames: number
}) {
useMobileColorScheme()
if (!isDevelopmentBuild()) {
return null
}
return (
<View style={styles.devFacts} pointerEvents="none">
<Text style={styles.devFactsText} testID="mobile-web-shell-dev-facts">
{formatMobileWebShellDevFacts({
buildId: state.buildId,
totalBytes: state.totalBytes,
elapsedMs: state.elapsedMs,
droppedBinaryFrames
})}
</Text>
</View>
)
}
const styles = themedStyleSheet(() => ({
devFacts: {
position: 'absolute',
left: spacing.sm,
bottom: spacing.sm,
paddingHorizontal: spacing.sm,
paddingVertical: 2,
borderRadius: radii.pill,
backgroundColor: colors.bgPanel
},
devFactsText: {
fontSize: typography.metaSize,
color: colors.textMuted
}
}))