Skip to content

tui: split composer attachment and popup state#22581

Merged
etraut-openai merged 1 commit into
mainfrom
etraut/tui-composer-state-cleanup
May 14, 2026
Merged

tui: split composer attachment and popup state#22581
etraut-openai merged 1 commit into
mainfrom
etraut/tui-composer-state-cleanup

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai commented May 14, 2026

Why

ChatComposer currently owns text editing alongside attachment bookkeeping and popup lifecycle state, while BottomPane still triggers a couple of popup resyncs after composer methods that already do that work internally. That blurs the ownership boundary and makes the composer harder to simplify safely.

This PR is part 1 of a two-part cleanup. It peels off the composer state that can move cleanly on its own, so the follow-up can tackle the heavier draft/editing boundary without mixing every concern into one diff.

What changed

  • Move local and remote image bookkeeping, placeholder relabeling, and remote-image keyboard selection into AttachmentState.
  • Move active-popup and popup-dismissal/query bookkeeping into PopupState.
  • Update composer and history-search paths to use those state owners directly.
  • Remove redundant BottomPane popup synchronization after paste handling and insert_str.

Part 2

The follow-up PR will finish the cleanup around the remaining composer boundary: split out the draft/editing-oriented state and footer/status presentation concerns that still live in ChatComposer, then revisit the leftover BottomPane pass-throughs once those ownership lines are explicit. The goal is for ChatComposer to coordinate a few focused collaborators instead of continuing to be the landing zone for every input-path concern.

Verification

Did manual smoke tests.

Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai left a comment

Choose a reason for hiding this comment

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

Did a smoke test with some composer features and it worked as expected. Code looks good as well.

@etraut-openai etraut-openai merged commit a5040d0 into main May 14, 2026
45 of 47 checks passed
@etraut-openai etraut-openai deleted the etraut/tui-composer-state-cleanup branch May 14, 2026 16:04
@github-actions github-actions Bot locked and limited conversation to collaborators May 14, 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.

2 participants