Skip to content

refactor(ui): unify terminal rendering and component primitives - #159

Merged
fcoury merged 10 commits into
masterfrom
fcoury/ui-unification
Jul 27, 2026
Merged

refactor(ui): unify terminal rendering and component primitives#159
fcoury merged 10 commits into
masterfrom
fcoury/ui-unification

Conversation

@fcoury-oai

@fcoury-oai fcoury-oai commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

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

  • Introduce concrete shared UI primitives: a real rope-backed PromptBuffer, responsive UiAction/ActionBar, selection and follow-tail viewports, half-open ScreenRect geometry, Markdown rich-text painting, and a centralized icon catalog.
  • Migrate floating composers, docked panel composers, single-line input, picker selection, LSP completions, plugin workspaces, and file icons onto the appropriate shared primitive without introducing a general-purpose widget framework.
  • Keep the floating composer deliberately right-aligned so code remains visible on the left; preserve multiline editing, Vim modes, grapheme-aware cursor movement, undo/redo, prompt history, and Ctrl+Enter submission.
  • Recompose visible overlays on every frame and route incremental edits through the existing document-aware window renderer so overlays and multiline syntax highlighting remain correct.
  • Unify themed dialog and popup frames, responsive action hints, rounded completion borders, grapheme-safe truncation, and splash-screen display-width calculations.
  • Verify the plugin host API against runtime dispatch in both directions and document component ownership and intentionally separate follow-up work in 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

  1. Exercise the shared components and the sensitive agent-composer regression:

    cargo test --lib ui::
    cargo test -p red --lib agent_composer_never_uses_picker_history_or_records_prompt_input
    cargo test --lib runtime_dispatch_is_covered_by_the_machine_readable_schema

    Expected: prompt history, Unicode editing, responsive actions, picker/completion behavior, right-aligned composer geometry, Ctrl+Enter submission, and bidirectional plugin-schema parity all pass.

  2. 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 warnings

    Expected: all workspace tests pass and formatting and Clippy report no warnings or errors.

  3. 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.

  4. 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.

@fcoury
fcoury force-pushed the fcoury/ui-unification branch from 1755609 to 43a70c8 Compare July 26, 2026 22:33
@fcoury-oai fcoury-oai changed the title feat(agent): unify parallel workspaces and terminal ui primitives refactor(ui): unify terminal rendering and component primitives Jul 26, 2026
@fcoury

fcoury commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment thread src/plugin/panel.rs Outdated
@fcoury

fcoury commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment thread src/editor/rendering.rs Outdated
Comment thread src/editor/rendering.rs Outdated
Comment thread src/ui/prompt_buffer.rs Outdated
@fcoury

fcoury commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment thread src/ui/agent_composer.rs Outdated
@fcoury

fcoury commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment thread src/editor/rendering.rs Outdated
@fcoury-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e5958892f

ℹ️ 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".

Comment thread src/ui/prompt_buffer.rs
@fcoury-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 952c8f134f

ℹ️ 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".

Comment thread src/ui/prompt_buffer.rs Outdated
@fcoury-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13cafce554

ℹ️ 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".

Comment thread src/ui/prompt_buffer.rs Outdated
@fcoury-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6fb9bde457

ℹ️ 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".

Comment thread src/ui/prompt_buffer.rs
Comment thread src/ui/prompt_buffer.rs Outdated
Comment thread src/ui/prompt_buffer.rs
@fcoury-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3235d454ac

ℹ️ 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".

Comment thread src/ui/prompt_buffer.rs
@fcoury-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 620a6a4d26

ℹ️ 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".

@fcoury
fcoury merged commit b7de490 into master Jul 27, 2026
19 checks passed
@fcoury
fcoury deleted the fcoury/ui-unification branch July 27, 2026 02:41
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.

2 participants