fix: loadout name now comes exclusively from the file name stem - #1242
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📝 WalkthroughWalkthroughLoadout identity now comes from the TOML filename. The internal ChangesLoadout identity migration
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The change makes loadout names derive from filename stems while preserving compatibility with existing files; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Disk
participant LoadoutFile
participant Loadout
Disk->>LoadoutFile: parse TOML content
Disk->>LoadoutFile: inspect optional declared name
Disk->>Loadout: provide filename stem
LoadoutFile->>Loadout: create resolved loadout
Loadout-->>Disk: return loadout or parse error
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
71c0999 to
9bf5c56
Compare
fixes https://github.com/gominimal/inbox/issues/476
Summary
A loadout is now identified solely by its filename. The name field inside the file is accepted, warned about, and discarded — matching the filename or not, loading continues either way, so existing loadouts keep working. Previously a disagreement was a hard LoadError::NameMismatch.
Internals: LoadoutFile holds a file's contents unnamed; into_loadout(stem) pairs it with the filename, so Loadout still carries a non-optional name and no caller changed. Docs and fixtures drop name = ....
Testing
cargo test --workspace green (sessions 404 → 407 tests), just clippy and cargo fmt --check clean. Manually verified via min loadout list: both warnings fire, and a file declaring something-else lists as its filename.
Checklist
Summary by CodeRabbit
New Features
namefield is optional and no longer overrides the filename.Bug Fixes
Documentation