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

chore: Introduce token focus controller helper #2633

Merged
merged 2 commits into from
Sep 2, 2024
Merged

Conversation

pan-kot
Copy link
Member

@pan-kot pan-kot commented Aug 30, 2024

Description

Standardise focus handling between property filter tokens, nested tokens, editor tokens, file upload, and token editor.

This also fixes a bug caused but next filter index not being cleaned up. As result, the token transition did not always happen or instead of focusing on the adjacent token the focus moved to the input, see recording:

Screen.Recording.2024-08-30.at.10.46.26.mov

This is a preparation for property filter with token groups feature: #2627

How has this been tested?

  • Manual testing in all touched components and multiselect
  • Existing unit tests
  • New unit tests
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

src/file-upload/internal.tsx Outdated Show resolved Hide resolved
Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 99.01961% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.80%. Comparing base (3ccb87b) to head (68fa44c).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/internal/hooks/use-list-focus-controller.tsx 97.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2633   +/-   ##
=======================================
  Coverage   95.80%   95.80%           
=======================================
  Files         743      743           
  Lines       20409    20469   +60     
  Branches     6942     6965   +23     
=======================================
+ Hits        19553    19611   +58     
- Misses        848      850    +2     
  Partials        8        8           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pan-kot pan-kot marked this pull request as ready for review August 30, 2024 10:29
@pan-kot pan-kot requested a review from a team as a code owner August 30, 2024 10:29
@pan-kot pan-kot requested review from dpitcock and removed request for a team August 30, 2024 10:29
Copy link
Member

@dpitcock dpitcock left a comment

Choose a reason for hiding this comment

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

The useListFocusController is a nice solution to the problem.

@pan-kot pan-kot enabled auto-merge September 2, 2024 08:33
@pan-kot pan-kot added this pull request to the merge queue Sep 2, 2024
Merged via the queue into main with commit b1f2977 Sep 2, 2024
34 checks passed
@pan-kot pan-kot deleted the token-list-focus-hook branch September 2, 2024 08:57
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