Skip to content

fix(ui): show available space instead of total capacity in size info widget - #219

Merged
deepin-bot[bot] merged 2 commits into
linuxdeepin:release/1071from
GongHeng2017:release/1071
Sep 9, 2026
Merged

deepin-bot[bot] merged 2 commits into
linuxdeepin:release/1071from
GongHeng2017:release/1071

Conversation

@GongHeng2017

@GongHeng2017 GongHeng2017 commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

fix(ui): show available space instead of total capacity in size info widget

The capacity bar label in the disk/partition detail view was showing
total capacity. Per product decision, change it to show available space
(available = total - used) with the label 'Available:' instead of the
partition path + 'Capacity:'.

Log: Update capacity bar legend to display available space
Bug: https://pms.uniontech.com/bug-view-204631.html

Summary by Sourcery

Show available space rather than total capacity in the size information widget.

Bug Fixes:

  • Display available disk or partition space in the size information widget instead of total capacity.

Enhancements:

  • Update the capacity bar legend to use the “Available:” label and show available-space values across partition, logical-volume, device, and decrypted LUKS views.

…widget

The capacity bar label in the disk/partition detail view was showing
total capacity. Per product decision, change it to show available space
(available = total - used) with the label 'Available:' instead of the
partition path + 'Capacity:'.

Log: Update capacity bar legend to display available space
Bug: https://pms.uniontech.com/bug-view-204631.html
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: GongHeng2017

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The widget now derives and stores available space for partition, logical-volume, device, and decrypted LUKS data, then displays that value under an “Available:” legend in place of total capacity in both capacity-bar rendering paths.

Flow diagram for available-space size info rendering

flowchart LR
    A["PartitionInfo, LVInfo, or DeviceInfo"] --> B["setData()"]
    B --> C["Calculate available space"]
    C --> D["Override with decrypted LUKS filesystem free space"]
    D --> E["paintEvent()"]
    E --> F["Display Available: value"]
Loading

File-Level Changes

Change Details Files
Track available-space values alongside used and total sizes for all supported storage data sources.
  • Calculate formatted available space from partition, logical-volume, and device filesystem metadata.
  • Use decrypted LUKS mapper usage data when available, including unavailable placeholders for encrypted logical volumes that are not decrypted.
application/widgets/customcontrol/sizeinfowidget.cpp
application/widgets/customcontrol/sizeinfowidget.h
Update the capacity-bar legend to present available space instead of total capacity.
  • Replace the partition-path/Capacity label with Available.
  • Render and size the legend value using the new available-space field in both painting paths.
application/widgets/customcontrol/sizeinfowidget.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@GongHeng2017

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This pr force merged! (status: unstable)

@deepin-bot
deepin-bot Bot merged commit 527cd5c into linuxdeepin:release/1071 Sep 9, 2026
14 of 16 checks passed
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.

3 participants