@adea-ai/app-framework 0.44.1 → 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.
@@ -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.44.1","commit":"5b23d0416a45130ae5cdfd90f9878f6ca7e921e5"}
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 the configured batch soak.
19
+ * Promote only a successfully qualified daily after its individual soak.
20
20
  *
21
- * `soakBypassTag` replaces a bad stable without waiting for the soak: it names exactly one pending
22
- * daily (newer than the current stable, never a downgrade), which is promoted at once if it
23
- * qualifies. Nothing else changes: qualification is still required, a hold still wins, and a tag
24
- * that is not a pending daily is refused rather than ignored. Callers read it from a protected
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 the configured batch soak.
20
+ * Promote only a successfully qualified daily after its individual soak.
21
21
  *
22
- * `soakBypassTag` replaces a bad stable without waiting for the soak: it names exactly one pending
23
- * daily (newer than the current stable, never a downgrade), which is promoted at once if it
24
- * qualifies. Nothing else changes: qualification is still required, a hold still wins, and a tag
25
- * that is not a pending daily is refused rather than ignored. Callers read it from a protected
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 < 0 || hours > 8760) throw new Error("Invalid promotion clock or soak");
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 anchor = stable && (!observedStable || stable.tag === observedStable.tag) ? stableTime(stable) : observedStable?.publishedAt ?? batch[0]?.publishedAt;
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 = anchor !== void 0 && now - Date.parse(anchor) >= hours * 36e5 ? [...batch].reverse() : [];
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" };
@@ -1,9 +1,24 @@
1
+ import { type AppearanceEditorTab } from '@adea-ai/ui/components/composites/appearance-editor';
2
+ import { type JSX } from 'solid-js';
3
+ export type AppearanceControlTab = AppearanceEditorTab;
1
4
  type AppearanceControlProps = {
2
5
  open: boolean;
3
6
  onOpen(): void;
4
7
  onClose(): void;
8
+ /**
9
+ * Split the panel into Global, Terminal and Code tabs and select one. The app
10
+ * owns the selection so its own links can open the panel on a given tab.
11
+ */
12
+ tab?: AppearanceControlTab;
13
+ onTabChange?(tab: AppearanceControlTab): void;
14
+ /** App rows closing the Global tab, composed with `AppearanceSettingsRow`. */
15
+ globalRows?: JSX.Element;
16
+ /** App rows closing the Terminal tab, composed with `AppearanceSettingsRow`. */
17
+ terminalRows?: JSX.Element;
18
+ /** App rows closing the Code tab, composed with `AppearanceSettingsRow`. */
19
+ codeRows?: JSX.Element;
5
20
  };
6
- export declare function AppearancePanel(): import("solid-js").JSX.Element;
21
+ export declare function AppearancePanel(): JSX.Element;
7
22
  /** Device-local preview and persistence around the shared live popover. */
8
- export declare function AppearanceControl(props: AppearanceControlProps): import("solid-js").JSX.Element;
23
+ export declare function AppearanceControl(props: AppearanceControlProps): JSX.Element;
9
24
  export {};
@@ -290,6 +290,19 @@ function AppearanceHost(props) {
290
290
  },
