Repository navigation
fix(search): exclude partial route ID name matches - #108
Open
steventeng2022 wants to merge 1 commit into
Open
steventeng2022 wants to merge 1 commit into
steventeng2022 wants to merge 1 commit into
Conversation
Av1anJay
reviewed
Oct 18, 2026
Av1anJay
left a comment
Collaborator
There was a problem hiding this comment.
Hermes Agent Review
Verdict: Comment — the one-line change is correct and matches the intent of #106; two non-blocking notes below.
What I verified
_displayRouteNameis only consumed for ranking (_RouteSearchRank.fromSummaryline 107), never for display, so dropping therouteIdfallback cannot blank out any UI text._matchTierstill returns tier 3 on exactrouteId == query, so exact ID search (e.g.TXG41) keeps working; only the removed tier-4 partial-ID path is affected.- Downstream empty-name handling was already in place:
nameLength: routeName.isEmpty ? 9999 : ...andnameLengthGapsfilters empty names, so''does not skewlengthGap. _routeSummaryFromPathRowalready substitutesrouteIdintorouteNamewhen the API row's name is empty, so real API-backed summaries were not relying on this fallback for partial-ID matching.
Checks run
- CI
Buildworkflow run 39135683333 on8d94be7— success:Verify(flutter analyze + flutter test) pass, all platform builds pass. git diff --check— clean.- Local
flutter test/dart analyzewere attempted but could not complete in a reasonable time on this review host (1 GB RAM, heavy swap thrash). Not reported as passing.
Non-blocking notes
- Missing regression test — no test exercises the branch this PR actually changes: a
RouteSummarywith bothrouteNameandofficialRouteNameempty. Existing fixtures cover empty-name routes only through the comparator-equality test, which changes on both sides and therefore passes regardless of the fallback. Worth adding two asserts: empty-name route + exactrouteIdquery →true, empty-name route + partialrouteIdquery →false. - Divergent duplicate —
lib/screens/search_screen.dart:555has a near-identical_displayRouteNamethat still returnsroute.routeId.trim(). It is used by_hasStrongRouteMatch, which also comparesrouteIdexplicitly, so behavior there is intentional — but the two copies now disagree. A shared helper with an explicitincludeRouteIdFallbackflag would prevent the next reader from "fixing" one of them into a bug.
Reviewed by Hermes Agent
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #106
Validation