-
Notifications
You must be signed in to change notification settings - Fork 146
Redesign event detail layout and improve pending activities view #3281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f37e28a
b69ccb2
e7907e2
747bf4c
331ce5a
2802e2c
b60eced
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,7 +125,7 @@ | |
| {@const href = getEventLinkHref(link)} | ||
| {@const value = href.split('workflows/')?.[1] || href} | ||
| <div class="flex items-start gap-4"> | ||
| <p class="min-w-56 text-sm text-secondary/80"> | ||
| <p class="min-w-56 text-sm font-medium text-secondary"> | ||
| {translate('nexus.link')} | ||
| </p> | ||
| <Copyable | ||
|
|
@@ -141,7 +141,7 @@ | |
| {#snippet eventNamespaceLink(link: ELink)} | ||
| {@const href = routeForNamespace({ namespace: link.workflowEvent.namespace })} | ||
| <div class="flex items-start gap-4"> | ||
| <p class="min-w-56 text-sm text-secondary/80"> | ||
| <p class="min-w-56 text-sm font-medium text-secondary"> | ||
| {translate('nexus.link-namespace')} | ||
| </p> | ||
| <Copyable | ||
|
|
@@ -157,7 +157,7 @@ | |
| {/snippet} | ||
|
|
||
| {#snippet eventLinks(links: ELink[])} | ||
| {#each links as link} | ||
| {@render eventLink(link)} | ||
| {@render eventNamespaceLink(link)} | ||
| {/each} | ||
|
|
@@ -165,7 +165,7 @@ | |
|
|
||
| {#snippet eventSummary(value: Payload)} | ||
| <div class="flex items-start gap-4"> | ||
| <p class="min-w-56 text-sm text-secondary/80">Summary</p> | ||
| <p class="min-w-56 text-sm font-medium text-secondary">Summary</p> | ||
| <p class="whitespace-pre-line"> | ||
| <MetadataDecoder | ||
| {value} | ||
|
|
@@ -182,7 +182,7 @@ | |
| {@const codeBlockValue = getCodeBlockValue(value)} | ||
| {@const stackTrace = getStackTrace(codeBlockValue)} | ||
| <div> | ||
| <p class="mb-1 min-w-56 text-sm text-secondary/80"> | ||
| <p class="mb-1 min-w-56 text-sm font-medium text-secondary"> | ||
| {format(key)} | ||
| </p> | ||
| {#if value?.payloads} | ||
|
|
@@ -225,7 +225,7 @@ | |
| </div> | ||
| {#if stackTrace} | ||
| <div> | ||
| <p class="mb-1 min-w-56 text-sm text-secondary/80"> | ||
| <p class="mb-1 min-w-56 text-sm font-medium text-secondary"> | ||
| {translate('workflows.call-stack-tab')} | ||
| </p> | ||
| <CodeBlock | ||
|
|
@@ -241,7 +241,7 @@ | |
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| {#snippet link(key, value)} | ||
| <div class="flex items-start gap-4"> | ||
| <p class="min-w-56 text-sm text-secondary/80"> | ||
| <p class="min-w-56 text-sm font-medium text-secondary"> | ||
| {format(key)} | ||
| </p> | ||
| <Copyable | ||
|
|
@@ -261,7 +261,7 @@ | |
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| {#snippet details(key, value)} | ||
| <div class="flex items-start gap-4"> | ||
| <p class="min-w-56 text-sm text-secondary/80"> | ||
| <p class="min-w-56 text-sm font-medium text-secondary"> | ||
| {format(key)} | ||
| </p> | ||
| <p class="whitespace-pre-line break-all"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| <script lang="ts"> | ||
| import { page } from '$app/state'; | ||
|
|
||
| import Timestamp from '$lib/components/timestamp.svelte'; | ||
| import Copyable from '$lib/holocene/copyable/index.svelte'; | ||
| import Link from '$lib/holocene/link.svelte'; | ||
| import { translate } from '$lib/i18n/translate'; | ||
| import type { EventGroup } from '$lib/models/event-groups/event-groups'; | ||
| import type { WorkflowEvent } from '$lib/types/events'; | ||
| import { getEventLinkHref } from '$lib/utilities/event-link-href'; | ||
| import { | ||
| format, | ||
| spaceBetweenCapitalLetters, | ||
| } from '$lib/utilities/format-camel-case'; | ||
| import type { CombinedAttributes } from '$lib/utilities/format-event-attributes'; | ||
| import { formatDistanceAbbreviated } from '$lib/utilities/format-time'; | ||
| import { | ||
| displayLinkType, | ||
| shouldDisplayAsTime, | ||
| } from '$lib/utilities/get-single-attribute-for-event'; | ||
| import { isLocalActivityMarkerEvent } from '$lib/utilities/is-event-type'; | ||
| import { | ||
| routeForEventHistoryEvent, | ||
| routeForNamespace, | ||
| } from '$lib/utilities/route-for'; | ||
|
|
||
| import EventDetailsLink from './event-details-link.svelte'; | ||
| import MetadataDecoder from './metadata-decoder.svelte'; | ||
|
|
||
| let { | ||
| event, | ||
| group, | ||
| attributes, | ||
| detailFields, | ||
| linkFields, | ||
| }: { | ||
| event: WorkflowEvent; | ||
| group?: EventGroup; | ||
| attributes: CombinedAttributes; | ||
| detailFields: [string, unknown][]; | ||
| linkFields: [string, unknown][]; | ||
| } = $props(); | ||
|
|
||
| const { namespace, workflow, run } = $derived(page.params); | ||
|
|
||
| const displayName = $derived( | ||
| isLocalActivityMarkerEvent(event) | ||
| ? translate('events.category.local-activity') | ||
| : spaceBetweenCapitalLetters(event.name), | ||
| ); | ||
|
|
||
| const durationSinceLastEvent = $derived.by(() => { | ||
| if (!group) return ''; | ||
| const eventIndex = group.eventList.findIndex((evt) => evt.id === event.id); | ||
| if (eventIndex === -1 || eventIndex === 0) return ''; | ||
| const previousEvent = group.eventList[eventIndex - 1]; | ||
| return formatDistanceAbbreviated({ | ||
| start: event.eventTime, | ||
| end: previousEvent.eventTime, | ||
| includeMilliseconds: true, | ||
| }); | ||
| }); | ||
| </script> | ||
|
|
||
| <div class="mb-2 flex w-full flex-wrap items-center justify-between gap-2"> | ||
| <div class="flex items-center gap-2 text-base"> | ||
| <Link | ||
| href={routeForEventHistoryEvent({ | ||
| eventId: event.id, | ||
| run, | ||
| workflow, | ||
| namespace, | ||
| })}>{event.id}</Link | ||
| > | ||
| <p class="font-medium"> | ||
| {displayName} | ||
| </p> | ||
| </div> | ||
| <div class="flex flex-col items-end gap-0 font-mono text-sm leading-4"> | ||
| <Timestamp as="p" dateTime={event.eventTime} /> | ||
| {#if durationSinceLastEvent} | ||
| <p class="font-medium text-secondary">+{durationSinceLastEvent}</p> | ||
| {/if} | ||
| </div> | ||
| </div> | ||
|
|
||
| {#if event?.links?.length} | ||
| {#each event.links as link} | ||
| {@const href = getEventLinkHref(link)} | ||
| {@const value = href.split('workflows/')?.[1] || href} | ||
| <div class="flex items-start gap-4"> | ||
| <p class="min-w-56 text-sm font-medium text-secondary"> | ||
| {translate('nexus.link')} | ||
| </p> | ||
| <Copyable | ||
| copyIconTitle={translate('common.copy-icon-title')} | ||
| copySuccessIconTitle={translate('common.copy-success-icon-title')} | ||
| content={value} | ||
| > | ||
| <Link {href} class="whitespace-pre-line">{value}</Link> | ||
| </Copyable> | ||
| </div> | ||
| {@const nsHref = routeForNamespace({ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| namespace: link.workflowEvent.namespace, | ||
| })} | ||
| <div class="flex items-start gap-4"> | ||
| <p class="min-w-56 text-sm font-medium text-secondary"> | ||
| {translate('nexus.link-namespace')} | ||
| </p> | ||
| <Copyable | ||
| copyIconTitle={translate('common.copy-icon-title')} | ||
| copySuccessIconTitle={translate('common.copy-success-icon-title')} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| content={link.workflowEvent.namespace} | ||
| > | ||
| <Link href={nsHref} class="whitespace-pre-line" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| >{link.workflowEvent.namespace}</Link | ||
| > | ||
| </Copyable> | ||
| </div> | ||
| {/each} | ||
| {/if} | ||
|
|
||
| {#if event?.userMetadata?.summary} | ||
| <div class="flex items-start gap-4"> | ||
| <p class="min-w-56 text-sm font-medium text-secondary">Summary</p> | ||
| <p class="whitespace-pre-line"> | ||
| <MetadataDecoder | ||
| value={event.userMetadata.summary} | ||
| let:decodedValue | ||
| fallback={translate('events.decode-failed')} | ||
| > | ||
| {decodedValue} | ||
| </MetadataDecoder> | ||
| </p> | ||
| </div> | ||
| {/if} | ||
|
|
||
| {#each detailFields as [key, value] (key)} | ||
| <div class="flex items-start gap-4"> | ||
| <p class="min-w-56 text-sm font-medium text-secondary"> | ||
| {format(key)} | ||
| </p> | ||
| <p class="whitespace-pre-line break-all"> | ||
| {#if shouldDisplayAsTime(key)} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| <Timestamp dateTime={value} /> | ||
| {:else} | ||
| {value} | ||
| {/if} | ||
| </p> | ||
| </div> | ||
| {/each} | ||
|
|
||
| {#each linkFields as [key, value] (key)} | ||
| <div class="flex items-start gap-4"> | ||
| <p class="min-w-56 text-sm font-medium text-secondary"> | ||
| {format(key)} | ||
| </p> | ||
| <Copyable | ||
| copyIconTitle={translate('common.copy-icon-title')} | ||
| copySuccessIconTitle={translate('common.copy-success-icon-title')} | ||
| content={String(value)} | ||
| > | ||
| <EventDetailsLink | ||
| value={String(value)} | ||
| {attributes} | ||
| type={displayLinkType(key, attributes)} | ||
| class="whitespace-pre-line" | ||
| /> | ||
| </Copyable> | ||
| </div> | ||
| {/each} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.