@unoverse-platform/studio 0.1.36 → 0.1.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unoverse-platform/studio",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "type": "module",
5
5
  "description": "Unoverse Studio: the local authoring app. Reads your own rx/ folder, no backend.",
6
6
  "scripts": {
@@ -68,7 +68,15 @@ export function AppEngine(cfg: AppConfig) {
68
68
  const [def, setDef] = useState<UnoverseDefinition | null>(null);
69
69
  const lastWidthRef = useRef<string | undefined>(undefined);
70
70
  // Named app sizes resolve via the served theme (theme.appSize), like every token.
71
- const theme = useUnoverseTheme(client, def ? (def.org ? `${def.org}/light` : "light") : null);
71
+ // The theme's name is the template's org. When templateId already carries it
72
+ // ("org/name" — every production boot), start the theme read IMMEDIATELY, in
73
+ // parallel with the template read; waiting for the definition just to learn an org
74
+ // we were handed serialized two round trips for nothing. Bare ids (dev) still wait.
75
+ const orgFromId = templateId.includes("/") ? templateId.split("/")[0] : null;
76
+ const theme = useUnoverseTheme(
77
+ client,
78
+ orgFromId ? `${orgFromId}/light` : def ? (def.org ? `${def.org}/light` : "light") : null,
79
+ );
72
80
 
73
81
  // The app owns which workflow it runs — read it from its manifest (§4b), not from config.
74
82
  useEffect(() => {
@@ -119,6 +127,17 @@ export function AppEngine(cfg: AppConfig) {
119
127
  }, [surface, conversationId, userId, analyticsDebug]);
120
128
 
121
129
  useEffect(() => {
130
+ // A NEW APP RE-ANNOUNCES ITS WIDTH, ALWAYS. The native host keeps ONE iframe for every
131
+ // app (its srcdoc is keyed on the server, not the app — it just re-posts
132
+ // `unoverse:config` with a new templateId) and this engine is re-rendered in place, so
133
+ // the change-guard below outlives the switch — while the host RESETS its frame to the
134
+ // default on it (NativeAppHost/TemplatesView). Two apps of the same declared width is
135
+ // the ordinary case (one org, one `chat` size), and the incoming app then reported
136
+ // nothing: its frame sat at the host default (100%) while its core panel held its
137
+ // declared width, leaving a dead band beside it (observed live 2026-08-13,
138
+ // bpp-voice-layout). Clearing the guard here makes the first report after an app
139
+ // switch unconditional; the guard still suppresses repeats within one app.
140
+ lastWidthRef.current = undefined;
122
141
  const report = () => {
123
142
  // NAME-SYNC: width is computed off the ACTIVE layout (multi-layout templates
124
143
  // swap whole arrangements); single-layout defs resolve to their root.