Skip to content

🧺 refactor: Move the Composer Tray and Staged Items Into @librechat/chat - #17817

Open
berry-13 wants to merge 1 commit into
refactor/chat-composer-filerowfrom
refactor/chat-composer-tray
Open

berry-13 wants to merge 1 commit into
refactor/chat-composer-filerowfrom
refactor/chat-composer-tray

Conversation

@berry-13

@berry-13 berry-13 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

The composer's staged-context tray (file cards first, then the quote and manual-skill chips) and useComposerItems, the hook that merges the staged quotes and skills into one ordered list, still live in the app. A consumer of @librechat/chat could not show what is staged for the next send.

This PR moves the tray to packages/chat/src/components/composer/Tray.tsx, exported as ComposerTray, and the hook to packages/chat/src/react/items.ts, exported from @librechat/chat/react. The tray no longer reaches into the app for uploads: it takes abortUpload as a prop, and the client's Composer/Tray.tsx shrinks to a wrapper that supplies it from useFileHandlingNoChatContext, so ChatForm keeps its import. Rendering and behavior are unchanged, including the focus hand-off after a quote is dismissed.

Stacked on #17801.

Type of change

  • Refactor
  • Tests / tooling / CI

Testing

Tested environments/configuration:

  • Node 22, jsdom (packages/chat and client jest)

Automated tests:

  • Tray.spec.tsx and useComposerItems.spec.tsx moved into packages/chat and run against the English bundle (the mocked keys became copy such as Remove quote and Staged context). The tray spec drops its mock of the app's translation hook and gains a case that abortUpload reaches the file row.
  • packages/chat jest: 175 suites, 2667 tests. Client jest (Chat/Input, ChatView, hooks/Input): 49 suites, 1108 tests. npx tsc --noEmit in packages/chat and client: clean. ESLint, Prettier and the import sorter on touched files: clean.
  • A grep of client, packages and e2e found no remaining reference to the old Tray or hook paths. The existing staged-quotes-show-as-chips-and-remove-one scenario covers the rendered tray in CI.

Screenshots / recordings

No user-facing change. The tray's markup and classes are unchanged.

Risk / compatibility

useComposerItems now reads its atoms from the package's own composer state, the same atoms the client already imported from @librechat/chat/react.

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors
  • Required documentation PR: N/A

@berry-13 berry-13 added 🔨 refactor Code cleanup without new features 🧪 tests Unit/integration test updates labels Nov 5, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T16:38:15.578453Z 4cfbdf2 New commits
🔒 Security Review ✅ Completed 2026-11-05T00:07:31.082013Z 348c619 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@berry-13
berry-13 added this pull request to stack #17848 November 5, 2026 21:36
@berry-13
berry-13 force-pushed the refactor/chat-composer-tray branch from 348c619 to be2131e Compare November 5, 2026 21:36
Copilot AI balanced review requested due to automatic review settings November 5, 2026 21:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@berry-13
berry-13 force-pushed the refactor/chat-composer-tray branch from be2131e to 4cfbdf2 Compare November 6, 2026 16:37

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 refactor Code cleanup without new features 🧪 tests Unit/integration test updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants