Skip to content

fix(portal): restore file parent folder after search preview back (IK5KDG) - #2255

Closed
likaiaki wants to merge 3 commits into
feat/2.5.0-sgfrom
fix/IK5KDG-search-back-nav
Closed

fix(portal): restore file parent folder after search preview back (IK5KDG)#2255
likaiaki wants to merge 3 commits into
feat/2.5.0-sgfrom
fix/IK5KDG-search-back-nav

Conversation

@likaiaki

@likaiaki likaiaki commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • When a user opens a file from in-space search results and clicks「返回文件列表」, navigate to the file's parent folder list instead of staying on the wrong root or stale folder view.
  • Added regression test covering search → preview → back for a file inside a subfolder.

Test plan

  • npx jest src/pages/knowledge/portal/PortalKnowledgeWorkbench.test.tsx -t "returns from search preview" --no-watchman --coverage=false
  • npx jest src/pages/knowledge/portal/PortalKnowledgeWorkbench.test.tsx -t "deep-link open with folderId returns" --no-watchman --coverage=false
  • Manual: search in knowledge portal → open matched file in subfolder → back → verify parent folder file list

Gitee

  • Issue: IK5KDG
  • State: unchanged (per team policy)

Made with Cursor

…5KDG)

When opening a file from in-space search results, returning to the list
now navigates to the file's parent folder instead of leaving the user on
the wrong root or stale folder view.

Co-authored-by: Cursor <cursoragent@cursor.com>
likaiaki and others added 2 commits August 4, 2026 18:27
Sidebar global search never set searchMode, so back stayed on 我的收藏.
Track return space/parent, emit parent_id from file_level_path, and switch
away from favorites into the file's containing folder.

Co-authored-by: Cursor <cursoragent@cursor.com>
…5KDG)

usePortalSpaces was bouncing activeSpace back to 我的收藏 when the target
space was briefly missing from sidebar lists. Preserve the return target
and navigate to the parent folder after the space switch settles.

Co-authored-by: Cursor <cursoragent@cursor.com>
@likaiaki likaiaki closed this Aug 14, 2026
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.

1 participant