Skip to content

feat: show a local mode notice in Settings instead of account and billing panels - #59

Merged
codxbrexx merged 1 commit into
metacall:masterfrom
mohdTahaRafi:feat/settings-local-mode
Oct 28, 2026
Merged

codxbrexx merged 1 commit into
metacall:masterfrom
mohdTahaRafi:feat/settings-local-mode

Conversation

@mohdTahaRafi

@mohdTahaRafi mohdTahaRafi commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

In local mode (metacall launchpad) there's no account, but Settings still showed the email, CLI token, password form, VAT, billing and subscription panels. None of them work against a local FaaS: Refresh Token showed a raw HTML 404 page in the error banner, the password update always failed, and the email was the example@gmail.com placeholder.

Now, when isLocalMode() is true, Settings renders a new LocalModeSettings component instead. It shows the FaaS URL the dashboard is using (getBaseUrl()), explains that account, password, CLI token and billing settings are on the hosted dashboard, and links to dashboard.metacall.io. Settings also skips the listSubscriptions, inspect and listSubscriptionsDeploys calls in local mode.

The change in SettingsPage.tsx is small: an early return after all the hooks, and a guard in the fetch effect. The existing panels aren't touched, so the hosted dashboard looks exactly the same. isLocalMode() is only true when /__launchpad/config returns mode: "local", and that probe is skipped on dashboard.metacall.io.

I added four tests to settings_page_test.tsx. In local mode the notice and FaaS URL are shown, the account, security and billing panels are hidden, and no billing requests are made. A fourth test checks the panels still render outside local mode. The three local mode tests fail on master and pass with this change.

Test results: npm run unit passes (146/146), and lint, format:check, typecheck and build pass. npm run test (Playwright) is 96/97. The only failure is dashboard.spec.ts:96 ("three paid plan slot cards are rendered"), which also fails on a clean master and isn't related to this change.

How to test:

  1. Run npm ci.
  2. Run cd cli && npm ci && npm run build && node dist/index.js.
  3. Open http://localhost:9001/settings.

No login is needed in local mode. Before this change you get the full account page, and clicking Refresh Token shows the 404 page. After it you get the Local Mode card. With npm run dev:fast (not local mode) Settings is unchanged.

This covers the two Settings items under "Local Triad / Launchpad Support" in TODO.md. I didn't edit TODO.md, so you can tick them the way you prefer.

Fixes #58

Part of #28

Type of Change

  • fix: Bug fix (non-breaking change which fixes an issue)
  • feat: New feature (non-breaking change which adds functionality)
  • refactor: Code refactor (no functional changes, no API changes)
  • docs: Documentation update
  • test: Adding or updating tests
  • chore: Maintenance (CI, dependencies, tooling)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Screenshots / Recordings

Before After
Before: Settings displays account and billing panels in local mode After: Settings displays the Local Mode card

Checklist

  • I have linked the related issue above.
  • My code follows the coding standards of this project.
  • I have added tests that prove my fix is effective or my feature works.
  • Unit tests pass locally (npm run unit, 146/146).
  • No new lint warnings or errors (npm run lint).
  • Formatting, typecheck and build pass (format:check, typecheck and build).
  • All Playwright tests pass (npm run test). One pre-existing failure remains at dashboard.spec.ts:96; it also fails on a clean master and is unrelated to this change.
  • My PR title follows Conventional Commits (e.g., fix: resolve login redirect).

…ling panels

In local mode there is no account, and local FaaS has no refresh-token,
password or billing routes, so the Settings panels could only fail or show
placeholders. Render a LocalModeSettings card with the FaaS URL instead, and
skip the billing requests.
Copilot AI balanced review requested due to automatic review settings October 26, 2026 23:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@codxbrexx

Copy link
Copy Markdown
Collaborator

LGTM :)

@codxbrexx
codxbrexx merged commit e2bab25 into metacall:master Oct 28, 2026
1 check passed
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.

[FEATURE] Show a local mode notice in Settings instead of the account and billing panels

3 participants