Long segment summaries shrink the editable chunk area

Open Beginner friendly
#40,779 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
typescript
Domain
frontend

Research direction

Start in web/app/components/datasets/documents/detail/completed/segment-detail.tsx and common/summary-text.tsx, then reproduce the issue with a long segment summary in the non-fullscreen edit drawer. Trace the column flex layout and autosizing summary field. Done means the summary remains bounded and scrolls within its field while the segment content editor retains a usable minimum height.

Written by the indexing model from the issue text.

Description

Self Checks
  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report.
  • I have searched for existing issues, including closed ones.
  • I am submitting this report in English.
Dify version

1.16.1 / current main

Cloud or Self Hosted

Self Hosted

Steps to reproduce
  1. Open a document in a knowledge base with segment summary enabled.
  2. Open a segment in the non-fullscreen edit drawer.
  3. Enter or generate a long summary containing many lines.
  4. Observe the editable segment content area above the summary field.
Expected behavior

The segment content editor should keep a usable minimum height. A long summary should scroll inside its own field or otherwise remain bounded within the drawer.

Actual behavior

The summary textarea grows with its content and the segment content editor above it is progressively compressed. With a sufficiently long summary, the editable content area becomes difficult to use.

Root cause

In web/app/components/datasets/documents/detail/completed/segment-detail.tsx, the non-fullscreen drawer uses a column flex layout. The segment content area uses h-0 grow, while the summary panel uses shrink-0. In common/summary-text.tsx, the summary field uses react-textarea-autosize with minRows but no maximum row count or max height, so the summary panel can consume the available drawer height without bound.

Proposed fix

Bound the summary textarea height and enable scrolling inside the summary field after the limit is reached, while keeping the segment content editor usable.

Related work

This is separate from #40698, which covers summary regeneration timing and stale segment drawer callbacks.

Dominant language
TypeScript
Stars
157k
Forks
24.7k
Avg merge
22h 32m
Merged PRs (30d)
611

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from langgenius/dify

All issues in langgenius/dify

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.