Skip to content

fix(sidebar): preserve the list view when opening a session from search - #5258

Merged
liruifengv merged 2 commits into
mainfrom
fix/preserve-sidebar-view-on-session-search
Nov 23, 2026
Merged

liruifengv merged 2 commits into
mainfrom
fix/preserve-sidebar-view-on-session-search

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

Requirement or Bug

Opening an unpinned session from search in the web or desktop sidebar changed Flat list to Group by project. The change was saved, so refreshing the page did not restore the user's choice.

Bug Reproduction Steps

  1. Set the sidebar to List options → Flat list.
  2. Search for an unpinned session in an unpinned project and open the session result (not the project result).
  3. Check the sidebar immediately and after refreshing. It should still use Flat list.

Root Cause

After opening the session, the sidebar tried to reveal its row by calling the same setter used for an explicit view change. That setter switched the layout and saved it. The flat rows also lacked the session ID used by the row locator.

Code Changes

SessionListPanel now looks for the row in the selected layout rather than changing the layout to find it. Flat rows use the existing scroll and highlight behavior. When the result is outside the rendered page, the session still opens, but the sidebar does not load intervening pages. Selecting a project search result still uses the separate project locator.

Screenshots / Recordings

No browser capture. The component regression tests check the saved preference, which row scrolls and highlights, and whether another page was requested.

Behavior Changes and Affected Users

Scenario Before After Who relies on the old behavior Alternative
Flat list, result on the current page Switched to grouped view and saved it Scrolls to and highlights the flat row; keeps the preference and project fold state Web and desktop users who used search to reveal the project Choose Group by project in List options
Flat list, result outside the current page Switched views to locate the session in its project Opens the session without paging or scrolling to an unrelated row Users finding older sessions through search Use Load more or switch to grouped view
Grouped view or a pinned result Expanded the containing project or pinned section Still reveals the containing project or pinned section; only an actual pinned match opens the pinned section Users navigating grouped or pinned sessions No action needed
Verification
  • sessionListPanelRerender.test.ts and searchSessionsDialogCaps.test.ts: 23 tests passed. Both new flat-list cases failed before the fix because the saved mode became grouped.
  • Renderer type check and lint of the changed source/test passed. The broader desktop type check was blocked locally by unresolved pathe and yaml dependencies outside the changed files. Full lint and browser E2E were not run locally.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (reported directly; no linked issue).
  • I have added tests that prove the fix works.
  • The behavior changes and the alternative for users who want grouped navigation are described above.
  • Added a kimi-code-app patch changeset.
  • No user guide update needed: the existing view option and search controls are unchanged.

@changeset-bot

changeset-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 42f3d3a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kimi-code-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T06:28:15.518142Z 42f3d3a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Nov 23, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@d1d6890
npx https://pkg.pr.new/@moonshot-ai/kimi-code@d1d6890

commit: d1d6890

@liruifengv
liruifengv merged commit 972e750 into main Nov 23, 2026
19 of 42 checks passed
@liruifengv
liruifengv deleted the fix/preserve-sidebar-view-on-session-search branch November 23, 2026 07:29
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 24, 2026
Record MoonshotAI#5247 ported and MoonshotAI#5258, MoonshotAI#5259 and MoonshotAI#5266 equivalent to the fork's
own sidebar, composer and tool-duration implementations, each with an
executable probe.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 26, 2026
Port upstream 972e750 (MoonshotAI#5258): locateSession keeps the flat or grouped view instead of replacing it, scrolls to the rendered row, and flashes it. The upstream regression test covers flat, grouped, off-page and pinned cases.

The ledger row was marked equivalent with a probe aimed at the desktop Sidebar; the shared app-components component was still at the pre-image. Replace the probe with se-locate-flash in SessionListPanel.vue and mark the row ported.

Verified: app-components sessionListPanelRerender 20 pass (4 new cases); check:no-comments clean.
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