Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ go.work.sum
.claude/settings.local.json
.claude/*
!.claude/skills/
.sisyphus/*
.sisyphus/*
.omc
13 changes: 13 additions & 0 deletions .serena/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,16 @@ encoding: utf-8
# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
languages:
- typescript

# time budget (seconds) per tool call for the retrieval of additional symbol information
# such as docstrings or parameter information.
# This overrides the corresponding setting in the global configuration; see the documentation there.
# If null or missing, use the setting from the global configuration.
symbol_info_budget:

# The language backend to use for this project.
# If not set, the global setting from serena_config.yml is used.
# Valid values: LSP, JetBrains
# Note: the backend is fixed at startup. If a project with a different backend
# is activated post-init, an error will be returned.
language_backend:
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const sharedPlugins = {
};

const sharedRules = {
'svelte/no-navigation-without-resolve': 'off',
'no-undef': 'off',
quotes: ['error', 'single', { avoidEscape: true }],
'@typescript-eslint/no-unused-vars': [
Expand Down Expand Up @@ -126,7 +127,6 @@ export default [
rules: {
...sharedRules,
'svelte/require-each-key': 'warn',
'svelte/no-navigation-without-resolve': 'warn',
'svelte/no-reactive-reassign': 'warn',
'svelte/no-reactive-functions': 'warn',
'svelte/no-reactive-literals': 'warn',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@

const { filter, handleSubmit } = getContext<FilterContext>(FILTER_CONTEXT);

// Local state for date/time values - defaults to today
let localStartDate = $state(startOfDay(new Date()));
let localStartHour = $state('');
let localStartMinute = $state('');
let localStartSecond = $state('');
// Local state for date/time values - initialize from stores to preserve previous values
let localStartDate = $state($startDate ?? startOfDay(new Date()));
let localStartHour = $state($startHour ?? '');
let localStartMinute = $state($startMinute ?? '');
let localStartSecond = $state($startSecond ?? '');

let localEndDate = $state(startOfDay(new Date()));
let localEndHour = $state('');
let localEndMinute = $state('');
let localEndSecond = $state('');
let localEndDate = $state($endDate ?? startOfDay(new Date()));
let localEndHour = $state($endHour ?? '');
let localEndMinute = $state($endMinute ?? '');
let localEndSecond = $state($endSecond ?? '');

const error = (x: string) => {
if (x) return isNaN(Number(x)) || isNaN(parseFloat(x));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import { addHours, addMinutes, addSeconds, startOfDay } from 'date-fns';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Could not find a declaration file for module 'date-fns-tz'. '/home/runner/work/ui/ui/node_modules/.pnpm/date-fns-tz@1.3.8_date-fns@2.30.0/node_modules/date-fns-tz/index.js' implicitly has an 'any' type.

import { zonedTimeToUtc } from 'date-fns-tz';
import { untrack } from 'svelte';

import { timestamp } from '$lib/components/timestamp.svelte';
import Button from '$lib/holocene/button.svelte';
Expand Down Expand Up @@ -35,6 +36,7 @@
} from '$lib/stores/time-format';
import { getSelectedTimezone } from '$lib/utilities/format-date';
import { isInConditional, isNullConditional } from '$lib/utilities/is';
import { getInitialDateTimes } from '$lib/utilities/query/datetime-filter-parse';
import {
formatListFilterValue,
isBooleanFilter,
Expand Down Expand Up @@ -67,16 +69,9 @@
const open = writable(false);
let localFilter = $state({ ...filter });

// Local state for date/time values - defaults to today
let localStartDate = $state(startOfDay(new Date()));
let localStartHour = $state('');
let localStartMinute = $state('');
let localStartSecond = $state('');
const timezone = $derived(getTimezone($timeFormat ?? 'UTC'));

let localEndDate = $state(startOfDay(new Date()));
let localEndHour = $state('');
let localEndMinute = $state('');
let localEndSecond = $state('');
let { start, end } = $state(getInitialDateTimes(filter, timezone));

const controlsId = $derived(
`dropdown-filter-chip-${filter.attribute}-${index}`,
Expand Down Expand Up @@ -213,11 +208,11 @@
}

const onStartDateChange = (d: CustomEvent) => {
localStartDate = startOfDay(d.detail);
start.date = startOfDay(d.detail);
};

const onEndDateChange = (d: CustomEvent) => {
localEndDate = startOfDay(d.detail);
end.date = startOfDay(d.detail);
};

const applyTimeChanges = (
Expand All @@ -241,15 +236,15 @@
);
localFilter.customDate = false;
} else {
let startDateWithTime = applyTimeChanges(localStartDate, {
hour: localStartHour,
minute: localStartMinute,
second: localStartSecond,
let startDateWithTime = applyTimeChanges(start.date, {
hour: start.hour,
minute: start.minute,
second: start.second,
});
let endDateWithTime = applyTimeChanges(localEndDate, {
hour: localEndHour,
minute: localEndMinute,
second: localEndSecond,
let endDateWithTime = applyTimeChanges(end.date, {
hour: end.hour,
minute: end.minute,
second: end.second,
});

const timezone = getTimezone($timeFormat ?? 'UTC');
Expand Down Expand Up @@ -277,15 +272,15 @@
}

// Update global stores so next filter gets these as defaults
startDate.set(localStartDate);
startHour.set(localStartHour);
startMinute.set(localStartMinute);
startSecond.set(localStartSecond);

endDate.set(localEndDate);
endHour.set(localEndHour);
endMinute.set(localEndMinute);
endSecond.set(localEndSecond);
startDate.set(start.date);
startHour.set(start.hour);
startMinute.set(start.minute);
startSecond.set(start.second);

endDate.set(end.date);
endHour.set(end.hour);
endMinute.set(end.minute);
endSecond.set(end.second);
}
};

Expand All @@ -300,6 +295,15 @@
localFilter = { ...filter };
}
});

$effect(() => {
if (!$open) {
({ start, end } = getInitialDateTimes(
untrack(() => filter),
timezone,
));
}
});
</script>

{#snippet conditionalButtons(options: { value: string; label: string }[])}
Expand Down Expand Up @@ -355,31 +359,31 @@
<DatePicker
label={translate('common.start')}
on:datechange={onStartDateChange}
selected={new Date(localStartDate)}
selected={new Date(start.date)}
todayLabel={translate('common.today')}
closeLabel={translate('common.close')}
clearLabel={translate('common.clear-input-button-label')}
/>
<TimePicker
bind:hour={localStartHour}
bind:minute={localStartMinute}
bind:second={localStartSecond}
bind:hour={start.hour}
bind:minute={start.minute}
bind:second={start.second}
twelveHourClock={false}
/>
</div>
<div class="flex flex-col gap-2">
<DatePicker
label={translate('common.end')}
on:datechange={onEndDateChange}
selected={new Date(localEndDate)}
selected={new Date(end.date)}
todayLabel={translate('common.today')}
closeLabel={translate('common.close')}
clearLabel={translate('common.clear-input-button-label')}
/>
<TimePicker
bind:hour={localEndHour}
bind:minute={localEndMinute}
bind:second={localEndSecond}
bind:hour={end.hour}
bind:minute={end.minute}
bind:second={end.second}
twelveHourClock={false}
/>
</div>
Expand Down Expand Up @@ -433,16 +437,16 @@
label=""
labelHidden
on:datechange={onStartDateChange}
selected={new Date(localStartDate)}
selected={new Date(start.date)}
todayLabel={translate('common.today')}
closeLabel={translate('common.close')}
clearLabel={translate('common.clear-input-button-label')}
disabled={$timeFormatType !== 'absolute' || isNullFilter}
/>
<TimePicker
bind:hour={localStartHour}
bind:minute={localStartMinute}
bind:second={localStartSecond}
bind:hour={start.hour}
bind:minute={start.minute}
bind:second={start.second}
twelveHourClock={false}
disabled={$timeFormatType !== 'absolute'}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/pages/workflow-history.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import { onMount } from 'svelte';

import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { page } from '$app/state';

import { eventFilterSort } from '$lib/stores/event-view';
import { routeForEventHistory } from '$lib/utilities/route-for';

const { namespace, workflow, run } = $page.params;
const { namespace, workflow, run } = page.params;

onMount(async () => {
const queryParams = {
Expand Down
5 changes: 2 additions & 3 deletions src/lib/stores/schedules.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { writable } from 'svelte/store';

import { goto } from '$app/navigation';
import { resolve } from '$app/paths';

import { translate } from '$lib/i18n/translate';
import { createSchedule, editSchedule } from '$lib/services/schedule-service';
Expand Down Expand Up @@ -173,7 +172,7 @@ export const submitCreateSchedule = async ({
createTimeout = setTimeout(() => {
error.set('');
loading.set(false);
goto(resolve(routeForSchedules({ namespace }), {}));
goto(routeForSchedules({ namespace }));
}, 2000);
}
};
Expand Down Expand Up @@ -266,7 +265,7 @@ export const submitEditSchedule = async (
} else {
clearTimeout(editTimeout);
editTimeout = setTimeout(() => {
goto(resolve(routeForSchedule({ namespace, scheduleId: name }), {}));
goto(routeForSchedule({ namespace, scheduleId: name }));
error.set('');
loading.set(false);
}, 2000);
Expand Down
Loading
Loading