Skip to content

fix(router): default landing follows site.features order, not hardcoded chatgpt-first#462

Merged
Germey merged 2 commits intomainfrom
fix/default-route-respect-site-feature-order
Apr 26, 2026
Merged

fix(router): default landing follows site.features order, not hardcoded chatgpt-first#462
Germey merged 2 commits intomainfrom
fix/default-route-respect-site-feature-order

Conversation

@acedatacloud-dev
Copy link
Copy Markdown
Member

Problem

https://hub.acedata.cloud/ (and every other Nexior site) was forcibly redirected to /chatgpt/conversation/new, regardless of how the site operator configured features on the platform side.

The bug lives in src/router/index.ts (introduced in #458): getDefaultRoute() iterates a hardcoded FEATURE_ROUTE_ORDER whose first entry is always chatgpt. Since chatgpt is enabled on essentially every site, the loop always picks ChatGPT and operators have no way to change the landing page.

Fix

Walk store.state.site.features in the order the platform API returned them (Python dict + JSON preserve insertion order) and pick the first enabled: true key that maps to a known landing route.

For hub.acedata.cloud whose feature insertion order is veo, wan, chat, flux, grok, ..., new visitors will now land on /veo — the operator-intended first feature — instead of /chatgpt/conversation/new. Operators who want ChatGPT first just need to put chatgpt first in the site's features map.

If a site has no recognised landing feature at all, we still fall back to chatgpt-conversation-new, so behaviour is identical for any pathological config.

src/router/index.ts | 90 ++++++++++++++++-----------------------------
1 file changed, 36 insertions(+), 54 deletions(-)

No template/HTML/store changes; only the redirect resolver.

… not chatgpt-first

PR #458 added getDefaultRoute() which iterates a hardcoded
FEATURE_ROUTE_ORDER (chatgpt, deepseek, grok, ...). Because
chatgpt is the first entry and is enabled on basically every
site, every visitor to '/' was forcibly redirected to
/chatgpt/conversation/new — operators couldn't change the
landing page even by reordering or disabling features.

This change walks site.features in the order the API returned
them (Python dict insertion order is preserved in JSON) and
picks the first enabled key that maps to a known landing route.
On hub.acedata.cloud, where features start with veo, wan, chat,
flux, grok, ..., new visitors will now land on /veo (the
operator-intended first feature) instead of /chatgpt/conversation/new.

If a site config has no recognised landing feature, we still
fall back to chatgpt-conversation-new as before.
…s to actual path

The bigger half of the bug: getDefaultRoute() returned a bare string
like 'chatgpt-conversation-new', which is a vue-router route NAME
(maps to path '/chatgpt/conversations'). When vue-router sees a bare
string in 'redirect', it treats it as a PATH, so the browser was sent
to the literal URL '/chatgpt-conversation-new' which matches no route
and rendered an empty layout.

Returning { name } makes vue-router resolve the actual registered path.
@acedatacloud-dev
Copy link
Copy Markdown
Member Author

Pushed b80a65a — fixes the bigger half of the bug.

getDefaultRoute() was returning a bare string like 'chatgpt-conversation-new'. That string is the vue-router route name (whose actual path is /chatgpt/conversations), but redirect treats a bare string as a path, so visitors were being sent to the literal URL /chatgpt-conversation-new — which matches no registered route and rendered an empty layout. That's the exact symptom the original report described.

Now returns { name }, and vue-router resolves it to the real path.

@Germey Germey enabled auto-merge (squash) April 26, 2026 17:06
@Germey Germey disabled auto-merge April 26, 2026 17:06
@Germey Germey merged commit efd2351 into main Apr 26, 2026
1 check passed
@Germey Germey deleted the fix/default-route-respect-site-feature-order branch April 26, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants