[PR #1176] [MERGED] Fix branch sidebar representative #4959

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1176
Author: @cha1latte
Created: 5/24/2026
Status: ✅ Merged
Merged: 5/24/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1135-branch-sidebar


📝 Commits (1)

  • 9c63c85 Fix branch sidebar representative

📊 Changes

3 files changed (+27 additions, -6 deletions)

View changed files

➕ docs/pr-evidence/issue-1135/after-return.png (+0 -0)
➕ docs/pr-evidence/issue-1135/before-return.png (+0 -0)
📝 src/app/shell/ChatSidebar.tsx (+27 -6)

📄 Description

Linked issue

Closes #1135

Why this change

  • Switching branches in a grouped roleplay updated the active chat, but the collapsed chats sidebar row kept using the first sorted branch as its visible and clickable representative. That made the sidebar show the stale branch name and caused returning from another roleplay to reopen the wrong branch.

What changed

  • Remember the last active branch per grouped chat in ChatSidebar.
  • Use the active or remembered branch as the collapsed sidebar representative when it still matches the current sidebar filter.
  • Preserve normal search/filter behavior by falling back to the matching filtered branch if the remembered branch is filtered out.
  • Added scoped PR evidence screenshots for the before/after UI proof.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Codex reproduced the bug with node scratch\issue-1135-branch-sidebar-repro.mjs: before the fix, switching to Roleplay A - Branch 4 left the sidebar on Roleplay A - Branch 1, and clicking away/back selected rp-a-1.
  • Codex verified the fix with node scratch\issue-1135-branch-sidebar-repro.mjs --after --edge-search: after switching to Roleplay A - Branch 4, the sidebar showed Branch 4 and clicking away/back selected rp-a-4.
  • Edge case verified: after switching to Branch 4, searching for Branch 1 still showed the matching Branch 1 row rather than forcing the remembered Branch 4.
  • pnpm check passed locally after the final code change.
  • No manual verification is required for the core claim.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

No docs, release metadata, schema, dependency, storage, auth, or prompt-pipeline changes are included.

UI evidence (if applicable)

Before: stale sidebar representative reopens Branch 1 after returning.

Before branch sidebar return

After: sidebar representative stays on Branch 4 and returning selects Branch 4.

After branch sidebar return


🔄 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/1176 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/24/2026 **Status:** ✅ Merged **Merged:** 5/24/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1135-branch-sidebar` --- ### 📝 Commits (1) - [`9c63c85`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9c63c85c0efc380e0f85185fdc79cb7685fccb4e) Fix branch sidebar representative ### 📊 Changes **3 files changed** (+27 additions, -6 deletions) <details> <summary>View changed files</summary> ➕ `docs/pr-evidence/issue-1135/after-return.png` (+0 -0) ➕ `docs/pr-evidence/issue-1135/before-return.png` (+0 -0) 📝 `src/app/shell/ChatSidebar.tsx` (+27 -6) </details> ### 📄 Description ## Linked issue Closes #1135 ## Why this change - Switching branches in a grouped roleplay updated the active chat, but the collapsed chats sidebar row kept using the first sorted branch as its visible and clickable representative. That made the sidebar show the stale branch name and caused returning from another roleplay to reopen the wrong branch. ## What changed - Remember the last active branch per grouped chat in `ChatSidebar`. - Use the active or remembered branch as the collapsed sidebar representative when it still matches the current sidebar filter. - Preserve normal search/filter behavior by falling back to the matching filtered branch if the remembered branch is filtered out. - Added scoped PR evidence screenshots for the before/after UI proof. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Codex reproduced the bug with `node scratch\issue-1135-branch-sidebar-repro.mjs`: before the fix, switching to `Roleplay A - Branch 4` left the sidebar on `Roleplay A - Branch 1`, and clicking away/back selected `rp-a-1`. - Codex verified the fix with `node scratch\issue-1135-branch-sidebar-repro.mjs --after --edge-search`: after switching to `Roleplay A - Branch 4`, the sidebar showed Branch 4 and clicking away/back selected `rp-a-4`. - Edge case verified: after switching to Branch 4, searching for `Branch 1` still showed the matching Branch 1 row rather than forcing the remembered Branch 4. - `pnpm check` passed locally after the final code change. - No manual verification is required for the core claim. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) No docs, release metadata, schema, dependency, storage, auth, or prompt-pipeline changes are included. ## UI evidence (if applicable) Before: stale sidebar representative reopens Branch 1 after returning. ![Before branch sidebar return](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/fix/issue-1135-branch-sidebar/docs/pr-evidence/issue-1135/before-return.png) After: sidebar representative stays on Branch 4 and returning selects Branch 4. ![After branch sidebar return](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/fix/issue-1135-branch-sidebar/docs/pr-evidence/issue-1135/after-return.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12:01 +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#4959
No description provided.