aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaude <noreply@anthropic.com>2026-02-18 22:56:56 +0000
committerClaude <noreply@anthropic.com>2026-02-18 22:56:56 +0000
commit0876a683cdc344b200dbd65aa137969a1528c85d (patch)
tree6a8eb1314cc203f4e070c98422a9cb75699766f1
parentb78090371ddc394bf766ba0382568d0c3c6cfd89 (diff)
downloadneko-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
-rw-r--r--frontend-vanilla/src/main.ts2
-rw-r--r--frontend-vanilla/src/polling.test.ts6
-rw-r--r--frontend-vanilla/src/regression.test.ts4
-rw-r--r--web/dist/v3/assets/index-DZsQUXOH.js (renamed from web/dist/v3/assets/index-3ySRh1ZH.js)2
-rw-r--r--web/dist/v3/index.html2
5 files changed, 8 insertions, 8 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({
diff --git a/web/dist/v3/assets/index-3ySRh1ZH.js b/web/dist/v3/assets/index-DZsQUXOH.js
index 21ef42f..95719d5 100644
--- a/web/dist/v3/assets/index-3ySRh1ZH.js
+++ b/web/dist/v3/assets/index-DZsQUXOH.js
@@ -93,7 +93,7 @@
${e.map(s=>O(s)).join("")}
</ul>
${a.hasMore?'<div id="load-more-sentinel" class="loading-more">Loading more...</div>':""}
- `;const i=document.getElementById("main-content");if(i){let s=null;i.onscroll=()=>{!a.loading&&a.hasMore&&i.scrollHeight>i.clientHeight&&i.scrollHeight-i.scrollTop-i.clientHeight<200&&E(),s===null&&(s=window.setTimeout(()=>{R(i),s=null},250))}}}function R(e){const t=e.getBoundingClientRect(),n=e.querySelectorAll(".feed-item");for(const i of n){const s=parseInt(i.getAttribute("data-id")),o=a.items.find(f=>f._id===s);if(!o||o.read)continue;i.getBoundingClientRect().bottom<t.top&&p(o._id,{read:!0})}}typeof window<"u"&&setInterval(()=>{const e=document.getElementById("main-content");if(a.loading||!a.hasMore)return;if(e&&(R(e),e.scrollHeight>e.clientHeight&&e.scrollHeight-e.scrollTop-e.clientHeight<200)){E();return}const t=document.documentElement.scrollHeight||document.body.scrollHeight,n=window.innerHeight,i=window.scrollY||document.documentElement.scrollTop;t>n&&t-n-i<200&&E()},3e3);function v(){const e=document.getElementById("content-area");if(!e)return;e.innerHTML=`
+ `;const i=document.getElementById("main-content");if(i){let s=null;i.onscroll=()=>{!a.loading&&a.hasMore&&i.scrollHeight>i.clientHeight&&i.scrollHeight-i.scrollTop-i.clientHeight<200&&E(),s===null&&(s=window.setTimeout(()=>{R(i),s=null},250))}}}function R(e){const t=e.getBoundingClientRect(),n=e.querySelectorAll(".feed-item");for(const i of n){const s=parseInt(i.getAttribute("data-id")),o=a.items.find(f=>f._id===s);if(!o||o.read)continue;i.getBoundingClientRect().bottom<t.top&&p(o._id,{read:!0})}}typeof window<"u"&&setInterval(()=>{const e=document.getElementById("main-content");if(a.loading||!a.hasMore)return;if(e&&(R(e),e.scrollHeight>e.clientHeight&&e.scrollHeight-e.scrollTop-e.clientHeight<200)){E();return}const t=document.documentElement.scrollHeight||document.body.scrollHeight,n=window.innerHeight,i=window.scrollY||document.documentElement.scrollTop;t>n&&t-n-i<200&&E()},1e3);function v(){const e=document.getElementById("content-area");if(!e)return;e.innerHTML=`
<div class="settings-view">
<h2>Settings</h2>
diff --git a/web/dist/v3/index.html b/web/dist/v3/index.html
index 25a0b86..8c1f6a6 100644
--- a/web/dist/v3/index.html
+++ b/web/dist/v3/index.html
@@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>neko</title>
- <script type="module" crossorigin src="/v3/assets/index-3ySRh1ZH.js"></script>
+ <script type="module" crossorigin src="/v3/assets/index-DZsQUXOH.js"></script>
<link rel="stylesheet" crossorigin href="/v3/assets/index-FN4JJv2k.css">
</head>
<body>