Skip to content

Fix sorting in Domain Selection screen #24631

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

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

kean
Copy link
Contributor

@kean kean commented Jun 26, 2025

@kean kean added this to the 26.0 milestone Jun 26, 2025
@kean kean added the Domains label Jun 26, 2025
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 26.0. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

} else {
// If neither rhs nor lhs ara a match then sort alphabetically
return lhs.domainName.caseInsensitiveCompare(rhs.domainName) == .orderedAscending
completion(Result.failure(error))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

RCA:

  1. Server returns results already sorted by relevance. If the query is specific enough, it might start returning low-relevance domains with dashes at the bottom of the response:
{
    "domain_name": "buy-a-simple-domain.casa",
    "relevance": 0.32,
  1. The spring incorrectly sorts the domains with dashes earlier than the same domains without them.

The app doesn't need the extra sorting as the default relevance-based sorting is done by the server and matches the web.

@@ -64,20 +62,6 @@ final class DomainSelectionViewController: CollapsableHeaderViewController {
table.reloadData()
}
}
private var _hasExactMatch: Bool = false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was unused.

@kean kean requested a review from crazytonyli June 26, 2025 13:54
@kean kean enabled auto-merge June 26, 2025 13:54
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jun 26, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number28017
VersionPR #24631
Bundle IDcom.jetpack.alpha
Commitbb29b06
Installation URL0luu1n413gamo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jun 26, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number28017
VersionPR #24631
Bundle IDorg.wordpress.alpha
Commitbb29b06
Installation URL20jsp0e2sedl0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Copy link

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.

3 participants