Commit Graph
268 Commits
Author SHA1 Message Date
objz c792e1cc11 perf(tui): avoid redundant idle rendering 2026-07-11 17:13:02 +02:00
objz d10be1676e Merge pull request #25 from objz/feature/image-render-options
Feature/image render options
2026-07-11 16:04:25 +02:00
objz b94957a952 fix: formatting 2026-07-11 15:46:15 +02:00
objz 6f5722aa02 feat(tui): render streamed content icons 2026-07-11 15:41:51 +02:00
objz 4bf43a438b feat(content): add quadrant icon rasterization 2026-07-11 15:41:36 +02:00
objz b372571648 feat(config): add terminal image mode setting 2026-07-11 15:41:21 +02:00
objz b5d98e5e8a fix: polling noice on log and cache for scanning java version 2026-07-10 17:06:59 +02:00
objz 7e5ff7f75f fix(ci): choco validation file was remove and fixed icon paths 2026-07-10 16:56:11 +02:00
objz 099d96bcca Merge pull request #23 from objz/feature/delete-mods
feat(tui): add delete actions for instance content
2026-07-10 16:46:34 +02:00
objz 4ba9c65f73 fix(tui): route account deletes through shared confirmation 2026-07-10 16:39:43 +02:00
objz be01370ab2 feature(tui): added delete button to every content type 2026-07-10 16:35:55 +02:00
objz 4ddb8f49bb Merge pull request #24 from objz/feature/config-sync
feat(config-sync): add shared config profiles
2026-07-10 16:30:00 +02:00
objz 4576da4551 fix(config-sync): satisfy clippy warnings 2026-07-10 16:20:03 +02:00
objz 269814945d feat(tui): manage config profiles from settings 2026-07-10 16:12:48 +02:00
objz 69549b7152 feat(config-sync): add per-instance config profiles 2026-07-10 16:09:47 +02:00
objz 8f16931502 chore: v0.3.2 v0.3.2 2026-06-16 15:17:55 +02:00
objz a95250cf9a Merge pull request #21 from objz/fix/adding-neoforge-instance-fails
Fix/adding neoforge instance fails
2026-06-16 15:13:30 +02:00
objz 2adfd0afbd Merge pull request #20 from objz/fix/sun-misc-unsafe-memory-accessallow
Fix/sun misc unsafe memory accessallow
2026-06-16 15:13:15 +02:00
objz 3ab6adf700 Merge pull request #22 from objz/fix/aur-failed-to-install
fix(pkg): isolate cargo target and config for AUR builds
2026-06-16 15:12:31 +02:00
objz 7c59758f5f fix(pkg): isolate cargo target and config for AUR builds 2026-06-16 15:08:14 +02:00
objz 63d7ef0fa1 fix: lib directory should point to the local libs preffered, only shared libs as backup to prevent corruption neoforge installation 2026-06-16 14:13:57 +02:00
objz 68d2f45236 fix: point -Duser to the right directory to prevent crashes 2026-06-16 14:13:57 +02:00
objz 3dd384c5c6 fixed clippy fail on windows caused by dead code that is only needed on unix 2026-06-16 14:01:32 +02:00
objz c5da2c7c99 fixed duplicate error messages on installer failure and added new error type 2026-06-16 13:25:28 +02:00
objz 1fd1b4e09d fix(launch): validate required Java version before launch 2026-06-16 12:32:37 +02:00
objz 0d9cd9c6b8 fixed duplicate logs 2026-06-16 12:26:18 +02:00
objz 09f403aa07 fixed noisy log 2026-06-16 12:07:31 +02:00
objz 3d7f233e27 fixed clippy issues 2026-06-16 10:35:34 +02:00
objz db23b86dca fix: flush downloaded files before returning 2026-06-16 10:27:21 +02:00
objz 09bc8f26fb chore: improve rmcl diagnostic logging 2026-06-16 10:22:51 +02:00
objz a58e6fb76d style: apply rustfmt 2026-06-16 09:58:34 +02:00
objz 7723716e18 Merge pull request #12 from objz/stout/sterr-parse-tui
added minecraft log parser
2026-06-13 16:53:21 +02:00
objz 29280e9f8d added minecraft log parser 2026-06-13 16:27:05 +02:00
objz e7e033715e fixed shocase gif 2026-06-12 11:36:19 +02:00
objz 4c22381675 added showcase.gif to the readme 2026-06-12 09:58:18 +02:00
objz e809fac364 fix generated wix v0.3.1 2026-06-11 21:00:55 +02:00
objz bf95404920 fix(test): peek_does_not_remove() was failing falsely 2026-06-11 20:47:22 +02:00
objz 4197beea3c chore(0.3.1 2026-06-11 20:08:30 +02:00
objz 10bfe8ad2f Merge branch 'master' of https://github.com/objz/rmcl 2026-06-11 20:06:24 +02:00
objz 58cbeb3ba0 removed println when launching from cli, so it does not open a seperate terminal window for a headless launch 2026-06-11 20:06:02 +02:00
objz 8b15dbcda5 removed println when launching from cli, so it does not open a seperate terminal window for a headless launch 2026-06-11 19:35:12 +02:00
objz 595af32e54 Merge pull request #9 from objz/test-overhaul
refactor: test suite overhaul (lib.rs split, snapshots, CI canaries)
2026-06-11 20:06:56 +03:00
objz c6c774b1e3 refactored: final review polish and detect_format + neoforge coverage
Addresses the six items the last review flagged. Four are polish for
existing tests; two add coverage for previously-untested public APIs.

Polish:

- instance/content/mods.rs: icon_path_from_value_map now asserts a
  single deterministic value. serde_json::Map is a BTreeMap so the
  "128" key sorts before "64" and the test no longer needs an
  order-tolerant disjunction.

- cli/log.rs: replace the hand-rolled unique_temp_dir with
  tempfile::tempdir() across both tests. Drop the trailing
  remove_dir_all cleanup since TempDir handles that on Drop. Last
  inline test file using the hand-rolled pattern.

- running.rs: remove drain_empty_returns_empty. Two consecutive calls
  to drain_last_played in the same test can race with the parallel
  push_and_drain_last_played test which pushes to the same global
  LAST_PLAYED state. drain semantics are covered by the existing
  push_and_drain test.

- tui/error_buffer.rs: peek_does_not_remove now actually verifies the
  invariant the name promises. Pushes a tagged event, captures the
  count before and after peek_error, asserts the count is unchanged
  and the tagged event is still in the queue. Previous version only
  asserted that something was returned.

New coverage:

- net/neoforge.rs: added fetch_neoforge_game_versions_from(client,
  api_url) mirroring the existing _from pattern. tests/net_loaders.rs
  gains neoforge_fetch_game_versions_reverse_engineers_mc_versions
  covering the maven-version-to-MC-version reverse mapping, which was
  only touched by the #[ignore] live API test before.

- instance/import/mod.rs: six new tests for detect_format covering
  mrpack detection, mmc-pack at root and nested, the priority case
  where both markers are present, unknown archives, and missing
  files. Helper make_pack_zip builds in-memory zips so the tests
  don't need fixture files on disk.
2026-05-27 18:55:19 +02:00
objz 5f43128a80 added: tests for patches helpers, forge installer detection, url_encode, profile fetchers
Closes the seven remaining tractable coverage gaps the final review
flagged. All tests-only or tiny *_from variants matching the existing
pattern. 18 new tests.

- src/instance/launch/patches.rs: seven inline tests for the lwjgl3ify
  patch helpers that were entirely untested before. strip_replaced_libs
  has happy + no-op cases. parse_add_opens covers the basic Add-Opens
  extraction, the MANIFEST.MF continuation-line case (the tricky one:
  jar manifests wrap lines with a trailing space + leading-space marker
  that gets stripped on join), missing manifest, and missing file.
  add_lwjgl3 verifies that only jars that actually exist in lib_dir
  end up on the classpath.

- src/net/forge.rs: three inline tests for has_legacy_install_profile.
  Builds synthetic forge installer zips in a tempdir with and without
  the versionInfo key in install_profile.json; covers the missing-jar
  branch with a path that doesn't exist.

- src/net/modrinth.rs: five-case rstest for url_encode covering the
  unreserved set, space, RFC 3986 reserved characters, multi-byte UTF-8
  (the encoder operates per-byte so emoji exercises the multi-byte
  path), and empty input.

- src/net/fabric.rs / src/net/quilt.rs: added fetch_*_profile_from and
  fetch_*_profile_with_raw_from variants mirroring the existing pattern.
  Existing fetch_*_profile and *_with_raw delegate to them with the
  upstream constants.

- tests/net_loaders.rs: two new wiremock tests (fabric_fetch_profile
  parses libraries, quilt_fetch_profile parses libraries) using the
  new _from variants.

- src/tui/widgets/popups/import_modpack/render.rs: extra snapshot for
  the Confirm step when loader_version is None (vanilla pack or old
  mmc pack). The previous Confirm snapshot covered Some(_) only.

Production touches stay minimal: the four new pub fn delegators in
fabric.rs and quilt.rs, all behaviour-preserving.
2026-05-27 18:19:26 +02:00
objz 0eb47fd7b4 added: *_from variants in net::{forge,fabric,quilt,neoforge} + assets
Same pattern as fetch_version_manifest_from from the earlier batch:
each fetcher gets a sibling that takes the URL as a parameter; the
existing function delegates to it with the upstream constant.
Production callers are unchanged.

- src/net/forge.rs: fetch_forge_versions_from(client, promotions_url,
  game_version) and fetch_forge_game_versions_from(client,
  promotions_url).
- src/net/fabric.rs: fetch_fabric_game_versions_from(client, base) and
  fetch_fabric_versions_from(client, base, game_version). The fabric
  API is hierarchical so the helpers take the meta base URL and append
  the rest internally, matching the existing layout.
- src/net/quilt.rs: same pair as fabric.
- src/net/neoforge.rs: fetch_neoforge_versions_from(client, api_url,
  game_version).
- src/net/mojang.rs: download_assets_from(client, meta, meta_dir,
  assets_base) so tests can route per-asset CDN downloads through a
  wiremock server. download_assets delegates to it with
  ASSETS_BASE_URL.

tests/net_loaders.rs adds eight wiremock tests covering each new
fetcher and a happy + error case for neoforge's invalid-game-version
branch. tests/net_mojang.rs gains download_assets_from_writes_index_and_assets
which now exercises the full per-asset download path against synthetic
hashes.

Production touches are minimal (one new pub fn delegating to the
existing one for each fetcher). Behaviour of existing callers is
unchanged.
2026-05-27 18:03:57 +02:00
objz 0d1b7984fc added: deferred tests-only items (extra wizard snapshots + library/asset downloads)
Closes the "zero production touches" subset of the deferred coverage
items the audit had flagged.

- src/tui/widgets/popups/new_instance/render.rs: three new snapshots
  for the Version, LoaderVersion, and Confirm steps. Each pre-populates
  WIZARD_STATE so ensure_versions_loaded and ensure_loader_versions_loaded
  short-circuit on LoadState::Loaded and never spawn a network task. The
  TEST_SERIAL mutex established in the earlier batch serialises against
  the existing Name/Loader snapshots.

- src/tui/widgets/popups/import_modpack/render.rs: two new snapshots
  for the Version step (synthetic VersionInfo entries) and the Confirm
  step (synthetic ImportSummary). Same serialisation pattern.

- tests/net_mojang.rs: three new wiremock tests.
  download_libraries_writes_artifact_to_meta_dir constructs a synthetic
  VersionMeta whose single library points at the wiremock server, then
  asserts the bytes land at meta_dir/libraries/<artifact.path>.
  download_libraries_skips_when_destination_exists verifies the cache
  hit path via wiremock's expect(0).
  download_assets_writes_index_when_objects_is_empty exercises the
  index fetch+write code path with an empty objects map so the per-asset
  download loop never fires.

  Zero production touches. download_libraries already takes a
  VersionMeta whose libraries carry their own URLs; download_assets'
  index fetch reads from meta.asset_index.url (also configurable
  per-call), so the empty-objects path doesn't need ASSETS_BASE_URL
  overridable. Full per-asset coverage lands in a separate commit.
2026-05-27 18:03:57 +02:00
objz d612f83446 refactored: address final review punch list
Final-review pass flagged three items. All addressed:

- src/instance/loader/mod.rs: rename and rewrite the two profile-shape
  tests so the test name matches what the body does.

  legacy_forge_version_info_round_trips_through_save_profile_json was
  misleading; the body never called save_installer_profile, it only
  wrote bytes to disk and read them back. Renamed to
  legacy_forge_version_info_deserialises_as_launch_profile and dropped
  the filesystem dance - the test was only ever verifying serde shape
  on the literal byte string.

  raw_fabric_profile_bytes_parse_as_launch_profile got the same
  treatment for consistency: dropped the TempDir + write + read round
  trip since the test only checks deserialisation.

- src/tui/error_buffer.rs: removed has_errors_after_push. The test
  read global state populated by other tests in the same module, so
  it would still pass if push_error were a no-op. The push semantics
  are properly covered by peek_all_returns_newest_first and
  overflow_drops_oldest, both of which use unique tagged messages to
  isolate from cross-test interference.
2026-05-27 17:42:14 +02:00
objz 8d7a0903fd refactored: DRY repetitive test fixtures with owning struct + rstest
Picks up the remaining test-only suggestions from the style audit. No
production code change.

- launch_profile/templates.rs: introduces a Fixture struct that owns
  the four PathBuf inputs (lib/nat/game/assets) and exposes a ctx()
  method. Eight tests that each rebuilt the same context inline now
  collapse into one rstest with eight cases plus two standalone
  tests for the recursive-substitution and Windows-backslash edge
  cases. Net code: ~120 lines saved.

- launch_profile/render.rs: same pattern. Fixture::new() owns the
  paths plus a FeatureSet; ctx() and rule_ctx() expose what every
  test needs. Six tests stop redeclaring four PathBufs + a five-line
  RuleContext literal apiece.

- instance/launch/mod.rs: three installer_version_dir_name tests
  (Forge / NeoForge / non-installer loaders) become one rstest with
  five cases (one per ModLoader variant). A regression that
  misorders the match arms would now fail a specific case, not just
  the catch-all "non-installer" test.

- instance/content/resource_packs.rs: ten extract_description_*
  tests become one rstest with ten cases. Each case still hits a
  distinct match arm (string, object{text}, object{no text}, array
  variants, null, number, bool); the rstest is cosmetic, not a
  consolidation that loses coverage.

Net effect: same coverage, ~250 lines less repetitive test setup,
clearer intent. Test count rises by 2 because rstest expands cases
into separate test functions.
2026-05-27 17:35:50 +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 6ac9f4e239 added: net::mojang wiremock tests via *_from URL variants
The existing fetch_version_manifest hard-codes the Mojang URL, so tests
either had to hit the live endpoint (the #[ignore] live-API test) or
not run at all. Adds fetch_version_manifest_from(client, url) that lets
callers pick the URL; fetch_version_manifest stays compatible by
delegating with the upstream constant. fetch_version_meta_with_raw
already takes the URL via VersionEntry, no change needed.

tests/net_mojang.rs adds three wiremock tests:

- fetch_version_manifest_parses_synthetic_response verifies the
  VersionManifest deserialiser against a synthetic upstream-shaped
  payload (latest + versions list).
- fetch_version_meta_returns_struct_and_raw_bytes verifies both the
  parsed VersionMeta and the raw byte capture path used by the install
  flow to write upstream JSON byte-for-byte.
- fetch_version_manifest_retries_5xx_and_succeeds confirms the retry
  envelope integrates correctly with VersionManifest deserialisation
  on top of the retry-only tests in tests/net_retry.rs.

These don't replace the #[ignore = "hits live Mojang API"] canary
which still runs on master push to detect upstream schema drift.
2026-05-27 17:22:32 +02:00