refactor(ui): unify terminal rendering and component primitives#159
refactor(ui): unify terminal rendering and component primitives#159fcoury-oai wants to merge 4 commits into
Conversation
1755609 to
43a70c8
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43a70c8b92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2fe8e6e79
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5df142d8a5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23b9485082
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let rows = (0..self.window_content_height(&window)) | ||
| .map(|row| self.window_to_terminal_y(&window, row)) | ||
| .collect::<Vec<_>>(); |
There was a problem hiding this comment.
Avoid repainting the full viewport before the final frame
For ordinary edit events in EventRenderMode::Immediate, this now renders every visible row of the active window, but render_edited_window_rows neither flushes a frame nor advances render_generation. Consequently, process_editor_event still calls self.render(buffer) at src/editor.rs:7549-7552, repainting the viewport again after every inserted or deleted character. This changes the prior one-row prepaint into an extra full syntax-highlighted viewport pass and can noticeably increase input latency in large panes or expensive documents; either limit this prepaint to affected rows or make it satisfy the event's final render.
Useful? React with 👍 / 👎.
Why
Red's dialogs, floating and docked composers, pickers, completions, panels, overlays, and plugin workspaces independently implemented prompt editing, action hints, scrolling, geometry, icons, Unicode clipping, and frame rendering. That duplication made narrow terminals, theme changes, streamed content, and document-aware highlighting inconsistent and difficult to maintain.
What changed
PromptBuffer, responsiveUiAction/ActionBar, selection and follow-tail viewports, half-openScreenRectgeometry, Markdown rich-text painting, and a centralized icon catalog.docs/UI_ARCHITECTURE.md.This is a standalone UI refactor based directly on
master. It contains no parallel-agent foundation commits, agent-workspace backend, worktree or checkpoint changes, or plugin host-contract expansion.How to Test
Exercise the shared components and the sensitive agent-composer regression:
Expected: prompt history, Unicode editing, responsive actions, picker/completion behavior, right-aligned composer geometry, Ctrl+Enter submission, and bidirectional plugin-schema parity all pass.
Run the complete workspace and repository quality gates:
cargo fmt --check cargo test --workspace --all-targets --all-features cargo clippy --all-targets --all-features -- -D warningsExpected: all workspace tests pass and formatting and Clippy report no warnings or errors.
Open the floating agent composer, enter a multiline Unicode draft, resize the terminal, and submit using Ctrl+Enter.
Expected: Enter inserts a newline, the composer remains right-aligned, the editor remains visible on the left, and the exact draft is submitted without leaking into picker history.
Scroll upward in a streaming text panel and resize the editor while an overlay is visible.
Expected: new transcript content does not interrupt manual scroll position, complete Unicode graphemes remain visible, and the overlay persists across subsequent rendered frames.