diff --git a/bin/todo_desktop.dart b/bin/todo_desktop.dart index 094547c..a1c5027 100644 --- a/bin/todo_desktop.dart +++ b/bin/todo_desktop.dart @@ -28,10 +28,14 @@ Future main(List args) async { exit(1); } + // Overridable so a verification run cannot point at the real backlog: an + // app that starts with an empty store would export over it. final server = WrapperServer( webRoot: webRoot, - backlogPath: p.join(home, 'todo', 'BACKLOG.md'), - logPath: p.join(home, '.local', 'share', 'todo-desktop', 'todo_notes.json'), + backlogPath: + _argValue(args, '--backlog-path') ?? p.join(home, 'todo', 'BACKLOG.md'), + logPath: _argValue(args, '--log-path') ?? + p.join(home, '.local', 'share', 'todo-desktop', 'todo_notes.json'), ); await server.start(_port); stdout.writeln('todo desktop serving on http://localhost:$_port'); diff --git a/lib/frame_stats_web.dart b/lib/frame_stats_web.dart index 841dba6..f6be46e 100644 --- a/lib/frame_stats_web.dart +++ b/lib/frame_stats_web.dart @@ -12,7 +12,15 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/scheduler.dart'; /// Whether the frame-stats instrument is armed for this build. -const frameStatsEnabled = bool.fromEnvironment('TODO_FRAME_STATS'); +/// +/// Read as a string rather than `bool.fromEnvironment`, which only accepts the +/// exact literal `true` — `--dart-define=TODO_FRAME_STATS=1` silently yields +/// false and the instrument produces nothing at all. +const String _frameStatsFlag = String.fromEnvironment('TODO_FRAME_STATS'); + +/// Whether the instrument is armed (`--dart-define=TODO_FRAME_STATS=1`). +const bool frameStatsEnabled = + _frameStatsFlag == '1' || _frameStatsFlag == 'true'; const _slowFrameMs = 8; const _probePeriod = Duration(milliseconds: 16);