Skip to content

πŸ—‚οΈ refactor: Move Pane Composer Files to Jotai in the Chat Package - #17193

Merged
berry-13 merged 1 commit into
devfrom
refactor/chat-pane-files
Oct 16, 2026
Merged

berry-13 merged 1 commit into
devfrom
refactor/chat-pane-files

Conversation

@berry-13

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

The files staged in each chat pane's composer lived in a Recoil atom family (filesByIndex in client/src/store/families.ts), so useChatHelpers, useNewConvo, useNewChat, the files table and the sign-out reset all reached into ~/store for state that only the chat pane owns.

This moves that state to a Jotai family, filesFamily, under packages/chat/src/react/pane/ (exported from @librechat/chat/react) together with all six consumers. The ExtendedFile type the family holds moves to packages/chat/src/core/files.ts; ~/common re-exports it, so existing imports are unchanged. Behavior is the same: each pane starts with an empty map, and sign-out clears every pane except the kept first one.

Stacked on #17179, which moves the pane preset and option settings the same way; both edit the same consumers. This continues moving feature-owned chat state onto Jotai inside the chat package and cutting the chat hooks' reads of ~/store.

Type of change

  • Refactor

Testing

Tested environments/configuration:

  • No runtime configuration involved; the change swaps the state library with identical defaults and the same consumers.

Automated tests:

  • pane.spec.ts now covers the files family's empty default and per-pane isolation.
  • The useClearStates per-pane reset case now also asserts that staged files are cleared on sign-out.
  • The ChatForm specs read files from the Jotai family and reset it after each test, since the default Jotai store outlives each test's RecoilRoot. The useNewChat and useNewConvo specs back their file maps with the real atom instead of a mocked Recoil hook.
  • npx jest over Chat/Input (including the files table), hooks/Chat/__tests__, useClearStates, hooks/Conversations, useNewConvo and Chat/Menus: 91 suites, 1662 tests passed.
  • npm run typecheck in client and packages/chat: no errors. ESLint, Prettier and import sorting clean on the changed files.

Screenshots / recordings

No user-facing change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-10-16T21:07:25.984258Z 42e672f New commits
πŸ”’ Security Review βœ… Completed 2026-10-16T19:45:56.891767Z 810f98a 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.

@codegraph-librechat codegraph-librechat Bot added the πŸ—ΊοΈ Client UI Foundation codegraph: the taxonomy area this belongs to (classifier, confidence β‰₯ 0.9) label Oct 16, 2026
@berry-13
berry-13 added this pull request to stack #17195 October 16, 2026 21:03
Base automatically changed from refactor/chat-pane-atoms to dev October 16, 2026 21:05
@berry-13
berry-13 force-pushed the refactor/chat-pane-files branch from 810f98a to 42e672f Compare October 16, 2026 21:05
@berry-13
berry-13 merged commit 59849fd into dev Oct 16, 2026
43 checks passed
@berry-13
berry-13 deleted the refactor/chat-pane-files branch October 16, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

πŸ—ΊοΈ Client UI Foundation codegraph: the taxonomy area this belongs to (classifier, confidence β‰₯ 0.9)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant