@adea-ai/app-framework 0.45.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/appearance/appearance-preferences.js +1 -1
- package/dist/appearance/editor.js +12 -1
- package/dist/framework-source.json +1 -1
- package/dist/release/release-promotion.d.ts +5 -6
- package/dist/release/release-promotion.js +10 -11
- package/dist/views/appearance-surface.d.ts +2 -0
- package/dist/views/appearance-surface.js +3 -0
- package/package.json +3 -1
- package/src/appearance/appearance-preferences.ts +7 -2
- package/src/appearance/editor.ts +28 -5
- package/src/views/appearance-surface.tsx +3 -0
|
@@ -124,7 +124,7 @@ function sameFonts(left, right) {
|
|
|
124
124
|
"ui",
|
|
125
125
|
"content",
|
|
126
126
|
"code"
|
|
127
|
-
].every((axis) => left[axis].family === right[axis].family && left[axis].size === right[axis].size);
|
|
127
|
+
].every((axis) => left[axis].family === right[axis].family && left[axis].size === right[axis].size) && left.terminal?.family === right.terminal?.family && left.terminal?.size === right.terminal?.size;
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
130
|
* Where the V2 document lives. One object feeds the persistence and the boot
|
|
@@ -22,7 +22,15 @@ function samePreferences(left, right) {
|
|
|
22
22
|
"ui",
|
|
23
23
|
"content",
|
|
24
24
|
"code"
|
|
25
|
-
].every((axis) => leftFonts[axis].family === rightFonts[axis].family && leftFonts[axis].size === rightFonts[axis].size);
|
|
25
|
+
].every((axis) => leftFonts[axis].family === rightFonts[axis].family && leftFonts[axis].size === rightFonts[axis].size) && sameOptionalFont(leftFonts.terminal, rightFonts.terminal);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The Terminal axis is optional: absent, the terminal follows Code. Left out of the comparison,
|
|
29
|
+
* a Terminal font change read as "no change", so the editor dropped it and the terminal kept
|
|
30
|
+
* showing the Code font.
|
|
31
|
+
*/
|
|
32
|
+
function sameOptionalFont(left, right) {
|
|
33
|
+
return left?.family === right?.family && left?.size === right?.size;
|
|
26
34
|
}
|
|
27
35
|
function createAppearanceEditor(committed = defaultAppearancePreferences) {
|
|
28
36
|
const [draft, setDraft] = createSignal(committed);
|
|
@@ -77,6 +85,9 @@ function createAppearanceEditor(committed = defaultAppearancePreferences) {
|
|
|
77
85
|
family: originalFonts[axis].family === draftFonts[axis].family ? currentFonts[axis].family : draftFonts[axis].family,
|
|
78
86
|
size: originalFonts[axis].size === draftFonts[axis].size ? currentFonts[axis].size : draftFonts[axis].size
|
|
79
87
|
};
|
|
88
|
+
const terminal = sameOptionalFont(originalFonts.terminal, draftFonts.terminal) ? currentFonts.terminal : draftFonts.terminal;
|
|
89
|
+
if (terminal === void 0) delete fonts.terminal;
|
|
90
|
+
else fonts.terminal = terminal;
|
|
80
91
|
if (after.fonts !== void 0 || current.fonts !== void 0) merged.fonts = fonts;
|
|
81
92
|
return merged;
|
|
82
93
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.
|
|
1
|
+
{"version":"0.46.0","commit":"02545033497809f1540e565078301d7fcc5ff313"}
|
|
@@ -16,13 +16,12 @@ export type PromotionProvider = {
|
|
|
16
16
|
markStable(release: PromotionRelease, at: string): Promise<void>;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
* Promote only a successfully qualified daily after
|
|
19
|
+
* Promote only a successfully qualified daily after its individual soak.
|
|
20
20
|
*
|
|
21
|
-
* `soakBypassTag`
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* variable (STABLE_SOAK_BYPASS_TAG) set for one release and removed after it.
|
|
21
|
+
* `soakBypassTag` names exactly one pending daily (newer than the current stable, never a
|
|
22
|
+
* downgrade). It may bypass candidate ordering, but the candidate must still complete the full
|
|
23
|
+
* configured soak and qualify. Callers read it from a protected variable
|
|
24
|
+
* (STABLE_SOAK_BYPASS_TAG) set for one release and removed after it.
|
|
26
25
|
*/
|
|
27
26
|
export declare function promoteDailyRelease(options: {
|
|
28
27
|
now: string;
|
|
@@ -17,13 +17,12 @@ function stableTime(release) {
|
|
|
17
17
|
}
|
|
18
18
|
var eligibleTag = (tag) => tag.length <= 65 && /^v(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/.test(tag);
|
|
19
19
|
/**
|
|
20
|
-
* Promote only a successfully qualified daily after
|
|
20
|
+
* Promote only a successfully qualified daily after its individual soak.
|
|
21
21
|
*
|
|
22
|
-
* `soakBypassTag`
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* variable (STABLE_SOAK_BYPASS_TAG) set for one release and removed after it.
|
|
22
|
+
* `soakBypassTag` names exactly one pending daily (newer than the current stable, never a
|
|
23
|
+
* downgrade). It may bypass candidate ordering, but the candidate must still complete the full
|
|
24
|
+
* configured soak and qualify. Callers read it from a protected variable
|
|
25
|
+
* (STABLE_SOAK_BYPASS_TAG) set for one release and removed after it.
|
|
27
26
|
*/
|
|
28
27
|
async function promoteDailyRelease(options) {
|
|
29
28
|
if (options.held) return { status: "held" };
|
|
@@ -31,7 +30,7 @@ async function promoteDailyRelease(options) {
|
|
|
31
30
|
if (bypass !== void 0 && !eligibleTag(bypass)) throw new Error("Invalid soak bypass tag");
|
|
32
31
|
const now = Date.parse(options.now);
|
|
33
32
|
const hours = options.soakHours ?? 96;
|
|
34
|
-
if (!Number.isFinite(now) || !Number.isSafeInteger(hours) || hours <
|
|
33
|
+
if (!Number.isFinite(now) || !Number.isSafeInteger(hours) || hours < 96 || hours > 8760) throw new Error("Invalid promotion clock or soak");
|
|
35
34
|
const releases = await options.provider.list();
|
|
36
35
|
const ids = /* @__PURE__ */ new Set(), tags = /* @__PURE__ */ new Set();
|
|
37
36
|
for (const release of releases) {
|
|
@@ -46,10 +45,11 @@ async function promoteDailyRelease(options) {
|
|
|
46
45
|
const stable = stableReleases.at(-1);
|
|
47
46
|
const observedStable = releases.filter((release) => !release.draft && !release.prerelease && Date.parse(release.publishedAt) <= now && eligibleTag(release.tag)).sort(compareVersion).at(-1);
|
|
48
47
|
const batch = dailies.filter((release) => release.prerelease && (!stable || order(release, stable) > 0) && (!observedStable || versionLessThan(observedStable.tag, release.tag)));
|
|
49
|
-
const
|
|
48
|
+
const soaked = (release) => now - Date.parse(release.publishedAt) >= hours * 36e5;
|
|
50
49
|
if (bypass !== void 0) {
|
|
51
50
|
const named = batch.find((release) => release.tag === bypass);
|
|
52
51
|
if (!named) throw new Error(`Soak bypass tag ${bypass} is not a pending daily`);
|
|
52
|
+
if (!soaked(named)) return { status: "soaking" };
|
|
53
53
|
let qualified = false;
|
|
54
54
|
try {
|
|
55
55
|
qualified = await options.provider.qualify(named) === true;
|
|
@@ -58,11 +58,10 @@ async function promoteDailyRelease(options) {
|
|
|
58
58
|
await options.provider.markStable(named, options.now);
|
|
59
59
|
return {
|
|
60
60
|
status: "stable",
|
|
61
|
-
tag: named.tag
|
|
62
|
-
soakBypassed: true
|
|
61
|
+
tag: named.tag
|
|
63
62
|
};
|
|
64
63
|
}
|
|
65
|
-
const candidates =
|
|
64
|
+
const candidates = [...batch].filter(soaked).reverse();
|
|
66
65
|
candidates.sort((a, b) => versionLessThan(a.tag, b.tag) ? 1 : versionLessThan(b.tag, a.tag) ? -1 : order(b, a));
|
|
67
66
|
if (stable && (!observedStable || stable.tag === observedStable.tag)) candidates.push(stable);
|
|
68
67
|
if (!candidates.length) return { status: "soaking" };
|
|
@@ -11,6 +11,8 @@ type AppearanceControlProps = {
|
|
|
11
11
|
*/
|
|
12
12
|
tab?: AppearanceControlTab;
|
|
13
13
|
onTabChange?(tab: AppearanceControlTab): void;
|
|
14
|
+
/** App rows closing the Global tab, composed with `AppearanceSettingsRow`. */
|
|
15
|
+
globalRows?: JSX.Element;
|
|
14
16
|
/** App rows closing the Terminal tab, composed with `AppearanceSettingsRow`. */
|
|
15
17
|
terminalRows?: JSX.Element;
|
|
16
18
|
/** App rows closing the Code tab, composed with `AppearanceSettingsRow`. */
|
|
@@ -294,6 +294,9 @@ function AppearanceHost(props) {
|
|
|
294
294
|
return control().tab;
|
|
295
295
|
},
|
|
296
296
|
onTabChange: (tab) => control().onTabChange?.(tab),
|
|
297
|
+
get extraRows() {
|
|
298
|
+
return control().globalRows;
|
|
299
|
+
},
|
|
297
300
|
get terminalRows() {
|
|
298
301
|
return control().terminalRows;
|
|
299
302
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adea-ai/app-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -409,6 +409,8 @@
|
|
|
409
409
|
},
|
|
410
410
|
"scripts": {
|
|
411
411
|
"test": "bun test --parallel=$(bun -e \"process.stdout.write(process.env.ADEA_TEST_WORKERS || '4')\") --timeout=$(bun -e \"process.stdout.write(process.env.ADEA_TEST_TIMEOUT_MS || '5000')\") --timings=tests/test-timings.json tests/*/*.test.ts tests/*/*/*.test.ts && bun run test:ui",
|
|
412
|
+
"test:qualification": "bun scripts/test-qualification.ts unit",
|
|
413
|
+
"test:packed:qualification": "bun scripts/test-qualification.ts packed",
|
|
412
414
|
"test:ui": "bun test --parallel=$(bun -e \"process.stdout.write(process.env.ADEA_TEST_WORKERS || '4')\") --timeout=$(bun -e \"process.stdout.write(process.env.ADEA_TEST_TIMEOUT_MS || '5000')\") --conditions=browser --preload @adea-ai/ui/testing/solid-transform tests/*/*.test.tsx",
|
|
413
415
|
"test:sidebar-responsive-matrix": "bash scripts/test-sidebar-responsive-matrix.sh",
|
|
414
416
|
"test:theme-browser": "bun scripts/test-theme-library-browser.ts",
|
|
@@ -232,8 +232,13 @@ function codeThemeIdOf(selection: ThemeSelection): string | undefined {
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
function sameFonts(left: AppearanceEditorFontSettings, right: AppearanceEditorFontSettings) {
|
|
235
|
-
return (
|
|
236
|
-
(
|
|
235
|
+
return (
|
|
236
|
+
(['ui', 'content', 'code'] as const).every(
|
|
237
|
+
(axis) => left[axis].family === right[axis].family && left[axis].size === right[axis].size
|
|
238
|
+
) &&
|
|
239
|
+
// The optional Terminal axis counts too: a terminal font set apart is a change to keep.
|
|
240
|
+
left.terminal?.family === right.terminal?.family &&
|
|
241
|
+
left.terminal?.size === right.terminal?.size
|
|
237
242
|
)
|
|
238
243
|
}
|
|
239
244
|
|
package/src/appearance/editor.ts
CHANGED
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
* See NOTICE for source and license provenance.
|
|
13
13
|
*/
|
|
14
14
|
import { createSignal } from 'solid-js'
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
normalizeAppearanceEditorFontSettings,
|
|
17
|
+
type AppearanceEditorFontSettings,
|
|
18
|
+
} from '@adea-ai/ui/lib/appearance-font-settings'
|
|
16
19
|
|
|
17
20
|
import {
|
|
18
21
|
defaultAppearancePreferences,
|
|
@@ -60,13 +63,27 @@ function samePreferences(left: AppearancePreferencesV2, right: AppearancePrefere
|
|
|
60
63
|
if (left.fonts === right.fonts) return true
|
|
61
64
|
const leftFonts = normalizeAppearanceEditorFontSettings(left.fonts).settings
|
|
62
65
|
const rightFonts = normalizeAppearanceEditorFontSettings(right.fonts).settings
|
|
63
|
-
return (
|
|
64
|
-
(
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
return (
|
|
67
|
+
(['ui', 'content', 'code'] as const).every(
|
|
68
|
+
(axis) =>
|
|
69
|
+
leftFonts[axis].family === rightFonts[axis].family &&
|
|
70
|
+
leftFonts[axis].size === rightFonts[axis].size
|
|
71
|
+
) && sameOptionalFont(leftFonts.terminal, rightFonts.terminal)
|
|
67
72
|
)
|
|
68
73
|
}
|
|
69
74
|
|
|
75
|
+
/**
|
|
76
|
+
* The Terminal axis is optional: absent, the terminal follows Code. Left out of the comparison,
|
|
77
|
+
* a Terminal font change read as "no change", so the editor dropped it and the terminal kept
|
|
78
|
+
* showing the Code font.
|
|
79
|
+
*/
|
|
80
|
+
function sameOptionalFont(
|
|
81
|
+
left: AppearanceEditorFontSettings['terminal'],
|
|
82
|
+
right: AppearanceEditorFontSettings['terminal']
|
|
83
|
+
) {
|
|
84
|
+
return left?.family === right?.family && left?.size === right?.size
|
|
85
|
+
}
|
|
86
|
+
|
|
70
87
|
export function createAppearanceEditor(
|
|
71
88
|
committed: AppearancePreferencesV2 = defaultAppearancePreferences
|
|
72
89
|
): AppearanceEditor {
|
|
@@ -132,6 +149,12 @@ export function createAppearanceEditor(
|
|
|
132
149
|
: draftFonts[axis].size,
|
|
133
150
|
}
|
|
134
151
|
}
|
|
152
|
+
// The optional Terminal axis merges on the same rule: the draft's when it changed it.
|
|
153
|
+
const terminal = sameOptionalFont(originalFonts.terminal, draftFonts.terminal)
|
|
154
|
+
? currentFonts.terminal
|
|
155
|
+
: draftFonts.terminal
|
|
156
|
+
if (terminal === undefined) delete (fonts as { terminal?: unknown }).terminal
|
|
157
|
+
else fonts.terminal = terminal
|
|
135
158
|
if (after.fonts !== undefined || current.fonts !== undefined) merged.fonts = fonts
|
|
136
159
|
return merged
|
|
137
160
|
},
|
|
@@ -80,6 +80,8 @@ type AppearanceControlProps = {
|
|
|
80
80
|
*/
|
|
81
81
|
tab?: AppearanceControlTab
|
|
82
82
|
onTabChange?(tab: AppearanceControlTab): void
|
|
83
|
+
/** App rows closing the Global tab, composed with `AppearanceSettingsRow`. */
|
|
84
|
+
globalRows?: JSX.Element
|
|
83
85
|
/** App rows closing the Terminal tab, composed with `AppearanceSettingsRow`. */
|
|
84
86
|
terminalRows?: JSX.Element
|
|
85
87
|
/** App rows closing the Code tab, composed with `AppearanceSettingsRow`. */
|
|
@@ -452,6 +454,7 @@ function AppearanceHost(props: { popover?: AppearanceControlProps }) {
|
|
|
452
454
|
triggerVariant="toolbar"
|
|
453
455
|
tab={control().tab}
|
|
454
456
|
onTabChange={(tab) => control().onTabChange?.(tab)}
|
|
457
|
+
extraRows={control().globalRows}
|
|
455
458
|
terminalRows={control().terminalRows}
|
|
456
459
|
codeRows={control().codeRows}
|
|
457
460
|
open={control().open}
|