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
6 changes: 4 additions & 2 deletions loop-library/scripts/check.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ assert(html.includes("Search the library"));
assert(html.includes("Search by title, task, or contributor"));
assert(html.includes('class="search-field"'));
assert(html.includes("styles.css?v=20260623-row-background-v2"));
assert(html.includes("script.js?v=20260625-form-protection"));
assert(html.includes("script.js?v=20260702-popular-sort"));
assert(css.includes(".search-control-label"));
assert(css.includes(".search-control:hover .search-field"));
assert(css.includes(".search-control:focus-within .search-field"));
Expand All @@ -154,7 +154,7 @@ assert.match(css, /\.loop-table td\s*\{[^}]*background:\s*transparent;[^}]*\}/);
assert.equal((html.match(/data-here-now-credit/g) || []).length, 2);
for (const page of [learnHtml, agentHtml]) {
assert(page.includes("styles.css?v=20260623-row-background-v2"));
assert(page.includes("script.js?v=20260625-form-protection"));
assert(page.includes("script.js?v=20260702-popular-sort"));
}
for (const page of [html, learnHtml, agentHtml]) {
const brandPosition = page.indexOf('class="brand-lockup"');
Expand Down Expand Up @@ -186,6 +186,8 @@ assert(browserScript.includes('params.set("sort", activeSort)'));
assert(browserScript.includes("function comparePopular"));
assert(browserScript.includes("Number(b.dataset.upvotes || 0)"));
assert(html.includes('<option value="featured">Featured, then popular</option>'));
assert(html.includes('<option value="popular">Most popular</option>'));
assert(browserScript.includes('activeSort === "popular"'));
assert(browserScript.includes("library-pagination"));
assert(!browserScript.includes("innerHTML"));

Expand Down
2 changes: 1 addition & 1 deletion loop-library/site/agents/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
/>
<link rel="icon" type="image/png" href="../assets/favicon.png" />
<link rel="stylesheet" href="../styles.css?v=20260623-row-background-v2" />
<script src="../script.js?v=20260625-form-protection" defer></script>
<script src="../script.js?v=20260702-popular-sort" defer></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand Down
3 changes: 2 additions & 1 deletion loop-library/site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
]
}
</script>
<script src="./script.js?v=20260625-form-protection" defer></script>
<script src="./script.js?v=20260702-popular-sort" defer></script>
<title>Loop Library: Repeatable AI Agent Workflows | Forward Future</title>
</head>
<body>
Expand Down Expand Up @@ -430,6 +430,7 @@ <h2 id="agent-skill-title">
<span>Sort</span>
<select id="loop-sort">
<option value="featured">Featured, then popular</option>
<option value="popular">Most popular</option>
<option value="newest">Newest → oldest</option>
<option value="oldest">Oldest → newest</option>
<option value="alphabetical">A–Z</option>
Expand Down
2 changes: 1 addition & 1 deletion loop-library/site/learn/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
/>
<link rel="icon" type="image/png" href="../assets/favicon.png" />
<link rel="stylesheet" href="../styles.css?v=20260623-row-background-v2" />
<script src="../script.js?v=20260625-form-protection" defer></script>
<script src="../script.js?v=20260702-popular-sort" defer></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand Down
5 changes: 5 additions & 0 deletions loop-library/site/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const loopRowPositions = new Map(
);
const SORT_OPTIONS = new Set([
"featured",
"popular",
"newest",
"oldest",
"alphabetical",
Expand Down Expand Up @@ -155,6 +156,10 @@ function applySort(sort) {
});
}

if (activeSort === "popular") {
return comparePopular(a, b);
}

if (activeSort === "newest") {
return compareNewest(a, b);
}
Expand Down
Loading