Skip to content

Commit 99f768a

Browse files
committed
fix(webapp): preserve selectable row layout and controls
1 parent e3d604b commit 99f768a

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
@@ -928,8 +928,21 @@ function HeaderCellContent({
928928
const [isFilterHovered, setIsFilterHovered] = useState(false);
929929

930930
const sortHighlighted = isCellHovered && !isFilterHovered;
931-
const headerContent = (
932-
<>
931+
932+
/* 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. */
933+
/* oxlint-disable jsx-a11y/no-static-element-interactions -- Preserve the existing full-header pointer target rather than nesting its child controls. */
934+
return (
935+
<div
936+
className={cn(
937+
"flex w-full items-center gap-1 overflow-hidden bg-background-bright py-2 pl-2 pr-3",
938+
"font-mono text-xs font-medium text-text-bright",
939+
alignment === "right" && "justify-end",
940+
canSort && "cursor-pointer select-none"
941+
)}
942+
onMouseEnter={() => setIsCellHovered(true)}
943+
onMouseLeave={() => setIsCellHovered(false)}
944+
onClick={onSortClick}
945+
>
933946
{tooltip ? (
934947
<div
935948
className={cn("flex min-w-0 flex-1 items-center gap-1 truncate", {
@@ -949,6 +962,7 @@ function HeaderCellContent({
949962
) : (
950963
<span className="min-w-0 flex-1 truncate text-left">{children}</span>
951964
)}
965+
{/* Sort indicator */}
952966
{canSort && (
953967
<span
954968
className={cn(
@@ -965,33 +979,6 @@ function HeaderCellContent({
965979
)}
966980
</span>
967981
)}
968-
</>
969-
);
970-
971-
return (
972-
<div
973-
className={cn(
974-
"flex w-full items-center gap-1 overflow-hidden bg-background-bright py-2 pl-2 pr-3",
975-
"font-mono text-xs font-medium text-text-bright",
976-
alignment === "right" && "justify-end"
977-
)}
978-
onMouseEnter={() => setIsCellHovered(true)}
979-
onMouseLeave={() => setIsCellHovered(false)}
980-
>
981-
{canSort ? (
982-
<button
983-
type="button"
984-
onClick={onSortClick}
985-
className={cn(
986-
"flex min-w-0 flex-1 cursor-pointer select-none items-center gap-1 overflow-hidden text-left focus-custom",
987-
alignment === "right" && "justify-end"
988-
)}
989-
>
990-
{headerContent}
991-
</button>
992-
) : (
993-
headerContent
994-
)}
995982
{onFilterClick && (
996983
<button
997984
type="button"
@@ -1010,6 +997,8 @@ function HeaderCellContent({
1010997
</div>
1011998
);
1012999
}
1000+
/* oxlint-enable jsx-a11y/click-events-have-key-events */
1001+
/* oxlint-enable jsx-a11y/no-static-element-interactions */
10131002

10141003
/**
10151004
* 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)