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

Copy link
Copy Markdown

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. The only other change in gui_main.py is the uic version line in its header.
  • Startup fetch: when at least one mapper is enabled, a single fetch runs a second after launch.

Trade-offs

The startup fetch is the one policy call here: it's one request to each enabled 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__ and I'm happy to drop it from the PR.

Testing

  • 8 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, and the generated window has the button.
  • Full suite: 92 passed (84 existing + 8).
  • 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: additive behavior, no changes to routing, mappers or auth.

🤖 Generated with Claude Code

mogglemoss and others added 2 commits November 8, 2026 18:17
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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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