[PR #286] [MERGED] feat(ui): add rename button and toggle folder on click #4547

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/286
Author: @ghost
Created: 4/28/2026
Status: ✅ Merged
Merged: 4/28/2026
Merged by: @SpicyMarinara

Base: main ← Head: chat_folder_click


📝 Commits (1)

  • ce48362 feat(ui): add rename button and toggle folder on click

📊 Changes

1 file changed (+29 additions, -18 deletions)

View changed files

📝 packages/client/src/components/layout/ChatSidebar.tsx (+29 -18)

📄 Description

Linked Issue

Closes #278.

Why this change

This improves usability on phones with small screens, where tapping the arrow button to expand/collapse the folder can be difficult.

What changed

  • Unified click target for collapse: The entire folder header <div> (from grip handle through to the count badge, excluding icon buttons) now handles fold/unfold via a single onClick={() => onToggleCollapse(folder)} on the parent container. Previously only the chevron button and folder name span had individual click handlers.
  • Folder name click → collapse: Removed onClick={() => setRename(true)} from the folder name <span> and removed its local rename state trigger. Clicking the name now delegates to the parent's toggle collapse.
  • New dedicated rename button: Added a Pencil icon button positioned between the count badge and delete button. Uses e.stopPropagation() to prevent triggering parent collapse. Triggers inline rename mode via setRenameValue(folder.name) + setRenaming(true).
  • Color dot (midot) made non-interactive: Converted from a <button> with hover scale transform to a static <div> styled with cursor-pointer. Now participates in the parent's click area rather than having its own handler.
  • Chevron rendered as icon (not button): Changed from <button onClick={...}> to <ChevronRight ...> with class-based rotation, sharing the parent's click handler.
  • Icon buttons use stopPropagation: The pencil (rename) and trash (delete) buttons explicitly call e.stopPropagation() to prevent the parent header click from firing when clicked.

Validation

  • pnpm check passes locally
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport)

Clicking anywhere in the folder area will expand/collapse the folder.

UI evidence (if applicable)

Screenshot 2026-04-28 173245 Screenshot 2026-04-28 173355

Summary by CodeRabbit

  • UI Improvements

    • Enhanced folder sidebar interface with improved styling for chevron indicators and folder color dots.
    • Refined visual presentation and organization of folder header controls.
  • Behavioral Changes

    • Simplified folder renaming interaction by introducing a dedicated rename button, replacing the previous click-on-folder-name behavior for clearer and more intuitive folder management.

🔄 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/286 **Author:** [@ghost](https://github.com/ghost) **Created:** 4/28/2026 **Status:** ✅ Merged **Merged:** 4/28/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `chat_folder_click` --- ### 📝 Commits (1) - [`ce48362`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ce48362f4f92df77fd9dc9fd699e4667feafa76c) feat(ui): add rename button and toggle folder on click ### 📊 Changes **1 file changed** (+29 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/layout/ChatSidebar.tsx` (+29 -18) </details> ### 📄 Description ## Linked Issue Closes #278. ## Why this change This improves usability on phones with small screens, where tapping the arrow button to expand/collapse the folder can be difficult. ## What changed - **Unified click target for collapse:** The entire folder header `<div>` (from grip handle through to the count badge, excluding icon buttons) now handles fold/unfold via a single `onClick={() => onToggleCollapse(folder)}` on the parent container. Previously only the chevron button and folder name span had individual click handlers. - **Folder name click → collapse**: Removed `onClick={() => setRename(true)}` from the folder name `<span>` and removed its local rename state trigger. Clicking the name now delegates to the parent's toggle collapse. - **New dedicated rename button**: Added a `Pencil` icon button positioned between the count badge and delete button. Uses `e.stopPropagation()` to prevent triggering parent collapse. Triggers inline rename mode via `setRenameValue(folder.name)` + `setRenaming(true)`. - **Color dot (midot) made non-interactive**: Converted from a `<button>` with hover scale transform to a static `<div>` styled with cursor-pointer. Now participates in the parent's click area rather than having its own handler. - **Chevron rendered as icon (not button)**: Changed from `<button onClick={...}>` to `<ChevronRight ...>` with class-based rotation, sharing the parent's click handler. - **Icon buttons use stopPropagation**: The pencil (rename) and trash (delete) buttons explicitly call `e.stopPropagation()` to prevent the parent header click from firing when clicked. ## Validation - [x] `pnpm check` passes locally - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport) Clicking anywhere in the folder area will expand/collapse the folder. ## UI evidence (if applicable) <img width="48%" alt="Screenshot 2026-04-28 173245" src="https://github.com/user-attachments/assets/f53d6d52-791c-43d4-94ab-c3b0fa2b05bf" /> <img width="25%" alt="Screenshot 2026-04-28 173355" src="https://github.com/user-attachments/assets/7d08fedf-64e8-4580-90c4-1b5a28d80b7d" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **UI Improvements** * Enhanced folder sidebar interface with improved styling for chevron indicators and folder color dots. * Refined visual presentation and organization of folder header controls. * **Behavioral Changes** * Simplified folder renaming interaction by introducing a dedicated rename button, replacing the previous click-on-folder-name behavior for clearer and more intuitive folder management. <!-- 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:08:36 +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#4547
No description provided.