Compare commits

..
6 changed files with 16 additions and 14 deletions

No files matched your search

@@ -161,7 +161,7 @@ export interface DefaultWidgetConfig {
export const defaultWidgetConfigs: DefaultWidgetConfig[] = [
{ kind: "clock", width: 2, height: 1 },
{ kind: "weather", width: 2, height: 1, options: { showHumidity: false, showCity: false, hasForecast: false } },
{ kind: "weather", width: 2, height: 1, options: { showCity: true, hasForecast: true, forecastDayCount: 3 } },
{ kind: "bookmarks", width: 2, height: 2, options: { title: "Useful Links", layout: "grid", openNewTab: true } },
];
+4 -2
View File
@@ -3012,10 +3012,12 @@
"label": "Animate weather icons"
},
"showHumidity": {
"label": "Show humidity"
"label": "Show humidity",
"description": "Display humidity in current conditions, hourly details and daily forecasts"
},
"showCurrentWindSpeed": {
"label": "Show current wind speed"
"label": "Show current wind speed",
"description": "Only on current weather"
},
"useImperialSpeed": {
"label": "Use mph for windspeed"
@@ -5,8 +5,8 @@
}
.errorIndicator {
top: 4px;
inset-inline-start: 4px;
top: calc(var(--mantine-spacing-md) + var(--mantine-spacing-xl));
inset-inline-end: 4px;
z-index: 1;
padding: 2px;
border: 1px solid rgb(from var(--mantine-primary-color-filled) r g b / calc(var(--opacity, 1) * 0.45));
+2 -2
View File
@@ -293,7 +293,7 @@ const CalendarAgenda = ({
const monthLabel = new Intl.DateTimeFormat(locale, { month: "long", year: "numeric" }).format(month);
return (
<Stack h="100%" w="100%" gap="sm" p="md" pos="relative" style={{ overflow: "hidden" }}>
<Stack h="100%" w="100%" gap="sm" p="md" style={{ overflow: "hidden" }}>
<Group justify="space-between" align="center" wrap="nowrap">
<Group gap="xs" wrap="nowrap">
<Tooltip label={t("previousMonth")} events={{ hover: true, focus: true, touch: false }}>
@@ -329,7 +329,7 @@ const CalendarAgenda = ({
</ActionIcon>
</Tooltip>
</Group>
<Group className={classes.errorIndicator} gap={0} pos="absolute">
<Group gap={0}>
<IntegrationErrorIndicator results={failedIntegrations} />
<WidgetQueryErrorIndicator error={queryError} label={queryErrorLabel} />
</Group>
@@ -69,13 +69,13 @@ describe("weather layout", () => {
});
describe("weather defaults", () => {
it("starts minimal and static while preserving saved false values", () => {
it("starts rich and static while preserving saved false values", () => {
const options = definition.createOptions();
expect(options.showCity.defaultValue).toBe(false);
expect(options.hasForecast.defaultValue).toBe(false);
expect(options.showCity.defaultValue).toBe(true);
expect(options.hasForecast.defaultValue).toBe(true);
expect(options.forecastDayCount.defaultValue).toBe(3);
expect(options.animateIcons.defaultValue).toBe(false);
expect(options.showHumidity.defaultValue).toBe(false);
expect(options.showHumidity.defaultValue).toBe(true);
const reduced = reduceWidgetOptionsWithDefinition(definition, {} as never, {
showCity: false,
+3 -3
View File
@@ -26,7 +26,7 @@ export const { definition, componentLoader } = createWidgetDefinition("weather",
isFormatFahrenheit: factory.switch(),
disableTemperatureDecimals: factory.switch(),
animateIcons: factory.switch(),
showHumidity: factory.switch({ defaultValue: false, withDescription: true }),
showHumidity: factory.switch({ defaultValue: true, withDescription: true }),
showCurrentWindSpeed: factory.switch({ withDescription: true }),
useImperialSpeed: factory.switch(),
location: factory.location({
@@ -50,8 +50,8 @@ export const { definition, componentLoader } = createWidgetDefinition("weather",
defaultValue: "dddd, MMMM D",
withDescription: true,
}),
showCity: factory.switch({ defaultValue: false }),
hasForecast: factory.switch({ defaultValue: false }),
showCity: factory.switch({ defaultValue: true }),
hasForecast: factory.switch({ defaultValue: true }),
forecastDayCount: factory.slider({
defaultValue: 3,
validate: z.number().min(1).max(7),