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: 1 addition & 1 deletion 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=20260621-author-byline" />
<script src="../script.js?v=20260622-retry-after" defer></script>
<script src="../script.js?v=20260622-search-index" defer></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand Down
2 changes: 1 addition & 1 deletion 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=20260622-retry-after" defer></script>
<script src="./script.js?v=20260622-search-index" defer></script>
<title>Loop Library: Repeatable AI Agent Workflows | Forward Future</title>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion 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=20260621-author-byline" />
<script src="../script.js?v=20260622-retry-after" defer></script>
<script src="../script.js?v=20260622-search-index" defer></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand Down
14 changes: 12 additions & 2 deletions site/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ if (loopTableBody) {
loopRows.forEach((row) => loopTableBody.append(row));
}

// Snapshot each row's searchable text before the prompt toggle is injected
// below. Read the loop content rather than the whole row so search does not
// match interface controls such as "Copy loop" or "Show more".
const rowSearchText = new Map(
loopRows.map((row) => {
const content = row.querySelector(".cell-loop") ?? row;
return [row, normalize(`${row.dataset.search ?? ""} ${content.textContent}`)];
}),
);

const promptPreviews = loopRows
.map((row, index) => {
const prompt = row.querySelector("[data-prompt]");
Expand Down Expand Up @@ -173,9 +183,9 @@ function updateLibrary() {

const query = normalize(searchInput.value);
const matchingRows = loopRows.filter((row) => {
const searchableText = `${row.dataset.search} ${row.textContent}`;
const searchableText = rowSearchText.get(row) ?? "";
const matchesSearch =
query.length === 0 || normalize(searchableText).includes(query);
query.length === 0 || searchableText.includes(query);
const matchesCategory =
activeCategory === "all" || row.dataset.category === activeCategory;
return matchesSearch && matchesCategory;
Expand Down
Loading