Skip to content

refactor(ai): AI status in overview settings page - #857

Merged
aXenDeveloper merged 2 commits into
claude/security-hardeningfrom
refactor/ai_status
Oct 9, 2026
Merged

aXenDeveloper merged 2 commits into
claude/security-hardeningfrom
refactor/ai_status

Conversation

@aXenDeveloper

Copy link
Copy Markdown
Owner

Improving Documentation

Description

What?

Why?

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T15:05:21.495206Z b5cf987 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the 🧱 Refactor A code change that neither fixes a bug nor adds a feature label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

React Doctor found 4 new issues in 3 files · 4 warnings · score 90 / 100 (Great) · 2 fixed · vs claude/security-hardening

4 warnings

scripts/cli/builder/report.ts

  • ⚠️ L320 Array lookup inside a loop js-set-map-lookups

src/proto/ai-unlimited/data.ts

  • ⚠️ L54 Intl formatter rebuilt each call js-hoist-intl
  • ⚠️ L58 Intl formatter rebuilt each call js-hoist-intl

src/proto/ai-unlimited/harness.tsx

  • ⚠️ L82 Effect re-subscribes on a changing callback prefer-use-effect-event

Reviewed by React Doctor for commit b5cf987. See inline comments for fixes.

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

Copy link
Copy Markdown

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: 3c32577b38

ℹ️ 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".

@@ -0,0 +1,8 @@
import { createFileRoute } from '@tanstack/react-router'

import { AiUnlimitedProto } from '@/proto/ai-unlimited/harness'

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 Badge Keep route modules topology-only

This route directly imports and mounts an app-local prototype screen, contrary to the repository requirement that route modules contain only topology and that screens and namespaces live behind @vitnode/core/tanstack/*. Move the screen behind the prescribed TanStack module and leave this file with route metadata and loaders only.

AGENTS.md reference: AGENTS.md:L31-L31

Useful? React with 👍 / 👎.

.max(USER_HEADLINE_MAX_LENGTH)
.default(user.headline ?? ""),
showRealName: z.boolean().default(user.showRealName),
timeZone: z.enum(zones as [string, ...string[]]).default(initialTimeZone),

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 Preserve stored time zones in the form enum

When Intl.supportedValuesOf is unavailable, or the account stores a valid IANA alias absent from the browser's returned list, initialTimeZone is not a member of this enum. Submitting the combined sheet then fails time-zone validation even when the user only changed an unrelated name or phone field. Include the stored value in zones and its labels, or avoid browser-enum validation for an unchanged server value.

Useful? React with 👍 / 👎.

.map(action => ({ action, points: Number(action.monthPoints) }))
.filter(({ points }) => points > 0)
.sort((a, b) => b.points - a.points);
const total = used.reduce((sum, { points }) => sum + points, 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 Account for usage from unavailable AI actions

When a user spent points on an action that is later disabled or whose permission is revoked, loadUserAiUsage still includes those charges in points.used but omits that action from actions (usage-summary.ts filters at lines 148–165). Computing the denominator solely from the remaining actions makes their percentages add up to 100% while the displayed point rows do not equal the monthly total. Pass the overall used total into the breakdown and represent the residual usage as an “other” segment.

Useful? React with 👍 / 👎.


export const formatPoints = (value: number) => {
if (value > 0 && value < 0.1) return '<0.1'
return new Intl.NumberFormat('en', { maximumFractionDigits: 1 }).format(Math.floor(value * 10) / 10)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/js-hoist-intl (warning)

This is slow because new Intl.NumberFormat() rebuilds on every call inside a function, so move it to the top of the file, or wrap it in useMemo

Fix → Move new Intl.NumberFormat(...) to the top of the file or wrap it in useMemo. Building one is slow, so don't redo it on every call

Docs

}

export const formatDay = (date: Date) =>
new Intl.DateTimeFormat('en', { day: 'numeric', month: 'long' }).format(date)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/js-hoist-intl (warning)

This is slow because new Intl.DateTimeFormat() rebuilds on every call inside a function, so move it to the top of the file, or wrap it in useMemo

Fix → Move new Intl.NumberFormat(...) to the top of the file or wrap it in useMemo. Building one is slow, so don't redo it on every call

Docs

}
document.addEventListener('keydown', onKey)
return () => document.removeEventListener('keydown', onKey)
}, [active, onChange])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/prefer-use-effect-event (warning)

Your effect re-subscribes whenever "onChange" changes, even though it's only used inside addEventListener.

Fix → Wrap the callback with useEffectEvent(callback) (React 19.2+) and call it inside the sub-handler. An Effect Event always sees the latest props and state but isn't a dependency, so the effect won't re-subscribe every time the parent redraws. See https://react.dev/reference/react/useEffectEvent

Docs

? []
: routes.filter(route => isAdminRoute(route) && route.mode === "dynamic");
const lines: RouteLine[] = routes
.filter(route => !collapsed.includes(route))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/js-set-map-lookups (warning)

This scales poorly because array.includes() inside a loop scans the whole list every time. Use a Set for constant-time lookups.

Fix → Use a Set or Map when you check for the same items over and over. Array.includes/find scans the whole list each time

Docs

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

Copy link
Copy Markdown

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: b5cf987969

ℹ️ 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".

specifier,
})),
contentRegistry: contentRegistry.modules,
hostRoutes,

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 Preserve host routes with supported file syntax

When an app uses TanStack's escaped-dot or optional-parameter filename syntax, this exposes the intentionally conservative readHostRoutes result to the new report even though its parser drops every file containing an unrecognized token. The current app demonstrates the regression: llms[.]txt.ts, llms-full[.]txt.ts, and docs.{$}[.]md.ts are present in routeTree.gen.ts, but never enter hostRoutes, so vitnode build silently omits real routes from the advertised all-routes summary. Build the report from the generated route tree or extend discovery to cover all supported file-route syntax.

Useful? React with 👍 / 👎.

@aXenDeveloper
aXenDeveloper added this pull request to stack #860 October 9, 2026 17:08
@aXenDeveloper
aXenDeveloper merged commit f5654c3 into canary Oct 9, 2026
5 of 6 checks passed
@aXenDeveloper
aXenDeveloper deleted the refactor/ai_status branch October 9, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧱 Refactor A code change that neither fixes a bug nor adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant