[PR #23325] feat(ui): unify tag editing in app sidebar and add management entry to TagFilter #30244

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

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

State: closed
Merged: Yes


Summary

This PR implements unified tag editing functionality across multiple Dify application interfaces, addressing issue #23309 where users could only edit app tags from the workspace view but not from the app's Edit Info or Settings panels.

Key Changes

Core Features Implemented:

  • Unified Tag Editing: Added consistent tag editing capability to app sidebar and detail panels
  • Data Consistency: Implemented fallback mechanism to ensure tags are always available regardless of entry point
  • UI/UX Consistency: Tags now appear and behave consistently with AppCard patterns across all entry points

Technical Implementation:

  • layout-main.tsx: Enhanced fetchAppDetail with fallback to fetchAppWithTags when tags are missing
  • app-info.tsx: Added TagSelector component with proper overflow handling and state management
  • TagSelector: Enhanced with auto-initialization and configurable minimum width
  • apps.ts: Added fetchAppWithTags service function for data fallback

Bug Fixes:

  • Fixed tag disappearance on page refresh in sidebar (从workspace点击进来才会有,但是刷新就会消失)
  • Resolved TagSelector overflow issues in sidebar layout
  • Ensured TagSelector displays all available tags, not just current ones

Testing:

  • Added comprehensive 28-test suite validating core business logic
  • Covers tag state management, fallback mechanisms, CSS logic, and backward compatibility
  • Validates performance with large tag arrays and edge case handling
  • Ensures no regression in existing AppCard behavior

Technical Details

The solution addresses the core issue where AppCard gets data from fetchAppList API (includes tags) while app-info gets data from fetchAppDetail API (doesn't include tags). On page refresh, tags were lost because app-info's appDetail comes from fetchAppDetail.

The fix ensures tags are available at the layout level before reaching app-info, while maintaining all existing functionality and improving the user experience with consistent tag management across all interfaces.

Screenshots

Before After

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Fixes #23309

**Original Pull Request:** https://github.com/langgenius/dify/pull/23325 **State:** closed **Merged:** Yes --- ## Summary This PR implements unified tag editing functionality across multiple Dify application interfaces, addressing issue #23309 where users could only edit app tags from the workspace view but not from the app's Edit Info or Settings panels. ### Key Changes **Core Features Implemented:** - **Unified Tag Editing**: Added consistent tag editing capability to app sidebar and detail panels - **Data Consistency**: Implemented fallback mechanism to ensure tags are always available regardless of entry point - **UI/UX Consistency**: Tags now appear and behave consistently with AppCard patterns across all entry points **Technical Implementation:** - **layout-main.tsx**: Enhanced `fetchAppDetail` with fallback to `fetchAppWithTags` when tags are missing - **app-info.tsx**: Added `TagSelector` component with proper overflow handling and state management - **TagSelector**: Enhanced with auto-initialization and configurable minimum width - **apps.ts**: Added `fetchAppWithTags` service function for data fallback **Bug Fixes:** - Fixed tag disappearance on page refresh in sidebar (从workspace点击进来才会有,但是刷新就会消失) - Resolved TagSelector overflow issues in sidebar layout - Ensured TagSelector displays all available tags, not just current ones **Testing:** - Added comprehensive 28-test suite validating core business logic - Covers tag state management, fallback mechanisms, CSS logic, and backward compatibility - Validates performance with large tag arrays and edge case handling - Ensures no regression in existing AppCard behavior ### Technical Details The solution addresses the core issue where AppCard gets data from `fetchAppList` API (includes tags) while app-info gets data from `fetchAppDetail` API (doesn't include tags). On page refresh, tags were lost because app-info's appDetail comes from fetchAppDetail. The fix ensures tags are available at the layout level before reaching app-info, while maintaining all existing functionality and improving the user experience with consistent tag management across all interfaces. ## Screenshots <table> <thead> <tr> <th>Before</th> <th>After</th> </tr> </thead> <tbody> <tr> <td><img width="405" height="101" src="https://github.com/user-attachments/assets/85b10256-01b3-4d80-971f-72b622b011df" /></td> <td><img width="402" height="104" src="https://github.com/user-attachments/assets/f7a6239c-039e-48e4-96c5-3545e2642a31" /></td> </tr> </tbody> </table> ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos\!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods Fixes #23309
yindo added the pull-request label 2026-02-21 20:47:07 -05:00
yindo closed this issue 2026-02-21 20:47:07 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30244