Skip to content

Conversation

@charley-oai
Copy link
Collaborator

@charley-oai charley-oai commented Jan 16, 2026

Continuation of breaking up this PR #9116

Summary

  • Thread user text element ranges through TUI/TUI2 input, submission, queueing, and history so placeholders survive resume/edit flows.
  • Preserve local image attachments alongside text elements and rehydrate placeholders when restoring drafts.
  • Keep model-facing content shapes clean by attaching UI metadata only to user input/events (no API content changes).

Key Changes

  • TUI/TUI2 composer now captures text element ranges, trims them with text edits, and restores them when submission is suppressed.
  • User history cells render styled spans for text elements and keep local image paths for future rehydration.
  • Initial chat widget bootstraps accept empty initial_text_elements to keep initialization uniform.
  • Protocol/core helpers updated to tolerate the new InputText field shape without changing payloads sent to the API.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR threads text element ranges through TUI input submission, history, and resume flows to preserve placeholder styling (e.g., image attachments) across user interactions and session restores.

Changes:

  • Composer input now tracks text element ranges and local image paths, updating them when text is edited or submission is suppressed
  • User history cells render styled spans for text elements and store local image paths for rehydration
  • Queued messages preserve text elements and image attachments, remapping placeholder labels when merging drafts after interruption

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated no comments.

Show a summary per file
File Description
codex-rs/tui2/src/chatwidget.rs Threads text elements and local images through submission, queuing, and interrupt flows; remaps placeholders when merging drafts
codex-rs/tui2/src/history_cell.rs Adds text_elements and local_image_paths fields to UserHistoryCell; renders styled spans for text elements
codex-rs/tui2/src/bottom_pane/chat_composer.rs Captures and trims text elements during submission; restores them if submission is suppressed
codex-rs/tui2/src/bottom_pane/textarea.rs Adds set_text_with_elements and text_elements methods to manage UI element ranges
codex-rs/tui2/src/bottom_pane/mod.rs Exposes LocalImageAttachment struct and methods to access composer text elements and images
codex-rs/tui2/src/app.rs Adds initial_text_elements field to ChatWidgetInit; provides empty Vec for fork/resume/new session bootstraps
codex-rs/tui/src/chatwidget.rs Mirrors tui2 changes: threads text elements through submission, queuing, and history
codex-rs/tui/src/history_cell.rs Mirrors tui2 UserHistoryCell changes for text_elements and local_image_paths
codex-rs/tui/src/bottom_pane/chat_composer.rs Mirrors tui2 composer changes for capturing/trimming text elements
codex-rs/protocol/src/models.rs Updates ContentItem::InputText pattern matches to ignore new text_elements field
codex-rs/core/src/* Updates comments to clarify when text_elements is empty (synthesized prompts, model input)
codex-rs/exec/src/lib.rs Adds comment clarifying CLI input doesn't track UI element ranges

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@charley-oai charley-oai force-pushed the tui-text-elements-history branch from a6626dd to dc8591b Compare January 16, 2026 23:07
@aibrahim-oai
Copy link
Collaborator

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 6576980f63

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

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 6d1ba5fbd2

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

@charley-oai charley-oai force-pushed the tui-text-elements-history branch from f8d686b to de835bd Compare January 17, 2026 23:05
@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: de835bda7b

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

@charley-oai charley-oai force-pushed the tui-text-elements-history branch from ee48335 to fe178f1 Compare January 18, 2026 01:44
@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: fe178f1285

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

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 74975aef6e

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

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: f51ed3ba08

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

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 6ce06005e0

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

@charley-oai
Copy link
Collaborator Author

@codex review this

@charley-oai charley-oai force-pushed the tui-text-elements-history branch from 1329889 to f96ab1f Compare January 20, 2026 06:39
@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: f96ab1f66b

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

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: cc25597fc6

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

@charley-oai charley-oai merged commit eb90e20 into main Jan 20, 2026
32 checks passed
@charley-oai charley-oai deleted the tui-text-elements-history branch January 20, 2026 07:49
@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants