[PR #720] [MERGED] fix(chat-folder): improve chat folder click area #4745

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/720
Author: @ghost
Created: 5/12/2026
Status: ✅ Merged
Merged: 5/13/2026
Merged by: @Xelvanis

Base: main ← Head: fix_chat_folder_click


📝 Commits (2)

  • 27c008b fix(chat-folder): improve chat folder click area
  • 7227e66 fix(chat-folder): refine click zone, fix rename input propagation, add keyboard support

📊 Changes

1 file changed (+56 additions, -37 deletions)

View changed files

📝 packages/client/src/components/layout/ChatSidebar.tsx (+56 -37)

📄 Description

Linked issue

Closes #278
Improves #286

Why this change

Clicking chat sidebar folder's blank space around grip icon was inadvertently triggering the folder to open/close because the entire folder header row had a single click handler. This improves the click area to exclude the blank space around the grip icon.

What changed

  • Removed the top-level onClick from the folder header <div> that was causing unintended toggle behavior
  • Extracted the toggle zone into an inner <div> that spans from the chevron arrow through the folder name
  • Added e.stopPropagation() to the toggle handler to prevent conflicts with Framer Motion's drag reorder system
  • Added e.stopPropagation() to the rename input's onKeyDown and onBlur handlers so typing in the rename field doesn't toggle the folder
  • Grip icon, rename button, and delete button are now independent of the toggle — they already had e.stopPropagation() and remain unaffected

Validation

  • pnpm check passes locally
  • Ran the app, clicked through the changes manually
  • Checked edge cases (desktop + mobile viewport)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  1. Open any chat mode (Conversation / Roleplay / Game) that has folders
  2. Create a new folder or use an existing one
  3. Clicking the blank space around grip icon not trigger folder expand/collapse

Docs and release impact

  • No docs changes needed

UI evidence (if applicable)

  • Before

https://github.com/user-attachments/assets/5567f7ee-042b-426c-8548-ae177e64939b

  • After

https://github.com/user-attachments/assets/b4aad10f-44e4-46a3-9321-ce016aba0a90

Summary by CodeRabbit

  • Bug Fixes

    • Fixed folder header interactions to prevent unintended event propagation during collapse toggles and rename operations.
    • Ensured rename input no longer leaks clicks or blur events, preserving expected commit/cancel behavior.
  • Accessibility

    • Made folder collapse toggle keyboard-accessible and exposed expanded state for assistive tech.
    • Adjusted chevron and entries count presentation in headers.

Review Change Stack


🔄 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/720 **Author:** [@ghost](https://github.com/ghost) **Created:** 5/12/2026 **Status:** ✅ Merged **Merged:** 5/13/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `main` ← **Head:** `fix_chat_folder_click` --- ### 📝 Commits (2) - [`27c008b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/27c008b9895e451512ea7a699b8e80149109efb0) fix(chat-folder): improve chat folder click area - [`7227e66`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7227e661c5489302d301eb157cb7ddada61968c7) fix(chat-folder): refine click zone, fix rename input propagation, add keyboard support ### 📊 Changes **1 file changed** (+56 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/layout/ChatSidebar.tsx` (+56 -37) </details> ### 📄 Description ## Linked issue Closes #278 Improves #286 ## Why this change Clicking chat sidebar folder's blank space around grip icon was inadvertently triggering the folder to open/close because the entire folder header row had a single click handler. This improves the click area to exclude the blank space around the grip icon. ## What changed - Removed the top-level `onClick` from the folder header `<div>` that was causing unintended toggle behavior - Extracted the toggle zone into an inner `<div>` that spans from the chevron arrow through the folder name - Added `e.stopPropagation()` to the toggle handler to prevent conflicts with Framer Motion's drag reorder system - Added `e.stopPropagation()` to the rename input's `onKeyDown` and `onBlur` handlers so typing in the rename field doesn't toggle the folder - Grip icon, rename button, and delete button are now independent of the toggle — they already had `e.stopPropagation()` and remain unaffected ## Validation - [x] `pnpm check` passes locally - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (desktop + mobile viewport) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes 1. Open any chat mode (Conversation / Roleplay / Game) that has folders 2. Create a new folder or use an existing one 3. Clicking the blank space around grip icon not trigger folder expand/collapse ## Docs and release impact - [x] No docs changes needed ## UI evidence (if applicable) - Before https://github.com/user-attachments/assets/5567f7ee-042b-426c-8548-ae177e64939b - After https://github.com/user-attachments/assets/b4aad10f-44e4-46a3-9321-ce016aba0a90 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed folder header interactions to prevent unintended event propagation during collapse toggles and rename operations. * Ensured rename input no longer leaks clicks or blur events, preserving expected commit/cancel behavior. * **Accessibility** * Made folder collapse toggle keyboard-accessible and exposed expanded state for assistive tech. * Adjusted chevron and entries count presentation in headers. [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/720) <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:17 +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#4745
No description provided.