long-msp-30 #1

Merged
longjacksonle merged 3 commits from long-msp-30 into main 2026-04-02 13:37:16 +02:00
Member

● Summary

Remove wrapper remnants and switch to GNU cross-compilation target

src/main.rs

  • Removed the WRAPPER_REMOTE_REPO / WRAPPER_REMOTE_VERSION / WRAPPER_REMOTE_SCRIPT check block from
    install_script() — the function now simply copies the current executable to self.install_path with no
    preconditions
  • Removed the WRAPPER environment variables section from help_text()

Cargo.toml

  • Commented out the [target.'cfg(windows)'.dependencies] windows crate entry — it does not link under the GNU
    target on Linux

CLAUDE.md

  • Updated build commands from cargo build --target x86_64-pc-windows-msvc to cargo zigbuild --target
    x86_64-pc-windows-gnu
  • Added a Dev Workflow section describing the Linux → Windows cycle (edit → build → copy .exe → test)
  • Updated Platform Notes to document the GNU target and why the windows crate is disabled

Add Windows 11 multi-tab Explorer save and restore

File format — bookmark files now use [Window] section headers:
[Window]
C:\Users\foo\Documents
C:\Users\foo\Downloads

[Window]
C:\Projects\my-app
First path in each group is the active (foreground) tab. Files without [Window] headers (old format) are
treated as a single window group for backward compatibility.

Save (save_bookmarks) — the three-line Shell.Application PowerShell script is replaced with a
UIAutomation-based script that:

  • Enumerates CabinetWClass windows and detects ShellTabWindowClass children
  • Gets the active tab path from Shell.Application COM (reliable)
  • For background tabs, temporarily activates each tab via SelectionItemPattern.Select(), reads the new active
    path from COM (up to 500 ms retry), then restores the original active tab
  • Falls back to single-path output on pre-22H2 Windows where no tab children are found

Restore (open_bookmarks) — rewritten to use a generated PowerShell script that:

  • Opens the first path per group with explorer.exe
  • Waits up to 3 seconds for the new window to register in Shell.Application
  • Opens remaining paths as tabs via IWebBrowser2.Navigate2(path, 0x800) (navOpenInNewTab flag)

New functions

  • parse_bookmark_file() — parses [Window] groups from a BufRead; 8 unit tests added
  • build_restore_script() — serialises window groups into the PowerShell restore script

Config — restore_max_file_size default raised from 1024 → 4096 bytes, range ceiling raised to 16384 to
accommodate larger multi-tab files

▎ Known limitation: Navigate2 with the navOpenInNewTab flag needs verification on a real Windows 11 machine.
If Explorer does not honour the flag, the first tab of each window will still restore correctly and subsequent
tabs will log warnings.

● Summary Remove wrapper remnants and switch to GNU cross-compilation target src/main.rs - Removed the WRAPPER_REMOTE_REPO / WRAPPER_REMOTE_VERSION / WRAPPER_REMOTE_SCRIPT check block from install_script() — the function now simply copies the current executable to self.install_path with no preconditions - Removed the WRAPPER environment variables section from help_text() Cargo.toml - Commented out the [target.'cfg(windows)'.dependencies] windows crate entry — it does not link under the GNU target on Linux CLAUDE.md - Updated build commands from cargo build --target x86_64-pc-windows-msvc to cargo zigbuild --target x86_64-pc-windows-gnu - Added a Dev Workflow section describing the Linux → Windows cycle (edit → build → copy .exe → test) - Updated Platform Notes to document the GNU target and why the windows crate is disabled --- Add Windows 11 multi-tab Explorer save and restore File format — bookmark files now use [Window] section headers: [Window] C:\Users\foo\Documents C:\Users\foo\Downloads [Window] C:\Projects\my-app First path in each group is the active (foreground) tab. Files without [Window] headers (old format) are treated as a single window group for backward compatibility. Save (save_bookmarks) — the three-line Shell.Application PowerShell script is replaced with a UIAutomation-based script that: - Enumerates CabinetWClass windows and detects ShellTabWindowClass children - Gets the active tab path from Shell.Application COM (reliable) - For background tabs, temporarily activates each tab via SelectionItemPattern.Select(), reads the new active path from COM (up to 500 ms retry), then restores the original active tab - Falls back to single-path output on pre-22H2 Windows where no tab children are found Restore (open_bookmarks) — rewritten to use a generated PowerShell script that: - Opens the first path per group with explorer.exe - Waits up to 3 seconds for the new window to register in Shell.Application - Opens remaining paths as tabs via IWebBrowser2.Navigate2(path, 0x800) (navOpenInNewTab flag) New functions - parse_bookmark_file() — parses [Window] groups from a BufRead; 8 unit tests added - build_restore_script() — serialises window groups into the PowerShell restore script Config — restore_max_file_size default raised from 1024 → 4096 bytes, range ceiling raised to 16384 to accommodate larger multi-tab files ▎ Known limitation: Navigate2 with the navOpenInNewTab flag needs verification on a real Windows 11 machine. If Explorer does not honour the flag, the first tab of each window will still restore correctly and subsequent tabs will log warnings.
current executable. The three WRAPPER_* lines are also removed from help_text()
release
  - Dev Workflow: new section with the four-step Linux→Windows cycle
  - Platform Notes: replaced the stale msvc/windows-crate lines with the current GNU target setup
- Loads UIAutomation assemblies
  - Enumerates CabinetWClass windows and finds ShellTabWindowClass children per window
  - Writes [Window] headers for multi-tab windows
  - Active tab path comes from Shell.Application COM (reliable); background tabs are temporarily activated
  one-by-one (up to 500 ms retry each) to read their paths from COM, then the original tab is restored
  - Falls back to single-path output for pre-22H2 windows with no tabs

  New parse_bookmark_file() free function
  - Splits on [Window] headers into groups; files without headers become one group (backward compat)

  Rewritten open_bookmarks()
  - Uses parse_bookmark_file() and delegates entirely to a generated PowerShell script
  - Total path count (across all groups) is checked against restore_max_windows

  New build_restore_script() method
  - Serializes window groups as a PowerShell array-of-arrays
  - Opens first path per window via explorer.exe, waits for the window to appear in Shell.Application, then
  calls Navigate2(path, 0x800) (navOpenInNewTab) for each subsequent tab
  - Navigate2 calls are wrapped in try/catch so a failure (e.g. if Explorer doesn't support the flag) just logs
  a warning rather than aborting

  Config/help: restore_max_file_size default raised 1024 → 4096, max raised 4096 → 16384; help text updated
  accordingly

  Note: Navigate2 with 0x800 needs real-world verification on Windows 11 — if it's unsupported the first tab per
   window will still restore correctly.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pandoras-box/explorer-bookmarks!1
No description provided.