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:
@@ -66,13 +66,17 @@ void main() {
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pumpWidget(bar(selected: selected, initial: start));
|
||||
await tester.pumpAndSettle();
|
||||
expect(pillLeft(tester), closeTo(slot * start, 0.5),
|
||||
reason: 'tab $start should be the one wearing the pill');
|
||||
expect(
|
||||
pillLeft(tester),
|
||||
closeTo(slot * start, 0.5),
|
||||
reason: 'tab $start should be the one wearing the pill',
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
testWidgets('Account → Home crosses Earnings and Bookings on the way',
|
||||
(tester) async {
|
||||
testWidgets('Account → Home crosses Earnings and Bookings on the way', (
|
||||
tester,
|
||||
) async {
|
||||
// The failing case the rider described, measured directly.
|
||||
final selected = ValueNotifier(3);
|
||||
addTearDown(selected.dispose);
|
||||
@@ -94,16 +98,26 @@ void main() {
|
||||
// at some point. A pair of cross-fading per-tab pills produces *no* sample
|
||||
// in either band — the whole point of the test.
|
||||
bool over(int tab) => samples.any(
|
||||
(x) => x > slot * tab - slot / 2 && x < slot * tab + slot / 2);
|
||||
expect(over(2), isTrue,
|
||||
reason: 'the pill never passed over Earnings; samples: $samples');
|
||||
expect(over(1), isTrue,
|
||||
reason: 'the pill never passed over Bookings; samples: $samples');
|
||||
(x) => x > slot * tab - slot / 2 && x < slot * tab + slot / 2,
|
||||
);
|
||||
expect(
|
||||
over(2),
|
||||
isTrue,
|
||||
reason: 'the pill never passed over Earnings; samples: $samples',
|
||||
);
|
||||
expect(
|
||||
over(1),
|
||||
isTrue,
|
||||
reason: 'the pill never passed over Bookings; samples: $samples',
|
||||
);
|
||||
|
||||
// And it went there directly — no backtracking, which would read as a wobble.
|
||||
for (var i = 1; i < samples.length; i++) {
|
||||
expect(samples[i], lessThanOrEqualTo(samples[i - 1] + 0.5),
|
||||
reason: 'the pill moved backwards at sample $i: $samples');
|
||||
expect(
|
||||
samples[i],
|
||||
lessThanOrEqualTo(samples[i - 1] + 0.5),
|
||||
reason: 'the pill moved backwards at sample $i: $samples',
|
||||
);
|
||||
}
|
||||
|
||||
await tester.pumpAndSettle();
|
||||
@@ -129,8 +143,11 @@ void main() {
|
||||
selected.value = 2;
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 16));
|
||||
expect(pillLeft(tester), closeTo(midway, slot * 0.25),
|
||||
reason: 'it should carry on from $midway, not jump back to ${slot * 3}');
|
||||
expect(
|
||||
pillLeft(tester),
|
||||
closeTo(midway, slot * 0.25),
|
||||
reason: 'it should carry on from $midway, not jump back to ${slot * 3}',
|
||||
);
|
||||
|
||||
await tester.pumpAndSettle();
|
||||
expect(pillLeft(tester), closeTo(slot * 2, 0.5));
|
||||
@@ -158,8 +175,11 @@ void main() {
|
||||
final lit = _lit(tester);
|
||||
if (lit[1] > 0.05 || lit[2] > 0.05) sawMiddleGlow = true;
|
||||
}
|
||||
expect(sawMiddleGlow, isTrue,
|
||||
reason: 'Bookings and Earnings should warm up under the passing pill');
|
||||
expect(
|
||||
sawMiddleGlow,
|
||||
isTrue,
|
||||
reason: 'Bookings and Earnings should warm up under the passing pill',
|
||||
);
|
||||
|
||||
await tester.pumpAndSettle();
|
||||
expect(_lit(tester), [1.0, 0.0, 0.0, 0.0]);
|
||||
@@ -192,7 +212,8 @@ class _PillBar extends StatefulWidget {
|
||||
State<_PillBar> createState() => _PillBarState();
|
||||
}
|
||||
|
||||
class _PillBarState extends State<_PillBar> with SingleTickerProviderStateMixin {
|
||||
class _PillBarState extends State<_PillBar>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late final AnimationController _anim;
|
||||
late final Animation<double> _curve;
|
||||
late Tween<double> _tween;
|
||||
|
||||
Reference in New Issue
Block a user