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

Fix filter on filenames with diacritical marks #21

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

Rvervuurt
Copy link

Related:

Issue

Can't filter on file names with å and Å. In looking for a fix, I found it it's called characters with diacritical marks

Solution

I got some help from ChatGPT.
This solution normalizes words by splitting the diacritical marks in the filter function, so now forhånd and forhand result in the same files. Before, when trying to filter on forhåndsvisning, I had to stop after forha, because the filter didn't match anymore (in the filename, the å was split up in a and º, but I couldn't type that in the filter of course).
After it has normalized the characters, it then removes the diacritical marks. They're still displayed in the overview, but in the filter function, they are ignored.

image

image

Impact

I can't imagine this will have any impact on either the codebase, performance or backwards compatibility. It'll only impact users (positively!) who work with alphabets with diacritical characters

Usage Changes

Filter now supports filtering on words with diacritical characters

Considerations

I got help from ChatGPT to fix this. I think it's a good idea if a "real" developer takes a good look at the solution before merging it into the main branch.

Testing

No unit tests included, but I also doubt there has to be a unit test for such a small addition?

Copy link
Member

@mike-sheppard mike-sheppard left a comment

Choose a reason for hiding this comment

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

yep looks good to me, thanks @Rvervuurt 🙏

@mike-sheppard mike-sheppard merged commit a39a772 into smithfield-studio:main Oct 15, 2024
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