launcher: side-by-side versions.json fallback + empty-state UX

The version dropdown sat silently empty when the GitHub manifest
fetch 404'd (private repo, network down, etc.) and there was no
DORKNET_LOCAL_MANIFEST to fall back to. Two fixes:

- csproj copies the repo-root versions.json next to dorknet.exe on
  build, and LocalOverrides.GetLocalManifestPath checks that path
  as a fallback after the env var. Dev checkouts against a private
  repo now Just Work — no env vars needed.
- When the manifest can't be loaded, RefreshManifestAsync now
  inserts a disabled placeholder "(no versions - check internet or
  set DORKNET_LOCAL_MANIFEST)" in the dropdown so the user sees the
  problem at a glance instead of a silent blank.
- LocalOverrides.DescribeManifestSource shows in Settings whether
  the active manifest came from the env var, the side-by-side
  fallback, or the live GitHub fetch.
This commit is contained in:
Alexa
2026-05-27 12:05:21 +03:00
parent a5f1d74a8e
commit de98ea694f
3 changed files with 59 additions and 8 deletions
+15 -3
View File
@@ -184,13 +184,25 @@ public partial class MainWindow : Window
private async Task RefreshManifestAsync()
{
_manifest = await new VersionsManifest().FetchAsync();
VersionSelect.Items.Clear();
if (_manifest is null)
{
HostStatusText.Text = "Couldn't load versions.json from GitHub. " +
"Check internet, then reopen.";
// Empty placeholder so the user sees *something* in the
// dropdown instead of a silent blank — helps when the public
// repo is unreachable (e.g. private repo + no env override).
var placeholder = new ComboBoxItem
{
Content = "(no versions — check internet or set DORKNET_LOCAL_MANIFEST)",
IsEnabled = false,
Tag = null,
};
VersionSelect.Items.Add(placeholder);
placeholder.IsSelected = true;
HostStatusText.Text = "Couldn't load versions.json. " +
"Either the repo isn't reachable, or DORKNET_LOCAL_MANIFEST " +
"points at a missing/invalid file — check Settings.";
return;
}
VersionSelect.Items.Clear();
foreach (var v in _manifest.Branches.Where(b => b.Supported))
{
var item = new ComboBoxItem