@glassly/engine 0.3.5-dev.720 → 0.3.5-dev.728
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/build/generated/releaseMetadata.js +3 -3
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
- package/build/services/LocalMiniappRuntime.js +9 -3
- package/build/services/LocalMiniappRuntime.js.map +1 -1
- package/build/services/MiniappExitGesture.d.ts +2 -0
- package/build/services/MiniappExitGesture.d.ts.map +1 -1
- package/build/services/MiniappExitGesture.js +1 -1
- package/build/services/MiniappExitGesture.js.map +1 -1
- package/build/services/MiniappWidgetMode.d.ts +4 -3
- package/build/services/MiniappWidgetMode.d.ts.map +1 -1
- package/build/services/MiniappWidgetMode.js +4 -3
- package/build/services/MiniappWidgetMode.js.map +1 -1
- package/build/stores/apps.d.ts.map +1 -1
- package/build/stores/apps.js +13 -11
- package/build/stores/apps.js.map +1 -1
- package/package.json +7 -7
- package/src/generated/releaseMetadata.ts +3 -3
- package/src/services/LocalMiniappRuntime.ts +9 -3
- package/src/services/MiniappExitGesture.ts +3 -1
- package/src/services/MiniappWidgetMode.ts +4 -3
- package/src/stores/apps.ts +12 -10
package/src/stores/apps.ts
CHANGED
|
@@ -256,6 +256,7 @@ function projectApps(previousState: AppStatusState, localApps: ClientApp[]): Cli
|
|
|
256
256
|
// across both passes.
|
|
257
257
|
foregrounded: app.packageName === previousState.foregroundedPackage,
|
|
258
258
|
paused: app.local && app.running && isMiniappsPaused(),
|
|
259
|
+
widgetOnly: !!app.local && app.running && miniappWidgetMode.isWidgetOnly(app.packageName),
|
|
259
260
|
}
|
|
260
261
|
const prev = previousByPackage.get(app.packageName)
|
|
261
262
|
return prev && shallowEqualApp(prev, next) ? prev : next
|
|
@@ -362,6 +363,11 @@ export const useAppStatusStore = create<AppStatusState>((set, get) => ({
|
|
|
362
363
|
return false
|
|
363
364
|
}
|
|
364
365
|
|
|
366
|
+
// An app running only for its widget is promoted before the host hook:
|
|
367
|
+
// the hook may foreground it, and setForeground sends a widget-only app
|
|
368
|
+
// back here.
|
|
369
|
+
if (app.widgetOnly) miniappWidgetMode.setWidgetOnly(packageName, false)
|
|
370
|
+
|
|
365
371
|
// Host navigation / open-animation seam. Runs on EVERY accepted open —
|
|
366
372
|
// including re-opening an already-running app — so the animation always
|
|
367
373
|
// plays (BuiltInMiniappCatalog.navigateForApp: overlay apps setForeground
|
|
@@ -374,13 +380,12 @@ export const useAppStatusStore = create<AppStatusState>((set, get) => ({
|
|
|
374
380
|
|
|
375
381
|
// If the tapped app is already running, this is a re-open: the nav/foreground
|
|
376
382
|
// above already drove the animation, and there's nothing to spawn. Short-
|
|
377
|
-
// circuit before the spawn pipeline.
|
|
378
|
-
//
|
|
383
|
+
// circuit before the spawn pipeline. A promoted app keeps its context but
|
|
384
|
+
// still takes the foreground below.
|
|
379
385
|
if (app.running && !app.widgetOnly) {
|
|
380
386
|
saveLastOpenTime(packageName)
|
|
381
387
|
return true
|
|
382
388
|
}
|
|
383
|
-
if (app.widgetOnly) miniappWidgetMode.setWidgetOnly(packageName, false)
|
|
384
389
|
|
|
385
390
|
// Only-one rules: one standard app in the foreground, one dashboard
|
|
386
391
|
// drawing the overlay. Starting another stops the one running. Widget-only
|
|
@@ -495,13 +500,10 @@ export const useAppStatusStore = create<AppStatusState>((set, get) => ({
|
|
|
495
500
|
apps: s.apps.map((a) => ({...a, foregrounded: a.packageName === packageName})),
|
|
496
501
|
}))
|
|
497
502
|
|
|
498
|
-
//
|
|
499
|
-
//
|
|
500
|
-
//
|
|
501
|
-
|
|
502
|
-
// if (!app.running) {
|
|
503
|
-
// get().start(app)
|
|
504
|
-
// }
|
|
503
|
+
// The wearer is in this app now: one running only for its widget becomes
|
|
504
|
+
// a normal run. start() promotes it, stops the standard peer and keeps the
|
|
505
|
+
// context. Fire-and-forget after the flag flip so it doesn't block paint.
|
|
506
|
+
if (app.running && app.widgetOnly) void get().start(app, {skipNavigation: true})
|
|
505
507
|
},
|
|
506
508
|
|
|
507
509
|
clearForeground: () => {
|