Skip to content

Conversation

@bhorbowicz
Copy link
Contributor

Fixes #13804

Summary

This PR changes search functionality in Resources screen to case insensitive, adds a margin below the search field and align the search field to the left with CSS fixes for loading indicator.

Testing

  1. Add attachments to your notes.
  2. Go to Tools -> Note attachments...
  3. Use search field to filter the attachments list
resources_search_case_insensitive.mp4

Comment on lines 89 to 90
const filterLowerCase = props.filter.toLowerCase();
return resource.title?.toLocaleLowerCase().includes(filterLowerCase) || resource.id.toLowerCase().includes(filterLowerCase);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Be sure to match the .toLowerCase and .toLocaleLowerCase uses. For certain system locales, .toLocaleLowerCase gives different output from .toLowerCase for the same input. For example, if the system locale is tr and props.filter is 'İ', then filterLowerCase would be 'i̇' and resource.title?.toLocaleLowerCase() would be 'i'. See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed 🙈 Updated the code to use toLowerCase only.

@mrjo118
Copy link
Contributor

mrjo118 commented Dec 1, 2025

Just wondering, why was there a need to move the search box to the left? The ask on the issue raised was just to add a bit of space below it

@bhorbowicz
Copy link
Contributor Author

The search field should be aligned to the left, rather than right.

@mrjo118
Copy link
Contributor

mrjo118 commented Dec 1, 2025

The search field should be aligned to the left, rather than right.

Oh I see, that last requirement merged with the image to my eyes...

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.

Search feature in Resource screen needs to be improved

3 participants