Skip to content

feat(mobile): outline every text field at 3:1 with a focus ring, and drop the composer shadow - #37221

Merged
AmoabaKelvin merged 5 commits into
mainfrom
sc-input-contrast
Nov 1, 2026
Merged

AmoabaKelvin merged 5 commits into
mainfrom
sc-input-contrast

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44
Prod 19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​198 $\color{#cf222e}{\Huge{\mathbf{−}}}$​124 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​74

ELI5

On the phone, search boxes and form fields didn't look like places you can type, especially in light mode. A white box on a white sheet, or a dark grey box on a slightly different dark grey, just reads as a block. Every plain field now has a clear grey outline in both themes, and a blue ring while you're typing in it. The chat composer and the other composer boxes keep their look, but lose their drop shadow.

What Changed

  • New token inputBorder (#737373) in mobile-theme.ts, both palettes. This is desktop's dark --ring. It reaches 3:1 against every surface a field sits on: screen, sheet and sheet group, light and dark.
  • One shared look for plain fields in composer-input:
    • A 1px inputBorder edge.
    • A 2pt accentBlue ring on focus. It is drawn as border plus a 1px outline, so nothing moves.
    • useInputFocus keeps the focus state and still calls the caller's own onFocus/onBlur.
  • Where the edge and ring show up:
    • TextField. This covers every search field (MobileSearchField, BottomSearchBar, Jump to file, pickers) and every single-line sheet field (new workspace, reviewers, link PR, settings and host edit, quick commands, tasks).
    • The no-controls form of MessageBox: review notes and description boxes.
    • A new FieldTextInput, for fields that set their own size: Create PR title and description, the PR edit sheet, automation fields, the browser's "Type on page" and the custom-key capture box.
    • The terminal's live input, which now uses TextField.
    • These used to be raw TextInputs with their own one-off fills.
  • Composer-style boxes keep the composer look. That means boxes with their own Send/attach/mic controls: the chat composer, the terminal command dock, the Source Control commit box, and PR/task comment and reply composers.
    • The docked drop shadow is gone (Kelvin asked). Its docked style and prop are deleted; only the chat composer and the terminal dock read it.
    • Their composerBorder edge is now 1px instead of a hairline, which matches desktop's composer.
  • The page text-input size census (mobile-web-app-text-input-font-size-seam.mjs) now reads <FieldTextInput> call sites like <TextInput>. It treats the wrapper's forwarded style as checked at those call sites, so every field's font size is still held to the iOS no-zoom seam. There is a fixture case for it.
  • A palette test now holds inputBorder and accentBlue at 3:1 and the placeholder at 4.5:1 on every field surface, in both schemes.

Why

Measured on main, a field's fill and hairline edge were 1.17 to 1.57:1 against the surface they sit on. WCAG 1.4.11 asks for 3:1 for whatever visually identifies a control. The research (in Notes) says the boundary has to carry it: a fill near the sheet tones can't reach 3:1 without turning into a dark block in light mode. The iOS system fills and Material's filled container also fail 3:1 on their own. Material's outlined field and Primer's emphasis border both use a solid 3:1 outline.

The fix sits in the token and the shared field components, not in each screen. Raw-TextInput holdouts moved onto the family, so the next field picks the rule up for free.

Composer-style boxes stay as they are. W3C only requires a boundary "when there is no other visual way to identify the presence of the control". These boxes have Send/attach controls and a 4.7:1 placeholder.

The focus state lives in the component that owns the input. A first version kept it in the parent, and review caught the ring going stale when a focused field unmounted.

Linked Issue

No issue. This is a design build Kelvin asked for: mobile inputs don't clearly read as inputs. It follows the input unification in #36166.

Visual Proof

Each image shows before dark, after dark, before light and after light. All captures are OTA page renders in WebKit at 393×852 @3x.

Search on a screen (bottom search bar), rest and focused
search bar rest
search bar focused

Search in a sheet (review → Jump to file), rest and focused
sheet search rest
sheet search focused

Single-line field in a sheet (Create worktree → Start from), rest and focused
new workspace rest
new workspace focused

Form box in a sheet (review line note), rest and focused
review note rest
review note focused

Create PR sheet, title and description, rest and description focused
create PR rest
create PR focused

Terminal live input
terminal live field

Custom key sheet: text macro fields and shortcut key capture
custom key macro
custom key shortcut

Automations editor fields on a screen
automations editor

Composer-style boxes, unchanged apart from the shadow and the 1px edge: chat composer, commit box, task comment composer
chat composer
commit box
task comment composer

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • I captured every input type above, before and after, in both themes, with a scripted host. That's 17 pairs, focused states included, from pnpm run build:mobile-web, which still reports 181 assets, the same as main.

  • mobile-theme-contrast.test.ts gained a case for field edge, focus ring and placeholder contrast on every field surface. It fails with the old edge colour and passes now.

  • Focused vitest: theme, composer, terminal dock, custom key, PR sidebar, automations and tasks suites, 214 files.

  • Mobile typecheck (mobile/tsconfig.json), plus check:code-quality:changed and check:react-doctor:changed. Lint and format ran on the changed files.

  • No new strings, so localization is untouched. No host-calling code changed, so the RPC goldens don't apply.

  • Native shells weren't captured on a simulator. The same components render there, and RN 0.83's new architecture supports outline* on iOS and Android.

Risk

Level: Low

  • It only changes how things look, on mobile only. No data, settings or wire changes, so mixed host and phone versions don't matter.
  • The riskiest part is the focus ring's outline style. On a native shell that ignored it, the focused field would show a 1pt blue border instead of 2pt. Nothing else changes.
  • Removing the composer shadow also removes Android's elevation on the chat and terminal composers. Those boxes now sit flat with their 1px edge.
  • A plain revert backs all of it out.

AI Disclosure

Review

Codex and a Claude subagent each ran one review round (review-loop). Neither found a P0 or P1.

  • Both reviewers, P2: the focus state lived in parent components, so a field that unmounted while focused came back with a stale ring. This is fixed: state now lives in FieldTextInput/TextField.
  • Claude, P3: Chromium web pages would draw a second, browser-made ring inside wrapped fields. Fixed by turning that outline off on the inner text.

The simplify pass did two things:

  • Applied: one shared edge() helper; MessageBox passes focus handlers straight through when it has its own controls, so there are no wasted re-renders.
  • Not applied: moving FieldTextInput's sites onto TextField/MessageBox. That would resize approved sheets. The PR description would shrink from 160–320 pt to 70–154 pt, and the browser input would grow from 34 to 44 pt. That's a separate design call.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Research (primary sources)

Measured contrast, before → after (plain fields)

Theme Surface Fill vs surface Edge before Edge after Focus ring Placeholder on fill
dark screen #0a0a0a 1.20 1.57 4.18 5.38 4.71
dark sheet #171717 1.09 1.42 3.78 4.87 4.71
dark sheet group #262626 1.09 1.20 3.19 4.11 4.71
light screen #ffffff 1.00 1.27 4.74 5.17 5.49
light sheet #f5f5f5 1.09 1.17 4.35 4.74 5.49
light sheet group #ffffff 1.00 1.27 4.74 5.17 5.49

"Edge before" is the hairline composerBorder composited over the fill.

Composer-style boxes (finding, not changed)

  • Without the shadow, the composer edge (composerBorder, now 1px, same colour as desktop's composer border) is 1.57:1 (dark) and 1.27:1 (light) on the screen. It does not meet 3:1.
  • Their fill doesn't separate in light mode either. It is white on a white screen (1.00:1); dark is 1.20:1.
  • They pass 1.4.11 through their controls (Send/attach/mic) and placeholder (4.71 dark / 5.49 light). The edge is visible at full size, but faint in light mode.
  • If Kelvin wants them to separate more, the options are a stronger composerBorder or giving composers inputBorder too. That's a product call, left out of this PR.

Try it (waiting for blessing)

  • On a paired phone, open a workspace list and tap the bottom search bar. At rest it has a grey outline in light and dark; while you type, a blue ring.
  • Open Source Control → Pull request → Create pull request, and tap Description. The field gets the blue ring, and Title keeps its grey outline. The commit box and chat composer have no drop shadow and keep their composer look.
  • Worktree for a dev build: /Users/kelvinamoaba/orca/workspaces/orca/sc-input-contrast (run pnpm run build:mobile-web to serve the pages).

Shared pieces other branches pick up

inputBorder (mobile-theme.ts); composerInputStyles.focused / fieldInput; FieldTextInput and useInputFocus (composer-input). MessageBox no longer has a docked prop.

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Fields with no controls of their own were told apart from their surface
only by a fill and a hairline at 1.17-1.57:1, so search fields and sheet
fields read as flat blocks. They now share an inputBorder edge (#737373,
3.19-4.74:1 on screen, sheet and sheet group in both themes) and a 2pt
accent ring on focus. Composer-style boxes keep their look, lose the
docked shadow, and draw their edge at 1px like desktop's composer.
A focus flag held by a parent outlived the input when a step or tab swap
unmounted it while focused, so the field came back with a stale ring.
Raw holdouts now use FieldTextInput and the terminal live field uses
TextField, so focus state mounts and unmounts with the input.
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9497e367-3039-48ff-9665-d8d7d4afa3e8
Commits

Reviewing files that changed from the base of the PR and between b87d18c and df70a71.

Files selected for processing: 19
  • mobile/src/automations/AutomationControls.tsx
  • mobile/src/automations/automation-styles.ts
  • mobile/src/browser/MobileBrowserPaneView.tsx
  • mobile/src/browser/mobile-browser-pane-styles.ts
  • mobile/src/components/CustomKeyModal.styles.ts
  • mobile/src/components/CustomKeyModal.tsx
  • mobile/src/components/composer-input/FieldTextInput.tsx
  • mobile/src/components/composer-input/MessageBox.tsx
  • mobile/src/components/composer-input/TextField.tsx
  • mobile/src/components/composer-input/composer-input-styles.ts
  • mobile/src/components/composer-input/use-input-focus.ts
  • mobile/src/components/pr-sidebar/MobilePrTabSheets.tsx
  • mobile/src/components/pr-sidebar/PrCreateSheet.tsx
  • mobile/src/components/pr-sidebar/pr-tab-styles.ts
  • mobile/src/session/MobileSessionCommandDock.tsx
  • mobile/src/session/mobile-session-command-input-styles.ts
  • mobile/src/session/native-chat/composer/mobile-native-chat-composer-styles.ts
  • mobile/src/theme/mobile-theme-contrast.test.ts
  • mobile/src/theme/mobile-theme.ts
Files with no reviewable changes: 5
  • mobile/src/components/CustomKeyModal.styles.ts
  • mobile/src/components/pr-sidebar/pr-tab-styles.ts
  • mobile/src/automations/automation-styles.ts
  • mobile/src/session/mobile-session-command-input-styles.ts
  • mobile/src/browser/mobile-browser-pane-styles.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Walkthrough

Mobile input components now share focus handling and input styling. Automation, browser, shortcut-key, and pull-request forms use FieldTextInput. The session command input uses TextField, and the command and chat composers no longer apply docked styling. Both mobile palettes add an input-border color, with contrast tests for the border, accent, and muted text.

Merge Risk: Minimal · up to df70a

The change adds shared field borders and focus styling and removes composer shadows. No merge-blocking issue was established.

Pre-merge checks: Passed 3 · Failed 1 · Inconclusive 1

Failed Failed checks: 1 warning · 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Inconclusive The description follows most of the repository template. It has an ELI5, What Changed, Why, Visual Proof with before and after images, Testing with checked boxes, Risk with a Low level and a rollback … 1. Linked Issue: Add a link to an existing issue with 'Fixes #', or confirm that the author is a maintainer who does not need one. The text currently says 'No issue' and cites #36166 only as related work. 2. AI Disclosure: Confirm w…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the primary changes: adding outlines and focus rings to mobile text fields and removing the composer shadow.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 9 functions across 14 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Description check

Explanation

The description follows most of the repository template. It has an ELI5, What Changed, Why, Visual Proof with before and after images, Testing with checked boxes, Risk with a Low level and a rollback path, a filled Review section, the upstream boundary checkbox, and Notes. Two sections are incomplete. The Linked Issue section says 'No issue' and has no 'Fixes #' reference. The template says outside contributors must link an actual issue, and this PR cites #36166 only as related context. The AI Disclosure section is empty. The author appears to be a maintainer (Kelvin), so the empty AI Disclosure may be acceptable, but the template still asks for it to be filled in unless the author is a StablyAI team member. The lint, typecheck, test, and build checklist item is unchecked, which the author should confirm or explain before merge.

Resolution

  1. Linked Issue: Add a link to an existing issue with 'Fixes #<number>', or confirm that the author is a maintainer who does not need one. The text currently says 'No issue' and cites #36166 only as related work. 2. AI Disclosure: Confirm whether the author is a StablyAI team member. If not, state which AI model, if any, was used. 3. Checklist: Run or confirm 'pnpm lint', 'pnpm typecheck', 'pnpm test', and 'pnpm build', then check the item. The PR currently reports only focused Vitest runs and a mobile typecheck, and it does not report a full lint or build run.
Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…nsus

FieldTextInput forwards its style to the TextInput inside, so the census
saw an unresolved style there and lost sight of the call sites' sizes.
It now reads FieldTextInput tags like TextInput and treats the wrapper's
forwarded style as checked at those call sites.
@AmoabaKelvin
AmoabaKelvin merged commit 03abca6 into main Nov 1, 2026
44 of 45 checks passed
@AmoabaKelvin
AmoabaKelvin deleted the sc-input-contrast branch November 1, 2026 23:39
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