Skip to content

Commit b3cc270

Browse files
committed
fix(webapp): use native selectable row controls
1 parent 71a26ba commit b3cc270

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
@@ -926,19 +926,8 @@ function HeaderCellContent({
926926
const [isFilterHovered, setIsFilterHovered] = useState(false);
927927

928928
const sortHighlighted = isCellHovered && !isFilterHovered;
929-
930-
return (
931-
<div
932-
className={cn(
933-
"flex w-full items-center gap-1 overflow-hidden bg-background-bright py-2 pl-2 pr-3",
934-
"font-mono text-xs font-medium text-text-bright",
935-
alignment === "right" && "justify-end",
936-
canSort && "cursor-pointer select-none"
937-
)}
938-
onMouseEnter={() => setIsCellHovered(true)}
939-
onMouseLeave={() => setIsCellHovered(false)}
940-
onClick={onSortClick}
941-
>
929+
const headerContent = (
930+
<>
942931
{tooltip ? (
943932
<div
944933
className={cn("flex min-w-0 flex-1 items-center gap-1 truncate", {
@@ -958,7 +947,6 @@ function HeaderCellContent({
958947
) : (
959948
<span className="min-w-0 flex-1 truncate text-left">{children}</span>
960949
)}
961-
{/* Sort indicator */}
962950
{canSort && (
963951
<span
964952
className={cn(
@@ -975,6 +963,33 @@ function HeaderCellContent({
975963
)}
976964
</span>
977965
)}
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+
)}
978993
{onFilterClick && (
979994
<button
980995
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)