Skip to content

🤖 feat: allow collapsing attached reviews in the chat decoration#3486

Open
ammar-agent wants to merge 1 commit into
mainfrom
chat-decoration-3gsj
Open

🤖 feat: allow collapsing attached reviews in the chat decoration#3486
ammar-agent wants to merge 1 commit into
mainfrom
chat-decoration-3gsj

Conversation

@ammar-agent

Copy link
Copy Markdown
Collaborator

Summary

Make the "Attached Reviews" panel in the chat composer collapsible by rendering it through the shared ChatInputDecoration primitive, so a pending message with many attached reviews can be tucked away without detaching them.

Background

Reviews attached to the pending message were always rendered fully expanded above the textarea. When several reviews are attached, the panel could consume a large portion of the composer area and push the input around. Every other composer-adjacent decoration (pending reviews banner, pinned TODO list, queued message, background processes) already uses the collapsible ChatInputDecoration chrome; the attached-reviews panel was the odd one out.

Implementation

  • AttachedReviewsPanel now wraps its contents in ChatInputDecoration:
    • Collapsed summary shows the review icon + attached count.
    • Expanded body keeps the existing review blocks and the "Clear all" action (shown when more than one review is attached).
  • Expansion intent persists per-workspace via usePersistedState under a new getAttachedReviewsExpandedKey(workspaceId) storage key, defaulting to expanded to preserve the prior always-visible behavior.
  • The panel renders inside the chat-input card (which already supplies the gutter), so the decoration's top border + horizontal padding are dropped and a bottom divider is kept above the textarea, matching the panel's prior placement.
  • ChatInput passes workspaceId to the panel (only rendered in the workspace variant).

Validation

  • make typecheck, make static-check, and targeted eslint on the touched files all pass.

Risks

Low. Scope is limited to the composer's attached-reviews preview; detach/clear/edit handlers are unchanged, and the default expanded state preserves existing behavior. Worst case is a per-workspace UI preference being mis-persisted, which self-heals on toggle.


Generated with mux • Model: anthropic:claude-opus-4-8 • Thinking: xhigh • Cost: n/a

Wrap the AttachedReviewsPanel in the ChatInputDecoration primitive so the reviews attached to a pending message can be collapsed/expanded like the other composer decorations. The collapsed/expanded intent persists per-workspace and defaults to expanded to preserve the prior always-visible behavior.
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

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

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.

1 participant