Skip to content

Commit 398a6ce

Browse files
committed
fix(webapp): preserve selectable row layout and controls
1 parent b3cc270 commit 398a6ce

2 files changed

Lines changed: 19 additions & 30 deletions

File tree

  • apps/webapp/app

apps/webapp/app/components/code/TSQLResultsTable.tsx

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,21 @@ function HeaderCellContent({
926926
const [isFilterHovered, setIsFilterHovered] = useState(false);
927927

928928
const sortHighlighted = isCellHovered && !isFilterHovered;
929-
const headerContent = (
930-
<>
929+
930+
/* oxlint-disable jsx-a11y/click-events-have-key-events -- The sortable header contains separate tooltip and filter controls that cannot be nested in a button. */
931+
/* oxlint-disable jsx-a11y/no-static-element-interactions -- Preserve the existing full-header pointer target rather than nesting its child controls. */
932+
return (
933+
<div
934+
className={cn(
935+
"flex w-full items-center gap-1 overflow-hidden bg-background-bright py-2 pl-2 pr-3",
936+
"font-mono text-xs font-medium text-text-bright",
937+
alignment === "right" && "justify-end",
938+
canSort && "cursor-pointer select-none"
939+
)}
940+
onMouseEnter={() => setIsCellHovered(true)}
941+
onMouseLeave={() => setIsCellHovered(false)}
942+
onClick={onSortClick}
943+
>
931944
{tooltip ? (
932945
<div
933946
className={cn("flex min-w-0 flex-1 items-center gap-1 truncate", {
@@ -947,6 +960,7 @@ function HeaderCellContent({
947960
) : (
948961
<span className="min-w-0 flex-1 truncate text-left">{children}</span>
949962
)}
963+
{/* Sort indicator */}
950964
{canSort && (
951965
<span
952966
className={cn(
@@ -963,33 +977,6 @@ function HeaderCellContent({
963977
)}
964978
</span>
965979
)}
966-
</>
967-
);
968-
969-
return (
970-
<div
971-
className={cn(
972-
"flex w-full items-center gap-1 overflow-hidden bg-background-bright py-2 pl-2 pr-3",
973-
"font-mono text-xs font-medium text-text-bright",
974-
alignment === "right" && "justify-end"
975-
)}
976-
onMouseEnter={() => setIsCellHovered(true)}
977-
onMouseLeave={() => setIsCellHovered(false)}
978-
>
979-
{canSort ? (
980-
<button
981-
type="button"
982-
onClick={onSortClick}
983-
className={cn(
984-
"flex min-w-0 flex-1 cursor-pointer select-none items-center gap-1 overflow-hidden text-left focus-custom",
985-
alignment === "right" && "justify-end"
986-
)}
987-
>
988-
{headerContent}
989-
</button>
990-
) : (
991-
headerContent
992-
)}
993980
{onFilterClick && (
994981
<button
995982
type="button"
@@ -1008,6 +995,8 @@ function HeaderCellContent({
1008995
</div>
1009996
);
1010997
}
998+
/* oxlint-enable jsx-a11y/click-events-have-key-events */
999+
/* oxlint-enable jsx-a11y/no-static-element-interactions */
10111000

10121001
/**
10131002
* Filter input cell for the filter row

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.prompts.$promptSlug/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2099,7 +2099,7 @@ function VersionsTab({
20992099
key={v.id}
21002100
onClick={() => onSelectVersion(v.version)}
21012101
className={cn(
2102-
"flex cursor-pointer items-center gap-3 px-3 py-3 text-sm transition",
2102+
"flex w-full cursor-pointer items-center gap-3 px-3 py-3 text-left text-sm transition focus-custom",
21032103
isSelected
21042104
? "bg-indigo-500/10 hover:bg-indigo-500/[0.07]"
21052105
: "hover:bg-background-hover"

0 commit comments

Comments
 (0)