-
-
Notifications
You must be signed in to change notification settings - Fork 278
[WIP] enhancement: Added a command-line option to list all the available color themes. #803
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
Conversation
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.
@sumagnadas Thanks for working on this 👍 I've left some minor comments inline.
As per your comment in #613, you have the right idea. To avoid the first commit breaking tests, squashing these commits together would be good.
You could also add a test for this functionality, and as per #613 perhaps add an entry in the FAQ regarding themes.
zulipterminal/cli/run.py
Outdated
print('\nThemes available:-',) | ||
print('\t' + "\n\t".join(all_themes()) + '\n') |
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 haven't used tabs in the rest of this file; we could do with standardizing/simplifying, but for now could you use spaces for consistency?
I'm not sure we need leading/trailing blank lines.
You could also indicate how the theme is specified after listing the 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.
By specifying, do you mean specifying how to change the theme to the other ones using --theme
or -t
?.
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.
Yes, via that and possibly also the config file option.
I changed the output and it outputs the themes like this now. Does this look good or did the previous one look better (or if you haven't seen the previous one, you can see the following output)?
|
@sumagnadas Regarding the output, the original was good for a first version, as they are the actual theme names. The other version you listed seems like a combination of the theme names and theme aliases, but not quite (the first is inverted)? The theme aliases are intended to be deprecated at some point, so I think it would be good to show only the official names, as originally. However, the suffixes you added made me think we could mark the default theme with an |
The first one is inverted because the alias of I will remove the aliases part as it is going to be deprecated at some point as you said. I will print a line at the end describing how to change the theme using
|
I added suffixes which denote the default theme and the theme specified or preferred by the user. I also added a description which tells the end-user how to change the theme using the command-line option or using the zuliprc file. |
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.
@sumagnadas This looks good, but with the extra features/scope which I suggested this has grown quite a bit and we have some duplication - a little like my response!
I'd suggest you restructure the changes something like this:
- Make a relatively small commit similar to your previous version, with just the simple listing of themes given
--list-themes
, adjusted to show the default theme and with the changes (eg. to spacing) I asked for, and optionally that extra output at the end - that commit will be sufficient to minimally fix the issue and you can add "Fixes #613" to the body of this commit text to automatically close the issue when this commit is merged - Note there is another location where themes are listed - it would be useful to remove duplication and use (maybe only some of) the improved version in both cases, so a good follow-up commit would be to do that
- The current status of your branch has duplication between the new code and that below it, so the next step could be to adjust the list-themes approach from the new two commits to use the existing codepath which finalizes the selected theme
Here's an observation of your current sequence of commits - apologies if you're already aware of this: currently they show the order of your work, which is often more applicable committing directly to the main/master branch with each subsequent commit adjusting previous work. However, when merging a sequence of commits as they are from a branch it's easier to review and understand if the commits you write are each updated and restructured to match a logical clean flow. For example, you might go back and fix an older commit in your branch to make it work as intended or add code to it, rather than add more and more 'fix' commits on top to make the total work right - for example, this means not excluding code you add in one commit on the branch and then remove completely later. This can depend on the workflow in a project - if a branch is squashed before merging then this is not relevant, though arguably could still also help review; here we use merge-with-rebase so all the commits you write end up in the project git log after merging (though maintainers occasionally adjust them slightly before merging).
You may want to save your existing work as another local branch before you do eg. an interactive rebase, but I'll leave you to restructure it unless you'd like some more advice - I'm happy to help :) I think I see you on chat.zulip.org, so feel free to drop by #zulip-terminal or other relevant streams and ask any questions there too.
I didn't see anywhere else where themes are listed.
Yes there is some duplication like the variables like |
What is left now to implement to this PR? I can't think of any other thing right now. |
1) Added the theme suffixes '[default theme]' and '[user preference]' 2) Added a description of how to change the theme at the end of the output
@sumagnadas Thanks for your work on this - as discussed in #zulip-terminal on chat.zulip.org, I adjusted your earlier commits and merged those separately first, since that was sufficient for an initial solution and I recommend we work on the follow-up in a separate PR 👍 |
This PR adds the
--list-themes
command-line option to zulip-term which list all the available color themes.Fixes #613