Nod composer: show every line while typing, up to five, then scroll - #617
Merged
Merged
Conversation
The draft box grew when a second line was typed, but the line could sit out of view: AppKit scrolled to the caret while the text outgrew the box, and the offset survived SwiftUI's resize. After every resize the box now shows all of its text when it fits and the caret's line when it does not. It grows up to five lines (was 140pt, about nine), then scrolls with an overlay scroller. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: scgopi <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Nod's chat pane, the draft box grew to two lines but the second line could be out of view, so you couldn't see what you were typing.
Render:
NodChatRenderTests.theComposerGrowsToFiveLines— two lines both visible; seven lines show 3–7 with the caret on the last.Evidence
RED: NodComposerHeightTests.aBoxWhoseTextFitsIsNeverLeftScrolled with the guard removed -> fails, visible(box).minY is one line down; aLongDraftShowsFiveLinesAndScrolls on main's composer -> fails, box height is not 5 lines and there is no scroller
GREEN: xcodebuild test -only-testing NodComposerHeightTests -> 5 tests passed, including typing into the pane's own NodComposerView with its store
REGRESSION: full xcodebuild test -> 2234 tests, only MessageDeliveryTests.aSessionWhoseTaskEndedIsNeverTypedInto fails, identically on main on this Mac; cli and daemon builds exit 0; make check 0 errors; swift-portable exit 0