Skip to content

Conversation

@VahantSharma
Copy link
Contributor

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 shouldIgnoreRowClick guard 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

    • Guarded the row click handler using shouldIgnoreRowClick
    • Prevents accidental navigation when interacting with the dropdown menu or nearby areas
  • VariantsTable

    • Guarded the row click handler using shouldIgnoreRowClick
    • Prevents conflicts between row navigation and:
      • Selection checkboxes
      • Dropdown action menus
      • Commit notes tooltip interactions
    • Applies consistently across all contexts where VariantsTable is used
      (overview page, deployment modals, evaluation configuration)

No other logic or behavior was changed.


Why this approach

  • Reuses the shared guard introduced in the previous PR
  • Keeps the fix small, targeted, and low-risk
  • Preserves existing navigation behavior while eliminating accidental triggers
  • Aligns with existing defensive event handling (stopPropagation) already present in these components

Testing

Manually verified the following scenarios:

AppTable

  • Clicking the row body navigates as before
  • Clicking the dropdown menu opens the menu without navigation
  • Clicking near the dropdown does not trigger navigation

VariantsTable

  • Clicking checkboxes toggles selection only
  • Clicking dropdown menus opens menus without triggering row actions
  • Clicking commit notes tooltip behaves correctly
  • Clicking empty row areas still triggers the expected row behavior
  • Verified behavior in:
    • Overview / Variants page
    • Deployment modals
    • Evaluation configuration flow

Related to #3254
Builds on the shared guard introduced in the previous PR.

Copilot AI review requested due to automatic review settings December 20, 2025 21:07
@vercel
Copy link

vercel bot commented Dec 20, 2025

@VahantSharma is attempting to deploy a commit to the agenta projects Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Dec 20, 2025
@dosubot dosubot bot added UI UX labels Dec 20, 2025
Copy link
Contributor

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 prevents accidental row navigation in AppTable and VariantsTable by applying a shared shouldIgnoreRowClick guard that checks if clicks originated from interactive elements like checkboxes, dropdowns, or buttons before triggering row-level navigation.

Key changes:

  • Added row click guard to AppTable's onRow handler to prevent navigation when interacting with dropdown menus
  • Added row click guard to VariantsTable's onRow handler to prevent conflicts with checkboxes, dropdown menus, and tooltips
  • Modified both tables to accept an event parameter in their onClick handlers

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
web/oss/src/components/pages/app-management/components/AppTable.tsx Added shouldIgnoreRowClick guard to row click handler and imported the utility function
web/oss/src/components/VariantsComponents/Table/index.tsx Added shouldIgnoreRowClick guard to row click handler and imported the utility function

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


import useURL from "@/oss/hooks/useURL"
import {EnhancedVariant} from "@/oss/lib/shared/variant/transformer/types"
import {shouldIgnoreRowClick} from "@/oss/lib/tableRowClick"
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

The import path '@/oss/lib/tableRowClick' does not exist in the codebase. The shouldIgnoreRowClick function is actually exported from '@/oss/components/InfiniteVirtualTable' (as seen in InfiniteVirtualTable/index.ts). This will cause a build failure. Update the import to use the correct path.

Suggested change
import {shouldIgnoreRowClick} from "@/oss/lib/tableRowClick"
import {shouldIgnoreRowClick} from "@/oss/components/InfiniteVirtualTable"

Copilot uses AI. Check for mistakes.
import NoResultsFound from "@/oss/components/NoResultsFound/NoResultsFound"
import useURL from "@/oss/hooks/useURL"
import {formatDay} from "@/oss/lib/helpers/dateTimeHelper"
import {shouldIgnoreRowClick} from "@/oss/lib/tableRowClick"
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

The import path '@/oss/lib/tableRowClick' does not exist in the codebase. The shouldIgnoreRowClick function is actually exported from '@/oss/components/InfiniteVirtualTable' (as seen in InfiniteVirtualTable/index.ts). This will cause a build failure. Update the import to use the correct path.

Suggested change
import {shouldIgnoreRowClick} from "@/oss/lib/tableRowClick"
import {shouldIgnoreRowClick} from "@/oss/components/InfiniteVirtualTable"

Copilot uses AI. Check for mistakes.
@VahantSharma
Copy link
Contributor Author

Response to Import Path Concern

This PR depends on PR #3262, which introduces the shared shouldIgnoreRowClick utility.

PR #3262 — Foundation

  • Adds the shared utility at web/oss/src/lib/tableRowClick.ts
  • Refactors InfiniteVirtualTable to use the new utility
  • Establishes a consistent pattern for preventing accidental row navigation

PR #3263 — This PR (Application)

  • Applies the same guard logic to AppTable and VariantsTable
  • Fixes the same UX issue in two additional high-traffic tables

The import path @/oss/lib/tableRowClick will be available once the foundational change is merged. For that reason, this PR should be reviewed and merged sequentially afterward.

I’m happy to rebase this PR on top of the foundational change if that helps with testing or review.

@mmabrouk
Copy link
Member

Hey @VahantSharma it would be nice to provide a video demo of the functionality post this PR

Copy link
Member

@bekossy bekossy left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @VahantSharma!
This PR relies on changes from PR #3262 (new tableRowClick helper). Since that PR isn’t merged yet, this will fail. Please merge both changes into one PR

- 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 VahantSharma force-pushed the ui/fix-row-click-app-variants branch from 4025be4 to 13985db Compare December 24, 2025 11:21
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Dec 24, 2025
@VahantSharma
Copy link
Contributor Author

VahantSharma commented Dec 24, 2025

PR.3263.mp4

Above is the demo video of the functionality, after changes.

I’ve moved the shared tableRowClick helper and the related table updates into this PR, so it’s fully self-contained and no longer depends on #3262.

@VahantSharma VahantSharma requested a review from bekossy December 26, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files. UI UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants