Skip to content

fix(gui): open the config folder from the fail-closed config screen - #942

Open
yuzi-co wants to merge 1 commit into
AprilNEA:masterfrom
yuzi-co:fix/windows-open-config-folder
Open

fix(gui): open the config folder from the fail-closed config screen#942
yuzi-co wants to merge 1 commit into
AprilNEA:masterfrom
yuzi-co:fix/windows-open-config-folder

Conversation

@yuzi-co

@yuzi-co yuzi-co commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

The Open Configuration Folder button on the fail-closed configuration-error
screen did nothing on Windows — no Explorer window, no error, no feedback.

It was the only cx.dispatch_action call site in the GUI. App::dispatch_action
routes through the active window instead of dispatching globally, and swallows
the failure when that window cannot be resolved:

if let Some(active_window) = self.active_window() {
    active_window
        .update(self, |_, window, cx| window.dispatch_action(action.boxed_clone(), cx))
        .log_err();               // <- "window not found", action dropped
} else {
    self.dispatch_global_action(action);
}

On that frame active_window() yields a handle update() cannot resolve, so the
OpenConfigFolder handler never ran. Instrumented capture of a real click:

WARN  openlogi_desktop::app::status: open-config-folder button clicked
ERROR gpui::app: window not found

The click reaches on_click; the handler is never entered.

This is also the one screen where a second window is always in play — an
unreadable config falls back to Config::ephemeral(), so update_prompt_seen
stays false and runtime.rs:113 opens the update-consent window alongside the
error frame on every launch. That is the likely trigger for the unresolvable
handle; the dropped dispatch is what was directly observed.

The other two buttons that reveal the same folder (right panel → Config
folder
, Settings → About → Show in file manager) call cx.open_url
directly and were unaffected. Verified during diagnosis that the path and URL
themselves are fine on Windows: config_dir() resolves to a mixed-separator
C:\Users\…\.config/openlogi (etcetera's ".config/" default), which
Url::from_file_path normalizes to an identical, working
file:///C:/Users/…/.config/openlogi. That separator wart is real but cosmetic
and is left for a separate change.

Changes

crates/openlogi-desktop

  • app/menu.rs: add open_config_folder, the single reveal helper; the
    OpenConfigFolder action now delegates to it, and file_url becomes private.
  • app/status.rs: the config-error button calls the helper directly instead of
    dispatching the action. This is the fix.
  • app/detail.rs, windows/settings/about.rs: call the same helper, replacing
    two near-duplicate inline implementations (about.rs had its own copy of
    Url::from_file_path).

Only the menu bar, which has no view to call from, still goes through the action.

Testing

Runtime-verified on Windows 11 Pro (10.0.26200) against a deterministic
reproduction — schema_version = 99 in config.toml to force the error frame,
then clicking the button:

  • before: click logged, ERROR gpui::app: window not found, no Explorer window.
  • after: Explorer opens at file:///C:/Users/…/.config/openlogi, no error.

Not exercised on macOS or Linux; the changed code is not cfg-gated.

Commands run on the final tree (Windows host):

cargo fmt --all -- --check                                    # pass
RUSTFLAGS="-D warnings" cargo clippy --workspace --all-targets -- -D warnings   # pass
RUSTFLAGS="-D warnings" cargo test --workspace --no-fail-fast # 1 pre-existing failure, see below
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items \
  --exclude openlogi-ui --exclude openlogi-desktop --exclude openlogi-overlay \
  --exclude openlogi-agent                                    # pre-existing failure, see below

Two gate steps fail on this Windows host before this change — both reproduced
on an untouched branch, neither touched by this diff:

  1. xtask::commands::ci::jobs::tests::ci_yml_runs_what_this_runner_runs — asserts
    ci.yml runs the rustdoc command, but core.autocrlf=true checks ci.yml out
    with CRLF, so the \-continuation join does not match. Windows-checkout only.
  2. cargo doc cannot document openlogi-permissions — its module docs link
    [`PermissionStatus::Unknown`] and [`open_pane`], both
    #[cfg(any(target_os = "macos", target_os = "linux"))], so the links cannot
    resolve on Windows on any branch. CI runs this job on Linux, where it passes.

Every other workspace test target passed. CI jobs not reproducible on this host
(Linux clippy, MSRV, cargo-deny, shell lint) were not run.

Fixes #941

@yuzi-co
yuzi-co requested a review from AprilNEA as a code owner August 24, 2026 19:37
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Greptile Summary

The PR fixes the configuration-error screen’s folder button by bypassing active-window action dispatch and consolidates all configuration-folder reveal behavior behind one helper.

  • Adds a shared open_config_folder helper that converts the configuration directory to a file URL and opens it through the application context.
  • Calls the helper directly from the fail-closed screen, device details, and About settings.
  • Retains action-based handling only for the application menu.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/openlogi-desktop/src/app/menu.rs Introduces the shared configuration-folder helper and preserves the menu action’s existing behavior.
crates/openlogi-desktop/src/app/status.rs Fixes the failing configuration-error button by invoking the folder-opening helper directly.
crates/openlogi-desktop/src/app/detail.rs Replaces equivalent inline folder-opening logic with the shared helper.
crates/openlogi-desktop/src/windows/settings/about.rs Reuses the shared helper while preserving the displayed config-file path and revealed directory.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Config error button] --> B[open_config_folder]
    C[Device details button] --> B
    D[About settings button] --> B
    E[Application menu action] --> B
    B --> F[Resolve config_dir]
    F --> G[Convert to file URL]
    G --> H[App open_url]
Loading

Reviews (2): Last reviewed commit: "fix(gui): open the config folder from th..." | Re-trigger Greptile

@davidbudnick davidbudnick added type: bug Something is broken or behaves incorrectly area: gui Graphical user interface platform: all Cross-platform issue labels Aug 25, 2026
The "Open Configuration Folder" button on the configuration-error frame
did nothing on Windows. It was the only `cx.dispatch_action` call site in
the GUI, and `App::dispatch_action` routes through the *active* window
rather than dispatching globally, swallowing the failure when that window
cannot be resolved:

    if let Some(active_window) = self.active_window() {
        active_window.update(self, ...).log_err();  // "window not found"
    } else {
        self.dispatch_global_action(action);
    }

On this frame `active_window()` yields a handle `update()` cannot resolve,
so the `OpenConfigFolder` handler never ran — the click reached `on_click`
and the action was dropped with only a swallowed log line to show for it.
This is also the one screen where a second window is always in play: an
unreadable config falls back to `Config::ephemeral()`, leaving
`update_prompt_seen` false so the update-consent window opens alongside it
on every launch.

Give the three in-window buttons one `open_config_folder` helper and have
them call it directly; only the menu bar, which has no view to call from,
still goes through the action. That also collapses three near-duplicate
implementations of the same reveal — `about.rs` had its own inline
`Url::from_file_path` copy — and lets `file_url` go private.

Fixes AprilNEA#941
@yuzi-co
yuzi-co force-pushed the fix/windows-open-config-folder branch from ee2c7c9 to 7d3d61d Compare August 25, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: gui Graphical user interface platform: all Cross-platform issue type: bug Something is broken or behaves incorrectly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "Open Configuration Folder" on the config-error screen does nothing on Windows

2 participants