langgenius / langgenius/dify

Long segment summaries shrink the editable chunk area

Open Beginner friendly
#40,779 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
156k
Forks
24.6k
Avg merge
22h 9m
Merged PRs (30d)
610

Description

### Self Checks

- [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542).
- [x] This is only for bug report.
- [x] I have searched for existing issues, including closed ones.
- [x] 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.

Contributor guide

Open the contributing guide

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.