fix: unify trial-mode API settings storage keys#15
Open
Anionex wants to merge 6 commits intoOpenDCAI:mainfrom
Open
fix: unify trial-mode API settings storage keys#15Anionex wants to merge 6 commits intoOpenDCAI:mainfrom
Anionex wants to merge 6 commits intoOpenDCAI:mainfrom
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
frontend_zh/src/services/apiSettingsService.tsfrontend_en/src/services/apiSettingsService.tsdefault,local, andglobalas the same logical settings bucketWhy this fixes it
Different parts of the frontend were using different trial-mode user IDs:
defaultlocalnull->globalThat produced inconsistent localStorage keys under
kb_api_settings_*.Verification
Manual/code verification:
origin/main(025f398)git diff --checksuccessfullyBuild/test status:
frontend_zh:npm run buildcurrently fails becausetscprints help instead of compiling in the existing repo environmentfrontend_en:npm run buildcurrently fails becausetscis not available in the existing repo environmentRisk
Low. The change is isolated to trial-mode localStorage key resolution and keeps existing saved values compatible.