Skip to content

refactor: consolidate type checking into adamantite linting#100

Open
adelrodriguez wants to merge 3 commits into
mainfrom
03-20-refactor_migrate_from_.oxlintrc.json_to_oxlint.config.ts
Open

refactor: consolidate type checking into adamantite linting#100
adelrodriguez wants to merge 3 commits into
mainfrom
03-20-refactor_migrate_from_.oxlintrc.json_to_oxlint.config.ts

Conversation

@adelrodriguez
Copy link
Copy Markdown
Collaborator

This pull request consolidates type checking functionality into the linting process and removes standalone type checking commands across the codebase.

Key Changes

Removed standalone type checking:

  • Removed typecheck script from all package.json files
  • Removed typecheck task from turbo.json pipeline
  • Removed types step from GitHub Actions workflow
  • Deleted .oxlintrc.json configuration file

Integrated type checking into linting:

  • Added oxlint.config.ts with typeAware: true and typeCheck: true options
  • Updated adamantite check to now handle both linting and type checking
  • Modified documentation to reflect that adamantite check runs both linting and type checks

Dependency management:

  • Introduced package catalog for consistent TypeScript and Node.js type versions
  • Updated dependencies to use catalog references ("typescript": "catalog:")
  • Upgraded various tools including adamantite, oxlint, oxfmt, and knip

Code quality improvements:

  • Fixed TypeScript strict mode violations by removing unnecessary null checks and optional chaining
  • Added proper type annotations and improved type safety
  • Updated mobile app files with oxlint disable comments for CommonJS modules
  • Enhanced error handling and removed redundant authentication checks

Configuration updates:

  • Added proper types field to tsconfig files for runtime-specific types
  • Updated package manager to bun@1.3.11
  • Consolidated linting configuration with proper ignore patterns and overrides

This change streamlines the development workflow by having a single command (bun run check) handle both linting and type checking, while maintaining the same level of code quality assurance.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 20, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 017926bf-0639-4e2d-9b34-17ebbe887c24

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 03-20-refactor_migrate_from_.oxlintrc.json_to_oxlint.config.ts

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.

@adelrodriguez adelrodriguez marked this pull request as ready for review March 20, 2026 21:04
Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@adelrodriguez adelrodriguez force-pushed the 03-20-refactor_migrate_from_.oxlintrc.json_to_oxlint.config.ts branch from 73b3803 to 5ebe8df Compare March 20, 2026 21:07
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 20, 2026

Greptile Summary

This PR consolidates type checking from standalone tsc --noEmit commands into oxlint's built-in typeAware and typeCheck options via a new oxlint.config.ts. The changes simplify the developer workflow to a single bun run check command and remove the separate typecheck turbo pipeline task. Additionally, a package catalog is introduced for consistent TypeScript and @types/* versioning across the monorepo, and the tooling/env/src/vite.ts ensureEnv signature is updated to require an explicit workspace URL instead of relying on process.cwd().

Key observations:

  • The carousel's reInit event listener memory leak (listeners added but never removed on cleanup) has been correctly fixed.
  • The ensureEnv API change is a breaking change for callers; all four call sites have been properly updated to pass import.meta.url.
  • Several null/optional-chain guards were removed as TypeScript strict mode deemed them unnecessary — concerns about some of these removals (e.g., payload.length in chart.tsx, globalThis.matchMedia() in theme.tsx, inputOTPContext.slots in input-otp.tsx, keyGenerator returning null in middleware.ts, data.data in email/src/client.ts) have been raised and discussed in previous review threads.
  • The base tsconfig now explicitly sets "types": [], requiring all packages to opt-in to ambient globals — this is a good hygiene improvement.

Confidence Score: 3/5

  • The structural refactoring is sound, but several null-guard removals flagged in previous review threads still represent real runtime risks in UI components and the rate-limiter key generator.
  • The linting consolidation and catalog versioning are well-executed. However, previous review threads flagged several unaddressed issues: payload.length without a null check in chart.tsx, globalThis.matchMedia() without optional chaining in theme.tsx, inputOTPContext.slots without a null guard in input-otp.tsx, and keyGenerator returning null in the rate limiter. Until these are resolved the PR carries meaningful runtime risk in the UI package.
  • packages/ui/src/components/chart.tsx, packages/ui/src/components/theme.tsx, packages/ui/src/components/input-otp.tsx, apps/api/src/shared/middleware.ts
Prompt To Fix All With AI
This is a comment left during a code review.
Path: packages/ui/src/components/carousel.tsx
Line: 95-98

Comment:
**`reInit` listener now properly cleaned up**

The old cleanup only removed the `select` listener while the `reInit` listener (registered on line 92 in the same effect) was never removed, causing a memory/event leak on unmount or `api` changes. The new cleanup correctly removes both listeners. This is a good fix.

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: "fix lint and type is..."

Comment thread packages/backend/src/functions/shared/convex.ts
Comment thread apps/api/src/shared/middleware.ts
Comment thread packages/email/src/client.ts Outdated
Comment thread packages/backend/src/functions/system/health.ts Outdated
@adelrodriguez adelrodriguez force-pushed the 03-20-refactor_migrate_from_.oxlintrc.json_to_oxlint.config.ts branch from 5ebe8df to 2e4e55e Compare March 20, 2026 21:13
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 73b38038d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 149 to +150
const tooltipLabel = React.useMemo(() => {
if (hideLabel || !payload?.length) {
if (hideLabel || payload.length === 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard ChartTooltipContent against missing payload

CustomTooltipProps inherits Recharts' tooltip contract, where payload is optional, but this change dereferences payload.length before any nullish guard. When Recharts invokes the tooltip with payload === undefined (for example before the first hover or while clearing the tooltip), ChartTooltipContent will throw instead of rendering nothing, crashing any chart that uses this shared tooltip.

Useful? React with 👍 / 👎.

Comment thread oxlint.config.ts

export default defineConfig({
extends: [core, react, node],
ignorePatterns: ["**/*.hbs", "**/src/**/_generated", "**/*.d.ts", "**/*.gen.ts", "cli/**"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Stop excluding the CLI from the unified type check

This refactor removes the CLI package's standalone typecheck script, but the new root adamantite check path still skips cli/** entirely via oxlint's ignore list. That leaves cli/src/** with no automated type-check coverage at all, so regressions in the published init-now CLI will now pass both local bun run check and the Adamantite workflow unnoticed.

Useful? React with 👍 / 👎.


const tooltipLabel = React.useMemo(() => {
if (hideLabel || !payload?.length) {
if (hideLabel || payload.length === 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 payload can be undefined, causing a TypeError

payload comes from recharts' TooltipContentProps<ValueType, NameType> where it is typed as Payload<ValueType, NameType>[] | undefined. The original payload?.length safely short-circuits when payload is undefined (returning undefined, which is falsy), but payload.length will throw TypeError: Cannot read properties of undefined (reading 'length') when recharts passes undefined — which it routinely does before the tooltip is active or on initial mount.

The same crash occurs on line 177 for the same reason.

Suggested change
if (hideLabel || payload.length === 0) {
if (hideLabel || !payload?.length) {
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/ui/src/components/chart.tsx
Line: 150

Comment:
**`payload` can be `undefined`, causing a TypeError**

`payload` comes from recharts' `TooltipContentProps<ValueType, NameType>` where it is typed as `Payload<ValueType, NameType>[] | undefined`. The original `payload?.length` safely short-circuits when `payload` is `undefined` (returning `undefined`, which is falsy), but `payload.length` will throw `TypeError: Cannot read properties of undefined (reading 'length')` when recharts passes `undefined` — which it routinely does before the tooltip is active or on initial mount.

The same crash occurs on line 177 for the same reason.

```suggestion
    if (hideLabel || !payload?.length) {
```

How can I resolve this? If you propose a fix, please make it concise.

}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey])

if (!active || !payload?.length) {
if (!active || payload.length === 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Same payload undefined crash as line 150

payload is Payload[] | undefined from recharts' TooltipContentProps. When payload is undefined this line throws a TypeError rather than returning null as the original !payload?.length guard did.

Suggested change
if (!active || payload.length === 0) {
if (!active || !payload?.length) {
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/ui/src/components/chart.tsx
Line: 177

Comment:
**Same `payload` undefined crash as line 150**

`payload` is `Payload[] | undefined` from recharts' `TooltipContentProps`. When `payload` is `undefined` this line throws a TypeError rather than returning `null` as the original `!payload?.length` guard did.

```suggestion
  if (!active || !payload?.length) {
```

How can I resolve this? If you propose a fix, please make it concise.

useEffect(() => {
const root = document.documentElement
const mediaQuery = globalThis.matchMedia?.("(prefers-color-scheme: dark)")
const mediaQuery = globalThis.matchMedia("(prefers-color-scheme: dark)")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 matchMedia may be undefined in test environments, causing a TypeError

While useEffect only runs in the browser and SSR is safe, globalThis.matchMedia is undefined in JSDOM (the default test environment for Vitest/Jest) unless explicitly mocked. The removed ?. optional chaining would previously return undefined gracefully, making the effect a no-op. Now it throws TypeError: globalThis.matchMedia is not a function, which will crash any component test that renders ThemeProvider without setting up a matchMedia mock.

Suggested change
const mediaQuery = globalThis.matchMedia("(prefers-color-scheme: dark)")
const mediaQuery = globalThis.matchMedia?.("(prefers-color-scheme: dark)")
if (!mediaQuery) return
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/ui/src/components/theme.tsx
Line: 59

Comment:
**`matchMedia` may be undefined in test environments, causing a TypeError**

While `useEffect` only runs in the browser and SSR is safe, `globalThis.matchMedia` is `undefined` in JSDOM (the default test environment for Vitest/Jest) unless explicitly mocked. The removed `?.` optional chaining would previously return `undefined` gracefully, making the effect a no-op. Now it throws `TypeError: globalThis.matchMedia is not a function`, which will crash any component test that renders `ThemeProvider` without setting up a `matchMedia` mock.

```suggestion
    const mediaQuery = globalThis.matchMedia?.("(prefers-color-scheme: dark)")
    if (!mediaQuery) return
```

How can I resolve this? If you propose a fix, please make it concise.

@adelrodriguez adelrodriguez force-pushed the 03-20-refactor_migrate_from_.oxlintrc.json_to_oxlint.config.ts branch from 2e4e55e to 6142aca Compare March 20, 2026 21:25
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6142acac5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 38 to 40
const authUser = await authComponent.getAuthUser(ctx)

if (!authUser) {
throw new UnauthenticatedError()
}

if (authUser.role !== "admin") {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore the null guard after getAuthUser in auth middleware

ctx.auth.getUserIdentity() only proves the request has an auth token; it does not guarantee authComponent.getAuthUser(ctx) returns a row. If the Better Auth user has been deleted or is otherwise out of sync, this branch now dereferences authUser.role and throws a 500 instead of returning an auth error, and the sibling withAuthentication middleware will pass authUser: null into protected handlers. Keeping the old UnauthenticatedError check avoids that stale-session crash path.

Useful? React with 👍 / 👎.

export function withRateLimiting(interval: TimeExpression, limit: number) {
return rateLimiter<AppContext>({
keyGenerator: (c) => c.var.session?.user.id ?? findIp(c.req.raw) ?? "unknown",
keyGenerator: (c) => c.var.session?.user.id ?? findIp(c.req.raw),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep a fallback key for anonymous rate-limited requests

The public /health route is the current caller of withRateLimiting, so c.var.session is always null there. findIp(c.req.raw) can also fail to resolve an address (for example in local/dev setups or behind proxies that do not forward client IPs), and hono-rate-limiter uses whatever keyGenerator returns as the store key. After removing the 'unknown' fallback, all of those anonymous requests collapse onto the same undefined bucket, so a few probes can start 429ing every other health check.

Useful? React with 👍 / 👎.

}) {
const inputOTPContext = React.useContext(OTPInputContext)
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index] ?? {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 inputOTPContext may be null when used outside its provider

React.useContext(OTPInputContext) returns null if InputOTPSlot is rendered outside an OTPInput provider. The original inputOTPContext?.slots[index] ?? {} handled this gracefully — the ?. would short-circuit and ?? {} would provide a safe fallback.

The new inputOTPContext.slots[index] ?? {} removes the guard: if inputOTPContext is null, accessing .slots throws TypeError: Cannot read properties of null (reading 'slots'), crashing any component that renders InputOTPSlot outside the correct provider context.

Suggested change
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index] ?? {}
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/ui/src/components/input-otp.tsx
Line: 49

Comment:
**`inputOTPContext` may be `null` when used outside its provider**

`React.useContext(OTPInputContext)` returns `null` if `InputOTPSlot` is rendered outside an `OTPInput` provider. The original `inputOTPContext?.slots[index] ?? {}` handled this gracefully — the `?.` would short-circuit and `?? {}` would provide a safe fallback.

The new `inputOTPContext.slots[index] ?? {}` removes the guard: if `inputOTPContext` is `null`, accessing `.slots` throws `TypeError: Cannot read properties of null (reading 'slots')`, crashing any component that renders `InputOTPSlot` outside the correct provider context.

```suggestion
  const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}
```

How can I resolve this? If you propose a fix, please make it concise.

@adelrodriguez adelrodriguez force-pushed the 03-20-refactor_migrate_from_.oxlintrc.json_to_oxlint.config.ts branch from 6142aca to 2844ec6 Compare March 20, 2026 21:39
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2844ec6a83

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/adamantite.yml Outdated
Comment thread packages/email/src/client.ts
@adelrodriguez adelrodriguez force-pushed the 03-20-refactor_migrate_from_.oxlintrc.json_to_oxlint.config.ts branch from 2844ec6 to f25f4c6 Compare March 20, 2026 21:47
@adelrodriguez adelrodriguez requested a review from Copilot March 20, 2026 21:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR streamlines the monorepo’s developer workflow by removing standalone TypeScript typecheck commands and making bun run check (Adamantite + Oxlint) run both linting and type checking, while also normalizing TS/typings versions via Bun’s catalog.

Changes:

  • Removed typecheck scripts/tasks/CI step and consolidated type checking into Oxlint (typeAware/typeCheck) via oxlint.config.ts.
  • Updated tsconfigs across apps/packages to explicitly set runtime types and added repo-wide dependency version pinning via catalog:.
  • Various small code tweaks to satisfy stricter type/lint rules and updated toolchain versions/lockfile.

Reviewed changes

Copilot reviewed 73 out of 75 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
turbo.json Removes typecheck pipeline task.
tsconfig.json Adds Bun types and includes oxlint.config.ts.
tooling/tsconfig/base.json Sets types: [] baseline for per-package opt-in.
tooling/env/src/vite.ts Refactors ensureEnv to resolve workspace dir from path or file URL.
packages/workflows/package.json Drops typecheck script; switches TS version to catalog:.
packages/utils/tsconfig.json Adds Bun/Node runtime typings.
packages/utils/src/url.ts Simplifies URL builder signature typing.
packages/utils/src/singleton.ts Makes global cache field optional for strict typing.
packages/utils/package.json Removes typecheck; switches to catalog: for typings/TS.
packages/ui/src/components/theme.tsx Adjusts matchMedia usage and theme logic typing.
packages/ui/src/components/sonner.tsx Removes default theme fallback from useTheme() destructure.
packages/ui/src/components/input-otp.tsx Tightens OTP context access to satisfy strictness.
packages/ui/src/components/field.tsx Simplifies length check for stricter typing.
packages/ui/src/components/chart.tsx Refactors tooltip guards (introduces a runtime risk).
packages/ui/src/components/carousel.tsx Cleans up Embla event unsubscription and props.
packages/ui/package.json Removes typecheck; switches TS to catalog:.
packages/storage/tsconfig.json Adds Bun runtime typings.
packages/storage/package.json Removes typecheck; switches to catalog:.
packages/payments/package.json Removes typecheck; switches TS to catalog:.
packages/observability/package.json Removes typecheck; switches TS to catalog:.
packages/native-ui/src/components/text.tsx Simplifies role/aria-level assignment.
packages/native-ui/package.json Removes typecheck; switches TS to catalog:.
packages/kv/tsconfig.json Adds Bun runtime typings.
packages/kv/package.json Removes typecheck; switches typings/TS to catalog:.
packages/error/package.json Removes typecheck; switches TS to catalog:.
packages/env/tsconfig.json Adds Node runtime typings.
packages/env/src/runtime.ts Improves runtime env typing across environments.
packages/env/package.json Removes typecheck; adds @types/node via catalog:.
packages/email/tsconfig.json Adds Node runtime typings.
packages/email/src/client.ts Changes batch email return value (introduces return-shape mismatch).
packages/email/package.json Removes typecheck; switches typings/TS to catalog:.
packages/db/package.json Removes typecheck; switches TS to catalog:.
packages/core/package.json Removes typecheck; switches TS to catalog:.
packages/backend/tsconfig.json Adds Node runtime typings.
packages/backend/src/functions/system/health.ts Refactors handler to explicit Promise return.
packages/backend/src/functions/shared/convex.ts Removes redundant authUser null checks in middleware.
packages/backend/src/functions/public/auth.ts Simplifies current user return value.
packages/backend/package.json Removes typecheck; adds @types/node via catalog:.
packages/auth/src/client/index.ts Tightens locale/error code lookup typing.
packages/auth/package.json Removes typecheck; switches TS to catalog:.
packages/analytics/package.json Removes typecheck; switches TS to catalog:.
packages/ai/package.json Removes typecheck; switches TS to catalog:.
package.json Removes root typecheck script; adds Bun catalog; updates tool versions and bun version.
oxlint.config.ts Adds consolidated Oxlint config with type-aware/type-check enabled.
docs/development.md Removes mention of bun run typecheck.
cli/package.json Updates typecheck script to use project tsconfig; TS via catalog:.
bun.lock Updates lockfile for toolchain upgrades and catalog resolution.
apps/web/tsconfig.json Removes local esModuleInterop override.
apps/web/package.json Removes typecheck; TS via catalog:.
apps/web/astro.config.ts Updates ensureEnv call signature.
apps/mobile/tsconfig.json Adds Node runtime typings.
apps/mobile/src/shared/utils.ts Replaces ts-expect-error with explicit global typing.
apps/mobile/package.json Removes typecheck; adds @types/node via catalog:.
apps/mobile/metro.config.js Adds oxlint disable for CommonJS module.
apps/mobile/babel.config.js Adds oxlint disable for CommonJS module.
apps/extension/wxt.config.ts Updates ensureEnv call signature.
apps/extension/tsconfig.json Adds Chrome runtime typings.
apps/extension/package.json Removes compile/typecheck; TS via catalog:.
apps/docs/tsconfig.json Removes local esModuleInterop override.
apps/docs/package.json Removes typecheck; TS via catalog:.
apps/desktop/vite.config.ts Updates ensureEnv call signature.
apps/desktop/package.json Removes typecheck; TS via catalog:.
apps/app/vite.config.ts Updates ensureEnv call signature.
apps/app/tsconfig.json Adds Node runtime typings.
apps/app/src/shared/logger.ts Uses "window" in globalThis for environment detection.
apps/app/src/routes/_authenticated/index.tsx Removes UI fallback for missing user name.
apps/app/package.json Removes typecheck; typings/TS via catalog:.
apps/api/turbo.json Drops ^typecheck dependency from deploy task.
apps/api/tsconfig.json Adds Bun runtime typings.
apps/api/src/shared/middleware.ts Simplifies session middleware and rate limit key generation.
apps/api/src/routes/v1/index.ts Removes optional chaining on validated query object.
apps/api/package.json Removes typecheck; typings/TS via catalog:.
AGENTS.md Updates contributor guidance for new check workflow.
.oxlintrc.json Removes old JSON-based Oxlint config (replaced by TS config).
.github/workflows/adamantite.yml Removes separate typecheck job; ensures codegen runs before check; adds Node setup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 149 to 152
const tooltipLabel = React.useMemo(() => {
if (hideLabel || !payload?.length) {
if (hideLabel || payload.length === 0) {
return null
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

payload comes from TooltipContentProps and can be undefined; accessing payload.length will throw at runtime. Consider defaulting payload = [] in the destructuring or switching back to payload?.length checks.

Copilot uses AI. Check for mistakes.
Comment on lines +177 to 178
if (!active || payload.length === 0) {
return null
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

Same issue here: payload may be undefined per TooltipContentProps, so payload.length can crash. Guard with payload?.length or default payload to an empty array.

Copilot uses AI. Check for mistakes.
}

return data.data ?? []
return data
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

batchEmails returns an array in the MOCK_RESEND branch, but this now returns data from email.batch.send, which appears to change the return shape (previously returned data.data ?? []). Please keep the return type consistent (e.g., return the array of results) to avoid breaking callers.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

"check": "adamantite check",

P2 Badge Add codegen/typegen prerequisites back to the root check script

bun run check is now the documented local verification step (AGENTS.md:9-12, docs/development.md:21-24), but this script no longer materializes generated inputs before invoking Adamantite. On a clean checkout, that means apps/web/src/middleware.ts:2 imports #shared/internationalization/runtime.js before apps/web/package.json:11-16 has run codegen, and apps/extension/tsconfig.json:7 still references .wxt/wxt.d.ts that only apps/extension/package.json:17-18 creates via wxt prepare. As written, fresh clones and cleaned worktrees will see bun run check fail before it can lint or type-check user code.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 95 to +98
api.on("select", onSelect)

return () => {
api?.off("select", onSelect)
api.off("reInit", onSelect)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 reInit listener now properly cleaned up

The old cleanup only removed the select listener while the reInit listener (registered on line 92 in the same effect) was never removed, causing a memory/event leak on unmount or api changes. The new cleanup correctly removes both listeners. This is a good fix.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/ui/src/components/carousel.tsx
Line: 95-98

Comment:
**`reInit` listener now properly cleaned up**

The old cleanup only removed the `select` listener while the `reInit` listener (registered on line 92 in the same effect) was never removed, causing a memory/event leak on unmount or `api` changes. The new cleanup correctly removes both listeners. This is a good fix.

How can I resolve this? If you propose a fix, please make it concise.

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