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 ++++++++++-- packages/meshbay-hub/src/meshbay_hub/static/locales/de.js | 1 + packages/meshbay-hub/src/meshbay_hub/static/locales/en.js | 1 + packages/meshbay-hub/src/meshbay_hub/static/locales/es.js | 1 + packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js | 1 + packages/meshbay-hub/src/meshbay_hub/static/locales/it.js | 1 + packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js | 1 + packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js | 1 + packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js | 1 + packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js | 1 + packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js | 1 + 11 files changed, 20 insertions(+), 2 deletions(-) (limited to 'packages') 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} diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js index dae16a1..f8daa16 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js @@ -71,6 +71,7 @@ export default { 'explore.create_group': 'Gruppe erstellen', 'explore.join': 'Beitreten', 'explore.member': 'Beigetreten', + 'explore.disabled': "This hub does not have public groups.", // Group page 'group.default_name': 'Gruppe', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js index 6f12810..7cb3769 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js @@ -72,6 +72,7 @@ export default { 'explore.create_group': 'Create group', 'explore.join': 'Join', 'explore.member': 'Joined', + 'explore.disabled': "This hub does not have public groups.", // Group page 'group.default_name': 'Group', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js index 0e51ede..ba64ee0 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js @@ -69,6 +69,7 @@ export default { 'explore.create_group': 'Crear un grupo', 'explore.join': 'Unirse', 'explore.member': 'Miembro', + 'explore.disabled': "This hub does not have public groups.", // Group page 'group.default_name': 'Grupo', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js index ccfc709..60e56c9 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js @@ -70,6 +70,7 @@ export default { 'explore.create_group': 'Créer un groupe', 'explore.join': 'Rejoindre', 'explore.member': 'Membre', + 'explore.disabled': "Ce hub n'a pas de groupes publics.", // Group page 'group.default_name': 'Groupe', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js index 1220090..ccf54ed 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js @@ -70,6 +70,7 @@ export default { 'explore.create_group': 'Crea un gruppo', 'explore.join': 'Partecipa', 'explore.member': 'Iscritto', + 'explore.disabled': "This hub does not have public groups.", // Group page 'group.default_name': 'Gruppo', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js index f80f5d7..2ea90cb 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js @@ -68,6 +68,7 @@ export default { 'explore.create_group': 'グループを作成', 'explore.join': '参加', 'explore.member': '参加済み', + 'explore.disabled': "This hub does not have public groups.", // Group page 'group.default_name': 'グループ', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js index ddd62c2..4b7ff12 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js @@ -71,6 +71,7 @@ export default { 'explore.create_group': 'Groep aanmaken', 'explore.join': 'Deelnemen', 'explore.member': 'Lid', + 'explore.disabled': "This hub does not have public groups.", // Group page 'group.default_name': 'Groep', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js index c4a3c32..611c412 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js @@ -75,6 +75,7 @@ export default { 'explore.create_group': 'Utwórz grupę', 'explore.join': 'Dołącz', 'explore.member': 'Należy', + 'explore.disabled': "This hub does not have public groups.", // Group page 'group.default_name': 'Grupa', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js index 868ad30..74e5047 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js @@ -71,6 +71,7 @@ export default { 'explore.create_group': 'Criar um grupo', 'explore.join': 'Participar', 'explore.member': 'Participando', + 'explore.disabled': "This hub does not have public groups.", // Group page 'group.default_name': 'Grupo', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js index f019130..d2e6b48 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js @@ -68,6 +68,7 @@ export default { 'explore.create_group': '创建群组', 'explore.join': '加入', 'explore.member': '已加入', + 'explore.disabled': "This hub does not have public groups.", // Group page 'group.default_name': '群组', -- cgit v1.2.3