style: format web/src with oxfmt defaults (via vp fmt)

One-time mechanical sweep, isolated from any functional change.
- oxfmt defaults: double quotes, semicolons, 2-space indent, LF,
  printWidth 100, trailing commas, bracket spacing, arrow parens.
- vite.config.ts gains an fmt.ignorePatterns block for web/static:
  vendored/minified assets (htmx.min.js, compiled css) must never
  be reformatted.
- Verified: rebuild after the sweep produces byte-identical JS/CSS
  bundles; only sourcemaps changed (they embed sourcesContent).
This commit is contained in:
John O'Keefe committed 2026-10-21 13:18:24 -04:00
1 parent 8aeecaa0ef
commit 77cd268f4e
37 files changed
+1151 -1853

No files matched your search

+18 -30
View File
@@ -5,9 +5,7 @@ const SEARCH_DEBOUNCE_MS = 300;
const SEARCH_MIN_CHARS = 2;
function initializeSearch(): void {
const searchInput = document.getElementById(
"header-search",
) as HTMLInputElement | null;
const searchInput = document.getElementById("header-search") as HTMLInputElement | null;
const mobileSearchInput = document.getElementById(
"header-search-mobile",
) as HTMLInputElement | null;
@@ -107,11 +105,9 @@ function selectSearchResult(items: NodeListOf<Element>, index: number): void {
}
function getActiveSearchInput(): HTMLInputElement | null {
return (
document.activeElement?.id === "header-search-mobile"
? (document.getElementById("header-search-mobile") as HTMLInputElement)
: (document.getElementById("header-search") as HTMLInputElement)
);
return document.activeElement?.id === "header-search-mobile"
? (document.getElementById("header-search-mobile") as HTMLInputElement)
: (document.getElementById("header-search") as HTMLInputElement);
}
function performSearch(query: string): void {
@@ -138,27 +134,21 @@ function performSearch(query: string): void {
}
return response.json();
})
.then(
(
data:
| { error?: string; results?: MediaItemSummary[] }
| MediaItemSummary[],
) => {
hideSearchLoading();
.then((data: { error?: string; results?: MediaItemSummary[] } | MediaItemSummary[]) => {
hideSearchLoading();
const resultActiveId = getActiveSearchInput()?.id;
const resultActiveId = getActiveSearchInput()?.id;
if (data && "error" in data && data.error === "no results found") {
showNoResults(query, resultActiveId);
} else if (Array.isArray(data) && data.length > 0) {
showSearchResults(data, query, resultActiveId);
} else if (Array.isArray(data)) {
showNoResults(query, resultActiveId);
} else {
showNoResults(query, resultActiveId);
}
},
)
if (data && "error" in data && data.error === "no results found") {
showNoResults(query, resultActiveId);
} else if (Array.isArray(data) && data.length > 0) {
showSearchResults(data, query, resultActiveId);
} else if (Array.isArray(data)) {
showNoResults(query, resultActiveId);
} else {
showNoResults(query, resultActiveId);
}
})
.catch((error) => {
hideSearchLoading();
console.error("Search error:", error);
@@ -292,9 +282,7 @@ function createSearchResultsContainer(activeId?: string): void {
searchResults.style.cssText =
"background-color: var(--bg-secondary); border-color: var(--border)";
const searchInput = document.getElementById(
activeId || "header-search",
);
const searchInput = document.getElementById(activeId || "header-search");
if (searchInput) {
const searchContainer = searchInput.closest(".relative");
if (searchContainer) {