Commit Graph
131 Commits
Author SHA1 Message Date
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 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 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 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 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 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 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 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 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 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
objz 3a637a1dbd fix(auth): use pre-approved client ID, oauth2 for token refresh 2025-12-13 20:05:17 +01:00
objz 5189eace8a feat(auth): add Microsoft and offline account system 2025-12-13 19:14:51 +01:00
objz 011e0ef6bf feat(tui): move tabs to border title, fix live log auto-scroll 2025-11-29 20:42:33 +01:00
objz bc07b4af31 fix(tui): use Shift+hjkl for screenshots and logs nav 2025-11-29 20:12:05 +01:00
objz facd9f5967 fix(tui): logs viewer split pane, live log entry, periodic rescan 2025-11-29 19:15:28 +01:00
objz 83dd7efc11 feat(tui): redesign logs tab with split pane viewer 2025-11-29 18:38:42 +01:00
objz 24a8afe29b feat(tui): add worlds tab with dynamic icon heights 2025-11-15 17:31:07 +01:00
objz c3a26eaac2 feat(tui): add screenshots grid with kitty protocol 2025-11-15 16:44:53 +01:00