Skip to content
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
2 changes: 0 additions & 2 deletions app/lib/frontend/handlers/experimental.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ class ExperimentalFlags {

bool get useSearchPost => isEnabled('search-post');

bool get showTrending => true;

String encodedAsCookie() => _enabled.join(':');

@override
Expand Down
14 changes: 5 additions & 9 deletions app/lib/frontend/templates/_consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.

import 'package:_pub_shared/search/tags.dart';
import 'package:pub_dev/frontend/request_context.dart';

import '../dom/dom.dart' as d;

Expand Down Expand Up @@ -119,16 +118,13 @@ final _sortDicts = const <SortDict>[
id: 'downloads',
label: 'downloads',
tooltip: 'Packages are sorted by their download counts.'),
SortDict(
id: 'trending',
label: 'trending',
tooltip: 'Packages are sorted by trending.'),
];

List<SortDict> getSortDicts(bool isSearch) {
final removeId = isSearch ? 'listing_relevance' : 'search_relevance';
return <SortDict>[
..._sortDicts.where((d) => d.id != removeId),
if (requestContext.experimentalFlags.showTrending)
SortDict(
id: 'trending',
label: 'trending',
tooltip: 'Packages are sorted by trending.'),
];
return _sortDicts.where((d) => d.id != removeId).toList();
}