-
Notifications
You must be signed in to change notification settings - Fork 13
Trial mode API settings are saved/read under inconsistent localStorage keys #14
Description
Summary
In trial mode (no logged-in user), saving API settings in the frontend can succeed visually, but generating a mind map still shows:
请先在设置中配置 API URL 和 API Key
I confirmed this on the latest upstream origin/main as of 2026-03-30:
- commit:
025f39828dade791d527e8dd3e9db6df1e84b49f
Reproduction
- Start the app in trial mode (Supabase not configured / not logged in).
- Open Settings and save
API URL+API Key. - Go to a notebook, select files, click Generate Mind Map.
- The UI still warns that API settings are missing.
Expected
The saved API settings should be reused consistently across Dashboard, Settings modal, and NotebookView actions in trial mode.
Actual
Different parts of the frontend read/write different localStorage keys for trial-mode users, so the config is effectively "saved" in one place and "missing" in another.
Root Cause
The trial-mode user identity is inconsistent across pages/components:
- Settings modal uses
default - Dashboard uses
local - Some generation paths use
null->global
That leads to inconsistent storage keys under kb_api_settings_*.
Relevant code paths:
frontend_zh/src/components/SettingsModal.tsxfrontend_zh/src/pages/Dashboard.tsxfrontend_zh/src/pages/NotebookView.tsx- same pattern also exists in
frontend_en/
Suggested Fix
Unify trial-mode settings storage so default / local / global resolve to the same logical settings bucket, or standardize all trial-mode callers on a single key.
Impact
- Mind map generation in trial mode
- Other features that require frontend-stored API settings may also be affected
- Both Chinese and English frontends appear affected