Skip to content

Commit c11c668

Browse files
committed
fix(webapp): use native selectable row controls
1 parent d7ab909 commit c11c668

3 files changed

Lines changed: 34 additions & 20 deletions

File tree

  • apps/webapp/app
    • components/code
    • routes
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.prompts.$promptSlug

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

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -916,19 +916,8 @@ function HeaderCellContent({
916916
const [isFilterHovered, setIsFilterHovered] = useState(false);
917917

918918
const sortHighlighted = isCellHovered && !isFilterHovered;
919-
920-
return (
921-
<div
922-
className={cn(
923-
"flex w-full items-center gap-1 overflow-hidden bg-background-bright py-2 pl-2 pr-3",
924-
"font-mono text-xs font-medium text-text-bright",
925-
alignment === "right" && "justify-end",
926-
canSort && "cursor-pointer select-none"
927-
)}
928-
onMouseEnter={() => setIsCellHovered(true)}
929-
onMouseLeave={() => setIsCellHovered(false)}
930-
onClick={onSortClick}
931-
>
919+
const headerContent = (
920+
<>
932921
{tooltip ? (
933922
<div
934923
className={cn("flex min-w-0 flex-1 items-center gap-1 truncate", {
@@ -948,7 +937,6 @@ function HeaderCellContent({
948937
) : (
949938
<span className="min-w-0 flex-1 truncate text-left">{children}</span>
950939
)}
951-
{/* Sort indicator */}
952940
{canSort && (
953941
<span
954942
className={cn(
@@ -965,6 +953,33 @@ function HeaderCellContent({
965953
)}
966954
</span>
967955
)}
956+
</>
957+
);
958+
959+
return (
960+
<div
961+
className={cn(
962+
"flex w-full items-center gap-1 overflow-hidden bg-background-bright py-2 pl-2 pr-3",
963+
"font-mono text-xs font-medium text-text-bright",
964+
alignment === "right" && "justify-end"
965+
)}
966+
onMouseEnter={() => setIsCellHovered(true)}
967+
onMouseLeave={() => setIsCellHovered(false)}
968+
>
969+
{canSort ? (
970+
<button
971+
type="button"
972+
onClick={onSortClick}
973+
className={cn(
974+
"flex min-w-0 flex-1 cursor-pointer select-none items-center gap-1 overflow-hidden text-left focus-custom",
975+
alignment === "right" && "justify-end"
976+
)}
977+
>
978+
{headerContent}
979+
</button>
980+
) : (
981+
headerContent
982+
)}
968983
{onFilterClick && (
969984
<button
970985
type="button"

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,7 @@ export default function Page() {
340340
{hasVercelIntegration && (
341341
<TableCell isSelected={isSelected}>
342342
{deployment.vercelDeploymentUrl ? (
343-
<div
344-
className="-ml-1 flex items-center"
345-
onClick={(e) => e.stopPropagation()}
346-
>
343+
<div className="-ml-1 flex items-center">
347344
<VercelLink
348345
vercelDeploymentUrl={deployment.vercelDeploymentUrl}
349346
/>

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,7 +2093,9 @@ function VersionsTab({
20932093
const isOverride = v.labels.includes("override");
20942094

20952095
return (
2096-
<div
2096+
<button
2097+
type="button"
2098+
aria-pressed={isSelected}
20972099
key={v.id}
20982100
onClick={() => onSelectVersion(v.version)}
20992101
className={cn(
@@ -2143,7 +2145,7 @@ function VersionsTab({
21432145
<span className="shrink-0 text-xs text-text-dimmed">
21442146
<DateTime date={v.createdAt} />
21452147
</span>
2146-
</div>
2148+
</button>
21472149
);
21482150
})}
21492151
</div>

0 commit comments

Comments
 (0)