[PR #24714] chore: simplify the workflow details logic #30757

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

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

State: closed
Merged: Yes


Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

close https://github.com/langgenius/dify/issues/23612

This pull request refactors the workflow process rendering logic in the chat answer component, simplifying how workflow steps are displayed and controlled. The main change is to always hide the workflow process UI when it is marked as readonly, rather than conditionally rendering parts of it. This makes the code easier to follow and ensures consistent behavior.

Workflow process rendering logic:

  • The WorkflowProcessItem component now returns null when readonly is true, fully hiding the workflow process UI in readonly mode.
  • The workflow process arrow icon and collapse/expand behavior are no longer conditional on readonly, simplifying user interaction and visual cues. [1] [2]

Component usage and prop handling:

  • The logic for rendering the workflow process in the Answer component is simplified: it now always renders the workflow process if present, and sets the readonly prop based on hideProcessDetail and the site settings.

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
**Original Pull Request:** https://github.com/langgenius/dify/pull/24714 **State:** closed **Merged:** Yes --- > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 1. Ensure there is an associated issue and you have been assigned to it > 1. Use the correct syntax to link this PR: `Fixes #<issue number>`. ## Summary close https://github.com/langgenius/dify/issues/23612 This pull request refactors the workflow process rendering logic in the chat answer component, simplifying how workflow steps are displayed and controlled. The main change is to always hide the workflow process UI when it is marked as readonly, rather than conditionally rendering parts of it. This makes the code easier to follow and ensures consistent behavior. **Workflow process rendering logic:** * The `WorkflowProcessItem` component now returns `null` when `readonly` is true, fully hiding the workflow process UI in readonly mode. * The workflow process arrow icon and collapse/expand behavior are no longer conditional on `readonly`, simplifying user interaction and visual cues. [[1]](diffhunk://#diff-27f7eff85cb13745439f0f1216281620009f22d04cbedc088931387aec785c99L54-R57) [[2]](diffhunk://#diff-27f7eff85cb13745439f0f1216281620009f22d04cbedc088931387aec785c99L75-R80) **Component usage and prop handling:** * The logic for rendering the workflow process in the `Answer` component is simplified: it now always renders the workflow process if present, and sets the `readonly` prop based on `hideProcessDetail` and the site settings. ## Screenshots | Before | After | |--------|-------| | ... | ... | ## 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:10 -05:00
yindo closed this issue 2026-02-21 20:48:10 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30757