From 2dd221b2a3172feecc44eb20b07d0ac7c925d378 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 28 Aug 2026 09:33:02 +0200 Subject: fix(hub): Explore page says nothing about public groups when they're off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the hub has public groups disabled, /explore showed an empty "Public Groups" screen with a search box and a Create button that do nothing. It now renders a single line — "This hub does not have public groups." — and the server already returns an empty directory regardless. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_018gKJ85aZyvEwarXMFzFEwi --- packages/meshbay-hub/src/meshbay_hub/static/app.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'packages/meshbay-hub/src/meshbay_hub/static/app.js') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/app.js b/packages/meshbay-hub/src/meshbay_hub/static/app.js index a380033..9164a4d 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/app.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/app.js @@ -629,7 +629,7 @@ function HomePage({ groups, notifications, onMarkRead, onPurge }) { // ── Explore Page ───────────────────────────────────────────────────────────── -function ExplorePage({ token, myGroupIds }) { +function ExplorePage({ token, myGroupIds, allowPublicGroups = true }) { const [groups, setGroups] = useState([]); const [loading, setLoading] = useState(true); const [search, setSearch] = useState(''); @@ -671,6 +671,13 @@ function ExplorePage({ token, myGroupIds }) { const isMember = (gid) => myGroupIds && myGroupIds.includes(gid); + // The hub can switch public groups off instance-wide (the server already + // returns nothing here). Say so plainly rather than showing an empty + // "Public groups" screen — nothing on this page has anything to do. + if (!allowPublicGroups) { + return html`

${t('explore.disabled')}

`; + } + return html`
@@ -3270,7 +3277,8 @@ function App() { page = html`<${SearchPage} />`; } else if (route === '/explore') { page = html`<${ExplorePage} token=${user.token} - myGroupIds=${groups.map(g => g.id)} />`; + myGroupIds=${groups.map(g => g.id)} + allowPublicGroups=${allowPublicGroups} />`; } else if (route === '/create-group') { page = html`<${CreateGroupPage} token=${user.token} username=${user.username} allowPublicGroups=${allowPublicGroups} -- cgit v1.2.3