Skip to content
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

about_popup: Terminal size added in about popup. #1539

Closed
wants to merge 4 commits into from
Closed

about_popup: Terminal size added in about popup. #1539

wants to merge 4 commits into from

Conversation

Swarnim114
Copy link
Collaborator

@Swarnim114 Swarnim114 commented Jul 25, 2024

closes #1536

What does this PR do, and why?

Adds a Terminal size label under the "Detected Environment " in About popup

image

External discussion & connections

How did you test this?

  • Manually - Behavioral changes
  • Manually - Visual changes
  • Adapting existing automated tests
  • Adding automated tests for new behavior (or missing tests)
  • Existing automated tests should already cover this (only a refactor of tested code)

Self-review checklist for each commit

  • It is a minimal coherent idea
  • It has a commit summary following the documented style (title & body)
  • It has a commit summary describing the motivation and reasoning for the change
  • It individually passes linting and tests
  • It contains test additions for any new behavior
  • It flows clearly from a previous branch commit, and/or prepares for the next commit

Visual changes

image

@zulipbot zulipbot added size: S [Automatic label added by zulipbot] size: M [Automatic label added by zulipbot] and removed size: S [Automatic label added by zulipbot] labels Jul 25, 2024
@Swarnim114
Copy link
Collaborator Author

Hi @neiljp
Can you please review this PR?

@neiljp
Copy link
Collaborator

neiljp commented Jul 25, 2024

@Swarnim114 Thanks for working on this! Welcome to the project!

Visually this looks broadly like I was expecting, though I'd maybe add spaces around the the x to make it easier to read the numbers. If you saw this popup, do you think you'd want to know which was columns vs rows?

In terms of the code, it would be cleaner to pass the actual size directly, to avoid the view (and readers of the code) needing to know about the screen. The popup contents don't update dynamically while it is open right now.

Thanks for looking at tests, and your current way of keeping them as a separate commit is great for now, though we generally squash minimal code and test changes into one commit in a branch before merging. Note that I don't mean all commits, rather that code additions/changes are kept together with matching tests :)

For the next iteration it would be good to get all the checks passing.

@neiljp neiljp added area: popup: about PR awaiting update PR has been reviewed & is awaiting update or response to reviewer feedback labels Jul 25, 2024
@Swarnim114
Copy link
Collaborator Author

@neiljp

I apologize for the issues with my recent pull request.

  1. I was unable to get the "Current terminal size update dynamically" feature to work as intended.
  2. One of the checks failed due to a small mistake on my part.

Current State

Please let me know if there are any further changes you would like me to make.

Copy link
Collaborator

@neiljp neiljp left a comment

Choose a reason for hiding this comment

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

@Swarnim114 Thanks for making the updates 👍

To be clear: I was not expecting a dynamic update of size from you, rather meaning that the lack of that meant that the window size could be passed in :)

The current one remaining failing test refers to isolated commits, which is happening since in at least some cases, one of your commits is fixing a problem in an earlier one. See the README about this; you can use check-branch to see what is happening locally.

For merging it would be useful to have

  • all the commits squashed together (simplifying your test issue above)
  • fixing the points I raised inline
  • write a good single commit title and text, matching the Zulip-Terminal project style.

@@ -1137,7 +1145,6 @@ def __init__(

popup_width, column_widths = self.calculate_table_widths(contents, len(title))
widgets = self.make_table_with_categories(contents, column_widths)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please check your PRs for these unrelated changes.

Comment on lines +271 to +286
mocker.Mock()
self.about_view = AboutView(
self.controller,
"About",
zt_version=ZT_VERSION,
server_version=MINIMUM_SUPPORTED_SERVER_VERSION[0],
server_feature_level=MINIMUM_SUPPORTED_SERVER_VERSION[1],
theme_name="zt_dark",
color_depth=256,
notify_enabled=False,
autohide_enabled=False,
maximum_footlinks=3,
exit_confirmation_enabled=False,
transparency_enabled=False,
terminal_size=(80, 24),
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This new code is not necessary:

  • please look up what mocker/mock/Mock() is used for, if you intend to use it :)
  • self.about_view is set automatically in the first function (fixture) of this test class, which is used automatically every time, so this is duplicated each time.

@neiljp
Copy link
Collaborator

neiljp commented Jul 30, 2024

@Swarnim114 If you intend to contribute further to Zulip, note that you can use @zulipbot to set/unset the 'PR awaiting update' and 'PR needs review' tags, which can help us with identifying the state of PRs :)

@Swarnim114 Swarnim114 closed this by deleting the head repository Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: popup: about PR awaiting update PR has been reviewed & is awaiting update or response to reviewer feedback size: M [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add current terminal window size to About popup
3 participants