diff --git a/app/lib/features/chat/conversation/chat_thread_header.dart b/app/lib/features/chat/conversation/chat_thread_header.dart index 8ca533a5..f4e871af 100644 --- a/app/lib/features/chat/conversation/chat_thread_header.dart +++ b/app/lib/features/chat/conversation/chat_thread_header.dart @@ -12,6 +12,8 @@ import '../ui/sessions/chat_adaptive.dart'; /// pill with the conversation's title and folder that opens the chat's /// information, a selector island holding [controls] (model and mode), /// then the Files action and a native More menu in a separate island. +/// Narrow panes give readable model/mode values a separate row; exceptionally +/// short viewports can scroll the header to keep controls reachable. class ChatThreadHeader extends StatelessWidget { const ChatThreadHeader({ super.key, @@ -50,7 +52,9 @@ class ChatThreadHeader extends StatelessWidget { chatControlsStyleOf(context) == ChatControlsStyle.cupertino; return LayoutBuilder( builder: (context, constraints) { - final narrow = constraints.maxWidth < 800; + final textScale = MediaQuery.textScalerOf(context).scale(14) / 14; + final readableWidth = constraints.maxWidth / textScale; + final narrow = readableWidth < 800; final bar = SegmentedBar( cupertino: cupertino, automaticallyImplyLeading: false, @@ -121,7 +125,7 @@ class ChatThreadHeader extends StatelessWidget { child: _ControlIsland( key: const Key('chat-model-permission-island'), fill: true, - vertical: constraints.maxWidth < 340, + vertical: readableWidth < 340, children: controls, ), ), diff --git a/app/lib/ui/adaptive/floating_destination_bar.dart b/app/lib/ui/adaptive/floating_destination_bar.dart index d0ce7b42..a9bf07c4 100644 --- a/app/lib/ui/adaptive/floating_destination_bar.dart +++ b/app/lib/ui/adaptive/floating_destination_bar.dart @@ -24,7 +24,8 @@ import 'floating_destination_labels.dart'; /// button pops in on its own, staggered, when the bar appears or its set of /// tabs changes, never when only the selection does. /// -/// The buttons show icons only. Each tab's label stays its accessible name +/// Page tabs show icons only by default; [showLabels] gives main navigation +/// visible, scalable captions. Each tab's label stays its accessible name /// (and the Material tooltip), announced as a selectable tab with "tab n of /// m" the way the platform navigation controls announce theirs (see /// [FloatingTabButton]); the icons must be distinct within a bar. The diff --git a/app/lib/ui/adaptive/floating_destination_labels.dart b/app/lib/ui/adaptive/floating_destination_labels.dart index 43015d18..92caa3c4 100644 --- a/app/lib/ui/adaptive/floating_destination_labels.dart +++ b/app/lib/ui/adaptive/floating_destination_labels.dart @@ -56,22 +56,24 @@ class FloatingDestinationLabels extends StatelessWidget { key: ValueKey('destination-label-${labels[index]}'), excludeFromSemantics: true, onTap: () => onTap(index), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - buttonBuilder(index), - ExcludeSemantics( - child: Text( - labels[index], - style: style.copyWith( - color: color, - fontWeight: index == selected - ? FontWeight.w600 - : style.fontWeight, + child: TextFieldTapRegion( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + buttonBuilder(index), + ExcludeSemantics( + child: Text( + labels[index], + style: style.copyWith( + color: color, + fontWeight: index == selected + ? FontWeight.w600 + : style.fontWeight, + ), ), ), - ), - ], + ], + ), ), ), ], diff --git a/app/lib/ui/adaptive/segmented_bar_overlay.dart b/app/lib/ui/adaptive/segmented_bar_overlay.dart index efc8432b..4884877b 100644 --- a/app/lib/ui/adaptive/segmented_bar_overlay.dart +++ b/app/lib/ui/adaptive/segmented_bar_overlay.dart @@ -6,7 +6,8 @@ import 'package:flutter/widgets.dart'; /// [child] fills the whole area and scrolls behind the bar; it learns the /// bar's measured height (status-bar inset included) as its /// [MediaQuery.paddingOf] top, so a list can pad its first item below the bar -/// at rest. Taps the bar does not take reach [child]. +/// at rest. [reserveSpace] instead gives reading content its own clipped +/// viewport below the bar. Taps the bar does not take reach [child]. class SegmentedBarOverlay extends StatelessWidget { const SegmentedBarOverlay({ super.key, diff --git a/app/notes/chat-ui-clarity.md b/app/notes/chat-ui-clarity.md new file mode 100644 index 00000000..3ce30e4e --- /dev/null +++ b/app/notes/chat-ui-clarity.md @@ -0,0 +1,37 @@ +# Chat UI clarity follow-up + +Addresses the independent screenshot review of the populated chat workspace. + +- Mobile inactive panes have a persistent chat title and explicit Switch action, + a divider grip, and a separate transcript viewport. Remembered peek bounds and + Tape default are preserved. +- Code blocks and tables expose actual horizontal overflow with native persistent + scrollbars, a directional cue, keyboard focus/arrows and semantic actions. +- Chat headers reserve their own viewport rather than covering scrolling content. + Model and permission values remain readable in narrow panes and with enlarged + text. Exceptionally short headers scroll to keep controls reachable. +- Chat identity colors remain stable; Active/Visible and Working/background/New + are separate textual or shaped states. Compact rows retain attention badges, + identity initials and full-context tooltips. Tested metadata/state contrast is + at least 4.5:1 across 64 native palette/identity combinations; this is not a + complete accessibility audit. +- Main navigation has captions. Compact chat navigation exposes a labeled Menu + with all destinations and returns without discarding chat state or drafts. + Caption taps preserve text-field focus. + +## Verification + +- Integration: 1,578 tests passed across chat, settings, motion, adaptive UI, + shell and application (`/tmp/memwatch/out.ouMreH`). +- Final header/text-scale and caption-focus changes: 13 tests passed + (`/tmp/memwatch/out.EtZ7az`). Final analyzer clean (`flutter-analyze.TyE0Cf`). +- Real browser full-app fake-gateway captures: Material dark mobile and desktop, + Material light desktop and Cupertino light mobile. Compact Menu navigation, + Tape switching and inactive transcript bottom were exercised. Fixtures only; + no real chats or runs were modified. +- Captures: `/tmp/review/chat-clarity-desktop-reviewed`, + `/tmp/review/chat-clarity-light`, `/tmp/review/chat-clarity-phone`, + `/tmp/review/chat-clarity-cupertino`. +- No native device test or installation was performed. The personal Fold remains + delivery-only. Web and APK deployment are tracked separately from code checks; + these client changes require no server restart. diff --git a/app/test/features/chat/conversation/chat_thread_header_test.dart b/app/test/features/chat/conversation/chat_thread_header_test.dart index fcda068e..8192bf50 100644 --- a/app/test/features/chat/conversation/chat_thread_header_test.dart +++ b/app/test/features/chat/conversation/chat_thread_header_test.dart @@ -199,7 +199,7 @@ void main() { final actions = find.byKey(const Key('chat-actions-island')); expect(selectors, findsOneWidget); expect(actions, findsOneWidget); - if (width >= 800) { + if (width / 2 >= 800) { expect( tester.getTopRight(selectors).dx, lessThan(tester.getTopLeft(actions).dx), diff --git a/app/test/ui/adaptive/floating_destination_labels_test.dart b/app/test/ui/adaptive/floating_destination_labels_test.dart new file mode 100644 index 00000000..619bf449 --- /dev/null +++ b/app/test/ui/adaptive/floating_destination_labels_test.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:pipelines_app/ui/adaptive/floating_destination_bar.dart'; + +void main() { + testWidgets('caption clicks select once and preserve text-field focus', ( + tester, + ) async { + final focus = FocusNode(); + addTearDown(focus.dispose); + var selections = 0; + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: Column( + children: [ + TextField(focusNode: focus), + FloatingDestinationBar( + cupertino: false, + currentIndex: 0, + showLabels: true, + items: const [ + FloatingDestinationItem( + label: 'Chat', + icon: Icon(Icons.chat), + ), + ], + onTap: (_) => selections++, + ), + ], + ), + ), + ), + ); + await tester.pumpAndSettle(); + focus.requestFocus(); + await tester.pump(); + expect(focus.hasFocus, isTrue); + await tester.tap(find.text('Chat')); + await tester.pump(); + expect(selections, 1); + expect(focus.hasFocus, isTrue); + expect(tester.takeException(), isNull); + }); +}