fix(frontend): unify shouldIgnoreRowClick to shared utility in useTableManager#4391
Conversation
|
@Quantum0uasar is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR consolidates the ChangesRow click handler consolidation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 766f6668-bb60-4914-96cc-05d28e8b3a80
📒 Files selected for processing (2)
web/oss/src/components/EvaluationRunsTablePOC/actions/navigationActions.tsweb/oss/src/components/EvaluationRunsTablePOC/components/EvaluationRunsTable/index.tsx
💤 Files with no reviewable changes (1)
- web/oss/src/components/EvaluationRunsTablePOC/actions/navigationActions.ts
| import {useQueryParamState} from "@/oss/state/appState" | ||
|
|
||
| import {shouldIgnoreRowClick} from "../../actions/navigationActions" | ||
| import {shouldIgnoreRowClick} from "../../../../InfiniteVirtualTable/hooks/useTableManager" |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Use @/oss/* alias instead of a deep relative import.
This import should use the OSS alias to avoid brittle relative traversal and to stay consistent with module-boundary rules.
♻️ Proposed fix
-import {shouldIgnoreRowClick} from "../../../../InfiniteVirtualTable/hooks/useTableManager"
+import {shouldIgnoreRowClick} from "`@/oss/components/InfiniteVirtualTable/hooks/useTableManager`"As per coding guidelines, "Use @/oss/* path alias for shared utilities, helpers, types, hooks, and state that work the same in both EE and OSS" and "Never use relative paths for cross-package imports; use explicit path aliases instead".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import {shouldIgnoreRowClick} from "../../../../InfiniteVirtualTable/hooks/useTableManager" | |
| import {shouldIgnoreRowClick} from "`@/oss/components/InfiniteVirtualTable/hooks/useTableManager`" |
There was a problem hiding this comment.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
ardaerzin
left a comment
There was a problem hiding this comment.
one small change is required to improve import paths in the EvaluationRunsTable/index.tsx file changes
ardaerzin
left a comment
There was a problem hiding this comment.
thanks for the PR @Quantum0uasar 👍
|
Hey maintainers 👋 — the CI failures on this PR are not caused by any code issues. All 6 build jobs are failing with: This is because the PR comes from a fork ( The actual code change in this PR (removing the duplicate Could a maintainer please re-run the failed jobs from your side (with an org-scoped token), or approve the workflow run under |
|
Thanks so much @ardaerzin for the review and approval! Really appreciate the feedback on the import path — glad we got it sorted. 🙏 |
Summary
Closes #3254
This PR removes the duplicate
shouldIgnoreRowClickhelper fromEvaluationRunsTablePOC/actions/navigationActions.tsand updates the import inEvaluationRunsTable/index.tsxto use the canonical shared utility already defined inInfiniteVirtualTable/hooks/useTableManager.tsx.Changes
EvaluationRunsTable/index.tsx: Updated import ofshouldIgnoreRowClickfrom../../actions/navigationActions→../../../../InfiniteVirtualTable/hooks/useTableManagernavigationActions.ts: Removed the duplicateshouldIgnoreRowClickfunction (lines 26–32) and the now-unusedimport type {MouseEvent} from "react"on line 1Why
shouldIgnoreRowClickwas defined in two places with slightly different implementations. The canonical version inuseTableManager.tsxis more thorough (handles Ant Design-specific selectors like.ant-dropdown-trigger,.ant-checkbox-wrapper,.ant-select). All tables should use the one shared utility to stay consistent.Testing
useTableManager.tsxis unchanged