Skip to content

fix(gui): fall back to the executable stem for a bare Windows path - #1463

Open
4ni1ak wants to merge 1 commit into
AprilNEA:masterfrom
4ni1ak:fix/windows-per-app-friendly-name
Open

4ni1ak wants to merge 1 commit into
AprilNEA:masterfrom
4ni1ak:fix/windows-per-app-friendly-name

Conversation

@4ni1ak

@4ni1ak 4ni1ak commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Per-app profile rows on Windows were all labelled "exe" instead of the application name.

Changes

  • crates/openlogi-desktop/src/features/profiles.rs: friendly_app_name only treated exe:-prefixed identifiers as paths. openlogi-hook's Windows ForegroundApp::id (crates/openlogi-hook/src/windows/hook.rs) is the bare lower-cased full executable path with no such prefix, so the function's dot-splitting fallback returned the segment after the last . for every Windows identifier — always exe. Now any identifier containing a path separator or ending in .exe (case-insensitively) is treated as a path and resolved to its file stem, whether or not it carries the exe: prefix.

Testing

  • cargo test -p openlogi-desktop (adds a_raw_windows_path_with_no_exe_prefix_still_resolves_to_the_stem, keeps the existing exe:-prefixed and bundle-id cases green)
  • cargo fmt --all -- --check
  • cargo clippy -p openlogi-desktop --all-targets -- -D warnings
  • Pure string-handling fix, not runtime-tested on Windows — the identifier format is confirmed by reading ForegroundApp::id's construction in openlogi-hook.

Fixes #1403

friendly_app_name only treated exe:-prefixed identifiers as paths, but
openlogi-hook's Windows ForegroundApp::id is a bare lower-cased full
executable path with no such prefix. Its dot rule returned the segment
after the last '.' for any identifier, so every Windows profile row
was labelled 'exe'.

Fixes AprilNEA#1403
@4ni1ak
4ni1ak requested a review from AprilNEA as a code owner September 17, 2026 06:33
@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking edge case where Windows executables using another extension receive an inconsistent profile label.

Fix All in CodexFindings

  1. P2 Incomplete Executable Stem

Summary

This PR updates profile-label formatting so bare Windows executable paths are recognized and displayed using their final path component instead of the generic exe suffix.

  • Recognizes both slash styles and case-insensitive .exe suffixes.
  • Preserves support for exe:-prefixed identifiers and reverse-DNS bundle identifiers.
  • Adds coverage for bare, lowercased Windows executable paths.
  • The fallback remains inconsistent with executable-stem handling for non-.exe Windows images.

Reviews (1) · Last reviewed commit: "fix(gui): fall back to the executable st..."

Comment on lines +380 to +385
let stem = name
.len()
.checked_sub(4)
.filter(|&i| name[i..].eq_ignore_ascii_case(".exe"))
.map_or(name, |i| &name[..i]);
return stem.to_string();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Incomplete executable stem

If a Windows executable uses another valid extension, such as c:\tools\app.com, this branch returns app.com. The Windows hook and other executable-name handling use Path::file_stem() and would return app, so the profile label can differ depending on whether the application was observed during the current session. Please derive the final component's stem consistently rather than removing only .exe.

Fix in Codex Fix in Claude Code

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.

[Bug]: Per-app profile picker labels every Windows application "exe"

1 participant