From 58f4b7a448f894e997f21baf3cb8aff003678f5d Mon Sep 17 00:00:00 2001 From: CodeWithMaBot <310216433+CodeWithMaBot@users.noreply.github.com> Date: Thu, 26 Nov 2026 18:02:16 +0100 Subject: [PATCH 1/6] chore: remove comments from utils, domain, models, and directives Co-Authored-By: Claude Opus 5.5 --- src/app/directives/file-picker-focus.directive.ts | 1 - src/app/domain/availability-deferral.ts | 1 - src/app/domain/item-edit.ts | 1 - src/app/domain/poster-references.ts | 1 - src/app/domain/storage-schema.spec.ts | 1 - src/app/domain/storage-schema.ts | 15 --------------- src/app/models/readonly.ts | 2 -- src/app/utils/discussion-link.utils.ts | 2 -- src/app/utils/progress.utils.spec.ts | 2 +- src/app/utils/search-stream.utils.ts | 2 -- src/app/utils/sort.utils.spec.ts | 7 ------- src/app/utils/sort.utils.ts | 1 - 12 files changed, 1 insertion(+), 35 deletions(-) diff --git a/src/app/directives/file-picker-focus.directive.ts b/src/app/directives/file-picker-focus.directive.ts index 8949391..de2a6a7 100644 --- a/src/app/directives/file-picker-focus.directive.ts +++ b/src/app/directives/file-picker-focus.directive.ts @@ -9,7 +9,6 @@ import { Directive } from '@angular/core'; }) export class FilePickerFocusDirective { restoreFocus(): void { - // Request renderer focus whenever the native file picker closes, including cancellation. if (typeof window !== 'undefined' && typeof window.focus === 'function') { window.focus(); } diff --git a/src/app/domain/availability-deferral.ts b/src/app/domain/availability-deferral.ts index 34fa033..134b2e9 100644 --- a/src/app/domain/availability-deferral.ts +++ b/src/app/domain/availability-deferral.ts @@ -1,7 +1,6 @@ import { ReadonlyItem, SeriesProgress } from '../models/item.model'; import { isEpisodicType } from './item.constants'; -/** Elapsed hours, bounded by the ISO date range supported by persistence. */ export function deferralReturnDate(hours: number, now = Date.now()) { if (!Number.isSafeInteger(hours) || hours <= 0) return null; const until = now + hours * 3_600_000; diff --git a/src/app/domain/item-edit.ts b/src/app/domain/item-edit.ts index 74b2bb5..997a47c 100644 --- a/src/app/domain/item-edit.ts +++ b/src/app/domain/item-edit.ts @@ -6,7 +6,6 @@ type EditableFields = Omit< 'id' | 'createdAt' | 'watchHistory' | 'progress' | 'availabilityDeferral' >; -/** Omitted properties are untouched; null progress/season entries explicitly remove them. */ export type ItemEdit = Partial & { progress?: | (Partial> & { diff --git a/src/app/domain/poster-references.ts b/src/app/domain/poster-references.ts index 68e4d83..5a1c01e 100644 --- a/src/app/domain/poster-references.ts +++ b/src/app/domain/poster-references.ts @@ -1,6 +1,5 @@ import { Item } from '../models/item.model'; -/** Mutates only the detached import/export items, never the published collection. */ export function removeUnavailablePosterReferences( items: Record, availableIds: ReadonlySet, diff --git a/src/app/domain/storage-schema.spec.ts b/src/app/domain/storage-schema.spec.ts index 8e67d98..79806d0 100644 --- a/src/app/domain/storage-schema.spec.ts +++ b/src/app/domain/storage-schema.spec.ts @@ -227,7 +227,6 @@ describe('storage version compatibility', () => { expect(() => normalizeStorageData(newer)).toThrow(/newer version of Watch List/); expect(newer).toEqual(original); - // A future schema may replace today's required fields entirely. expect(() => normalizeStorageData({ schemaVersion: newer.schemaVersion })).toThrow( /newer version of Watch List/, ); diff --git a/src/app/domain/storage-schema.ts b/src/app/domain/storage-schema.ts index 1a00f4c..ae6fc0b 100644 --- a/src/app/domain/storage-schema.ts +++ b/src/app/domain/storage-schema.ts @@ -6,8 +6,6 @@ import { Item } from '../models/item.model'; const PositiveIntegerSchema = z.number().int().positive(); const NonblankStringSchema = z.string().refine((value) => value.trim().length > 0); -// History and creation dates must be real dates. Release metadata deliberately -// retains its older, more permissive YYYY-MM-DD contract below. const DateSchema = z.union([z.iso.date(), z.iso.datetime({ offset: true, local: true })]); const SeasonInfoSchema = z.object({ @@ -78,8 +76,6 @@ const DeletedItemHistorySchema = z.object({ deletedAt: DateSchema, }); -// Migration handles untrusted records, not domain objects. Only parsing each -// record below grants it a domain type. // Keep all own keys: z.record discards __proto__ before recovery can count it. const UntrustedRecordsSchema = z.custom>(isRecord); const StorageEnvelopeSchema = z.object({ @@ -234,8 +230,6 @@ function migrateStorageData(data: StorageEnvelope): StorageEnvelope { if (migrated.schemaVersion < 3) { for (const item of Object.values(migrated.items)) { - // Malformed records (null, primitives) pass through to quarantine, - // which drops them after migration salvages the valid items. if (!isRecord(item)) { continue; } @@ -279,27 +273,20 @@ function migrateStorageData(data: StorageEnvelope): StorageEnvelope { if (!isRecord(item)) { continue; } - // Remote URLs must never survive the offline-image migration. Existing - // posters are deliberately cleared instead of being fetched at startup. delete item['posterPath']; } migrated.schemaVersion = 6; } if (migrated.schemaVersion < 7) { - // Introduce 'paused' status. No auto-migration: existing 'not-started' items - // remain in backlog even if they were previously paused via the lie. migrated.schemaVersion = 7; } if (migrated.schemaVersion < 8) { - // Widen ItemType to include 'ova' and 'ona'. No data migration needed; - // existing 'series'|'movie' values remain valid under the expanded enum. migrated.schemaVersion = 8; } if (migrated.schemaVersion < 9) { - // Introduce required isAdult. Existing items lack the field; default to false (SFW). for (const item of Object.values(migrated.items)) { if (!isRecord(item)) { continue; @@ -312,12 +299,10 @@ function migrateStorageData(data: StorageEnvelope): StorageEnvelope { } if (migrated.schemaVersion < 10) { - // Optional per-season release delay: absent counts mean zero, with no baseline rewrite. migrated.schemaVersion = 10; } if (migrated.schemaVersion < 11) { - // Optional episode-specific availability deferrals; existing records stay valid. migrated.schemaVersion = 11; } diff --git a/src/app/models/readonly.ts b/src/app/models/readonly.ts index 54e960d..3349332 100644 --- a/src/app/models/readonly.ts +++ b/src/app/models/readonly.ts @@ -1,7 +1,5 @@ -/** Read models share settled state; command drafts remain mutable. */ export type DeepReadonly = { readonly [K in keyof T]: DeepReadonly }; -/** Freeze once at publication, rather than cloning on each reactive read. */ export function freezeReadModel(value: T): DeepReadonly { if (value && typeof value === 'object' && !Object.isFrozen(value)) { for (const child of Object.values(value)) freezeReadModel(child); diff --git a/src/app/utils/discussion-link.utils.ts b/src/app/utils/discussion-link.utils.ts index 1a32f11..7751ff0 100644 --- a/src/app/utils/discussion-link.utils.ts +++ b/src/app/utils/discussion-link.utils.ts @@ -13,7 +13,6 @@ export function validateDiscussionTemplate(template: string): string | null { if (!/^https?:\/\//i.test(template)) { return 'Enter an absolute HTTP or HTTPS URL.'; } - // Keep the destination explicit; placeholders belong in the path, query, or fragment. if (/[{}]/.test(template.match(/^https?:\/\/([^/?#]*)/i)?.[1] ?? '')) { return 'Placeholders cannot be used in the URL host.'; } @@ -47,7 +46,6 @@ export function buildDiscussionUrl( (_, name: keyof typeof values) => encodeURIComponent(values[name]), ); } catch { - // Malformed Unicode in an imported title must not prevent rendering history. return null; } } diff --git a/src/app/utils/progress.utils.spec.ts b/src/app/utils/progress.utils.spec.ts index b5f77fe..3895ec2 100644 --- a/src/app/utils/progress.utils.spec.ts +++ b/src/app/utils/progress.utils.spec.ts @@ -64,7 +64,7 @@ describe('calculateProgress', () => { progress: { season: 1, episode: 6, seasons: [{ seasonNumber: 1, totalEpisodes: 10 }] }, }), ), - ).toBe(50); // (6-1)/10 =50% + ).toBe(50); expect( calculateProgress( item({ diff --git a/src/app/utils/search-stream.utils.ts b/src/app/utils/search-stream.utils.ts index 348ac20..bb6d1c1 100644 --- a/src/app/utils/search-stream.utils.ts +++ b/src/app/utils/search-stream.utils.ts @@ -57,7 +57,6 @@ export function createSearchStream( }); } - // Settings can remove the selected provider without a menu interaction. effect(() => { const source = selectedSource(); if (lastRequest && lastRequest.source !== source) untracked(request); @@ -80,7 +79,6 @@ export function createSearchStream( selectedSource.set(source); request(); }, - // Selection updates the displayed query without scheduling another search. dismiss(value = '') { query.set(value); lastRequest = undefined; diff --git a/src/app/utils/sort.utils.spec.ts b/src/app/utils/sort.utils.spec.ts index 9bda0f9..07eb96a 100644 --- a/src/app/utils/sort.utils.spec.ts +++ b/src/app/utils/sort.utils.spec.ts @@ -151,7 +151,6 @@ describe('sort.utils', () => { title: 'B', watchHistory: [{ date: '2026-05-01T00:00:00.000Z' }], }); - // a lastWatched is 2026-06-01 > b 2026-05-01 expect(compareItems(a, b, 'lastWatched', 'asc')).toBeGreaterThan(0); expect(compareItems(b, a, 'lastWatched', 'asc')).toBeLessThan(0); }); @@ -186,7 +185,6 @@ describe('sort.utils', () => { createdAt: '2026-01-01T00:00:00.000Z', watchHistory: [{ date: '2026-02-01T00:00:00.000Z' }], }); - // a lastWatched = 2026-10-01, b = 2026-02-01 expect(compareItems(a, b, 'lastWatched', 'asc')).toBeGreaterThan(0); }); @@ -202,7 +200,6 @@ describe('sort.utils', () => { watchHistory: [{ date: 'not-a-date' }], createdAt: '2026-02-01T00:00:00.000Z', }); - // invalid history treated as -Infinity, so asc: invalid first, desc: valid first expect(compareItems(invalid, valid, 'lastWatched', 'asc')).toBeLessThan(0); expect(compareItems(invalid, valid, 'lastWatched', 'desc')).toBeGreaterThan(0); expect(compareItems(valid, invalid, 'lastWatched', 'asc')).toBeGreaterThan(0); @@ -223,7 +220,6 @@ describe('sort.utils', () => { title: 'B', watchHistory: [{ date: '2026-03-01T00:00:00.000Z' }], }); - // withInvalid most recent is 2026-04-01 > valid 2026-03-01 expect(compareItems(withInvalid, valid, 'lastWatched', 'asc')).toBeGreaterThan(0); }); @@ -354,19 +350,16 @@ describe('sort.utils', () => { title: 'V2', watchHistory: [{ date: '2026-05-01T00:00:00.000Z' }], }); - // ascending: invalid (-Infinity) first, then v1, then v2 expect(sortItems([valid2, invalid, valid1], 'lastWatched', 'asc').map((i) => i.id)).toEqual([ 'inv', 'v1', 'v2', ]); - // descending: v2, v1, invalid last expect(sortItems([invalid, valid1, valid2], 'lastWatched', 'desc').map((i) => i.id)).toEqual([ 'v2', 'v1', 'inv', ]); - // does not produce NaN, stable equality for invalid-only const onlyInvalid = [ item({ id: 'a', title: 'A', watchHistory: [{ date: 'bad' }] }), item({ id: 'b', title: 'B', watchHistory: [{ date: 'also-bad' }] }), diff --git a/src/app/utils/sort.utils.ts b/src/app/utils/sort.utils.ts index b45d9fb..0499539 100644 --- a/src/app/utils/sort.utils.ts +++ b/src/app/utils/sort.utils.ts @@ -76,7 +76,6 @@ function compareByStatus(a: Item, b: Item, direction: SortDirection): number { return direction === 'asc' ? primary : -primary; } - // Tie-breaker: most recently watched first, regardless of direction. const recent = toTimestamp(getMostRecentWatchDate(b)) - toTimestamp(getMostRecentWatchDate(a)); if (recent !== 0 && !Number.isNaN(recent)) { return recent; From ade1353cec48b89bcb20531e1bc2b01e602f414d Mon Sep 17 00:00:00 2001 From: CodeWithMaBot <310216433+CodeWithMaBot@users.noreply.github.com> Date: Thu, 26 Nov 2026 18:05:27 +0100 Subject: [PATCH 2/6] chore: remove comments from services Co-Authored-By: Claude Opus 5.5 --- .../browser-settings-storage.service.ts | 1 - src/app/services/group-item-mutations.spec.ts | 2 -- src/app/services/group.service.spec.ts | 1 - src/app/services/group.service.ts | 2 -- .../services/image-storage.service.spec.ts | 4 --- src/app/services/image-storage.service.ts | 2 -- .../services/import-export.service.spec.ts | 4 --- src/app/services/import-export.service.ts | 9 ------ .../services/indexeddb-write.test-utils.ts | 3 -- src/app/services/item-sort.service.spec.ts | 1 - src/app/services/item-sort.service.ts | 2 +- src/app/services/jikan-suggestion.service.ts | 1 - .../services/poster-context-conflicts.spec.ts | 1 - src/app/services/poster-ownership.spec.ts | 4 --- src/app/services/poster-reader.ts | 1 - src/app/services/provider-settings.service.ts | 2 -- src/app/services/round-robin.service.spec.ts | 13 --------- src/app/services/round-robin.service.ts | 1 - src/app/services/session-recovery.spec.ts | 3 -- src/app/services/storage.service.spec.ts | 5 ---- src/app/services/storage.service.ts | 29 ------------------- .../services/suggestion-search.test-utils.ts | 1 - .../services/watch-list-database.service.ts | 1 - 23 files changed, 1 insertion(+), 92 deletions(-) diff --git a/src/app/services/browser-settings-storage.service.ts b/src/app/services/browser-settings-storage.service.ts index 3d79442..69544ff 100644 --- a/src/app/services/browser-settings-storage.service.ts +++ b/src/app/services/browser-settings-storage.service.ts @@ -1,6 +1,5 @@ import { Injectable, signal } from '@angular/core'; -/** Optional browser settings never gate access to the collection. */ @Injectable({ providedIn: 'root' }) export class BrowserSettingsStorage { private readonly failed = signal(false); diff --git a/src/app/services/group-item-mutations.spec.ts b/src/app/services/group-item-mutations.spec.ts index 02d918c..1148152 100644 --- a/src/app/services/group-item-mutations.spec.ts +++ b/src/app/services/group-item-mutations.spec.ts @@ -17,8 +17,6 @@ describe('Group and item mutation coexistence', () => { async (groupAction) => { const { storage, groups, items, target } = await setup(); - // Start the real item command after the group put succeeds but before its - // transaction completes. No application methods or queue internals are mocked. let itemWrite: ReturnType | undefined; const saveItem = () => runItemCommand(items, itemAction, target); const put = IDBObjectStore.prototype.put; diff --git a/src/app/services/group.service.spec.ts b/src/app/services/group.service.spec.ts index 0822e93..7c1c46f 100644 --- a/src/app/services/group.service.spec.ts +++ b/src/app/services/group.service.spec.ts @@ -233,7 +233,6 @@ describe('GroupService', () => { return service.reorderGroups(['films', DEFAULT_GROUP_ID]); } })(); - // These commands are invoked before the first transaction settles. const second = firstKind === 'create' ? service.createGroup('Second') diff --git a/src/app/services/group.service.ts b/src/app/services/group.service.ts index 3fbf682..087adc9 100644 --- a/src/app/services/group.service.ts +++ b/src/app/services/group.service.ts @@ -43,7 +43,6 @@ export class GroupService { throw new Error('Cannot delete the ungrouped group'); } delete data.groups[groupId]; - // Group removal and item reassignment commit together. Object.values(data.items).forEach((item) => { if (item.groupId === groupId) item.groupId = DEFAULT_GROUP_ID; }); @@ -65,7 +64,6 @@ export class GroupService { } }); - // Keep any groups not in the reorder list Object.values(data.groups).forEach((group) => { if (!groups.has(group.id)) { groups.set(group.id, group); diff --git a/src/app/services/image-storage.service.spec.ts b/src/app/services/image-storage.service.spec.ts index 8df874b..733a34f 100644 --- a/src/app/services/image-storage.service.spec.ts +++ b/src/app/services/image-storage.service.spec.ts @@ -305,7 +305,6 @@ describe('ImageStorageService', () => { const storage = TestBed.inject(StorageService); await storage.importDataWithImages(storage.getData(), [ { id, blob: createImageBlob() }, - // A damaged unrelated blob must never be read by a selected export. { id: 'unrelated', blob: null as unknown as Blob }, ]); @@ -537,7 +536,6 @@ describe('ImageStorageService', () => { const [v1, v2] = await Promise.all([p1, p2]); expect(v1).toBe('blob:mock-url'); expect(v2).toBe('blob:mock-url'); - // second call still cached returns same resolved value await expect(service.getUrl(id)).resolves.toBe('blob:mock-url'); }); @@ -628,7 +626,6 @@ describe('ImageStorageService', () => { await service.getUrl(id); const before = imageVersion(); service.invalidateAll(); - // revoke is async (void), wait a tick await new Promise((r) => setTimeout(r, 0)); expect(imageVersion()).toBeGreaterThan(before); expect(URL.revokeObjectURL).toHaveBeenCalled(); @@ -639,7 +636,6 @@ describe('ImageStorageService', () => { const blob = createImageBlob('abc', 'image/png'); const id = await service.storeFile(blob); const urlPromise = service.getUrl(id); - // Make URL.createObjectURL throw? Actually revoke path catches errors URL.revokeObjectURL = vi.fn(() => { throw new Error('revoke fail'); }) as unknown as typeof URL.revokeObjectURL; diff --git a/src/app/services/image-storage.service.ts b/src/app/services/image-storage.service.ts index b444d9b..85e6362 100644 --- a/src/app/services/image-storage.service.ts +++ b/src/app/services/image-storage.service.ts @@ -39,7 +39,6 @@ export class ImageStorageService { imagesInvalidated.subscribe((id) => this.refreshCache(id)); } - /** Prepare a UI draft; only a collection command can persist it with an item reference. */ async storeFile(file: Blob): Promise { await this.ensureWritable(); await this.validateImage(file); @@ -61,7 +60,6 @@ export class ImageStorageService { return this.storeFile(await response.blob()); } - /** Releasing a UI draft never deletes persistent images or committed ownership. */ discardDraft(id: string): void { if (this.storageService.discardProvisionalImage(id)) { this.setPosterMissing(id, false); diff --git a/src/app/services/import-export.service.spec.ts b/src/app/services/import-export.service.spec.ts index a934266..a1cbc7f 100644 --- a/src/app/services/import-export.service.spec.ts +++ b/src/app/services/import-export.service.spec.ts @@ -69,7 +69,6 @@ describe('import version compatibility', () => { } : { data: newer, - // Newer image formats must not hide the version explanation behind an image error. images: format === 'portable' ? [] : { futureFormat: true }, preferences: { providerSettings: { tmdb: true } }, }; @@ -92,7 +91,6 @@ describe('import version compatibility', () => { request.onsuccess = () => resolve(request.result); }); expect(images).toEqual([image]); - // Rejection must not lock an otherwise compatible collection. await expect(storage.replaceData(original)).resolves.toMatchObject({ durability: 'persistent', }); @@ -241,7 +239,6 @@ describe('ImportExportService', () => { it('always includes non-sensitive preferences and never leaks tokens', async () => { storageService.getData.mockReturnValue({ items: [] }); - // Simulate tokens in localStorage – service must not read them const store: Record = {}; const mockStorage = { getItem: (k: string) => store[k] ?? null, @@ -604,7 +601,6 @@ describe('ImportExportService', () => { includeAdult: false, }), ); - // importSettings should only receive providerSettings, never the injected token keys const calledWith = providerSettings.importSettings.mock.calls[0][0] as Record< string, unknown diff --git a/src/app/services/import-export.service.ts b/src/app/services/import-export.service.ts index 67ae629..3c583de 100644 --- a/src/app/services/import-export.service.ts +++ b/src/app/services/import-export.service.ts @@ -50,8 +50,6 @@ export class ImportExportService { private discussionSettings = inject(DiscussionSettingsService); async exportData(): Promise { - // Export the collection visible when the action starts, not later edits made - // while poster reads/encoding are pending. Only its referenced posters belong here. const data = this.storageService.getData(); const posterIds = new Set( Object.values(data.items).flatMap((item) => (item.posterId ? [item.posterId] : [])), @@ -75,8 +73,6 @@ export class ImportExportService { discussionSettings: this.discussionSettings.exportSettings(), }, }; - // TMDB credentials are never read or exported here. User-configured discussion - // URL templates are intentionally portable, alongside the provider preferences. this.downloadJson(payload, 'watch-list-export'); return posters; } @@ -110,12 +106,10 @@ export class ImportExportService { } async importData(file: File): Promise { - // Confirmation belongs to the currently reviewed context, before async file preparation. const context = this.storageService.captureImportContext(); try { const text = await file.text(); const payload: unknown = JSON.parse(text); - // Unknown fields on a newer raw document may resemble today's export wrapper. assertSupportedStorageVersion(payload); const data = isPortableExport(payload) ? payload.data : payload; assertSupportedStorageVersion(data); @@ -158,7 +152,6 @@ export class ImportExportService { if (!isPortableExport(payload) || !hasPreferences(payload)) { return; } - // Never import sensitive keys; ProviderSettingsService normalizes and ignores unknown fields. try { this.providerSettings.importSettings(payload.preferences.providerSettings); } catch { @@ -189,14 +182,12 @@ function readPosterCoverage(payload: unknown): PosterCoverage | undefined { function assertLosslessJson(value: unknown, seen = new WeakSet()): void { if (value === null || typeof value === 'string' || typeof value === 'boolean') return; if (typeof value === 'number' && Number.isFinite(value) && !Object.is(value, -0)) return; - // Repeated references also lose their identity in JSON, even without a cycle. if (typeof value !== 'object' || seen.has(value)) { throw new UnsupportedRecoveryFormatError(); } seen.add(value); const keys = Object.keys(value); if (Array.isArray(value)) { - // JSON drops extra array properties and turns holes into null. if (keys.length !== value.length || keys.some((key, index) => key !== String(index))) { throw new UnsupportedRecoveryFormatError(); } diff --git a/src/app/services/indexeddb-write.test-utils.ts b/src/app/services/indexeddb-write.test-utils.ts index b66df13..fabfdfa 100644 --- a/src/app/services/indexeddb-write.test-utils.ts +++ b/src/app/services/indexeddb-write.test-utils.ts @@ -1,7 +1,6 @@ import { IDBObjectStore } from 'fake-indexeddb'; import { vi } from 'vitest'; -/** Observe request success or abort selected collection writes before transaction completion. */ export function controlStorageWrites( outcomes: boolean[] = [], onRequestSuccess?: (index: number, store: IDBObjectStore) => void, @@ -25,7 +24,6 @@ export function controlStorageWrites( }); } -/** Keep a real transaction pending until release, without mocking application persistence. */ export function holdStorageWrite(index: number, onRequestSuccess?: (index: number) => void) { let released = false; let transaction: IDBTransaction | undefined; @@ -58,7 +56,6 @@ export function holdStorageWrite(index: number, onRequestSuccess?: (index: numbe }; } -/** Hold ownership cleanup after its delete request succeeds but before it commits. */ export function holdPosterCleanup() { let released = false; let signalStarted = () => undefined as void; diff --git a/src/app/services/item-sort.service.spec.ts b/src/app/services/item-sort.service.spec.ts index 4257c75..d0202d1 100644 --- a/src/app/services/item-sort.service.spec.ts +++ b/src/app/services/item-sort.service.spec.ts @@ -134,7 +134,6 @@ describe('ItemSortService', () => { try { service.setField('title'); service.setDirection('asc'); - // in-memory should still update expect(service.field()).toBe('title'); expect(service.direction()).toBe('asc'); } finally { diff --git a/src/app/services/item-sort.service.ts b/src/app/services/item-sort.service.ts index 7ed9a03..70da7d3 100644 --- a/src/app/services/item-sort.service.ts +++ b/src/app/services/item-sort.service.ts @@ -40,7 +40,7 @@ export class ItemSortService { return raw; } } catch { - // ignore read errors, fallback to default + // ignore read errors } return DEFAULT_SORT_FIELD; } diff --git a/src/app/services/jikan-suggestion.service.ts b/src/app/services/jikan-suggestion.service.ts index 2cf6cb0..f31c71a 100644 --- a/src/app/services/jikan-suggestion.service.ts +++ b/src/app/services/jikan-suggestion.service.ts @@ -142,7 +142,6 @@ export class JikanSuggestionService { const firstEpisodeAirDate = this.extractDate(candidate.aired); - // Only return a season entry if we have at least episode count or air date if (totalEpisodes === undefined && !firstEpisodeAirDate) { return null; } diff --git a/src/app/services/poster-context-conflicts.spec.ts b/src/app/services/poster-context-conflicts.spec.ts index 02304cb..0984edd 100644 --- a/src/app/services/poster-context-conflicts.spec.ts +++ b/src/app/services/poster-context-conflicts.spec.ts @@ -142,7 +142,6 @@ describe('Poster persistence context conflicts', () => { }); expect(reloaded.storage.getGroups()[0].name).toBe('Concurrent edit'); expect(await reloaded.images.getUrl(posterId)).toBe('blob:poster'); - // A reload adopts the poster revision too, so its next edit must succeed. await reloaded.storage.mutate((draft) => { draft.items[reloaded.storage.getItems()[0].id].title = 'Edited after reload'; }); diff --git a/src/app/services/poster-ownership.spec.ts b/src/app/services/poster-ownership.spec.ts index 4381288..b6e1379 100644 --- a/src/app/services/poster-ownership.spec.ts +++ b/src/app/services/poster-ownership.spec.ts @@ -62,7 +62,6 @@ describe('Committed poster ownership', () => { expect(reloaded.getData()).toEqual(previous); expect(storage.getData()).toEqual(previous); expect(await freshImages.getUrl(oldPoster)).toBe('blob:poster'); - // Resolve through a separate storage context: a pending draft is not a persisted image. expect(await persistentImages().getUrl(posterId)).toBeNull(); expect(await images.getUrl(posterId)).toBe('blob:poster'); await save(); @@ -140,7 +139,6 @@ describe('Committed poster ownership', () => { const posterId = await images.storeFile(new Blob(['poster'], { type: 'image/png' })); const { value: first } = await watch.addItem({ ...movie, posterId }); const { value: second } = await watch.addItem({ ...movie, title: 'Second', posterId }); - // Portable imports may legitimately give multiple items the same poster identity. const data = storage.getData(); await storage.importDataWithImages(data, [{ id: posterId, blob: image() }]); expect(await images.getUrl(posterId)).toBe('blob:poster'); @@ -223,7 +221,6 @@ describe('Committed poster ownership', () => { await peer.initialize(); let peerRefresh = Promise.resolve(); controlStorageWrites([], (index) => { - // Queue the peer's read behind the new owner's write, ahead of cleanup. if (index === 1) peerRefresh = peer.refresh(); }); const removal = watch.deleteItem(first.id); @@ -318,7 +315,6 @@ async function setup() { } function persistentImages() { - // Independent services avoid a provisional-image map or an object-URL cache masking disk state. const storage = TestBed.runInInjectionContext(() => new StorageService()); return TestBed.runInInjectionContext(() => { const injector = TestBed.inject(Injector); diff --git a/src/app/services/poster-reader.ts b/src/app/services/poster-reader.ts index d68ee44..a85f141 100644 --- a/src/app/services/poster-reader.ts +++ b/src/app/services/poster-reader.ts @@ -1,7 +1,6 @@ import { effect, inject, signal, untracked } from '@angular/core'; import { ImageStorageService } from './image-storage.service'; -/** Read a cached poster for this injection lifetime, retaining it while a replacement loads. */ export function injectPosterUrl(posterId: () => string | undefined) { const images = inject(ImageStorageService); const url = signal(null); diff --git a/src/app/services/provider-settings.service.ts b/src/app/services/provider-settings.service.ts index eb323b7..ee67de7 100644 --- a/src/app/services/provider-settings.service.ts +++ b/src/app/services/provider-settings.service.ts @@ -163,8 +163,6 @@ export class ProviderSettingsService { return DEFAULT_ADULT_DISPLAY_MODE; } - // Strict reset: any invalid entry (wrong length, duplicate, unknown lang) falls back to default. - // Alternative lenient dedup/filter was considered but we prefer explicit reset to avoid drift. private normalizeTitlePreference(value: unknown): TitlePreference { if (!Array.isArray(value) || value.length !== 3) { return [...DEFAULT_TITLE_PREFERENCE]; diff --git a/src/app/services/round-robin.service.spec.ts b/src/app/services/round-robin.service.spec.ts index 7d77b0c..ef925e6 100644 --- a/src/app/services/round-robin.service.spec.ts +++ b/src/app/services/round-robin.service.spec.ts @@ -104,15 +104,10 @@ describe('RoundRobinService', () => { watchHistory: [{ date: '2026-04-01T00:00:00.000Z' }], }), ]); - // b has older last watched, should be suggested first expect(service.nextSeries()?.id).toBe('b'); }); it('implements round-robin when all others have been watched', async () => { - // Two series, 'a' oldest but 'b' has no watch history, so canSuggest for 'b' is false, for 'a' is true? Let's craft - // canSuggest checks if all otherSeries have watchHistory length >0 - // If b has empty history, then for target a, other=b has empty => allOthersWatched false => canSuggest false for a - // For target b, other=a has history => true => canSuggest true for b => b should be returned await saveItems([ createSeries({ id: 'a', @@ -129,15 +124,10 @@ describe('RoundRobinService', () => { firstEpisodeAirDate: '2020-01-01', }), ]); - // sorted by last watched: b (no history => uses createdAt? actually getMostRecentWatchDate falls back to createdAt) - // For b, lastWatched is createdAt 2026-01-02, for a it's 2026-04-01, so b is older => watchable sorted [b,a] - // Loop: canSuggest(b) -> other=a has history => true => return b expect(service.nextSeries()?.id).toBe('b'); }); it('falls back to first watchable when no series can be suggested', async () => { - // Both have empty history, so for each, allOthersWatched is false (other has empty) - // No canSuggest true, should return watchable[0] (oldest) await saveItems([ createSeries({ id: 'a', @@ -156,7 +146,6 @@ describe('RoundRobinService', () => { ]); const result = service.nextSeries(); expect(result).not.toBeNull(); - // watchable sorted [a,b] because both have same fallback? a older expect(result?.id).toBe('a'); }); @@ -255,7 +244,6 @@ describe('RoundRobinService', () => { episode: 2, firstEpisodeAirDate: '2026-05-01', }); - // Change progress to season 2 but seasons only has season 1 (missingSeason as Item).progress = { season: 2, episode: 1, @@ -299,7 +287,6 @@ describe('RoundRobinService', () => { createdAt: '2026-01-01T00:00:00.000Z', firstEpisodeAirDate: '2026-00-01', }); - // year 2026 ok, month 0 -> falsy? 0 is falsy, so returns null expect(service.hasAiredCurrentEpisode(badMonth)).toBe(true); }); diff --git a/src/app/services/round-robin.service.ts b/src/app/services/round-robin.service.ts index edbf738..8c0a1a4 100644 --- a/src/app/services/round-robin.service.ts +++ b/src/app/services/round-robin.service.ts @@ -40,7 +40,6 @@ export class RoundRobinService { if (this.document.visibilityState === 'visible') refresh(); }; refresh(); - // Re-arm the timer when a deferral is saved, cleared, or loaded. effect(refresh); window.addEventListener('focus', refresh); this.document.addEventListener('visibilitychange', onVisibilityChange); diff --git a/src/app/services/session-recovery.spec.ts b/src/app/services/session-recovery.spec.ts index 93427f9..ffbe805 100644 --- a/src/app/services/session-recovery.spec.ts +++ b/src/app/services/session-recovery.spec.ts @@ -99,7 +99,6 @@ describe('session metadata recovery', () => { ).toBeNull(); expect(storage.getInMemorySessionSignal()()).toBe(true); - // Reconnecting a poster reader must never reload older disk data over session edits. openFailure.mockRestore(); expect(await TestBed.inject(ImageStorageService).exportImages()).toEqual([]); await storage.initialize(); @@ -109,7 +108,6 @@ describe('session metadata recovery', () => { const reloaded = TestBed.runInInjectionContext(() => new StorageService()); await reloaded.initialize(); expect(reloaded.getData().groups['ungrouped'].name).toBe('Older disk collection'); - // Explicit recovery into a persistent context is deliberate and can then survive reload. await reloaded.importDataWithImages(JSON.parse(text).data, []); const recovered = TestBed.runInInjectionContext(() => new StorageService()); await recovered.initialize(); @@ -229,7 +227,6 @@ describe('session metadata recovery', () => { vi.spyOn(IDBObjectStore.prototype, 'clear').mockImplementation(function ( this: IDBObjectStore, ) { - // A real failing image-store request: adding the already-present key raises ConstraintError. return this.add({ id: 'old-poster' }) as unknown as IDBRequest; }); const file = new File([], 'metadata-only.json'); diff --git a/src/app/services/storage.service.spec.ts b/src/app/services/storage.service.spec.ts index ccf2a02..82ec88e 100644 --- a/src/app/services/storage.service.spec.ts +++ b/src/app/services/storage.service.spec.ts @@ -493,8 +493,6 @@ describe('StorageService', () => { }, }; await writeRecord(database, raw); - // Even an unavailable corruption-backup/write path must not turn compatibility into - // the generic in-memory fallback. This also detects any normalization write. const put = vi.spyOn(FakeIDBObjectStore.prototype, 'put').mockImplementation(() => { throw new Error('Writes unavailable'); }); @@ -618,7 +616,6 @@ describe('StorageService', () => { await service.initialize(); const database = await openTestDatabase(); const raw = { schemaVersion: CURRENT_SCHEMA_VERSION + 1, futureRecords: ['keep'] }; - // A separate preflight read would let the upgrade commit before the stale save. const upgrade = upgradeAfterNextRead(database, raw); await service.replaceData(withGroup(service.getData(), 'edited')); @@ -1335,7 +1332,6 @@ describe('StorageService', () => { 'keeps publication ordered across startup when saves settle (%s, %s)', async (firstSucceeds, secondSucceeds) => { const service = createStorageService(); - // Replacements reserve their place before startup, publishing only once settled. const first = service.replaceData(withGroup(createDefaultStorageData(), 'first')); await service.initialize(); abortStorageWrites([firstSucceeds, secondSucceeds]); @@ -1646,7 +1642,6 @@ function upgradeAfterNextRead(database: IDBDatabase, raw: unknown) { if (this.name === 'storage' && key === 'watch-list-data') { request.addEventListener('success', () => { spy.mockRestore(); - // Queue another tab's write before the reader can queue a replacement. void writeRecord(database, raw).then(resolve, reject); }); } diff --git a/src/app/services/storage.service.ts b/src/app/services/storage.service.ts index 9943a0a..186f5a9 100644 --- a/src/app/services/storage.service.ts +++ b/src/app/services/storage.service.ts @@ -19,7 +19,6 @@ import { } from './watch-list-database.service'; const DATA_KEY = 'watch-list-data'; -// Local concurrency metadata stays out of portable documents and schema migration. const REVISION_KEY = 'watch-list-revision'; const BACKUP_PREFIX = 'watch-list-data-backup-'; const BACKUP_LIMIT = 10; @@ -76,7 +75,6 @@ export class StorageService { if (!this.initialization) { this.loading.set(true); this.initializationError.set(null); - // Poster reads can recover independently, so preserve edits even after their error clears. const preserveSession = this.inMemorySession() && this.data() && @@ -118,19 +116,12 @@ export class StorageService { return this.getData(); } - /** Explicit validated collection replacement for import/recovery, retaining owned posters. */ async replaceData(data: StorageData) { return this.enqueueMutation(() => undefined, { replacement: validateSaveData(data), }); } - /** - * Commands and explicit replacements share invocation order in this service instance. - * An intent edits a detached draft of the latest successful state after earlier writes settle. - * Keep the callback synchronous and side-effect free. Rejection discards its entire draft; - * success publishes only after transaction completion (or explicitly as session-only). - */ async mutate(intent: (draft: StorageData) => T): Promise> { return this.enqueueMutation(intent); } @@ -149,10 +140,6 @@ export class StorageService { return this.provisionalImages.delete(id); } - /** Capture the blob at command invocation: form destruction can only release its draft, - * never the command's copy. The image and its first committed reference share a transaction. - * A rejected command leaves a mounted form's draft available for explicit retry. - */ mutateWithPoster(intent: (draft: StorageData) => T, posterId?: string) { return this.enqueueMutation(intent, { posterId, @@ -232,8 +219,6 @@ export class StorageService { (error: unknown) => this.reportSaveFailure(error), ); const result = await mutation; - // Publication and the collection queue settle at commit. Await cleanup outside that - // queue entry: commands already queued must be able to run before ownership is rechecked. if (removedPosters.length && this.persistentStorage) { try { await this.cleanupPosters(removedPosters); @@ -244,7 +229,6 @@ export class StorageService { return result; } - /** Bind asynchronous file preparation to the context in which import was confirmed. */ captureImportContext() { this.assertMutationReady(); return this.importContext; @@ -280,8 +264,6 @@ export class StorageService { const cleanup = this.writeQueue.then(async () => { if (this.conflict()) throw new CollectionConflictError(); this.assertWritable(); - // The local queue holds ownership stable until cleanup settles. Avoid an empty - // write (and revision bump) when later commands have reclaimed every candidate. const owned = new Set( Object.values(this.settledData?.items ?? {}).map((item) => item.posterId), ); @@ -320,7 +302,6 @@ export class StorageService { return this.refreshing.asReadonly(); } - /** Refresh committed state in place: mounted forms keep ownership of their drafts. */ refresh(): Promise { if (this.refreshing()) return Promise.reject(new Error('The collection is already refreshing.')); @@ -419,8 +400,6 @@ export class StorageService { } private reportSaveFailure(error: unknown, message = 'Failed to save watch-list data:') { - // A rejected command needs refresh/retry feedback. Best-effort cleanup uses the - // same revision protection, but must not present its committed command as unsaved. if (error instanceof CollectionConflictError && this.settledData) this.conflict.set(true); this.saveError.set( this.compatibilityError() ? null : error instanceof Error ? error.message : String(error), @@ -496,8 +475,6 @@ export class StorageService { this.publishLoadedData(defaults); } catch (error) { if (this.compatibilityError()) return; - // Another initializer may have won the first revision or normalization write. - // Read its committed state rather than publishing defaults or a stale snapshot. if (error instanceof CollectionConflictError) return this.loadData(allowSessionFallback); if (!allowSessionFallback) throw error; if (this.databaseError()) throw error; @@ -636,8 +613,6 @@ export class StorageService { ); return false; } catch (error) { - // Only a poster-store acquisition/cleanup failure permits metadata-only recovery. - // Metadata failures, conflicts, and image-containing imports must still reject. if (images.length || !(error instanceof PosterStorageError)) throw error; await this.writeData(data); return true; @@ -690,8 +665,6 @@ export class StorageService { try { transaction = database.transaction(stores, 'readwrite'); } catch (error) { - // No transaction or write has started. A metadata-only import can retry - // without posters, with the normal revision and compatibility checks. throw stores.includes(IMAGE_STORE_NAME) ? new PosterStorageError(error) : error; } const nextRevision = crypto.randomUUID(); @@ -706,8 +679,6 @@ export class StorageService { }; transaction.onerror = () => reject(failure ?? transaction.error ?? new Error(message)); transaction.onabort = () => reject(failure ?? transaction.error ?? new Error(message)); - // Reading and writing in one transaction prevents another tab from upgrading - // the document between the compatibility check and any collection/poster changes. const request = transaction.objectStore(STORE_NAME).get(DATA_KEY) as IDBRequest; const revision = transaction.objectStore(STORE_NAME).get(REVISION_KEY) as IDBRequest; revision.onsuccess = () => { diff --git a/src/app/services/suggestion-search.test-utils.ts b/src/app/services/suggestion-search.test-utils.ts index f9a8894..b58bad8 100644 --- a/src/app/services/suggestion-search.test-utils.ts +++ b/src/app/services/suggestion-search.test-utils.ts @@ -5,7 +5,6 @@ import { AnilistSuggestionService } from './anilist-suggestion.service'; import { JikanSuggestionService } from './jikan-suggestion.service'; import { TmdbSuggestionService } from './tmdb-suggestion.service'; -// Control external provider responses while exercising the real search lifecycle. export function createSuggestionProviders() { const search = vi.fn<(query: string, source: SuggestionSource) => Observable>(() => of([]), diff --git a/src/app/services/watch-list-database.service.ts b/src/app/services/watch-list-database.service.ts index 6f703ad..dad2b3a 100644 --- a/src/app/services/watch-list-database.service.ts +++ b/src/app/services/watch-list-database.service.ts @@ -1,7 +1,6 @@ import { Injectable, signal } from '@angular/core'; const DATABASE_NAME = 'watch-list'; -// Version 2 could be created by poster reads with only the images store. const DATABASE_VERSION = 3; const OPEN_TIMEOUT_MS = 5_000; export const STORAGE_STORE_NAME = 'storage'; From 8d4e5a1103c6cd9d85ca9ae2766faf18f4c280ff Mon Sep 17 00:00:00 2001 From: CodeWithMaBot <310216433+CodeWithMaBot@users.noreply.github.com> Date: Thu, 26 Nov 2026 18:05:37 +0100 Subject: [PATCH 3/6] chore: remove comments from components, e2e, electron, and config The inline theme script lost a comment, so its CSP sha256 is recomputed in both index.html and nginx.conf. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/bun-audit.yml | 2 +- .github/workflows/ci.yml | 1 - .github/workflows/dependabot-automerge.yml | 1 - bunfig.toml | 1 - containers/nginx.conf | 11 +---------- e2e/journey.e2e.ts | 5 ----- e2e/serve.mjs | 2 -- electron/preload.ts | 2 -- playwright.config.ts | 3 --- scripts/build.mjs | 1 - .../conflict-recovery/conflict-recovery.component.ts | 1 - src/app/components/home/home.component.spec.ts | 4 ---- src/app/components/home/home.component.ts | 2 -- src/app/components/item-card/item-card.component.ts | 3 --- .../components/item-detail/item-detail.component.ts | 1 - src/app/components/item-form-interactions.spec.ts | 1 - .../components/item-list/item-list.component.spec.ts | 3 --- src/app/components/item-mutation-feedback.ts | 1 - src/app/components/mutation-feedback.ts | 2 -- src/app/components/poster-drafts.spec.ts | 1 - .../poster-picker/poster-picker.component.spec.ts | 4 ---- .../components/settings/settings.component.spec.ts | 4 ---- src/app/components/settings/settings.component.ts | 2 -- src/index.html | 6 ++---- 24 files changed, 4 insertions(+), 60 deletions(-) diff --git a/.github/workflows/bun-audit.yml b/.github/workflows/bun-audit.yml index 468f7ee..6f709ea 100644 --- a/.github/workflows/bun-audit.yml +++ b/.github/workflows/bun-audit.yml @@ -2,7 +2,7 @@ name: Dependency Audit on: schedule: - - cron: '0 0 * * 0' # Weekly Sunday 00:00 UTC + - cron: '0 0 * * 0' workflow_dispatch: jobs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 158ef53..b16a4e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,6 @@ jobs: - run: bun install --frozen-lockfile - uses: j178/prek-action@v3.1.0 with: - # Branch protection applies to local commits, not CI checkouts. extra-args: --all-files --skip no-commit-to-branch - run: bunx tsc --noEmit -p electron/tsconfig.json diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index fea6bd4..7c98a4d 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -23,7 +23,6 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} - # Auto-merge waits for the required status checks enforced by the dev branch rules. - name: Enable automerge for patch and minor updates if: >- steps.metadata.outputs.package-ecosystem == 'bun' && diff --git a/bunfig.toml b/bunfig.toml index 2e87a1e..55af992 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -1,3 +1,2 @@ [install] -# Only resolve new package versions published at least 3 days ago (versions already pinned in bun.lock are unaffected) minimumReleaseAge = 259200 diff --git a/containers/nginx.conf b/containers/nginx.conf index 52bcd97..03963ea 100644 --- a/containers/nginx.conf +++ b/containers/nginx.conf @@ -1,18 +1,9 @@ -# Production server for the container image (copied to -# /etc/nginx/conf.d/default.conf in the Containerfile). -# # The Content-Security-Policy here must stay in sync with the fallback # in src/index.html (GitHub Pages cannot send custom HTTP headers, so the meta # tag is its only enforcement). If the inline theme script in index.html # changes, recompute its sha256 and update script-src in both places. # The one intended difference: frame-ancestors exists only here, because # browsers ignore it in a tag and log an error on every page load. -# -# Policy notes: -# - img-src allows blob:/data:/https: (IndexedDB posters via object URLs, -# inline SVG placeholder, TMDB/MyAnimeList/AniList CDN posters). -# - connect-src enumerates the API + image origins the app fetches from -# (poster save uses fetch() on image CDN URLs, so those need connect-src). # - style-src 'unsafe-inline' is required: Angular injects component styles # at runtime. No external stylesheets are used. server { @@ -22,7 +13,7 @@ server { root /usr/share/nginx/html; index index.html; - add_header Content-Security-Policy "default-src 'self'; base-uri 'self'; form-action 'self'; object-src 'none'; frame-ancestors 'none'; script-src 'self' 'sha256-Hq3FIAQiTPolQXnEfi9wb+iJcaXWvqDZulbwr3WX+IE='; style-src 'self' 'unsafe-inline'; img-src 'self' blob: data: https:; connect-src 'self' https://api.themoviedb.org https://api.jikan.moe https://graphql.anilist.co https://image.tmdb.org https://cdn.myanimelist.net https://s4.anilist.co; font-src 'self' data:; manifest-src 'self'; worker-src 'self'" always; + add_header Content-Security-Policy "default-src 'self'; base-uri 'self'; form-action 'self'; object-src 'none'; frame-ancestors 'none'; script-src 'self' 'sha256-toZFmdk2CkvU3nyUgzTVJAy/6YfDgBH8RrDVwKZXNAo='; style-src 'self' 'unsafe-inline'; img-src 'self' blob: data: https:; connect-src 'self' https://api.themoviedb.org https://api.jikan.moe https://graphql.anilist.co https://image.tmdb.org https://cdn.myanimelist.net https://s4.anilist.co; font-src 'self' data:; manifest-src 'self'; worker-src 'self'" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "DENY" always; add_header Referrer-Policy "no-referrer" always; diff --git a/e2e/journey.e2e.ts b/e2e/journey.e2e.ts index d4031fd..ed5c241 100644 --- a/e2e/journey.e2e.ts +++ b/e2e/journey.e2e.ts @@ -1,9 +1,5 @@ import { expect, test } from '@playwright/test'; -// The one browser test. Component and service behaviour is covered by the -// Vitest specs; this proves what they cannot: the production bundle boots under -// its Content-Security-Policy, real clicks reach the controls, and the -// collection persists in the browser's own IndexedDB. test('add a series, watch an episode, and delete the series', async ({ page }) => { const title = 'Browser Journey Series'; const problems: string[] = []; @@ -48,7 +44,6 @@ test('add a series, watch an episode, and delete the series', async ({ page }) = await expect(page).toHaveURL(/\/items$/); await expect(page.getByText('No items found')).toBeVisible(); await nav.getByRole('link', { name: 'History' }).click(); - // History outlives its item by design. await expect(page.getByText(`${title} (deleted)`)).toBeVisible(); expect(problems).toEqual([]); diff --git a/e2e/serve.mjs b/e2e/serve.mjs index de1f76d..32cc3b1 100644 --- a/e2e/serve.mjs +++ b/e2e/serve.mjs @@ -1,5 +1,3 @@ -// Serves the production build for the browser tests, with the same SPA -// fallback as containers/nginx.conf. import { join, normalize } from 'node:path'; const root = join(import.meta.dirname, '../dist/watch-list/browser'); diff --git a/electron/preload.ts b/electron/preload.ts index 083d3fa..e92264a 100644 --- a/electron/preload.ts +++ b/electron/preload.ts @@ -1,7 +1,5 @@ import { contextBridge } from 'electron'; -// Expose a minimal, secure API surface. Extend here when IPC is needed. -// Keeping contextIsolation + sandbox enabled (see main.ts). contextBridge.exposeInMainWorld('electronAPI', { platform: process.platform, }); diff --git a/playwright.config.ts b/playwright.config.ts index bdfc82c..f7c6a84 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,8 +1,5 @@ import { defineConfig, devices } from '@playwright/test'; -// Set E2E_BASE_URL to test an already running deployment (CI points it at the -// nginx container, the only place the real security headers exist). Without it -// the production build is created and served locally. const externalBaseUrl = process.env['E2E_BASE_URL']; const localPort = 4300; // Playwright's downloaded Chromium cannot start on every OS (NixOS, for one). diff --git a/scripts/build.mjs b/scripts/build.mjs index 6ef2ca3..609ea64 100755 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -31,7 +31,6 @@ const version = getVersion(); const hash = getHash(); const buildDate = getBuildDate(); -// All args after script name are forwarded to ng build (e.g. --configuration=..., --base-href ...) const extraArgs = process.argv.slice(2); const defines = [ diff --git a/src/app/components/conflict-recovery/conflict-recovery.component.ts b/src/app/components/conflict-recovery/conflict-recovery.component.ts index 78e80c5..46c6ffd 100644 --- a/src/app/components/conflict-recovery/conflict-recovery.component.ts +++ b/src/app/components/conflict-recovery/conflict-recovery.component.ts @@ -1,7 +1,6 @@ import { Component, inject, input, output, signal } from '@angular/core'; import { StorageService } from '../../services/storage.service'; -/** Refresh shared collection state without navigating away from recoverable drafts. */ @Component({ selector: 'app-conflict-recovery', template: ` diff --git a/src/app/components/home/home.component.spec.ts b/src/app/components/home/home.component.spec.ts index de0e0c8..60667e7 100644 --- a/src/app/components/home/home.component.spec.ts +++ b/src/app/components/home/home.component.spec.ts @@ -270,14 +270,12 @@ describe('HomeComponent', () => { }); it('shows empty states for nextSeries/nextMovie', async () => { - // No series in list setup({ watchItems: [], inProgressSeries: [], nextSeries: null, nextMovie: null }); let fixture = TestBed.createComponent(HomeComponent); fixture.detectChanges(); await fixture.whenStable(); expect(fixture.nativeElement.textContent).toContain('No series in your watch list'); - // Has series but none in progress const seriesNotStarted = createItem({ id: 's1', title: 'S', @@ -296,7 +294,6 @@ describe('HomeComponent', () => { await fixture.whenStable(); expect(fixture.nativeElement.textContent).toContain('No series currently being watched'); - // Has in-progress but not watchable (all future) const inProg = createItem({ id: 's2', title: 'S2', @@ -310,7 +307,6 @@ describe('HomeComponent', () => { await fixture.whenStable(); expect(fixture.nativeElement.textContent).toContain('No aired series episodes available'); - // Movies setup({ watchItems: [], inProgressSeries: [], nextSeries: null, nextMovie: null }); fixture = TestBed.createComponent(HomeComponent); fixture.detectChanges(); diff --git a/src/app/components/home/home.component.ts b/src/app/components/home/home.component.ts index 1fd4c50..f879b24 100644 --- a/src/app/components/home/home.component.ts +++ b/src/app/components/home/home.component.ts @@ -55,7 +55,6 @@ import { DiscussionLinkComponent } from '../discussion-link/discussion-link.comp @if (nextSeries()) {
-