langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
47.15k stars 6.7k forks source link

Run panel position is wrong! #5996

Closed aixgeek closed 2 months ago

aixgeek commented 3 months ago

Self Checks

Dify version

0.6.11

Cloud or Self Hosted

Cloud, Self Hosted (Docker), Self Hosted (Source)

Steps to reproduce

Add multi outputs in panel and scroll panel Click run button,the run panel position is wrong.

✔️ Expected Behavior

image

❌ Actual Behavior

image

image

dosubot[bot] commented 3 months ago

To fix the issue where the run panel appears in the wrong position after adding multiple outputs and scrolling the panel in the Dify application, you need to ensure that the height of the panel is adjusted correctly when the content changes.

In the provided code, the adjustResultHeight function is responsible for setting the height of the panel. However, it is only called in the useEffect hook that depends on the loading state. You should also call this function whenever the content of the panel changes.

You can achieve this by adding a dependency on runDetail in the useEffect hook that calls adjustResultHeight. Here is the modified code:

useEffect(() => {
  adjustResultHeight()
}, [loading, runDetail])

This ensures that the height is adjusted whenever the runDetail changes, which should fix the issue with the panel appearing in the wrong position.

Here is the updated part of the code:

useEffect(() => {
  adjustResultHeight()
}, [loading, runDetail])

This change should ensure that the panel height is recalculated whenever the content changes, thus fixing the positioning issue [1][2].

To continue talking to Dosu, mention @dosu.