fix: auto-download UI in viz when bundle is missing#1104
Open
CoronRing wants to merge 3 commits into
Open
Conversation
railtracks viz started the server even when .railtracks/ui/ did not
exist, silently serving {"error":"File not found"} on every request
with no indication that railtracks init was required first.
- viz now checks for index.html before starting and downloads the UI
bundle automatically if missing
- Path validity check switched from FileNotFoundError to OSError so
the Windows invalid-filename fallback actually fires
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pooria90
reviewed
May 21, 2026
|
|
||
| create_railtracks_dir() | ||
|
|
||
| ui_index = Path(f"{cli_directory}/ui/index.html") |
Contributor
There was a problem hiding this comment.
Let's wait until #1110 is merged, then change this line to
ui_index = resolve_railtracks_home() / "ui" / "index.html"As now we rely on absolute path generate by the paths/resolve_railtracks_home function.
Pooria90
requested changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1103
railtracks viznow checks for.railtracks/ui/index.htmlbefore starting the server and automatically downloads the UI bundle if it is missing, makingrailtracks initan optional step rather than a silent prerequisiteFileNotFoundErrortoOSErrorso the invalid-filename fallback actually fires on Windows (where bad chars raiseOSErrorerrno 22, notFileNotFoundError)Test plan
.railtracks/ui/and runrailtracks viz— bundle should download automatically, browser should load the UIrailtracks vizwith UI already present — should start immediately with no downloadrailtracks initthenrailtracks viz— still works as before