This build was committed by a bot.

This commit is contained in:
github-actions[bot]
2026-01-16 23:10:32 +00:00
parent 6e1405edba
commit a8cfb037a9
3 changed files with 32 additions and 19 deletions

View File

@@ -1403,6 +1403,28 @@ el.htmlTab_index.textContent = "index.html";
el.htmlTab_extension.textContent = "extension.html";
el.htmlTab_index.onclick = () => showHtmlTab("index");
el.htmlTab_extension.onclick = () => showHtmlTab("extension");
const pullThreads = async () => {
const u = el.threadRepoInput.value.trim();
if (!u.startsWith("gh://")) return;
const info = parseGhUrl(u);
try {
const items = await ghApi(`${info.apiPath}?ref=${info.branch}`);
if (!items) {
THREAD.list = [];
await THREAD.save();
} else {
THREAD.list = items.map((i) => {
if (i.type === "dir") return { id: i.name, title: i.name, type: "folder", updatedAt: 0 };
const d = deserializeThreadName(i.name);
return d ? { ...d, status: "synced" } : null;
}).filter(Boolean);
await THREAD.save();
}
await renderThreads();
} catch (e) {
console.error("Auto-pull failed:", e);
}
};
$(el.threadRepoInput).on("change", async () => {
const u = el.threadRepoInput.value.trim();
localStorage.setItem("thread_repo_url", u);
@@ -1412,8 +1434,11 @@ $(el.threadRepoInput).on("change", async () => {
}
el.threadFolderBtn.classList.toggle("hidden", !u.startsWith("gh://"));
el.threadBackBtn.classList.toggle("hidden", !u.startsWith("gh://") || u.split("/").length <= 3);
if (u.startsWith("gh://")) await pullThreads();
else {
await THREAD.load();
await renderThreads();
}
});
$(el.threadBackBtn).on("click", () => {
const u = el.threadRepoInput.value.trim();
@@ -1469,21 +1494,9 @@ $(el.threadSyncBtn).on("click", async () => {
await THREAD.save();
alert("Pushed to GitHub.");
} else {
const items = await ghApi(`${info.apiPath}?ref=${info.branch}`);
if (!items) {
THREAD.list = [];
await THREAD.save();
alert("Remote is empty.");
} else {
THREAD.list = items.map((i) => {
if (i.type === "dir") return { id: i.name, title: i.name, type: "folder", updatedAt: 0 };
const d = deserializeThreadName(i.name);
return d ? { ...d, status: "synced" } : null;
}).filter(Boolean);
await THREAD.save();
await pullThreads();
alert("Pulled from GitHub.");
}
}
await renderThreads();
} catch (e) {
alert("Sync failed: " + e.message);
@@ -1733,4 +1746,4 @@ $(el.pasteHTML).on("click", async () => {
} catch {
}
});
Object.assign(window, { icons, haptic, clamp, num, int, gid, esc, positionPopover, sid, fmtSize, asDataURL, b64, makeSune, getModelShort, resolveSuneSrc, processSuneIncludes, renderSuneHTML, reflectActiveSune, suneRow, enhanceCodeBlocks, getSuneLabel, _createMessageRow, msgRow, partsToText, addSuneBubbleStreaming, clearChat, payloadWithSampling, setBtnStop, setBtnSend, localDemoReply, titleFrom, serializeThreadName, deserializeThreadName, ensureThreadOnFirstUser, generateTitleWithAI, threadRow, renderThreads, hideThreadPopover, showThreadPopover, hideSunePopover, showSunePopover, updateAttachBadge, toAttach, ensureJars, openSettings, closeSettings, showTab, dl, ts, kbUpdate, kbBind, activeMeta, init, showHtmlTab, showAccountTab, openAccountSettings, closeAccountSettings, getBubbleById, syncActiveThread, syncWhileBusy, onForeground, getActiveHtmlParts, imgToWebp, cacheStore, ghApi, parseGhUrl });
Object.assign(window, { icons, haptic, clamp, num, int, gid, esc, positionPopover, sid, fmtSize, asDataURL, b64, makeSune, getModelShort, resolveSuneSrc, processSuneIncludes, renderSuneHTML, reflectActiveSune, suneRow, enhanceCodeBlocks, getSuneLabel, _createMessageRow, msgRow, partsToText, addSuneBubbleStreaming, clearChat, payloadWithSampling, setBtnStop, setBtnSend, localDemoReply, titleFrom, serializeThreadName, deserializeThreadName, ensureThreadOnFirstUser, generateTitleWithAI, threadRow, renderThreads, hideThreadPopover, showThreadPopover, hideSunePopover, showSunePopover, updateAttachBadge, toAttach, ensureJars, openSettings, closeSettings, showTab, dl, ts, kbUpdate, kbBind, activeMeta, init, showHtmlTab, showAccountTab, openAccountSettings, closeAccountSettings, getBubbleById, syncActiveThread, syncWhileBusy, onForeground, getActiveHtmlParts, imgToWebp, cacheStore, ghApi, parseGhUrl, pullThreads });

2
dist/index.html vendored
View File

@@ -12,7 +12,7 @@
<script defer src="https://cdn.jsdelivr.net/npm/cash-dom/dist/cash.min.js"></script>
<script defer src="//unpkg.com/alpinejs"></script>
<script type="module" crossorigin src="/assets/index-B_jJyKld.js"></script>
<script type="module" crossorigin src="/assets/index-B2V8L6xx.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-JLEDB1oP.css">
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
<body class="bg-white text-gray-900 selection:bg-black/10" x-data @click.window="if($event.target.closest('button')) haptic(); if(!document.getElementById('threadPopover').contains($event.target)&&!$event.target.closest('[data-thread-menu]')) hideThreadPopover(); if(!document.getElementById('sunePopover').contains($event.target)&&!$event.target.closest('[data-sune-menu]')) hideSunePopover(); if(!document.getElementById('userMenu').contains($event.target)&&!document.getElementById('userMenuBtn').contains($event.target)) document.getElementById('userMenu').classList.add('hidden')">

2
dist/sw.js vendored
View File

@@ -1 +1 @@
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didnt register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),c={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map(e=>c[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"e62fb0c404f4d8ff32418b5610c8fd66"},{url:"assets/index-JLEDB1oP.css",revision:null},{url:"assets/index-B_jJyKld.js",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didnt register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const d=e=>i(e,t),l={module:{uri:t},exports:o,require:d};s[t]=Promise.all(n.map(e=>l[e]||d(e))).then(e=>(r(...e),o))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"15e44f2964c10d1a44ad0d0391de6213"},{url:"assets/index-JLEDB1oP.css",revision:null},{url:"assets/index-B2V8L6xx.js",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});