Skip to content

Make the UI follow Material 3 Expressive - #8

Closed
Tarquinen wants to merge 18 commits into
sync/ios-3d50fd74from
ui/material-native
Closed

Tarquinen wants to merge 18 commits into
sync/ios-3d50fd74from
ui/material-native

Conversation

@Tarquinen

Copy link
Copy Markdown
Member

Summary

Makes the app look like a Material 3 Expressive Android app instead of an iOS port, based on an audit against Material guidelines and apps like Messages and Gemini. Stacked on #5, so this diff only shows the UI changes.

  • Design system:
    • Material 3 type scale: body 16sp, buttons and menus labelLarge, instead of iOS's 17sp semibold.
    • Material 3 corner scale.
    • Buttons are 40dp, or 56dp for main actions.
    • Destructive buttons use the error colour.
  • Drawer:
    • 56dp rows with round active indicators.
    • A Material search bar.
    • A "New Session" extended FAB.
    • Settings and Call move to the header.
    • A modal sheet with a scrim.
  • Composer and model picker:
    • Agent and model are outlined assist chips that fit at large font sizes.
    • One Picker has a scrim, a selected row and a level chip.
    • The + menu uses a Material container and a place pin for Location.
  • Transcript:
    • Code blocks and display math sit on rounded cards with a language label and a copy button.
    • Jump to Latest is a small FAB.
    • iOS-style row chevrons are gone.
  • Screens:
    • The in-app browser uses a Custom Tab-style top bar with an overflow menu and an Ask FAB.
    • The image viewer's controls always use dark colours.
    • Call controls are Material 3 Expressive toggle buttons, with a red End button.
    • The connect screen and manual server form use filled and tonal buttons and a dialog header.
  • Settings and menus:
    • What's New tiles are tonal, and row chevrons are gone.
    • The Rename dialog uses standard Cancel/Rename actions.
    • Export opens a submenu in place.
    • Two iOS-only experiment names are reworded for Android ("Background Call Shortcut", "Session Live Updates").

Notes

  • Each change has an Android divergence note in its parity row. Behaviour and copy still match iOS, apart from the dialog and menu layouts above.
  • Some M3 Expressive APIs used here are experimental in material3 1.5.0-beta02.

Testing

  • scripts/check.sh passes.
  • Checked on a Galaxy S24 Ultra at font scale 1.15: drawer, search, Settings, What's New, Rename dialog, Export submenu, One Picker, composer chips, image viewer.
  • Not checked on a device: the in-app browser, voice call controls, Catch Up, and the connect screen.

