Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fb7d660
refactor: replace PayloadDecoder and MetadataDecoder with unified Pay…
rossedfort Apr 9, 2026
aa66e2d
remove unused component, fix css
rossedfort Apr 13, 2026
5a5794f
refactor: move Payload component into payload/ directory
rossedfort Apr 13, 2026
d89d123
docs: add Payload component improvement suggestions
rossedfort Apr 13, 2026
13f0e56
docs: add decode-payload usage report and refactoring recommendations
rossedfort Apr 13, 2026
aadc984
Merge branch 'main' into refactor-payload-component
rossedfort Apr 16, 2026
3bc7c9f
Merge branch 'main' into refactor-payload-component
rossedfort Apr 20, 2026
d174838
refactor(payload): split Payload component into focused mode-specific…
rossedfort Apr 20, 2026
fda5e2c
fix(payload-summary): use decodeUserMetadata and add onDecode prop
rossedfort Apr 20, 2026
4ce968e
refactor(payload): extract shared decode logic into decode-payload-va…
rossedfort Apr 20, 2026
00288d0
fix(payload): replace onMount with \$effect for reactive value updates
rossedfort Apr 20, 2026
1265db8
add workflow with user metadata
rossedfort Apr 21, 2026
47f80ec
Merge branch 'main' into refactor-payload-component
rossedfort Apr 21, 2026
f38770f
remove unnecessary props from payload code block
rossedfort Apr 21, 2026
a627493
fix summary display
rossedfort Apr 21, 2026
9700eb9
add improvements
rossedfort Apr 22, 2026
adaf39d
fix heading levels
rossedfort Apr 22, 2026
5da1c5c
add multi input workflow
rossedfort Apr 23, 2026
ceae496
get rid of fieldName prop and fix most of the call sites
rossedfort Apr 23, 2026
cb00653
fix remaining type errors
rossedfort Apr 23, 2026
51a5c44
fix tests
rossedfort Apr 23, 2026
6fd76a0
rm inspect
rossedfort Apr 23, 2026
1d27eb4
rm console.log
rossedfort Apr 23, 2026
86127b9
Merge branch 'main' into refactor-payload-component
rossedfort Apr 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 27 additions & 44 deletions src/lib/components/event/event-card.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts">
import { page } from '$app/state';

import Payload from '$lib/components/payload.svelte';
import Timestamp from '$lib/components/timestamp.svelte';
import CodeBlock from '$lib/holocene/code-block.svelte';
import Copyable from '$lib/holocene/copyable/index.svelte';
import Link from '$lib/holocene/link.svelte';
import { translate } from '$lib/i18n/translate';
import type { EventLink as ELink } from '$lib/types';
import { type Payload } from '$lib/types';
import { type Payload as RawPayload } from '$lib/types';
import type { WorkflowEvent } from '$lib/types/events';
import { getEventLinkHref } from '$lib/utilities/event-link-href';
import {
Expand All @@ -28,8 +28,6 @@
} from '$lib/utilities/route-for';

import EventDetailsLink from './event-details-link.svelte';
import MetadataDecoder from './metadata-decoder.svelte';
import PayloadDecoder from './payload-decoder.svelte';

let { event }: { event: WorkflowEvent } = $props();
const { namespace, workflow, run } = $derived(page.params);
Expand Down Expand Up @@ -157,23 +155,21 @@
{/snippet}

{#snippet eventLinks(links: ELink[])}
{#each links as link}
{#each links as link (link)}
{@render eventLink(link)}
{@render eventNamespaceLink(link)}
{/each}
{/snippet}

{#snippet eventSummary(value: Payload)}
{#snippet eventSummary(value: RawPayload)}
<div class="flex items-start gap-4">
<p class="min-w-56 text-sm text-secondary/80">Summary</p>
<p class="whitespace-pre-line">
<MetadataDecoder
<Payload
{value}
let:decodedValue
mode="summary"
fallback={translate('events.decode-failed')}
>
{decodedValue}
</MetadataDecoder>
/>
</p>
</div>
{/snippet}
Expand All @@ -186,50 +182,37 @@
{format(key)}
</p>
{#if value?.payloads}
<PayloadDecoder {value} key="payloads">
{#snippet children(decodedValue)}
<CodeBlock
content={decodedValue}
maxHeight={384}
copyIconTitle={translate('common.copy-icon-title')}
copySuccessIconTitle={translate('common.copy-success-icon-title')}
/>
{/snippet}
</PayloadDecoder>
<Payload
{value}
key="payloads"
maxHeight={384}
copyIconTitle={translate('common.copy-icon-title')}
copySuccessIconTitle={translate('common.copy-success-icon-title')}
/>
{:else if key === 'searchAttributes'}
<PayloadDecoder
<Payload
key="searchAttributes"
value={{ searchAttributes: codeBlockValue }}
>
{#snippet children(decodedValue)}
<CodeBlock
content={decodedValue}
maxHeight={384}
copyIconTitle={translate('common.copy-icon-title')}
copySuccessIconTitle={translate('common.copy-success-icon-title')}
/>
{/snippet}
</PayloadDecoder>
maxHeight={384}
copyIconTitle={translate('common.copy-icon-title')}
copySuccessIconTitle={translate('common.copy-success-icon-title')}
/>
{:else}
<PayloadDecoder value={codeBlockValue}>
{#snippet children(decodedValue)}
<CodeBlock
content={decodedValue}
maxHeight={384}
copyIconTitle={translate('common.copy-icon-title')}
copySuccessIconTitle={translate('common.copy-success-icon-title')}
/>
{/snippet}
</PayloadDecoder>
<Payload
value={codeBlockValue}
maxHeight={384}
copyIconTitle={translate('common.copy-icon-title')}
copySuccessIconTitle={translate('common.copy-success-icon-title')}
/>
{/if}
</div>
{#if stackTrace}
<div>
<p class="mb-1 min-w-56 text-sm text-secondary/80">
{translate('workflows.call-stack-tab')}
</p>
<CodeBlock
content={stackTrace}
<Payload
value={stackTrace}
language="text"
maxHeight={384}
copyIconTitle={translate('common.copy-icon-title')}
Expand Down
31 changes: 7 additions & 24 deletions src/lib/components/event/event-details-row.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { twMerge as merge } from 'tailwind-merge';

import Payload from '$lib/components/payload.svelte';
import Badge from '$lib/holocene/badge.svelte';
import Copyable from '$lib/holocene/copyable/index.svelte';
import { translate } from '$lib/i18n/translate';
Expand All @@ -10,7 +11,6 @@
import { displayLinkType } from '$lib/utilities/get-single-attribute-for-event';

import EventDetailsLink from './event-details-link.svelte';
import PayloadDecoder from './payload-decoder.svelte';

export let key: string;
export let value: string | Record<string, unknown> | Payloads;
Expand All @@ -33,15 +33,12 @@
<div
class="flex max-w-sm items-center justify-between gap-2 overflow-hidden pr-1 xl:flex-nowrap"
>
<PayloadDecoder {value} key="payloads">
{#snippet children(decodedValue)}
<div class={merge('payload', $$props.class)}>
<code>
<pre class="truncate">{decodedValue.slice(0, 60)}</pre>
</code>
</div>
{/snippet}
</PayloadDecoder>
<Payload
{value}
key="payloads"
mode="inline-truncated"
class={merge($$props.class)}
/>
</div>
{:else if linkType !== 'none'}
<Copyable
Expand All @@ -64,17 +61,3 @@
{/if}
</div>
{/if}

<style lang="postcss">
.payload {
@apply overflow-hidden border border-subtle bg-code-block px-1 py-0.5 font-mono text-xs;
}

.payload code {
@apply text-primary;
}

.payload pre {
@apply text-primary;
}
</style>
23 changes: 10 additions & 13 deletions src/lib/components/event/event-metadata-expanded.svelte
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
<script lang="ts">
import Payload from '$lib/components/payload.svelte';
import Badge from '$lib/holocene/badge.svelte';
import { translate } from '$lib/i18n/translate';
import type { Payload } from '$lib/types';
import type { Payload as RawPayload } from '$lib/types';

import MetadataDecoder from './metadata-decoder.svelte';

export let value: Payload;
export let value: RawPayload;
</script>

<div class="block w-full select-all px-2 py-1 text-left">
<p class="text-sm">Summary</p>
<MetadataDecoder
{value}
let:decodedValue
fallback={translate('events.decode-failed')}
>
<Badge type="secondary" class="inline-block whitespace-pre-wrap">
{decodedValue}
</Badge>
</MetadataDecoder>
<Payload {value} mode="summary" fallback={translate('events.decode-failed')}>
{#snippet children(decodedValue)}
<Badge type="secondary" class="inline-block whitespace-pre-wrap">
{decodedValue}
</Badge>
{/snippet}
</Payload>
</div>
25 changes: 10 additions & 15 deletions src/lib/components/event/event-summary-row.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import { page } from '$app/state';

import Payload from '$lib/components/payload.svelte';
import { timestamp } from '$lib/components/timestamp.svelte';
import Badge from '$lib/holocene/badge.svelte';
import Copyable from '$lib/holocene/copyable/index.svelte';
Expand Down Expand Up @@ -42,7 +43,6 @@
import EventDetailsFull from './event-details-full.svelte';
import EventDetailsRow from './event-details-row.svelte';
import EventLink from './event-link.svelte';
import MetadataDecoder from './metadata-decoder.svelte';

interface Props {
event: IterableEvent;
Expand Down Expand Up @@ -217,7 +217,7 @@
{#if isEventGroup(event)}
<td class="font-mono">
<div class="flex items-center gap-0.5">
{#each event.eventList as groupEvent}

Check warning on line 220 in src/lib/components/event/event-summary-row.svelte

View workflow job for this annotation

GitHub Actions / lint

Each block should have a key
<Link
data-testid="link"
href={routeForEventHistoryEvent({
Expand Down Expand Up @@ -326,21 +326,16 @@
<EventDetailsRow {...primaryLocalAttribute} {attributes} />
{/if}
{#if currentEvent?.userMetadata?.summary}
<MetadataDecoder
value={currentEvent.userMetadata.summary}
let:decodedValue
<div
class="flex max-w-xl items-center gap-2 first:pt-0 last:border-b-0 md:w-auto"
>
{#if decodedValue}
<div
class="flex max-w-xl items-center gap-2 first:pt-0 last:border-b-0 md:w-auto"
>
<p class="whitespace-nowrap text-right text-xs">Summary</p>
<Badge type="secondary" class="block select-none truncate">
{decodedValue}
</Badge>
</div>
{/if}
</MetadataDecoder>
<p class="whitespace-nowrap text-right text-xs">Summary</p>
<Payload
value={currentEvent.userMetadata.summary}
mode="summary"
class="block select-none truncate"
/>
</div>
{/if}
{#if currentEvent?.links?.length}
<EventLink
Expand Down
69 changes: 0 additions & 69 deletions src/lib/components/event/metadata-decoder.svelte

This file was deleted.

Loading
Loading