Skip to content

Save the app's settings, keep layers by stable id, release 0.6.0 - #24

Merged
byRandom merged 1 commit into
mainfrom
feat/saved-settings
Nov 14, 2026
Merged

byRandom merged 1 commit into
mainfrom
feat/saved-settings

Conversation

@byRandom

Copy link
Copy Markdown
Owner

This finishes 0.6 with saved settings, and does proposal #4 of the architecture review: layers get stable ids. It also prepares release 0.6.0.

Saved settings

  • The app remembers these between runs:
    • the seed;
    • the dimension;
    • the view (center, zoom, biome y);
    • which layers and overlays are shown;
    • the seed finder's query (center, filters, biome, seed range).
  • They are stored through eframe's persistence feature, as a RON file in the platform's app data folder. The new settings.rs defines Settings, with a version field.
  • Every field has a default, so a file written by another version still loads: missing fields get their default and unknown fields are ignored.
  • The values are checked on load: zoom and y are clamped, and a non-finite center becomes 0.
  • If the seed field holds text that was never applied, the app saves the seed actually shown on the map.

Layers with stable ids (proposal #4)

  • Each Kind now has an id (villages, bastions, end_cities, …) and a Source: Spawn, Strongholds, or Set { set, only }.
  • The pseudo set names SPAWN and STRONGHOLDS are gone, along with the string comparisons spread across the app. That logic now lives on the layer: is_spawn(), searchable(), has_ships() and select().
  • Settings and finder filters refer to layers by id, never by their position in the list:
    • a layer added later shows its default;
    • a layer that no longer exists is ignored;
    • a finder filter on a missing layer is dropped.

Tests

  • These are the app's first unit tests:
    • settings survive a save and load;
    • layers are kept by id;
    • partial files and files with unknown fields load;
    • layer ids are unique;
    • finder filters need a searchable layer.
  • Checked by hand under a virtual display:
    • the app saves its settings to app.ron;
    • after editing that file to Nether, seed 12345, 150 % zoom, a new center, nether fossils on and an end-city filter with a ship, a fresh start shows exactly that, both on the map and in the finder.

Release

Version 0.6.0, notes in docs/releases/v0.6.0.md. After merging, run Actions → Release → Run workflow on main.


Generated by Claude Code

The app now remembers the seed, the dimension, the view (center, zoom,
biome y), the shown layers and overlays, and the seed finder's query
between runs, through eframe's storage (a RON file in the platform's app
data folder). Every field has a default, so a file from another version
loads: missing fields take their default and unknown ones are ignored.

Layers are saved by a stable id, not by their position in the list, so
adding or reordering layers keeps a user's choices; a new layer takes its
default and a removed one is ignored. To get there, each layer now has an
id and a Source (the spawn, strongholds, or a structure set with an
optional prefix) instead of pseudo set names compared as strings across
the app: searchable(), has_ships() and select() live on the layer.

The app gets its first unit tests: settings round trip, layers kept by id,
partial and unknown files, unique ids, finder filters on missing layers.
Checked by hand under a virtual display: settings are saved, and an edited
file brings back the seed, Nether, zoom, center, layers and finder filter.

With mineshafts and the "possible" markers done, this completes 0.6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SenGxDDRwLejx8nir8GXKG
@byRandom
byRandom merged commit 760b2c1 into main Nov 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant