Summary
Waypoints captured with a device classifier render as "(no screenshot)" in the waypoint graph UI until their example files are hand-renamed, because the UI's example loader only resolves the bare <base>.example.json sibling and ignores classifier-labeled example files.
Details
trailblaze waypoint capture-example writes classifier-labeled example pairs when the source log records a device classifier — e.g. <base>.example.android-phone.json plus its screenshot (see WaypointCaptureExampleCommand.kt). It does not write a bare <base>.example.json in that case.
The example loader used by the waypoint graph UI (/waypoints/graph) and the Compose waypoints tab only resolves the bare sibling:
trailblaze-host/src/main/java/xyz/block/trailblaze/ui/tabs/waypoints/WaypointsTabComposable.kt — tryLoadFilesystemExample builds File(waypointFile.parentFile, "$basename.example.json") (~line 454).
- The trailmap-side loader has the same limitation with
exampleJsonPath = "$basename.example.json" (~line 605).
As a result, a freshly captured classifier-labeled waypoint has no matching example file from the UI's perspective and renders with no screenshot. The current workaround is to manually rename the classifier-labeled files to the bare form.
Expected
WaypointValidateCommand.kt already understands the full example set — the bare <base>.example.json plus any <base>.example.<classifier>.json siblings (see resolveSiblingExamples, ~lines 204–221). The UI loader should mirror that resolution: prefer the bare example, and fall back to a classifier-labeled example (deterministically, e.g. first sorted classifier) when no bare file exists.
Suggested fix
- Update the example resolution in
WaypointsTabComposable.kt (both the filesystem loader at ~line 454 and the trailmap loader at ~line 605) to fall back to <base>.example.<classifier>.json when the bare file is absent, choosing deterministically.
- Add a test alongside the existing loader tests in
trailblaze-host/src/test/java/xyz/block/trailblaze/ui/tabs/waypoints/.
Summary
Waypoints captured with a device classifier render as "(no screenshot)" in the waypoint graph UI until their example files are hand-renamed, because the UI's example loader only resolves the bare
<base>.example.jsonsibling and ignores classifier-labeled example files.Details
trailblaze waypoint capture-examplewrites classifier-labeled example pairs when the source log records a device classifier — e.g.<base>.example.android-phone.jsonplus its screenshot (seeWaypointCaptureExampleCommand.kt). It does not write a bare<base>.example.jsonin that case.The example loader used by the waypoint graph UI (
/waypoints/graph) and the Compose waypoints tab only resolves the bare sibling:trailblaze-host/src/main/java/xyz/block/trailblaze/ui/tabs/waypoints/WaypointsTabComposable.kt—tryLoadFilesystemExamplebuildsFile(waypointFile.parentFile, "$basename.example.json")(~line 454).exampleJsonPath = "$basename.example.json"(~line 605).As a result, a freshly captured classifier-labeled waypoint has no matching example file from the UI's perspective and renders with no screenshot. The current workaround is to manually rename the classifier-labeled files to the bare form.
Expected
WaypointValidateCommand.ktalready understands the full example set — the bare<base>.example.jsonplus any<base>.example.<classifier>.jsonsiblings (seeresolveSiblingExamples, ~lines 204–221). The UI loader should mirror that resolution: prefer the bare example, and fall back to a classifier-labeled example (deterministically, e.g. first sorted classifier) when no bare file exists.Suggested fix
WaypointsTabComposable.kt(both the filesystem loader at ~line 454 and the trailmap loader at ~line 605) to fall back to<base>.example.<classifier>.jsonwhen the bare file is absent, choosing deterministically.trailblaze-host/src/test/java/xyz/block/trailblaze/ui/tabs/waypoints/.