fix: preserve wiki folder path after creation - #2429
Merged
Conversation
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.
Description
修复 Wiki 前端新建目录后跳回根目录的问题。
问题现象
用户在 Wiki 的多级目录中创建子目录并确认后,目录树会重新初始化,导致当前路径被折叠,侧边栏不会停留在当前界面,会跳回根目录。
根因
创建目录成功后会重新加载目录树。原有刷新逻辑会清空目录的展开、折叠和用户访问状态。
虽然创建逻辑曾尝试保持父目录展开,但这个状态随后又被刷新逻辑清除。并且目录接口按层级返回直接子目录,刷新根目录后还需要逐层重新加载原来展开的深层路径。
修改内容
Type of Change
Related Issue
N/A
Testing
在 Podman Linux、Node.js 24 环境中完成以下验证:
npm run type-check:通过。npm run build:通过;构建时使用NODE_OPTIONS=--max-old-space-size=4096。git diff --check:通过。覆盖的主要场景:
Checklist
make fmt && make lint && make testpass locallydocs/, Swagger annotations, etc.)Screenshots / Recordings
N/A — behavior-only fix; no visual layout changes.