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:
2026-08-22 05:40:35 +05:30
parent c8350563d9
commit d7348e253f
387 changed files with 80693 additions and 12272 deletions

View File

@@ -31,12 +31,18 @@ void main() {
const belowKey = ValueKey('below');
final trips = [
Trip.fromStops(id: 't1', stops: [
{'orderid': 'A', 'type': 'pickup', 'pickupcustomer': 'Sri Balaji'},
]),
Trip.fromStops(id: 't2', stops: [
{'orderid': 'B', 'type': 'delivery', 'pickupcustomer': 'Anand'},
]),
Trip.fromStops(
id: 't1',
stops: [
{'orderid': 'A', 'type': 'pickup', 'pickupcustomer': 'Sri Balaji'},
],
),
Trip.fromStops(
id: 't2',
stops: [
{'orderid': 'B', 'type': 'delivery', 'pickupcustomer': 'Anand'},
],
),
];
/// Pumps the real delegate inside a scroll view, at a given text scale, and
@@ -58,8 +64,9 @@ void main() {
designSize: const Size(390, 844),
builder: (_, _) => MaterialApp(
builder: (context, child) => MediaQuery(
data: MediaQuery.of(context)
.copyWith(textScaler: TextScaler.linear(textScale)),
data: MediaQuery.of(
context,
).copyWith(textScaler: TextScaler.linear(textScale)),
child: child!,
),
home: Scaffold(
@@ -110,18 +117,29 @@ void main() {
testWidgets('at ${scale}x text scale', (tester) async {
final extent = await pump(tester, textScale: scale);
expect(tester.takeException(), isNull,
reason: 'the tabs must not overflow the reserved extent');
expect(
tester.takeException(),
isNull,
reason: 'the tabs must not overflow the reserved extent',
);
final tabs = tester.getSize(find.byType(TripTabs));
expect(tabs.height, lessThanOrEqualTo(extent + 0.01),
reason: 'tabs are ${tabs.height} tall but only $extent was '
'reserved — the bar would be clipped');
expect(
tabs.height,
lessThanOrEqualTo(extent + 0.01),
reason:
'tabs are ${tabs.height} tall but only $extent was '
'reserved — the bar would be clipped',
);
// Over-reserving is the safe direction, but not by a wasteful amount.
expect(extent - tabs.height, lessThan(14),
reason: 'reserving $extent for ${tabs.height} of content is '
'more dead space than the safety margin intends');
expect(
extent - tabs.height,
lessThan(14),
reason:
'reserving $extent for ${tabs.height} of content is '
'more dead space than the safety margin intends',
);
// All three slots are still rendered and readable at this scale.
for (final label in ['Trip 1', 'Trip 2', 'Trip 3']) {
@@ -132,8 +150,9 @@ void main() {
});
group('pinning', () {
testWidgets('the bar holds at the top while content scrolls under it',
(tester) async {
testWidgets('the bar holds at the top while content scrolls under it', (
tester,
) async {
await pump(tester);
final atRest = tester.getRect(find.byType(TripTabs));
// It starts below the 300pt block above it, not stuck to the top.
@@ -143,10 +162,16 @@ void main() {
await tester.pumpAndSettle();
final pinned = tester.getRect(find.byType(TripTabs));
expect(pinned.top, lessThan(atRest.top),
reason: 'it should travel up with the page first');
expect(pinned.top, lessThan(40),
reason: 'and then hold near the top of the viewport');
expect(
pinned.top,
lessThan(atRest.top),
reason: 'it should travel up with the page first',
);
expect(
pinned.top,
lessThan(40),
reason: 'and then hold near the top of the viewport',
);
// Scrolling further does not move it again.
await tester.dragFrom(inViewport, const Offset(0, -600));
@@ -176,8 +201,11 @@ void main() {
await tester.tap(find.text('Trip 1'));
await tester.pumpAndSettle();
expect(picked, 0,
reason: 'switching trips from deep in the list is the whole point');
expect(
picked,
0,
reason: 'switching trips from deep in the list is the whole point',
);
});
});
}