From 2a076dfb1d1471474063ab46a801016ba3f0ff3b Mon Sep 17 00:00:00 2001 From: you Date: Fri, 20 Mar 2026 06:51:54 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20shareable=20URLs=20for=20channels=20?= =?UTF-8?q?=E2=80=94=20update=20URL=20on=20selection,=20accept=20route=20p?= =?UTF-8?q?aram?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - selectChannel updates URL to #/channels/ - init accepts routeParam and auto-selects channel - Search results use new URL format instead of ?ch= query param --- public/app.js | 2 +- public/channels.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/public/app.js b/public/app.js index f58cf8fe..5f8eeded 100644 --- a/public/app.js +++ b/public/app.js @@ -464,7 +464,7 @@ window.addEventListener('DOMContentLoaded', () => { const chList = Array.isArray(channels) ? channels : []; for (const c of chList) { if (c.name && c.name.toLowerCase().includes(q.toLowerCase())) { - html += `
+ html += `
Channel${c.name}
`; } } diff --git a/public/channels.js b/public/channels.js index 5731a9d8..ad3fc0e3 100644 --- a/public/channels.js +++ b/public/channels.js @@ -211,7 +211,7 @@ }); } - function init(app) { + function init(app, routeParam) { app.innerHTML = `
@@ -235,7 +235,9 @@
`; - loadChannels(); + loadChannels().then(() => { + if (routeParam) selectChannel(routeParam); + }); // #89: Sidebar resize handle (function () { @@ -438,6 +440,7 @@ async function selectChannel(hash) { selectedHash = hash; + history.replaceState(null, '', `#/channels/${hash}`); renderChannelList(); const ch = channels.find(c => c.hash === hash); const name = ch?.name || `Channel ${hash}`;