Skip to content

Shorten launch-to-route: auto-location, a swap button, one startup fetch - #64

Open
mogglemoss wants to merge 2 commits into
secondfry:masterfrom
mogglemoss:feature/launch-to-route-flow
Open

mogglemoss wants to merge 2 commits into
secondfry:masterfrom
mogglemoss:feature/launch-to-route-flow

Conversation

@mogglemoss

@mogglemoss mogglemoss commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Three small behaviors that cut the steps between opening Short Circuit and getting a route: the pilot's location fills Source after login, a Swap ⇅ button exchanges Source and Destination, and one mapper fetch runs at launch when mappers are configured.

Context

A returning user's flow today is: launch → log in → click Player location → click Fetch Mappers → type a destination → Find path. Two of those clicks are things the app can do on its own, and a there-and-back trip means retyping both systems.

Approach

  • Auto-location: after a successful login, the location is fetched and fills Source. It never overwrites a source the user has already typed, and if it fails (pilot offline, ESI error) it fails quietly instead of opening a dialog. The manual Player location button behaves exactly as before, including its error dialog.
  • Swap: a Swap ⇅ button in the empty grid cell between Player location and Find path. Added in gui_main.ui and regenerated with the command from generate_gui.sh.
  • Startup fetch: when at least one enabled mapper is set up, a single fetch runs a second after launch.
  • Mappers that aren't set up are skipped: a fresh install enables Tripwire with no account, and Tripwire logs in from its constructor, so fetching it would send a blank login. is_configured() decides from the config alone (Tripwire and Wanderer need a URL and both credentials), and Navigation.setup_mappers() skips the rest, so a manual fetch doesn't send a blank login either.

Trade-offs

The startup fetch is the one policy call here: it's one fetch from each enabled, set-up mapper per launch. It deliberately isn't a recurring refresh, so an idle app never polls mapper servers. If you'd rather keep fetching purely manual, it's a self-contained block in __init__ plus _startup_fetch and I'm happy to drop it from the PR.

Testing

  • 9 new tests in test_launch_flow.py drive the handlers on a stand-in object (no settings, database or network): login fills an empty Source, a failed login doesn't fetch, a typed Source is never overwritten, the automatic path stays silent on failure while the manual button still reports it, a manual fetch does overwrite, swap exchanges the fields, the startup fetch skips when one is already running or when no mapper is set up, and the generated window has the button.
  • 13 new tests in test_mapper_readiness.py: what counts as set up for each mapper type, that a fresh install has nothing to fetch, that a mapper that isn't set up is never built, and that every type with a builder can be configured (a type missing from the check would be skipped without an error).
  • Full suite: 176 passed (154 on master + 22), rebased onto 71ef624.
  • Rendered the real main window offscreen (settings redirected to a temp folder, network stubbed) to check the button's placement and that swap works.
  • Not covered live: the post-login location fill was exercised through the handlers, not a real ESI login in this branch. The same behavior has been running live in the mogglemoss fork.

Risks

Low: no changes to routing, mapper sources or auth. The one change to existing behavior is that a mapper that isn't set up is now skipped instead of being fetched and failing.

🤖 Generated with Claude Code

mogglemoss and others added 2 commits November 24, 2026 08:39
A returning user's flow was: launch, log in, click Player location,
click Fetch Mappers, then type a destination and Find path — two of
those steps are things the app can do itself, and going there-and-back
meant retyping both systems.

- After a successful login the pilot's location is fetched and fills
  Source. It never overwrites a source the user already typed, and a
  failure (pilot offline, ESI error) is silent rather than a dialog —
  the manual Player location button still reports failures as before.
- A Swap ⇅ button sits in the empty grid cell between Player location
  and Find path and exchanges Source and Destination. Added in
  gui_main.ui and regenerated with generate_gui.sh's command.
- When mappers are configured, one fetch runs a second after launch.
  This is a single fetch per launch, not a recurring refresh, so no
  extra load on mapper servers while the app sits idle.

Tests drive the handlers on a stand-in object (no settings, database or
network) and check the generated window has the button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fresh install's default config enables Tripwire with no account, so
the startup fetch added in this PR would build a Tripwire source on
first launch. Tripwire logs in from its constructor, so that sends a
blank-credential login to tripwire.eve-apps.com, a pointless request
to someone else's server, and opens the app on an error.

- mapper_config.is_configured() decides from the config alone whether a
  mapper has what it needs, mirroring each mapper's validate_config().
  It can't build the source to ask, because building a Tripwire source
  is itself the login request.
- The startup fetch is scheduled, and runs, only when at least one
  enabled mapper is set up.
- Navigation.setup_mappers() skips mappers that aren't set up, so a
  manual fetch never sends a blank login either.

Wanderer (secondfry#61) was merged after this was written. is_configured() now
covers it, since a type it doesn't know is skipped without an error, and
a test checks that every type with a builder can be configured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mogglemoss
mogglemoss force-pushed the feature/launch-to-route-flow branch from 70157f3 to 6079542 Compare November 24, 2026 16:41
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