fix(ui): prevent accidental navigation in AppTable and VariantsTable#3340
Open
VahantSharma wants to merge 2 commits intoAgenta-AI:mainfrom
Open
fix(ui): prevent accidental navigation in AppTable and VariantsTable#3340VahantSharma wants to merge 2 commits intoAgenta-AI:mainfrom
VahantSharma wants to merge 2 commits intoAgenta-AI:mainfrom
Conversation
- Add shouldIgnoreRowClick guard to AppTable row click handler - Add shouldIgnoreRowClick guard to VariantsTable row click handler - Fixes issue where clicking checkboxes or dropdown menus triggers row navigation - Affects app management page and all variant table contexts (overview, deployment, evaluation) Builds on shared utility from PR Agenta-AI#1
|
@VahantSharma is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents accidental row navigation in AppTable and VariantsTable by extracting a shared shouldIgnoreRowClick helper function that guards against clicks on interactive elements within table rows.
- Extracts the
shouldIgnoreRowClickhelper from InfiniteVirtualTable to a shared utility module - Applies the helper to AppTable and VariantsTable row click handlers
- Ensures row navigation only triggers on intentional row body clicks, not on interactive elements
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| web/oss/src/lib/tableRowClick.ts | New shared utility function with comprehensive JSDoc that checks if a click originated from interactive elements (buttons, links, checkboxes, dropdowns, inputs) |
| web/oss/src/components/pages/app-management/components/AppTable.tsx | Applies shouldIgnoreRowClick guard to prevent accidental navigation when clicking dropdown menus |
| web/oss/src/components/VariantsComponents/Table/index.tsx | Applies shouldIgnoreRowClick guard to prevent conflicts between row navigation and checkboxes/dropdowns/tooltips |
| web/oss/src/components/InfiniteVirtualTable/hooks/useTableManager.tsx | Refactored to import shouldIgnoreRowClick from the new shared location instead of defining it locally |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR prevents accidental row navigation in AppTable and VariantsTable when users interact with checkboxes, dropdown menus, and other interactive elements inside table rows.
It applies the shared
shouldIgnoreRowClickguard to these tables to ensure row-level navigation only triggers when the user intentionally clicks the row body.Context
Several tables in the UI implement row-level navigation (
onRow/onClick) alongside interactive child elements such as checkboxes and action menus.In AppTable and VariantsTable, this resulted in the UX issue described in #3254: clicks near or on interactive elements could unintentionally trigger row navigation.
Both components already use
stopPropagation()defensively on individual actions; however, this PR adds a row-level guard as a final safety net, following the same pattern previously used in InfiniteVirtualTable.What changed
AppTable
shouldIgnoreRowClickVariantsTable
shouldIgnoreRowClickNo other logic or behavior was changed.
Why this approach
stopPropagation) already present in these componentsTesting
Manually verified the following scenarios:
AppTable
VariantsTable
Related
Changes since #3263: Branch renamed from
ui/fix-row-click-app-variantstofix-row-click-tablesto resolve GitHub Actions checkout refspec error.