Skip to content

Commit f02d7c4

Browse files
committed
Added some padding to the run id button
1 parent 3875bb2 commit f02d7c4

2 files changed

Lines changed: 55 additions & 29 deletions

File tree

  • apps/webapp/app
    • components/primitives
    • routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,20 @@ export function CopyableText({
7272
button={
7373
<Button
7474
variant="minimal/small"
75-
onClick={(e) => {
75+
onClick={(e) => {
7676
e.stopPropagation();
77-
copy();
77+
copy();
7878
}}
7979
className={cn(
80-
"cursor-pointer bg-transparent py-0 px-1 text-left text-text-bright transition-colors hover:text-white hover:bg-transparent",
80+
"cursor-pointer bg-transparent px-1 py-0 text-left text-text-bright transition-colors hover:bg-transparent hover:text-white",
8181
className
8282
)}
8383
>
8484
<span>{value}</span>
8585
</Button>
8686
}
87-
content={copied ? "Copied" : "Click to copy"}
88-
className="font-sans px-2 py-1"
87+
content={copied ? "Copied" : "Copy"}
88+
className="px-2 py-1 font-sans"
8989
disableHoverableContent
9090
open={isHovered || copied}
9191
onOpenChange={setIsHovered}

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

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,10 @@ async function getRunsListFromTableState({
210210
}
211211
}
212212

213-
if (currentRunIndex === currentPageResult.runs.length - 1 && currentPageResult.pagination.next) {
213+
if (
214+
currentRunIndex === currentPageResult.runs.length - 1 &&
215+
currentPageResult.pagination.next
216+
) {
214217
const nextPageResult = await runsListPresenter.call(project.organizationId, environment.id, {
215218
userId,
216219
projectId: project.id,
@@ -313,7 +316,16 @@ export default function Page() {
313316
const tabParam = value("tab") ?? undefined;
314317
const spanParam = value("span") ?? undefined;
315318

316-
const [previousRunPath, nextRunPath] = useAdjacentRunPaths({organization, project, environment, tableState, run, runsList, tabParam, useSpan: !!spanParam});
319+
const [previousRunPath, nextRunPath] = useAdjacentRunPaths({
320+
organization,
321+
project,
322+
environment,
323+
tableState,
324+
run,
325+
runsList,
326+
tabParam,
327+
useSpan: !!spanParam,
328+
});
317329

318330
return (
319331
<>
@@ -323,13 +335,21 @@ export default function Page() {
323335
to: v3RunsPath(organization, project, environment, filters),
324336
text: "Runs",
325337
}}
326-
title={<>
327-
<CopyableText value={run.friendlyId} variant="text-below" className="font-mono px-0 py-0 pb-[2px]"/>
328-
{tableState && (<div className="flex">
329-
<PreviousRunButton to={previousRunPath} />
330-
<NextRunButton to={nextRunPath} />
331-
</div>)}
332-
</>}
338+
title={
339+
<>
340+
<CopyableText
341+
value={run.friendlyId}
342+
variant="text-below"
343+
className="-ml-[0.4375rem] px-1.5 pb-[3px] font-mono text-xs leading-none"
344+
/>
345+
{tableState && (
346+
<div className="flex">
347+
<PreviousRunButton to={previousRunPath} />
348+
<NextRunButton to={nextRunPath} />
349+
</div>
350+
)}
351+
</>
352+
}
333353
/>
334354
{environment.type === "DEVELOPMENT" && <DevDisconnectedBanner isConnected={isConnected} />}
335355
<PageAccessories>
@@ -407,16 +427,18 @@ export default function Page() {
407427
maximumLiveReloadingSetting={maximumLiveReloadingSetting}
408428
/>
409429
) : (
410-
<NoLogsView
411-
run={run}
412-
/>
430+
<NoLogsView run={run} />
413431
)}
414432
</PageBody>
415433
</>
416434
);
417435
}
418436

419-
function TraceView({ run, trace, maximumLiveReloadingSetting }: Pick<LoaderData, "run" | "trace" | "maximumLiveReloadingSetting">) {
437+
function TraceView({
438+
run,
439+
trace,
440+
maximumLiveReloadingSetting,
441+
}: Pick<LoaderData, "run" | "trace" | "maximumLiveReloadingSetting">) {
420442
const organization = useOrganization();
421443
const project = useProject();
422444
const environment = useEnvironment();
@@ -1130,7 +1152,9 @@ function TimelineView({
11301152
"-ml-[0.5px] h-[0.5625rem] w-px rounded-none",
11311153
eventBackgroundClassName(node.data)
11321154
)}
1133-
layoutId={node.data.isPartial ? `${node.id}-${event.name}` : undefined}
1155+
layoutId={
1156+
node.data.isPartial ? `${node.id}-${event.name}` : undefined
1157+
}
11341158
animate={!node.data.isPartial ? false : undefined}
11351159
/>
11361160
)}
@@ -1149,7 +1173,9 @@ function TimelineView({
11491173
"-ml-[0.1562rem] size-[0.3125rem] rounded-full border bg-background-bright",
11501174
eventBorderClassName(node.data)
11511175
)}
1152-
layoutId={node.data.isPartial ? `${node.id}-${event.name}` : undefined}
1176+
layoutId={
1177+
node.data.isPartial ? `${node.id}-${event.name}` : undefined
1178+
}
11531179
animate={!node.data.isPartial ? false : undefined}
11541180
/>
11551181
)}
@@ -1580,13 +1606,15 @@ function KeyboardShortcuts({
15801606
}
15811607

15821608
function AdjacentRunsShortcuts() {
1583-
return (<div className="flex items-center gap-0.5">
1609+
return (
1610+
<div className="flex items-center gap-0.5">
15841611
<ShortcutKey shortcut={{ key: "[" }} variant="medium" className="ml-0 mr-0 px-1" />
15851612
<ShortcutKey shortcut={{ key: "]" }} variant="medium" className="ml-0 mr-0 px-1" />
15861613
<Paragraph variant="extra-small" className="ml-1.5 whitespace-nowrap">
15871614
Adjacent runs
15881615
</Paragraph>
1589-
</div>);
1616+
</div>
1617+
);
15901618
}
15911619

15921620
function ArrowKeyShortcuts() {
@@ -1676,13 +1704,13 @@ function useAdjacentRunPaths({
16761704
run,
16771705
runsList,
16781706
tabParam,
1679-
useSpan
1707+
useSpan,
16801708
}: {
16811709
organization: { slug: string };
16821710
project: { slug: string };
16831711
environment: { slug: string };
16841712
tableState: string;
1685-
run: { friendlyId: string, spanId: string };
1713+
run: { friendlyId: string; spanId: string };
16861714
runsList: RunsListNavigation | null;
16871715
tabParam?: string;
16881716
useSpan?: boolean;
@@ -1692,7 +1720,7 @@ function useAdjacentRunPaths({
16921720
}
16931721

16941722
const currentIndex = runsList.runs.findIndex((r) => r.friendlyId === run.friendlyId);
1695-
1723+
16961724
if (currentIndex === -1) {
16971725
return [null, null];
16981726
}
@@ -1748,12 +1776,11 @@ function useAdjacentRunPaths({
17481776
return [previousRunPath, nextRunPath];
17491777
}
17501778

1751-
17521779
function PreviousRunButton({ to }: { to: string | null }) {
17531780
return (
17541781
<div className={cn("peer/prev order-1", !to && "pointer-events-none")}>
17551782
<LinkButton
1756-
to={to ? to : '#'}
1783+
to={to ? to : "#"}
17571784
variant={"minimal/small"}
17581785
LeadingIcon={ChevronUpIcon}
17591786
className={cn(
@@ -1774,7 +1801,7 @@ function NextRunButton({ to }: { to: string | null }) {
17741801
return (
17751802
<div className={cn("peer/next order-3", !to && "pointer-events-none")}>
17761803
<LinkButton
1777-
to={to ? to : '#'}
1804+
to={to ? to : "#"}
17781805
variant={"minimal/small"}
17791806
TrailingIcon={ChevronDownIcon}
17801807
className={cn(
@@ -1790,4 +1817,3 @@ function NextRunButton({ to }: { to: string | null }) {
17901817
</div>
17911818
);
17921819
}
1793-

0 commit comments

Comments
 (0)