Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2551e52
Update translate to svelte 5 syntax
tegan-temporal Apr 30, 2026
6c877ef
Update PageTitle to Svelte 5 syntax
tegan-temporal Apr 30, 2026
57cf0cd
Update Panel to Svelte 5 syntax
tegan-temporal Apr 30, 2026
22d7da6
Update PayloadInput
tegan-temporal Apr 30, 2026
38ca449
Update WorkflowStatus to svelte 5 syntax
tegan-temporal Apr 30, 2026
99fe895
Update BatchOperations Table to Svelte 5 syntax
tegan-temporal Apr 30, 2026
133b360
Update Icon and Svg components to Svelte 5 syntax
tegan-temporal Apr 30, 2026
8cb57b9
Update Error to Svelte 5 syntax
tegan-temporal Apr 30, 2026
9d96f0a
Update Keyboard Short components to Svelte 5 syntax
tegan-temporal Apr 30, 2026
d5654a4
Update Label component Svelte 5 syntax
tegan-temporal Apr 30, 2026
d2324c4
Update TabPanel to Svelte 5 syntax
tegan-temporal Apr 30, 2026
baff33a
Update Combobox async-test to Svelte 5 syntax
tegan-temporal Apr 30, 2026
da54561
Update Logo to Svelte 5 syntax
tegan-temporal Apr 30, 2026
027add8
Update Batch Operations Page to Svelte 5 syntax
tegan-temporal Apr 30, 2026
36e9f2e
Update (app) +page to Svelte 5 syntax
tegan-temporal Apr 30, 2026
e182eee
Update NameSpace page to Svelte 5 syntax
tegan-temporal Apr 30, 2026
c56d72a
update UserMenuMobile to Svelte 5 syntax
tegan-temporal Apr 30, 2026
a5d0471
Update Lines and Dots components to Svelte 5 syntax
tegan-temporal Apr 30, 2026
9a634f9
Use worse type to not introduce more errors
tegan-temporal Apr 30, 2026
371162a
Migrate forgotten lines and dots component to Svelte 5 syntax
tegan-temporal Apr 30, 2026
3eb0277
Change derived state to reactive state in async combobox test
tegan-temporal May 1, 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
8 changes: 6 additions & 2 deletions src/lib/components/batch-operations/table.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
} from '$lib/types/batch';
import { routeForBatchOperation } from '$lib/utilities/route-for';

export let namespace: string;
export let operations: BatchOperationInfo[];
interface Props {
namespace: string;
operations: BatchOperationInfo[];
}

let { namespace, operations }: Props = $props();

