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

@@ -63,9 +63,13 @@ void main() {
surfaces.forEach((bgName, bg) {
test('$name on $bgName', () {
final r = ratio(colour, bg);
expect(r, greaterThanOrEqualTo(aaNormal),
reason: '$name on $bgName is ${r.toStringAsFixed(2)}:1, '
'under the $aaNormal:1 AA floor for normal text');
expect(
r,
greaterThanOrEqualTo(aaNormal),
reason:
'$name on $bgName is ${r.toStringAsFixed(2)}:1, '
'under the $aaNormal:1 AA floor for normal text',
);
});
});
});
@@ -138,11 +142,15 @@ void main() {
surfaces.forEach((bgName, bg) {
test('text-safe: $name reads on $bgName', () {
final r = ratio(colour, bg);
expect(r, greaterThanOrEqualTo(aaNormal),
reason: '$name on $bgName is ${r.toStringAsFixed(2)}:1. Either '
'lift the colour or move it out of the text-safe list — a '
'token that is in no list is how #FF9500 ended up carrying '
'the retry notice at 2.20:1');
expect(
r,
greaterThanOrEqualTo(aaNormal),
reason:
'$name on $bgName is ${r.toStringAsFixed(2)}:1. Either '
'lift the colour or move it out of the text-safe list — a '
'token that is in no list is how #FF9500 ended up carrying '
'the retry notice at 2.20:1',
);
});
});
});
@@ -150,8 +158,11 @@ void main() {
fillWithWhiteLabel.forEach((name, fill) {
test('fill: $name carries a white label', () {
final r = ratio(Colors.white, fill);
expect(r, greaterThanOrEqualTo(aaNormal),
reason: 'white on $name is ${r.toStringAsFixed(2)}:1');
expect(
r,
greaterThanOrEqualTo(aaNormal),
reason: 'white on $name is ${r.toStringAsFixed(2)}:1',
);
});
});
@@ -163,17 +174,25 @@ void main() {
// asserted is that the difference is real and cannot erode to nothing.
// `borderStrong` is held higher, separately, because its job is to make
// a container read as a container in sunlight.
expect(r, greaterThan(1.15),
reason: '$name is ${r.toStringAsFixed(3)}:1 on white — an edge '
'nobody can see');
expect(
r,
greaterThan(1.15),
reason:
'$name is ${r.toStringAsFixed(3)}:1 on white — an edge '
'nobody can see',
);
});
test('structural: $name is never a text colour', () {
// It cannot pass as text, which is exactly why it must not be used as
// one. `disabledFill` was, on seven screens, at 1.68:1.
final r = ratio(colour, Colors.white);
expect(r, lessThan(aaNormal),
reason: '$name reads well enough to be text — if that is what it '
'is for, move it to the text-safe list');
expect(
r,
lessThan(aaNormal),
reason:
'$name reads well enough to be text — if that is what it '
'is for, move it to the text-safe list',
);
});
});
@@ -190,9 +209,13 @@ void main() {
};
for (final e in retired.entries) {
final r = ratio(Color(e.value), Colors.white);
expect(r, lessThan(aaNormal),
reason: 'sanity: ${e.key} really did fail at '
'${r.toStringAsFixed(2)}:1');
expect(
r,
lessThan(aaNormal),
reason:
'sanity: ${e.key} really did fail at '
'${r.toStringAsFixed(2)}:1',
);
}
});
});
@@ -213,8 +236,11 @@ void main() {
final r = ratio(Colors.white, fill);
// Button and chip labels are bold, so the large-text floor applies —
// but everything here should be comfortably past it.
expect(r, greaterThanOrEqualTo(aaLarge),
reason: 'white on $name is ${r.toStringAsFixed(2)}:1');
expect(
r,
greaterThanOrEqualTo(aaLarge),
reason: 'white on $name is ${r.toStringAsFixed(2)}:1',
);
});
});
@@ -227,9 +253,13 @@ void main() {
'combinedChip': ColorConstants.combinedChip,
}.entries) {
final r = ratio(Colors.white, e.value);
expect(r, greaterThanOrEqualTo(aaNormal),
reason: '${e.key} is ${r.toStringAsFixed(2)}:1 — the chip label is '
'10sp, so large-text allowances do not apply');
expect(
r,
greaterThanOrEqualTo(aaNormal),
reason:
'${e.key} is ${r.toStringAsFixed(2)}:1 — the chip label is '
'10sp, so large-text allowances do not apply',
);
}
});
});
@@ -239,12 +269,17 @@ void main() {
// Riders reported being unable to tell cards apart at ~3%; this keeps the
// separation from quietly eroding back to that.
test('cardSurface is clearly darker than the page', () {
final drop = 1 -
final drop =
1 -
luminance(ColorConstants.cardSurface) /
luminance(ColorConstants.surface);
expect(drop, greaterThan(0.07),
reason: 'only ${(drop * 100).toStringAsFixed(1)}% darker than the '
'page — a borderless card needs its fill to do the separating');
expect(
drop,
greaterThan(0.07),
reason:
'only ${(drop * 100).toStringAsFixed(1)}% darker than the '
'page — a borderless card needs its fill to do the separating',
);
});
test('borderStrong is visible against white and against the card', () {
@@ -254,9 +289,13 @@ void main() {
'cardSurface': ColorConstants.cardSurface,
}.entries) {
final r = ratio(ColorConstants.borderStrong, e.value);
expect(r, greaterThan(1.2),
reason: 'borderStrong on ${e.key} is only '
'${r.toStringAsFixed(2)}:1 — an edge nobody can see');
expect(
r,
greaterThan(1.2),
reason:
'borderStrong on ${e.key} is only '
'${r.toStringAsFixed(2)}:1 — an edge nobody can see',
);
}
});
});
@@ -268,11 +307,15 @@ void main() {
// dashboard was slate-and-white. These assert they stay neutral: for a
// grey/slate, the three channels sit close together.
void expectNeutral(String name, Color c) {
final spread = [c.r, c.g, c.b].reduce(math.max) -
[c.r, c.g, c.b].reduce(math.min);
expect(spread, lessThan(0.12),
reason: '$name has an RGB spread of ${spread.toStringAsFixed(3)} — '
'that is a hue, not a neutral');
final spread =
[c.r, c.g, c.b].reduce(math.max) - [c.r, c.g, c.b].reduce(math.min);
expect(
spread,
lessThan(0.12),
reason:
'$name has an RGB spread of ${spread.toStringAsFixed(3)} — '
'that is a hue, not a neutral',
);
}
test('onSurfaceVariant is a neutral, not a brown', () {