feat(demo): per-folder media merge + AIUI seed-chats bootstrap
- Curated files loader now MERGES per top-level folder: dropping real files into demo/files/Music/ swaps only Music and keeps the sample Documents/Photos/Videos (verified). Media plays with the Range support already in place. - AIUI index.html: a ?seed bootstrap pre-loads the example "Content Showcase" conversation into AIUI's IndexedDB by calling the bundle's own seedPromptsToConversation() (identical to its /seed command), so the chat history isn't empty when the demo points users to "previous chats". Guarded by try/catch + an existence check; no-op without ?seed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
445f08a5c1
commit
7efebb4a8c
@@ -14,6 +14,31 @@
|
||||
<link rel="icon" href="/aiui/favicon.svg" type="image/svg+xml" />
|
||||
<link rel="apple-touch-icon" href="/aiui/apple-touch-icon-180x180.png" />
|
||||
<title>AIUI</title>
|
||||
<!-- Demo (?seed): pre-load the example "Content Showcase" conversation into
|
||||
AIUI's IndexedDB so the chat history isn't empty (live chat is disabled
|
||||
in the demo and points users to these previous chats). Mirrors the app's
|
||||
own /seed exactly by calling its seedPromptsToConversation(). -->
|
||||
<script type="module">
|
||||
(async () => {
|
||||
try {
|
||||
if (!new URLSearchParams(location.search).has('seed')) return;
|
||||
const db = await new Promise((res, rej) => {
|
||||
const r = indexedDB.open('aiui-store', 1);
|
||||
r.onupgradeneeded = (e) => { const d = e.target.result; if (!d.objectStoreNames.contains('conversations')) d.createObjectStore('conversations', { keyPath: 'id' }); };
|
||||
r.onsuccess = () => res(r.result); r.onerror = () => rej(r.error);
|
||||
});
|
||||
const exists = await new Promise((res) => {
|
||||
try { const q = db.transaction('conversations', 'readonly').objectStore('conversations').getKey('seed-all'); q.onsuccess = () => res(!!q.result); q.onerror = () => res(false); }
|
||||
catch { res(false); }
|
||||
});
|
||||
if (exists) return;
|
||||
const { seedPromptsToConversation } = await import('/aiui/assets/seedPrompts-CLWaUv28.js');
|
||||
const conv = seedPromptsToConversation();
|
||||
await new Promise((res, rej) => { const t = db.transaction('conversations', 'readwrite'); t.objectStore('conversations').put(conv); t.oncomplete = () => res(); t.onerror = () => rej(t.error); });
|
||||
try { localStorage.setItem('aiui-active-conversation', conv.id); } catch {}
|
||||
} catch (e) { console.warn('[demo] AIUI seed bootstrap failed', e); }
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/aiui/assets/index-Lh5NfTCq.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/aiui/assets/index-CHQ7uqBj.css">
|
||||
<link rel="manifest" href="/aiui/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/aiui/registerSW.js"></script></head>
|
||||
|
||||
Reference in New Issue
Block a user