291
291
  children: (control) => createComponent(AppearancePopover, mergeProps(editorProps, {
292
292
  triggerVariant: "toolbar",
293
+ get tab() {
294
+ return control().tab;
295
+ },
296
+ onTabChange: (tab) => control().onTabChange?.(tab),
297
+ get extraRows() {
298
+ return control().globalRows;
299
+ },
300
+ get terminalRows() {
301
+ return control().terminalRows;
302
+ },
303
+ get codeRows() {
304
+ return control().codeRows;
305
+ },
293
306
  get open() {
294
307
  return control().open;
295
308
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/app-framework",
3
- "version": "0.44.1",
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",
@@ -426,7 +428,7 @@
426
428
  "tar": "^7.5.22"
427
429
  },
428
430
  "devDependencies": {
429
- "@adea-ai/ui": "0.157.0",
431
+ "@adea-ai/ui": "0.158.0",
430
432
  "@babel/core": "8.1.0",
431
433
  "@babel/preset-typescript": "^8.0.7",
432
434
  "@happy-dom/global-registrator": "^21.0.4",
@@ -448,7 +450,7 @@
448
450
  "vite-plus": "1.5.1"
449
451
  },
450
452
  "peerDependencies": {
451
- "@adea-ai/ui": "^0.157.0",
453
+ "@adea-ai/ui": "^0.158.0",
452
454
  "lucide-solid": "^1.51.0",
453
455
  "solid-js": "^1.9.15"
454
456
  },
@@ -232,8 +232,13 @@ function codeThemeIdOf(selection: ThemeSelection): string | undefined {
232
232
  }
233
233
 
234
234
  function sameFonts(left: AppearanceEditorFontSettings, right: AppearanceEditorFontSettings) {
235
- return (['ui', 'content', 'code'] as const).every(
236
- (axis) => left[axis].family === right[axis].family && left[axis].size === right[axis].size
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
 
@@ -12,7 +12,10 @@
12
12
  * See NOTICE for source and license provenance.
13
13
  */
14
14
  import { createSignal } from 'solid-js'
15
- import { normalizeAppearanceEditorFontSettings } from '@adea-ai/ui/lib/appearance-font-settings'
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 (['ui', 'content', 'code'] as const).every(
64
- (axis) =>
65
- leftFonts[axis].family === rightFonts[axis].family &&
66
- leftFonts[axis].size === rightFonts[axis].size
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
  },
@@ -10,6 +10,7 @@ import {
10
10
  AppearancePopover,
11
11
  type AppearanceDraft,
12
12
  type AppearanceEditorProps,
13
+ type AppearanceEditorTab,
13
14
  } from '@adea-ai/ui/components/composites/appearance-editor'
14
15
  import {
15
16
  accents as accentPresets,
@@ -44,6 +45,7 @@ import {
44
45
  onMount,
45
46
  Show,
46
47
  untrack,
48
+ type JSX,
47
49
  } from 'solid-js'
48
50
  import { MonitorCog } from 'lucide-solid'
49
51
  import { themeAccentsForRecords } from '@adea-ai/ui/lib/theme-projection'
@@ -66,10 +68,24 @@ function customAccentValue(accent: string): string {
66
68
  return accent === 'theme' || accentPresetById(accent) || isThemeAccentId(accent) ? '' : accent
67
69
  }
68
70
 
71
+ export type AppearanceControlTab = AppearanceEditorTab
72
+
69
73
  type AppearanceControlProps = {
70
74
  open: boolean
71
75
  onOpen(): void
72
76
  onClose(): void
77
+ /**
78
+ * Split the panel into Global, Terminal and Code tabs and select one. The app
79
+ * owns the selection so its own links can open the panel on a given tab.
80
+ */
81
+ tab?: AppearanceControlTab
82
+ onTabChange?(tab: AppearanceControlTab): void
83
+ /** App rows closing the Global tab, composed with `AppearanceSettingsRow`. */
84
+ globalRows?: JSX.Element
85
+ /** App rows closing the Terminal tab, composed with `AppearanceSettingsRow`. */
86
+ terminalRows?: JSX.Element
87
+ /** App rows closing the Code tab, composed with `AppearanceSettingsRow`. */
88
+ codeRows?: JSX.Element
73
89
  }
74
90
 
75
91
  export function AppearancePanel() {
@@ -436,6 +452,11 @@ function AppearanceHost(props: { popover?: AppearanceControlProps }) {
436
452
  <AppearancePopover
437
453
  {...editorProps}
438
454
  triggerVariant="toolbar"
455
+ tab={control().tab}
456
+ onTabChange={(tab) => control().onTabChange?.(tab)}
457
+ extraRows={control().globalRows}
458
+ terminalRows={control().terminalRows}
459
+ codeRows={control().codeRows}
439
460
  open={control().open}
440
461
  onOpen={() => {
441
462
  openDraft()