refactor: resolve SonarCloud code smells across web, api, and packages - close #180#179
Conversation
…, and eslint-config
📝 WalkthroughWalkthroughThe PR pins GitHub Actions in the CI/CD workflows, updates shared theme and Storybook typings and state helpers, refactors graph visibility and graph-building helpers, and changes renderer, article-page, contact-page, API client, and worker request flows. ChangesBuild and workflow hardening
Shared UI, theme, and Storybook changes
Graph views and graph construction
Renderer and page helpers
API client and worker backend
Sequence Diagram(s)sequenceDiagram
participant Client
participant ContactRoute
participant Turnstile
participant ContactSchema
Client->>ContactRoute: POST /contact
ContactRoute->>ContactRoute: isBot(body)
ContactRoute->>Turnstile: passedCaptcha(token)
ContactRoute->>ContactSchema: safeParse(body)
ContactRoute->>ContactRoute: fieldErrors(result.error)
ContactRoute-->>Client: ok / 403 / fieldErrors
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Bundle ReportChanges will increase total bundle size by 1.47kB (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: @soroush.tech/dev-esmAssets Changed:
Files in
Files in
Files in
Files in
Files in
Files in
|
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
…Cloud duplication Radio and Checkbox stories carried byte-identical ControlledArgs/WithCheckedState decorators plus a duplicated Colors-story scaffold, driving new_duplicated_lines_density to 6% against the 3% gate on PR #179. Extract both into a shared storiesToggle helper (ControlledArgs, WithCheckedState, colorSwatches, ColorSwatchRows) consumed by both story files, with a co-located test at 100% coverage.
…submission Add an `error` listener to the injected Turnstile script so `loadTurnstile` always settles — a failed load (CSP, network, blockers) can no longer leave the promise hanging and the submit button silently disabled forever. The hook now exposes an `error` state, and ContactInquire shows a message prompting the user to disable blockers and refresh.
…view nits Use the `src/theme/themes` alias for the PaletteColor re-export (alias-only import rule) and correct the AppBar `elevation` JSDoc to state the `4` default.
|



Summary
Cleans up SonarCloud-reported code smells across the monorepo without changing behavior. Spans the web app, the worker API, shared packages, and CI hardening.
Changes
Radio,Switch,TextInput,Paper,Typography,ThemeProvider), graph/utilities, stories, and the API client/logger/request helpers; tightened a few configs.ContactRowvalue typing for safe stringification, and resolved smells in worker services and utils.schema,vite-plugin-sitemap(extracted nested template literal), andeslint-config.build-log.txt.Verification
pnpm lintpnpm test:coverage— 100% on touched filespnpm buildSummary by CodeRabbit
Bug Fixes
Chores