Skip to content

Fix sidebar device bugs and long file names hiding the extension - #106

Closed
dim-ghub wants to merge 6 commits into
AstraSuite:mainfrom
dim-ghub:main
Closed

dim-ghub wants to merge 6 commits into
AstraSuite:mainfrom
dim-ghub:main

Conversation

@dim-ghub

Copy link
Copy Markdown
Collaborator

What this changes

  • Devices with several mount points (e.g. a btrfs root) now always open at /, or else the shortest path. Fixes device path changing between reboot #97.
  • Hidden devices are remembered by UUID instead of /dev/sdX, so they stay hidden when disk names swap after a reboot. Existing settings are migrated. Fixes Devices randomly changing #94.
  • Long file names keep their extension (including .tar.gz and similar) in the grid, compact and details views.

Why

  • Atlas took whichever mount point lsblk listed first, and that order isn't fixed.
  • /dev/sdX names aren't stable across boots.
  • The grid view used middle eliding, which Qt doesn't support on multi-line text, so it cut off the end instead. The compact and details views' helper never loaded its measuring object, so it never shortened names at all.

How it was verified

  • Device fixes: built the real drivemanager.cpp against a fake lsblk that simulates two disks swapping names. Both bugs reproduced before the fix and are gone after.
  • File names: rendered the labels offscreen before and after, checking for no binding loop warnings and that names re-shorten on resize.
  • Not verified in the full app: this environment only had Qt 6.4, and Atlas needs 6.5.

A filesystem mounted in several places, like a btrfs root with /home,
/var/tmp and /var/cache subvolumes, was shown at whichever mount point
lsblk happened to list first, so clicking / in the sidebar opened a
different folder after each boot. Prefer / and otherwise the shortest
path, for both the sidebar and the mount-and-open fallback.
Hidden devices were stored by their /dev/sdX path. With more than one
disk the kernel can hand out those names in a different order after a
reboot, so a hidden /boot came back and another device was hidden in its
place. Store the filesystem UUID, or the partition UUID when there is no
filesystem UUID, and only fall back to the /dev path for devices that
have neither. Existing /dev entries are moved to the UUID of the device
at that path the first time the drive list loads.
Grid labels wrap over several lines and asked for Text.ElideMiddle, but
Qt does not support middle eliding on multi-line text and cuts off the
end instead, so long names lost their extension without even showing an
ellipsis. Shorten the base name until the label fits its lines and keep
the extension, as the compact and details views already do.
Compressed tarballs have a two-part extension, so a long backup.tar.gz
was shortened to backup….gz. Treat .tar.<anything> as one extension.
FileNameHelper built its measuring object with
Qt.createComponent("QtQuick.TextMetrics"), which treats the string as a
file URL, so it never loaded and every name fell back to plain end
eliding with the extension cut off. Create a FontMetrics inline instead,
parented to the top-level item so the shared instance outlives the
delegate that first asked for it, and measure through advanceWidth() so
the calling bindings do not depend on what they write and loop.
…names

Fix sidebar device bugs and long file names hiding the extension
@dim-ghub dim-ghub closed this by deleting the head repository Oct 23, 2026
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.

device path changing between reboot Devices randomly changing

1 participant