Skip to content

feat(debug): add a Map debug module with overlays and marker toggles - #24

Merged
Sloy merged 2 commits into
masterfrom
feat/debug-map-module
Oct 7, 2026
Merged

Sloy merged 2 commits into
masterfrom
feat/debug-map-module

Conversation

@Sloy

@Sloy Sloy commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Why

Debugging the map camera (SEVAND-5, Fix line focus area in map) meant guessing from screenshots. The only on-map info was a centered "LineSelected / Debug Info" label.

What

A new Map section in the debug menu. It replaces the Location section:

  • Fake location: dropdown with the same presets as before (Triana, Centro, Nervión, Huelva). DebugLocationService now reads it from the Map section.
  • Map state chip: the current MapScreenState.
  • Camera chip: zoom and camera target.
  • Visible area: outlines the map padding (the area not covered by the top bar and the sheet) and the area the camera fits bounds into, with their centers.
  • Fit bounds: draws the bounds the camera fits for a selected line or stop.
  • Stop markers / Bus markers toggles. The stop toggle hides the stops outside the selection (the hundreds of markers that slow down emulators). The line stops and the selected stop stay.

The chips sit at the bottom left of the visible map, above the sheet, using the overlay pill from the debug menu library (OverlayPill is now public).

The static "Debug Info" label and FeatureFlags.showMapDebugInfo are removed.

How

  • MapDebugOptions (main) is the plain set of options the map reads. Release builds use the defaults through rememberMapDebugOptions() and an empty MapDebugOverlay in app/src/release, so nothing is drawn.
  • Debug: MapDebugModule, MapDebugModuleViewModel, MapDebugModuleDataSource and MapDebugOverlay in feature/debug/map/.
  • MarkerLayersByState filters stops and buses out of the state before drawing.

Note: the persisted fake location of the old Location section is not migrated, so it resets to Off once.

Testing

  • compileDebugKotlin, compileReleaseKotlin, app and debug-menu unit tests pass (DebugLocationServiceTest updated).
  • Checked on an emulator: menu section, chips, visible area guide and fit bounds outline on line 02. On master's camera code, the overlay shows the line bounds running off the top and the zoom clamped at 13.00.

The Map section replaces the Location section and adds tools to debug
the camera:

- Fake location dropdown, same presets as before.
- Map state and camera (zoom and target) chips at the bottom left of the
  visible map, using the overlay pill from the debug menu library.
- Visible area guide: the map padding, the area the camera fits bounds
  into and its center.
- Fit bounds outline: the bounds the camera fits for a line or stop.
- Toggles to hide the stop markers outside the selection and the buses.

The static "Debug Info" label and FeatureFlags.showMapDebugInfo are gone.
Release builds use the default options and draw nothing.

Claude-Session: https://claude.ai/code/session_01J9znEGS7eVo4z7jrHEJkVM
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Screenshot tests passed

All screenshots match their references. Workflow run

- Stop and bus marker switches become "Hide stop markers" and "Hide bus
  markers", so every Map debug option is off by default.
- Map state, zoom and camera target are three separate chips with spacing
  between them.
- Chips use the inverse surface colors, dark in light mode and light in
  dark mode, to stand out over the map.
@Sloy
Sloy merged commit 464c3cc into master Oct 7, 2026
5 checks passed
@Sloy
Sloy deleted the feat/debug-map-module branch October 7, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant