diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-28 09:33:02 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-28 09:33:02 +0200 |
| commit | 2dd221b2a3172feecc44eb20b07d0ac7c925d378 (patch) | |
| tree | 707afe03768482cadb58b90c4bb24880229e5a24 | |
| parent | c170b9cffd2b8fb4b7ef919ee62c28d2daaa8711 (diff) | |
| download | meshbay-2dd221b2a3172feecc44eb20b07d0ac7c925d378.tar.gz | |
fix(hub): Explore page says nothing about public groups when they're off
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018gKJ85aZyvEwarXMFzFEwi
11 files changed, 20 insertions, 2 deletions
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`<div><p class="page-message">${t('explore.disabled')}</p></div>`; + } + return html` <div> <div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:16px"> @@ -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': '群组', |