Files
doormile_milderapp/test/geofence_flag_test.dart
Thiru-tenext d7348e253f 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>
2026-08-22 05:40:35 +05:30

50 lines
2.3 KiB
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:miler/controllers/pickups_controller.dart';
/// Whichever way the proximity fence is set, it must be set **once** and on
/// purpose.
///
/// [kGeofenceEnforced] decides whether "Picked up" means the rider was standing
/// at the door or merely pressed a button, and it has already been wrong in
/// both directions: it was `kDebugMode` — so every debug build had no fence and
/// the fence was therefore never tested — and then a hard `false`, so the flow
/// could not be walked at a desk at all.
///
/// **It is currently OFF**, decided on 2026-08-19 because the fence was
/// refusing real work: riders pressing *Picked up* at a counter were told they
/// were kilometres away, most often because the booking's own coordinates were
/// wrong rather than the rider. See the declaration for the full reasoning and
/// for how to restore it.
///
/// So this file no longer guards a direction. It guards the two properties that
/// made the old defaults dangerous: that the state is *deliberate*, and that
/// every gate reads the same switch.
void main() {
test('there is one switch, and the legacy name derives from it', () {
// Two constants that could disagree is exactly how a build ends up with
// the fence on in one gate and off in the other — the bulk check on Home
// and the per-stop check in the controller are separate code paths that
// must never answer differently.
expect(kBypassGeofenceForTesting, !kGeofenceEnforced);
});
test('enforcement is off, and that is the recorded decision', () {
// If this fails, one of two things happened, and both should be read rather
// than silenced:
//
// • the default was changed back to enforced — which is the intended
// end state, so update this test with the date and the reason; or
// • this run passed `--dart-define=ENFORCE_GEOFENCE=true`, in which case
// the failure is correct and is telling you this build has the fence on.
expect(
kGeofenceEnforced,
isFalse,
reason:
'Proximity enforcement is expected to be OFF (see kGeofenceEnforced). '
'Either the default was restored, or this run passed '
'--dart-define=ENFORCE_GEOFENCE=true.',
);
});
}