Skip to content

Clean unused#1569

Merged
simo6529 merged 14 commits intomainfrom
clean-unused
Oct 28, 2025
Merged

Clean unused#1569
simo6529 merged 14 commits intomainfrom
clean-unused

Conversation

@simo6529
Copy link
Copy Markdown
Collaborator

@simo6529 simo6529 commented Oct 27, 2025

Summary by CodeRabbit

  • Chores
    • Added dead code detection tools (Knip, ts-prune, depcheck).
    • Updated import paths to use consistent alias conventions.
    • Removed unused internal utilities and deprecated components.
    • Added Lexical editor packages and other runtime dependencies.
    • Cleaned up internal type exports and API surface.

Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 27, 2025

Walkthrough

A 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

Cohort / File(s) Summary
Configuration & Tooling
.ts-prunerc, .unimportedrc.json, knip.jsonc, package.json
New config files for dead code detection (ts-prune, unimported, knip) with project, entry points, and ignore patterns; package.json adds deadcode scripts, Lexical packages, and dev tooling.
Test Import Migrations
__tests__/app/api/farcaster.route.test.ts, __tests__/components/distribution-plan-tool/.../*.test.tsx, __tests__/components/drops/.../*.test.tsx, __tests__/components/groups/.../*.test.tsx, __tests__/components/memes/.../*.test.tsx, __tests__/components/user/.../*.test.tsx, __tests__/components/utils/CommonFilterTargetSelect.test.tsx, __tests__/components/waves/*/*.test.tsx, __tests__/helpers/time.types.test.ts
Updated relative imports to use @/ path aliases; minor type reference updates (e.g., FilterTargetTypeProfileActivityFilterTargetType).
Test Utilities Cleanup
__tests__/utils/editDropTestUtils.tsx, __tests__/utils/mockFactories.ts, __tests__/utils/testContexts.tsx, __tests__/utils/titleTestUtils.tsx, __tests__/fixtures/gradientFixtures.ts
Removed test context providers, bulk mock factories, fixture exports; simplified to core helpers (createMockDrop, renderWithAuth).
Component Export Visibility Reductions
components/auth/error-boundary/*, components/brain/left-sidebar/web/*, components/distribution-plan-tool/create-custom-snapshots/form/CreateCustomSnapshotForm.tsx, components/drops/create/lexical/plugins/hashtags/HashtagsPlugin.tsx, components/drops/view/part/dropPartMarkdown/*, components/utils/CommonFilterTargetSelect.tsx, components/waves/*/types.ts, components/waves/drops/*
Removed export modifiers from interfaces, types, and functions; removed re-exports of handler/type aliases; removed default exports where replaced by named exports.
Deleted Components & Hooks
components/brain/left-sidebar/web/WebBrainLeftSidebarSearchWave.tsx, components/brain/left-sidebar/web/WebBrainLeftSidebarViewChange.tsx, components/waves/OpenSeaCard.tsx, hooks/errors/WalletConnectionError.ts, hooks/usePopoverPosition.ts, hooks/waves/useWaveScopePermissions.ts, services/websocket/useWaveSubscriptionManager.ts
Removed entire unused components, hooks, and error classes.
Error Class Removals
src/errors/authentication.ts, src/errors/wallet-connection.ts, src/errors/appkit-initialization.ts, src/errors/wallet.ts
Removed exported error class hierarchies (TokenRefreshError, AuthenticationRoleError, WalletConnectionError variants); made AppKitInitializationError and WalletConnectionError non-exported.
Service & Utility Export Reductions
services/api/pinned-waves-api.ts, services/groups/groupMutations.ts, lib/ens/detect.ts, lib/security/urlGuard.ts, lib/cache/lruTtl.ts, lib/text/html.ts, helpers/WalletHelpers.ts, utils/error-sanitizer.ts, utils/wallet-validation.utils.ts
Made interfaces, types, constants, and test helpers non-exported; refactored wallet validators from functions to arrow constants with enhanced validation logic.
Farcaster & Type System Updates
app/api/farcaster/route.ts, components/waves/FarcasterCard.tsx, types/farcaster.types.ts, src/services/farcaster/url.ts
Added FarcasterUnsupportedPreview type with optional reason; refactored unsupported preview handling; made identifier types non-exported.
Wave/Drop Enum & Type Migrations
contexts/wave/hooks/types.ts, contexts/wave/hooks/useEnhancedDmWavesList.ts, contexts/wave/utils/wave-messages-utils.ts, components/waves/drops/WaveDropQuoteWithSerialNo.tsx, components/waves/drops/normalizeDropMarkdown.ts, hooks/useDropMessages.ts
Replaced local WaveDropsSearchStrategy enum with ApiDropSearchStrategy re-export; updated enum values (e.g., FIND_OLDEROlder, FIND_BOTHBoth); removed default exports.
Type & Interface Visibility Changes
components/navigation/navTypes.ts, components/header/HeaderNavConfig.ts, components/meme-calendar/meme-calendar.szn1.ts, hooks/breadcrumbs.config.ts, hooks/breadcrumbs.types.ts, hooks/useAuthenticatedContent.tsx, hooks/useCreateModalState.ts, hooks/groups/useGroupMutations.ts, hooks/useVirtualizedWaves.ts, lib/cache/lruTtl.ts, app/api/open-graph/compound/registry.ts, app/nextgen/token/[token]/[[...view]]/page-utils.ts, store/store.ts, entities/ISeason.ts, entities/ITDH.ts, helpers/Types.tsx, helpers/video.helpers.ts, components/waves/compound/types.ts, components/brain/my-stream/layout/LayoutContext.tsx, components/brain/notifications/index.tsx, components/common/CompactMenu.tsx, components/compact-menu/index.tsx, components/drops/view/part/dropPartMarkdown/content.tsx, components/drops/view/part/dropPartMarkdown/linkHandlers.tsx, components/drops/view/part/dropPartMarkdown/linkTypes.ts, components/drops/view/part/dropPartMarkdown/pepe.tsx, components/drops/view/part/dropPartMarkdown/tiktok.ts, components/drops/view/part/dropPartMarkdown/youtube.ts, components/drops/view/part/dropPartMarkdown/youtubePreview.tsx, components/waves/drop/types/slider.types.ts, components/waves/drops/LightDrop.tsx, components/waves/drops/wave-drops-all/index.tsx, components/waves/specs/groups/group/edit/WaveGroupEditButtons.tsx, components/waves/specs/groups/group/edit/buttons/hooks/useWaveGroupEditButtonsController.ts
Systematically removed export keywords from types, interfaces, and enums; restricted public API surface to module scope.
Test & Playwright Cleanup
tests/globalSetup.ts, tests/mocks/walletMock.ts, tests/testHelpers.ts
Removed Playwright global setup, wallet mock helpers, and login test utility.
Documentation Updates
codex/STATE.md, codex/tickets/TKT-0017.md, codex/tickets/TKT-0018.md, codex/tickets/TKT-0019.md
Reordered ticket log; documented UrlGuardHooks export removal; added ticket for Wave card clickability feature.
Other Component Changes
components/waves/drops/blankLinePlaceholders.ts, components/waves/drops/reaction-utils.ts, components/waves/specs/groups/group/edit/buttons/utils/waveGroupEdit.ts, components/waves/specs/groups/group/edit/utils/waveGroupUpdate.ts, components/waves/drops/WaveDropReactions.tsx, components/drops/view/part/dropPartMarkdown/renderers.tsx, components/waves/drops/EditDropLexical.tsx, src/services/artblocks/url.ts, src/services/wikimedia/url.ts, constants/sidebar.ts
Removed default exports, function exports, and constant exports; changed import patterns; made previously exported symbols internal.
Test Data Updates
__tests__/components/providers/AppKitAdapterManager.test.ts, __tests__/components/drops/view/part/dropPartMarkdown/linkHandlersRegistry.test.tsx, __tests__/components/waves/WaveDropQuoteWithSerialNo.test.tsx
Added valid private_key constants to test wallets; updated mocks to reference new enum values.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Areas requiring extra attention:

  • Deleted modules & dependencies: Verify removal of useWaveScopePermissions, usePopoverPosition, OpenSeaCard, error classes don't break downstream consumers; check all removal sites via codebase search
  • Enum migrations (WaveDropsSearchStrategyApiDropSearchStrategy): Ensure all usages updated consistently; verify API contract alignment
  • Export visibility reductions: Confirm no external imports depend on newly-internal types/interfaces; check for any circular dependency issues introduced
  • Type system changes (FarcasterUnsupportedPreview extension): Verify serialization/deserialization compatibility and API response parsing
  • Test utilities cleanup: Ensure test coverage doesn't degrade; verify renderWithAuth and remaining factories are sufficient
  • Package.json: Validate new Lexical and dependency versions are compatible; check new dev tooling scripts run without issues
  • Path alias migrations: Spot-check several test files to confirm alias resolution and type inference work correctly

Possibly related PRs

Suggested reviewers

  • ragnep

🐰 Hops through files with eager paws,
Cleaning exports, removing flaws,
Aliases bloom, old code retires,
Dead wood burned in refactor's fires—
A tidy burrow, fresh and bright!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Clean unused" accurately describes the primary objective of this changeset. The PR focuses on cleaning up unused code through multiple approaches: adding dead code detection tooling (ts-prune, knip, depcheck configurations and npm scripts), removing hundreds of unused or unnecessary exports across the codebase, deleting unused components and utility functions, and updating import paths. The title is concise, clear, and specific enough for a teammate reviewing history to understand this is a cleanup and refactoring effort targeting dead code and unused exports.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch clean-unused

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.

❤️ Share

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

Signed-off-by: Simo <simo@6529.io>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 the jest.mock calls 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 replacing Partial<any> with a typed interface.

The Partial<any> type provides minimal type safety. Consider defining a GradientNFT interface and using Partial<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

📥 Commits

Reviewing files that changed from the base of the PR and between c01bf38 and 0d31095.

⛔ Files ignored due to path filters (1)
  • package-lock.json is 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 props

Use TypeScript across the codebase

Files:

  • __tests__/components/waves/winners/drops/DefaultWaveWinnerDrop.test.tsx
  • components/waves/drops/reaction-utils.ts
  • __tests__/components/drops/create/lexical/plugins/mentions/MentionsTypeaheadMenu.test.tsx
  • components/drops/view/part/dropPartMarkdown/renderers.tsx
  • components/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.tsx
  • components/drops/create/lexical/plugins/hashtags/HashtagsPlugin.tsx
  • __tests__/utils/titleTestUtils.tsx
  • components/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 styling

Use 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.tsx
  • components/drops/view/part/dropPartMarkdown/renderers.tsx
  • components/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.tsx
  • components/drops/create/lexical/plugins/hashtags/HashtagsPlugin.tsx
  • __tests__/utils/titleTestUtils.tsx
  • components/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/react and @testing-library/user-event for 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 fixtures and helpers subfolders 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 ProfileActivityFilterTargetType directly from @/enums instead 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 FilterTargetType to ProfileActivityFilterTargetType, 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 duplicateProfilesWithoutUser is 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; mockGradientNFT is 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 by mockGradientCollection. 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 ReactNode and 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. The mockTitleContextModule() 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 of WaveDropReaction.

Search confirms that only WaveDropReactions (the public export) is imported across the codebase. The internal WaveDropReaction component 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: true for better dead code detection in private repos
  • treatConfigHintsAsErrors: true for CI enforcement

The 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 Knip
  • deadcode:exports - Unused export detection with strict error mode
  • deadcode:deps - Dependency analysis with appropriate ignores for dev tooling
  • deadcode - Convenient wrapper running all checks

The --error flag 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 infrastructure
  • depcheck, ts-prune - Dead code analysis
  • istanbul-lib-coverage - Coverage tooling
  • knip updated to 5.66.3 (substantial version bump from 5.50.5)

Note: pino-pretty moved 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 checkForAtSignHashtags is 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.

Comment thread __tests__/components/waves/memes/traits/DropdownTrait.test.tsx
Comment thread __tests__/utils/titleTestUtils.tsx
Comment thread components/drops/view/part/dropPartMarkdown/renderers.tsx
Signed-off-by: Simo <simo@6529.io>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 function getErrorCode at 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: Add Object.setPrototypeOf(this, WalletValidationError.prototype) to maintain correct prototype chain.

WalletValidationError is missing the Object.setPrototypeOf call that all other exported error classes in this file use. Without it, instances will incorrectly have WalletConnectionError.prototype instead of WalletValidationError.prototype, breaking the prototype chain. The internal WalletConnectionError base 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 validateWalletSafely remains in the public API.

Apply this diff:

-// Export individual validators for reuse in other parts of the application

76-88: Fix empty string handling in validatePrivateKey.

The check !wallet.private_key on line 77 returns early for empty strings without validation. Since private_key is a required string field in the AppWallet interface 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_WORDS and MAX_MNEMONIC_WORDS are 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 validatePrivateKey at 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 AppKitInitializationError is safe—no external imports found. The Object.setPrototypeOf addition on line 5 correctly fixes the Error prototype chain.

However, AppKitValidationError (line 9-14) should also include Object.setPrototypeOf for 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_WORDS and MAX_MNEMONIC_WORDS are defined but not currently used in the validation logic. These should be utilized for word count validation in validateMnemonic (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

📥 Commits

Reviewing files that changed from the base of the PR and between 0d31095 and 21f210a.

📒 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 props

Use TypeScript across the codebase

Files:

  • services/groups/groupMutations.ts
  • hooks/useVirtualizedWaves.ts
  • utils/error-sanitizer.ts
  • components/waves/memes/traits/schema.ts
  • src/errors/wallet.ts
  • utils/wallet-validation.utils.ts
  • src/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 sanitiseGroupPayload from 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_HEIGHT is only used internally within hooks/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_OPTIONS is not imported or referenced anywhere outside schema.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 WalletInitializationError implementation is correct with proper prototype handling and clear error semantics.


1-7: WalletValidationError in wallet.ts extends non-exported parent class; design inconsistency with duplicate in wallet-validation.ts

The codebase has WalletValidationError defined in two separate files with different implementations:

  • src/errors/wallet.ts: extends WalletConnectionError (which is no longer exported)
  • src/errors/wallet-validation.ts: extends Error directly

Files import inconsistently from both. Additionally, WalletConnectionError in wallet.ts is now internal and unused (no imports found in the codebase). Clarify the intent: should WalletConnectionError remain at all, and consolidate WalletValidationError to 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 validateWalletSafely function properly orchestrates all validators in sequence.

Also applies to: 112-119

Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 format ivHex:authTagHex:encryptedHex (e.g., 32 hex chars + ":" + 32 hex chars + ":" + encrypted data). This minimum requires ~67 characters, but MIN_PRIVATE_KEY_LENGTH is set to 32, which would reject all properly encrypted private keys.

Update utils/wallet-validation.utils.ts line 8:

const MIN_PRIVATE_KEY_LENGTH = 67

This 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 enabled

The FieldDefinition union (line 115-119) references private TextFieldDefinition and BooleanFieldDefinition, which will cause "exported type has or is using private name" errors if declaration emit is enabled. Additionally, traitDefinitions (line 148) and getFormSections (line 477-479) expose the private SectionDefinition type. While .d.ts emit 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 of traitDefinitions and getFormSections.

♻️ Duplicate comments (1)
components/waves/memes/traits/schema.ts (1)

100-103: Same private-name exposure via FieldDefinition union

BooleanFieldDefinition 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., faPlay from @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 unused drop prop.

The drop prop 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.

TestArgs and UpdateVisibilityArgs are parameter types for public methods runTest and updateVisibility. While consumers can construct objects inline, exporting these interfaces would improve type safety and discoverability, especially since SubmitArgs (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 with readonly (aligns with guidelines).

These are static config objects. Adding readonly to fields (and arrays as readonly) 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: Standardize className shape and harden collections.

To simplify consumers, consider making className consistently 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 readonly to properties and arrays.


3-7: Apply readonly to NavLink fields 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

📥 Commits

Reviewing files that changed from the base of the PR and between 21f210a and a00dd5d.

📒 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 props

Use TypeScript across the codebase

Files:

  • components/waves/specs/groups/group/edit/buttons/hooks/useWaveGroupEditButtonsController.ts
  • components/drops/view/part/dropPartMarkdown/youtube.ts
  • components/drops/view/part/dropPartMarkdown/youtubePreview.tsx
  • hooks/useDropMessages.ts
  • hooks/breadcrumbs.types.ts
  • src/services/wikimedia/url.ts
  • components/waves/drops/WaveDropQuoteWithSerialNo.tsx
  • helpers/video.helpers.ts
  • hooks/useCreateModalState.ts
  • components/waves/specs/groups/group/edit/WaveGroupEditButtons.tsx
  • components/compact-menu/index.tsx
  • components/brain/my-stream/layout/LayoutContext.tsx
  • components/drops/view/part/dropPartMarkdown/pepe.tsx
  • components/drops/view/part/dropPartMarkdown/content.tsx
  • components/waves/drops/reaction-utils.ts
  • components/waves/drops/wave-drops-all/index.tsx
  • components/waves/FarcasterCard.tsx
  • hooks/useHlsPlayer.ts
  • components/drops/view/part/dropPartMarkdown/linkHandlers.tsx
  • components/drops/view/part/dropPartMarkdown/tiktok.ts
  • lib/security/urlGuard.ts
  • components/waves/drops/EditDropLexical.tsx
  • services/api/pinned-waves-api.ts
  • src/services/farcaster/url.ts
  • lib/cache/lruTtl.ts
  • hooks/useAuthenticatedContent.tsx
  • components/meme-calendar/meme-calendar.szn1.ts
  • app/nextgen/token/[token]/[[...view]]/page-utils.ts
  • contexts/wave/hooks/types.ts
  • components/header/HeaderNavConfig.ts
  • app/api/farcaster/route.ts
  • components/waves/drops/LightDrop.tsx
  • components/drops/view/part/dropPartMarkdown/linkTypes.ts
  • components/common/CompactMenu.tsx
  • contexts/wave/utils/wave-messages-utils.ts
  • hooks/breadcrumbs.config.ts
  • lib/text/html.ts
  • contexts/wave/hooks/useEnhancedDmWavesList.ts
  • app/api/open-graph/compound/registry.ts
  • utils/wallet-validation.utils.ts
  • components/waves/drop/types/slider.types.ts
  • store/store.ts
  • components/waves/memes/traits/schema.ts
  • components/navigation/navTypes.ts
  • types/farcaster.types.ts
  • components/waves/compound/types.ts
  • hooks/groups/useGroupMutations.ts
  • __tests__/components/waves/WaveDropQuoteWithSerialNo.test.tsx
  • src/errors/appkit-initialization.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use FontAwesome for icons
Use TailwindCSS for styling

Use React functional components with hooks for UI components

Files:

  • components/drops/view/part/dropPartMarkdown/youtubePreview.tsx
  • components/waves/drops/WaveDropQuoteWithSerialNo.tsx
  • components/waves/specs/groups/group/edit/WaveGroupEditButtons.tsx
  • components/compact-menu/index.tsx
  • components/brain/my-stream/layout/LayoutContext.tsx
  • components/drops/view/part/dropPartMarkdown/pepe.tsx
  • components/drops/view/part/dropPartMarkdown/content.tsx
  • components/waves/drops/wave-drops-all/index.tsx
  • components/waves/FarcasterCard.tsx
  • components/drops/view/part/dropPartMarkdown/linkHandlers.tsx
  • components/waves/drops/EditDropLexical.tsx
  • hooks/useAuthenticatedContent.tsx
  • components/waves/drops/LightDrop.tsx
  • components/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.ts
  • app/api/farcaster/route.ts
  • app/api/open-graph/compound/registry.ts
app/**

📄 CodeRabbit inference engine (AGENTS.md)

Add all new Next.js production routes under the app/ router (the pages/ directory is fully migrated)

Files:

  • app/nextgen/token/[token]/[[...view]]/page-utils.ts
  • app/api/farcaster/route.ts
  • app/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.ts
  • app/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.ts
  • app/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/react and @testing-library/user-event for 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 type on line 7 is a TypeScript best practice that ensures the import is erased at runtime since MinimalWave is only used in type positions.


63-64: Verify stub implementations for pinning functions.

The addPinnedWave and removePinnedWave functions 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 useCallback and useMemo for 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" to ApiDropSearchStrategy.Newer improves 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 previous FIND_BOTH value. 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_OLDER to WaveDropsSearchStrategy.Older correctly 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.Both is used in the queryKey, matching the production code changes in WaveDropQuoteWithSerialNo.tsx.

contexts/wave/hooks/types.ts (1)

30-30: LGTM! Effective consolidation onto generated types.

Aliasing WaveDropsSearchStrategy to ApiDropSearchStrategy from 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 WaveGroupEditButtonsProps is not imported elsewhere in the codebase, making this change safe. The interface properly uses readonly modifiers 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 AppStore nor AppDispatch are imported or referenced outside store/store.ts. Making AppStore internal (by removing the export) introduces no breaking changes, and the exported AppState and wrapper types properly utilize the internal AppStore type.

components/waves/drops/reaction-utils.ts (1)

5-9: Approved: Remove unused exports for ReactionEntry and duplicateProfilesWithoutUser.

Verification confirms both symbols are used only internally within this file. Removing their exports appropriately reduces the public API surface.

Optional: Simplify duplicateProfilesWithoutUser with Array.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 WikimediaLinkResult is 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 exported parseWikimediaLink function. The interface also complies with the coding guideline requiring readonly on properties.

helpers/video.helpers.ts (1)

7-11: Change is safe to approve.

The verification confirms that VideoConversions is never explicitly imported in any file outside of the definition. All external code imports and uses the getVideoConversions function, 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 include readonly modifiers 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 YoutubeLinkInfo is only referenced within this file (interface definition and return type of parseYoutubeLink). 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 createMarkdownContentRenderers function. 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 createLinkRenderer is 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 LinkDisplay is used in the exported LinkHandler interface, 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 of SpecificDeterminedRouteInfo detected.

Verification confirms that SpecificDeterminedRouteInfo is referenced only within hooks/breadcrumbs.config.ts and nowhere else in the codebase. Making it internal is appropriate, as it serves as an implementation detail for the exported DeterminedRouteInfo union type.

hooks/breadcrumbs.types.ts (1)

6-14: No external usages of DynamicRouteType found—change is safe.

Verification confirms that DynamicRouteType is not imported or referenced in any code outside hooks/breadcrumbs.types.ts. The only external reference is a comment in hooks/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 useMemo and a complete dependency array.


8-14: Dismiss this review comment—ContentState was never exported.

Verification shows that ContentState is not exported (no export keyword present) and is used only internally within hooks/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 CreateModalMode is 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 WaveDropsAllProps interface 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 AppKitValidationError checks work properly when extending through an intermediate class.


1-7: No issues found — the export removal is safe.

The verification confirms that AppKitInitializationError has no external usages in the codebase. It is only referenced internally within the file by AppKitValidationError. 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 HistoricalMint type. The only external usage is the getHistoricalMintsOnUtcDay function (line 47 in MemeCalendar.tsx), which is still exported. Internal code that calls this function receives the typed results implicitly without needing the HistoricalMint type export. The change to make HistoricalMint private is safe and consistent with the PR's goal.

components/drops/view/part/dropPartMarkdown/pepe.tsx (1)

3-7: Verification passed: No external references to PepeLinkResult found.

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 is WaveGroupIdentitiesModal (a different type), so removing the export from WaveGroupEditButtonsController introduces 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 YoutubePreviewProps aligns 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 getSliderTheme is imported from this module, not the SliderTheme interface 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 TikTokLinkKind is only used within TikTokLinkInfo, 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 TikTokLinkInfo is not imported anywhere in the codebase. The removal of its export does not break external consumers—parseTikTokLink remains exported, allowing TypeScript users to rely on type inference or ReturnType<typeof parseTikTokLink>. The interface correctly implements the readonly coding guideline.

components/waves/drops/LightDrop.tsx (1)

4-4: Interface change to internal is safe—no external imports detected.

Verification confirms LightDropProps is 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 drop prop (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 UseHlsPlayerParams outside of hooks/useHlsPlayer.ts. The interface is only used internally within this module, making the removal of the export keyword safe.

components/navigation/navTypes.ts (3)

39-42: SidebarNavItem non-export is safe.

Verification confirms no external code references SidebarNavItem directly. 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 RouteNavItem or ViewNavItem directly. Making these types non-exported is safe and forces consumers to use the NavItem union 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.ts include both the key and icon required fields. Additionally, code accessing these fields (e.g., useSectionMap using section.key and mapSidebarSectionsToPages using section.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 PinnedWavesService is appropriate since external consumers can still use the exported pinnedWavesApi object 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 TokenData interface is correctly internalized since it's only used as the return type of fetchTokenData. 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 CompoundRegistry makes sense since the exported compoundRegistry constant provides the necessary public interface. The type remains accessible through typeof compoundRegistry if needed.

lib/text/html.ts (1)

1-4: LGTM - Options type correctly internalized.

The StripHtmlTagsOptions interface 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 LruTtlOptions internal 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 LayoutRefType is 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: true is 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 UrlGuardErrorKind internal is appropriate. The type remains accessible through the kind property of thrown UrlGuardError instances, allowing consumers to handle errors without needing to import the type directly.


37-39: LGTM - Hooks interface correctly scoped.

Internalizing UrlGuardHooks reduces the public API surface while maintaining full functionality. Consumers can still pass hooks via the UrlGuardOptions interface with complete type safety.


47-52: LGTM - Parse options appropriately internalized.

The ParsePublicUrlOptions interface is correctly made internal since it's only used as a parameter type for parsePublicUrl. 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 ReturnType utilities 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 CompactMenuProps from components/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:

  • knip for general dead code analysis
  • ts-prune for unused exports
  • depcheck for unused dependencies

The 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, updated knip (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 that CompactMenuProps is not used externally.

Automated searches for external imports of CompactMenuProps returned 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 safe

Verification shows MEME_NAME_OPTIONS is not imported or used outside schema.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 _context parameter. The outer parameter is intentionally marked unused (with the _ prefix), and the inner lambda's _context is intentional shadowing that is actively used on line 119—this is idiomatic TypeScript, not a bug.

Regarding the private type reference: toolsBottomItems is typed as NavLink[], but NavLink remains internal. This is technically a type reference, but practically harmless since declaration emit is disabled in tsconfig.json, and no other modules import NavLink, NavSection, or NavDropdown—only the exported values and NavContext type are consumed. The code works correctly as-is.

Likely an incorrect or invalid review comment.


32-34: Clarify parameter shadowing and add type safety to getDesktopNavigation.

The outer _context parameter 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 to ctx to match the pattern used elsewhere in the file (lines 82, 86, 140). Also add an explicit readonly return type and make the navigation array 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" : "",

Comment thread codex/tickets/TKT-0016.md
Comment thread components/navigation/navTypes.ts Outdated
Comment thread components/waves/memes/traits/schema.ts
Comment thread package.json Outdated
Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 Done or Completed to 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: #1569
components/navigation/navTypes.ts (2)

27-36: Consider adding readonly modifiers 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 adding readonly modifiers.

Internalizing SidebarNavItem aligns 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

📥 Commits

Reviewing files that changed from the base of the PR and between a00dd5d and e5399be.

⛔ Files ignored due to path filters (1)
  • package-lock.json is 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 props

Use TypeScript across the codebase

Files:

  • __tests__/components/providers/AppKitAdapterManager.test.ts
  • components/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/react and @testing-library/user-event for 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_KEY constant centralizes test data and ensures all wallet fixtures include the required private_key field from the AppWallet interface. 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_key field, ensuring complete AppWallet objects are tested throughout the suite.

Also applies to: 176-198


35-35: LGTM! Consistent usage across test fixtures.

The VALID_PRIVATE_KEY constant is consistently applied to all wallet fixtures throughout the test suite, ensuring that all test data conforms to the AppWallet interface 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/react package 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:

  1. The Lexical release notes for breaking changes between 0.14.2 and 0.14.5
  2. Peer dependency requirements in each package
  3. Run npm ls @lexical/react to confirm installed version and any warnings

Alternatively, consider updating @lexical/react to ^0.14.5 to 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 depcheck configuration 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 --ignores patterns in the deadcode:deps script 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-pretty as 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-pretty is 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 RouteNavItem aligns with the PR objective to reduce the public API surface while keeping it available through the exported NavItem union type.


15-23: LGTM: Intentional API surface reduction.

Internalizing ViewNavItem aligns with the PR objective to reduce the public API surface while keeping it available through the exported NavItem union type.


25-25: LGTM: ActionNavItem removal as intended.

The removal of ActionNavItem from the union type is consistent with the cleanup effort described in the AI summary.

@simo6529 simo6529 merged commit 3e69063 into main Oct 28, 2025
9 checks passed
@simo6529 simo6529 deleted the clean-unused branch October 28, 2025 11:31
This was referenced Oct 29, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Jan 9, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Feb 3, 2026
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.

2 participants