aboutsummaryrefslogtreecommitdiffstats
path: root/web/dist/v3
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-17 13:49:27 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-17 13:49:27 -0800
commit71504966c15db9b506b99a29d6b9cd52e311502b (patch)
tree1fb3d36b1d10940fbe9ac5b2a2e3fa97e8100789 /web/dist/v3
parent8848259ccec2383211182d63cd87b46ba6f05a0c (diff)
downloadneko-71504966c15db9b506b99a29d6b9cd52e311502b.tar.gz
neko-71504966c15db9b506b99a29d6b9cd52e311502b.tar.bz2
neko-71504966c15db9b506b99a29d6b9cd52e311502b.zip
Soft deprecate tags feature in Settings
Diffstat (limited to 'web/dist/v3')
-rw-r--r--web/dist/v3/assets/index-mpR-GrQg.js (renamed from web/dist/v3/assets/index-Cz0NZ4Th.js)12
-rw-r--r--web/dist/v3/index.html2
2 files changed, 8 insertions, 6 deletions
diff --git a/web/dist/v3/assets/index-Cz0NZ4Th.js b/web/dist/v3/assets/index-mpR-GrQg.js
index 25cd456..86bb934 100644
--- a/web/dist/v3/assets/index-Cz0NZ4Th.js
+++ b/web/dist/v3/assets/index-mpR-GrQg.js
@@ -1,4 +1,4 @@
-(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const d of r.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function i(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function a(n){if(n.ep)return;n.ep=!0;const r=i(n);fetch(n.href,r)}})();function C(e){const i=`; ${document.cookie}`.split(`; ${e}=`);if(i.length===2)return i.pop()?.split(";").shift()}async function f(e,t){const i=t?.method?.toUpperCase()||"GET",a=["POST","PUT","DELETE"].includes(i),n=new Headers(t?.headers||{});if(a){const r=C("csrf_token");r&&n.set("X-CSRF-Token",r)}return fetch(e,{...t,headers:n,credentials:"include"})}function B(){const e=document.cookie.split("; ").find(t=>t.startsWith("neko_sidebar="));return e?e.split("=")[1]==="1":null}function P(e){document.cookie=`neko_sidebar=${e?"1":"0"}; path=/; max-age=31536000; SameSite=Lax`}function O(){const e=B();return e!==null?e:window.innerWidth>1024}class H extends EventTarget{feeds=[];tags=[];items=[];activeFeedId=null;activeTagName=null;filter="unread";searchQuery="";loading=!1;hasMore=!0;theme=localStorage.getItem("neko-theme")||"light";fontTheme=localStorage.getItem("neko-font-theme")||"default";sidebarVisible=O();setFeeds(t){this.feeds=t,this.emit("feeds-updated")}setTags(t){this.tags=t,this.emit("tags-updated")}setItems(t,i=!1){i?this.items=[...this.items,...t]:this.items=t,this.emit("items-updated")}setActiveFeed(t){this.activeFeedId=t,this.activeTagName=null,this.emit("active-feed-updated")}setActiveTag(t){this.activeTagName=t,this.activeFeedId=null,this.emit("active-tag-updated")}setFilter(t){this.filter!==t&&(this.filter=t,this.emit("filter-updated"))}setSearchQuery(t){this.searchQuery!==t&&(this.searchQuery=t,this.emit("search-updated"))}setLoading(t){this.loading=t,this.emit("loading-state-changed")}setHasMore(t){this.hasMore=t}setTheme(t){this.theme=t,localStorage.setItem("neko-theme",t),this.emit("theme-updated")}setFontTheme(t){this.fontTheme=t,localStorage.setItem("neko-font-theme",t),this.emit("theme-updated")}setSidebarVisible(t){this.sidebarVisible=t,P(t),this.emit("sidebar-toggle")}toggleSidebar(){this.setSidebarVisible(!this.sidebarVisible)}emit(t,i){this.dispatchEvent(new CustomEvent(t,{detail:i}))}on(t,i){this.addEventListener(t,i)}}const s=new H;class q extends EventTarget{constructor(){super(),window.addEventListener("popstate",()=>this.handleRouteChange())}handleRouteChange(){this.dispatchEvent(new CustomEvent("route-changed",{detail:this.getCurrentRoute()}))}getCurrentRoute(){const t=new URL(window.location.href),a=t.pathname.replace(/^\/v3\//,"").split("/").filter(Boolean);let n="/";const r={};return a[0]==="feed"&&a[1]?(n="/feed",r.feedId=a[1]):a[0]==="tag"&&a[1]?(n="/tag",r.tagName=decodeURIComponent(a[1])):a[0]==="settings"&&(n="/settings"),{path:n,params:r,query:t.searchParams}}navigate(t,i){let a=`/v3${t}`;if(i){const n=new URLSearchParams(i);a+=`?${n.toString()}`}window.history.pushState({},"",a),this.handleRouteChange()}updateQuery(t){const i=new URL(window.location.href);for(const[a,n]of Object.entries(t))n?i.searchParams.set(a,n):i.searchParams.delete(a);window.history.pushState({},"",i.toString()),this.handleRouteChange()}}const o=new q;function M(e,t=!1){const i=new Date(e.publish_date).toLocaleDateString();return`
+(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function i(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(n){if(n.ep)return;n.ep=!0;const o=i(n);fetch(n.href,o)}})();function A(e){const i=`; ${document.cookie}`.split(`; ${e}=`);if(i.length===2)return i.pop()?.split(";").shift()}async function f(e,t){const i=t?.method?.toUpperCase()||"GET",a=["POST","PUT","DELETE"].includes(i),n=new Headers(t?.headers||{});if(a){const o=A("csrf_token");o&&n.set("X-CSRF-Token",o)}return fetch(e,{...t,headers:n,credentials:"include"})}function C(){const e=document.cookie.split("; ").find(t=>t.startsWith("neko_sidebar="));return e?e.split("=")[1]==="1":null}function B(e){document.cookie=`neko_sidebar=${e?"1":"0"}; path=/; max-age=31536000; SameSite=Lax`}function P(){const e=C();return e!==null?e:window.innerWidth>1024}class O extends EventTarget{feeds=[];tags=[];items=[];activeFeedId=null;activeTagName=null;filter="unread";searchQuery="";loading=!1;hasMore=!0;theme=localStorage.getItem("neko-theme")||"light";fontTheme=localStorage.getItem("neko-font-theme")||"default";sidebarVisible=P();setFeeds(t){this.feeds=t,this.emit("feeds-updated")}setTags(t){this.tags=t,this.emit("tags-updated")}setItems(t,i=!1){i?this.items=[...this.items,...t]:this.items=t,this.emit("items-updated")}setActiveFeed(t){this.activeFeedId=t,this.activeTagName=null,this.emit("active-feed-updated")}setActiveTag(t){this.activeTagName=t,this.activeFeedId=null,this.emit("active-tag-updated")}setFilter(t){this.filter!==t&&(this.filter=t,this.emit("filter-updated"))}setSearchQuery(t){this.searchQuery!==t&&(this.searchQuery=t,this.emit("search-updated"))}setLoading(t){this.loading=t,this.emit("loading-state-changed")}setHasMore(t){this.hasMore=t}setTheme(t){this.theme=t,localStorage.setItem("neko-theme",t),this.emit("theme-updated")}setFontTheme(t){this.fontTheme=t,localStorage.setItem("neko-font-theme",t),this.emit("theme-updated")}setSidebarVisible(t){this.sidebarVisible=t,B(t),this.emit("sidebar-toggle")}toggleSidebar(){this.setSidebarVisible(!this.sidebarVisible)}emit(t,i){this.dispatchEvent(new CustomEvent(t,{detail:i}))}on(t,i){this.addEventListener(t,i)}}const s=new O;class H extends EventTarget{constructor(){super(),window.addEventListener("popstate",()=>this.handleRouteChange())}handleRouteChange(){this.dispatchEvent(new CustomEvent("route-changed",{detail:this.getCurrentRoute()}))}getCurrentRoute(){const t=new URL(window.location.href),a=t.pathname.replace(/^\/v3\//,"").split("/").filter(Boolean);let n="/";const o={};return a[0]==="feed"&&a[1]?(n="/feed",o.feedId=a[1]):a[0]==="tag"&&a[1]?(n="/tag",o.tagName=decodeURIComponent(a[1])):a[0]==="settings"&&(n="/settings"),{path:n,params:o,query:t.searchParams}}navigate(t,i){let a=`/v3${t}`;if(i){const n=new URLSearchParams(i);a+=`?${n.toString()}`}window.history.pushState({},"",a),this.handleRouteChange()}updateQuery(t){const i=new URL(window.location.href);for(const[a,n]of Object.entries(t))n?i.searchParams.set(a,n):i.searchParams.delete(a);window.history.pushState({},"",i.toString()),this.handleRouteChange()}}const r=new H;function M(e,t=!1){const i=new Date(e.publish_date).toLocaleDateString();return`
<li class="feed-item ${e.read?"read":"unread"} ${t?"selected":""}" data-id="${e._id}">
<div class="item-header">
<a href="${e.url}" target="_blank" rel="noopener noreferrer" class="item-title" data-action="open">
@@ -66,7 +66,7 @@
<div id="content-area"></div>
</main>
</div>
- `,N())}function N(){document.getElementById("search-input")?.addEventListener("input",n=>{const r=n.target.value;o.updateQuery({q:r})}),document.getElementById("logo-link")?.addEventListener("click",()=>o.navigate("/")),document.getElementById("logout-button")?.addEventListener("click",n=>{n.preventDefault(),J()}),document.getElementById("sidebar-toggle-btn")?.addEventListener("click",()=>{s.toggleSidebar()}),document.getElementById("sidebar-backdrop")?.addEventListener("click",()=>{s.setSidebarVisible(!1)}),document.querySelectorAll(".sidebar-section.collapsible h3").forEach(n=>{n.addEventListener("click",()=>{n.parentElement?.classList.toggle("collapsed")})}),document.getElementById("sidebar")?.addEventListener("click",n=>{const r=n.target,d=r.closest("a");if(!d){r.classList.contains("logo")&&(n.preventDefault(),o.navigate("/",{}));return}const h=d.getAttribute("data-nav"),m=Object.fromEntries(o.getCurrentRoute().query.entries());if(h==="filter"){n.preventDefault();const u=d.getAttribute("data-value");o.getCurrentRoute().path==="/settings"?o.navigate("/",{...m,filter:u}):o.updateQuery({filter:u})}else if(h==="tag"){n.preventDefault();const u=d.getAttribute("data-value");o.navigate(`/tag/${encodeURIComponent(u)}`,m)}else if(h==="feed"){n.preventDefault();const u=d.getAttribute("data-value"),l=o.getCurrentRoute();s.activeFeedId===parseInt(u)&&l.path!=="/settings"?o.navigate("/",m):o.navigate(`/feed/${u}`,m)}else h==="settings"&&(n.preventDefault(),o.getCurrentRoute().path==="/settings"?o.navigate("/",m):o.navigate("/settings",m));window.innerWidth<=768&&s.setSidebarVisible(!1)}),document.getElementById("content-area")?.addEventListener("click",n=>{const r=n.target,d=r.closest('[data-action="toggle-star"]');if(d){const l=d.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));V(v)}return}const h=r.closest('[data-action="scrape"]');if(h){const l=h.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));X(v)}return}const m=r.closest('[data-action="open"]'),u=r.closest(".feed-item");if(u&&!m){const l=parseInt(u.getAttribute("data-id"));c=l,document.querySelectorAll(".feed-item").forEach(y=>{const A=parseInt(y.getAttribute("data-id")||"0");y.classList.toggle("selected",A===c)});const v=s.items.find(y=>y._id===l);v&&!v.read&&p(l,{read:!0})}})}function k(){const{feeds:e,activeFeedId:t}=s,i=document.getElementById("feed-list");i&&(i.innerHTML=e.map(a=>`
+ `,q())}function q(){document.getElementById("search-input")?.addEventListener("input",n=>{const o=n.target.value;r.updateQuery({q:o})}),document.getElementById("logo-link")?.addEventListener("click",()=>r.navigate("/")),document.getElementById("logout-button")?.addEventListener("click",n=>{n.preventDefault(),X()}),document.getElementById("sidebar-toggle-btn")?.addEventListener("click",()=>{s.toggleSidebar()}),document.getElementById("sidebar-backdrop")?.addEventListener("click",()=>{s.setSidebarVisible(!1)}),document.querySelectorAll(".sidebar-section.collapsible h3").forEach(n=>{n.addEventListener("click",()=>{n.parentElement?.classList.toggle("collapsed")})}),document.getElementById("sidebar")?.addEventListener("click",n=>{const o=n.target,d=o.closest("a");if(!d){o.classList.contains("logo")&&(n.preventDefault(),r.navigate("/",{}));return}const h=d.getAttribute("data-nav"),m=Object.fromEntries(r.getCurrentRoute().query.entries());if(h==="filter"){n.preventDefault();const u=d.getAttribute("data-value");r.getCurrentRoute().path==="/settings"?r.navigate("/",{...m,filter:u}):r.updateQuery({filter:u})}else if(h==="tag"){n.preventDefault();const u=d.getAttribute("data-value");r.navigate(`/tag/${encodeURIComponent(u)}`,m)}else if(h==="feed"){n.preventDefault();const u=d.getAttribute("data-value"),l=r.getCurrentRoute();s.activeFeedId===parseInt(u)&&l.path!=="/settings"?r.navigate("/",m):r.navigate(`/feed/${u}`,m)}else h==="settings"&&(n.preventDefault(),r.getCurrentRoute().path==="/settings"?r.navigate("/",m):r.navigate("/settings",m));window.innerWidth<=768&&s.setSidebarVisible(!1)}),document.getElementById("content-area")?.addEventListener("click",n=>{const o=n.target,d=o.closest('[data-action="toggle-star"]');if(d){const l=d.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));Q(v)}return}const h=o.closest('[data-action="scrape"]');if(h){const l=h.closest("[data-id]");if(l){const v=parseInt(l.getAttribute("data-id"));U(v)}return}const m=o.closest('[data-action="open"]'),u=o.closest(".feed-item");if(u&&!m){const l=parseInt(u.getAttribute("data-id"));c=l,document.querySelectorAll(".feed-item").forEach(b=>{const F=parseInt(b.getAttribute("data-id")||"0");b.classList.toggle("selected",F===c)});const v=s.items.find(b=>b._id===l);v&&!v.read&&p(l,{read:!0})}})}function k(){const{feeds:e,activeFeedId:t}=s,i=document.getElementById("feed-list");i&&(i.innerHTML=e.map(a=>`
<li class="${a._id===t?"active":""}">
<a href="/v3/feed/${a._id}" data-nav="feed" data-value="${a._id}">
${a.title||a.url}
@@ -78,12 +78,12 @@
${a.title}
</a>
</li>
- `).join(""))}function _(){const{filter:e}=s,t=document.getElementById("filter-list");t&&t.querySelectorAll("li").forEach(i=>{i.classList.toggle("active",i.getAttribute("data-filter")===e)})}function T(){const{items:e,loading:t}=s,i=document.getElementById("content-area");if(!i||o.getCurrentRoute().path==="/settings")return;if(t&&e.length===0){i.innerHTML='<p class="loading">Loading items...</p>';return}if(e.length===0){i.innerHTML='<p class="empty">No items found.</p>';return}i.innerHTML=`
+ `).join(""))}function _(){const{filter:e}=s,t=document.getElementById("filter-list");t&&t.querySelectorAll("li").forEach(i=>{i.classList.toggle("active",i.getAttribute("data-filter")===e)})}function T(){const{items:e,loading:t}=s,i=document.getElementById("content-area");if(!i||r.getCurrentRoute().path==="/settings")return;if(t&&e.length===0){i.innerHTML='<p class="loading">Loading items...</p>';return}if(e.length===0){i.innerHTML='<p class="empty">No items found.</p>';return}i.innerHTML=`
<ul class="item-list">
${e.map(n=>M(n,n._id===c)).join("")}
</ul>
${s.hasMore?'<div id="load-more-sentinel" class="loading-more">Loading more...</div>':""}
- `;const a=document.getElementById("main-content");if(a){let n=null;a.onscroll=()=>{!s.loading&&s.hasMore&&a.scrollHeight>a.clientHeight&&a.scrollHeight-a.scrollTop-a.clientHeight<200&&I(),n===null&&(n=window.setTimeout(()=>{R(a),n=null},250))}}}function R(e){const t=e.getBoundingClientRect();s.items.forEach(i=>{if(i.read)return;const a=document.querySelector(`.feed-item[data-id="${i._id}"]`);a&&a.getBoundingClientRect().bottom<t.top&&p(i._id,{read:!0})})}typeof window<"u"&&setInterval(()=>{const e=document.getElementById("main-content");if(s.loading||!s.hasMore)return;if(e&&(R(e),e.scrollHeight>e.clientHeight&&e.scrollHeight-e.scrollTop-e.clientHeight<200)){I();return}const t=document.documentElement.scrollHeight||document.body.scrollHeight,i=window.innerHeight,a=window.scrollY||document.documentElement.scrollTop;t>i&&t-i-a<200&&I()},1e3);function E(){const e=document.getElementById("content-area");if(!e)return;e.innerHTML=`
+ `;const a=document.getElementById("main-content");if(a){let n=null;a.onscroll=()=>{!s.loading&&s.hasMore&&a.scrollHeight>a.clientHeight&&a.scrollHeight-a.scrollTop-a.clientHeight<200&&w(),n===null&&(n=window.setTimeout(()=>{R(a),n=null},250))}}}function R(e){const t=e.getBoundingClientRect();s.items.forEach(i=>{if(i.read)return;const a=document.querySelector(`.feed-item[data-id="${i._id}"]`);a&&a.getBoundingClientRect().bottom<t.top&&p(i._id,{read:!0})})}typeof window<"u"&&setInterval(()=>{const e=document.getElementById("main-content");if(s.loading||!s.hasMore)return;if(e&&(R(e),e.scrollHeight>e.clientHeight&&e.scrollHeight-e.scrollTop-e.clientHeight<200)){w();return}const t=document.documentElement.scrollHeight||document.body.scrollHeight,i=window.innerHeight,a=window.scrollY||document.documentElement.scrollTop;t>i&&t-i-a<200&&w()},1e3);function I(){const e=document.getElementById("content-area");if(!e)return;e.innerHTML=`
<div class="settings-view">
<h2>Settings</h2>
@@ -142,8 +142,10 @@
<div class="feed-url">${a.url}</div>
</div>
<div class="feed-actions">
+ <!-- FIXME: Tags feature is broken/unused in V3. Soft deprecated for now.
<input type="text" class="feed-tag-input" data-id="${a._id}" value="${a.category||""}" placeholder="Tag">
<button class="update-feed-tag-btn" data-id="${a._id}">SAVE</button>
+ -->
<button class="delete-feed-btn" data-id="${a._id}">DELETE</button>
</div>
</li>
@@ -151,4 +153,4 @@
</ul>
</section>
</div>
- `,document.getElementById("theme-options")?.addEventListener("click",a=>{const n=a.target.closest("button");n&&(s.setTheme(n.getAttribute("data-theme")),E())}),document.getElementById("font-selector")?.addEventListener("change",a=>{s.setFontTheme(a.target.value)}),document.getElementById("add-feed-btn")?.addEventListener("click",async()=>{const a=document.getElementById("new-feed-url"),n=a.value.trim();n&&(await x(n)?(a.value="",alert("Feed added successfully!"),b()):alert("Failed to add feed."))});let t="opml";const i=document.getElementById("import-file");document.querySelectorAll(".import-btn").forEach(a=>{a.addEventListener("click",n=>{t=n.currentTarget.getAttribute("data-format")||"opml",i.click()})}),i?.addEventListener("change",async a=>{const n=a.target.files?.[0];n&&(await j(n,t)?(alert(`Import (${t}) started! check logs.`),b()):alert("Failed to import.")),i.value=""}),document.querySelectorAll(".delete-feed-btn").forEach(a=>{a.addEventListener("click",async n=>{const r=parseInt(n.target.getAttribute("data-id"));confirm("Delete this feed?")&&(await Q(r),await b(),E())})}),document.querySelectorAll(".update-feed-tag-btn").forEach(a=>{a.addEventListener("click",async n=>{const r=parseInt(n.target.getAttribute("data-id")),d=document.querySelector(`.feed-tag-input[data-id="${r}"]`);await U(r,{category:d.value.trim()}),await b(),await F(),E(),alert("Feed updated")})})}async function x(e){try{return(await f("/api/feed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).ok}catch(t){return console.error("Failed to add feed",t),!1}}async function j(e,t){try{const i=new FormData;i.append("file",e),i.append("format",t);const a=document.cookie.split("; ").find(r=>r.startsWith("csrf_token="))?.split("=")[1];return(await fetch("/api/import",{method:"POST",headers:{"X-CSRF-Token":a||""},body:i})).ok}catch(i){return console.error("Failed to import",i),!1}}async function Q(e){try{return(await f(`/api/feed/${e}`,{method:"DELETE"})).ok}catch(t){return console.error("Failed to delete feed",t),!1}}async function U(e,t){try{return(await f("/api/feed",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,_id:e})})).ok}catch(i){return console.error("Failed to update feed",i),!1}}async function V(e){const t=s.items.find(i=>i._id===e);t&&p(e,{starred:!t.starred})}async function X(e){if(s.items.find(i=>i._id===e))try{const i=await f(`/api/item/${e}/content`);if(i.ok){const a=await i.json();a.full_content&&p(e,{full_content:a.full_content})}}catch(i){console.error("Failed to fetch full content",i)}}async function p(e,t){try{if((await f(`/api/item/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok){const a=s.items.find(n=>n._id===e);if(a){Object.assign(a,t);const n=document.querySelector(`.feed-item[data-id="${e}"]`);if(n){if(t.read!==void 0&&n.classList.toggle("read",t.read),t.starred!==void 0){const r=n.querySelector(".star-btn");r&&(r.classList.toggle("is-starred",t.starred),r.classList.toggle("is-unstarred",!t.starred),r.setAttribute("title",t.starred?"Unstar":"Star"))}t.full_content&&T()}}}}catch(i){console.error("Failed to update item",i)}}async function b(){const e=await f("/api/feed/");if(e.ok){const t=await e.json();s.setFeeds(t)}}async function F(){const e=await f("/api/tag");if(e.ok){const t=await e.json();s.setTags(t)}}async function w(e,t,i=!1){s.setLoading(!0);try{const a=new URLSearchParams;e&&a.append("feed_id",e),t&&a.append("tag",t),s.searchQuery&&a.append("q",s.searchQuery),(s.filter==="starred"||s.filter==="all")&&a.append("read_filter","all"),s.filter==="starred"&&a.append("starred","true"),i&&s.items.length>0&&a.append("max_id",String(s.items[s.items.length-1]._id));const n=await f(`/api/stream?${a.toString()}`);if(n.ok){const r=await n.json();s.setHasMore(r.length>0),s.setItems(r,i)}}finally{s.setLoading(!1)}}async function I(){const e=o.getCurrentRoute();w(e.params.feedId,e.params.tagName,!0)}async function J(){await f("/api/logout",{method:"POST"}),window.location.href="/login/"}function L(){const e=o.getCurrentRoute(),t=e.query.get("filter");s.setFilter(t||"unread");const i=e.query.get("q");if(i!==null&&s.setSearchQuery(i),e.path==="/settings"){E();return}if(e.path==="/feed"&&e.params.feedId){const a=parseInt(e.params.feedId);s.setActiveFeed(a),w(e.params.feedId),document.getElementById("section-feeds")?.classList.remove("collapsed")}else e.path==="/tag"&&e.params.tagName?(s.setActiveTag(e.params.tagName),w(void 0,e.params.tagName),document.getElementById("section-tags")?.classList.remove("collapsed")):(s.setActiveFeed(null),s.setActiveTag(null),w())}window.addEventListener("keydown",e=>{if(!["INPUT","TEXTAREA"].includes(e.target.tagName))switch(e.key){case"j":S(1);break;case"k":S(-1);break;case"r":if(c){const t=s.items.find(i=>i._id===c);t&&p(t._id,{read:!t.read})}break;case"s":if(c){const t=s.items.find(i=>i._id===c);t&&p(t._id,{starred:!t.starred})}break;case"/":e.preventDefault(),document.getElementById("search-input")?.focus();break}});function S(e){if(s.items.length===0)return;const t=s.items.findIndex(a=>a._id===c);let i;if(t===-1?i=e>0?0:s.items.length-1:i=t+e,i>=0&&i<s.items.length){c=s.items[i]._id,document.querySelectorAll(".feed-item").forEach(n=>{const r=parseInt(n.getAttribute("data-id")||"0");n.classList.toggle("selected",r===c)});const a=document.querySelector(`.feed-item[data-id="${c}"]`);a&&a.scrollIntoView({block:"start",behavior:"smooth"}),s.items[i].read||p(c,{read:!0})}}s.on("feeds-updated",k);s.on("tags-updated",$);s.on("active-feed-updated",k);s.on("active-tag-updated",$);s.on("filter-updated",_);s.on("search-updated",()=>{const e=document.getElementById("search-input");e&&e.value!==s.searchQuery&&(e.value=s.searchQuery),L()});s.on("theme-updated",()=>{g||(g=document.querySelector("#app")),g&&(g.className=`theme-${s.theme} font-${s.fontTheme}`)});s.on("sidebar-toggle",()=>{const e=document.querySelector(".layout");e&&(s.sidebarVisible?(e.classList.remove("sidebar-hidden"),e.classList.add("sidebar-visible")):(e.classList.remove("sidebar-visible"),e.classList.add("sidebar-hidden")))});s.on("items-updated",T);s.on("loading-state-changed",T);o.addEventListener("route-changed",L);window.app={navigate:e=>o.navigate(e)};async function W(){const e=await f("/api/auth");if(!e||e.status===401){window.location.href="/login/";return}D(),_();try{await Promise.all([b(),F()])}catch(t){console.error("Initial fetch failed",t)}L()}typeof window<"u"&&!window.__VITEST__&&W();
+ `,document.getElementById("theme-options")?.addEventListener("click",a=>{const n=a.target.closest("button");n&&(s.setTheme(n.getAttribute("data-theme")),I())}),document.getElementById("font-selector")?.addEventListener("change",a=>{s.setFontTheme(a.target.value)}),document.getElementById("add-feed-btn")?.addEventListener("click",async()=>{const a=document.getElementById("new-feed-url"),n=a.value.trim();n&&(await N(n)?(a.value="",alert("Feed added successfully!"),y()):alert("Failed to add feed."))});let t="opml";const i=document.getElementById("import-file");document.querySelectorAll(".import-btn").forEach(a=>{a.addEventListener("click",n=>{t=n.currentTarget.getAttribute("data-format")||"opml",i.click()})}),i?.addEventListener("change",async a=>{const n=a.target.files?.[0];n&&(await x(n,t)?(alert(`Import (${t}) started! check logs.`),y()):alert("Failed to import.")),i.value=""}),document.querySelectorAll(".delete-feed-btn").forEach(a=>{a.addEventListener("click",async n=>{const o=parseInt(n.target.getAttribute("data-id"));confirm("Delete this feed?")&&(await j(o),await y(),I())})})}async function N(e){try{return(await f("/api/feed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).ok}catch(t){return console.error("Failed to add feed",t),!1}}async function x(e,t){try{const i=new FormData;i.append("file",e),i.append("format",t);const a=document.cookie.split("; ").find(o=>o.startsWith("csrf_token="))?.split("=")[1];return(await fetch("/api/import",{method:"POST",headers:{"X-CSRF-Token":a||""},body:i})).ok}catch(i){return console.error("Failed to import",i),!1}}async function j(e){try{return(await f(`/api/feed/${e}`,{method:"DELETE"})).ok}catch(t){return console.error("Failed to delete feed",t),!1}}async function Q(e){const t=s.items.find(i=>i._id===e);t&&p(e,{starred:!t.starred})}async function U(e){if(s.items.find(i=>i._id===e))try{const i=await f(`/api/item/${e}/content`);if(i.ok){const a=await i.json();a.full_content&&p(e,{full_content:a.full_content})}}catch(i){console.error("Failed to fetch full content",i)}}async function p(e,t){try{if((await f(`/api/item/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok){const a=s.items.find(n=>n._id===e);if(a){Object.assign(a,t);const n=document.querySelector(`.feed-item[data-id="${e}"]`);if(n){if(t.read!==void 0&&n.classList.toggle("read",t.read),t.starred!==void 0){const o=n.querySelector(".star-btn");o&&(o.classList.toggle("is-starred",t.starred),o.classList.toggle("is-unstarred",!t.starred),o.setAttribute("title",t.starred?"Unstar":"Star"))}t.full_content&&T()}}}}catch(i){console.error("Failed to update item",i)}}async function y(){const e=await f("/api/feed/");if(e.ok){const t=await e.json();s.setFeeds(t)}}async function V(){const e=await f("/api/tag");if(e.ok){const t=await e.json();s.setTags(t)}}async function E(e,t,i=!1){s.setLoading(!0);try{const a=new URLSearchParams;e&&a.append("feed_id",e),t&&a.append("tag",t),s.searchQuery&&a.append("q",s.searchQuery),(s.filter==="starred"||s.filter==="all")&&a.append("read_filter","all"),s.filter==="starred"&&a.append("starred","true"),i&&s.items.length>0&&a.append("max_id",String(s.items[s.items.length-1]._id));const n=await f(`/api/stream?${a.toString()}`);if(n.ok){const o=await n.json();s.setHasMore(o.length>0),s.setItems(o,i)}}finally{s.setLoading(!1)}}async function w(){const e=r.getCurrentRoute();E(e.params.feedId,e.params.tagName,!0)}async function X(){await f("/api/logout",{method:"POST"}),window.location.href="/login/"}function L(){const e=r.getCurrentRoute(),t=e.query.get("filter");s.setFilter(t||"unread");const i=e.query.get("q");if(i!==null&&s.setSearchQuery(i),e.path==="/settings"){I();return}if(e.path==="/feed"&&e.params.feedId){const a=parseInt(e.params.feedId);s.setActiveFeed(a),E(e.params.feedId),document.getElementById("section-feeds")?.classList.remove("collapsed")}else e.path==="/tag"&&e.params.tagName?(s.setActiveTag(e.params.tagName),E(void 0,e.params.tagName),document.getElementById("section-tags")?.classList.remove("collapsed")):(s.setActiveFeed(null),s.setActiveTag(null),E())}window.addEventListener("keydown",e=>{if(!["INPUT","TEXTAREA"].includes(e.target.tagName))switch(e.key){case"j":S(1);break;case"k":S(-1);break;case"r":if(c){const t=s.items.find(i=>i._id===c);t&&p(t._id,{read:!t.read})}break;case"s":if(c){const t=s.items.find(i=>i._id===c);t&&p(t._id,{starred:!t.starred})}break;case"/":e.preventDefault(),document.getElementById("search-input")?.focus();break}});function S(e){if(s.items.length===0)return;const t=s.items.findIndex(a=>a._id===c);let i;if(t===-1?i=e>0?0:s.items.length-1:i=t+e,i>=0&&i<s.items.length){c=s.items[i]._id,document.querySelectorAll(".feed-item").forEach(n=>{const o=parseInt(n.getAttribute("data-id")||"0");n.classList.toggle("selected",o===c)});const a=document.querySelector(`.feed-item[data-id="${c}"]`);a&&a.scrollIntoView({block:"start",behavior:"smooth"}),s.items[i].read||p(c,{read:!0})}}s.on("feeds-updated",k);s.on("tags-updated",$);s.on("active-feed-updated",k);s.on("active-tag-updated",$);s.on("filter-updated",_);s.on("search-updated",()=>{const e=document.getElementById("search-input");e&&e.value!==s.searchQuery&&(e.value=s.searchQuery),L()});s.on("theme-updated",()=>{g||(g=document.querySelector("#app")),g&&(g.className=`theme-${s.theme} font-${s.fontTheme}`)});s.on("sidebar-toggle",()=>{const e=document.querySelector(".layout");e&&(s.sidebarVisible?(e.classList.remove("sidebar-hidden"),e.classList.add("sidebar-visible")):(e.classList.remove("sidebar-visible"),e.classList.add("sidebar-hidden")))});s.on("items-updated",T);s.on("loading-state-changed",T);r.addEventListener("route-changed",L);window.app={navigate:e=>r.navigate(e)};async function J(){const e=await f("/api/auth");if(!e||e.status===401){window.location.href="/login/";return}D(),_();try{await Promise.all([y(),V()])}catch(t){console.error("Initial fetch failed",t)}L()}typeof window<"u"&&!window.__VITEST__&&J();
diff --git a/web/dist/v3/index.html b/web/dist/v3/index.html
index a18b2df..c1f6133 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-Cz0NZ4Th.js"></script>
+ <script type="module" crossorigin src="/v3/assets/index-mpR-GrQg.js"></script>
<link rel="stylesheet" crossorigin href="/v3/assets/index-C-K96KpW.css">
</head>
<body>