Skip to content

Add tray customization and reliable configuration handling - #1

Merged
vorflux[bot] merged 4 commits into
mainfrom
bot/customization-reliability
Nov 17, 2026
Merged

vorflux[bot] merged 4 commits into
mainfrom
bot/customization-reliability

Conversation

@vorflux

@vorflux vorflux Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Customize MicroBin and keep its tray appearance reliable

Open PR tour

MicroBin supports custom tray icons and configurable Windows confirmation, progress, and sound. It preserves legacy labels and silent-empty defaults. The app now restores its configured tray appearance after Explorer restarts and avoids repeated missing-config warnings in read-only folders.

Why — limited customization and unreliable recovery

The original app only customized four labels and hid operation failures. The upstream tray library lost custom appearance after Explorer restarts. A missing configuration in a read-only folder caused a warning on every launch.

What — compatible settings and persistent tray appearance

  • Load partial and legacy configuration with defaults. Reject invalid values and unknown keys without replacing existing files.
  • Load custom ICO files relative to the configuration directory. Report loading failures and use the embedded icon.
  • Configure confirmation, progress, and sound independently. The example enables confirmation; generated defaults preserve legacy behavior.
  • Report native failures without treating cancellation or an already-empty bin as errors.
  • Restore the saved icon, tooltip, identity, and callback after TaskbarCreated. A Windows-only local tray-item patch retains the upstream MIT license and documents its changes.
  • Use defaults silently when configuration is missing and creation returns PermissionDenied. Existing unreadable or invalid configuration still reports an error.
  • Provide Russian/English documentation and Linux/Windows CI, including Windows tray-library tests and lint checks.

How — preserve settings and reuse native tray state

---
config:
  flowchart:
    wrappingWidth: 1000
---
flowchart TD
  A["Read config.toml"] --> B{"Settings available?"}
  B -->|Yes| C["Validate settings"]
  B -->|No| D["Create settings or<br/>use defaults"]
  C --> E["Create tray and<br/>save appearance"]
  D --> E
  E --> F["Run native menu<br/>actions"]
  E --> G["Explorer restarts"]
  G --> H["Restore saved icon,<br/>tooltip and callback"]
Loading
  1. Load: Preserve existing configuration and use compatible defaults for missing options.
  2. Apply: Map settings to native tray and Shell behavior.
  3. Recover: Copy the saved tray state before re-adding the icon. Release state locks before Shell calls.

In one line: More customization, preserved configuration, and recovery of the selected tray appearance.

Out-of-Scope Feedback

  • Restore tray appearance after Explorer restarts — Fix requested. Implemented with saved notification state and targeted regression tests. Native Explorer recovery still needs a Windows live check.
  • Reduce repeated configuration warnings in read-only folders — Fix requested. Implemented for PermissionDenied when creating a missing configuration. Existing files remain unchanged and existing-file errors stay visible.
  • Prevent tray recovery during shutdown — Pending. Upstream deletes the icon before stopping the window thread. A TaskbarCreated message in that narrow interval can leave a temporary ghost icon. A separate fix should disable recovery before deletion and stop pending recovery safely.

Testing

Independent testing completed on the final source and release package. The squash merge is on main at 1c9635d, with the same source tree as c2ab89c. Overall status: Partial, because native GUI checks remain unavailable. Seventeen checks passed, including the docs-only packaging follow-up; eight native Windows areas remain unverified. Passed commands and checks:

  • cargo fmt --all -- --check
  • cargo test --locked: 12 configuration tests, including real read-only directory and unreadable-file checks on Linux.
  • cargo clippy --locked --all-targets -- -D warnings
  • cargo build --locked --release --target x86_64-pc-windows-gnu
  • cargo test --locked -p tray-item --lib --target x86_64-pc-windows-gnu --no-run: Windows recovery tests compile; no execution claimed.
  • cargo clippy --locked --all-targets --target x86_64-pc-windows-gnu -- -D warnings
  • cargo clippy --locked -p tray-item --all-targets --target x86_64-pc-windows-gnu -- -D warnings
  • git diff --check
  • Three saved-state regression tests passed through a throwaway Linux harness using the actual vendored module. This is portable logic evidence, not native Explorer recovery.
  • Five deliberate saved-state mutations were caught by those tests.
  • Real-permission fixtures verified missing, invalid, valid read-only, unreadable, and inaccessible-parent cases without replacing existing bytes.
  • Concurrent configuration creation: 800 loads across 100 eight-thread runs; no failures.
  • Workspace checks confirmed the Windows path patch, Linux isolation from desktop dependencies, and unchanged lockfile bytes during verification.

The initial vendored build exposed six upstream Clippy warnings. Mechanical fixes resolved those warnings. Cargo still emits a harmless redundant homepage/repository manifest warning.

Native Windows tray, real TaskbarCreated delivery, ICO loading/fallback, menus, dialogs, confirmation/cancellation, progress, sound, Windows folder ACL behavior, and OS theme checks remain unverified. No Recycle Bin contents were touched. Main CI passed on Linux and Windows: https://github.com/vaniley/MicroBin/actions/runs/44183242589. Windows executed 10 configuration tests and 3 saved-state tests, strict lint, and the MSVC release build. This native test execution does not verify the tray GUI. No screenshots or recordings exist because no native Windows UI could run.

Release package verification confirmed ZIP integrity, checksums, the exact CI executable, GUI subsystem, icon resources, imports, license, configuration example, and source provenance. The package includes the Visual C++ x64 runtime prerequisite in its release notes. The executable was not launched by the agent.

Risk Assessment

3/10 — Low. Verdict: Safe to ship, with a manual Windows check before release.

Review found no blocking issues. It confirmed saved-state sharing, lock release before Shell calls, callback identity, custom icon lifetime, and existing-file safety. The Windows-only dependency cleanup followed review and did not change recovery logic.

Remaining concerns: native runtime behavior is unverified; the project maintains a local native-library patch; the pre-existing narrow shutdown race remains a separate finding.

Release

Merged into main and published as the latest stable release: https://github.com/vaniley/MicroBin/releases/tag/v0.1.0.

The Windows x64 ZIP comes from the successful main MSVC build. It includes configuration, bilingual documentation, patch license, provenance, and release notes. A fresh download of the published assets passed checksum verification. The package requires the Visual C++ 2015–2022 x64 runtime if VCRUNTIME140.dll is missing.

UI brief

Reuse the native tray menu, icons, tooltips, and Shell dialogs. No layout, token, or custom theme changes. Added states: Explorer recovery and missing configuration in a read-only folder. UI gaps: native interaction, theme, and screenshot evidence remain unverified because no Windows runtime is available.

Setup notes

Linux verification requires stable Rust. Windows cross-builds additionally require MinGW-w64 GCC/windres and the Rust Windows GNU target. The root package is the default workspace member so Linux checks do not build a desktop backend. Windows CI additionally runs cargo test --locked -p tray-item --lib and strict lint for the local library. The repository has no configured machine blueprint.


Session Details

@vorflux
vorflux Bot merged commit 1c9635d into main Nov 17, 2026
4 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.

0 participants