-
Notifications
You must be signed in to change notification settings - Fork 9
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
Ignore accents when doing a bookmark search #3255
Ignore accents when doing a bookmark search #3255
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, mostly around naming, documentation and unit tests @mainactor use
@@ -85,6 +85,24 @@ extension String { | |||
self.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty | |||
} | |||
|
|||
var cleanStringForBookmarkSearch: String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very picky notes:
- In general, functions that get self and return a modified version of self are named like
replacingOccurrences(of:...)
, this could bereplacing....
orcleaning...
- This is a function in a shared framework but is very specific and undocumented, I see 2 options here:
a. Use a more generic name and add documentation explaining the input, the expected output, the use cases and examples.
b. Leave it as it is but move it from the shared extension to a private, bookmarks only, extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will move the extension to where is used and make it private. This is not going to be used elsewhere so it makes sense to remove it from here 👍🏼 .
About the name, I’m renaming it to: cleaningStringForBookmarkSearch
. I will also add some documentation to it.
.lowercased() | ||
} | ||
|
||
private func removeAccents() -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, very generic name and no documentation.
The above naming convention comment is valid for this too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@federicocappelli What’s generic about the name 🤔 ? Removing accents seems clear to me, the function removes any accent from the string. What other naming suggestions do you have in mind?
I will add some documentation so it’s clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, with generic name
I meant that it doesn't follow the usual naming convention replacing.... or cleaning... etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# By Dominik Kapusta (4) and others # Via Dominik Kapusta (4) and GitHub (2) * main: Support dragging strings to new tab button (#3228) BSK - Add feature flag for SKAN API (#3265) Ignore accents when doing a bookmark search (#3255) Update UI tests workflows to always compile the app on the supported version of Xcode (#3262) Bump C.S.S (via BSK) (#3244) Tab previews presentation implementation adjusted for the latest MouseOverView logic (#3260) Bump version to 1.106.0 (260) Default to appstore signing for fastlane match Clean up secrets in GHA workflows Update Onboarding gradients (#3248) Wait for UserScripts to be loaded for email protection (#3252) Fix UI tests failing in the CI (#3254) Fix WKDownloadMock mock (#3258) VPN Proxy stop and pixel improvements (#3239) Use fastlane match for code signing DMG builds (#3246) Implement new VPN site troubleshooting report alert (#3224) # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
# By Dominik Kapusta (7) and others # Via Dominik Kapusta (6) and GitHub (4) * main: (37 commits) Add visted links support (#3261) Bump version to 1.106.0 (261) Update Gemfile.lock Remove migration file (#3270) Use new AsanaCreateActionItem action (#3264) Update survey builder OS version (#3247) Support dragging strings to new tab button (#3228) BSK - Add feature flag for SKAN API (#3265) Ignore accents when doing a bookmark search (#3255) Update UI tests workflows to always compile the app on the supported version of Xcode (#3262) Bump C.S.S (via BSK) (#3244) Tab previews presentation implementation adjusted for the latest MouseOverView logic (#3260) Bump version to 1.106.0 (260) Default to appstore signing for fastlane match Clean up secrets in GHA workflows Update Onboarding gradients (#3248) Wait for UserScripts to be loaded for email protection (#3252) Fix UI tests failing in the CI (#3254) Fix WKDownloadMock mock (#3258) VPN Proxy stop and pixel improvements (#3239) ... # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Task/Issue URL: https://app.asana.com/0/1203972458584429/1208262956542583/f
Tech Design URL:
CC:
Description
Acceptance criteria
AC#1
Given a user with a bookmark with an accent, for example
café
, when searching forcafe
we should return the bookmark with the accent.AC#2
Given a user with a bookmark without an accent, for example
cafe
, when searching forcafé
we should return the bookmark without the accent, ignoring the accent on the search query.AC#3
Given a user with a bookmark with symbols, for example, Site • Login , when searching for site login then we should return the bookmark with the symbol
AC#4
Given a user with a bookmark without symbols, for example, Site Login , when searching for site • login then we should return the bookmark without the symbol ignoring the symbol in the search query.
Steps to test this PR
Accents
café
cafe
(without the accent)cafe
, and search forcafé
, the accent should be ignored and the result should be returned in the search.Symbols
Site • Login
site login
(without the symbol)Definition of Done:
—
Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation