Repository navigation
chore: delete five unreferenced exports from src/lib and src/hooks - #37
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe PR removes obsolete onboarding and session actions, AI provider interfaces, and the Supabase staging environment export. ChangesPublic API cleanup
Estimated code review effort: 1 (Trivial) | ~5 minutes Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing. Comment |
47ac9e1 to
8b61519
Compare
|
Interim independent review while CodeRabbit is rate limited (Free plan allows 1 review/hour). Reviewer: Claude Opus 4.5, run locally against CodeRabbit will still review this PR when its hourly window resets; this does not replace it. |
8b61519 to
c876a1c
Compare
|
Independent review, second pass, model upgraded to Claude Opus 5 (the earlier comment on this PR used Opus 4.5). Run locally against Every should-fix finding below has been addressed in the current head. Full output: |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Each has no caller anywhere in the tracked tree. Verified with plain string greps, not just typecheck, since untyped access through a store would not fail typecheck: - AIRequest and AIResponse in lib/ai/providers/types.ts. Speculative provider DTOs from before AI calls moved behind the Edge Functions. The rest of the file (AIProvider, AIModel, ProviderConfig, DEFAULT_PROVIDERS) is live. - moveSourceToFolder in the session store, a one-line delegate to updateSource that nothing calls. LibraryPage calls updateSource directly, folder included. - resetOnboarding in the onboarding store. Its only consumer, OnboardingTour.tsx, destructures isTourRunning, hasCompletedOnboarding, setOnboardingComplete, startTour, and stopTour, but never this action. No window store exposure and no page.evaluate access exists anywhere. - IS_STAGING in lib/supabase/env.ts. Zero matches in the entire tracked tree, including e2e/staging, scripts, ios, public, nginx.conf, and vercel.json. The staging suite never imports this module: it builds its own client from @supabase/supabase-js and reads STAGING_* environment variables. Verified on main fe679fd, from a clean npm ci: docs:check, lint, typecheck, 956 unit tests, 121 edge tests, build, and 126 Chromium e2e tests pass.
c876a1c to
6333ff0
Compare
Fourth PR from the over-engineering audit. Scoped to
src/libandsrc/hooks. Independent of #34, #35, #36, and #38: no file overlap, based on currentmain.Removed
Five exports, 23 lines. Each was verified with plain string greps across the whole tracked tree, not just typecheck, because untyped access through a Zustand store would not fail typecheck:
AIRequestandAIResponseinsrc/lib/ai/providers/types.ts. Speculative provider DTOs from before AI calls moved behind the Edge Functions, which now own the request and response shapes. The rest of the file stays:AIProvider,AIModel,ProviderConfig, andDEFAULT_PROVIDERSare all live.README.md:591contains an unrelated inlineinterface AIRequestin an API example; it does not import this type.moveSourceToFolderin the session store. A one-line delegate toupdateSourcethat nothing calls;LibraryPage.tsx:395callsupdateSourcedirectly, including for thefolderfield.resetOnboardingin the onboarding store. Its only consumer isOnboardingTour.tsx:10, which destructuresisTourRunning,hasCompletedOnboarding,setOnboardingComplete,startTour, andstopTour— never this action. There is nowindow.__stores-style exposure anywhere and nopage.evaluatestore access ine2e/, so there is no untyped call path either.IS_STAGINGinsrc/lib/supabase/env.ts. See below.On IS_STAGING and the staging suite
Worth addressing head on, since this PR deletes the app's only staging flag while not running the staging suite.
Zero matches in the entire tracked tree, including
e2e/staging/,scripts/,ios/,public/,nginx.conf, andvercel.json. There is no barrel that re-exportsenv.tseither.The staging suite cannot be affected, and the reason is structural rather than a grep result:
e2e/staging/auth.setup.tsande2e/staging/authed-flows.spec.tsnever import fromsrc/. They construct their own client from@supabase/supabase-jsand read theSTAGING_SUPABASE_URL/STAGING_SUPABASE_ANON_KEY/STAGING_DEMO_CODEenvironment variables.IS_STAGINGwas a browser-bundle flag with no consumer on either side.An earlier revision of this description said "nothing here is staging dependent", which was loose wording for a PR that deletes a symbol with
STAGINGin its name. The claim above is the precise one.Rejected during this pass
Three findings from the audit that I tried and backed out. Each is a case where the shorter form is wrong, so I'd rather record why than leave them to be rediscovered:
Dropping the
FileReaderfallbacks insrc/lib/source-file-import.ts(~30 lines, the largest cut in this slice).file.text()andfile.arrayBuffer()exist in every browser this app targets, so the fallbacks look like dead compatibility code. They are not, and the empirical result is the justification: removing them fails 6 tests withTypeError: file.text is not a function. Mechanism, pinned to this lockfile rather than stated as a general jsdom fact — jsdom 20.0.3, the version installed here, implements neither:Keeping the fallback is strictly less code than removing it and polyfilling the test setup.
Replacing
createId()'s UUID fallback withcrypto.randomUUID()in the sparring store.crypto.randomUUIDis only defined in a secure context, so this would beundefinedand throw when the dev server is reached over a plain-HTTP LAN address. Six lines is not worth that.Removing
BLOCKED_PROTOCOLSfromsrc/lib/validation/url.ts. TheALLOWED_PROTOCOLSallowlist immediately below already rejects every scheme the blocklist names, so the check is redundant for the reject decision. It is still deliberate defense in depth at a trust boundary and emits a distinct[SECURITY]log line for dangerous schemes. Not worth trading for 6 lines.Verification
npm run lintnpm run typechecknpm test -- --coveragenpm run test:edgenpm run buildnpm run test:e2esearch-qualityNot run: WebKit smoke, and the protected staging suite, whose independence from this diff is established above.
Summary by CodeRabbit