[PR #24625] refactor(sidebar): Restructure app operations with toggle functionality #30719

Closed
opened 2026-02-21 20:48:05 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/24625

State: closed
Merged: Yes


Summary

This PR refactors the app sidebar operations component with the following key improvements:

🔧 Architecture Changes

  • Split operations into primary/secondary: Always-visible primary operations with secondary operations in dropdown menu
  • Remove complex responsive calculation: Eliminates the performance-heavy dynamic width calculation algorithm
  • Simplify state management: Streamlined component state with cleaner logic

🎯 UI/UX Improvements

  • Move delete operation: Relocated from standalone button to secondary operations menu
  • Add visual dividers: Better grouping with divider support in dropdown
  • Toggle functionality: "More" button now properly toggles open/close on repeated clicks
  • Maintain compatibility: Preserves existing dismiss behavior for outside clicks

Performance Benefits

  • Reduced complexity: Removed heavy DOM calculations and measurement logic
  • Better rendering: Fixed primary operations eliminate layout thrashing
  • Cleaner code: 17 fewer lines with improved maintainability

🔗 Related Issues

Test Plan

  • First click on "More" button opens dropdown menu
  • Second click on "More" button closes dropdown menu
  • Clicking outside dropdown closes menu (existing behavior preserved)
  • All operation buttons work correctly
  • Visual dividers render properly in dropdown
  • ESLint and TypeScript checks pass
  • No console errors or warnings

Technical Details

  • Files changed: app-info.tsx, app-operations.tsx
  • Lines: +111, -128 (net: -17 lines)
  • Breaking changes: None - maintains existing API compatibility
  • Performance impact: Positive - eliminates expensive DOM calculations

Screenshots

N/A - Functional refactoring without visual changes to end-user experience

**Original Pull Request:** https://github.com/langgenius/dify/pull/24625 **State:** closed **Merged:** Yes --- ## Summary This PR refactors the app sidebar operations component with the following key improvements: ### 🔧 Architecture Changes - **Split operations into primary/secondary**: Always-visible primary operations with secondary operations in dropdown menu - **Remove complex responsive calculation**: Eliminates the performance-heavy dynamic width calculation algorithm - **Simplify state management**: Streamlined component state with cleaner logic ### 🎯 UI/UX Improvements - **Move delete operation**: Relocated from standalone button to secondary operations menu - **Add visual dividers**: Better grouping with divider support in dropdown - **Toggle functionality**: "More" button now properly toggles open/close on repeated clicks - **Maintain compatibility**: Preserves existing dismiss behavior for outside clicks ### ⚡ Performance Benefits - **Reduced complexity**: Removed heavy DOM calculations and measurement logic - **Better rendering**: Fixed primary operations eliminate layout thrashing - **Cleaner code**: 17 fewer lines with improved maintainability ### 🔗 Related Issues - Related: #23981 - Related: #24198 ## Test Plan - [x] First click on "More" button opens dropdown menu - [x] Second click on "More" button closes dropdown menu - [x] Clicking outside dropdown closes menu (existing behavior preserved) - [x] All operation buttons work correctly - [x] Visual dividers render properly in dropdown - [x] ESLint and TypeScript checks pass - [x] No console errors or warnings ## Technical Details - **Files changed**: `app-info.tsx`, `app-operations.tsx` - **Lines**: +111, -128 (net: -17 lines) - **Breaking changes**: None - maintains existing API compatibility - **Performance impact**: Positive - eliminates expensive DOM calculations ## Screenshots N/A - Functional refactoring without visual changes to end-user experience
yindo added the pull-request label 2026-02-21 20:48:05 -05:00
yindo closed this issue 2026-02-21 20:48:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30719