fix: preserve nested App text scale and align API schema
This commit is contained in:
1 parent
33404dec95
commit
6f953f1d4e
2 files changed
+24
-36
No files matched your search
+17
-32
@@ -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"
|
||||
|
||||
@@ -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}
|
||||
>
|
||||
<Stack gap={0} className={classes.appText} style={textStyle}>
|
||||
|
||||
Reference in new issue
Block a user