Skip to content

Red background behind over quota - #114

Open
plstonge wants to merge 2 commits into
mainfrom
quota-colors
Open

Red background behind over quota#114
plstonge wants to merge 2 commits into
mainfrom
quota-colors

Conversation

@plstonge

Copy link
Copy Markdown
Contributor

When users have a long list of project and nearline spaces, and because the units are sometimes different between the usage and the quota, it is a bit hard to identify any over quota situations. With this change, the background color clearly identifies which quota has been reached or surpassed.

@plstonge
plstonge requested a review from mboisson August 20, 2026 20:44
@mboisson

Copy link
Copy Markdown
Member

Mmm, what does it look like with dark terminal ? with bright terminal ? white ? dark ?

@ofisette

ofisette commented Aug 20, 2026

Copy link
Copy Markdown

I find it difficult to read on my terminal (dark colour scheme). The issue is that Back is used with the default foreground colour. All colours in a (good) colour scheme should read well against the default background colour, but not all colours are guaranteed to act well as a background colour for the default foreground colour. This can be fixed by using Fore.RED instead. Combined with Bright, it gives the same colour as broken symlinks in ls and gcc error messages, and should be readable in any decent terminal.

Another issue is that you can reach your quota without an entry turning red because a large file write will be rejected if you are close to your quota. (I tested this on Rorqual.) This can be fixed by using if quota_info['space_used_bytes'] / quota_info['space_quota_bytes'] > 0.99 rather than the current test (and similarly for the file count). I would actually suggest to make it 0.95 to give an advance warning.

@plstonge

plstonge commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

On my side, it looks good with a black background and white text:
image
But it looks bad on a white background with black text. Somehow, the red is darker in this version:
image
I will try Olivier's suggestions.

Note: to test the color, I have temporarily inverted the operator >=

@plstonge

Copy link
Copy Markdown
Contributor Author

This is how it looks with the last revision:
image
image

@mboisson

mboisson commented Aug 21, 2026

Copy link
Copy Markdown
Member

I wonder if we should also support some sort of non-colorized indications (for colourblind people). Maybe a --nocolor option that replaces those with asterisks ?

@plstonge

plstonge commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

I will try something. The *'s could be there with or without the color, so I will not add another command flag, at first.

@ofisette

Copy link
Copy Markdown

Agreed. With argparse, the typical way to do it would be parser.add_argument('--color', action=argparse.BooleanOptionalAction), which automatically gives you --no-color too.

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