-
-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic fields in footer notification styling #971
Conversation
251cf02
to
4a9431e
Compare
@Ezio-Sarthak Really nice addition to ZT. |
@Rohitth007 thanks for the feedback. Re |
@Ezio-Sarthak I'm assuming the footer would have an independent styling as it acts sort of like a notification bar? |
4a9431e
to
51ba272
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really nice work. The footer looks much clean and dynamic now. 👍
I haven't tested it on all themes yet, but the darker ones are looking good.
I am also inclined to Sai's point above that we should have footer
instead of area
, but the task
sounds like a fine replacement too. I would love to gather some more opinions on this, but the PR, in general, should be very close to being merge-able. I have dropped in some points below, but they are mostly minor and may need discussion. :)
zulipterminal/config/themes.py
Outdated
('area:neutral', 'black', 'light gray', | ||
None, DEF['black'], DEF['light_gray']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change this to task
, to be more consistent with other footer styles. We could always have another one for area:neutral
if the need be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out. The original intent for it was that it might be used (in general) for other areas (in future) where there's no highlighting required, e.g., typing status. However, since I couldn't think of more such examples, currently we could just align it with other footer-dedicated attributes. We could simply add such themes later in any case 👍
c3240b8
to
9c48738
Compare
ad7a80c
to
8da6281
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ezio-Sarthak Thanks for taking this up - I agree with others that the visual feedback is much better 👍
I've left some comments inline, but I think we'll likely be able to squash these commits together.
Reading this PR it's more clear that we now call a function in a very similar way in many places! I'd consider a refactor before this to add something like report_success
and similar methods to the controller which would have the default timeout and know the style to use and where to report it (ie. footer). That would make it less explicit where/how we're reporting it, but remove the need for all the explicit style variables here and the existing time variable (which we could scale up slightly based on the string length?).
This needs a black rebase in any case.
zulipterminal/config/themes.py
Outdated
'task:success': 'standout', | ||
'task:failure': 'standout', | ||
'task:warning': 'standout', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure if having these the same as the footer default provides the (temporary) strikingly visible update that we'll get with the colored themes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having a color (say green) on a result (say success) draws user's attention more than just changing the text with the default footer background. We could surely gain feedback in stream in any case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, my initial thought would be to temporarily do something like invert from the default style; I'm not sure what that translates to. Discussing on the stream would be good, though this would be a small update later too.
9a34ecd
to
a8ed8a9
Compare
a8ed8a9
to
4dd1121
Compare
This commit: * adds styles for various notification categories (inverted color backgrounds). * Improves the default 'footer' style, avoiding conflict with the added styles. The categories with associated styles and footer used as of now: * success (task:success) - on successful completion of a task * warning (task:warning) - providing heads-up for a certain task * error (task:error) - on an errorenous result * neutral (footer) - default notification style
This commit adds entries in themes.py, labelled 'footer_contrast' that define the color for hint text. This could also be referred to as the color scheme for background of the footer. Prior to this an old theme style name was in use, which could give unreliable rendering results between systems. This commit migrates from this old absent "code" style to use the newly added style. Tests amended.
This commit: * amends set_footer_text() to allow styles passed explicitly, with default style set to 'footer'. * adds general helpers for footer notification that avoid need to specify style and duration of the notification. (report_success, report_error, report_warning). Tests amended.
This commit replaces those instances of `set_footer_text` with the new report_* helpers, that notify user of a success/error/warning response. Tests amended. Fixes zulip#782.
4dd1121
to
5eecc12
Compare
@Ezio-Sarthak Thanks for the polish on this; I adapted some of the commit text and have just merged it 🎉 |
What does this PR do?!
task:success
,task:error
,task:warning
.set_footer_text()
with added helpers wherever reasonable.I'd highly appreciate any feedback :)
Fixes #782.