@@ -50,7 +50,7 @@ String renderPkgIndexPage(
5050 title: topPackages,
5151 messageFromBackend: searchResultPage.errorMessage,
5252 ),
53- nameMatches: _nameMatches (searchResultPage.nameMatches),
53+ nameMatches: _nameMatches (searchForm, searchResultPage.nameMatches),
5454 packageList: packageList (searchResultPage),
5555 pagination: searchResultPage.hasHit ? paginationNode (links) : null ,
5656 openSections: openSections,
@@ -124,14 +124,18 @@ class PageLinks {
124124 }
125125}
126126
127- d.Node ? _nameMatches (List <String >? matches) {
127+ d.Node ? _nameMatches (SearchForm form, List <String >? matches) {
128128 if (matches == null || matches.isEmpty) {
129129 return null ;
130130 }
131131 final singular = matches.length == 1 ;
132- final namePluralized = singular ? 'name' : 'names' ;
132+ final isExactNameMatch = singular && form.parsedQuery.text == matches.single;
133+ final nameMatchLabel = isExactNameMatch
134+ ? 'Exact package name match: '
135+ : 'Matching package ${singular ? 'name' : 'names' }: ' ;
136+
133137 return d.p (children: [
134- d.b (text: 'Matching package $ namePluralized : ' ),
138+ d.b (text: nameMatchLabel ),
135139 ...matches.expandIndexed ((i, name) {
136140 return [
137141 if (i > 0 ) d.text (', ' ),
0 commit comments