Repository navigation
refactor(arca-gui): move view-owned state mutations into AppController - #87
Merged
devin-ai-integration[bot] merged 2 commits intoOct 18, 2026
Merged
Conversation
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
devin-ai-integration
Bot
force-pushed
the
devin/1792271402-controller-owned-state
branch
3 times, most recently
from
October 18, 2026 10:40
58400e5 to
6156812
Compare
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…es through the controller Views mutated AppState and Settings directly and called Settings::save, which dropped I/O errors. Settings::save now returns io::Result and AppController::update_settings saves once and shows a failure as an error notice. Both create dialogs read the compressor from AppController::compressor and share one codec picker. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
force-pushed
the
devin/1792271402-controller-owned-state
branch
from
October 18, 2026 10:48
6156812 to
bc73d44
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Views in
arca-gui/src/ui/wrote straight intoAppState/Settingsand calledSettings::save()themselves, which silently dropped I/O errors. They also kept two copies of the codec/level picker that had drifted apart. The active pane's state was stored twice: in the legacyAppStatefields and inbrowser.panes[active], kept in sync bysnapshot_active_pane/restore_active_pane. Behavior is unchanged, except that a failed settings write now shows an error notice.Active pane: one copy of its state (commit 1)
AppState::{checked, filter, order, current_dir, cursor}.DirectoryPane::selected: HashSet<usize>is nowchecked: Vec<bool>.AppState::active_pane()/active_pane_mut()return&browser.panes[browser.active].snapshot_active_pane/restore_active_paneare gone. Switching panes callspane_switched(), which does what restore did: resizes the pane'scheckedtoentries.len()and clearslast_click,renamingand the preview.select_only(added on main in refactor(arca-gui): select a single row through one controller action #72 asAppAction::SelectOnly) now clearsactive_pane_mut().checkedand no longer needs a snapshot.Settings persistence
Every
settings.save()call inui/(dialogs including the theme library, header, sidebar, preview, browser, mod) and in the controller, includingset_archive_defaultsfrom #68, now goes through this path. New stringsettings_not_saved(en/es).Compressor picker
AppController::compressor_for(format, codec) -> Compressor::{Fixed("LZMA2"|"RAR"), Codec { codec, editable }}replaces the two copies of theis_lzma2/Format::Rarcheck.compressor()applies it to the session'sstate.format/state.codec.CODECSandLEVEL_PRESETSreplace the inline arrays.codec_combohelper:settings.new_format/new_codectocompressor_forand saves throughset_archive_defaults.compressor()and callsset_codec/set_level.Notices:
set_notice(text, error)replaces the pairednotice/errorwrites.Tests
New tests:
select_only_replaces_the_active_selectionandonly_zip_lets_the_codec_be_picked. #72'sselect_onlytest now checkspanes[0].checked.Ran locally:
cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,cargo test --workspace, both release builds, andbash interop.sh(146 passed).Not covered:
XDG_CONFIG_HOMEset for the whole process, and the tests run in parallel.Link to Devin session: https://app.devin.ai/sessions/f6cf7190c78d468b8c00be133c2d3a76
Open in Devin Desktop: https://app.devin.ai/desktop/session/f6cf7190c78d468b8c00be133c2d3a76?variant=devin
Requested by: @Villoh