Conversation
WalkthroughA comprehensive codebase cleanup effort that adds code quality tooling configuration (ts-prune, knip, unimported), migrates test and component imports to path aliases, systematically reduces public API surface by making numerous exports internal, removes unused components and hooks, updates dependencies including Lexical editor packages, and refactors enum values across wave-related modules. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
__tests__/components/groups/page/create/config/wallets/CreateGroupWalletsEmma.test.tsx (1)
6-24: Update mock paths to use path alias for consistency.The import statements on lines 3-4 use the
@/path alias, but thejest.mockcalls still use relative paths without the@/prefix. This creates inconsistency in the codebase.Apply this diff to align the mock paths with the updated import style:
-jest.mock('components/utils/input/emma/EmmaListSearch', () => ({ +jest.mock('@/components/utils/input/emma/EmmaListSearch', () => ({ __esModule: true, default: () => <div data-testid="emma-search" />, })); -jest.mock('components/groups/page/create/config/wallets/GroupCreateWalletsCount', () => ({ +jest.mock('@/components/groups/page/create/config/wallets/GroupCreateWalletsCount', () => ({ __esModule: true, default: ({ removeWallets }: any) => ( <button aria-label="remove" onClick={removeWallets}>remove</button> ), })); jest.mock('@tanstack/react-query', () => ({ useQuery: () => ({ data: [{ wallet: '0xAA' }, { wallet: '0xbb' }], isFetching: false }), })); -jest.mock('services/distribution-plan-api', () => ({ +jest.mock('@/services/distribution-plan-api', () => ({ distributionPlanApiFetch: jest.fn(() => ({ data: [] })), }));__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableRow.test.tsx (1)
9-17: Update jest.mock() paths to use @/ aliases for consistency.The jest.mock() calls still use relative paths without the @/ prefix, which is inconsistent with the updated imports on lines 4-7. For consistency and maintainability, all module paths should follow the same convention.
Apply this diff to align with the @/ alias convention:
-jest.mock('services/distribution-plan-api', () => ({ +jest.mock('@/services/distribution-plan-api', () => ({ distributionPlanApiFetch: jest.fn(async () => ({ success: true, data: [{ wallet: '0x1', amount: 1, phaseId: 'p1', phaseComponentId: 'c1' }] })) })); -jest.mock('components/distribution-plan-tool/common/DistributionPlanTableRowWrapper', () => ({ children }: any) => <tr data-testid="wrapper">{children}</tr>); -jest.mock('components/distribution-plan-tool/common/RoundedJsonIconButton', () => (props: any) => <button data-testid="json-btn" onClick={props.onClick} />); -jest.mock('components/distribution-plan-tool/common/RoundedCsvIconButton', () => (props: any) => <button data-testid="csv-btn" onClick={props.onClick} />); -jest.mock('components/distribution-plan-tool/common/RoundedManifoldIconButton', () => (props: any) => <button data-testid="manifold-btn" onClick={props.onClick} />); -jest.mock('components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableSubscription', () => ({ SubscriptionLinks: () => <div /> })); +jest.mock('@/components/distribution-plan-tool/common/DistributionPlanTableRowWrapper', () => ({ children }: any) => <tr data-testid="wrapper">{children}</tr>); +jest.mock('@/components/distribution-plan-tool/common/RoundedJsonIconButton', () => (props: any) => <button data-testid="json-btn" onClick={props.onClick} />); +jest.mock('@/components/distribution-plan-tool/common/RoundedCsvIconButton', () => (props: any) => <button data-testid="csv-btn" onClick={props.onClick} />); +jest.mock('@/components/distribution-plan-tool/common/RoundedManifoldIconButton', () => (props: any) => <button data-testid="manifold-btn" onClick={props.onClick} />); +jest.mock('@/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableSubscription', () => ({ SubscriptionLinks: () => <div /> }));
🧹 Nitpick comments (1)
__tests__/fixtures/gradientFixtures.ts (1)
3-3: Consider replacingPartial<any>with a typed interface.The
Partial<any>type provides minimal type safety. Consider defining aGradientNFTinterface and usingPartial<GradientNFT>instead for better type checking in tests.For example, you could define an interface and update the function signature:
interface GradientNFT { id: number; contract: string; name: string; owner: string; owner_display: string; boosted_tdh: number; tdh_rank: number; tdh__raw: number; mint_date: string; } const mockGradientNFT = (overrides: Partial<GradientNFT> = {}): GradientNFT => ({
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (44)
.ts-prunerc(1 hunks).unimportedrc.json(1 hunks)__tests__/app/api/farcaster.route.test.ts(2 hunks)__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTable.test.tsx(1 hunks)__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableRow.test.tsx(1 hunks)__tests__/components/drops/create/lexical/plugins/mentions/MentionsTypeaheadMenu.test.tsx(1 hunks)__tests__/components/groups/page/create/config/wallets/CreateGroupWalletsEmma.test.tsx(1 hunks)__tests__/components/groups/page/list/card/utils/GroupCardActionStats.test.tsx(1 hunks)__tests__/components/memes/drops/meme-participation-drop/MemeDropVoteStats.test.tsx(1 hunks)__tests__/components/user/identity/statements/add/UserPageIdentityAddStatements.test.tsx(1 hunks)__tests__/components/utils/CommonFilterTargetSelect.test.tsx(6 hunks)__tests__/components/waves/CreateDropReplying.test.tsx(1 hunks)__tests__/components/waves/drops/winner/WinnerDropBadge.test.tsx(1 hunks)__tests__/components/waves/memes/traits/DropdownTrait.test.tsx(1 hunks)__tests__/components/waves/winners/drops/DefaultWaveWinnerDrop.test.tsx(1 hunks)__tests__/fixtures/gradientFixtures.ts(1 hunks)__tests__/helpers/time.types.test.ts(1 hunks)__tests__/utils/editDropTestUtils.tsx(0 hunks)__tests__/utils/mockFactories.ts(0 hunks)__tests__/utils/testContexts.tsx(0 hunks)__tests__/utils/titleTestUtils.tsx(2 hunks)components/auth/error-boundary/WalletErrorBoundary.tsx(0 hunks)components/auth/error-boundary/index.ts(0 hunks)components/brain/left-sidebar/web/WebBrainLeftSidebarSearchWave.tsx(0 hunks)components/brain/left-sidebar/web/WebBrainLeftSidebarViewChange.tsx(0 hunks)components/distribution-plan-tool/create-custom-snapshots/form/CreateCustomSnapshotForm.tsx(1 hunks)components/drops/create/lexical/plugins/hashtags/HashtagsPlugin.tsx(1 hunks)components/drops/view/part/dropPartMarkdown/renderers.tsx(1 hunks)components/utils/CommonFilterTargetSelect.tsx(0 hunks)components/waves/OpenSeaCard.tsx(0 hunks)components/waves/drops/WaveDropReactions.tsx(1 hunks)components/waves/drops/blankLinePlaceholders.ts(0 hunks)components/waves/drops/reaction-utils.ts(1 hunks)components/waves/ens/types.ts(0 hunks)hooks/errors/WalletConnectionError.ts(0 hunks)hooks/usePopoverPosition.ts(0 hunks)hooks/waves/useWaveScopePermissions.ts(0 hunks)knip.jsonc(1 hunks)package.json(5 hunks)services/websocket/useWaveSubscriptionManager.ts(0 hunks)src/errors/authentication.ts(0 hunks)src/errors/wallet-connection.ts(0 hunks)tests/globalSetup.ts(0 hunks)tests/mocks/walletMock.ts(0 hunks)
💤 Files with no reviewable changes (19)
- components/waves/drops/blankLinePlaceholders.ts
- components/auth/error-boundary/index.ts
- components/waves/OpenSeaCard.tsx
- services/websocket/useWaveSubscriptionManager.ts
- tests/utils/testContexts.tsx
- components/auth/error-boundary/WalletErrorBoundary.tsx
- hooks/usePopoverPosition.ts
- tests/mocks/walletMock.ts
- tests/utils/mockFactories.ts
- components/waves/ens/types.ts
- tests/globalSetup.ts
- hooks/errors/WalletConnectionError.ts
- src/errors/wallet-connection.ts
- components/brain/left-sidebar/web/WebBrainLeftSidebarViewChange.tsx
- hooks/waves/useWaveScopePermissions.ts
- tests/utils/editDropTestUtils.tsx
- src/errors/authentication.ts
- components/brain/left-sidebar/web/WebBrainLeftSidebarSearchWave.tsx
- components/utils/CommonFilterTargetSelect.tsx
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx}: Do not include any comments in the code
Use react-query for data fetching
Always add readonly before propsUse TypeScript across the codebase
Files:
__tests__/components/waves/winners/drops/DefaultWaveWinnerDrop.test.tsxcomponents/waves/drops/reaction-utils.ts__tests__/components/drops/create/lexical/plugins/mentions/MentionsTypeaheadMenu.test.tsxcomponents/drops/view/part/dropPartMarkdown/renderers.tsxcomponents/distribution-plan-tool/create-custom-snapshots/form/CreateCustomSnapshotForm.tsx__tests__/components/user/identity/statements/add/UserPageIdentityAddStatements.test.tsx__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableRow.test.tsxcomponents/drops/create/lexical/plugins/hashtags/HashtagsPlugin.tsx__tests__/utils/titleTestUtils.tsxcomponents/waves/drops/WaveDropReactions.tsx__tests__/fixtures/gradientFixtures.ts__tests__/components/groups/page/create/config/wallets/CreateGroupWalletsEmma.test.tsx__tests__/components/waves/memes/traits/DropdownTrait.test.tsx__tests__/components/waves/drops/winner/WinnerDropBadge.test.tsx__tests__/helpers/time.types.test.ts__tests__/components/waves/CreateDropReplying.test.tsx__tests__/components/utils/CommonFilterTargetSelect.test.tsx__tests__/components/memes/drops/meme-participation-drop/MemeDropVoteStats.test.tsx__tests__/components/groups/page/list/card/utils/GroupCardActionStats.test.tsx__tests__/app/api/farcaster.route.test.ts__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTable.test.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursorrules)
**/*.tsx: Use FontAwesome for icons
Use TailwindCSS for stylingUse React functional components with hooks for UI components
Files:
__tests__/components/waves/winners/drops/DefaultWaveWinnerDrop.test.tsx__tests__/components/drops/create/lexical/plugins/mentions/MentionsTypeaheadMenu.test.tsxcomponents/drops/view/part/dropPartMarkdown/renderers.tsxcomponents/distribution-plan-tool/create-custom-snapshots/form/CreateCustomSnapshotForm.tsx__tests__/components/user/identity/statements/add/UserPageIdentityAddStatements.test.tsx__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableRow.test.tsxcomponents/drops/create/lexical/plugins/hashtags/HashtagsPlugin.tsx__tests__/utils/titleTestUtils.tsxcomponents/waves/drops/WaveDropReactions.tsx__tests__/components/groups/page/create/config/wallets/CreateGroupWalletsEmma.test.tsx__tests__/components/waves/memes/traits/DropdownTrait.test.tsx__tests__/components/waves/drops/winner/WinnerDropBadge.test.tsx__tests__/components/waves/CreateDropReplying.test.tsx__tests__/components/utils/CommonFilterTargetSelect.test.tsx__tests__/components/memes/drops/meme-participation-drop/MemeDropVoteStats.test.tsx__tests__/components/groups/page/list/card/utils/GroupCardActionStats.test.tsx__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTable.test.tsx
__tests__/**
📄 CodeRabbit inference engine (tests/AGENTS.md)
Place Jest test suites under the
__tests__directory mirroring source folders (e.g., components, contexts, hooks, utils)
Files:
__tests__/components/waves/winners/drops/DefaultWaveWinnerDrop.test.tsx__tests__/components/drops/create/lexical/plugins/mentions/MentionsTypeaheadMenu.test.tsx__tests__/components/user/identity/statements/add/UserPageIdentityAddStatements.test.tsx__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableRow.test.tsx__tests__/utils/titleTestUtils.tsx__tests__/fixtures/gradientFixtures.ts__tests__/components/groups/page/create/config/wallets/CreateGroupWalletsEmma.test.tsx__tests__/components/waves/memes/traits/DropdownTrait.test.tsx__tests__/components/waves/drops/winner/WinnerDropBadge.test.tsx__tests__/helpers/time.types.test.ts__tests__/components/waves/CreateDropReplying.test.tsx__tests__/components/utils/CommonFilterTargetSelect.test.tsx__tests__/components/memes/drops/meme-participation-drop/MemeDropVoteStats.test.tsx__tests__/components/groups/page/list/card/utils/GroupCardActionStats.test.tsx__tests__/app/api/farcaster.route.test.ts__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTable.test.tsx
__tests__/components/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (tests/AGENTS.md)
Use
@testing-library/reactand@testing-library/user-eventfor React component tests
Files:
__tests__/components/waves/winners/drops/DefaultWaveWinnerDrop.test.tsx__tests__/components/drops/create/lexical/plugins/mentions/MentionsTypeaheadMenu.test.tsx__tests__/components/user/identity/statements/add/UserPageIdentityAddStatements.test.tsx__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableRow.test.tsx__tests__/components/groups/page/create/config/wallets/CreateGroupWalletsEmma.test.tsx__tests__/components/waves/memes/traits/DropdownTrait.test.tsx__tests__/components/waves/drops/winner/WinnerDropBadge.test.tsx__tests__/components/waves/CreateDropReplying.test.tsx__tests__/components/utils/CommonFilterTargetSelect.test.tsx__tests__/components/memes/drops/meme-participation-drop/MemeDropVoteStats.test.tsx__tests__/components/groups/page/list/card/utils/GroupCardActionStats.test.tsx__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTable.test.tsx
**/__tests__/**
📄 CodeRabbit inference engine (AGENTS.md)
Place tests in
__tests__directories when organizing test suites
Files:
__tests__/components/waves/winners/drops/DefaultWaveWinnerDrop.test.tsx__tests__/components/drops/create/lexical/plugins/mentions/MentionsTypeaheadMenu.test.tsx__tests__/components/user/identity/statements/add/UserPageIdentityAddStatements.test.tsx__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableRow.test.tsx__tests__/utils/titleTestUtils.tsx__tests__/fixtures/gradientFixtures.ts__tests__/components/groups/page/create/config/wallets/CreateGroupWalletsEmma.test.tsx__tests__/components/waves/memes/traits/DropdownTrait.test.tsx__tests__/components/waves/drops/winner/WinnerDropBadge.test.tsx__tests__/helpers/time.types.test.ts__tests__/components/waves/CreateDropReplying.test.tsx__tests__/components/utils/CommonFilterTargetSelect.test.tsx__tests__/components/memes/drops/meme-participation-drop/MemeDropVoteStats.test.tsx__tests__/components/groups/page/list/card/utils/GroupCardActionStats.test.tsx__tests__/app/api/farcaster.route.test.ts__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTable.test.tsx
**/*.test.tsx
📄 CodeRabbit inference engine (AGENTS.md)
When colocating tests with components, name them
ComponentName.test.tsx
Files:
__tests__/components/waves/winners/drops/DefaultWaveWinnerDrop.test.tsx__tests__/components/drops/create/lexical/plugins/mentions/MentionsTypeaheadMenu.test.tsx__tests__/components/user/identity/statements/add/UserPageIdentityAddStatements.test.tsx__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableRow.test.tsx__tests__/components/groups/page/create/config/wallets/CreateGroupWalletsEmma.test.tsx__tests__/components/waves/memes/traits/DropdownTrait.test.tsx__tests__/components/waves/drops/winner/WinnerDropBadge.test.tsx__tests__/components/waves/CreateDropReplying.test.tsx__tests__/components/utils/CommonFilterTargetSelect.test.tsx__tests__/components/memes/drops/meme-participation-drop/MemeDropVoteStats.test.tsx__tests__/components/groups/page/list/card/utils/GroupCardActionStats.test.tsx__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTable.test.tsx
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Mock external dependencies and APIs in tests
Files:
__tests__/components/waves/winners/drops/DefaultWaveWinnerDrop.test.tsx__tests__/components/drops/create/lexical/plugins/mentions/MentionsTypeaheadMenu.test.tsx__tests__/components/user/identity/statements/add/UserPageIdentityAddStatements.test.tsx__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableRow.test.tsx__tests__/components/groups/page/create/config/wallets/CreateGroupWalletsEmma.test.tsx__tests__/components/waves/memes/traits/DropdownTrait.test.tsx__tests__/components/waves/drops/winner/WinnerDropBadge.test.tsx__tests__/helpers/time.types.test.ts__tests__/components/waves/CreateDropReplying.test.tsx__tests__/components/utils/CommonFilterTargetSelect.test.tsx__tests__/components/memes/drops/meme-participation-drop/MemeDropVoteStats.test.tsx__tests__/components/groups/page/list/card/utils/GroupCardActionStats.test.tsx__tests__/app/api/farcaster.route.test.ts__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTable.test.tsx
__tests__/**/{fixtures,helpers}/**
📄 CodeRabbit inference engine (tests/AGENTS.md)
Put shared test fixtures and helpers in dedicated
fixturesandhelperssubfolders within tests
Files:
__tests__/fixtures/gradientFixtures.ts__tests__/helpers/time.types.test.ts
__tests__/app/api/**/?(*.)test.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (tests/AGENTS.md)
Store integration tests for API routes under
app/api
Files:
__tests__/app/api/farcaster.route.test.ts
🧠 Learnings (1)
📚 Learning: 2025-09-28T12:33:30.950Z
Learnt from: CR
PR: 6529-Collections/6529seize-frontend#0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:30.950Z
Learning: Applies to __tests__/components/**/*.{ts,tsx,js,jsx} : Use `testing-library/react` and `testing-library/user-event` for React component tests
Applied to files:
__tests__/components/waves/memes/traits/DropdownTrait.test.tsx
🧬 Code graph analysis (1)
__tests__/components/utils/CommonFilterTargetSelect.test.tsx (1)
components/utils/CommonFilterTargetSelect.tsx (1)
CommonFilterTargetSelect(13-55)
🔇 Additional comments (27)
__tests__/components/memes/drops/meme-participation-drop/MemeDropVoteStats.test.tsx (1)
4-4: LGTM! Import path updated to use path alias.The import path has been correctly updated to use the path alias
@/generated/models/, which aligns with the PR's objective to consolidate import paths and clean up the codebase.__tests__/components/user/identity/statements/add/UserPageIdentityAddStatements.test.tsx (1)
4-4: LGTM! Import path correctly updated.The import path has been properly corrected to reference the generated models from the source tree rather than from a test-specific location. This aligns with the PR's objective of consolidating import paths.
__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableRow.test.tsx (1)
4-7: LGTM! Path alias imports applied correctly.The conversion from relative imports to @/ alias-based imports is correct and aligns with the PR's objective to consolidate import paths across the codebase.
__tests__/components/waves/memes/traits/DropdownTrait.test.tsx (1)
2-2: LGTM! Import path updated to use alias.The import path correctly uses the
@/alias, aligning with the PR's objective to consolidate import paths.__tests__/components/utils/CommonFilterTargetSelect.test.tsx (2)
1-4: LGTM! Clean refactor of imports.The import consolidation correctly uses path aliases and imports the canonical
ProfileActivityFilterTargetTypedirectly from@/enumsinstead of the re-exported alias. This aligns with the PR's objective of cleaning up unused code and consolidating import paths.
13-70: LGTM! Consistent type refactoring throughout test cases.All enum references have been correctly updated from
FilterTargetTypetoProfileActivityFilterTargetType, maintaining consistency with the component's type signature. The test logic remains unchanged and continues to properly validate rendering, click interactions, and keyboard navigation.components/distribution-plan-tool/create-custom-snapshots/form/CreateCustomSnapshotForm.tsx (1)
26-27: LGTM - Appropriate visibility change.Making these constants internal is correct since they're not used outside this module. The constants are properly utilized within the file and passed as props to child components where needed.
components/waves/drops/reaction-utils.ts (1)
24-41: No issues found—export removal is appropriate cleanup.The verification confirms that
duplicateProfilesWithoutUseris not imported or used anywhere else in the codebase. Since the function remains available for internal use within the file (line 50), removing the export is appropriate cleanup and aligns with the PR objective.__tests__/components/drops/create/lexical/plugins/mentions/MentionsTypeaheadMenu.test.tsx (1)
8-8: LGTM! Path alias improves consistency.The import path update to use the
@/alias enhances maintainability and aligns with the project's standardization effort.__tests__/components/waves/winners/drops/DefaultWaveWinnerDrop.test.tsx (1)
1-1: LGTM! Consistent path alias usage.The import update standardizes module resolution across the test suite.
__tests__/components/groups/page/list/card/utils/GroupCardActionStats.test.tsx (1)
3-6: LGTM! Consistent path alias usage across imports.All import paths now use the
@/alias, improving consistency and maintainability.__tests__/components/waves/CreateDropReplying.test.tsx (1)
4-4: LGTM! Corrected import path.Good catch removing the incorrect
__tests__directory from the generated models import path. Generated types should be imported from@/generated, not@/__tests__/generated.__tests__/components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTable.test.tsx (1)
3-4: LGTM! Standardized import paths.The path alias updates align with the project-wide cleanup effort.
__tests__/helpers/time.types.test.ts (1)
1-1: LGTM! Path alias applied.The import standardization improves consistency across the test suite.
__tests__/components/waves/drops/winner/WinnerDropBadge.test.tsx (1)
2-2: LGTM! Import path standardized.The path alias update enhances maintainability.
__tests__/app/api/farcaster.route.test.ts (1)
48-48: LGTM! Both static and dynamic imports standardized.The path alias updates ensure consistent module resolution for both type declarations and runtime imports.
Also applies to: 61-61
__tests__/fixtures/gradientFixtures.ts (1)
3-14: Export removal is safe;mockGradientNFTis only used internally.Verification confirms that
mockGradientNFT(line 3) is not imported anywhere else in the codebase and is only referenced internally at line 18 bymockGradientCollection. The export removal is appropriate and introduces no breaking changes.__tests__/utils/titleTestUtils.tsx (2)
1-1: LGTM! Type-only import improves bundle efficiency.The change to use a type-only import for
ReactNodeand update the type annotation accordingly is a good practice that avoids importing unnecessary runtime code.Also applies to: 21-21
14-23: No issues found. ThemockTitleContextModule()pattern is correct.The function is called at module level (line 98 in Auth.test.tsx) before tests execute, and TitleContext is never directly imported at module level in that file. Jest.mock() hoisting requirements are satisfied, as the mock is established before any imports of the mocked module occur. While the pattern differs from direct jest.mock() calls elsewhere in the same file, it functions correctly and poses no risk.
components/waves/drops/WaveDropReactions.tsx (1)
50-50: Verified: no external usage ofWaveDropReaction.Search confirms that only
WaveDropReactions(the public export) is imported across the codebase. The internalWaveDropReactioncomponent has no external dependencies, making this refactoring safe..ts-prunerc (1)
1-4: LGTM! Well-structured ts-prune configuration.The configuration appropriately excludes generated files, tests, stories, and Next.js special files (middleware, route handlers, app/pages directories) from unused export checks. This aligns well with the PR's goal of adding static analysis tooling.
knip.jsonc (1)
1-41: LGTM! Comprehensive Knip configuration.The configuration is well-structured with:
- Appropriate project and entry patterns for Next.js
- Sensible ignore rules for generated code
includeEntryExports: truefor better dead code detection in private repostreatConfigHintsAsErrors: truefor CI enforcementThe inline comments make the configuration maintainable.
.unimportedrc.json (1)
1-21: LGTM! Well-configured unimported setup.The configuration properly defines:
- Entry points for Next.js App Router and Pages Router
- Path alias
@/*→./src/*for import resolution- Appropriate ignore patterns for build artifacts and generated code
- Comprehensive scanned directories
This aligns with the broader PR goal of adding static analysis tooling.
package.json (3)
34-38: LGTM! Well-structured deadcode analysis scripts.The new scripts provide comprehensive dead code detection:
deadcode:knip- Static analysis via Knipdeadcode:exports- Unused export detection with strict error modedeadcode:deps- Dependency analysis with appropriate ignores for dev toolingdeadcode- Convenient wrapper running all checksThe
--errorflag on ts-prune ensures CI enforcement.
143-184: LGTM! DevDependencies updated to support analysis tooling.The changes add necessary tooling for the cleanup effort:
@jest/globals,babel-jest- Testing infrastructuredepcheck,ts-prune- Dead code analysisistanbul-lib-coverage- Coverage toolingknipupdated to 5.66.3 (substantial version bump from 5.50.5)Note:
pino-prettymoved from devDependencies to dependencies (line 114), which is appropriate if it's used at runtime.
60-68: Lexical packages are all actively used in the codebase.All nine Lexical packages added in package.json are imported and actively utilized across multiple components and plugins. Each package serves a specific purpose: markdown transformation, editor plugins (hashtags, mentions, emoji, enter key handling), and core node types (code, link, list, table, rich-text). The additions are justified and necessary.
components/drops/create/lexical/plugins/hashtags/HashtagsPlugin.tsx (1)
286-286: No issues found—export change is safe.Verification confirms that
checkForAtSignHashtagsis not referenced anywhere outside the file, so removing it from the public API export does not break any external dependencies. The function remains available for internal use within the module.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
utils/error-sanitizer.ts (1)
242-265: Remove unused functiongetErrorCodeat lines 242-265.Verification confirms this function is never called anywhere in the codebase and should be removed as part of this "Clean unused" PR. The search found zero imports and zero internal/external calls to
getErrorCode. Removing it will align with the PR's objective and reduce code clutter.src/errors/wallet.ts (1)
9-14: AddObject.setPrototypeOf(this, WalletValidationError.prototype)to maintain correct prototype chain.
WalletValidationErroris missing theObject.setPrototypeOfcall that all other exported error classes in this file use. Without it, instances will incorrectly haveWalletConnectionError.prototypeinstead ofWalletValidationError.prototype, breaking the prototype chain. The internalWalletConnectionErrorbase class appropriately remains unexported.export class WalletValidationError extends WalletConnectionError { constructor(message: string, cause?: unknown) { super(`Wallet validation failed: ${message}`, cause); this.name = 'WalletValidationError'; Object.setPrototypeOf(this, WalletValidationError.prototype); } }utils/wallet-validation.utils.ts (3)
121-121: Remove stale comment.This comment states that individual validators are exported, but they are no longer publicly exported after the refactoring. Only
validateWalletSafelyremains in the public API.Apply this diff:
-// Export individual validators for reuse in other parts of the application
76-88: Fix empty string handling invalidatePrivateKey.The check
!wallet.private_keyon line 77 returns early for empty strings without validation. Sinceprivate_keyis a required string field in theAppWalletinterface and validation is fail-fast, empty strings should be rejected rather than silently skipped.Change the early return to throw an error for empty strings:
if (!wallet.private_key) { throw new WalletSecurityError('Private key is required') }This ensures empty strings are caught during the security validation chain and aligns with the fail-fast validation approach in
validateWalletSafely.
93-107: Add mnemonic word count validation using the provided diff.The review correctly identifies that word count validation is missing. BIP39 mnemonics must be 12, 15, 18, 21, or 24 words. The constants
MIN_MNEMONIC_WORDSandMAX_MNEMONIC_WORDSare defined at lines 10–11 and the proposed diff correctly applies them.The early return on line 94 follows the intentional optional field pattern used consistently in the codebase (see
validatePrivateKeyat line 77), so this is not a security issue.Apply the diff as proposed:
const validateMnemonic = (wallet: AppWallet): void => { if (!wallet.mnemonic) { return } if (typeof wallet.mnemonic !== 'string') { throw new WalletSecurityError('Mnemonic must be a string') } const words = wallet.mnemonic.trim().split(/\s+/) if (words.some(word => !word || word.length === 0)) { throw new WalletSecurityError('Mnemonic contains empty words - security violation detected') } + + if (words.length < MIN_MNEMONIC_WORDS || words.length > MAX_MNEMONIC_WORDS) { + throw new WalletSecurityError(`Mnemonic must contain between ${MIN_MNEMONIC_WORDS} and ${MAX_MNEMONIC_WORDS} words`) + } }
🧹 Nitpick comments (4)
src/errors/appkit-initialization.ts (2)
9-14: Consider adding prototype fix for consistency.For consistency with the parent class and to ensure proper prototype chain behavior at all inheritance levels, consider adding
Object.setPrototypeOf(this, AppKitValidationError.prototype)after setting the name.Apply this diff:
export class AppKitValidationError extends AppKitInitializationError { constructor(message: string, cause?: unknown) { super(`AppKit validation failed: ${message}`, cause); this.name = 'AppKitValidationError'; + Object.setPrototypeOf(this, AppKitValidationError.prototype); } }
1-7: Verify removal is safe; add Object.setPrototypeOf to AppKitValidationError for consistency.The export removal of
AppKitInitializationErroris safe—no external imports found. TheObject.setPrototypeOfaddition on line 5 correctly fixes the Error prototype chain.However,
AppKitValidationError(line 9-14) should also includeObject.setPrototypeOffor consistency and proper Error subclass behavior:export class AppKitValidationError extends AppKitInitializationError { constructor(message: string, cause?: unknown) { super(`AppKit validation failed: ${message}`, cause); this.name = 'AppKitValidationError'; Object.setPrototypeOf(this, AppKitValidationError.prototype); } }utils/wallet-validation.utils.ts (2)
10-11: Unused constants are defined for mnemonic validation.
MIN_MNEMONIC_WORDSandMAX_MNEMONIC_WORDSare defined but not currently used in the validation logic. These should be utilized for word count validation invalidateMnemonic(see previous comment).
4-4: Consider removing comments per coding guidelines.The coding guidelines specify: "Do not include any comments in the code" for TypeScript files. While these JSDoc comments provide useful documentation, they violate the project's guidelines. Consider removing them or documenting these functions through other means (e.g., type definitions, naming conventions, external documentation).
As per coding guidelines
Also applies to: 13-15, 22-24, 39-41, 56-58, 73-75, 90-92, 109-111
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
__tests__/utils/titleTestUtils.tsx(2 hunks)components/waves/memes/traits/schema.ts(1 hunks)components/waves/specs/groups/group/edit/buttons/utils/waveGroupEdit.ts(0 hunks)components/waves/specs/groups/group/edit/utils/waveGroupUpdate.ts(0 hunks)constants/sidebar.ts(0 hunks)helpers/WalletHelpers.ts(0 hunks)hooks/groups/useGroupMutations.ts(0 hunks)hooks/useVirtualizedWaves.ts(1 hunks)lib/ens/detect.ts(0 hunks)lib/security/urlGuard.ts(0 hunks)services/groups/groupMutations.ts(1 hunks)src/errors/appkit-initialization.ts(1 hunks)src/errors/wallet.ts(2 hunks)src/services/farcaster/url.ts(0 hunks)tests/testHelpers.ts(0 hunks)utils/error-sanitizer.ts(1 hunks)utils/wallet-validation.utils.ts(6 hunks)
💤 Files with no reviewable changes (9)
- components/waves/specs/groups/group/edit/utils/waveGroupUpdate.ts
- hooks/groups/useGroupMutations.ts
- helpers/WalletHelpers.ts
- components/waves/specs/groups/group/edit/buttons/utils/waveGroupEdit.ts
- src/services/farcaster/url.ts
- constants/sidebar.ts
- lib/ens/detect.ts
- lib/security/urlGuard.ts
- tests/testHelpers.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/utils/titleTestUtils.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx}: Do not include any comments in the code
Use react-query for data fetching
Always add readonly before propsUse TypeScript across the codebase
Files:
services/groups/groupMutations.tshooks/useVirtualizedWaves.tsutils/error-sanitizer.tscomponents/waves/memes/traits/schema.tssrc/errors/wallet.tsutils/wallet-validation.utils.tssrc/errors/appkit-initialization.ts
🧬 Code graph analysis (2)
src/errors/wallet.ts (1)
components/auth/SeizeConnectContext.tsx (1)
WalletConnectionError(32-41)
utils/wallet-validation.utils.ts (1)
components/app-wallets/AppWalletsContext.tsx (1)
AppWallet(16-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
services/groups/groupMutations.ts (1)
32-50: Good encapsulation improvement.Narrowing
sanitiseGroupPayloadfrom exported to module-private reduces the public API surface. Verification confirms no external modules import this function—it is used only within this file (line 147). The implementation correctly performs defensive cloning of arrays.hooks/useVirtualizedWaves.ts (1)
12-12: Approved: SENTINEL_HEIGHT safe to keep private.Verification confirms
SENTINEL_HEIGHTis only used internally withinhooks/useVirtualizedWaves.ts(lines 63 and 66) with no external imports anywhere in the codebase. Removing the export is a safe refactor that appropriately reduces the public API surface.components/waves/memes/traits/schema.ts (1)
129-129: No issues found. The export removal is safe.Verification confirms that
MEME_NAME_OPTIONSis not imported or referenced anywhere outsideschema.ts, making the removal of the export a valid cleanup that reduces unnecessary public API surface.src/errors/wallet.ts (2)
16-26: LGTM!The
WalletInitializationErrorimplementation is correct with proper prototype handling and clear error semantics.
1-7:WalletValidationErrorinwallet.tsextends non-exported parent class; design inconsistency with duplicate inwallet-validation.tsThe codebase has
WalletValidationErrordefined in two separate files with different implementations:
src/errors/wallet.ts: extendsWalletConnectionError(which is no longer exported)src/errors/wallet-validation.ts: extendsErrordirectlyFiles import inconsistently from both. Additionally,
WalletConnectionErrorinwallet.tsis now internal and unused (no imports found in the codebase). Clarify the intent: shouldWalletConnectionErrorremain at all, and consolidateWalletValidationErrorto a single authoritative location to avoid confusion between the two implementations.utils/wallet-validation.utils.ts (1)
16-71: LGTM! Core validators and orchestration are well-implemented.The refactoring to arrow functions is appropriate, and the validation logic for wallet existence, address format, address hash, and name constraints is correct. The main
validateWalletSafelyfunction properly orchestrates all validators in sequence.Also applies to: 112-119
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
utils/wallet-validation.utils.ts (1)
60-72: Correct MIN_PRIVATE_KEY_LENGTH to match encrypted private key format.The validation is fundamentally broken. The
encryptData()function returns formativHex:authTagHex:encryptedHex(e.g., 32 hex chars + ":" + 32 hex chars + ":" + encrypted data). This minimum requires ~67 characters, butMIN_PRIVATE_KEY_LENGTHis set to 32, which would reject all properly encrypted private keys.Update
utils/wallet-validation.utils.tsline 8:const MIN_PRIVATE_KEY_LENGTH = 67This ensures encrypted private keys (minimum format:
{32chars}:{32chars}:{data}) pass validation.components/waves/memes/traits/schema.ts (1)
79-85: Exported union references private types; fix type visibility issue before declaration emit is enabledThe
FieldDefinitionunion (line 115-119) references privateTextFieldDefinitionandBooleanFieldDefinition, which will cause "exported type has or is using private name" errors if declaration emit is enabled. Additionally,traitDefinitions(line 148) andgetFormSections(line 477-479) expose the privateSectionDefinitiontype. While.d.tsemit is currently disabled, this creates a latent type safety problem that should be fixed now.Inline the TEXT and BOOLEAN variants in the union (lines 115-119):
-export type FieldDefinition = - | TextFieldDefinition - | NumberFieldDefinition - | BooleanFieldDefinition - | DropdownFieldDefinition; +export type FieldDefinition = + | (BaseFieldDefinition & { + readonly type: FieldType.TEXT; + readonly readOnly?: boolean; + readonly placeholder?: string; + readonly initialValue?: string; + }) + | NumberFieldDefinition + | (BaseFieldDefinition & { + readonly type: FieldType.BOOLEAN; + readonly initialValue?: boolean; + }) + | DropdownFieldDefinition;For
SectionDefinition: either export it or inline its definition in the return types oftraitDefinitionsandgetFormSections.
♻️ Duplicate comments (1)
components/waves/memes/traits/schema.ts (1)
100-103: Same private-name exposure via FieldDefinition unionBooleanFieldDefinition is now private but still named in the exported FieldDefinition union; handle via the union inlining fix above.
🧹 Nitpick comments (8)
components/drops/view/part/dropPartMarkdown/youtubePreview.tsx (2)
48-89: Consider using react-query for data fetching.The manual data fetching implementation with useEffect works but could be simplified using react-query, which would also align with the coding guidelines and provide built-in caching, refetching, and error handling.
As per coding guidelines.
133-141: Consider using FontAwesome for the play icon.The inline SVG works but using FontAwesome (e.g.,
faPlayfrom@fortawesome/free-solid-svg-icons) would align with the coding guidelines for icon usage.As per coding guidelines.
components/waves/drops/LightDrop.tsx (1)
4-6: Consider removing the unuseddropprop.The
dropprop is declared but never referenced in the component body. Given the PR's goal to "clean unused" code, consider removing it unless it's being kept for future use or API compatibility.Apply this diff if the prop is truly unused:
-interface LightDropProps { - readonly drop: ApiLightDrop; -} - -const LightDrop: FC<LightDropProps> = ({ drop }) => { +const LightDrop: FC = () => {Also applies to: 8-8
hooks/groups/useGroupMutations.ts (1)
36-39: Consider exporting parameter types for better developer experience.
TestArgsandUpdateVisibilityArgsare parameter types for public methodsrunTestandupdateVisibility. While consumers can construct objects inline, exporting these interfaces would improve type safety and discoverability, especially sinceSubmitArgs(line 16) remains exported.-interface TestArgs { +export interface TestArgs { readonly payload: ApiCreateGroup; readonly nameFallback: string; }-interface UpdateVisibilityArgs { +export interface UpdateVisibilityArgs { readonly groupId: string; readonly visible: boolean; readonly oldVersionId?: string | null; readonly skipAuth?: boolean; }Also applies to: 58-63
utils/wallet-validation.utils.ts (1)
74-92: Consider stricter BIP39 mnemonic validation.The current validation allows any word count between 12 and 24. However, BIP39 standard mnemonics are specifically 12, 15, 18, 21, or 24 words. Consider enforcing these exact counts for stricter compliance.
Apply this diff to enforce BIP39-compliant word counts:
+const VALID_MNEMONIC_WORD_COUNTS = [12, 15, 18, 21, 24] + const validateMnemonic = (wallet: AppWallet): void => { if (!wallet.mnemonic) { return } if (typeof wallet.mnemonic !== 'string') { throw new WalletSecurityError('Mnemonic must be a string') } const words = wallet.mnemonic.trim().split(/\s+/) if (words.some(word => !word || word.length === 0)) { throw new WalletSecurityError('Mnemonic contains empty words - security violation detected') } - if (words.length < MIN_MNEMONIC_WORDS || words.length > MAX_MNEMONIC_WORDS) { - throw new WalletSecurityError(`Mnemonic must contain between ${MIN_MNEMONIC_WORDS} and ${MAX_MNEMONIC_WORDS} words`) + if (!VALID_MNEMONIC_WORD_COUNTS.includes(words.length)) { + throw new WalletSecurityError(`Mnemonic must contain exactly ${VALID_MNEMONIC_WORD_COUNTS.join(', ')} words (BIP39 standard)`) } }components/header/HeaderNavConfig.ts (3)
9-13: Make config shapes immutable withreadonly(aligns with guidelines).These are static config objects. Adding
readonlyto fields (and arrays asreadonly) improves safety and matches the “always add readonly before props” guidance.-interface NavSection { - name: string; - items: NavLink[]; - hasDivider?: boolean; -} +interface NavSection { + readonly name: string; + readonly items: readonly NavLink[]; + readonly hasDivider?: boolean; +}
15-22: StandardizeclassNameshape and harden collections.To simplify consumers, consider making
classNameconsistently a function and mark collections readonly.-interface NavDropdown { - title: string; - condition?: (context: NavContext) => boolean; - className?: string | ((context: NavContext) => string); - items?: NavLink[]; - sections?: NavSection[]; - hasDividerAfter?: boolean; -} +interface NavDropdown { + readonly title: string; + readonly condition?: (context: NavContext) => boolean; + readonly className?: (context: NavContext) => string; + readonly items?: readonly NavLink[]; + readonly sections?: readonly NavSection[]; + readonly hasDividerAfter?: boolean; +}If keeping the union for back-compat, still add
readonlyto properties and arrays.
3-7: ApplyreadonlytoNavLinkfields for immutability.-interface NavLink { - name: string; - path: string; - condition?: (context: NavContext) => boolean; -} +interface NavLink { + readonly name: string; + readonly path: string; + readonly condition?: (context: NavContext) => boolean; +}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (70)
__tests__/components/drops/view/part/dropPartMarkdown/linkHandlersRegistry.test.tsx(0 hunks)__tests__/components/waves/WaveDropQuoteWithSerialNo.test.tsx(1 hunks)__tests__/utils/testContexts.tsx(1 hunks)app/api/farcaster/route.ts(4 hunks)app/api/open-graph/compound/registry.ts(1 hunks)app/nextgen/token/[token]/[[...view]]/page-utils.ts(1 hunks)codex/STATE.md(1 hunks)codex/tickets/TKT-0016.md(1 hunks)components/brain/my-stream/layout/LayoutContext.tsx(1 hunks)components/brain/notifications/index.tsx(0 hunks)components/common/CompactMenu.tsx(1 hunks)components/compact-menu/index.tsx(1 hunks)components/drops/view/part/dropPartMarkdown/content.tsx(2 hunks)components/drops/view/part/dropPartMarkdown/handlers/compound.tsx(0 hunks)components/drops/view/part/dropPartMarkdown/handlers/ens.tsx(0 hunks)components/drops/view/part/dropPartMarkdown/handlers/googleWorkspace.tsx(0 hunks)components/drops/view/part/dropPartMarkdown/handlers/index.ts(0 hunks)components/drops/view/part/dropPartMarkdown/handlers/seize.tsx(0 hunks)components/drops/view/part/dropPartMarkdown/handlers/tiktok.tsx(0 hunks)components/drops/view/part/dropPartMarkdown/handlers/youtube.tsx(0 hunks)components/drops/view/part/dropPartMarkdown/linkHandlers.tsx(1 hunks)components/drops/view/part/dropPartMarkdown/linkTypes.ts(1 hunks)components/drops/view/part/dropPartMarkdown/pepe.tsx(2 hunks)components/drops/view/part/dropPartMarkdown/tiktok.ts(1 hunks)components/drops/view/part/dropPartMarkdown/youtube.ts(1 hunks)components/drops/view/part/dropPartMarkdown/youtubePreview.tsx(1 hunks)components/header/HeaderNavConfig.ts(3 hunks)components/meme-calendar/meme-calendar.szn1.ts(1 hunks)components/navigation/navTypes.ts(4 hunks)components/waves/FarcasterCard.tsx(2 hunks)components/waves/compound/types.ts(7 hunks)components/waves/drop/types/slider.types.ts(1 hunks)components/waves/drops/EditDropLexical.tsx(1 hunks)components/waves/drops/LightDrop.tsx(1 hunks)components/waves/drops/WaveDropQuoteWithSerialNo.tsx(1 hunks)components/waves/drops/normalizeDropMarkdown.ts(0 hunks)components/waves/drops/reaction-utils.ts(2 hunks)components/waves/drops/wave-drops-all/index.tsx(1 hunks)components/waves/memes/traits/schema.ts(3 hunks)components/waves/specs/groups/group/edit/WaveGroupEditButtons.tsx(1 hunks)components/waves/specs/groups/group/edit/buttons/hooks/useWaveGroupEditButtonsController.ts(1 hunks)contexts/wave/hooks/types.ts(1 hunks)contexts/wave/hooks/useEnhancedDmWavesList.ts(1 hunks)contexts/wave/utils/wave-messages-utils.ts(1 hunks)entities/ISeason.ts(0 hunks)entities/ITDH.ts(0 hunks)helpers/Types.tsx(0 hunks)helpers/video.helpers.ts(1 hunks)hooks/breadcrumbs.config.ts(1 hunks)hooks/breadcrumbs.types.ts(1 hunks)hooks/groups/useGroupMutations.ts(3 hunks)hooks/useAuthenticatedContent.tsx(2 hunks)hooks/useCreateModalState.ts(1 hunks)hooks/useDropMessages.ts(1 hunks)hooks/useHlsPlayer.ts(1 hunks)knip.jsonc(1 hunks)lib/cache/lruTtl.ts(1 hunks)lib/security/urlGuard.ts(3 hunks)lib/text/html.ts(1 hunks)package.json(5 hunks)services/api/pinned-waves-api.ts(2 hunks)src/errors/appkit-initialization.ts(2 hunks)src/errors/wallet.ts(3 hunks)src/services/artblocks/url.ts(0 hunks)src/services/farcaster/url.ts(1 hunks)src/services/wikimedia/url.ts(1 hunks)store/store.ts(1 hunks)types/farcaster.types.ts(2 hunks)utils/error-sanitizer.ts(0 hunks)utils/wallet-validation.utils.ts(6 hunks)
💤 Files with no reviewable changes (15)
- components/drops/view/part/dropPartMarkdown/handlers/index.ts
- src/services/artblocks/url.ts
- components/drops/view/part/dropPartMarkdown/handlers/seize.tsx
- helpers/Types.tsx
- entities/ISeason.ts
- components/drops/view/part/dropPartMarkdown/handlers/youtube.tsx
- components/drops/view/part/dropPartMarkdown/handlers/compound.tsx
- components/drops/view/part/dropPartMarkdown/handlers/tiktok.tsx
- utils/error-sanitizer.ts
- components/drops/view/part/dropPartMarkdown/handlers/googleWorkspace.tsx
- components/waves/drops/normalizeDropMarkdown.ts
- components/drops/view/part/dropPartMarkdown/handlers/ens.tsx
- tests/components/drops/view/part/dropPartMarkdown/linkHandlersRegistry.test.tsx
- components/brain/notifications/index.tsx
- entities/ITDH.ts
✅ Files skipped from review due to trivial changes (1)
- codex/STATE.md
🚧 Files skipped from review as they are similar to previous changes (2)
- tests/utils/testContexts.tsx
- src/errors/wallet.ts
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx}: Do not include any comments in the code
Use react-query for data fetching
Always add readonly before propsUse TypeScript across the codebase
Files:
components/waves/specs/groups/group/edit/buttons/hooks/useWaveGroupEditButtonsController.tscomponents/drops/view/part/dropPartMarkdown/youtube.tscomponents/drops/view/part/dropPartMarkdown/youtubePreview.tsxhooks/useDropMessages.tshooks/breadcrumbs.types.tssrc/services/wikimedia/url.tscomponents/waves/drops/WaveDropQuoteWithSerialNo.tsxhelpers/video.helpers.tshooks/useCreateModalState.tscomponents/waves/specs/groups/group/edit/WaveGroupEditButtons.tsxcomponents/compact-menu/index.tsxcomponents/brain/my-stream/layout/LayoutContext.tsxcomponents/drops/view/part/dropPartMarkdown/pepe.tsxcomponents/drops/view/part/dropPartMarkdown/content.tsxcomponents/waves/drops/reaction-utils.tscomponents/waves/drops/wave-drops-all/index.tsxcomponents/waves/FarcasterCard.tsxhooks/useHlsPlayer.tscomponents/drops/view/part/dropPartMarkdown/linkHandlers.tsxcomponents/drops/view/part/dropPartMarkdown/tiktok.tslib/security/urlGuard.tscomponents/waves/drops/EditDropLexical.tsxservices/api/pinned-waves-api.tssrc/services/farcaster/url.tslib/cache/lruTtl.tshooks/useAuthenticatedContent.tsxcomponents/meme-calendar/meme-calendar.szn1.tsapp/nextgen/token/[token]/[[...view]]/page-utils.tscontexts/wave/hooks/types.tscomponents/header/HeaderNavConfig.tsapp/api/farcaster/route.tscomponents/waves/drops/LightDrop.tsxcomponents/drops/view/part/dropPartMarkdown/linkTypes.tscomponents/common/CompactMenu.tsxcontexts/wave/utils/wave-messages-utils.tshooks/breadcrumbs.config.tslib/text/html.tscontexts/wave/hooks/useEnhancedDmWavesList.tsapp/api/open-graph/compound/registry.tsutils/wallet-validation.utils.tscomponents/waves/drop/types/slider.types.tsstore/store.tscomponents/waves/memes/traits/schema.tscomponents/navigation/navTypes.tstypes/farcaster.types.tscomponents/waves/compound/types.tshooks/groups/useGroupMutations.ts__tests__/components/waves/WaveDropQuoteWithSerialNo.test.tsxsrc/errors/appkit-initialization.ts
**/*.tsx
📄 CodeRabbit inference engine (.cursorrules)
**/*.tsx: Use FontAwesome for icons
Use TailwindCSS for stylingUse React functional components with hooks for UI components
Files:
components/drops/view/part/dropPartMarkdown/youtubePreview.tsxcomponents/waves/drops/WaveDropQuoteWithSerialNo.tsxcomponents/waves/specs/groups/group/edit/WaveGroupEditButtons.tsxcomponents/compact-menu/index.tsxcomponents/brain/my-stream/layout/LayoutContext.tsxcomponents/drops/view/part/dropPartMarkdown/pepe.tsxcomponents/drops/view/part/dropPartMarkdown/content.tsxcomponents/waves/drops/wave-drops-all/index.tsxcomponents/waves/FarcasterCard.tsxcomponents/drops/view/part/dropPartMarkdown/linkHandlers.tsxcomponents/waves/drops/EditDropLexical.tsxhooks/useAuthenticatedContent.tsxcomponents/waves/drops/LightDrop.tsxcomponents/common/CompactMenu.tsx__tests__/components/waves/WaveDropQuoteWithSerialNo.test.tsx
{app,pages}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
Use NextJS features that match the current version
Files:
app/nextgen/token/[token]/[[...view]]/page-utils.tsapp/api/farcaster/route.tsapp/api/open-graph/compound/registry.ts
app/**
📄 CodeRabbit inference engine (AGENTS.md)
Add all new Next.js production routes under the
app/router (thepages/directory is fully migrated)
Files:
app/nextgen/token/[token]/[[...view]]/page-utils.tsapp/api/farcaster/route.tsapp/api/open-graph/compound/registry.ts
app/api/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (app/api/AGENTS.md)
app/api/**/*.{ts,tsx,js,jsx}: Never call fetch directly with user-controlled or scraped URLs in API code; use @/lib/security/urlGuard helpers (parsePublicUrl, assertPublicUrl, fetchPublicUrl, fetchPublicJson) so every hop is validated
When custom headers or timeouts are needed for external requests, pass them via urlGuard helper options instead of rolling a custom wrapper
Files:
app/api/farcaster/route.tsapp/api/open-graph/compound/registry.ts
app/api/**/route.{ts,js}
📄 CodeRabbit inference engine (app/api/AGENTS.md)
app/api/**/route.{ts,js}: Catch UrlGuardError explicitly in route handlers if returning a tailored response; otherwise allow it to propagate so the correct status code surfaces
Export HTTP verb handlers (e.g., GET) from route.ts files
Keep route.ts logic in small internal functions when it grows beyond ~200 lines
For edge caching behavior, prefer export const dynamic = "force-dynamic" or revalidate constants rather than inline headers
Follow project default responses (NextResponse.json) and reuse existing util modules instead of duplicating logic
Files:
app/api/farcaster/route.ts
app/api/**/*.ts
📄 CodeRabbit inference engine (app/api/AGENTS.md)
Use TypeScript types for request parameters and responses; avoid any unless a third-party payload has no shape guarantees
Files:
app/api/farcaster/route.tsapp/api/open-graph/compound/registry.ts
__tests__/**
📄 CodeRabbit inference engine (tests/AGENTS.md)
Place Jest test suites under the
__tests__directory mirroring source folders (e.g., components, contexts, hooks, utils)
Files:
__tests__/components/waves/WaveDropQuoteWithSerialNo.test.tsx
__tests__/components/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (tests/AGENTS.md)
Use
@testing-library/reactand@testing-library/user-eventfor React component tests
Files:
__tests__/components/waves/WaveDropQuoteWithSerialNo.test.tsx
**/__tests__/**
📄 CodeRabbit inference engine (AGENTS.md)
Place tests in
__tests__directories when organizing test suites
Files:
__tests__/components/waves/WaveDropQuoteWithSerialNo.test.tsx
**/*.test.tsx
📄 CodeRabbit inference engine (AGENTS.md)
When colocating tests with components, name them
ComponentName.test.tsx
Files:
__tests__/components/waves/WaveDropQuoteWithSerialNo.test.tsx
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Mock external dependencies and APIs in tests
Files:
__tests__/components/waves/WaveDropQuoteWithSerialNo.test.tsx
🧬 Code graph analysis (6)
components/waves/FarcasterCard.tsx (1)
types/farcaster.types.ts (2)
FarcasterUnavailablePreview(82-85)FarcasterUnsupportedPreview(87-90)
components/drops/view/part/dropPartMarkdown/linkHandlers.tsx (1)
generated/models/ApiDrop.ts (1)
ApiDrop(28-227)
app/api/farcaster/route.ts (1)
types/farcaster.types.ts (1)
FarcasterUnsupportedPreview(87-90)
contexts/wave/utils/wave-messages-utils.ts (1)
contexts/wave/hooks/types.ts (1)
ApiDropSearchStrategy(30-30)
utils/wallet-validation.utils.ts (2)
components/app-wallets/AppWalletsContext.tsx (1)
AppWallet(16-24)src/errors/wallet-validation.ts (2)
WalletValidationError(1-7)WalletSecurityError(9-14)
hooks/groups/useGroupMutations.ts (1)
generated/models/ApiCreateGroup.ts (1)
ApiCreateGroup(16-49)
🔇 Additional comments (72)
components/waves/drops/EditDropLexical.tsx (1)
57-57: LGTM! Clean import refactoring.The conversion from mixed default and named imports to all named imports improves consistency and aligns with the PR's objective to clean up exports across the codebase.
contexts/wave/hooks/useEnhancedDmWavesList.ts (3)
5-7: LGTM! Clean import optimization.The simplified import on line 5 removes unused exports, and using
import typeon line 7 is a TypeScript best practice that ensures the import is erased at runtime sinceMinimalWaveis only used in type positions.
63-64: Verify stub implementations for pinning functions.The
addPinnedWaveandremovePinnedWavefunctions return no-op implementations. If pinning is intentionally unsupported for DM waves, ensure that consumers of this hook are aware of this limitation and won't encounter unexpected behavior.
9-68: Well-structured hook implementation.The hook properly uses
useCallbackanduseMemofor optimization, correctly maps waves to the minimal format, and sorts them by latest drop timestamp in descending order. The implementation is clean and follows React best practices.contexts/wave/utils/wave-messages-utils.ts (1)
344-344: LGTM! Migration to generated enum value.The change from the string literal
"FIND_NEWER"toApiDropSearchStrategy.Newerimproves type safety and aligns with the generated API types. This is part of the broader consolidation onto generated enums.components/waves/drops/WaveDropQuoteWithSerialNo.tsx (1)
31-31: LGTM! Consistent enum value migration.Both the queryKey and API request parameter correctly use
WaveDropsSearchStrategy.Both, replacing the previousFIND_BOTHvalue. The changes are consistent and align with the generated API enum.Also applies to: 38-38
hooks/useDropMessages.ts (1)
75-75: LGTM! Pagination strategy updated correctly.The change from
WaveDropsSearchStrategy.FIND_OLDERtoWaveDropsSearchStrategy.Oldercorrectly updates the pagination strategy to use the new enum value while maintaining the same logical behavior.__tests__/components/waves/WaveDropQuoteWithSerialNo.test.tsx (1)
35-35: LGTM! Test updated to match production code.The test expectation correctly validates that
WaveDropsSearchStrategy.Bothis used in the queryKey, matching the production code changes inWaveDropQuoteWithSerialNo.tsx.contexts/wave/hooks/types.ts (1)
30-30: LGTM! Effective consolidation onto generated types.Aliasing
WaveDropsSearchStrategytoApiDropSearchStrategyfrom generated models is an excellent approach that:
- Centralizes type definitions on generated API types
- Maintains backward compatibility for existing imports
- Improves type safety and consistency with the API
This change enables the systematic migration across the codebase seen in the other files.
components/waves/specs/groups/group/edit/WaveGroupEditButtons.tsx (1)
20-24: Approved. Interface correctly scoped as internal.Verification confirms
WaveGroupEditButtonsPropsis not imported elsewhere in the codebase, making this change safe. The interface properly usesreadonlymodifiers and is used only within this file as component props. This aligns with the PR objective of cleaning unused exports.store/store.ts (1)
16-16: No external usages of AppStore or AppDispatch found—the change is safe.Verification confirms that neither
AppStorenorAppDispatchare imported or referenced outsidestore/store.ts. MakingAppStoreinternal (by removing the export) introduces no breaking changes, and the exportedAppStateandwrappertypes properly utilize the internalAppStoretype.components/waves/drops/reaction-utils.ts (1)
5-9: Approved: Remove unused exports forReactionEntryandduplicateProfilesWithoutUser.Verification confirms both symbols are used only internally within this file. Removing their exports appropriately reduces the public API surface.
Optional: Simplify
duplicateProfilesWithoutUserwithArray.filter().The manual loop at lines 24-41 could be replaced with a more concise implementation:
const duplicateProfilesWithoutUser = ( profiles: ApiProfileMin[], userId: string | null ): ApiProfileMin[] => { if (!userId) { return [...profiles]; } - - const filteredProfiles: ApiProfileMin[] = []; - - for (const profile of profiles) { - if (profile.id !== userId) { - filteredProfiles.push(profile); - } - } - - return filteredProfiles; + return profiles.filter(profile => profile.id !== userId); };src/services/wikimedia/url.ts (1)
1-3: No issues found. Change is safe to proceed.Verification confirms that
WikimediaLinkResultis not imported or referenced anywhere else in the codebase. Removing the export modifier is a safe API encapsulation change—consumers can still infer the return type from the exportedparseWikimediaLinkfunction. The interface also complies with the coding guideline requiringreadonlyon properties.helpers/video.helpers.ts (1)
7-11: Change is safe to approve.The verification confirms that
VideoConversionsis never explicitly imported in any file outside of the definition. All external code imports and uses thegetVideoConversionsfunction, not the interface type directly. Callers receive the type through inference, so making the interface non-exported appropriately reduces the public API surface without breaking external usage. The code also complies with coding guidelines: all properties includereadonlymodifiers and use TypeScript.components/drops/view/part/dropPartMarkdown/youtube.ts (1)
3-6: No issues found—change is safe to merge.The interface removal from exports is safe. Search results confirm
YoutubeLinkInfois only referenced within this file (interface definition and return type ofparseYoutubeLink). No external code imports it directly, so consumers remain unaffected—they can use type inference from the exported function.components/drops/view/part/dropPartMarkdown/content.tsx (1)
33-33: LGTM! Good API surface reduction.Internalizing these configuration and return type interfaces is appropriate since consumers only interact with the exported
createMarkdownContentRenderersfunction. This reduces the public API surface and provides more flexibility for future refactoring.Also applies to: 42-42
components/drops/view/part/dropPartMarkdown/linkHandlers.tsx (1)
25-25: LGTM! Consistent with good encapsulation practices.Removing the export from these interfaces is correct. Since
createLinkRendereris the only exported function and these are its internal configuration and return types, consumers don't need direct access to them.Also applies to: 29-29
components/drops/view/part/dropPartMarkdown/linkTypes.ts (1)
3-3: LGTM! Appropriate internalization of type.While
LinkDisplayis used in the exportedLinkHandlerinterface, it doesn't need to be exported since consumers only read and compare values (e.g.,handler.display === "block"). This reduces the public API surface without impacting usability.hooks/breadcrumbs.config.ts (1)
299-304: Change is safe—no external usages ofSpecificDeterminedRouteInfodetected.Verification confirms that
SpecificDeterminedRouteInfois referenced only withinhooks/breadcrumbs.config.tsand nowhere else in the codebase. Making it internal is appropriate, as it serves as an implementation detail for the exportedDeterminedRouteInfounion type.hooks/breadcrumbs.types.ts (1)
6-14: No external usages ofDynamicRouteTypefound—change is safe.Verification confirms that
DynamicRouteTypeis not imported or referenced in any code outsidehooks/breadcrumbs.types.ts. The only external reference is a comment inhooks/breadcrumbs.config.ts. Making this type internal aligns with reducing export visibility and does not break any external modules.hooks/useAuthenticatedContent.tsx (2)
16-66: LGTM! Hook implementation is solid.The state machine logic properly handles all six content states with clear transitions. The implementation follows React best practices with proper use of
useMemoand a complete dependency array.
8-14: Dismiss this review comment—ContentState was never exported.Verification shows that
ContentStateis not exported (noexportkeyword present) and is used only internally withinhooks/useAuthenticatedContent.tsx(line 22). There are no imports of this type elsewhere in the codebase. This type was never part of the public API, so there is no breaking change. The expanded state union ("not-available", "measuring", "ready") is a valid internal enhancement with no external impact.Likely an incorrect or invalid review comment.
hooks/useCreateModalState.ts (1)
15-18: LGTM! Export removal is safe and reduces public API surface.Verification confirms
CreateModalModeis only used internally within this file. No external imports were found, so removing the export is appropriate cleanup that improves maintainability.components/waves/drops/wave-drops-all/index.tsx (1)
20-20: No external dependencies on this interface detected—change is safe.The
WaveDropsAllPropsinterface is only used internally within its own module (line 42 as a type annotation) and has no external imports. Removing the export appropriately reduces the public API surface as intended.src/services/farcaster/url.ts (1)
16-34: LGTM! Good encapsulation of implementation details.Internalizing the three identifier interfaces (FarcasterCastIdentifier, FarcasterProfileIdentifier, FarcasterChannelIdentifier) while keeping the union type FarcasterResourceIdentifier public is a solid encapsulation practice. Consumers can still work with the union type without depending on the individual variants directly.
app/api/farcaster/route.ts (3)
657-664: LGTM! Excellent consistency with toUnavailable.The toUnsupported helper mirrors the structure of toUnavailable (lines 648-655), providing a clean, typed way to construct unsupported previews with optional diagnostic information. This improves maintainability and type safety.
690-690: LGTM! Proper usage of the helper.Using toUnsupported in the default path ensures consistency with the new structured FarcasterUnsupportedPreview type.
742-744: LGTM! Proper fallback handling.The fallback path now returns a structured unsupported preview with the URL and reason, improving debuggability.
types/farcaster.types.ts (2)
9-11: LGTM! Proper encapsulation of base type.Internalizing FarcasterBasePreview is appropriate since it's only used as a base for the exported preview interfaces. This reduces the public API surface without affecting consumers.
87-90: LGTM! Good consistency with FarcasterUnavailablePreview.Adding the optional reason field to FarcasterUnsupportedPreview brings it into alignment with FarcasterUnavailablePreview (lines 82-85), enabling better diagnostics for unsupported cases.
components/waves/FarcasterCard.tsx (2)
19-19: LGTM! Necessary import for type alignment.The import of FarcasterUnsupportedPreview is required for the updated type exclusion on line 31.
29-32: LGTM! Type-safe refactor aligned with structured preview types.Replacing the inline
{ type: "unsupported" }with the named FarcasterUnsupportedPreview type improves type safety and aligns with the new structured preview types. The runtime behavior remains unchanged.src/errors/appkit-initialization.ts (2)
13-13: LGTM: Proper prototype chain restoration.Adding the prototype restoration in the child class constructor is correct. This ensures that
instanceof AppKitValidationErrorchecks work properly when extending through an intermediate class.
1-7: No issues found — the export removal is safe.The verification confirms that
AppKitInitializationErrorhas no external usages in the codebase. It is only referenced internally within the file byAppKitValidationError. Removing the export does not break any imports or external dependencies.components/meme-calendar/meme-calendar.szn1.ts (1)
2-2: Remove verification request—no external references found.Search results confirm that no external code imports or references the
HistoricalMinttype. The only external usage is thegetHistoricalMintsOnUtcDayfunction (line 47 in MemeCalendar.tsx), which is still exported. Internal code that calls this function receives the typed results implicitly without needing theHistoricalMinttype export. The change to makeHistoricalMintprivate is safe and consistent with the PR's goal.components/drops/view/part/dropPartMarkdown/pepe.tsx (1)
3-7: Verification passed: No external references toPepeLinkResultfound.The type is safely internal. Both exported functions rely on type inference for external callers, confirming this export cleanup introduces no breaking changes.
components/waves/specs/groups/group/edit/buttons/hooks/useWaveGroupEditButtonsController.ts (1)
460-476: Interface export removal is safe—no other files reference this type directly.The search confirms that no files currently import
WaveGroupEditButtonsController. The only related import from this hook file isWaveGroupIdentitiesModal(a different type), so removing the export fromWaveGroupEditButtonsControllerintroduces no breaking changes and effectively reduces the public API surface as intended.components/drops/view/part/dropPartMarkdown/youtubePreview.tsx (1)
33-35: LGTM — interface not used elsewhere.Reducing the export visibility of
YoutubePreviewPropsaligns with the PR objective. Verification confirms the interface is not imported in any other files.components/waves/drop/types/slider.types.ts (1)
1-20: Removing the export from SliderTheme is safe—no direct imports found.Verification confirmed that only
getSliderThemeis imported from this module, not theSliderThemeinterface itself. The type remains accessible through type inference on exported declarations and causes no breaking changes.components/drops/view/part/dropPartMarkdown/tiktok.ts (3)
1-1: LGTM – appropriate visibility reduction.Since
TikTokLinkKindis only used withinTikTokLinkInfo, removing the export correctly reduces the public API surface.
20-63: LGTM – solid implementation.The parsing logic correctly handles TikTok link formats with appropriate error handling, domain validation, and pattern matching. The use of nullish coalescing for safe array access is appropriate.
3-6: No issues found. TikTokLinkInfo export removal is safe.Verification confirms that
TikTokLinkInfois not imported anywhere in the codebase. The removal of its export does not break external consumers—parseTikTokLinkremains exported, allowing TypeScript users to rely on type inference orReturnType<typeof parseTikTokLink>. The interface correctly implements thereadonlycoding guideline.components/waves/drops/LightDrop.tsx (1)
4-4: Interface change to internal is safe—no external imports detected.Verification confirms
LightDropPropsis not imported elsewhere in the codebase, so making the interface internal aligns well with the PR's goal to reduce export visibility without introducing breaking changes.Note: The
dropprop (line 5) remains unused in the component render (lines 9–27). If cleaning unused code, consider removing it.hooks/useHlsPlayer.ts (1)
6-6: No external imports found—change is safe.Verification confirms that no files in the codebase import
UseHlsPlayerParamsoutside ofhooks/useHlsPlayer.ts. The interface is only used internally within this module, making the removal of theexportkeyword safe.components/navigation/navTypes.ts (3)
39-42: SidebarNavItem non-export is safe.Verification confirms no external code references
SidebarNavItemdirectly. Making this interface non-exported restricts its visibility to this module without breaking changes.
5-23: No breaking changes detected from visibility modifications.Verification confirms that no external code references
RouteNavItemorViewNavItemdirectly. Making these types non-exported is safe and forces consumers to use theNavItemunion instead, which is a reasonable encapsulation improvement.
28-37: No issues found—all SidebarSection implementations already provide required fields.Verification confirms that all four SidebarSection objects created in
useSidebarSections.tsinclude both thekeyandiconrequired fields. Additionally, code accessing these fields (e.g.,useSectionMapusingsection.keyandmapSidebarSectionsToPagesusingsection.icon) is consistent with the interface definition. No breaking changes or missing implementations detected.services/api/pinned-waves-api.ts (1)
6-10: LGTM - Appropriate API surface reduction.Internalizing
PinnedWavesServiceis appropriate since external consumers can still use the exportedpinnedWavesApiobject with full type safety through TypeScript inference. This change reduces the public API surface while maintaining functionality.app/nextgen/token/[token]/[[...view]]/page-utils.ts (1)
10-16: LGTM - Type properly internalized.The
TokenDatainterface is correctly internalized since it's only used as the return type offetchTokenData. Consumers can still access the type through TypeScript's type inference.app/api/open-graph/compound/registry.ts (1)
29-33: LGTM - Registry type appropriately scoped.Internalizing
CompoundRegistrymakes sense since the exportedcompoundRegistryconstant provides the necessary public interface. The type remains accessible throughtypeof compoundRegistryif needed.lib/text/html.ts (1)
1-4: LGTM - Options type correctly internalized.The
StripHtmlTagsOptionsinterface is appropriately made internal. Consumers can still pass options using object literals with full type checking at the call site.lib/cache/lruTtl.ts (1)
1-4: LGTM - Constructor options type appropriately scoped.Making
LruTtlOptionsinternal is correct. Consumers can still construct the cache with full type safety through the constructor's parameter type.components/brain/my-stream/layout/LayoutContext.tsx (1)
69-75: LGTM - Internal type correctly scoped.The
LayoutRefTypeis an implementation detail of the layout registration system. Making it internal is appropriate since it's only used within the context's internal API.knip.jsonc (1)
1-50: LGTM - Well-structured static analysis configuration.The Knip configuration is well thought out:
- Proper project scope with appropriate exclusions for generated code and build artifacts
- Entry points correctly identify Next.js patterns (middleware, app routes, scripts)
includeEntryExports: trueis appropriate for a private repository to detect unused exports- Ignore patterns reasonably exclude generated code while still analyzing it for certain issues
This tooling supports the PR's objective of cleaning unused code and helps maintain a clean codebase going forward.
lib/security/urlGuard.ts (3)
5-16: LGTM - Error kind type appropriately internalized.Making
UrlGuardErrorKindinternal is appropriate. The type remains accessible through thekindproperty of thrownUrlGuardErrorinstances, allowing consumers to handle errors without needing to import the type directly.
37-39: LGTM - Hooks interface correctly scoped.Internalizing
UrlGuardHooksreduces the public API surface while maintaining full functionality. Consumers can still pass hooks via theUrlGuardOptionsinterface with complete type safety.
47-52: LGTM - Parse options appropriately internalized.The
ParsePublicUrlOptionsinterface is correctly made internal since it's only used as a parameter type forparsePublicUrl. Callers can construct options using object literals with full type inference.hooks/groups/useGroupMutations.ts (1)
23-34: LGTM! Return types appropriately internalized.Internalizing these return types reduces the public API surface while consumers can still infer types through TypeScript's type system or use
ReturnTypeutilities if needed.Also applies to: 41-51, 65-76
components/waves/compound/types.ts (1)
1-4: LGTM! Public API surface appropriately reduced.Internalizing these types is appropriate since they're component parts of the exported response types. TypeScript will inline these types in the public signatures, so consumers can still see and use the shapes while the implementation details remain internal.
Also applies to: 6-15, 17-24, 43-48, 67-76, 78-83, 85-93, 115-126, 138-140
components/common/CompactMenu.tsx (1)
2-2: LGTM! Consistent with the API surface reduction.This change correctly mirrors the removal of
CompactMenuPropsfromcomponents/compact-menu/index.tsx, maintaining consistency across the re-export barrel.package.json (2)
35-38: Well-configured deadcode detection scripts.The new scripts provide comprehensive deadcode detection:
knipfor general dead code analysists-prunefor unused exportsdepcheckfor unused dependenciesThe ignore patterns are appropriate, excluding tooling, types, and generated code.
143-179: LGTM! DevDependencies align with PR objectives.The additions support the deadcode detection and testing improvements:
- Testing tools:
@jest/globals,babel-jest,istanbul-lib-coverage- Static analysis:
depcheck,ts-prune, updatedknip(5.66.3)These changes are consistent with the PR's goal to improve code quality through better tooling.
components/compact-menu/index.tsx (1)
151-151: Verify thatCompactMenuPropsis not used externally.Automated searches for external imports of
CompactMenuPropsreturned no matches, indicating no direct imports from other files. However, ensure this change doesn't impact any indirect dependencies or re-exports before merging.utils/wallet-validation.utils.ts (6)
4-10: LGTM! Validation constants are well-defined.The constants provide clear thresholds for validation. The Ethereum address pattern correctly validates the standard format.
12-16: LGTM! Null check is appropriate.The existence check correctly guards against null or undefined wallet objects.
18-30: LGTM! Address validation is comprehensive.The validation correctly checks for presence, type, and Ethereum address format.
32-44: LGTM! Hash validation is appropriate.The validation correctly enforces minimum length requirements for the hashed address.
46-58: LGTM! Name validation is comprehensive.The validation correctly enforces presence, type, and reasonable length bounds for the wallet name.
94-101: LGTM! Public API orchestrates validations correctly.The function properly chains all internal validators and serves as the single public entry point for wallet validation.
components/waves/memes/traits/schema.ts (1)
129-145: No external usages found—change is safeVerification shows
MEME_NAME_OPTIONSis not imported or used outsideschema.ts. The constant is scoped to the file where it's defined, so there is no breaking change risk.components/header/HeaderNavConfig.ts (2)
3-7: Remove this review comment; the codebase is correct.The original comment mischaracterizes the
_contextparameter. The outer parameter is intentionally marked unused (with the_prefix), and the inner lambda's_contextis intentional shadowing that is actively used on line 119—this is idiomatic TypeScript, not a bug.Regarding the private type reference:
toolsBottomItemsis typed asNavLink[], butNavLinkremains internal. This is technically a type reference, but practically harmless since declaration emit is disabled intsconfig.json, and no other modules importNavLink,NavSection, orNavDropdown—only the exported values andNavContexttype are consumed. The code works correctly as-is.Likely an incorrect or invalid review comment.
32-34: Clarify parameter shadowing and add type safety togetDesktopNavigation.The outer
_contextparameter is unused, so keep it as-is with underscore prefix. However, the inner lambda parameter at lines 119-120 shadows it, causing confusion. Rename the lambda parameter toctxto match the pattern used elsewhere in the file (lines 82, 86, 140). Also add an explicit readonly return type and make thenavigationarray readonly for stronger type safety.-export function getDesktopNavigation(_context: NavContext) { - const navigation: NavDropdown[] = [ +export function getDesktopNavigation(_context: NavContext): readonly NavDropdown[] { + const navigation: readonly NavDropdown[] = [ { title: "About", - className: (_context) => - _context.pathname?.includes("/about") ? "active" : "", + className: (ctx) => + ctx.pathname?.includes("/about") ? "active" : "",
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
codex/tickets/TKT-0018.md (2)
6-6: Update status to reflect completed work.All plan items and acceptance criteria are marked complete, yet the status remains "In-Progress". Update to
DoneorCompletedto accurately reflect the ticket state.- status: In-Progress + status: Done
27-27: Fill in the PR reference.Replace the placeholder with a reference to PR #1569.
- - Primary PR: _(add when available)_ + - Primary PR: #1569components/navigation/navTypes.ts (2)
27-36: Consider addingreadonlymodifiers per coding guidelines.The coding guideline specifies "Always add readonly before props". Since this interface is likely used as component props, consider marking properties as readonly for immutability.
As per coding guidelines.
Apply this diff to add readonly modifiers:
export interface SidebarSection { - key: string; - name: string; - icon: React.ComponentType<{ className?: string }>; - items: SidebarNavItem[]; + readonly key: string; + readonly name: string; + readonly icon: React.ComponentType<{ className?: string }>; + readonly items: readonly SidebarNavItem[]; subsections?: { - name: string; - items: SidebarNavItem[]; + readonly name: string; + readonly items: readonly SidebarNavItem[]; }[]; }
38-41: LGTM: Intentional internalization. Consider addingreadonlymodifiers.Internalizing
SidebarNavItemaligns with the PR objective to reduce the public API surface. However, per the coding guideline "Always add readonly before props", consider adding readonly modifiers to the properties.As per coding guidelines.
Apply this diff to add readonly modifiers:
interface SidebarNavItem { - name: string; - href: string; + readonly name: string; + readonly href: string; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (9)
__tests__/components/providers/AppKitAdapterManager.test.ts(10 hunks)codex/STATE.md(1 hunks)codex/tickets/TKT-0017.md(0 hunks)codex/tickets/TKT-0018.md(2 hunks)codex/tickets/TKT-0019.md(1 hunks)components/navigation/navTypes.ts(4 hunks)helpers/Types.tsx(0 hunks)knip.jsonc(1 hunks)package.json(5 hunks)
💤 Files with no reviewable changes (2)
- codex/tickets/TKT-0017.md
- helpers/Types.tsx
✅ Files skipped from review due to trivial changes (1)
- codex/tickets/TKT-0019.md
🚧 Files skipped from review as they are similar to previous changes (2)
- knip.jsonc
- codex/STATE.md
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx}: Do not include any comments in the code
Use react-query for data fetching
Always add readonly before propsUse TypeScript across the codebase
Files:
__tests__/components/providers/AppKitAdapterManager.test.tscomponents/navigation/navTypes.ts
__tests__/**
📄 CodeRabbit inference engine (tests/AGENTS.md)
Place Jest test suites under the
__tests__directory mirroring source folders (e.g., components, contexts, hooks, utils)
Files:
__tests__/components/providers/AppKitAdapterManager.test.ts
__tests__/components/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (tests/AGENTS.md)
Use
@testing-library/reactand@testing-library/user-eventfor React component tests
Files:
__tests__/components/providers/AppKitAdapterManager.test.ts
**/__tests__/**
📄 CodeRabbit inference engine (AGENTS.md)
Place tests in
__tests__directories when organizing test suites
Files:
__tests__/components/providers/AppKitAdapterManager.test.ts
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Mock external dependencies and APIs in tests
Files:
__tests__/components/providers/AppKitAdapterManager.test.ts
🧬 Code graph analysis (1)
__tests__/components/providers/AppKitAdapterManager.test.ts (1)
components/app-wallets/AppWalletsContext.tsx (1)
AppWallet(16-24)
🪛 Gitleaks (8.28.0)
__tests__/components/providers/AppKitAdapterManager.test.ts
[high] 7-8: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (12)
codex/tickets/TKT-0018.md (1)
10-32: Well-structured cleanup ticket with clear documentation.The context, plan, and acceptance criteria are clear and verifiable. The log entry provides good traceability. No blockers identified.
__tests__/components/providers/AppKitAdapterManager.test.ts (3)
7-9: LGTM! Test constant follows best practices.The
VALID_PRIVATE_KEYconstant centralizes test data and ensures all wallet fixtures include the requiredprivate_keyfield from theAppWalletinterface. The 64-character hex format is correct for Ethereum private keys (32 bytes).Note: The static analysis warning flagging this as a secret is a false positive—this is clearly labeled test data in a test file, not a real private key.
133-139: LGTM! Enhanced test data improves realism.The updated mnemonic test cases now use multi-word phrases that better simulate real wallet data. All test fixtures consistently include the
private_keyfield, ensuring completeAppWalletobjects are tested throughout the suite.Also applies to: 176-198
35-35: LGTM! Consistent usage across test fixtures.The
VALID_PRIVATE_KEYconstant is consistently applied to all wallet fixtures throughout the test suite, ensuring that all test data conforms to theAppWalletinterface requirements. This improves maintainability by providing a single source of truth for test private keys.Also applies to: 55-55, 602-602, 661-661, 693-693
package.json (5)
60-68: Verify Lexical package version compatibility.The
@lexical/reactpackage is pinned to^0.14.2, while all other@lexical/*packages are^0.14.5. This version mismatch could cause peer dependency resolution issues or runtime compatibility problems. Typically, all Lexical packages within a project should use the same minor version to ensure API compatibility.Verify the versions are intentional and compatible by checking:
- The Lexical release notes for breaking changes between 0.14.2 and 0.14.5
- Peer dependency requirements in each package
- Run
npm ls @lexical/reactto confirm installed version and any warningsAlternatively, consider updating
@lexical/reactto^0.14.5to align with the other packages.Also applies to: 64-64
34-38: Configure and validate dead code detection scripts.The new dead code detection scripts are well-structured and align with the PR's cleanup objectives. The
depcheckconfiguration correctly excludes build tooling and common dependencies.However, ensure that these scripts are run and their output is reviewed before merging to prevent accidental removal of actually-used code. The
--ignorespatterns in thedeadcode:depsscript should be validated to confirm they match your project's tooling stack.
174-174: pino-pretty dependency correctly moved to devDependencies.The previous review flagged
pino-prettyas an unused production dependency. This has been properly resolved by moving it to devDependencies (line 174) with version^13.1.2. This is correct—pino-prettyis a formatting utility only needed in development and should not ship to production.
142-142: DevDependencies additions support code quality and testing goals.The new devDependencies (
@jest/globals,babel-jest,depcheck,eslint-plugin-react-hooks,istanbul-lib-coverage,ts-prune,typescript-eslint) are well-suited for a cleanup and type-safety initiative. These tools enable automated dead code detection, improved linting, and better test coverage tracking.Also applies to: 159-159, 161-161, 166-166, 169-169, 181-181, 184-184
41-41: All newly added dependencies are verified as actively used in the codebase.The search confirms all listed dependencies have legitimate imports across source files:
- @lexical/ packages: Used extensively in drop editors and markdown normalization
- axios: Used in multiPartUpload and IPFS service for HTTP operations
- unified/remark/rehype: Used in markdown rendering components
- date-fns: Used in participation and winners timeline components
- p-limit: Used in multiPartUpload for concurrency control
- @adraffy/ens-normalize: Used in OpenGraph ENS resolution
- @reown/appkit: Used in wallet connection and signing utilities
- clsx: Used throughout UI components for conditional styling
- form-data: Used in IPFS service for multipart uploads
No unused dependencies were detected.
components/navigation/navTypes.ts (3)
5-13: LGTM: Intentional API surface reduction.Internalizing
RouteNavItemaligns with the PR objective to reduce the public API surface while keeping it available through the exportedNavItemunion type.
15-23: LGTM: Intentional API surface reduction.Internalizing
ViewNavItemaligns with the PR objective to reduce the public API surface while keeping it available through the exportedNavItemunion type.
25-25: LGTM: ActionNavItem removal as intended.The removal of
ActionNavItemfrom the union type is consistent with the cleanup effort described in the AI summary.



Summary by CodeRabbit