Skip to content

Directories: pinned favorite show folders for quick switching - #6957

Open
heffneil wants to merge 2 commits into
xLightsSequencer:masterfrom
heffneil:feat/show-dir-favorites
Open

Directories: pinned favorite show folders for quick switching#6957
heffneil wants to merge 2 commits into
xLightsSequencer:masterfrom
heffneil:feat/show-dir-favorites

Conversation

@heffneil

@heffneil heffneil commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

What

Adds pinned favorite show folders to the Directories dialog so you can jump between shows you use often without browsing each time. Previously the dialog only let you Change Permanently / Temporarily via a folder picker.

A new Favorite Show Folders section shows a list of pinned folders with:

  • Add Current — pin the current show folder (disabled when it's already pinned or empty)
  • Remove — unpin the selected folder
  • Switch Permanently / Switch Temporarily — switch to the selected folder (double-click a row = permanent)

Favorites are persisted in the xLights config (up to 30 slots) and survive restarts. They are manual/pinned, independent of the existing auto Recent Show Folders MRU on the File menu.
Screenshot 2026-08-22 at 4 50 51 PM
Screenshot 2026-08-22 at 4 51 49 PM

How

  • ShowDirectoriesDialog gains a wxListBox + four buttons and a std::vector<wxString> _favorites.
  • Persistence via GetXLightsConfig() under keys ShowFolderFavorite0..29; unused trailing slots are blanked on save so removed favorites don't reappear.
  • Switching reuses the real xLightsFrame::SetDir(dir, permanent) path with the ObtainAccessToURL(dir, true) sandbox check — mirroring OnMenuMRU (the recent-folders switch) — and clears display elements + layout undo first, matching the dialog's existing temporary-switch cleanup.
  • Guards: skips a no-op switch to the current folder; warns (and does nothing) if a pinned folder no longer exists on disk or access can't be obtained; Add is disabled at the 30-slot cap or when the current folder is already pinned.

Testing

Built (macOS Debug). Pinned/removed folders, switched permanently and temporarily, confirmed the list persists across a restart and that a deleted folder is handled gracefully.

iPad parity

Desktop-only setup UI (src-ui-wx/setup/); the iPad has no equivalent Directories dialog. No iPad counterpart to change.

🤖 Generated with Claude Code

heffneil and others added 2 commits August 22, 2026 16:27
Adds a Favorite Show Folders list to the Directories dialog: pin the
current folder, remove, and switch to a pinned folder permanently or
temporarily (double-click = permanent). Favorites persist in the xLights
config (up to 30) and are independent of the auto Recent Show Folders MRU.

Switching reuses SetDir(dir, permanent) with the ObtainAccessToURL sandbox
check (mirroring OnMenuMRU) and guards against a folder that has been moved
or deleted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Brian's feedback on the favorites list: a pinned folder should carry a
display name, and favorites should be reachable from the File menu rather
than only from the Directories dialog.

- Add Current prompts for a name, pre-filled with the folder's own name,
  and a Rename button changes it later.
- The list becomes a wxListCtrl with Name and Folder columns, name first.
- File > Favorite Show Folders sits directly under Recent Show Folders and
  shows names only, with the full path as the item's help text.

The menu cannot follow OnMenuMRU's approach of reading the show folder back
out of the menu label, since the label is now a name - picking one would
try to open a directory called "Christmas 2026". Favorites keep an
id -> path map instead. Names are escaped with wxControl::EscapeMnemonics
so an '&' in a folder name does not become an accelerator.

Names live in new ShowFolderFavoriteName* config keys, so favorites pinned
before this change still load, defaulting to their folder name.

The menu is rebuilt when the Directories dialog closes as well as on a
folder change - adding a favorite without switching folders would otherwise
leave the menu stale. Both the dialog and the menu read through
ShowDirectoriesDialog::ReadFavoritesFromConfig so the config keys and the
30-slot cap are defined once.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant