Collapse large pastes; remove stale queued-message notice - #7
Open
MathiTz wants to merge 2 commits into
Open
Conversation
Pasting something long (e.g. a stack trace, file content, or diff) used to dump the entire text inline into the composer, making it unreadable and pushing the actual prompt out of view. - ChatComposer.on_paste: pastes over PASTE_COLLAPSE_THRESHOLD (100 chars) are collapsed to a "[LINES N]" placeholder instead of being inserted verbatim; shorter pastes are inserted as before. - The real pasted text is tracked internally and substituted back in when the message is submitted (Enter/Ctrl+S), so the model still receives the full original content - only the on-screen composer is compressed. - Same-line-count pastes within one draft get distinct placeholders (`[LINES N]`, `[LINES N#2]`, ...) so each expands back to its own text. - Added tests in tests/test_composer.py covering collapse, the threshold boundary, expansion on submit, and disambiguation of duplicate placeholders. Co-Authored-By: Warp <agent@warp.dev>
ChatPane now tracks each "📥 Queued (#N)" SystemMessage widget in self._queued_notices, parallel to self.state.message_queue. When a queued prompt is dequeued and starts its turn, the matching notice is removed from the chat log instead of staying there indefinitely. Notices for prompts discarded on cancellation are removed the same way. Co-Authored-By: Warp <agent@warp.dev>
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.
Summary
Follow-up to #6 (already merged): two small composer/queueing UX fixes that landed on the same branch after that PR was merged, so they need their own PR.
Changes
ui/tui.py): pasting more than 100 characters into the chat composer now collapses to a[LINES N]placeholder instead of dumping the raw text inline. The real content is tracked internally and substituted back in on submit, so the model still receives the full text. Duplicate same-line-count pastes in one draft get distinct placeholders ([LINES N],[LINES N#2], ...).ui/tui.py): the "📥 Queued (#N) — will run once the current task finishes" notice now gets removed from the chat log once that queued message is dequeued and starts running (or discarded, with its notice removed, if the run is cancelled). Previously it stayed in the log indefinitely even after being consumed.Testing
Full test suite passes locally:
PYTHONPATH=. .venv/bin/pytest tests/ -q→ 70 passed.Co-Authored-By: Warp agent@warp.dev