Skip to content

Commit 6ee1295

Browse files
committed
feat(webapp): UI improvements, PR feedback changes
1 parent 4e79186 commit 6ee1295

File tree

6 files changed

+24
-23
lines changed

6 files changed

+24
-23
lines changed

apps/webapp/app/components/primitives/Buttons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ export const NavLinkButton = ({ to, className, target, ...props }: NavLinkPropsT
408408
return (
409409
<NavLink
410410
to={to}
411-
className={cn("group/button outline-none", props.fullWidth ? "w-full" : "")}
411+
className={cn("group/button outline-none display-block", props.fullWidth ? "w-full" : "")}
412412
target={target}
413413
>
414414
{({ isActive, isPending }) => (

apps/webapp/app/components/primitives/CopyableText.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useState } from "react";
33
import { SimpleTooltip } from "~/components/primitives/Tooltip";
44
import { useCopy } from "~/hooks/useCopy";
55
import { cn } from "~/utils/cn";
6+
import { Button } from "./Buttons";
67

78
export function CopyableText({
89
value,
@@ -20,9 +21,9 @@ export function CopyableText({
2021
const [isHovered, setIsHovered] = useState(false);
2122
const { copy, copied } = useCopy(copyValue ?? value);
2223

23-
variant = variant ?? "icon-right";
24+
const resolvedVariant = variant ?? "icon-right";
2425

25-
if (variant === "icon-right") {
26+
if (resolvedVariant === "icon-right") {
2627
return (
2728
<span
2829
className={cn("group relative inline-flex h-6 items-center", className)}
@@ -65,22 +66,23 @@ export function CopyableText({
6566
);
6667
}
6768

68-
if (variant === "text-below") {
69+
if (resolvedVariant === "text-below") {
6970
return (
7071
<SimpleTooltip
7172
button={
72-
<span
73+
<Button
74+
variant="minimal/small"
7375
onClick={(e) => {
7476
e.stopPropagation();
7577
copy();
7678
}}
7779
className={cn(
78-
"cursor-pointer text-text-bright transition-colors hover:text-white",
80+
"cursor-pointer bg-transparent py-0 px-1 text-left text-text-bright transition-colors hover:text-white hover:bg-transparent",
7981
className
8082
)}
8183
>
82-
{value}
83-
</span>
84+
<span className="text-text-white">{value}</span>
85+
</Button>
8486
}
8587
content={copied ? "Copied" : "Click to copy"}
8688
className="font-sans px-2 py-1"

apps/webapp/app/components/primitives/PageHeader.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ type PageTitleProps = {
3636
to: string;
3737
text: string;
3838
};
39-
actions?: ReactNode;
4039
};
4140

42-
export function PageTitle({ title, backButton, actions }: PageTitleProps) {
41+
export function PageTitle({ title, backButton }: PageTitleProps) {
4342
return (
4443
<div className="flex items-center gap-2">
4544
{backButton && (
@@ -54,7 +53,6 @@ export function PageTitle({ title, backButton, actions }: PageTitleProps) {
5453
</div>
5554
)}
5655
<Header2 className="flex items-center gap-1">{title}</Header2>
57-
{actions && <div className="ml-auto">{actions}</div>}
5856
</div>
5957
);
6058
}

apps/webapp/app/components/primitives/ShortcutKey.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import { useOperatingSystem } from "./OperatingSystemProvider";
99
import { KeyboardEnterIcon } from "~/assets/icons/KeyboardEnterIcon";
1010

1111
const medium =
12-
"text-[0.75rem] font-medium min-w-[17px] rounded-[2px] tabular-nums px-1 ml-1 -mr-0.5 flex items-center gap-x-1.5 border border-dimmed/40 text-text-dimmed group-hover:text-text-bright/80 group-hover:border-dimmed/60 transition uppercase";
12+
"justify-center min-w-[1.25rem] min-h-[1.25rem] text-[0.65rem] font-mono font-medium rounded-[2px] tabular-nums px-1 ml-1 -mr-0.5 flex items-center gap-x-1.5 border border-dimmed/40 text-text-dimmed group-hover:text-text-bright/80 group-hover:border-dimmed/60 transition uppercase";
1313

1414
export const variants = {
1515
small:
16-
"text-[0.6rem] font-medium min-w-[17px] rounded-[2px] tabular-nums px-1 ml-1 -mr-0.5 flex items-center gap-x-1 border border-text-dimmed/40 text-text-dimmed group-hover:text-text-bright/80 group-hover:border-text-dimmed/60 transition uppercase",
16+
"justify-center text-[0.6rem] font-mono font-medium min-w-[1rem] min-h-[1rem] rounded-[2px] tabular-nums px-1 ml-1 -mr-0.5 flex items-center gap-x-1 border border-text-dimmed/40 text-text-dimmed group-hover:text-text-bright/80 group-hover:border-text-dimmed/60 transition uppercase",
1717
medium: cn(medium, "group-hover:border-charcoal-550"),
1818
"medium/bright": cn(medium, "bg-charcoal-750 text-text-bright border-charcoal-650"),
1919
};
@@ -57,7 +57,7 @@ export function ShortcutKey({ shortcut, variant, className }: ShortcutKeyProps)
5757
function keyString(key: string, isMac: boolean, variant: "small" | "medium" | "medium/bright") {
5858
key = key.toLowerCase();
5959

60-
const className = variant === "small" ? "w-2.5 h-4" : "w-3 h-5";
60+
const className = variant === "small" ? "w-2.5 h-4" : "w-2.5 h-4.5";
6161

6262
switch (key) {
6363
case "enter":

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,13 @@ export default function Page() {
290290
to: v3RunsPath(organization, project, environment, filters),
291291
text: "Runs",
292292
}}
293-
title={<CopyableText value={run.friendlyId} variant="text-below"/>}
294-
actions={
295-
tableState && (<div className="flex">
293+
title={<>
294+
<CopyableText value={run.friendlyId} variant="text-below" className="font-mono"/>
295+
{tableState && (<div className="flex">
296296
<PreviousRunButton to={previousRunPath} />
297297
<NextRunButton to={nextRunPath} />
298-
</div>)
299-
}
298+
</div>)}
299+
</>}
300300
/>
301301
{environment.type === "DEVELOPMENT" && <DevDisconnectedBanner isConnected={isConnected} />}
302302
<PageAccessories>
@@ -1547,8 +1547,7 @@ function KeyboardShortcuts({
15471547
);
15481548
}
15491549

1550-
function AdjacentRunsShortcuts({
1551-
}) {
1550+
function AdjacentRunsShortcuts() {
15521551
return (<div className="flex items-center gap-0.5">
15531552
<ShortcutKey shortcut={{ key: "[" }} variant="medium" className="ml-0 mr-0 px-1" />
15541553
<ShortcutKey shortcut={{ key: "]" }} variant="medium" className="ml-0 mr-0 px-1" />
@@ -1604,7 +1603,7 @@ function NumberShortcuts({ toggleLevel }: { toggleLevel: (depth: number) => void
16041603
return (
16051604
<div className="flex items-center gap-0.5">
16061605
<span className={cn(variants.medium, "ml-0 mr-0")}>0</span>
1607-
<span className="text-[0.75rem] text-text-dimmed"></span>
1606+
<span className="text-[0.65rem] text-text-dimmed"></span>
16081607
<span className={cn(variants.medium, "ml-0 mr-0")}>9</span>
16091608
<Paragraph variant="extra-small" className="ml-1.5 whitespace-nowrap">
16101609
Toggle level
@@ -1723,6 +1722,7 @@ function PreviousRunButton({ to }: { to: string | null }) {
17231722
onClick={(e) => !to && e.preventDefault()}
17241723
shortcut={{ key: "[" }}
17251724
tooltip="Previous Run"
1725+
disabled={!to}
17261726
/>
17271727
</div>
17281728
);
@@ -1742,6 +1742,7 @@ function NextRunButton({ to }: { to: string | null }) {
17421742
onClick={(e) => !to && e.preventDefault()}
17431743
shortcut={{ key: "]" }}
17441744
tooltip="Next Run"
1745+
disabled={!to}
17451746
/>
17461747
</div>
17471748
);

apps/webapp/app/utils/pathBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ export function v3RunSpanPath(
316316
searchParams?: URLSearchParams
317317
) {
318318
searchParams = searchParams ?? new URLSearchParams();
319-
searchParams.set("span", encodeURIComponent(span.spanId));
319+
searchParams.set("span", span.spanId);
320320
return `${v3RunPath(organization, project, environment, run, searchParams)}`;
321321
}
322322

0 commit comments

Comments
 (0)