Code blocks ran edge to edge between hairlines with no language or copy
control (iOS's band). On Android they now sit on CodeBlockCard: a 12 dp
(M3 medium shape) surfaceContainer card in the prose column, with a header
holding the language (labelMedium) and a content_copy icon button that
sends TranscriptAction.CopyTextTapped (SessionFeature plays Haptic.tap and
writes the clipboard; the Markdown file viewer now handles it too) and
shows a checkmark / "Copied" for 1.5 s, as Android chat apps do
(m3.material.io/components/cards, /icon-buttons). Display math uses the
same card without a header; a --- divider stays in the prose column.
Tables keep the full-width band. Horizontal scroll and edge fade, syntax
highlighting, reply selection and the drag-out (now rounded 12 dp) are
unchanged.

Verified: :feature:transcript:compileDebugKotlin.
…tom edge

- The subagent card, a tool row's Open-file row and agent file cards lose
  iOS's trailing chevron: Material list items that open something carry
  none (m3.material.io/components/lists). Time-based files keep play.
- Jump to Latest is an M3 SmallFloatingActionButton (secondaryContainer,
  lowered elevation; m3.material.io/components/floating-action-button)
  instead of a grey 34 dp circle; presence spring, slot collapse, borrowed
  drags, test tag and TalkBack label are unchanged.
- The transcript list draws a soft bottom scroll edge: rows fade into the
  canvas from just above the floating composer, so text no longer shows
  around its corners or under the gesture bar (06-session-tools-expanded).
  It is one draw on the list (no per-row state), standing in for
  SwiftUI's automatic soft scroll edge on iOS.
- Hard-coded colours: the link-preview video badge uses inverseSurface /
  inverseOnSurface; the shared-location pin uses error over onError.
- The agent file viewer's back button uses SFSymbol.ChevronBackward
  (arrow_back) like other top bars.

Verified: compileDebugKotlin for :feature:transcript, :feature:media,
:feature:session.
The Save/Share pill used surfaceContainerHighest (light grey in the light
theme) with white icons, near invisible, and Close was a light grey
circle on black. The viewer is always over a black backdrop, so it now
runs inside OpenCodeTheme(appearance = Dark) with the reader's theme:
Close is a dark FilledTonalIconButton, Save/Share sit on a
surfaceContainerHigh pill with onSurface icons, the title and detail use
onSurface/onSurfaceVariant, and the loading spinner uses the default M3
colour (m3.material.io/styles/color/roles). Paging, zoom, the flight,
TalkBack-visible controls and every action are unchanged; the body was
only re-indented under the theme.

Verified: :feature:media:compileDebugKotlin.
The browser was laid out like Safari: a floating 44 dp round back button
over the page and a bottom capsule with back/forward chevrons, the title,
Share and Open in Browser. It now follows Chrome Custom Tabs
(developer.chrome.com/docs/android/custom-tabs) with M3 components:
- a TopAppBar (surfaceContainer) with a close X ("Back to Session"),
  the title (titleMedium) over the lock/host, still tapping to scroll to
  the top, and an overflow DropdownMenu with Back, Forward (enabled from
  the page's history), Share (LinkShareSheet) and Open in Browser;
- Ask as an ExtendedFloatingActionButton (m3.material.io/components/
  extended-fab) that folds to a Cancel FAB while the Ask composer is up
  beside it; the reply capsule sits in the same spot.
Every action still goes through BrowserFeature; the back gesture
(browserBackAction), ⌘[ / Ctrl+[ close, the page's obscured insets (now
the 64 dp bar and the FAB row) and test tags are unchanged.
BrowserMetrics.controlSize is 48 dp (M3 touch target).

Verified: :feature:media:compileDebugKotlin.
The call's controls were custom-drawn circles with an inverted "on"
state, a generic Button role and a hard-coded white glyph on End. They
are now M3 Expressive icon buttons with the press/checked shape morph
(m3.material.io/components/icon-buttons, as the Pixel Phone app does):
- Mute: FilledTonalIconToggleButton with toggleableShapes; TalkBack
  reads it as a toggle named Mute, checked while muted (iOS relabels it
  Unmute);
- End (card and the capsule): FilledIconButton in error / onError;
- the placeholder controls: FilledTonalIconButton, disabled.
M3 disabled colours replace the custom 35% dim; the glyph crossfade
stays. Minimize is an IconButton with close_fullscreen instead of the
trailing iOS chevron. Hard-coded white: the call log's swipe-to-delete
uses error / onError, the provider's needs-a-key badge is an error
badge; the brand tile and the replay timeline's track labels keep white
on their fixed colours (commented). VoiceCallSurfaceDefaults.tertiaryFill
is removed (unused). The Living Orb, placement, drag, and every
action are unchanged.

Verified: :feature:voice:compileDebugKotlin.
The type, corner and button metrics were iOS's (17 sp semibold body and
buttons, 6/10/14/20/28 corners, 52 dp buttons with white destructive
text), so every Android screen looked heavy and iOS-shaped.

- OpenCodeTypography is the M3 baseline type scale
  (m3.material.io/styles/typography/type-scale-tokens). OpenCodeTextStyles
  keeps its iOS names but each maps to the nearest M3 role
  (body/callout -> bodyLarge 16/24, subheadline -> bodyMedium,
  headline -> titleMedium, footnote/caption1 -> bodySmall, ...), so every
  call site follows.
- OpenCodeShapes is M3's corner scale 4/8/12/16/28
  (m3.material.io/styles/shape/corner-radius-scale); OpenCodeRadius
  follows it.
- OpenCodePrimary/SecondaryButton use M3 button sizes
  (m3.material.io/components/buttons/specs): 40 dp default, new
  OpenCodeButtonSize.Medium (56 dp) for hero CTAs, ButtonDefaults padding,
  textStyleFor (labelLarge) and the expressive shapesFor shapes.
  Destructive is error/onError. The size param is trailing and defaulted,
  so existing call sites compile unchanged.
- Gallery and core-ui.md parity rows updated.

Verified: :core and :app compileDebugKotlin.
…ttons and dialog header

- Connect screen: Scan Pairing Code is a filled primary medium (56 dp)
  button and Enter a Server Manually a tonal one, replacing iOS's white
  and grey capsules (m3.material.io/components/buttons).
- Manual server form: the iOS sheet header (Cancel text button, centred
  title, capsule Connect with an arrow) becomes the M3 full-screen dialog
  header (close X labelled Cancel, start-aligned title) with a filled
  medium Connect button (m3.material.io/components/dialogs/specs).
- Onboarding (Welcome, playground pages): CTAs use the theme primary and
  tonal medium buttons with the M3 label style, not label-coloured 52 dp
  pills with 17 sp semibold text.
- Request dock permission buttons use ButtonDefaults' default size,
  padding and expressive shape instead of a private 14 dp radius; the
  label text comes from the button (labelLarge).
- Parity rows in app.md, settings.md and composer.md note the changes.

Behaviour, actions and copy are unchanged.
Verified: :app, :feature:settings, :feature:composer compileDebugKotlin.
…, Android names for two experiments

- What's New entry tiles: 40 dp M3 tonal containers (primary/secondary/
  tertiary container picked from the tint's colour family, on-container
  glyph) instead of saturated iOS Settings squares with white glyphs
  (M3 colour roles: https://m3.material.io/styles/color/roles).
- Server Details tiles lose the iOS trailing chevron (Android Settings rows
  have none); capsule actions use primary/onPrimary, inverseSurface,
  secondaryContainer and surfaceContainerHighest with labelLarge instead of
  blue/Color.White; tile, banner and tray corners use the M3 card radius.
- Voice key row and Voice Provider "Unavailable" disclosure: an expand arrow
  that flips 180° instead of a trailing chevron.right turning 90°.
- Experimental: "Background Action Button Call" -> "Background Call Shortcut"
  (Android has no Action button; the switch gates the Start Voice Call in
  Background shortcut/App Action), "Session Live Activity ... Lock Screen" ->
  "Session Live Updates / Follow runs in a live notification" (it posts a
  promoted ongoing notification). Raw values and storage keys unchanged; the
  matching What's New entry follows the new name.
- Parity notes appended to the settings.md rows.

Verified: ./gradlew :feature:settings:compileDebugKotlin (no emulator on
this machine).
- Rename dialog: Cancel and Rename are the dialog's two actions (dismiss/
  confirm) and Auto Rename is an icon text button (sparkles) under the field,
  instead of three stacked iOS-alert buttons
  (https://m3.material.io/components/dialogs/guidelines). Same copy, same
  actions, clear button kept.
- Session ⋮ menu: Export opens a cascading submenu (Markdown, JSON) marked
  with a trailing arrow_right, instead of expanding inline with a
  chevron-down (https://m3.material.io/components/menus/guidelines).
- New icon SFSymbol.ArrowtriangleRightFill -> ms_arrow_right (list + fetch
  script + core-ui.md row).
- Parity notes on the SessionSheetView/SessionView+Header rows.

Verified: ./gradlew :feature:session:compileDebugKotlin (no emulator on
this machine).
ExperimentalFeatureTests.everyExperimentHasACopyForSettings caps summaries
at six words; the Android summary had nine. iOS's 'Calls start without
opening the app' is accurate on Android too, so only the title diverges.

Verified: scripts/check.sh :core :app :feature:settings :feature:session
:feature:composer (BUILD SUCCESSFUL).
The + menu's popover now uses the M3 menu container (surfaceContainerHigh with
MenuDefaults.ShadowElevation, level 2), so it stands off the canvas in dark mode
instead of blending in (https://m3.material.io/components/menus/specs). No scrim:
M3 menus don't use one. Location now shows Material's location_on place pin
(new SFSymbol.Mappin, appended to the enum) instead of near_me, the iOS location
arrow; SFSymbol.Location keeps its mapping for its other uses.

Verified: :feature:composer:compileDebugKotlin.
The model chip was plain text with no affordance. It is now an M3 assist chip
(https://m3.material.io/components/chips/specs): a 32 dp outlined container
(AssistChipDefaults.Height/shape/assistChipBorder), labelLarge label, the level
word in onSurfaceVariant and an 18 dp arrow_drop_down, with the ripple drawn on
the chip while the 48 dp target (still lowered by pickerTargetDrop), TalkBack
slider semantics and chipFrame reporting are unchanged. Only the model name
ellipsizes; the level word and arrow always show, the arrow right after the word.

Width: fixed parts are 8+16+6+4+level+4+18+4 dp (~95 dp with "High" at font
scale 1.15); on a 384 dp screen the leading row leaves the chip ~200 dp, or ~135 dp
with the experimental agent chip, so the name keeps at least a few letters.

Verified: :feature:composer:compileDebugKotlin.
The open picker had no scrim, no row showed the current model, and the
thinking level read as grey supporting text rather than a control.

- Backdrop: OnePickerGlassBackdrop draws colorScheme.scrim at
  BACKDROP_DIM (now 0.32, the M3 modal bottom sheet scrim) times the
  pose's backdropStrength, so it fades with the open/close morph
  (m3.material.io/components/bottom-sheets).
- Current row: secondaryContainer fill with onSecondaryContainer name
  and mark, the M3 selected list item (m3.material.io/components/lists).
- Level: an M3 AssistChip (label, optional arc, 18dp arrow_drop_down)
  anchoring the existing levels DropdownMenu; semantics, custom
  Higher/Lower actions and the test tag are unchanged.

Parity rows for OnePickerListView/Surface/Tunables note the divergence.
Verified: :feature:composer:compileDebugKotlin.
Moves the drawer from iOS chrome to the Material 3 navigation drawer
(m3.material.io/components/navigation-drawer/specs, /search, /badges,
/extended-fab):

- Rows are 56 dp with a full-round secondaryContainer indicator for the
  selected session (was 44 dp / 10 dp radius, below the 48 dp minimum);
  insets follow the M3 drawer (edge 12, text 16, trailing 24).
- Search is an M3 search bar: the search icon button opens a full-width
  field with a leading back arrow that ends search and a trailing clear
  X; the separate round Cancel Search button is gone. Server search and
  paging are unchanged.
- New Session is an ExtendedFloatingActionButton (primaryContainer) at
  the bottom end; the list's bottom padding clears it. Settings and the
  call button move to header icon buttons; the call button keeps its
  show/hide rules and its floatingCallDrawerButton landing anchor.
- The phone's modal drawer is surfaceContainerLow (ModalDrawerSheet) via
  a new LocalDrawerSurface, so it stands off the content under the scrim
  in dark mode; the existing 16 dp end corners and scrim stay. The
  sidebar keeps the canvas.
- The menu button's dot uses badge roles (error for needs input,
  primary for unread) instead of hard-coded iOS orange/blue.
- White on coloured fills: on-colours for the session cell tint and the
  Inbox swipe backgrounds (primary/tertiary); Catch Up's swipe ink is a
  named onToneColor; the All Caught Up sweep drops its white sheen and
  glint.

TuningTests.defaultsAreWhatShipped updated on purpose for the new row,
inset, corner and footer metrics. Parity notes added to drawer.md.

Verified: scripts/check.sh :feature:drawer :feature:composer
:feature:session :core (assemble, lint, unit tests) passes. No emulator
run (machine short on RAM).
…al 3 type scale

The design-system change moved OpenCodeTextStyles to Material 3, but the transcript's own
typography tunables still defaulted to SF's 17 pt body, and a few composer spots hard-coded 17.

- Transcript body defaults to 16 sp with 3.5 sp leading (a ~24 sp line, Material 3 bodyLarge);
  Used N / Working follow at 16 sp; headings below H3 and display math use 16 sp.
- Question dock buttons label in labelLarge instead of 15 pt semibold.
- The autocomplete chip flight starts from the composer's body size instead of a literal 17.

MarkdownBlockTests' typography-default assertions updated to the new values on purpose.
Verified: full scripts/check.sh (all modules) passes.
… in place

The model chip was cut to "Op…" at font scale 1.15: the provider logo
and drop-down arrow took the room. Both chips are now matching outlined
M3 assist chips (32 dp, labelLarge) with no logo or arrow, so "Opus
High" fits. The Export submenu opened a second menu over the first; it
now replaces the menu's content with a back row, Markdown and JSON.

Verified: scripts/check.sh :feature:composer :feature:session; on the
phone (SM-S928U1, font scale 1.15) the chips read "Good" and
"Opus High" and the Export submenu replaces the menu.
…UI work

Brings Ryan's #3, #4, #6 and #7 into the Material 3 branch through PR #5.

Conflicts kept both sides: main's TalkBack, touch and focus fixes with this
branch's Material styling (Jump to Latest as a small FAB on main's touch
tracking, the Export submenu in main's non-focusable menu, the level word
ellipsizing inside the outlined model chip, the Catch Up swipe glyph on its
tone colour, the transcript's row exits with the soft bottom edge).

Verified: scripts/check.sh passes for every module; ios-sync check 0 errors;
parity test totals match Gradle.
The outlined assist-chip look read as heavy next to the message field. Both
chips are now plain labelLarge text whose press ripples a 32 dp capsule, like
an M3 text button; padding goes 12 -> 8 dp. The fit fix (no arrow, level word
ellipsizes) is unchanged.

Verified: scripts/check.sh :feature:composer passes; on the phone (fast build)
the chips read "Good" and "Opus High" with no outline.
@Tarquinen

Copy link
Copy Markdown
Member Author

Closing: the useful fixes from this PR were ported onto the desktop design in #26, and the Material 3 Expressive styling is superseded by the desktop restyle (#21).

@Tarquinen Tarquinen closed this Nov 10, 2026
Tarquinen added a commit that referenced this pull request Nov 10, 2026
Polish: fixes from #8 in the desktop look
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant