Skip to content

Conversation

@chu11
Copy link
Member

@chu11 chu11 commented May 17, 2023

Problem: flux-jobs(1) cute output does not throw enough emojis in your face.

Solution: Update flux-jobs cute format to use id.emoji over id.f58. Support new W presentation adjuster to make the output prettier.

image

@chu11
Copy link
Member Author

chu11 commented May 17, 2023

re-pushed, fix spelling and linting issues found by CI. Edit: oops another time, isort fail.

@grondo
Copy link
Contributor

grondo commented May 23, 2023

FYI, sadly this doesn't quite work for my font combination I guess 🙁
image

@chu11
Copy link
Member Author

chu11 commented May 23, 2023

doh! i wonder if this is even solvable within the framework of how we do output formats. I suppose in some worst case it could loop through all potential outputs, see what the longest emoji length is, then adjust field width .... ugh

@grondo
Copy link
Contributor

grondo commented May 23, 2023

Yeah, that's my worry as well. I guess we do already loop through all outputs to check for empty fields to handle ?: 🤷 If that works here maybe its ok? Meh, doesn't seem worth our time at this point.

@codecov
Copy link

codecov bot commented Sep 16, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.15%. Comparing base (11d4362) to head (19462df).
⚠️ Report is 4723 commits behind head on master.

Files with missing lines Patch % Lines
src/bindings/python/flux/util.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5179      +/-   ##
==========================================
- Coverage   83.15%   83.15%   -0.01%     
==========================================
  Files         455      455              
  Lines       78035    78050      +15     
==========================================
+ Hits        64890    64899       +9     
- Misses      13145    13151       +6     
Files with missing lines Coverage Δ
src/cmd/flux-jobs.py 96.50% <ø> (ø)
src/bindings/python/flux/util.py 95.18% <93.33%> (-0.05%) ⬇️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chu11
Copy link
Member Author

chu11 commented Sep 16, 2025

After working on #7053, I was like "hey, would '+:' help work on this old emoji output PR?" (it wasn't around when I first wrote it)

Had to do some small tweaks, but it seems good!

Screenshot from 2025-09-16 13-53-15

The only gotcha is use of the wcwidth python package, so we'd require yet another python dependency. It appears to be fairly common and was intalled on TOSS clusters by default (but not on my desktop). I did not add it to the scripts/install-* scripts yet.

Edit: oh it just occurred to me the STATUS emoji is not lined up correctly in the above picture. It's b/c this PR is not rebased on PR #7053. The width has not been corrected for the header. I temporarily widened the width for this next screenshot.

Screenshot from 2025-09-16 14-02-17

Edit2: Ok, nevermind, I rebased this on #7053. It's probably necessary for this to all look good.

Screenshot from 2025-09-16 14-43-10

Edit3: ugh, i guess the python dependency isn't in the images, so all CI fails

@chu11 chu11 force-pushed the more_cute branch 6 times, most recently from 5e1ea38 to ca0deb3 Compare September 16, 2025 22:56
Problem: The expandable width prefix ("+:") assumes all output
characters are 1 character width in size.  This may not always be
the case, such as with several of the emoji output options.

Use wcswidth() instead of len() for calculating output width.
Problem: Python does not take into account wide characters
(i.e. emojis) when attempting to do output alignment.  So when
outputting wide characters in flux-jobs, the output can be poor
due to the characters have different output widths.

Solution: Add a new W presentation type that can adjust formatting
of the form "(<|>)N", e.g. {id.emoji:>12W}.  The output width will
be adjusted given the number of wide characters that exist in the
string.
Problem: The W presentation type is not documented in flux-jobs(1)

Add paragraph covering it.
Problem: The cute format in flux-jobs is not cute enough!

Solution: Update the format to use id.emoji over id.f58.  Utilize
the expandable width prefix ("+:") and "W" presentation type to
get output to align more nicely.
Problem: There is no coveragage for id.emoji and the W presentation
type.

Add some coverage in t2800-jobs-cmd.t.
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