const jobStateToBadgeType: Record<BatchOperationState, BadgeType> = {
Completed: 'success',
Expand All @@ -34,7 +38,7 @@
<th class="max-sm:hidden lg:w-56">{translate('common.start-time')}</th>
<th class="max-sm:hidden lg:w-56">{translate('common.close-time')}</th>
</TableHeaderRow>
{#each operations as { state, jobId, startTime, closeTime }}

Check warning on line 41 in src/lib/components/batch-operations/table.svelte

View workflow job for this annotation

GitHub Actions / lint

Each block should have a key
<TableRow>
<td>
<Badge type={jobStateToBadgeType[state]}>
Expand Down
24 changes: 18 additions & 6 deletions src/lib/components/lines-and-dots/svg/graph-widget.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,23 @@

import TimelineGraph from './timeline-graph.svelte';

export let namespace: string;
export let workflowId: string;
export let runId = '';
export let viewportHeight = 360;
export let onLoad: () => void = () => {};
interface Props {
namespace: string;
workflowId: string;
runId?: string;
viewportHeight?: number;
onLoad?: () => void;
class?: string;
}

let {
namespace,
workflowId,
runId = '',
viewportHeight = 360,
onLoad = () => {},
class: className = '',
}: Props = $props();

const getWorkflowAndEventHistory = async () => {
const [workflow, history] = await Promise.all([
Expand All @@ -32,7 +44,7 @@
</script>

{#await getWorkflowAndEventHistory() then { workflow, history }}
<div class="cursor-pointer overflow-auto {$$restProps.class}">
<div class="cursor-pointer overflow-auto {className}">
<TimelineGraph
{viewportHeight}
Comment thread
tegan-temporal marked this conversation as resolved.
{workflow}
Comment thread
tegan-temporal marked this conversation as resolved.
Expand Down
16 changes: 10 additions & 6 deletions src/lib/components/lines-and-dots/svg/group-details-text.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@

import { DetailsConfig, staticCodeBlockHeight } from '../constants';

export let key: string;
export let value: string | Record<string, unknown>;
export let attributes: CombinedAttributes;
export let onDecode: (decodedValue: string) => void | undefined = undefined;
interface Props {
key: string;
value: string | Record<string, unknown>;
attributes: CombinedAttributes;
onDecode?: (decodedValue: string) => void | undefined;
}

let { key, value, attributes, onDecode = undefined }: Props = $props();

const { fontSizeRatio } = DetailsConfig;

$: codeBlockValue = getCodeBlockValue(value);
$: linkType = displayLinkType(key, attributes);
const codeBlockValue = $derived(getCodeBlockValue(value));
const linkType = $derived(displayLinkType(key, attributes));
</script>

{#if typeof value === 'object'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,46 +23,52 @@
import Dot from './dot.svelte';
import Line from './line.svelte';

export let event: WorkflowEventWithPending;
export let group: EventGroup;
export let history: WorkflowEventWithPending[];
export let groups: EventGroups;
export let index: number;
export let canvasWidth: number;
interface Props {
event: WorkflowEventWithPending;
group: EventGroup;
history: WorkflowEventWithPending[];
groups: EventGroups;
index: number;
canvasWidth: number;
}

let { event, group, history, groups, index, canvasWidth }: Props = $props();

const { height, radius } = HistoryConfig;
const strokeWidth = radius / 2;

$: y = index * height + height / 2;
$: ({ nextDistance, offset } = getNextDistanceAndOffset(
history,
event,
groups,
height,
$eventFilterSort,
));
const y = $derived(index * height + height / 2);
const distanceAndOffset = $derived(
getNextDistanceAndOffset(history, event, groups, height, $eventFilterSort),
);
const nextDistance = $derived(distanceAndOffset.nextDistance);
const offset = $derived(distanceAndOffset.offset);

$: zoomNextDistance = offset > 0 && nextDistance;
const zoomNextDistance = $derived(offset > 0 && nextDistance);

$: classification =
const classification = $derived(
isPendingActivity(event) || isPendingNexusOperation(event)
? 'pending'
: event?.classification;
: event?.classification,
);

$: horizontalOffset = offset * 1.75 * radius;
$: nextIsPending =
isEvent(event) && group?.lastEvent.id === event?.id && group?.isPending;
$: connectLine =
const horizontalOffset = $derived(offset * 1.75 * radius);
const nextIsPending = $derived(
isEvent(event) && group?.lastEvent.id === event?.id && group?.isPending,
);
const connectLine = $derived(
isPendingActivity(event) || isPendingNexusOperation(event) || offset === 0
? false
: !isMiddleEvent(event, groups);
$: category =
: !isMiddleEvent(event, groups),
);
const category = $derived(
isPendingActivity(event) || isPendingNexusOperation(event)
? 'pending'
: nextIsPending
? event?.category
: (undefined as EventTypeCategory | 'pending' | undefined);
$: reverseSort = $eventFilterSort === 'descending';
: (undefined as EventTypeCategory | 'pending' | undefined),
);
const reverseSort = $derived($eventFilterSort === 'descending');
</script>

<g role="button" tabindex="0" class="relative cursor-pointer">
Expand Down
34 changes: 17 additions & 17 deletions src/lib/components/lines-and-dots/svg/history-graph.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,40 @@
import HistoryGraphRowVisual from './history-graph-row-visual.svelte';
import Line from './line.svelte';

export let groups: EventGroups;
export let history: WorkflowEventWithPending[];
interface Props {
groups: EventGroups;
history: WorkflowEventWithPending[];
}

$: workflowTaskGroups = groupWorkflowTaskEvents(
$filteredEventHistory,
$eventFilterSort,
let { groups, history }: Props = $props();

const workflowTaskGroups = $derived(
groupWorkflowTaskEvents($filteredEventHistory, $eventFilterSort),
);
$: allGroups = [...workflowTaskGroups, ...groups];
const allGroups = $derived([...workflowTaskGroups, ...groups]);

const { height, radius } = HistoryConfig;

const nodeBuffer = 4 * radius;
const maxWidth = 600;

let canvasWidth = nodeBuffer;
let visualWidth = 0;

$: canvasHeight = history.length * height;

$: getMaxWidth = (items: WorkflowEventWithPending[]) => {
items.forEach((event) => {
const canvasWidth = $derived.by(() => {
let width = nodeBuffer;
history.forEach((event) => {
const { offset } = getNextDistanceAndOffset(
history,
event,
groups,
height,
$eventFilterSort,
);
canvasWidth = Math.max(canvasWidth, offset * 1.75 * radius + nodeBuffer);
visualWidth = Math.min(canvasWidth - 2 * radius, maxWidth);
width = Math.max(width, offset * 1.75 * radius + nodeBuffer);
});
};
return width;
});
const visualWidth = $derived(Math.min(canvasWidth - 2 * radius, maxWidth));
Comment thread
tegan-temporal marked this conversation as resolved.

$: getMaxWidth(history);
const canvasHeight = $derived(history.length * height);
</script>

<div
Expand Down
14 changes: 9 additions & 5 deletions src/lib/components/lines-and-dots/svg/workflow-row.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
import Dot from './dot.svelte';
import Line from './line.svelte';

export let workflow: WorkflowExecution;
export let length: number;
export let y: number;
interface Props {
workflow: WorkflowExecution;
length: number;
y: number;
}

let { workflow, length, y }: Props = $props();

const { radius, height, gutter } = TimelineConfig;

$: start = gutter;
$: end = start + length - 2 * gutter;
const start = $derived(gutter);
const end = $derived(start + length - 2 * gutter);
</script>

<g role="button" tabindex="0" class="relative cursor-pointer" {height}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
import { translate } from '$lib/i18n/translate';
import type { Failure } from '$lib/types';

export let failure: Failure | undefined = undefined;
import Self from './workflow-error-stack-trace.svelte';

interface Props {
failure?: Failure | undefined;
}

let { failure = undefined }: Props = $props();
</script>

{#if failure}
Expand Down Expand Up @@ -42,5 +48,5 @@
</Accordion>
{/if}
{#if failure?.cause}
<svelte:self failure={failure.cause} />
<Self failure={failure.cause} />
Comment thread
tegan-temporal marked this conversation as resolved.
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
import { translate } from '$lib/i18n/translate';
import type { PendingWorkflowTaskInfo } from '$lib/types';

export let pendingTask: PendingWorkflowTaskInfo | undefined = undefined;
interface Props {
pendingTask?: PendingWorkflowTaskInfo | undefined;
}

let { pendingTask = undefined }: Props = $props();
</script>

<Accordion title={translate('workflows.pending-workflow-task')}>
Expand Down
15 changes: 11 additions & 4 deletions src/lib/components/page-title.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
<script>
<script lang="ts">
import apple from '$lib/vendor/apple-touch-icon.png';
import banner from '$lib/vendor/banner.png';
import favicon from '$lib/vendor/favicon.ico';
import manifest from '$lib/vendor/site.webmanifest';
export let title = 'Temporal';
export let url = 'https://temporal.io';
interface Props {
title?: string;
url?: string;
image?: string;
}
export let image = banner;
let {
title = 'Temporal',
url = 'https://temporal.io',
image = banner,
}: Props = $props();
</script>

<svelte:head>
Expand Down
14 changes: 11 additions & 3 deletions src/lib/components/panel.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<script lang="ts">
export let error = false;
import type { Snippet } from 'svelte';

interface Props {
error?: boolean;
class?: string;
children?: Snippet;
}

let { error = false, class: className = '', children }: Props = $props();
</script>

<div class="panel surface-primary {$$props.class}" class:error>
<slot />
<div class="panel surface-primary {className}" class:error>
{@render children?.()}
</div>

<style lang="postcss">
Expand Down
32 changes: 24 additions & 8 deletions src/lib/components/payload-input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@
import Tooltip from '$lib/holocene/tooltip.svelte';
import { translate } from '$lib/i18n/translate';

export let id: string = crypto.randomUUID();
export let error = false;
export let input: string;
export let label = translate('workflows.signal-payload-input-label');
export let loading = false;
export let hintText = translate('workflows.signal-payload-input-label-hint');
export let editing = true;
interface Props {
id?: string;
error?: boolean;
input: string;
label?: string;
loading?: boolean;
hintText?: string;
editing?: boolean;
}

$: error = !isValidInput(input);
let {
id = crypto.randomUUID(),
error = $bindable(false),
input = $bindable(),
label = translate('workflows.signal-payload-input-label'),
loading = $bindable(false),
hintText = translate('workflows.signal-payload-input-label-hint'),
editing = true,
}: Props = $props();

const isValidInput = (value: string) => {
if (!input) return true;
Expand All @@ -27,6 +37,12 @@
}
};

const computedError = $derived(!isValidInput(input));

$effect(() => {
error = computedError;
});
Comment thread
tegan-temporal marked this conversation as resolved.

const handleInputChange = (text: string): void => {
if (text !== input) {
input = text;
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/workflow-status.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts" context="module">
import { Story, Template } from '@storybook/addon-svelte-csf';
import type { Meta } from '@storybook/svelte';
import type { ComponentProps } from 'svelte';

import WorkflowStatus from './workflow-status.svelte';

Expand All @@ -27,7 +28,7 @@
},
delayed: { name: 'Delayed', control: 'boolean' },
},
} satisfies Meta<WorkflowStatus>;
} satisfies Meta<ComponentProps<typeof WorkflowStatus>>;

const withCount = { count: 100 };
const withNewCount = { ...withCount, newCount: 999 };
Expand Down
Loading
Loading