The answer node content in the workflow is abnormally wrapped #4604

Closed
opened 2026-02-21 18:07:12 -05:00 by yindo · 2 comments
Owner

Originally created by @jx2011 on GitHub (Jul 15, 2024).

Originally assigned to: @iamjoel, @zxhlyh on GitHub.

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.13

Cloud or Self Hosted

Cloud

Steps to reproduce

  • step1: Create a workflow with only a start node and an answer node.
  • step2: Insert variables into the answer node content.
  • step3: Edit the contents of the row in which the variable is inserted.
  • step4: Select the Start node, then select the answer node.
    Abnormal line wrap

✔️ Expected Behavior

Line feed is displayed normally

Actual Behavior

Abnormal line wrap

Abnormal line wrap
Originally created by @jx2011 on GitHub (Jul 15, 2024). Originally assigned to: @iamjoel, @zxhlyh on GitHub. ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.13 ### Cloud or Self Hosted Cloud ### Steps to reproduce - step1: Create a workflow with only a start node and an answer node. - step2: Insert variables into the answer node content. - step3: Edit the contents of the row in which the variable is inserted. - step4: Select the Start node, then select the answer node. <img width="1080" alt="Abnormal line wrap" src="https://github.com/user-attachments/assets/63f2975c-ec52-4652-ad6c-3b429f5ddbba"> ### ✔️ Expected Behavior Line feed is displayed normally ### ❌ Actual Behavior Abnormal line wrap <img width="1080" alt="Abnormal line wrap" src="https://github.com/user-attachments/assets/8d999c75-8817-4ce1-985d-209580921f81">
yindo added the 🐞 bug label 2026-02-21 18:07:12 -05:00
yindo closed this issue 2026-02-21 18:07:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 15, 2024):

To resolve the issue of abnormal line wrapping in the answer node content in the workflow editor of Dify version 0.6.13 (Cloud), you can adjust the CSS styles applied to the editor component. Specifically, you can modify the min-h-[56px] and overflow-y-auto classes to ensure proper line wrapping.

Here's the relevant part of the code with the necessary adjustments:

<div className={cn(isExpand ? 'grow' : 'max-h-[536px]', 'relative px-3 min-h-[56px] overflow-y-auto')}>
  <PromptEditor
    key={controlPromptEditorRerenderKey}
    instanceId={instanceId}
    compact
    className='min-h-[56px]'
    style={isExpand ? { height: editorExpandHeight - 5 } : {}}
    value={value}
    contextBlock={{
      show: justVar ? false : isShowContext,
      selectable: !hasSetBlockStatus?.context,
      canNotAddContext: true,
    }}
    historyBlock={{
      show: justVar ? false : isShowHistory,
      selectable: !hasSetBlockStatus?.history,
      history: {
        user: 'Human',
        assistant: 'Assistant',
      },
    }}
    queryBlock={{
      show: false, // use [sys.query] instead of query block
      selectable: false,
    }}
    workflowVariableBlock={{
      show: true,
      variables: nodesOutputVars || [],
      workflowNodesMap: availableNodes.reduce((acc, node) => {
        acc[node.id] = {
          title: node.data.title,
          type: node.data.type,
        }
        if (node.data.type === BlockEnum.Start) {
          acc.sys = {
            title: t('workflow.blocks.start'),
            type: BlockEnum.Start,
          }
        }
        return acc
      }, {} as any),
    }}
    onChange={onChange}
    onBlur={setBlur}
    onFocus={setFocus}
    editable={!readOnly}
  />
  {readOnly && <div className='absolute inset-0 z-10'></div>}
</div>

Ensure that the min-h-[56px] and overflow-y-auto classes are correctly applied to handle the line wrapping properly. Adjusting these styles should help in resolving the abnormal line wrapping issue [1].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jul 15, 2024): <!-- Answer --> To resolve the issue of abnormal line wrapping in the answer node content in the workflow editor of Dify version 0.6.13 (Cloud), you can adjust the CSS styles applied to the editor component. Specifically, you can modify the `min-h-[56px]` and `overflow-y-auto` classes to ensure proper line wrapping. Here's the relevant part of the code with the necessary adjustments: ```tsx <div className={cn(isExpand ? 'grow' : 'max-h-[536px]', 'relative px-3 min-h-[56px] overflow-y-auto')}> <PromptEditor key={controlPromptEditorRerenderKey} instanceId={instanceId} compact className='min-h-[56px]' style={isExpand ? { height: editorExpandHeight - 5 } : {}} value={value} contextBlock={{ show: justVar ? false : isShowContext, selectable: !hasSetBlockStatus?.context, canNotAddContext: true, }} historyBlock={{ show: justVar ? false : isShowHistory, selectable: !hasSetBlockStatus?.history, history: { user: 'Human', assistant: 'Assistant', }, }} queryBlock={{ show: false, // use [sys.query] instead of query block selectable: false, }} workflowVariableBlock={{ show: true, variables: nodesOutputVars || [], workflowNodesMap: availableNodes.reduce((acc, node) => { acc[node.id] = { title: node.data.title, type: node.data.type, } if (node.data.type === BlockEnum.Start) { acc.sys = { title: t('workflow.blocks.start'), type: BlockEnum.Start, } } return acc }, {} as any), }} onChange={onChange} onBlur={setBlur} onFocus={setFocus} editable={!readOnly} /> {readOnly && <div className='absolute inset-0 z-10'></div>} </div> ``` Ensure that the `min-h-[56px]` and `overflow-y-auto` classes are correctly applied to handle the line wrapping properly. Adjusting these styles should help in resolving the abnormal line wrapping issue <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@zxhlyh commented on GitHub (Jul 15, 2024):

fixed. #6310

@zxhlyh commented on GitHub (Jul 15, 2024): fixed. #6310
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4604