Skip to content

fix: phone touch targets, send and stop names, and the Flow caret - #36

Closed
divyanshub024 wants to merge 5 commits into
fix/thread-settle-fitting-offsetfrom
fix/mobile-touch-targets-and-caret
Closed

fix: phone touch targets, send and stop names, and the Flow caret#36
divyanshub024 wants to merge 5 commits into
fix/thread-settle-fitting-offsetfrom
fix/mobile-touch-targets-and-caret

Conversation

@divyanshub024

@divyanshub024 divyanshub024 commented Aug 29, 2026

Copy link
Copy Markdown
Member

Summary

Mobile fixes from a pass over the example on the iPhone simulator. Stacked on #35 (shared changelog); merge that first.

  • Touch targets. Message actions sit on a 20px frame, the attach, stop, remove and error-dismiss discs on 24 to 32px, the menu triggers on 32, the code block's copy on 24. A finger needs 44 (Apple) to 48 (Material). New FlowTouchTarget widens the hit area on touch platforms without changing layout, sized per site so a neighbour's taps stay its own (siblings hit-test in reverse order, not by distance; the actions row takes its reach downward into the gap between turns). Pointer platforms pass straight through.
  • Send and stop names. The discs had no accessible name; VoiceOver announced an unnamed button. FlowComposer.sendTooltip and stopTooltip name them, as tooltips, which carry the semantics label. Docs and example updated.
  • Caret and selection colour. Nothing set them, so a host installing FlowTheme on a stock ThemeData got Material's purple caret, wash and iOS handles against Flow's primary. New FlowSelectionTheme derives TextSelectionTheme and the Cupertino primary from FlowColors; wraps the chat view and the composer.
  • The example gates its web-only drop and paste callbacks with kIsWeb, which silences the two runtime warnings it logged on iOS.

Screenshots

Before After
Purple caret in the composer (screenshots attached separately) Caret in the Flow primary

How this was verified

  • iPhone 17 Pro simulator, example app, light and dark: caret colour after hot reload; layout unchanged around the message actions, composer row and code block header; XXXL Dynamic Type still lays out.
  • flutter analyze clean at the root and in example/ and playground/; dart format . applied.

Checklist

  • flutter analyze lib and flutter analyze in example/ and playground/ are clean
  • dart format . applied
  • Exercised in the playground — with a stage demo added or updated if this is a new component or variant
  • Any new entry under dependencies: in pubspec.yaml is flutter.dev-published, forces no configuration on hosts that never use the feature, and is argued in this PR
  • Nothing model-facing — no prompts, schemas, or provider/network calls
  • New public API is exported from lib/flow_ui.dart and documented in docs/ and the README table
  • CHANGELOG.md updated for user-facing changes, with breaking changes called out
  • PR title follows conventional commits (feat:, fix:, refactor:, docs:, chore:)

Note

Low Risk
Localized UI/a11y and layout hit-testing on touch; no auth, data, or breaking API beyond optional composer tooltip params.

Overview
Improves mobile usability and accessibility without shifting desktop layout: new FlowTouchTarget (iOS/Android only) reserves larger hit boxes in layout and forwards taps to small controls—message actions, composer attach/send/stop rings, menu triggers, code-block copy, and error dismiss—often by reclaiming footer/row gap so pixels stay on-spec.

Adds FlowComposer.sendTooltip and stopTooltip so VoiceOver gets names for send/stop (documented in composer docs; example sets 'Send' / 'Stop'). FlowSelectionTheme wraps the chat surface and composer so caret, selection wash, handles, and Cupertino primary use Flow primary instead of the host ColorScheme purple.

The example passes kIsWeb-gated drop/paste handlers to avoid iOS runtime warnings. CHANGELOG.md records touch targets, tooltips, and the caret fix.

Reviewed by Cursor Bugbot for commit cb4bad4. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread lib/src/utils/flow_touch_target.dart
@divyanshub024
divyanshub024 force-pushed the fix/mobile-touch-targets-and-caret branch from b4d4d37 to 8edf666 Compare August 30, 2026 07:43
Comment thread lib/src/widgets/flow_message_actions.dart
Comment thread lib/src/widgets/flow_composer.dart Outdated
Comment thread lib/src/widgets/flow_composer.dart
Comment thread lib/src/widgets/flow_composer.dart Outdated
Comment thread lib/src/widgets/flow_message.dart
Comment thread lib/src/widgets/flow_composer.dart Outdated
Comment thread lib/src/widgets/flow_message_actions.dart Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 81c886a. Configure here.

Comment thread lib/src/widgets/flow_composer.dart
@divyanshub024

Copy link
Copy Markdown
Member Author

Folded into #37, which now targets main with these commits unchanged.

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