Skip to content

Waypoint graph UI shows "(no screenshot)" for classifier-labeled example captures #215

Description

@handstandsam

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.kttryLoadFilesystemExample 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/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions