Skip to content

feat(web): expand/collapse sidebar #16768

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

Merged
merged 21 commits into from
Apr 2, 2025
Merged

feat(web): expand/collapse sidebar #16768

merged 21 commits into from
Apr 2, 2025

Conversation

ben-basten
Copy link
Collaborator

@ben-basten ben-basten commented Mar 10, 2025

Description

Adding a collapsible sidebar with a hamburger menu for all breakpoints smaller than Tailwind md.

Benefits include:

  • more space for page content on smaller screen sizes
  • seeing the full text of the sidebar buttons on small screens, rather than just seeing the mini sidebar with icons only
  • sidebar contains the same content in mobile vs desktop, such as the supporter badge, server info, and online status

Also in this change:

  • Migrated all buttons in the sidebar and account info panel to use @immich/ui components, for consistent spacing and look.
  • Moved the theme toggle into the account info panel, to declutter the top navigation.
  • Fix the focus out behavior on the search bar so it will properly activate/deactivate. Currently it stays highlighted and never deactivates after focus leaves.
  • Maintain focus in the sidebar if a tree item is clicked on the folders or tags pages
  • Use bubbling instead of capturing for the click-outside Svelte action, to allow for finer control of the events, and stopping upward propogation if needed

How Has This Been Tested?

  • Testing that the sidebar is behaving as expected for all screen sizes in Firefox, Safari, and Chrome on MacOS.
  • Focusing the search bar highlights it, removing focus removes the color highlighting
  • Theme toggle working in the account info panel
  • The sidebar works as expected in the "Administration" settings, Folders page, Tags page, and main Immich sidebar

Screenshots

New account info panel

Sidebar expanded, phone size

Persistent sidebar, tablet size

Purchase options, phone size

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code

Copy link
Contributor

Deploying preview environment to https://pr-16768.preview.internal.immich.cloud/

- add skip link unit test
- remove unused tailwind styles
- adjust asset grid spacing
- fix event propogation
@ben-basten ben-basten force-pushed the feat/responsive-sidebar branch from cc0b286 to ec9a70c Compare March 11, 2025 02:32
@jrasm91 jrasm91 added preview and removed preview labels Mar 11, 2025
@jrasm91
Copy link
Contributor

jrasm91 commented Mar 11, 2025

Looks like the menu items only work once and then they seem to only trigger closing the sidebar (on mobile at least)

@ben-basten ben-basten changed the title feat: expand/collapse sidebar feat(web): expand/collapse sidebar Mar 11, 2025
@ben-basten
Copy link
Collaborator Author

Looks like the menu items only work once and then they seem to only trigger closing the sidebar (on mobile at least)

Nice catch @jrasm91, looks like one of the event handlers wasn't being removed properly. It's now fixed in the preview deployment!

@ben-basten

This comment was marked as outdated.

Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

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

Very nice!

@ben-basten ben-basten force-pushed the feat/responsive-sidebar branch from db3fd4d to 03137d4 Compare March 11, 2025 22:24
@ben-basten ben-basten force-pushed the feat/responsive-sidebar branch from 12358b8 to 568a049 Compare March 12, 2025 04:09
@ben-basten ben-basten marked this pull request as ready for review March 12, 2025 20:45
@ben-basten
Copy link
Collaborator Author

ben-basten commented Mar 17, 2025

This changes the appearance of the account info panel and moves the dark mode button into the account info panel, which sounds like they might not be desired changes at this time. Let me know if these need to be adjusted, I'm also watching for conversation on #16838.

Edit: I reverted the changes to the top nav icons and account info panel.

Screenshot

@ben-basten ben-basten force-pushed the feat/responsive-sidebar branch from a5b949d to f298087 Compare March 21, 2025 01:49
@zackpollard zackpollard requested a review from alextran1502 April 1, 2025 00:50
@alextran1502
Copy link
Contributor

Thank you <3 sorry for the hassle!

@alextran1502 alextran1502 merged commit 6e62c09 into main Apr 2, 2025
45 checks passed
@alextran1502 alextran1502 deleted the feat/responsive-sidebar branch April 2, 2025 02:12
@github-actions github-actions bot removed the preview label Apr 2, 2025
kirill-dev-pro pushed a commit to kirill-dev-pro/immich-but-with-public-albums-within-instance that referenced this pull request Apr 6, 2025
* feat: expand/collapse sidebar

* fix: general PR cleanup

- add skip link unit test
- remove unused tailwind styles
- adjust asset grid spacing
- fix event propogation

* fix: cleaning up event listeners

* fix: purchase modal and button on small screens

* fix: explicit tailwind classes

* fix: no animation on initial page load

* fix: sidebar spacing and reactivity

* chore: reverting changes to icons in nav and account info panel

* fix: remove left margin from the asset grid after merging in new timeline

* chore: extract search-bar changes for a separate PR

* fix: add margin to memories
savely-krasovsky pushed a commit to savely-krasovsky/immich that referenced this pull request Jun 8, 2025
* feat: expand/collapse sidebar

* fix: general PR cleanup

- add skip link unit test
- remove unused tailwind styles
- adjust asset grid spacing
- fix event propogation

* fix: cleaning up event listeners

* fix: purchase modal and button on small screens

* fix: explicit tailwind classes

* fix: no animation on initial page load

* fix: sidebar spacing and reactivity

* chore: reverting changes to icons in nav and account info panel

* fix: remove left margin from the asset grid after merging in new timeline

* chore: extract search-bar changes for a separate PR

* fix: add margin to memories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants