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

Updated Flutter icon weights for SDK search hits. #7329

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/lib/search/flutter_sdk_mem_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const _allowedLibraries = <String>{
};

const _flutterApiPageDirWeights = <String, double>{
'cupertino/CupertinoIcons': 0.7,
'material/Icons': 0.7,
'cupertino/CupertinoIcons': 0.25,
'material/Icons': 0.25,
};

final _logger = Logger('search.flutter_sdk_mem_index');
Expand Down
5 changes: 4 additions & 1 deletion app/lib/search/sdk_mem_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ class SdkMemIndex {
},
);

hits.add(_Hit(library, weightedResults));
final hit = _Hit(library, weightedResults);
if (hit.score > 0.25) {
hits.add(hit);
}
}
if (hits.isEmpty) return <SdkLibraryHit>[];

Expand Down