diff options
| author | Claude <noreply@anthropic.com> | 2026-02-18 22:56:56 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-02-18 22:56:56 +0000 |
| commit | 0876a683cdc344b200dbd65aa137969a1528c85d (patch) | |
| tree | 6a8eb1314cc203f4e070c98422a9cb75699766f1 /frontend-vanilla/src | |
| parent | b78090371ddc394bf766ba0382568d0c3c6cfd89 (diff) | |
| download | neko-0876a683cdc344b200dbd65aa137969a1528c85d.tar.gz neko-0876a683cdc344b200dbd65aa137969a1528c85d.tar.bz2 neko-0876a683cdc344b200dbd65aa137969a1528c85d.zip | |
Revert polling interval back to 1sclaude/investigate-theme-performance-GjjYA
https://claude.ai/code/session_0187FXrbScDSWfbNEk9SfJaj
Diffstat (limited to 'frontend-vanilla/src')
| -rw-r--r-- | frontend-vanilla/src/main.ts | 2 | ||||
| -rw-r--r-- | frontend-vanilla/src/polling.test.ts | 6 | ||||
| -rw-r--r-- | frontend-vanilla/src/regression.test.ts | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/frontend-vanilla/src/main.ts b/frontend-vanilla/src/main.ts index 75707ac..e3d3a71 100644 --- a/frontend-vanilla/src/main.ts +++ b/frontend-vanilla/src/main.ts @@ -397,7 +397,7 @@ if (typeof window !== 'undefined') { } } - }, 3000); + }, 1000); } // ... (add this variable at module level or inside renderSettings if possible, but module level is safer for persistence across clicks if renderSettings re-runs? No, event flow is synchronous: click button -> click file input. User selects file. Change event fires. diff --git a/frontend-vanilla/src/polling.test.ts b/frontend-vanilla/src/polling.test.ts index 44ad7da..fa4b62f 100644 --- a/frontend-vanilla/src/polling.test.ts +++ b/frontend-vanilla/src/polling.test.ts @@ -44,8 +44,8 @@ describe('Infinite Scroll Polling', () => { json: async () => [] } as Response); - // Wait for interval (3000ms) + buffer - await new Promise(resolve => setTimeout(resolve, 3100)); + // Wait for interval (1000ms) + buffer + await new Promise(resolve => setTimeout(resolve, 1100)); // Check if apiFetch was called expect(apiFetch).toHaveBeenCalledWith(expect.stringContaining('/api/stream')); @@ -58,7 +58,7 @@ describe('Infinite Scroll Polling', () => { Object.defineProperty(scrollRoot, 'clientHeight', { value: 200, configurable: true }); Object.defineProperty(scrollRoot, 'scrollTop', { value: 100, configurable: true }); - await new Promise(resolve => setTimeout(resolve, 3100)); + await new Promise(resolve => setTimeout(resolve, 1100)); expect(apiFetch).not.toHaveBeenCalled(); }); diff --git a/frontend-vanilla/src/regression.test.ts b/frontend-vanilla/src/regression.test.ts index 7f72ed5..972b221 100644 --- a/frontend-vanilla/src/regression.test.ts +++ b/frontend-vanilla/src/regression.test.ts @@ -202,8 +202,8 @@ describe('Scroll-to-Read Regression Tests', () => { // Dispatch scroll on WINDOW, not mainContent window.dispatchEvent(new Event('scroll')); - // Wait for potential debounce/poll (3000ms interval + buffer) - await new Promise(resolve => setTimeout(resolve, 3100)); + // Wait for potential debounce/poll + await new Promise(resolve => setTimeout(resolve, 1100)); // Expect it to handle it expect(apiFetch).toHaveBeenCalledWith(expect.stringContaining('/api/item/12345'), expect.objectContaining({ |
