Skip to content

feat(storage): show each comma-separated storage path as its own group - #618

Open
ilyasturki wants to merge 1 commit into
corecoding:developfrom
ilyasturki:feature/multiple-storage-paths
Open

ilyasturki wants to merge 1 commit into
corecoding:developfrom
ilyasturki:feature/multiple-storage-paths

Conversation

@ilyasturki

Copy link
Copy Markdown

What

storage-path now takes several comma-separated paths, and each path gets its own Storage group in the menu (Storage /, Storage /mnt/games, ...), with the full set of stats: Total, Used, Reserved, Free, the percentages, and read/write totals and rates for its device. With a single path nothing changes: same group label, same sensor keys.

Why

Closes #143, closes #455, closes #503.

On #525 you said you would rather have separate Storage trees than extra rows in one group, so this follows the same pattern as the GPUs (gpu#1, gpu#2).

Changes

  • Sensor types: the first path keeps the plain storage type, the next ones are storage#2, storage#3, ... Pinned keys such as _storage_free_ keep working; the extra ones look like _storage#2_free_. As with GPUs, the keys follow the position in the list, so reordering the paths moves a pin to another disk.
  • storageGroups() in helpers/catalog.js: splits storage-path on commas and maps each path to its type, shared by sensors.js and extension.js.
  • sensors.js: device lookup and read/write counters are per path. ZFS ARC stays in the first group.
  • extension.js: storage-path changes are now picked up live; the Storage groups are rebuilt in place. The gpu special cases in _showHideSensorsChanged, _defaultIcon and _sensorIconPath now go through sensorGroupFromType(), which already strips the #N suffix, so they cover storage too.
  • values.js: resetHistory() also clears the storage#N histories, otherwise rows would not come back after a redraw.
  • Prefs: the Path row gets a subtitle, "Separate several paths with commas". The schema type stays s, so existing settings are untouched.

Manual integration test

GNOME Shell 50.6, headless Wayland session, develop at 6803448:

  • /: one Storage group, same as before.
  • /, /mnt/games, /mnt/recordings: three groups, the three Free values pinned to the panel and updating with the menu closed.
  • Editing the path live: / to /,/nope to three paths to /mnt/games,/. Groups are rebuilt at the same spot in the menu, no errors in the journal.
  • A missing path (/nope) shows 0.0 B, like a wrong path does today.
  • Turning show-storage off and on hides and shows every Storage group.

This branch has not been deployed

No deployments
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