From 5c25e5a4f42f2eb05c525a284cd584786324b6e1 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Tue, 1 Sep 2026 15:18:27 +0200 Subject: fix(hub): adjust no-group prompt and post-create wizard step No-group home/explore message: when the hub offers no public groups, drop the "browse public groups" invitation and just ask to be invited by an admin. New home.invite_only key added to all ten catalogues. Create-group wizard done step: reword the message to point at inviting members, and send the button to the group's Settings tab (where the invite form lives) instead of a stale /groups/ path that never matched the router. The landing tab is a one-shot session hint, so the usual per-user default-tab preference is left untouched. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01QNPfgH6VWcRzJDZGuzy1jJ --- .../src/meshbay_hub/static/group-page.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'packages/meshbay-hub/src/meshbay_hub/static/group-page.js') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js index d7c81ad..6b9c82a 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js @@ -35,8 +35,25 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs, const [descDraft, setDescDraft] = useState(''); const [savingDesc, setSavingDesc] = useState(false); const defaultTab = (userPrefs && (userPrefs[`default_tab:${groupId}`] || userPrefs['default_tab'])) || 'chat'; - const [tab, setTab] = useState(defaultTab); - useEffect(() => { setTab(defaultTab); }, [groupId]); + // The create-group wizard can request a one-shot landing tab (Settings, where + // the invite form is) via session.openGroupTab. It applies once, only to the + // group it names, and never touches the user's default-tab preference — every + // other way into a group still lands on that preference, or 'chat'. + const consumeTabOverride = useCallback(() => { + const o = session.openGroupTab; + if (o && o.groupId === groupId) { session.openGroupTab = null; return o.tab; } + return null; + }, [groupId]); + const [tab, setTab] = useState(() => consumeTabOverride() || defaultTab); + // GroupPage is not remounted when switching groups (see the refreshedRef note + // below), so react to a real groupId change here — but not to the initial + // mount, where useState already picked the right tab. + const tabGroupRef = useRef(groupId); + useEffect(() => { + if (tabGroupRef.current === groupId) return; + tabGroupRef.current = groupId; + setTab(consumeTabOverride() || defaultTab); + }, [groupId]); const [groupMuted, setGroupMuted] = useState(() => !!(group && group.muted)); const _lastTouch = useRef(0); -- cgit v1.2.3