Skip to content

Commit 009f8ec

Browse files
committed
feat: change default sort order to installs
1 parent b141739 commit 009f8ec

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/api/extensions/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ type SortField = keyof typeof SORT_FIELDS;
1717

1818
const MAX_LIMIT = 100;
1919
const DEFAULT_LIMIT = 20;
20-
const DEFAULT_SORT: SortField = "stars";
20+
const DEFAULT_SORT: SortField = "installs";
2121

2222
/**
2323
* GET /api/extensions
2424
*
2525
* Query parameters:
2626
* page - Page number, 1-indexed (default: 1)
2727
* limit - Items per page, max 100 (default: 20)
28-
* sort - Sort field: "stars" | "installs" | "updated" (default: "stars")
28+
* sort - Sort field: "stars" | "installs" | "updated" (default: "installs")
2929
* order - Sort direction: "asc" | "desc" (default: "desc")
3030
* q - Optional search query (matches title, name, description, author)
3131
*

components/store/StoreGrid.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface StoreGridProps {
1515
export function StoreGrid({ extensions }: StoreGridProps) {
1616
const { t } = useLocale();
1717
const [search, setSearch] = useState("");
18-
const [sortKey, setSortKey] = useState<SortKey>("stars");
18+
const [sortKey, setSortKey] = useState<SortKey>("installs");
1919

2020
const filtered = useMemo(() => {
2121
const q = search.toLowerCase().trim();
@@ -40,8 +40,8 @@ export function StoreGrid({ extensions }: StoreGridProps) {
4040
}, [extensions, search, sortKey]);
4141

4242
const sortOptions: { key: SortKey; label: string }[] = [
43-
{ key: "stars", label: t("store.sort.stars") },
4443
{ key: "installs", label: t("store.sort.installs") },
44+
{ key: "stars", label: t("store.sort.stars") },
4545
{ key: "updated", label: t("store.sort.updated") },
4646
];
4747

0 commit comments

Comments
 (0)