fix: preserve nested App text scale and align API schema

This commit is contained in:
ajnart committed 2026-09-11 11:01:05 +02:00
1 parent 33404dec95
commit 6f953f1d4e
2 files changed
+24 -36

No files matched your search

+17 -32
View File
@@ -67,8 +67,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"maxLength": 64
}, },
"name": { "name": {
"type": "string" "type": "string"
@@ -206,8 +205,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"maxLength": 64
}, },
"name": { "name": {
"type": "string" "type": "string"
@@ -402,8 +400,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"maxLength": 64
}, },
"name": { "name": {
"type": "string" "type": "string"
@@ -542,8 +539,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"maxLength": 64
}, },
"name": { "name": {
"type": "string" "type": "string"
@@ -671,8 +667,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"maxLength": 64
}, },
"name": { "name": {
"type": "string" "type": "string"
@@ -788,8 +783,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"maxLength": 64
}, },
"name": { "name": {
"type": "string" "type": "string"
@@ -2488,8 +2482,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"maxLength": 64
}, },
"expirationDate": { "expirationDate": {
"type": "string" "type": "string"
@@ -3116,8 +3109,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"maxLength": 64
}, },
"name": { "name": {
"anyOf": [ "anyOf": [
@@ -3350,8 +3342,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"maxLength": 64
}, },
"name": { "name": {
"anyOf": [ "anyOf": [
@@ -3496,8 +3487,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"maxLength": 64
}, },
"name": { "name": {
"anyOf": [ "anyOf": [
@@ -3615,8 +3605,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"maxLength": 64
}, },
"name": { "name": {
"anyOf": [ "anyOf": [
@@ -3659,14 +3648,12 @@
] ]
}, },
"provider": { "provider": {
"type": "string", "type": "string"
"maxLength": 64
}, },
"homeBoardId": { "homeBoardId": {
"anyOf": [ "anyOf": [
{ {
"type": "string", "type": "string"
"maxLength": 64
}, },
{ {
"type": "null" "type": "null"
@@ -3676,8 +3663,7 @@
"mobileHomeBoardId": { "mobileHomeBoardId": {
"anyOf": [ "anyOf": [
{ {
"type": "string", "type": "string"
"maxLength": 64
}, },
{ {
"type": "null" "type": "null"
@@ -3693,8 +3679,8 @@
}, },
"firstDayOfWeek": { "firstDayOfWeek": {
"type": "integer", "type": "integer",
"minimum": -32768, "minimum": -9007199254740991,
"maximum": 32767 "maximum": 9007199254740991
}, },
"pingIconsEnabled": { "pingIconsEnabled": {
"type": "boolean" "type": "boolean"
@@ -3708,8 +3694,7 @@
"defaultSearchEngineId": { "defaultSearchEngineId": {
"anyOf": [ "anyOf": [
{ {
"type": "string", "type": "string"
"maxLength": 64
}, },
{ {
"type": "null" "type": "null"
+7 -4
View File
@@ -44,9 +44,12 @@ export default function AppWidget({
// Readable board tokens stay fixed on screen, but must yield space to the icon // 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. // when the tile itself becomes small. Below 100px, scale the whole composition.
const scale = getWidgetDisplayScale({ displayScale, displayMode }); const scale = getWidgetDisplayScale({ displayScale, displayMode });
const contentScale = Math.min(1 / Math.min(scale, 1), Math.min(width, height) / 100); const maximumContentScale = Math.min(width, height) / 100;
const textSize = `${14 * contentScale}px`; let uiScale = "var(--board-canvas-ui-scale, 1)";
const spacing = 12 * contentScale; 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 isColumnLayout = options.layout.startsWith("column");
const isTiny = Math.min(width, height) * scale < 100; const isTiny = Math.min(width, height) * scale < 100;
const textStyle: CSSProperties = {}; const textStyle: CSSProperties = {};
@@ -79,7 +82,7 @@ export default function AppWidget({
direction={options.layout} direction={options.layout}
justify="center" justify="center"
align="center" align="center"
style={{ padding: spacing, gap: isColumnLayout ? 0 : spacing / 2 }} style={{ padding: spacing, gap: isColumnLayout ? 0 : rowGap }}
onContextMenu={isEditMode ? (e) => e.preventDefault() : undefined} onContextMenu={isEditMode ? (e) => e.preventDefault() : undefined}
> >
<Stack gap={0} className={classes.appText} style={textStyle}> <Stack gap={0} className={classes.appText} style={textStyle}>