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

Replace hand-rolled dropdown on the dashboard and menu-related UI fixes #5037

Open
wants to merge 23 commits into
base: saved-segments/singular-bar
Choose a base branch
from

Conversation

apata
Copy link
Contributor

@apata apata commented Jan 30, 2025

Changes

  • Removes handrolled dropdowns and replaces them with headlessui Popovers: https://headlessui.com/v1/react/popover

    • Also tried to use headlessui Menu component for datepicker, but unfortunately those were too opinionated to work well with our keybinds.

    • Had to refactor the datepicker: visually that means extremely minor changes (first group doesn't have top padding)

  • Fixes the issue with calendars positioning off screen, aligning their right edge to right of dropdown or right of visible page on smaller screens.

    • Removes flatpickr position styles from CSS and applies position styles with TW.
  • Fixes issues with Dashboard modals not receiving focus

  • Fixes issues with Escape clearing filters instead of closing opened menu / popover

    • This was a bit hacky due to headlessui API: we have to stop Escape propagating from Popover.Button (which receives focus on escaping from Popover). If the button isn't blurred immediately, user will have to tab off the button for the clear all filters keybind to work.
  • Fixes issues with multiple dropdowns being openable at the same time

  • Optimises top bar components re-rendering too many times for no reason

One little issue remains: the calendar doesn't close when navigating to other menus with the keyboard, nor does it capture focus or Escape, and close itself on Escape or Tab out. I tried various ways to render the calendars 1) in headlessui dialogs 2) in headlessui popovers etc, but wasn't able to get it working.

Tests

  • Automated tests have been added

Changelog

  • Entry has been added to changelog
  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • The UI has been tested both in dark and light mode

@apata apata changed the base branch from master to saved-segments/singular-bar January 30, 2025 17:06
@apata apata added the preview label Jan 30, 2025
Copy link

Preview environment👷🏼‍♀️🏗️
PR-5037

@apata apata changed the title Saved segments/replace handrolled dropdown Replace hand-rolled dropdown on the dashboard and menu-related UI fixes Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant