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

Add TabView to Autohide Layout #1097

Merged
merged 4 commits into from
Jul 28, 2021
Merged

Add TabView to Autohide Layout #1097

merged 4 commits into from
Jul 28, 2021

Conversation

Rohitth007
Copy link
Collaborator

@Rohitth007 Rohitth007 commented Jul 24, 2021

What does this PR do?

  • This commit adds a closed tab view of width TAB_WIDTH (3) for each of the side
    panels when in the autohide layout. The initial layout when the app
    is started is left panel open right panel closed. This improves the UX and also makes it easier
    for first time users to figure out what is happening.

#zulip-terminal > Autohide Tabs
Tested?

  • Manually
  • Existing tests (adapted, if necessary)
  • New tests added (for any new behavior)
  • Passed linting & tests (each commit)

Commit flow

  • The first commit adds the TabView widget class
    and the second commit uses it in autohide layout.

Notes & Questions

  • The title for the left tab is named as INBOX currently for lack of something more apt.

Interactions

Visual changes
OnStartup

BothPanelsClosed

@zulipbot zulipbot added the size: XL [Automatic label added by zulipbot] label Jul 24, 2021
@Rohitth007 Rohitth007 added PR needs review PR requires feedback to proceed area: UI General user interface update PR blocks other PR labels Jul 24, 2021
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.

@Rohitth007 This is great work 👍

This conflicts with the first commit of #1074 - and sort of needs to switch the code/style back? It'd be reasonable to extract the namespace change in that first commit and have it as another commit first in this PR (to set the module-constant precedent to build upon with TAB_WIDTH), and then have this PR's current commits - possibly including the other change from that other PR first commit, but it may be different with this PR code present?

Regarding the second refactor in #1074, as per my comment below I think that would perhaps fit with a vertical-divider refactor commit which would tidy up the inconsistent use of lineboxes? (also enum would be more descriptive than an integer when we're not seeking compatibility with urwid precisely)

zulipterminal/ui_tools/views.py Outdated Show resolved Hide resolved
zulipterminal/ui.py Outdated Show resolved Hide resolved
zulipterminal/ui.py Show resolved Hide resolved
zulipterminal/ui.py Outdated Show resolved Hide resolved
zulipterminal/ui.py Outdated Show resolved Hide resolved
@neiljp neiljp added PR awaiting update PR has been reviewed & is awaiting update or response to reviewer feedback and removed PR needs review PR requires feedback to proceed labels Jul 24, 2021
@Rohitth007 Rohitth007 force-pushed the tab-autohide branch 2 times, most recently from 015a706 to a892d54 Compare July 27, 2021 12:45
This commit moves from View constants to module constants to improve
consistency with other constants.

Tests updated.
This commit simplifies the code used in show_left_panel and
show_right_panel to improve readability and remove unnecessary
focus calls already handled by keypress.

Tests updated.
This commit creates a new widget TabView for use as closed side tab
in any place appropriate. This takes a single string input and
renders in one character below the other by centering it vertically
and horizontally.

Tests added.
This commit adds a closed tab view of width 3 for each of the side
panels when in the autohide layout. The initial layout when the app
is started is left panel open, right panel closed.

This makes use of the TabView class and changes show_left_panel
and show_right_panel accordingly.

Tests updated.
@neiljp
Copy link
Collaborator

neiljp commented Jul 28, 2021

@Rohitth007 You made a few extra changes compared to the previous version so that needed a little more double-checking, but it looks good 👍 Thanks for tidying this up after the first version, this will make autohide a lot less cryptic - I'm merging it shortly 🎉

Other than a very minor test combination, the only change I made was to use an application-focused name for the symbols.

We could definitely explore refinements to the current design, but that's easier and not as critical as having something present to work with :) We could maybe make them more literally like "tabs" visually, and possibly we don't need "arrows" as such (the current ones also seem offset slightly), and maybe we want to keep the tabs present even when expanded, to show the connection? However, we have a great start point to build from :)

@neiljp neiljp merged commit 06871aa into zulip:main Jul 28, 2021
@neiljp neiljp removed the PR awaiting update PR has been reviewed & is awaiting update or response to reviewer feedback label Jul 28, 2021
@neiljp neiljp added this to the Next Release milestone Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: UI General user interface update PR blocks other PR size: XL [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants