Commit Graph
27 Commits
Author SHA1 Message Date
objz 53191bc23b feat: expand launcher settings 2026-09-04 20:57:07 +02:00
objz 29ad70fa16 chore: add SPDX copyright headers 2026-08-24 19:13:43 +02:00
objz 4ce081d6ed fix(content): stop dropping update labels
Update labels disappeared at random and only came back after switching
instances, and mods installed from a modpack never got one.

- display no longer requires the snapshot inventory to match the manifest
  exactly; a single changed file wiped every label in the instance even
  though each update is keyed by its exact installed version
- a finished scan is applied instead of discarded when the manifest moved
  on in the meantime, and the pending queue no longer leaks or replays
  stale snapshots over newer ones
- compare versions by publish date and ask the provider for the installed
  version when it is missing from the compatible list, which is the normal
  case for modpack pinned files; also fixes the modpack update label
- keep known updates for checks that failed so an offline scan no longer
  overwrites a good cache
- rescan only when the inventory changed or the snapshot is older than
  30 minutes, with one pooled http client per scan instead of one per mod
2026-08-15 21:24:51 +02:00
objz a839925041 feat(modpacks): manage installed pack versions 2026-08-05 21:30:57 +02:00
objz e09e5a0168 feat(modpacks): refresh managed instances safely 2026-08-05 00:16:24 +02:00
objz 695ba5a758 feat(modpacks): check discovered pack updates 2026-08-04 21:32:25 +02:00
objz 3bee6d8338 fix(tui): correct relative time wording 2026-08-01 16:51:32 +02:00
objz cccf65981a feat(tui): support Ctrl+Backspace in text inputs 2026-07-28 16:46:15 +02:00
objz d79843c54b fix(tui): initialize newly imported instances 2026-07-28 14:12:38 +02:00
objz 1742f62cd0 feat(discovery): add CurseForge and modpack browsing 2026-07-28 14:12:38 +02:00
objz c6205a337c refactor: reorganize source and tests 2026-07-27 11:28:57 +02:00
objz 64bb5e2d16 fix(tui): harden rendering and centralize tests 2026-07-27 01:09:33 +02:00
objz 6138e248cb test(tui): externalize and expand UI coverage 2026-07-26 23:57:13 +02:00
objz 19c47cdf7b feat(content): refine Modrinth discovery streaming 2026-07-22 22:22:00 +02:00
objz 269814945d feat(tui): manage config profiles from settings 2026-07-10 16:12:48 +02:00
objz 41d6da8008 added: ratatui snapshots for instance_list and wizard popups
Phase E added snapshots for the ErrorPopup; this extends the same
pattern to the three other high-value widgets the audit flagged.

- src/tui/widgets/instances.rs: two snapshots covering the instance
  list with three synthetic instances (verifies layout, "Never played"
  rendering, scrollbar gutter) and the empty list. State is passed in
  via the existing State::with_instances constructor; no global state
  involved.

- src/tui/widgets/popups/new_instance/render.rs: two snapshots covering
  the Name step (default) and Loader step (hardcoded loader list, no
  network). WIZARD_STATE is global, so the tests reset it under its
  mutex and serialise via a per-module TEST_SERIAL mutex to prevent
  cross-test races. The Version and LoaderVersion steps are skipped
  here because their render path calls ensure_versions_loaded which
  tokio::spawns a network task; covering them would need a fully
  pre-populated state and is deferred.

- src/tui/widgets/popups/import_modpack/render.rs: two snapshots
  covering the Input step (default) and the Fetching step (just a
  spinner + label, no network triggered by render). Same global-state
  serialisation pattern as new_instance.

Snapshots live next to each widget under snapshots/ as plain text and
are committed to git.
2026-05-27 17:22:33 +02:00
objz 623acd9e2c added: tests for retry envelope, manager rename, mod precedence, time buckets
Audit identified six high-priority coverage gaps. This commit closes
them with 30 net new passing tests.

- tests/net_retry.rs (new): 5 wiremock-based tests for the retry
  envelope in net/mod.rs. Covers get_json + download_file across:
  5xx retry-then-succeed, 4xx fail-fast (asserted via wiremock
  expect(1) so any retry attempt fails the test), and exhaust at
  MAX_RETRIES = 3 (asserted via expect(4)). The exhaust test takes
  ~3.5s of wall time because the production code sleeps 500 + 1000 +
  2000 ms between attempts; this is unavoidable without making the
  delays configurable.

- tests/launch_pipeline.rs: 3 new error-path tests against
  build_launch_invocation. merged_profile_missing_main_class_fails
  surfaces the LaunchError::Parse branch when meta.json deserialises
  cleanly but lacks mainClass. legacy_loader_profile_missing_loader_version_errors
  and legacy_loader_profile_missing_installer_json_errors exercise the
  two Parse branches inside migrate_legacy_loader_profile_if_needed.

- instance/manager.rs: 6 tests for rename (happy path, noop on same
  name, empty target rejected, missing source, target collision) and
  touch_last_played (sets the field to a stamp within 5 seconds of
  now). The InstanceManager rename surface had no coverage before;
  mutating the validation order or the std::fs::rename target would
  not have failed any existing test.

- instance/content/mods.rs: 4 new precedence-chain tests. The reader
  chain is fabric > quilt > forge-toml (which itself tries
  neoforge.mods.toml before mods.toml) > mcmod.info. Only the
  fabric-over-forge precedence had a test before. Adds quilt > forge,
  forge_toml > mcmod_info, neoforge.mods.toml > mods.toml, and a test
  that a mods.toml carrying only logoFile (no [[mods]] array) still
  resolves the icon.

- tui/widgets/instances.rs: 12 new tests for format_last_played. One
  case for the None input (returns "Never played"), then an rstest
  covering each bucket boundary in the match (0/59 just-now,
  60/3599 minutes, 3600/86399 hours, 86400/2591999 days,
  2592000/31535999 months, >=31536000 over-a-year). A mutation that
  bumps any boundary by one second, or swaps a unit suffix, fails at
  least one case.
2026-05-27 16:44:05 +02:00
objz 5dbb2be873 no-mistakes(lint): fix(lint): rustfmt formatting in mods.rs 2026-04-25 14:25:04 +02:00
objz aa19e5bde1 fix(tui): allow navigating filtered results after searching
enter now confirms the search and returns focus to the list so items
can be selected, toggled, etc. pressing / returns to the search bar
with the query intact, esc clears it.
2026-04-25 12:40:42 +02:00
objz b3da19cbaf fix(instance): apply edited memory config immediately 2026-04-25 11:52:38 +02:00
objz 52787b57c7 fix: switch default profile to terminal and fixed some comments 2026-04-18 19:44:59 +02:00
objz 47dad69321 refactor: upgrade crates and restructure project 2026-04-18 16:59:27 +02:00
72-S 8685fa9800 refactor(tui): rename instances to profiles 2025-03-11 19:10:18 +01:00
72-S ad3243cffe fix: update default config values 2025-03-09 00:40:01 +01:00
72-S f571aa3183 feat: improve config system 2025-03-08 22:33:21 +01:00
72-S 3bc5432a20 feat(tui): render instances as multi-line rows 2025-03-05 13:36:49 +01:00
72-S 96fe87fc69 feat(tui): add per-widget config, keybinds, and scrollbar 2025-02-16 21:22:45 +01:00