Skip to content

fix(annotations): clip and scroll multiline line-comment drafts above footer - #2271

Merged
Hona merged 1 commit into
devfrom
fix/line-comment-editor-scroll
Dec 3, 2026
Merged

Hona merged 1 commit into
devfrom
fix/line-comment-editor-scroll

Conversation

@Hona

@Hona Hona commented Dec 3, 2026

Copy link
Copy Markdown
Member

Fixes #2254

Problem

In the file and diff line-comment editors, the multiline text_input had a fixed or capped height (.h(64.0), .h_full(), or .max_h(160.0)) set directly on the input node without an enclosing scroll viewport. In Rune, text_input does not clip or scroll vertically on its own, so drafts taller than the box painted past its bottom edge directly over the footer buttons (Cancel and Comment / Send comment) and beyond the card border.

Fix

Wrap each multiline comment editor field in a session_view::scroller::scroller(...) viewport so the input grows naturally inside the scroll container, clips cleanly above the footer row, scrolls vertically with Desktop's native scrollbar, and keeps the caret in view:

  • features/annotations/src/line_comments/view.rs (editor_v2, Files and wide Review diffs): 64 pt (4 × 16 pt, matching official LineCommentEditor rows={4}) scrollable viewport above the footer row.
  • features/annotations/src/line_comments/view.rs (editor_v1, narrow Review diffs): scrollable viewport filling the resizable field-box above the actions row while keeping the vertical resize grip.
  • features/annotations/src/quote/editor.rs (compact quote comment editor): 20–160 pt growing scrollable viewport with stable_gutter(), matching line-comment.css.
  • apps/desktop/src/surfaces/browser/comment.rs (browser element comment and page note editors): 20–160 pt and 64–160 pt scrollable viewports above the footer.

Verification

  • Ran pwsh scripts/guardrails.ps1 locally on Windows (11/11 passed).
  • Ran cargo check -j 1 -p opencode-desktop, cargo clippy -j 1 -p opencode-feature-annotations --no-deps -- -D warnings, and cargo clippy -j 1 -p opencode-desktop --no-deps locally on Windows (clean).
  • Not visually tested in a live GUI window or on macOS/Linux hardware; cross-platform builds run in CI.

Copilot AI balanced review requested due to automatic review settings December 3, 2026 08:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Hona
Hona merged commit 0630414 into dev Dec 3, 2026
8 checks passed
@Hona
Hona deleted the fix/line-comment-editor-scroll branch December 3, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: Send comment button overlaps the line comment draft text

2 participants