Skip to content

fix: unify trial-mode API settings storage keys#15

Open
Anionex wants to merge 6 commits intoOpenDCAI:mainfrom
Anionex:fix/trial-api-settings-storage
Open

fix: unify trial-mode API settings storage keys#15
Anionex wants to merge 6 commits intoOpenDCAI:mainfrom
Anionex:fix/trial-api-settings-storage

Conversation

@Anionex
Copy link
Copy Markdown

@Anionex Anionex commented Mar 30, 2026

Summary

This fixes the trial-mode frontend bug where API settings could be saved successfully, but mind map generation still reported missing API URL / API Key.

Closes #14.

What changed

  • Updated frontend_zh/src/services/apiSettingsService.ts
  • Updated frontend_en/src/services/apiSettingsService.ts
  • Trial-mode storage now treats default, local, and global as the same logical settings bucket
  • Reads try all trial-mode aliases
  • Saves write through all trial-mode aliases for backward compatibility

Why this fixes it

Different parts of the frontend were using different trial-mode user IDs:

  • Settings modal: default
  • Dashboard: local
  • Some NotebookView actions: null -> global

That produced inconsistent localStorage keys under kb_api_settings_*.

Verification

Manual/code verification:

  • Confirmed the upstream bug still exists on latest origin/main (025f398)
  • Verified diff only touches the two API settings service files
  • Ran git diff --check successfully

Build/test status:

  • frontend_zh: npm run build currently fails because tsc prints help instead of compiling in the existing repo environment
  • frontend_en: npm run build currently fails because tsc is not available in the existing repo environment
  • No repo-level frontend test harness is currently configured for this area, so I did not add a new test framework in this bugfix PR

Risk

Low. The change is isolated to trial-mode localStorage key resolution and keeps existing saved values compatible.

Anionex added 6 commits March 30, 2026 22:15
Combine analyze_structure + generate_mermaid into one LLM call that
directly outputs Markdown. Uses a detailed knowledge-map prompt that
adapts to article type, producing structured nodes instead of bare titles.
- Replace mermaid with simple-mind-map in both frontends
- Add mermaidToMarkdown/markdownToMermaid converters for format compat
- Add TypeScript declarations for simple-mind-map
- New MindMapPreview component using simple-mind-map with:
  expand/collapse all, zoom/pan/fit, node expand/collapse buttons,
  PNG/TXT/Mermaid export, click-to-ask popover with contextual questions
- Wire onNodeClick to close modal, switch to chat, and focus input
- Fix preview modal missing rounded corners and backdrop blur
- Delete old MermaidPreview component
Let the LLM adapt depth to content complexity instead of enforcing
a fixed max_depth. The prompt structure already guides appropriate
depth through its description of 4 hierarchy levels.
- max_depth default to 6, layer depth driven by content complexity
- Remove example-heavy data instructions, keep core rule concise
- Hide modal download button for mindmap type (component has its own exports)
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.

Trial mode API settings are saved/read under inconsistent localStorage keys

1 participant