fix(self-host): show "Check rankings" action for self-hosted instances - #201
fix(self-host): show "Check rankings" action for self-hosted instances#201gortazar wants to merge 1 commit into
Conversation
RankTrackingDomainDetail computed isFreePlan by calling autumn-js's useCustomer() directly, with no awareness of self-hosted/local_noauth mode. Since self-hosted instances have no billing customer, this always resolved to "free plan", and ToolbarMenus' MoreMenu doesn't just disable the "Check rankings" item when checkDisabled is true — it omits it from the DOM entirely. So the action to manually trigger a rank check was invisible on every self-hosted instance. The server-side triggerRankTrackingCheck function already exempts self-hosted mode from this same plan check (`isHosted && !hasPaidPlan`), so self-hosted users could already run checks — they just had no way to reach the action. Switch to HostedPlanGate, the render-prop component two other pages (PromptExplorerPage, BrandLookupPage) already use for this exact purpose: it short-circuits to isFreePlan: false without touching Autumn at all when isHostedClientAuthMode() is false, and only defers to the real billing check in hosted mode. Verified with `pnpm run types:check` and `pnpm run lint` (both clean), and against a real self-hosted Docker instance: rebuilt the image from this branch, recreated the running container in place (existing D1 data untouched), and confirmed the "Check rankings" menu item now appears.
There was a problem hiding this comment.
Pull request overview
Fixes a self-hosted UI regression where the “Check rankings” action was hidden because the page incorrectly inferred a “free plan” when no billing customer exists in local_noauth / self-hosted mode.
Changes:
- Replaces direct
autumn-jscustomer/session plan detection withHostedPlanGateto correctly treat self-hosted as non-free for gating purposes. - Refactors the component into a small wrapper (
RankTrackingDomainDetail) plus an inner implementation (RankTrackingDomainDetailInner) that consumesHostedPlanGateState.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Hey, Thanks for contributing! For the next few months, I'm going to stop accepting external PRs. Reviewing and testing them has been slowing down progress against our roadmap: Contributing through Issues Here is our updated contributing guide: https://github.com/every-app/open-seo/blob/main/docs/CONTRIBUTING.md Converting, this PR to an issue would be the best way to get it prioritized. You can use the the |
Summary
RankTrackingDomainDetail.tsxcomputedisFreePlanby callingautumn-js'suseCustomer()directly, with no awareness of self-hosted/local_noauthmode. Since self-hosted instances have no billing customer, this always resolved to "free plan" — andToolbarMenus.tsx'sMoreMenudoesn't just disable the "Check rankings" item whencheckDisabledis true, it omits it from the DOM entirely. So the action to manually trigger a rank check was invisible on every self-hosted instance.triggerRankTrackingCheckfunction already exempts self-hosted mode from this same plan check (isHosted && !hasPaidPlan), so self-hosted users could already run checks server-side — they just had no UI path to reach the action.HostedPlanGate, the render-prop component two other pages (PromptExplorerPage,BrandLookupPage) already use for this exact purpose: it short-circuits toisFreePlan: falsewithout touching Autumn at all whenisHostedClientAuthMode()is false, and only defers to the real billing check in hosted mode.Test plan
pnpm run types:check— clean.pnpm run lint— clean, 0 warnings/errors.🤖 Generated with Claude Code