diff --git a/config/instance-config.js b/config/instance-config.js index f2820bda..e61ef92d 100644 --- a/config/instance-config.js +++ b/config/instance-config.js @@ -108,7 +108,7 @@ export const COMMUNITY_URL = "https://groups.nip29.com/?relay=wss://relay.groups * string) to hide the link entirely. */ export const NOSTR_URL = - "https://primal.net/p/npub13yarr7j6vjqjjkahd63dmr27curypehx45ucue286ac7sft27y0srnpmpe"; + "https://nostrudel.ninja/u/npub13yarr7j6vjqjjkahd63dmr27curypehx45ucue286ac7sft27y0srnpmpe"; /** * Optional external destination for the GitHub menu link. diff --git a/js/docsView.js b/js/docsView.js index 7c0366ec..59a37fc9 100644 --- a/js/docsView.js +++ b/js/docsView.js @@ -105,21 +105,35 @@ function buildLink(item) { return link; } +function getChevronIcon(expanded) { + if (expanded) { + // Chevron Down + return ` + + `; + } + // Chevron Right + return ` + + `; +} + function buildToggleButton(item, controlsId, expanded, groupList) { const button = document.createElement("button"); button.type = "button"; - button.className = "btn-ghost btn-xs"; + button.className = "btn-ghost btn-xs btn-square text-muted hover:text-text-primary"; button.setAttribute("aria-expanded", expanded ? "true" : "false"); button.setAttribute("aria-controls", controlsId); button.setAttribute("aria-label", `Toggle ${item.title || item.slug} section`); - button.textContent = expanded ? "Hide" : "Show"; + button.innerHTML = getChevronIcon(expanded); button.addEventListener("click", () => { const isExpanded = button.getAttribute("aria-expanded") === "true"; const nextExpanded = !isExpanded; button.setAttribute("aria-expanded", nextExpanded ? "true" : "false"); - button.textContent = nextExpanded ? "Hide" : "Show"; + button.innerHTML = getChevronIcon(nextExpanded); if (groupList) { groupList.hidden = !nextExpanded; + groupList.classList.toggle("hidden", !nextExpanded); } }); return button; @@ -152,6 +166,9 @@ function renderTocItems(items, container, level = 0, groupPrefix = "docs-toc") { childList.id = groupId; childList.classList.add("ml-md", "border-l", "border-border", "pl-md"); childList.hidden = !expanded; + if (!expanded) { + childList.classList.add("hidden"); + } const toggle = buildToggleButton(item, groupId, expanded, childList); row.appendChild(toggle); @@ -220,8 +237,9 @@ function updateActiveToc(slug) { groups.forEach((group) => { if (group?.button && group?.list) { group.button.setAttribute("aria-expanded", "true"); - group.button.textContent = "Hide"; + group.button.innerHTML = getChevronIcon(true); group.list.hidden = false; + group.list.classList.remove("hidden"); } }); } diff --git a/package-lock.json b/package-lock.json index 1dcbd861..5c341aa4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "GPL-3.0-or-later", "dependencies": { "@floating-ui/dom": "^1.7.4", + "@noble/hashes": "^2.0.1", "highlight.js": "^11.11.1", "jsdom": "^27.4.0", "marked": "^17.0.1", diff --git a/package.json b/package.json index 655e4702..aa0a146c 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "license": "GPL-3.0-or-later", "dependencies": { "@floating-ui/dom": "^1.7.4", + "@noble/hashes": "^2.0.1", "highlight.js": "^11.11.1", "jsdom": "^27.4.0", "marked": "^17.0.1", diff --git a/tests/ui/video-list-view-popular-tags.test.mjs b/tests/ui/video-list-view-popular-tags.test.mjs index 5d07834e..e2f98a68 100644 --- a/tests/ui/video-list-view-popular-tags.test.mjs +++ b/tests/ui/video-list-view-popular-tags.test.mjs @@ -76,7 +76,7 @@ test("VideoListView renders sorted popular tag pills", () => { assert.equal(buttons.length, 3); assert.deepEqual( Array.from(buttons, (button) => button.dataset.tag), - ["Nostr", "Video", "Learning"], + ["#Nostr", "#Video", "#Learning"], ); }); @@ -90,7 +90,7 @@ test("VideoListView applies tag preference variants to popular tags", () => { view.mount(listRoot); view.setPopularTagsContainer(tagsRoot); view.setTagPreferenceStateResolver((tag) => - tag === "Nostr" ? "interest" : tag === "Video" ? "disinterest" : "neutral", + tag === "#Nostr" ? "interest" : tag === "#Video" ? "disinterest" : "neutral", ); const videos = [ diff --git a/views/docs.html b/views/docs.html index 8ed33524..21197b7a 100644 --- a/views/docs.html +++ b/views/docs.html @@ -19,12 +19,26 @@