Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c19ea17464
ℹ️ 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".
| jest.mock('~/hooks/Files', () => ({ | ||
| useFileDeletion: (args: unknown) => mockUseFileDeletion(args), | ||
| })); |
There was a problem hiding this comment.
Test the files host with the real deletion hooks
The new host-adapter suite mocks both useFileDeletion and useDeleteFilesMutation, contrary to the repository's explicit testing rule to mock only external HTTP APIs or uncontrollable services. Consequently, these tests verify argument forwarding but never exercise the new adapter together with the actual deletion lifecycle; the separate deletion tests also supply their own host rather than appFilesHost. Render the real app host with the required providers and mock the HTTP boundary so the extracted wiring is covered without replacing its internal collaborators.
AGENTS.md reference: AGENTS.md:L211-L214
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60d6ec603a
ℹ️ 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".
| jest.mock('../FileContainer', () => ({ | ||
| __esModule: true, | ||
| default: function MockFileContainer({ |
There was a problem hiding this comment.
Exercise the real file card in the fallback deletion test
The new fallback suite replaces FileContainer with a synthetic button, contrary to the repository's explicit rule to mock only external HTTP APIs or uncontrollable services. This means the no-host deletion test can pass even if the real attachment card fails to expose or invoke its remove action. Render the real FileContainer and interact with its remove control so the test covers the user-facing fallback path rather than only callback forwarding.
AGENTS.md reference: AGENTS.md:L211-L214
Useful? React with 👍 / 👎.
…y the Service Call
eb6aa46 to
38fb656
Compare
Summary
The staged attachment row in the composer (
FileRow, with its image previews, file cards, upload progress and pasted-text actions) still lives inclient/src/components/Chat/Input/Files/FileRow.tsx, and it reaches into the app for the delete mutation and the cached local previews. A consumer of@librechat/chatcould not render the composer's attachments.This PR moves the row to
packages/chat/src/components/composer/files/FileRow.tsxand exportsFileRowandFileRowWrapperfrom@librechat/chat/components. The two app capabilities becomeFilesHostmembers:useDeleteFile(scoped by agent, assistant, tool resource and index) andgetPreviewUrl. The client fills them inFilesHostContext.tsxwith the same delete mutation anduseFileDeletioncall the row made before; without a host, the package falls back to removing the file from the staged map. The old client path re-exports the package row.Stacked on #17799.
Type of change
Testing
Tested environments/configuration:
Automated tests:
FileRow.spec.tsxmoved topackages/chat/src/components/composer/files/__tests__and now runs against a fakeFilesHost. NewFileRowFallback.spec.tsxcovers the row with no host, andFilesHostContext.spec.tsxcovers the app's delete scope and preview lookup.composer/files): 66/66. Client jest (FilesHostContext,useFileDeletion,Input/Files): 37/37.npx tsc --noEmitin packages/chat: clean. ESLint on touched files: clean.Screenshots / recordings
No user-facing change. The row's markup and classes are unchanged.
Risk / compatibility
FilesHostgains two required members, so any other host must supply them. The only host in the repo is the client's.Checklist