From 6f953f1d4ee1c9ef2c0e6fbeb717c87d6ca54261 Mon Sep 17 00:00:00 2001 From: ajnart Date: Fri, 11 Sep 2026 11:01:05 +0200 Subject: [PATCH] fix: preserve nested App text scale and align API schema --- apps/docs/static/api/open-api-schema.json | 49 ++++++++--------------- packages/widgets/src/app/component.tsx | 11 +++-- 2 files changed, 24 insertions(+), 36 deletions(-) diff --git a/apps/docs/static/api/open-api-schema.json b/apps/docs/static/api/open-api-schema.json index 9fa570883..1a8dc8afa 100644 --- a/apps/docs/static/api/open-api-schema.json +++ b/apps/docs/static/api/open-api-schema.json @@ -67,8 +67,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "maxLength": 64 + "type": "string" }, "name": { "type": "string" @@ -206,8 +205,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "maxLength": 64 + "type": "string" }, "name": { "type": "string" @@ -402,8 +400,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "maxLength": 64 + "type": "string" }, "name": { "type": "string" @@ -542,8 +539,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "maxLength": 64 + "type": "string" }, "name": { "type": "string" @@ -671,8 +667,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "maxLength": 64 + "type": "string" }, "name": { "type": "string" @@ -788,8 +783,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "maxLength": 64 + "type": "string" }, "name": { "type": "string" @@ -2488,8 +2482,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "maxLength": 64 + "type": "string" }, "expirationDate": { "type": "string" @@ -3116,8 +3109,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "maxLength": 64 + "type": "string" }, "name": { "anyOf": [ @@ -3350,8 +3342,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "maxLength": 64 + "type": "string" }, "name": { "anyOf": [ @@ -3496,8 +3487,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "maxLength": 64 + "type": "string" }, "name": { "anyOf": [ @@ -3615,8 +3605,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "maxLength": 64 + "type": "string" }, "name": { "anyOf": [ @@ -3659,14 +3648,12 @@ ] }, "provider": { - "type": "string", - "maxLength": 64 + "type": "string" }, "homeBoardId": { "anyOf": [ { - "type": "string", - "maxLength": 64 + "type": "string" }, { "type": "null" @@ -3676,8 +3663,7 @@ "mobileHomeBoardId": { "anyOf": [ { - "type": "string", - "maxLength": 64 + "type": "string" }, { "type": "null" @@ -3693,8 +3679,8 @@ }, "firstDayOfWeek": { "type": "integer", - "minimum": -32768, - "maximum": 32767 + "minimum": -9007199254740991, + "maximum": 9007199254740991 }, "pingIconsEnabled": { "type": "boolean" @@ -3708,8 +3694,7 @@ "defaultSearchEngineId": { "anyOf": [ { - "type": "string", - "maxLength": 64 + "type": "string" }, { "type": "null" diff --git a/packages/widgets/src/app/component.tsx b/packages/widgets/src/app/component.tsx index 15bd673e7..344cebf55 100644 --- a/packages/widgets/src/app/component.tsx +++ b/packages/widgets/src/app/component.tsx @@ -44,9 +44,12 @@ export default function AppWidget({ // Readable board tokens stay fixed on screen, but must yield space to the icon // when the tile itself becomes small. Below 100px, scale the whole composition. const scale = getWidgetDisplayScale({ displayScale, displayMode }); - const contentScale = Math.min(1 / Math.min(scale, 1), Math.min(width, height) / 100); - const textSize = `${14 * contentScale}px`; - const spacing = 12 * contentScale; + const maximumContentScale = Math.min(width, height) / 100; + let uiScale = "var(--board-canvas-ui-scale, 1)"; + if (displayMode === "advanced") uiScale = "1"; + const textSize = `min(calc(14px * ${uiScale}), ${14 * maximumContentScale}px)`; + const spacing = `min(calc(12px * ${uiScale}), ${12 * maximumContentScale}px)`; + const rowGap = `min(calc(6px * ${uiScale}), ${6 * maximumContentScale}px)`; const isColumnLayout = options.layout.startsWith("column"); const isTiny = Math.min(width, height) * scale < 100; const textStyle: CSSProperties = {}; @@ -79,7 +82,7 @@ export default function AppWidget({ direction={options.layout} justify="center" align="center" - style={{ padding: spacing, gap: isColumnLayout ? 0 : spacing / 2 }} + style={{ padding: spacing, gap: isColumnLayout ? 0 : rowGap }} onContextMenu={isEditMode ? (e) => e.preventDefault() : undefined} >