Skip to content

Improve UI robustness and group/selection handling#5270

Merged
DavidXanatos merged 2 commits intosandboxie-plus:masterfrom
offhub:ui-fixes-2026-1
Mar 28, 2026
Merged

Improve UI robustness and group/selection handling#5270
DavidXanatos merged 2 commits intosandboxie-plus:masterfrom
offhub:ui-fixes-2026-1

Conversation

@offhub
Copy link
Copy Markdown
Collaborator

@offhub offhub commented Mar 4, 2026

Multiple fixes and enhancements across the tray, grouping, and selection logic:

  • QSbieAPI/SbieIni: preserve and round-trip empty group entries when serializing/deserializing text maps (emit "Group:" lines and parse empty payloads).

  • SandMan (tray & box logic):

    • Update tray icon/tooltip while delete-content operations are in progress, and make m_iDeletingContent decremented safely and initialized on state update.
    • Harden OnBoxDblClick/OnBoxMenu/PopUpMenu with null/empty checks to avoid crashes when items or API are missing.
    • Improve tray widget layout: size policies, spacing, elide mode, alignment and minimum width calculation instead of fixed width.
    • Add user-visible placeholder actions/items when no sandboxes match the tray filter.
    • Fix several recursive Depth++ call sites to use Depth + 1 for clarity and correctness.
  • SbieView (grouping & selection):

    • Add NormalizeGroups() to sanitize group data (remove duplicates, cycles, invalid refs) and call it on load/save to keep grouping consistent.
    • Implement selection utilities SelectBoxes, SelectNames and RestoreBoxSelectionLater to preserve/restore selection and scroll post-refresh.
    • Make AddNewBox use a longer singleShot delay to avoid races with proxy/layout timers when selecting newly-created boxes.
    • Coalesce rapid MoveItem calls into a batch (m_MoveBatchPending/m_MoveBatchChanged) to avoid repeated clears/refreshes; restore selection after batch completes.
    • Ensure group create/import/rename/delete operations keep reasonable focus: restore box/group selection or root focus as appropriate.
    • Various small fixes: always ensure the empty root group exists, append new groups to root, and avoid invalid model/index operations.

These changes aim to fix crashes, prevent UI races, keep the user's focus after structural changes, and provide clear feedback in the tray when no sandboxes are present.

Multiple fixes and enhancements across the tray, grouping, and selection logic:

- QSbieAPI/SbieIni: preserve and round-trip empty group entries when serializing/deserializing text maps (emit "Group:" lines and parse empty payloads).

- SandMan (tray & box logic):
  - Update tray icon/tooltip while delete-content operations are in progress, and make m_iDeletingContent decremented safely and initialized on state update.
  - Harden OnBoxDblClick/OnBoxMenu/PopUpMenu with null/empty checks to avoid crashes when items or API are missing.
  - Improve tray widget layout: size policies, spacing, elide mode, alignment and minimum width calculation instead of fixed width.
  - Add user-visible placeholder actions/items when no sandboxes match the tray filter.
  - Fix several recursive Depth++ call sites to use Depth + 1 for clarity and correctness.

- SbieView (grouping & selection):
  - Add NormalizeGroups() to sanitize group data (remove duplicates, cycles, invalid refs) and call it on load/save to keep grouping consistent.
  - Implement selection utilities SelectBoxes, SelectNames and RestoreBoxSelectionLater to preserve/restore selection and scroll post-refresh.
  - Make AddNewBox use a longer singleShot delay to avoid races with proxy/layout timers when selecting newly-created boxes.
  - Coalesce rapid MoveItem calls into a batch (m_MoveBatchPending/m_MoveBatchChanged) to avoid repeated clears/refreshes; restore selection after batch completes.
  - Ensure group create/import/rename/delete operations keep reasonable focus: restore box/group selection or root focus as appropriate.
  - Various small fixes: always ensure the empty root group exists, append new groups to root, and avoid invalid model/index operations.

These changes aim to fix crashes, prevent UI races, keep the user's focus after structural changes, and provide clear feedback in the tray when no sandboxes are present.
@offhub offhub added the User Interface Related to Plus and/or Classic UIs label Mar 4, 2026
Add explicit action wrapper methods (AddNewBoxAction, AddNewGroupAction, ImportBoxesAction) and update OnSandBoxAction to call them. Introduce name-focused selection handling: track m_MoveBatchFocusNames, collect/GetSelectedGroups(), and add RestoreNameSelectionLater to restore group/name selections after operations. Ensure tree receives focus when selecting items (setFocus calls) and consolidate selection restore logic in OnGroupAction and OnMoveItem so moved/imported groups remain selected and visible.
@DavidXanatos DavidXanatos merged commit fa1cc28 into sandboxie-plus:master Mar 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

User Interface Related to Plus and/or Classic UIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants