mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-25 17:57:06 +00:00
feat(app-store): sort grid by stars and rotate featured weekly (#787)
Grid templates are now sorted by star count (descending) so popular apps surface naturally rather than appearing in registry fetch order. Featured hero rotates weekly among the top 5 starred apps instead of always pinning the single highest-starred entry. Rotation is seeded by week number so all nodes show the same featured app throughout a given week. Registries with no star data gracefully skip the featured hero and preserve their natural ordering.
This commit is contained in:
@@ -247,8 +247,10 @@ export function AppStoreView({ onDeploySuccess }: AppStoreViewProps) {
|
||||
}, [filtered, searchQuery]);
|
||||
|
||||
const gridTemplates = useMemo(() => {
|
||||
if (!featuredTemplate) return filtered;
|
||||
return filtered.filter(t => t.title !== featuredTemplate.title);
|
||||
const base = featuredTemplate
|
||||
? filtered.filter(t => t.title !== featuredTemplate.title)
|
||||
: filtered;
|
||||
return [...base].sort((a, b) => (b.stars ?? 0) - (a.stars ?? 0));
|
||||
}, [filtered, featuredTemplate]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user