Repository navigation
chore(pnpm): ✨ update seroval and seroval-plugins versions; add peerDependencyRules for TypeScript - #915
Conversation
…ependencyRules for TypeScript
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
React Doctor found 12 new issues in 7 files · 3 errors & 9 warnings · score 77 / 100 (Needs work) · 1 fixed · vs Errors
9 warnings
Reviewed by React Doctor for commit |
… pages - Introduced new pages for managing warning thresholds and reasons in the admin panel. - Implemented `AutoFormFieldCollapse` for better UI interactions in forms. - Added `ValueSwap` component for smooth transitions between values. - Renamed `durationHours` to `durationMinutes` in the database schema.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 388a614f0d
ℹ️ 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 @@ | |||
| ALTER TABLE "core_moderation_warning_thresholds" RENAME COLUMN "durationHours" TO "durationMinutes"; No newline at end of file | |||
There was a problem hiding this comment.
Convert existing hour values when renaming the duration column
When upgrading an installation with existing temporary-suspension thresholds, this migration preserves the numeric values in hours, but thresholdSuspensionEnd now interprets them as minutes. A configured 24-hour suspension therefore becomes a 24-minute suspension for subsequently issued warnings, silently shortening every existing temporary threshold by a factor of 60. Multiply the non-null stored durations by 60 as part of this migration so existing moderation settings retain their meaning.
Useful? React with 👍 / 👎.
…ivity logs - Introduced `ActivityPagination` interface for managing pagination. - Updated `fetchPage` to accept pagination parameters. - Enhanced `activityListQueryOptions` to support pagination and search actions. - Removed deprecated `ActivityRetentionForm` component. - Implemented `searchActivityActors` for filtering actors in activity logs. - Refactored `ActivityScreen` to utilize new pagination and search features. - Added `useActivityTableFilters` for managing filter options in the activity logs. - Updated `ActivityTable` to handle new entry display logic with details toggle. - Configured `VitNodeApiConfig` to include `activityLogs` retention settings.
1d07d0e
into
claude/vitnode-warning-sanctions-0ugeet
| const widthRef = React.useRef<null | number>(null); | ||
| const keyRef = React.useRef(swapKey); | ||
|
|
||
| React.useLayoutEffect(() => { |
There was a problem hiding this comment.
React Doctor · react-doctor/effect-needs-cleanup (error)
addEventListener creates a subscription in useLayoutEffect without guaranteed cleanup. Return a cleanup function that owns every allocation so it does not leak after unmount.
Fix → Return a cleanup function that stops the subscription or timer: return () => target.removeEventListener(name, handler) for listeners, return () => clearInterval(id) or clearTimeout(id) for timers, return () => observer.disconnect() for observers, return () => socket.close() for connections, or return unsubscribe if the subscribe call already gave you one.
| } | ||
| container.dataset.swapping = ""; | ||
| const resize = container.animate( | ||
| [{ width: `${previousWidth}px` }, { width: `${nextWidth}px` }], |
There was a problem hiding this comment.
React Doctor · react-doctor/no-layout-property-animation (error)
This Web Animation changes "width" every frame, forcing layout work. Animate transform or opacity instead.
Fix → Use transform: translateX() or scale() instead. They animate smoothly without making the browser redo layout or repaint
| const tab = useRouterState({ | ||
| select: state => adminWarningsTabFromPath(state.location.pathname), | ||
| }); | ||
| const [openCreate, setOpenCreate] = React.useState<(() => void) | null>(null); |
There was a problem hiding this comment.
React Doctor · react-doctor/rerender-state-only-in-handlers (warning)
Each update to "openCreate" redraws your component for nothing because this useState is set but never shown on screen.
Fix → Use useRef instead of useState when the value is only set and never shown on screen. ref.current = ... updates it without redrawing the component.
| ); | ||
| }; | ||
|
|
||
| const ActivityEntryPanelContent = ({ |
There was a problem hiding this comment.
React Doctor · react-doctor/no-high-complexity-react-function (warning)
ActivityEntryPanelContent has cyclomatic complexity 18, cognitive complexity 17, and maximum nesting depth 2, so its React logic is hard to understand and change. Extract independent branches into components or hooks.
Fix → Extract independent render branches and state logic into focused components or hooks until the control flow is easy to follow.
| </button> | ||
| ); | ||
|
|
||
| const FilterSection = ({ filter }: { filter: FilterDataTable }) => { |
There was a problem hiding this comment.
React Doctor · react-doctor/no-high-complexity-react-function (warning)
FilterSection has cyclomatic complexity 19, cognitive complexity 17, and maximum nesting depth 2, so its React logic is hard to understand and change. Extract independent branches into components or hooks.
Fix → Extract independent render branches and state logic into focused components or hooks until the control flow is easy to follow.
| ) : null} | ||
| {options.map(option => ( | ||
| <OptionChip | ||
| isSelected={selected.includes(option.value)} |
There was a problem hiding this comment.
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
| <div | ||
| aria-label={t("filters.label")} | ||
| className="border-foreground/10 border-b px-4 py-3" | ||
| role="search" |
There was a problem hiding this comment.
React Doctor · react-doctor/prefer-tag-over-role (warning)
Screen reader users get more reliable semantics from <search> than role="search", so use <search> instead.
Fix → Use the matching HTML element when one exists so browsers and assistive tech get native semantics.
| if (!needle) return undefined; | ||
|
|
||
| const matches = actions | ||
| .filter(action => foldForSearch(labelOf(action)).includes(needle)) |
There was a problem hiding this comment.
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
| const target = labels.target(entry); | ||
|
|
||
| return ( | ||
| <div |
There was a problem hiding this comment.
React Doctor · react-doctor/interactive-supports-focus (warning)
Keyboard users can't focus this 'row' because it can't receive focus, so add tabIndex={0} or tabIndex={-1}.
Fix → Add keyboard focus support so users can reach interactive elements without a pointer.
| <div | ||
| aria-label={t("table_label")} | ||
| className="grid grid-cols-[3rem_minmax(0,1fr)] md:grid-cols-[3rem_minmax(7rem,auto)_minmax(6rem,auto)_minmax(10rem,1.3fr)_minmax(8rem,1fr)_minmax(6rem,auto)]" | ||
| role="table" |
There was a problem hiding this comment.
React Doctor · react-doctor/prefer-tag-over-role (warning)
Screen reader users get more reliable semantics from <table> than role="table", so use <table> instead.
Fix → Use the matching HTML element when one exists so browsers and assistive tech get native semantics.
Improving Documentation
pnpm lint:fixto fix formatting issues before opening the PR.Description
What?
Why?