Miler rider app: surface system, visible design language, backend lifecycle
Design system - MilerSurface ladder (canvas → working → raised → floating) with MilerPanel as layer 1; canvas moved to #DEE3EA so white separates at 1.290:1. - Visible vocabulary applied across Home, Deliveries, Activity, Account and the sheets: hero heads (tabular numeral + small caption, clamped at 1.3x), canvas wells for anything that opens, small filled tags for shelf labels, demoted placeholders. Recorded in DESIGN_SYSTEM.md §6. - One icon family: 222 Material glyphs migrated to Lucide; none left outside lib/xpress. - Colour semantics corrected: amber only for what is genuinely owed, brand red reserved for the live stop, disabled primaries go neutral rather than pale. Data and lifecycle - lib/data/lifecycle.dart reads mutations for what they prove; route_order.dart makes admin sequence the single ordering authority; service_day.dart, and stop_area.dart rewritten against live Coimbatore addresses (digit-token stripping, city stoplist, street suffixes, stammer collapse). - countLabel states the load once, in bags. Testing - 1440 tests passing; golden shot harnesses for Home, Deliveries, Activity, sheets and verify, with test/failures/ now gitignored (diff debris). - New pins: home_gutter_test, stop_area_test, plus updated structural bounds. Note: this commit also carries pre-existing working-tree deletions that were present before this work (API_SPEC.md, README.md, demo test fixtures). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -47,31 +47,47 @@ void main() {
|
||||
await pump(tester, goingOnline: true);
|
||||
|
||||
expect(find.text('Go on duty?'), findsOneWidget);
|
||||
// The strip shows the move: leaving Off duty, arriving at On duty.
|
||||
expect(find.text('Off duty'), findsOneWidget);
|
||||
expect(find.text('On duty'), findsOneWidget);
|
||||
expect(find.text('Slide to go on duty'), findsOneWidget);
|
||||
// Duty is not connectivity.
|
||||
expect(find.text('Go on duty'), findsOneWidget);
|
||||
expect(find.text('Not yet'), findsOneWidget);
|
||||
|
||||
// Duty is not connectivity. A rider reading a wifi symbol on a screen that
|
||||
// stops his work is being told the app has a network problem.
|
||||
expect(find.byIcon(Icons.wifi), findsNothing);
|
||||
expect(find.byIcon(Icons.wifi_off), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('going off duty lists what stops, including the refusal', (
|
||||
// ── The consequence survives; the three rows that carried it do not ──
|
||||
//
|
||||
// The sheet listed what stops as three icon-and-text rows. The facts are the
|
||||
// contract, not the rows — and the one that matters most is the refusal,
|
||||
// which the original sheet sprang on the rider only *after* he had completed
|
||||
// a slide. It is in the sentence now, before he decides.
|
||||
testWidgets('going off duty states what stops, including the refusal', (
|
||||
tester,
|
||||
) async {
|
||||
await pump(tester, goingOnline: false);
|
||||
|
||||
expect(find.text('Go off duty?'), findsOneWidget);
|
||||
expect(find.text('No new trips until you are back on'), findsOneWidget);
|
||||
expect(find.text('Live tracking pauses'), findsOneWidget);
|
||||
// The one the old sheet sprang on him only after he had slid it.
|
||||
|
||||
final body = tester
|
||||
.widgetList<Text>(find.byType(Text))
|
||||
.map((t) => t.data ?? '')
|
||||
.join(' ');
|
||||
expect(body, contains('stops assigning you trips'));
|
||||
expect(body, contains('live tracking pauses'));
|
||||
expect(
|
||||
find.text('Any booking you are holding must be finished first'),
|
||||
findsOneWidget,
|
||||
body,
|
||||
contains('has to be finished first'),
|
||||
reason: 'the refusal must be stated before the gesture, not after it',
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('a completed slide runs the toggle', (tester) async {
|
||||
// ── Slides are reserved for money ──
|
||||
//
|
||||
// The confirmation was a slide-to-submit borrowed from the payment flows.
|
||||
// Ending a shift is not a transaction, and asking for a drag made the
|
||||
// commonest action of the rider's day the most laborious one.
|
||||
testWidgets('confirming runs the toggle', (tester) async {
|
||||
var calls = 0;
|
||||
await pump(
|
||||
tester,
|
||||
@@ -82,19 +98,14 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
// The knob, not the arrow in the state strip above it.
|
||||
final knob = find.descendant(
|
||||
of: find.byType(SlideToSubmit),
|
||||
matching: find.byIcon(Icons.arrow_forward_rounded),
|
||||
);
|
||||
await tester.drag(knob, const Offset(400, 0));
|
||||
await tester.tap(find.widgetWithText(ElevatedButton, 'Go on duty'));
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
|
||||
expect(calls, 1);
|
||||
});
|
||||
|
||||
testWidgets('a short slide does not', (tester) async {
|
||||
testWidgets('dismissing does not', (tester) async {
|
||||
var calls = 0;
|
||||
await pump(
|
||||
tester,
|
||||
@@ -105,14 +116,10 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
final knob = find.descendant(
|
||||
of: find.byType(SlideToSubmit),
|
||||
matching: find.byIcon(Icons.arrow_forward_rounded),
|
||||
);
|
||||
await tester.drag(knob, const Offset(40, 0));
|
||||
await tester.tap(find.text('Stay on duty'));
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
|
||||
expect(calls, 0, reason: 'ending the day takes a deliberate gesture');
|
||||
expect(calls, 0, reason: 'the way out must not perform the action');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user