Skip to content

Commit b7115ce

Browse files
feat: my shared archives base functionality
1 parent 3c6bc13 commit b7115ce

10 files changed

Lines changed: 14661 additions & 33 deletions

export.md

Lines changed: 13774 additions & 0 deletions
Large diffs are not rendered by default.

src/argo-archive-list.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "@material/web/list/list-item.js";
77
import "@material/web/checkbox/checkbox.js";
88
import "@material/web/icon/icon.js";
99
import "@material/web/labs/card/elevated-card.js";
10-
10+
// @ts-expect-error
1111
import filingDrawer from "assets/images/filing-drawer.avif";
1212

1313
import { getLocalOption } from "./localstorage";
@@ -184,15 +184,12 @@ export class ArgoArchiveList extends LitElement {
184184
protected updated(changed: PropertyValues) {
185185
super.updated(changed);
186186

187-
// 2) Rebuild the index when the raw pages change:
188187
if (changed.has("pages")) {
189188
this.flex = new FlexIndex<string>({
190189
tokenize: "forward",
191190
resolution: 3,
192191
});
193192
this.pages.forEach((p) => {
194-
// include title + text (and URL if you like)
195-
196193
const toIndex = [p.title ?? "", p.text ?? ""].join(" ");
197194
this.flex.add(p.ts, toIndex);
198195
});
@@ -204,6 +201,7 @@ export class ArgoArchiveList extends LitElement {
204201
this.filteredPages = [...this.pages];
205202
} else {
206203
// partial matches on title/text via the “match” preset
204+
// @ts-expect-error
207205
const matches = this.flex.search(this.filterQuery) as string[];
208206
this.filteredPages = this.pages.filter((p) => matches.includes(p.ts));
209207
}

0 commit comments

Comments
 (0)