fix(tui): label pending input modes#2532
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
| for steer in &self.pending_steers { | ||
| push_truncated_item(&mut lines, steer, width, dim, " ↳ ", " "); | ||
| push_truncated_item(&mut lines, steer, width, dim, " ↳ Steer pending: ", " "); | ||
| } | ||
| for steer in &self.rejected_steers { | ||
| push_truncated_item(&mut lines, steer, width, dim, " ↳ ", " "); | ||
| push_truncated_item( | ||
| &mut lines, | ||
| steer, | ||
| width, | ||
| dim, | ||
| " ↳ Rejected steer: ", | ||
| " ", | ||
| ); | ||
| } | ||
| for message in &self.queued_messages { | ||
| push_truncated_item(&mut lines, message, width, dim_italic, " ↳ ", " "); | ||
| push_truncated_item( | ||
| &mut lines, | ||
| message, | ||
| width, | ||
| dim_italic, | ||
| " ↳ Queued follow-up: ", | ||
| " ", | ||
| ); | ||
| } |
There was a problem hiding this comment.
The
subsequent_indent is still " " (4 spaces) even though the new first-line prefixes are 19–22 characters wide. If any steer or queued message wraps across multiple display lines, continuation lines will start at column 4 while the first line's content starts at column 19/21/22, producing a jagged, misaligned block. Matching the indent width to the prefix width keeps wrapped content visually aligned under the label text.
| for steer in &self.pending_steers { | |
| push_truncated_item(&mut lines, steer, width, dim, " ↳ ", " "); | |
| push_truncated_item(&mut lines, steer, width, dim, " ↳ Steer pending: ", " "); | |
| } | |
| for steer in &self.rejected_steers { | |
| push_truncated_item(&mut lines, steer, width, dim, " ↳ ", " "); | |
| push_truncated_item( | |
| &mut lines, | |
| steer, | |
| width, | |
| dim, | |
| " ↳ Rejected steer: ", | |
| " ", | |
| ); | |
| } | |
| for message in &self.queued_messages { | |
| push_truncated_item(&mut lines, message, width, dim_italic, " ↳ ", " "); | |
| push_truncated_item( | |
| &mut lines, | |
| message, | |
| width, | |
| dim_italic, | |
| " ↳ Queued follow-up: ", | |
| " ", | |
| ); | |
| } | |
| for steer in &self.pending_steers { | |
| push_truncated_item(&mut lines, steer, width, dim, " ↳ Steer pending: ", " "); | |
| } | |
| for steer in &self.rejected_steers { | |
| push_truncated_item( | |
| &mut lines, | |
| steer, | |
| width, | |
| dim, | |
| " ↳ Rejected steer: ", | |
| " ", | |
| ); | |
| } | |
| for message in &self.queued_messages { | |
| push_truncated_item( | |
| &mut lines, | |
| message, | |
| width, | |
| dim_italic, | |
| " ↳ Queued follow-up: ", | |
| " ", | |
| ); | |
| } |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
This PR was harvested into v0.8.50. Closing as already landed. |
Harvested from PR Hmbown#2532 by @cyq1017. Pending input rows now distinguish steer-pending, rejected-steer, and queued-follow-up states, with continuation rows aligned under the delivery label. Refs Hmbown#2054; leaves the broader cancel/edit affordance work open. Co-authored-by: cyq1017 <61975706+cyq1017@users.noreply.github.com>
Problem
Change
Verification
Refs #2054
Greptile Summary
This PR adds distinct labels to each delivery-mode row in the pending-input preview, replacing the generic
↳prefix with↳ Steer pending:,↳ Rejected steer:, and↳ Queued follow-up:labels. A new test verifies each label is rendered correctly.pending_input_preview.rs: Threepush_truncated_itemcall-sites updated with typed prefixes; a newpending_input_rows_label_each_delivery_modetest added alongside the existing suite.app.rs: One-line doc-comment update torejected_steersto match the new labelled rendering; no logic change.Confidence Score: 4/5
Safe to merge; the change is purely presentational and backed by new tests.
The only notable gap is that
subsequent_indentremains" "(4 spaces) while the new first-line prefixes are 19–22 characters wide. Any steer or queued message that wraps to a second display line will show content starting at column 4 rather than aligning under the label text. This is visible to end users but does not break functionality.crates/tui/src/tui/widgets/pending_input_preview.rs — the continuation-indent values passed to
push_truncated_itemdo not match the new prefix widths.Important Files Changed
rejected_steersto reflect the new labelled rendering; no logic changes.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[lines] --> B{has pending inputs?} B -- No --> C[return empty vec] B -- Yes --> D[push Pending inputs header] D --> E[iterate pending_steers] E --> F[push_truncated_item with Steer pending label] F --> G[iterate rejected_steers] G --> H[push_truncated_item with Rejected steer label] H --> I[iterate queued_messages] I --> J[push_truncated_item with Queued follow-up label] J --> K{queued_messages non-empty?} K -- Yes --> L[push edit-binding hint line] K -- No --> M[return lines] L --> MReviews (1): Last reviewed commit: "fix(tui): label pending input modes" | Re-trigger Greptile