Commit Graph
154 Commits
Author SHA1 Message Date
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 7a9dfa850d refactored: rework weak unit tests to catch real regressions
Audit found 9 confirmed-weak unit tests plus several newly-found ones that
asserted things equivalent to themselves, returned vacuous truth, or had
assertions guarded behind conditionals that silently swallowed failure.

Changes by file:

- auth/accounts.rs: create_offline_account_fields now pins the uuid to
  offline_uuid("TestPlayer") instead of !is_empty(); mutating the uuid
  derivation would fail this now.
- cli/mod.rs: parses_instance_list_subcommand drills into the list
  subcommand under instance rather than only verifying the instance
  group exists.
- config/theme.rs: border_style_roundtrip is now an rstest covering all
  four BorderStyle variants; mutating any non-Double arm is caught.
- instance/desktop.rs: removed desktop_path_returns_some (assertion was
  gated behind if let Some so could pass when the function returned
  None); build_content_linux* already covers the real behaviour.
- instance/launch/mod.rs: removed five predicate-only tests that
  asserted serde defaulting on LaunchProfile rather than invoking the
  migration predicate. Added two tests that actually call
  migrate_legacy_meta_if_needed (rstest over modern/legacy arg shapes)
  and migrate_legacy_loader_profile_if_needed (modern-with-inheritsFrom
  early-return). Renamed build_game_args_renders_upstream_arguments,
  dropping the misleading "and appends loader args" clause that the
  test never covered.
- instance/loader/mod.rs: removed test_vanilla_install_noop (no
  assertion at all) and test_vanilla_get_versions (asserted a hardcoded
  Ok(vec!["vanilla"]) return). Replaced test_vanilla_factory with an
  rstest covering all five ModLoader variants; a misordered match arm
  in get_installer is caught.
- migrate.rs: removed cleanup_instance_leftovers_handles_missing_dir
  (had no assertions and was redundant with
  cleanup_instance_leftovers_removes_shim_and_log4j).
- net/mod.rs: removed detect_java_falls_back_to_java which asserted
  !is_empty() against a function whose worst-case fallback is the
  literal string "java"; structurally uncatchable.
- tui/error_buffer.rs: peek_all_returns_newest_first and
  auto_assigned_ids_are_unique now tag their pushed events with a
  unique substring and filter peek_all_errors to just those, so the
  assertions actually fire instead of being silently skipped via
  if all.len() >= 2 when shared static state interfered.

Total: net zero change in test count (deletions and parameterised
replacements roughly balance), but mutation coverage of the surviving
suite is materially stronger.
2026-05-27 16:43:47 +02:00
objz 2163fef175 added: INFO-level snapshot + popup_area unit tests; rename narrow_frame test 2026-05-26 21:00:06 +02:00
objz c15cb9a378 added: ratatui snapshot tests for ErrorPopup (4 scenarios) 2026-05-26 20:59:59 +02:00
objz 961983d1fe removed: 6 useless tests (4 theatre + 2 wrapper redundancy) 2026-05-26 20:59:59 +02:00
objz a54e53038a fix(tui): memory_min/max now uses the real values from the config.toml instead of hardcoded values. same for java_path 2026-05-19 19:33:54 +02:00
objz ae2524f2ce feat!: rename project from mcl/mcl-launcher to rmcl
Renames Cargo package, binary, internal path identifiers, java shim,
user-agent, log filename, desktop shortcut Exec lines, and CLI program
name. Wires src/migrate.rs into main() so existing users have their
on-disk data (~/.config/mcl/, ~/.local/share/mcl/, ~/.cache/mcl/) moved
to the new locations on first launch.

BREAKING CHANGE: binary is now named rmcl. Old paths are auto-migrated.
2026-05-13 21:06:34 +02:00
objz d5cbc11c8a fix(tui): use open::that_detached to prevent freeze when opening directories 2026-05-02 21:42:43 +02:00
objz 2ea20b0a99 fix: renamed details.rs to settings.rs; the name was outdated as the label change to settings 2026-05-02 21:36:22 +02:00
objz 1feb1679ff fix: clippy errors 2026-04-26 21:27:14 +02:00
objz 33b2d856bc feat: require verified account for offline play 2026-04-26 20:37:52 +02:00
objz 035bae98d9 fix(logs): show real filename for live log and keep content on instance stop
the live log entry now shows the actual log filename in green instead
of a generic "Live" label. when the instance stops while viewing the
live log, the viewer transitions to the on-disk file so the content
stays visible instead of going blank.
2026-04-25 15:34:20 +02:00
objz 82665bd4e6 merge: resolve conflicts keeping streaming load and notify watcher 2026-04-25 15:23:49 +02:00
objz 82d215f58b feat(content): streaming load and event-driven file watching with notify
replace mtime polling with the notify crate (v8) for cross-platform
file watching via inotify/FSEvents/ReadDirectoryChanges. the initial
load now streams entries one by one through an mpsc channel so mods
appear as they are scanned instead of waiting for the full batch.

