Skip to content

Allow drag-and-drop reordering of dashboard widgets - #270

Open
moderathor12 wants to merge 3 commits into
IceWhaleTech:mainfrom
moderathor12:feature/widget-drag-reorder
Open

moderathor12 wants to merge 3 commits into
IceWhaleTech:mainfrom
moderathor12:feature/widget-drag-reorder

Conversation

@moderathor12

Copy link
Copy Markdown

What this does

Adds drag-and-drop reordering to the Widgets Settings panel, so users can customize the order of widgets (System status, Storage, etc.) on their dashboard.

How it works

  • Wraps the widget list in the existing Settings.vue with <draggable> from vuedraggable, which is already a project dependency (used in AppSection.vue for app icon reordering — this follows the same pattern).
  • A small CSS-based grip handle (no new icon dependency) lets users grab and reorder items.
  • On drag end, the existing handleInput() method fires, which already persists the new order through SideBar.vue's saveData() — no backend or storage schema changes needed, since widget order was already driven by the array order in widgets_config.

Related discussions

This addresses long-standing community requests for customizable dashboard widgets:

Testing

Tested locally against a live CasaOS instance — widgets can be reordered via the Widgets Settings dropdown, and the new order is reflected immediately on the dashboard and persists after refresh.

@sonarqubecloud

Copy link
Copy Markdown

inkly added a commit to ReCasaOS/CasaOS-UI that referenced this pull request Sep 15, 2026
…as shell

Each widget in Widgets Settings has a handle to drag, or to focus and move
with the arrow keys. The sidebar rebuilt the saved list in the order the
dashboard ships its widgets and wrote that back over it, so an order could
not have survived a reload; combineWidgetSettings keeps the saved order and
appends a widget a newer version adds. From IceWhaleTech/CasaOS-UI#270,
which as submitted lost the order on the next load.

A .env file opens as shell in the file editor rather than JavaScript
(IceWhaleTech/CasaOS-UI#269; its hidden-files half was already here). The
resize listener of the settings panel is removed on unmount, not added
twice.
@inkly

inkly commented Sep 15, 2026

Copy link
Copy Markdown

Nice one, this is something people ask for. When I took it into ReCasaOS I noticed the order does not survive a reload as it stands: on load, diffAndCombineData in SideBar.vue rebuilds the list in the order the widgets ship in, keeps only show from what was saved, and saves that back, so the order someone set is gone on the next page load. Keeping the saved order there and appending the widgets the saved list does not know fixes it. I also let the handle move a widget with the arrow keys, for keyboard users. It shipped in ReCasaOS v0.4.88 (github.com/ReCasaOS/CasaOS-Install) if you want to see it working.

ppenguin pushed a commit to ppenguin/CasaOS-UI-RCOS that referenced this pull request Nov 12, 2026
…he keyboard move

Widgets Settings gets a "Reset to the default order" link: the widgets go back
to the order the dashboard ships them, each keeping whether it is hidden. It is
disabled while the order already is the shipped one.

The shipped-widgets list moves out of Settings.vue into shippedWidgets.js so a
component spec can replace webpack's require.context. New specs cover the arrow
key move (down, up, ends, focus following the widget), the reset button, and
resetWidgetOrder with a name the dashboard no longer ships.

The drag handles and the arrow keys this completes come from
IceWhaleTech/CasaOS-UI#270 by moderathor12 (Apache-2.0).
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.

2 participants