[PR #24743] feat: implement trigger card component with auto-refresh #30770

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

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

State: closed
Merged: Yes


Summary

This PR implements a new trigger card component for the app overview page that displays workflow triggers with proper styling and auto-refresh functionality. This builds on the backend API implementation from #24693.

Related #24693
Related #24198

Changes Made

Frontend Components

  • New TriggerCard component: Displays list of app triggers with toggle controls
  • Icon styling: 24px icons with proper background colors matching workflow nodes
    • Webhook triggers: blue background
    • Schedule triggers: violet background
    • Plugin triggers: white background with custom icons
  • Status indicators: Left-corner status dots (green for enabled, light gray for disabled)
  • Empty state: "No trigger added" message with help text

API Integration

  • React Query hooks: Added useAppTriggers, useUpdateTriggerStatus, useInvalidateAppTriggers
  • Auto-refresh: Trigger list automatically updates after workflow publish
  • Field alignment: Fixed API response field from "triggers" to "data" for consistency

UI Improvements

  • MCP card styling: Changed background from indigo to blue to match other cards
  • Layout optimization: Moved trigger count to title position, removed duplicate dividers
  • Text colors: Adjusted for proper contrast and readability

Technical Details

The trigger list automatically refreshes when workflows are published by invalidating the React Query cache. All styling follows existing design system patterns for consistency.

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
**Original Pull Request:** https://github.com/langgenius/dify/pull/24743 **State:** closed **Merged:** Yes --- ## Summary This PR implements a new trigger card component for the app overview page that displays workflow triggers with proper styling and auto-refresh functionality. This builds on the backend API implementation from #24693. Related #24693 Related #24198 ## Changes Made ### Frontend Components - **New TriggerCard component**: Displays list of app triggers with toggle controls - **Icon styling**: 24px icons with proper background colors matching workflow nodes - Webhook triggers: blue background - Schedule triggers: violet background - Plugin triggers: white background with custom icons - **Status indicators**: Left-corner status dots (green for enabled, light gray for disabled) - **Empty state**: "No trigger added" message with help text ### API Integration - **React Query hooks**: Added useAppTriggers, useUpdateTriggerStatus, useInvalidateAppTriggers - **Auto-refresh**: Trigger list automatically updates after workflow publish - **Field alignment**: Fixed API response field from "triggers" to "data" for consistency ### UI Improvements - **MCP card styling**: Changed background from indigo to blue to match other cards - **Layout optimization**: Moved trigger count to title position, removed duplicate dividers - **Text colors**: Adjusted for proper contrast and readability ## Technical Details The trigger list automatically refreshes when workflows are published by invalidating the React Query cache. All styling follows existing design system patterns for consistency. ## 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
yindo added the pull-request label 2026-02-21 20:48:11 -05:00
yindo closed this issue 2026-02-21 20:48:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30770