From 349f268aecadefeb941c952d983f35d04ac4bdb9 Mon Sep 17 00:00:00 2001 From: Joachim Rosskopf Date: Sun, 31 May 2026 07:05:30 +0200 Subject: [PATCH] fix(explore): place the expand chevron in the top band like collapse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The collapse chevron sits in the top 28px header band, but the expand chevron floated at the rail's vertical centre — inconsistent and confusing. Top-align the expand chevron so collapse/expand share the same placement. The whole rail stays tappable (the InkWell still fills the region); only the icon's position moves into the top band. Co-Authored-By: Claude Opus 4.8 --- .../lib/crm/crm_workspace.dart | 19 ++++++++++++++----- .../test/crm/both_panes_collapse_test.dart | 8 ++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/apps/escurel-explore/lib/crm/crm_workspace.dart b/apps/escurel-explore/lib/crm/crm_workspace.dart index f9b043a..aab2aca 100644 --- a/apps/escurel-explore/lib/crm/crm_workspace.dart +++ b/apps/escurel-explore/lib/crm/crm_workspace.dart @@ -190,11 +190,20 @@ class _CollapsibleRegion extends StatelessWidget { message: 'Expand', child: InkWell( onTap: onToggle, - child: Center( - child: Icon( - edge == _Edge.right ? Icons.chevron_right : Icons.chevron_left, - size: 16, - color: kOnSurfaceVariant, + // Whole rail stays tappable, but the chevron sits in the + // same top 28px band as the collapse chevron (consistent + // placement) rather than floating at the vertical centre. + child: Align( + alignment: Alignment.topCenter, + child: SizedBox( + height: 28, + child: Center( + child: Icon( + edge == _Edge.right ? Icons.chevron_right : Icons.chevron_left, + size: 16, + color: kOnSurfaceVariant, + ), + ), ), ), ), diff --git a/apps/escurel-explore/test/crm/both_panes_collapse_test.dart b/apps/escurel-explore/test/crm/both_panes_collapse_test.dart index cb2b628..3710372 100644 --- a/apps/escurel-explore/test/crm/both_panes_collapse_test.dart +++ b/apps/escurel-explore/test/crm/both_panes_collapse_test.dart @@ -71,11 +71,11 @@ void main() { await tester.pumpAndSettle(); expect(find.bySemanticsLabel('event-pane'), findsNothing); - // Tap near the TOP of the collapsed rail — far from the vertically - // centered chevron icon. Before the full-rail hit target, only the - // ~16px icon responded, so a real click that missed it did nothing. + // Tap low in the collapsed rail — well away from the chevron icon + // (which sits in the top band). Only a full-rail hit target responds + // here; the old centered-icon target would have ignored this click. final rail = tester.getRect(find.bySemanticsLabel('region-events')); - await tester.tapAt(Offset(rail.center.dx, rail.top + 24)); + await tester.tapAt(Offset(rail.center.dx, rail.top + rail.height * 0.75)); await tester.pumpAndSettle(); expect(find.bySemanticsLabel('event-pane'), findsOneWidget, reason: 'tapping the rail (off the icon) must still expand it');