file changes detected by notify trigger a background directory diff
that applies incremental updates: toggles, removals, and per-file
scans for new entries. no full rescan ever happens after initial load.
instance switching restores from the in-memory cache instantly.
2026-04-25 15:19:54 +02:00
objz 1019169100 fix(tui): restore terminal on panic to prevent apparent freezes
without a panic hook, any panic left the terminal in raw mode with
the alternate screen active, making it look like the app froze.
2026-04-25 15:19:34 +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 e2caf66c19 fix(logging): applied env filter to global logging and applied timestamp saving. The readme was updated aswell 2026-04-23 20:13:08 +02:00
objz 5f3f7890aa added mmc/prism modpack import and refactored import module
split import.rs into import/ module with mod.rs, mrpack.rs, mmc.rs.
auto-detects pack format from zip contents (modrinth.index.json or
mmc-pack.json). moved input parsing from net/modrinth.rs to the
import module since it handles routing for all formats now.
2026-04-20 19:24:47 +02:00
objz 52787b57c7 fix: switch default profile to terminal and fixed some comments 2026-04-18 19:44:59 +02:00
objz 971375bf1f fix: resolve clippy issues 2026-04-18 17:09:01 +02:00
objz 47dad69321 refactor: upgrade crates and restructure project 2026-04-18 16:59:27 +02:00
objz ea093c044f feat(desktop): embed icon, shorten keybind label, add toggle feedback 2026-04-05 16:05:31 +02:00
objz 86d217903a fix(theme): add missing label_fg field to LogsTheme resolution 2026-04-05 15:38:14 +02:00
objz e18b18c0be feat(desktop): add per-instance desktop shortcut toggle 2026-04-05 15:12:48 +02:00
objz 3047086fa2 fix(theme): align popup_import fields with popup_new_instance pattern 2026-03-28 18:48:22 +01:00
objz f7349cada3 feat(theme): add dedicated popup_import theme section 2026-03-28 18:14:35 +01:00
objz 9070bef585 fix(tui): use error_buffer for import errors 2026-03-15 16:38:44 +01:00
objz 344358762f fix(tui): remove duplicate hint text from import input step 2026-03-15 16:12:27 +01:00
objz 6f8c6e6d9a fix(tui): move import keybind to content bar 2026-03-15 15:45:52 +01:00
objz dcadf1b1cc fix(tui): remove source step, add keybind hints 2026-03-15 15:24:18 +01:00
objz 5914e68b69 feat(tui): integrate import wizard into layout event loop 2026-03-14 15:52:07 +01:00
objz 8a9d6f9941 feat(tui): add import modpack wizard rendering 2026-03-14 15:28:19 +01:00
objz 6f44652622 feat(tui): add import wizard state machine and input handling 2026-03-14 15:05:42 +01:00
objz 2ae6beb43d test(error_buffer): add push, pop, peek, and overflow tests 2026-02-21 15:02:28 +01:00
objz 4f597d04b2 fix: resolve clippy warnings 2026-02-07 17:08:47 +01:00
objz 80210364d5 feat(theme): add palette system and per-element theming 2026-01-24 19:18:09 +01:00
objz ecc2b2bb23 feat(tui): rename tabs, add profile rename, fix editor spawning 2026-01-24 18:35:42 +01:00
objz df3d6b24c2 feat(tui): add rename functionality 2026-01-10 16:38:14 +01:00
objz 9e65fb43d8 feat(tui): auto-wrap keybind lines, show profiles keybinds 2026-01-10 15:55:33 +01:00
objz b0738761c9 feat(tui): add context-sensitive keybinds on bottom border of each panel 2026-01-10 15:22:06 +01:00
objz e5de3c14fc fix(tui): use content throbber for authenticating state 2026-01-10 14:51:18 +01:00
objz fc5b2cd0bb feat(tui): show authenticating throbber on launch 2026-01-10 14:32:45 +01:00
objz 3584f2c7cf fix(auth): deduplicate error popups, clear keyring errors 2025-12-27 16:52:14 +01:00
objz d3efaca167 fix(tui): fix log viewer keybinds 2025-12-27 16:28:47 +01:00
objz 60385e7916 fix(tui): abort launch on auth failure, add auth error variant 2025-12-27 16:05:33 +01:00
objz 14fd9d1ebc fix(tui): fix launch panic, highlight search matches 2025-12-27 15:41:05 +01:00
objz 41a63e16c4 feat(tui): add custom scrollable searchable log viewer 2025-12-27 15:12:28 +01:00
objz cba8fa7661 feat(tui): add search to all content tabs 2025-12-13 20:38:42 +01:00