Experiment to rebuild Diffuse using web applets.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: pilot theme + buckets loading from idb

+19 -18
+1 -1
src/pages/input/s3/_applet.astro
··· 334 334 335 335 async function loadBuckets() { 336 336 const i = await IDB.get(IDB_BUCKETS); 337 - return i; 337 + return i ? i : {}; 338 338 } 339 339 340 340 function parseURI(uriString: string): Bucket | undefined {
+16 -13
src/pages/orchestrator/single-queue/_applet.astro
··· 15 15 const context = applets.register<unknown>(); 16 16 17 17 // Applet connections 18 + const configurator = { 19 + input: await applet("../../configurator/input", { 20 + context: self.top || self.parent, 21 + }), 22 + }; 23 + 18 24 const engine = { 19 25 audio: await applet<AudioEngine.State>("../../engine/audio", { 20 26 context: self.top || self.parent, ··· 35 41 //////////////////////////////////////////// 36 42 context.setActionHandler("fill", fill); 37 43 38 - function fill() { 39 - // TODO: Need to translate the semi-permanent track uri 40 - // into a usable audio URL. 41 - engine.queue.sendAction( 42 - "add", 43 - orchestrator.output.data.tracks.collection.map((track: Track) => { 44 - return { 45 - expiresAt: Infinity, 46 - id: track.id, 47 - url: track.uri, 48 - }; 49 - }), 50 - ); 44 + async function fill() { 45 + const queueItems = orchestrator.output.data.tracks.collection.map(async (track: Track) => { 46 + return { 47 + expiresAt: Infinity, // TODO 48 + id: track.id, 49 + url: await configurator.input.sendAction("resolve", { method: "GET", uri: track.uri }), 50 + }; 51 + }); 52 + 53 + await engine.queue.sendAction("add", await Promise.all(queueItems)); 51 54 } 52 55 53 56 ////////////////////////////////////////////
+1 -4
src/scripts/themes/pilot/index.ts
··· 15 15 import type * as AudioUI from "@applets/themes/pilot/ui/audio/types.d.ts"; 16 16 17 17 const _configurator = { 18 + input: await applet("../../configurator/input"), 18 19 output: await applet("../../configurator/output"), 19 20 }; 20 21 21 22 const engine = { 22 23 audio: await applet<AudioEngine.State>("../../engine/audio"), 23 24 queue: await applet<QueueEngine.State>("../../engine/queue"), 24 - }; 25 - 26 - const input = { 27 - nativeFs: await applet("../../input/native-fs"), 28 25 }; 29 26 30 27 const _orchestrator = {
+1
src/styles/themes/pilot/index.css
··· 54 54 iframe[src*="/engine/"], 55 55 iframe[src*="/input/"], 56 56 iframe[src*="/orchestrator/"], 57 + iframe[src*="/processor/"], 57 58 iframe[src*="/output/"] { 58 59 height: 0; 59 60 left: 110vw;