Skip to content

Commit d0ed7da

Browse files
Copilotlstein
andcommitted
Fix all ESLint unused variable warnings - clean codebase
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
1 parent e6063de commit d0ed7da

20 files changed

+41
-63
lines changed

photomap/frontend/static/javascript/about.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ class AboutManager {
143143
setTimeout(() => window.location.reload(), 1000);
144144
return;
145145
}
146-
} catch (e) {
146+
} catch {
147147
// Ignore errors, server is still down
148148
}
149149
setTimeout(pollForServer, 2000);
150150
})();
151151
}, 5000);
152-
} catch (e) {
152+
} catch {
153153
updateStatus.textContent = "Update complete. Please refresh manually.";
154154
}
155155
}, 1000);

photomap/frontend/static/javascript/album-manager.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export class AlbumManager {
270270
}
271271
}
272272

273-
_createAlbumPathRow({ path = "", onAddRow, onRemoveRow, onFolderPick, container } = {}) {
273+
_createAlbumPathRow({ path = "", onAddRow, onRemoveRow, onFolderPick } = {}) {
274274
const wrapper = document.createElement("div");
275275
wrapper.className = "album-path-row";
276276
wrapper.style.cssText = `
@@ -636,7 +636,7 @@ export class AlbumManager {
636636
status.style.color = "red";
637637
createBtn.textContent = "Create Index";
638638
}
639-
} catch (e) {
639+
} catch {
640640
status.textContent = "No index present";
641641
status.style.color = "red";
642642
createBtn.textContent = "Create Index";
@@ -988,7 +988,7 @@ export class AlbumManager {
988988
return;
989989
}
990990
}
991-
} catch (error) {
991+
} catch {
992992
console.debug(`Could not check backend indexing status for album: ${albumKey}`);
993993
}
994994

@@ -1035,7 +1035,6 @@ export class AlbumManager {
10351035
const progressContainer = cardElement.querySelector(".progress-container");
10361036
const cancelBtn = cardElement.querySelector(".cancel-index-btn");
10371037
const status = cardElement.querySelector(".index-status");
1038-
const estimatedTime = cardElement.querySelector(".estimated-time");
10391038

10401039
progressContainer.style.display = "block";
10411040
createBtn.style.display = "none";
@@ -1287,7 +1286,7 @@ export class AlbumManager {
12871286
return { albumKey, restored: true };
12881287
}
12891288
}
1290-
} catch (error) {
1289+
} catch {
12911290
console.debug(`No ongoing operation for album: ${albumKey}`);
12921291
}
12931292

photomap/frontend/static/javascript/bookmarks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class BookmarkManager {
8585

8686
setupEventListeners() {
8787
// Listen for album changes to load bookmarks for the new album
88-
window.addEventListener("albumChanged", (e) => {
88+
window.addEventListener("albumChanged", () => {
8989
this.loadBookmarks();
9090
this.isShowingBookmarks = false;
9191
this.previousSearchResults = null;
@@ -372,7 +372,7 @@ class BookmarkManager {
372372
}
373373

374374
// Create search results from bookmarked indices
375-
const results = indices.map((index, i) => ({
375+
const results = indices.map((index) => ({
376376
index: index,
377377
score: 1.0,
378378
cluster: null,

photomap/frontend/static/javascript/control-panel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function handleCopyText() {
9292

9393
// Delete the current file
9494
async function handleDeleteCurrentFile() {
95-
const [globalIndex, totalImages, searchIndex] = getCurrentSlideIndex();
95+
const [globalIndex, , searchIndex] = getCurrentSlideIndex();
9696
const currentFilepath = await getCurrentFilepath();
9797

9898
if (globalIndex === -1 || !currentFilepath) {
@@ -129,7 +129,7 @@ function showDeleteConfirmModal(filepath, globalIndex) {
129129
dontAsk.checked = false;
130130
modal.style.display = "flex";
131131

132-
function cleanup(result) {
132+
function cleanup() {
133133
modal.style.display = "none";
134134
cancelBtn.removeEventListener("click", onCancel);
135135
confirmBtn.removeEventListener("click", onConfirm);

photomap/frontend/static/javascript/curation.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { hideSpinner, showSpinner } from "./utils.js";
88

99
let currentSelectionIndices = new Set();
1010
const excludedIndices = new Set();
11-
let currentSelectionFiles = [];
1211
let analysisResults = [];
1312
let isExcludeMode = false;
1413

@@ -214,9 +213,6 @@ function setupEventListeners() {
214213
const lockThresholdBtn = document.getElementById("lockThresholdBtn");
215214
const unlockBtn = document.getElementById("unlockOutliersBtn");
216215

217-
const methodFps = document.getElementById("methodFps");
218-
const methodKmeans = document.getElementById("methodKmeans");
219-
220216
if (!runBtn) {
221217
return;
222218
}
@@ -469,7 +465,6 @@ function setupEventListeners() {
469465
currentSelectionIndices.add(idx);
470466
}
471467
});
472-
currentSelectionFiles = data.selected_files;
473468
analysisResults = data.analysis_results;
474469

475470
// Merge new results into Global Metadata Map
@@ -665,7 +660,6 @@ function clearSelectionData() {
665660
highFreqIndices.clear();
666661
medFreqIndices.clear();
667662
lowFreqIndices.clear();
668-
currentSelectionFiles = [];
669663
// Do NOT clear globalMetadataMap here, as we want to remember excluded items from previous runs
670664
}
671665

photomap/frontend/static/javascript/events.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ export function showHidePanelText(hide) {
182182
}
183183

184184
// Listen for slide changes to update UI
185-
window.addEventListener("slideChanged", (e) => {
186-
const { globalIndex, searchIndex, totalCount, isSearchMode } = e.detail;
185+
window.addEventListener("slideChanged", () => {
187186
// nothing to do here yet, but could be used to update UI elements
188187
});
189188

photomap/frontend/static/javascript/filetree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class DirectoryPicker {
137137
try {
138138
const error = await response.json();
139139
errorMessage = error.detail || errorMessage;
140-
} catch (e) {
140+
} catch {
141141
// JSON parsing failed, use default message
142142
}
143143
}

photomap/frontend/static/javascript/grid-view.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@ class GridViewManager {
150150
}
151151

152152
addGridEventListeners() {
153-
this.addEventListener(window, "swiperModeChanged", async (e) => {
153+
this.addEventListener(window, "swiperModeChanged", async () => {
154154
await this.resetAllSlides();
155155
});
156156

157-
this.addEventListener(window, "searchResultsChanged", async (e) => {
157+
this.addEventListener(window, "searchResultsChanged", async () => {
158158
await this.resetAllSlides();
159159
});
160160

161-
this.addEventListener(window, "slideChanged", async (e) => {
161+
this.addEventListener(window, "slideChanged", async () => {
162162
// nothing for now
163163
});
164164

@@ -170,7 +170,7 @@ class GridViewManager {
170170
});
171171

172172
this.addEventListener(window, "seekToSlideIndex", async (e) => {
173-
const { globalIndex, searchIndex, totalSlides, isSearchMode } = e.detail;
173+
const { globalIndex, isSearchMode } = e.detail;
174174
if (isSearchMode !== slideState.isSearchMode) {
175175
console.error("Mismatched search mode in setSlideIndex event");
176176
return;
@@ -299,7 +299,7 @@ class GridViewManager {
299299
return;
300300
}
301301
let lastTap = 0;
302-
slideEl.addEventListener("touchend", (e) => {
302+
slideEl.addEventListener("touchend", () => {
303303
const now = Date.now();
304304
if (now - lastTap < 350) {
305305
window.handleGridSlideDblClick(globalIndex);

photomap/frontend/static/javascript/metadata-drawer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ metadataLink.addEventListener("click", async (e) => {
224224
} else {
225225
metadataTextArea.value = "Failed to load metadata.";
226226
}
227-
} catch (err) {
227+
} catch {
228228
metadataTextArea.value = "Error loading metadata.";
229229
}
230230
});

photomap/frontend/static/javascript/search-ui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ document.addEventListener("DOMContentLoaded", async () => {
176176
}
177177
});
178178

179-
textSearchPanel.addEventListener("transitionend", (e) => {
179+
textSearchPanel.addEventListener("transitionend", () => {
180180
if (textSearchPanel.style.opacity === "0") {
181181
textSearchPanel.style.display = "none";
182182
const noResultsMsg = document.getElementById("noResultsMsg");
@@ -353,7 +353,7 @@ document.addEventListener("DOMContentLoaded", async () => {
353353
renderSearchImageThumbArea();
354354
});
355355

356-
export async function searchWithImage(file, first_slide) {
356+
export async function searchWithImage(file) {
357357
try {
358358
showSpinner();
359359
let results = await searchImage(file);

0 commit comments

Comments
 (0)