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

feat(Sidebar): new design & workflow #486

Merged
merged 13 commits into from
Sep 18, 2023
Merged

Conversation

GeopJr
Copy link
Owner

@GeopJr GeopJr commented Sep 3, 2023

Goal

Per #228, The "Home" tabbed base should become sidebar items on desktop and be kept as tabs on mobile.

Problem

Sidebar items are NavigationPages and switching from StackPages to them based on breakpoints would cause reconstruction of the widgets at best which is not ideal since the breakpoints can be triggered multiple times.

Solution

Instead, let's create fake NavigationPage-like headerbars for the tabs and sync the sidebar items (that are only visible on desktop). There's a few bindings involved:

(is_mobile: mobile breakpoint triggered)
(is_home: the current view is Views.Main)

  • is_mobile -> PLACE_NOTIFICATIONS.visible // sidebar notifications

  • is_mobile -> PLACE_CONVERSATIONS.visible // sidebar conversations

  • is_mobile -> PLACE_SEARCH.visible // sidebar search

  • is_mobile -> search_button.visible // search headerbar button

  • is_mobile -> switcher_bar.visible // stack switcher bar

  • is_mobile -> switcher.visible // title switcher

  • is_mobile -> title_header.visible // headerbar title (matches active stack page)

when the fake back button is clicked:

  • sidebar selected item changes to "Home"
  • stack changed to "Home"

when the stack view changes:

  • check if the back button should be visible (not mobile + not "Home")

when the is-mobile notify signal gets emitted:

  • check if the back button should be visible (not mobile + not "Home")
  • if is-mobile, set selected sidebar item to "Home"
  • else, set it to the one matching the visible stack page

TODO:

  • leak check
  • badges
  • more sidebar syncing

@GeopJr GeopJr changed the title feat(Sidebar): match mockup order feat(Sidebar): new design & workflow Sep 11, 2023
@GeopJr GeopJr marked this pull request as draft September 11, 2023 00:34
@bertob
Copy link
Contributor

bertob commented Sep 13, 2023

The notification counters need some styling adjustments:

  • Smaller font size
  • Bold
  • Less padding
  • Circular when there's just a single digit

image

I'd basically follow what Fractal does here:

image

Co-authored-by: Julian Sparber <1911029+jsparber@users.noreply.github.com>
@GeopJr GeopJr marked this pull request as ready for review September 18, 2023 10:55
@GeopJr GeopJr merged commit 0b3ec8a into main Sep 18, 2023
@GeopJr GeopJr deleted the feat/sidebar/match-moockup-order branch September 18, 2023 13:02
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