From 14cffa86f2dbc622ccceaeda7d7c825c74bc94ec Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Fri, 30 Oct 2026 21:46:15 -0700 Subject: [PATCH] refactor(quality): remove unused JavaScript variables and imports --- tests/browser/activity-concept.spec.mjs | 1 - tests/browser/workspace-saved-views.spec.mjs | 2 +- tests/browser/workspace-system-diagnostics.spec.mjs | 1 - tests/js/legacy-refusals.test.js | 10 ---------- web/comfy/prompt_manager.js | 2 -- web/js/admin.js | 2 -- web/js/workspace/file-inspector.mjs | 1 - web/js/workspace/local-resolver-support.mjs | 2 +- web/js/workspace/local-resolver.mjs | 1 - 9 files changed, 2 insertions(+), 20 deletions(-) diff --git a/tests/browser/activity-concept.spec.mjs b/tests/browser/activity-concept.spec.mjs index 9dd4e646..443a6c0e 100644 --- a/tests/browser/activity-concept.spec.mjs +++ b/tests/browser/activity-concept.spec.mjs @@ -6,7 +6,6 @@ import { THEMES, seedConcept, openConcept, openProduction, diffInventory, mutate // app.js 1428–1432) and its backup box with the concept's System `.notice`; the differences are D55. The job view // has no concept counterpart: it is compared with the approved mockup `activity-scan.html` (a local, ignored file), // whose structure and CSS values are restated below (D56). Each comparison is shown to notice a mutation. -const workspace = '/prompt_manager/workspace'; test.beforeEach(async ({ page, request, browserName }) => { await startCoverage(page, browserName); diff --git a/tests/browser/workspace-saved-views.spec.mjs b/tests/browser/workspace-saved-views.spec.mjs index 1b216a4d..69258546 100644 --- a/tests/browser/workspace-saved-views.spec.mjs +++ b/tests/browser/workspace-saved-views.spec.mjs @@ -233,7 +233,7 @@ test('a view stored under older rules still lists and opens with its usable valu // D153 (#447): the workspace no longer offers "Highest rated"; the API still stores such a view as it was saved. test('a view saved under Highest rated opens on Recently added on Images and the Library', async ({ page, request }) => { const images = await create(request, { page: 'images', name: 'Rated cats', state: { ...IMAGE_DEFAULTS, q: 'cat', sort: 'rating' } }); - const library = await create(request, { page: 'library', name: 'Rated dogs', state: { q: 'dog', category: '', sort: 'rating', tags: [], tag_mode: 'all', folder: '' } }); + await create(request, { page: 'library', name: 'Rated dogs', state: { q: 'dog', category: '', sort: 'rating', tags: [], tag_mode: 'all', folder: '' } }); expect((await listed(request)).map(view => view.state.sort)).toEqual(['rating', 'rating']); const listings = []; page.on('request', item => { diff --git a/tests/browser/workspace-system-diagnostics.spec.mjs b/tests/browser/workspace-system-diagnostics.spec.mjs index 2f4cc07a..8f8cf38c 100644 --- a/tests/browser/workspace-system-diagnostics.spec.mjs +++ b/tests/browser/workspace-system-diagnostics.spec.mjs @@ -11,7 +11,6 @@ const REPORT_URL = '/prompt_manager/system/diagnostics'; const LOGS_URL = '/prompt_manager/logs'; const CONFIG_URL = '/prompt_manager/logs/config'; const PREVIEW_URL = '/prompt_manager/maintenance/preview'; -const APPLY_URL = '/prompt_manager/maintenance/apply'; const TEST_LINK_URL = '/prompt_manager/diagnostics/test-link'; const CHANGED = 'The log files changed since the review; nothing was deleted. Review again.'; const KEY = 'sk-s12-browser-SECRET-0123456789'; diff --git a/tests/js/legacy-refusals.test.js b/tests/js/legacy-refusals.test.js index 78d15c9b..23f6cf0e 100644 --- a/tests/js/legacy-refusals.test.js +++ b/tests/js/legacy-refusals.test.js @@ -21,14 +21,6 @@ function jsonResponse(status, body) { json: async () => body }; } -function sseResponse(frames) { - const bytes = new TextEncoder().encode(frames.map(frame => `data: ${JSON.stringify(frame)}\n\n`).join('')); - let sent = false; - return { ok: true, status: 200, body: { getReader: () => ({ - read: async () => (sent ? { done: true } : (sent = true, { done: false, value: bytes })), - }) } }; -} - function load(file, className, fetchUrl, extra = {}, dom = elements()) { const timers = []; const notifications = []; @@ -63,8 +55,6 @@ function load(file, className, fetchUrl, extra = {}, dom = elements()) { return { page, dom, timers, notifications, storage }; } -const BUSY = 'Scan for metadata already running'; - test('admin settings save shows why config.json refused it', async () => { const message = 'config.json cannot be read, so nothing was saved. Fix or remove the file, then save again.'; const { page, notifications } = load('admin.js', 'PromptAdmin', diff --git a/web/comfy/prompt_manager.js b/web/comfy/prompt_manager.js index ddd36e5e..6d875c04 100644 --- a/web/comfy/prompt_manager.js +++ b/web/comfy/prompt_manager.js @@ -354,8 +354,6 @@ app.registerExtension({ if (textWidget) { // Store reference to the widget for the closure const widgetRef = textWidget; - const originalSerializeValue = textWidget.serializeValue; - // Override serializeValue - use arrow function to capture widgetRef textWidget.serializeValue = (nodeId, widgetIndex) => { // Always return the current DOM value using our stored reference diff --git a/web/js/admin.js b/web/js/admin.js index 16039261..a3b4b7c4 100644 --- a/web/js/admin.js +++ b/web/js/admin.js @@ -2391,8 +2391,6 @@ Seed: ${this.currentMetadata.seed || 'Unknown'}`; // Extract relative path from the full path // The image_path might be absolute, we need to serve it via the API const path = image.image_path; - // Try to get filename for serving - const filename = image.filename || path.split(/[/\\]/).pop(); // Use the image ID if available, otherwise use the path-based serve endpoint if (image.id) { return ApiClient.resolveUrl(`/prompt_manager/images/${image.id}/file`); diff --git a/web/js/workspace/file-inspector.mjs b/web/js/workspace/file-inspector.mjs index 4135152c..97a4f0c6 100644 --- a/web/js/workspace/file-inspector.mjs +++ b/web/js/workspace/file-inspector.mjs @@ -1,7 +1,6 @@ import { createScope, createButton } from '../shared/toolkit/core.js'; import { mountPromptBlocks, promptRoles } from './prompt-blocks.mjs'; import { createInspectionController } from './inspection-state.mjs'; -import { createSendButton } from './prompt-sender.mjs'; import { createWorkspaceIcon } from './icons.mjs'; import { navigateTo } from './state.mjs'; import { showWorkspaceToast } from './toast.mjs'; diff --git a/web/js/workspace/local-resolver-support.mjs b/web/js/workspace/local-resolver-support.mjs index 7e062cdb..aa7e0271 100644 --- a/web/js/workspace/local-resolver-support.mjs +++ b/web/js/workspace/local-resolver-support.mjs @@ -1,7 +1,7 @@ // Tables, evidence reader, bounds and outcome lines for local-resolver.mjs (#249 local Inspect, PR L3 Tasks 8-9): // the constants of utils/prompt_pair_resolver.py and utils/inspection_outcomes.py, utils/pair_execution.py // `read_pair_execution` and the semantics table check of utils/inspection_semantics.py. No DOM. -import { PyFloat, PyValueError, isDict, isList, isInt, pyJsonLoads, pyLen, pySlice, pyStrip, pyTruthy, pyEqualsOne, pyStr, pyGet } from './py-json.mjs'; +import { PyValueError, isDict, isList, isInt, pyJsonLoads, pyLen, pySlice, pyTruthy, pyEqualsOne, pyGet } from './py-json.mjs'; /** The semantics table is unusable: the server's `SemanticsError`. */ export class SemanticsError extends Error { diff --git a/web/js/workspace/local-resolver.mjs b/web/js/workspace/local-resolver.mjs index 435b1a2a..9ce727f7 100644 --- a/web/js/workspace/local-resolver.mjs +++ b/web/js/workspace/local-resolver.mjs @@ -41,7 +41,6 @@ import { UNVERIFIABLE_CODES, Unresolved, ZEROED_SOURCE, - compileSemantics, explained, isLink, nodeRef,