Using a form form in template conversion, switching historical conversations and returning to the original conversation reduces the width of the form without adaptation #12642

Open
opened 2026-02-21 19:08:19 -05:00 by yindo · 2 comments
Owner

Originally created by @fw505 on GitHub (Apr 8, 2025).

Originally assigned to: @crazywoola 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).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @fw505 on GitHub (Apr 8, 2025). Originally assigned to: @crazywoola 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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.0.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/ceeddab0-f7f5-4aec-8327-fbbbb55d832a) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the good first issue label 2026-02-21 19:08:19 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 8, 2025):

你好 @fw505!我是一个可以帮助你解决bug、回答问题并成为贡献者的机器人。如果你需要帮助,随时可以问我,同时我会在这里等着人类维护者的回应。很高兴见到你!

The issue you're experiencing seems to be related to the form's width not adapting correctly when switching between historical conversations and returning to the original conversation in the Dify platform. This could be due to how the layout or width of the chat area is managed in the codebase.

In the Dify codebase, JavaScript functions like getContainerWidth and getContentWidth are used to adjust the layout and width of the chat area. These functions are called within useEffect hooks to ensure the layout adapts when the component mounts or when certain states change. Additionally, a ResizeObserver is used to recalculate the content width when the container is resized [1][2].

To address the issue, you might want to check if these functions are being triggered correctly when switching conversations. Ensure that the useEffect hooks and ResizeObserver are properly set up to handle changes in conversation state, which could help maintain the correct width of the form during these transitions.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 8, 2025): <!-- Greeting --> 你好 @fw505!我是一个可以帮助你解决bug、回答问题并成为贡献者的机器人。如果你需要帮助,随时可以问我,同时我会在这里等着人类维护者的回应。很高兴见到你! <!-- Answer --> The issue you're experiencing seems to be related to the form's width not adapting correctly when switching between historical conversations and returning to the original conversation in the Dify platform. This could be due to how the layout or width of the chat area is managed in the codebase. In the Dify codebase, JavaScript functions like `getContainerWidth` and `getContentWidth` are used to adjust the layout and width of the chat area. These functions are called within `useEffect` hooks to ensure the layout adapts when the component mounts or when certain states change. Additionally, a `ResizeObserver` is used to recalculate the content width when the container is resized <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/base/chat/chat/answer/index.tsx)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/web/app/components/base/chat/chat/answer/operation.tsx)</sup>. To address the issue, you might want to check if these functions are being triggered correctly when switching conversations. Ensure that the `useEffect` hooks and `ResizeObserver` are properly set up to handle changes in conversation state, which could help maintain the correct width of the form during these transitions. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/b27da335-f7d3-4dca-8ecf-b26ca823eaa8?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/b27da335-f7d3-4dca-8ecf-b26ca823eaa8?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/b27da335-f7d3-4dca-8ecf-b26ca823eaa8?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/b27da335-f7d3-4dca-8ecf-b26ca823eaa8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b27da335-f7d3-4dca-8ecf-b26ca823eaa8?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/b27da335-f7d3-4dca-8ecf-b26ca823eaa8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b27da335-f7d3-4dca-8ecf-b26ca823eaa8?feedback_type=other)</sup>
Author
Owner

@mvreddy13 commented on GitHub (Apr 8, 2025):

Hi @fw505, I attempted to reproduce the issue you reported, but I couldn’t replicate it. I tested accessing the historical conversation and returning to the original one without any problems. Here’s a video demonstrating it. If you’re still experiencing the issue, could you please provide a detailed step-by-step guide on how to replicate the bug?

https://github.com/user-attachments/assets/18924d0f-c49d-41e7-a003-6aff3a01c06a

@mvreddy13 commented on GitHub (Apr 8, 2025): Hi @fw505, I attempted to reproduce the issue you reported, but I couldn’t replicate it. I tested accessing the historical conversation and returning to the original one without any problems. Here’s a video demonstrating it. If you’re still experiencing the issue, could you please provide a detailed step-by-step guide on how to replicate the bug? https://github.com/user-attachments/assets/18924d0f-c49d-41e7-a003-6aff3a01c06a
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12642