[PR #79] [MERGED] fix: sync sidebar tab and folder with active chat selection #4446

Closed
opened 2026-10-22 04:07:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/79
Author: @coxde
Created: 4/9/2026
Status: ✅ Merged
Merged: 4/9/2026
Merged by: @coxde

Base: main ← Head: fix/sync-sidebar


📝 Commits (1)

  • 8ca4330 fix: sync sidebar tab and folder with active chat selection

📊 Changes

1 file changed (+80 additions, -0 deletions)

View changed files

📝 packages/client/src/components/layout/ChatSidebar.tsx (+80 -0)

📄 Description

This pull request enhances the ChatSidebar component to ensure the sidebar's tab, folder, and scroll position automatically sync with the currently active chat.

  • Added a useEffect in ChatSidebar to automatically synchronize the sidebar's active tab, folder expansion, and scroll position with the currently active chat, handling edge cases like late folder loading and navigation from notifications or imports.
  • Introduced syncRef and internalNavRef to track synchronization state and distinguish between internal and external navigation, ensuring the search filter is only cleared when appropriate.
  • Updated chat row rendering to include data-chat-id and set internalNavRef on sidebar clicks, preventing the search query from being cleared when navigating via the sidebar.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/79 **Author:** [@coxde](https://github.com/coxde) **Created:** 4/9/2026 **Status:** ✅ Merged **Merged:** 4/9/2026 **Merged by:** [@coxde](https://github.com/coxde) **Base:** `main` ← **Head:** `fix/sync-sidebar` --- ### 📝 Commits (1) - [`8ca4330`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8ca4330eec727fb81ef315fd37ed7ac2df68a5a0) fix: sync sidebar tab and folder with active chat selection ### 📊 Changes **1 file changed** (+80 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/layout/ChatSidebar.tsx` (+80 -0) </details> ### 📄 Description This pull request enhances the `ChatSidebar` component to ensure the sidebar's tab, folder, and scroll position automatically sync with the currently active chat. * Added a `useEffect` in `ChatSidebar` to automatically synchronize the sidebar's active tab, folder expansion, and scroll position with the currently active chat, handling edge cases like late folder loading and navigation from notifications or imports. * Introduced `syncRef` and `internalNavRef` to track synchronization state and distinguish between internal and external navigation, ensuring the search filter is only cleared when appropriate. * Updated chat row rendering to include `data-chat-id` and set `internalNavRef` on sidebar clicks, preventing the search query from being cleared when navigating via the sidebar. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:07:40 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4446
No description provided.