Skip to content

fix: correct zustand useShallow import path in AppModals#484

Merged
pedramamini merged 1 commit intomainfrom
fix/appmodals-zustand-import
Mar 1, 2026
Merged

fix: correct zustand useShallow import path in AppModals#484
pedramamini merged 1 commit intomainfrom
fix/appmodals-zustand-import

Conversation

@pedramamini
Copy link
Collaborator

@pedramamini pedramamini commented Mar 1, 2026

Summary

  • Fixed incorrect useShallow import path in AppModals.tsx from zustand/shallow to zustand/react/shallow
  • The wrong path caused useShallow to resolve as unknown in zustand 4.5.x, cascading into 30+ type errors on destructured modal properties

Test plan

  • npm run lint passes
  • npm run lint:eslint passes
  • npm run test passes (508 files, 21,547 tests, 0 failures)

Summary by CodeRabbit

  • Chores
    • Updated internal module dependencies for improved code organization.

Note: This release contains internal maintenance updates with no user-visible changes or new features.

The import was using `zustand/shallow` which doesn't export `useShallow`
in zustand 4.5.x, causing it to resolve as `unknown` and cascading 30+
type errors. The correct path is `zustand/react/shallow`.
@coderabbitai
Copy link

coderabbitai bot commented Mar 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3dda7b7 and 2f7b55d.

📒 Files selected for processing (1)
  • src/renderer/components/AppModals.tsx

📝 Walkthrough

Walkthrough

The import path for useShallow in AppModals.tsx is updated from zustand/shallow to zustand/react/shallow, reflecting a change in the zustand library's export structure.

Changes

Cohort / File(s) Summary
Import Path Update
src/renderer/components/AppModals.tsx
Updated useShallow import from zustand/shallow to zustand/react/shallow.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: correcting the import path for zustand's useShallow hook from 'zustand/shallow' to 'zustand/react/shallow' in AppModals.tsx.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/appmodals-zustand-import

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link

greptile-apps bot commented Mar 1, 2026

Greptile Summary

This PR corrects the useShallow import path in AppModals.tsx to align with zustand 5.x's module structure. The change from zustand/shallow to zustand/react/shallow resolves type errors where useShallow was incorrectly resolving as unknown.

  • The fix is consistent with the import pattern already used in SessionList.tsx
  • No other files require updating (verified via codebase search)
  • All tests and linting pass successfully

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • Single-line import path correction that fixes type errors. The fix aligns with zustand 5.x conventions and matches existing usage elsewhere in the codebase. All tests and linting pass.
  • No files require special attention

Important Files Changed

Filename Overview
src/renderer/components/AppModals.tsx Fixed useShallow import path from zustand/shallow to zustand/react/shallow for zustand 5.x compatibility

Last reviewed commit: 2f7b55d

@pedramamini pedramamini merged commit 2f7b55d into main Mar 1, 2026
4 of 5 checks passed
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