Skip to content

[PowerDisplay] Add profile reordering - #50453

Draft
Yu Leng (moooyo) wants to merge 6 commits into
mainfrom
yuleng/powerdisplay-profile-reordering
Draft

[PowerDisplay] Add profile reordering#50453
Yu Leng (moooyo) wants to merge 6 commits into
mainfrom
yuleng/powerdisplay-profile-reordering

Conversation

@moooyo

@moooyo Yu Leng (moooyo) commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Allow users to reorder saved Power Display profiles without deleting and recreating them. Add drag-and-drop sorting and Move up/Move down menu actions, and persist the display position in a separate order field while retaining stable integer profile IDs.

PR Checklist

  • Closes: Rearrangeable "Power Display" profiles #50425
  • Communication: Maintainer review is pending.
  • Tests: Added/updated; 629 relevant tests pass locally.
  • Localization: Added Settings UI strings use resource entries.
  • Dev docs: Updated doc/devdocs/modules/powerdisplay/design.md.
  • New binaries: Not applicable; no new projects, binaries, or dependencies.
  • Documentation updated: Public documentation follow-up is not included.

Detailed Description of the Pull Request / Additional comments

  • In src/settings-ui/Settings.UI/SettingsXAML/Views/PowerDisplayPage.xaml and src/settings-ui/Settings.UI/ViewModels/PowerDisplayViewModel.cs, add a reorderable profile list with drag handles, bounded scrolling, and keyboard-accessible Move up/Move down actions. Elevated Settings retains menu-based sorting with native drag/drop disabled, following Mouse Without Borders.
  • In src/modules/powerdisplay/PowerDisplay.Models/, use a contiguous zero-based order field independently of integer id and the physical JSON array. Editing preserves the saved position; new profiles use the existing nextId counter and append to the display order.
  • Normalize missing or invalid order values under the existing profile-store mutex. Reordering changes only order values in the latest stored collection, preserves concurrent additions and edits, and refreshes the flyout through the existing settings notification. Failed saves/reloads retain the last known saved order in Settings.
  • Preserve integer profile IDs, Light Switch references, and CLI/IPC schema version 1.0.

Validation Steps Performed

  • Final Debug x64 builds succeeded for Settings UI and its test project, the Power Display app, and the Power Display Lib, Contracts, IPC, and CLI test projects.
  • Ran the newly built assemblies through vstest.console.exe: Lib 341, Contracts 15, IPC 139, CLI 118, and relevant Settings ViewModel tests 16; 629 passed, 0 failed, 0 skipped.
  • Coverage includes explicit order independent of array position and integer ID, stable IDs and nextId, order initialization, edit/append behavior, failed and concurrent writes, Light Switch references, elevated drag gating, CLI numeric-ID validation, and JSON/IPC round trips.
  • git diff --check and XAML/XML parsing passed.
  • Interactive UI validation remains pending: normal/elevated drag behavior, long-list scrolling, keyboard focus, and screen-reader behavior. This PR remains a draft.

@moooyo Yu Leng (moooyo) changed the title [PowerDisplay] Reorder profiles and migrate IDs to UUIDs [PowerDisplay] Add profile reordering Sep 8, 2026
Yu Leng (from Dev Box) added 4 commits September 9, 2026 15:24
Load the Toolkit expander resources used by the profile template. Handle
Alt+Shift+arrow keys before native ListView reordering and reuse the menu's
persistence and focus handling.

Add UI regressions for single-step moves, persisted order, navigation reload,
focus, boundaries, and modifier keys. Preserve test settings and stop Power
Display cooperatively during cleanup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rearrangeable "Power Display" profiles

1 participant