@wix/himalaya-cli 0.1441.0 → 0.1443.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.
Files changed (161) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-config.d.ts +30 -3
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/state/src/index.d.ts +7 -0
  3. package/dist/cli.mjs +627 -389
  4. package/dist/preview-assets.generated.bin +0 -0
  5. package/guides/hhp.md +4 -0
  6. package/guides/himi-json-output.md +1 -1
  7. package/guides/himi-test.md +3 -2
  8. package/guides/sdk-reference.json +1 -1
  9. package/package.json +2 -2
  10. package/templates/beauty-salon/tier5-src/_shared/collection-query.ts +32 -5
  11. package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +2 -1
  12. package/templates/beauty-salon-owner/tier5-src/_shared/collection-query.ts +32 -5
  13. package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +2 -1
  14. package/templates/beauty-salon-owner/tier5-src/_shared/owner-editor-value.ts +10 -0
  15. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-manage/index.ts +18 -3
  16. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-post/index.ts +2 -0
  17. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -4
  18. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-product/index.ts +2 -0
  19. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-product-form/index.ts +10 -4
  20. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-search/index.ts +11 -0
  21. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-search/logic.ts +35 -1
  22. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-service-form/index.ts +2 -1
  23. package/templates/branded-lite/tier5-src/_shared/collection-query.ts +32 -5
  24. package/templates/branded-lite/tier5-src/_shared/collection-service.ts +2 -1
  25. package/templates/community-club/tier5-src/_shared/collection-query.ts +32 -5
  26. package/templates/community-club/tier5-src/_shared/collection-service.ts +2 -1
  27. package/templates/community-club-owner/tier5-src/_shared/collection-query.ts +32 -5
  28. package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +2 -1
  29. package/templates/community-club-owner/tier5-src/_shared/owner-editor-value.ts +10 -0
  30. package/templates/community-club-owner/tier5-src/himi-owner-lite-event/index.ts +2 -0
  31. package/templates/community-club-owner/tier5-src/himi-owner-lite-event-form/index.ts +4 -1
  32. package/templates/community-club-owner/tier5-src/himi-owner-lite-manage/index.ts +18 -3
  33. package/templates/community-club-owner/tier5-src/himi-owner-lite-post/index.ts +2 -0
  34. package/templates/community-club-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -4
  35. package/templates/community-club-owner/tier5-src/himi-owner-lite-product/index.ts +2 -0
  36. package/templates/community-club-owner/tier5-src/himi-owner-lite-product-form/index.ts +10 -4
  37. package/templates/community-club-owner/tier5-src/himi-owner-lite-search/index.ts +11 -0
  38. package/templates/community-club-owner/tier5-src/himi-owner-lite-search/logic.ts +35 -1
  39. package/templates/events-meetups/tier5-src/_shared/collection-query.ts +32 -5
  40. package/templates/events-meetups/tier5-src/_shared/collection-service.ts +2 -1
  41. package/templates/events-meetups-owner/tier5-src/_shared/collection-query.ts +32 -5
  42. package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +2 -1
  43. package/templates/events-meetups-owner/tier5-src/_shared/owner-editor-value.ts +10 -0
  44. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-event/index.ts +2 -0
  45. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-event-form/index.ts +4 -1
  46. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-manage/index.ts +18 -3
  47. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-post/index.ts +2 -0
  48. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -4
  49. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-search/index.ts +11 -0
  50. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-search/logic.ts +35 -1
  51. package/templates/gym-fitness/tier5-src/_shared/collection-query.ts +32 -5
  52. package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +2 -1
  53. package/templates/gym-fitness-owner/tier5-src/_shared/collection-query.ts +32 -5
  54. package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +2 -1
  55. package/templates/gym-fitness-owner/tier5-src/_shared/owner-editor-value.ts +10 -0
  56. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-event/index.ts +2 -0
  57. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-event-form/index.ts +4 -1
  58. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-manage/index.ts +18 -3
  59. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-post/index.ts +2 -0
  60. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -4
  61. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-product/index.ts +2 -0
  62. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-product-form/index.ts +10 -4
  63. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-search/index.ts +11 -0
  64. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-search/logic.ts +35 -1
  65. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-service-form/index.ts +2 -1
  66. package/templates/nonprofit-cause/tier5-src/_shared/collection-query.ts +32 -5
  67. package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +2 -1
  68. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-query.ts +32 -5
  69. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +2 -1
  70. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-editor-value.ts +10 -0
  71. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-event/index.ts +2 -0
  72. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-event-form/index.ts +4 -1
  73. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-manage/index.ts +18 -3
  74. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-post/index.ts +2 -0
  75. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -4
  76. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-search/index.ts +11 -0
  77. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-search/logic.ts +35 -1
  78. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-service-form/index.ts +2 -1
  79. package/templates/owner-lite/dev/index.ts +8 -2
  80. package/templates/owner-lite/tier5-src/_shared/collection-query.ts +32 -5
  81. package/templates/owner-lite/tier5-src/_shared/collection-service.ts +2 -1
  82. package/templates/owner-lite/tier5-src/_shared/owner-editor-value.ts +10 -0
  83. package/templates/owner-lite/tier5-src/himi-owner-lite-event/index.ts +2 -0
  84. package/templates/owner-lite/tier5-src/himi-owner-lite-event-form/index.ts +4 -1
  85. package/templates/owner-lite/tier5-src/himi-owner-lite-faq-category-form/index.ts +5 -1
  86. package/templates/owner-lite/tier5-src/himi-owner-lite-faq-question-form/index.ts +9 -3
  87. package/templates/owner-lite/tier5-src/himi-owner-lite-manage/index.ts +18 -3
  88. package/templates/owner-lite/tier5-src/himi-owner-lite-post/index.ts +2 -0
  89. package/templates/owner-lite/tier5-src/himi-owner-lite-post-form/index.ts +10 -4
  90. package/templates/owner-lite/tier5-src/himi-owner-lite-product/index.ts +2 -0
  91. package/templates/owner-lite/tier5-src/himi-owner-lite-product-form/index.ts +10 -4
  92. package/templates/owner-lite/tier5-src/himi-owner-lite-search/index.ts +11 -0
  93. package/templates/owner-lite/tier5-src/himi-owner-lite-search/logic.ts +35 -1
  94. package/templates/owner-lite/tier5-src/himi-owner-lite-service-form/index.ts +2 -1
  95. package/templates/podcast-creator/tier5-src/_shared/collection-query.ts +32 -5
  96. package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +2 -1
  97. package/templates/podcast-creator-owner/tier5-src/_shared/collection-query.ts +32 -5
  98. package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +2 -1
  99. package/templates/podcast-creator-owner/tier5-src/_shared/owner-editor-value.ts +10 -0
  100. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-event/index.ts +2 -0
  101. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-event-form/index.ts +4 -1
  102. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-manage/index.ts +18 -3
  103. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-post/index.ts +2 -0
  104. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -4
  105. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-product/index.ts +2 -0
  106. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-product-form/index.ts +10 -4
  107. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-search/index.ts +11 -0
  108. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-search/logic.ts +35 -1
  109. package/templates/portfolio-creative/tier5-src/_shared/collection-query.ts +32 -5
  110. package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +2 -1
  111. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-query.ts +32 -5
  112. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +2 -1
  113. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-editor-value.ts +10 -0
  114. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-manage/index.ts +18 -3
  115. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-post/index.ts +2 -0
  116. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -4
  117. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-product/index.ts +2 -0
  118. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-product-form/index.ts +10 -4
  119. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-search/index.ts +11 -0
  120. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-search/logic.ts +35 -1
  121. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-service-form/index.ts +2 -1
  122. package/templates/restaurant/tier5-src/_shared/collection-query.ts +32 -5
  123. package/templates/restaurant/tier5-src/_shared/collection-service.ts +2 -1
  124. package/templates/restaurant-owner/tier5-src/_shared/collection-query.ts +32 -5
  125. package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +2 -1
  126. package/templates/restaurant-owner/tier5-src/_shared/owner-editor-value.ts +10 -0
  127. package/templates/restaurant-owner/tier5-src/himi-owner-lite-event/index.ts +2 -0
  128. package/templates/restaurant-owner/tier5-src/himi-owner-lite-event-form/index.ts +4 -1
  129. package/templates/restaurant-owner/tier5-src/himi-owner-lite-manage/index.ts +18 -3
  130. package/templates/restaurant-owner/tier5-src/himi-owner-lite-post/index.ts +2 -0
  131. package/templates/restaurant-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -4
  132. package/templates/restaurant-owner/tier5-src/himi-owner-lite-product/index.ts +2 -0
  133. package/templates/restaurant-owner/tier5-src/himi-owner-lite-product-form/index.ts +10 -4
  134. package/templates/restaurant-owner/tier5-src/himi-owner-lite-search/index.ts +11 -0
  135. package/templates/restaurant-owner/tier5-src/himi-owner-lite-search/logic.ts +35 -1
  136. package/templates/restaurant-owner/tier5-src/himi-owner-lite-service-form/index.ts +2 -1
  137. package/templates/retail-store/tier5-src/_shared/collection-query.ts +32 -5
  138. package/templates/retail-store/tier5-src/_shared/collection-service.ts +2 -1
  139. package/templates/retail-store-owner/tier5-src/_shared/collection-query.ts +32 -5
  140. package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +2 -1
  141. package/templates/retail-store-owner/tier5-src/_shared/owner-editor-value.ts +10 -0
  142. package/templates/retail-store-owner/tier5-src/himi-owner-lite-manage/index.ts +18 -3
  143. package/templates/retail-store-owner/tier5-src/himi-owner-lite-post/index.ts +2 -0
  144. package/templates/retail-store-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -4
  145. package/templates/retail-store-owner/tier5-src/himi-owner-lite-product/index.ts +2 -0
  146. package/templates/retail-store-owner/tier5-src/himi-owner-lite-product-form/index.ts +10 -4
  147. package/templates/retail-store-owner/tier5-src/himi-owner-lite-search/index.ts +11 -0
  148. package/templates/retail-store-owner/tier5-src/himi-owner-lite-search/logic.ts +35 -1
  149. package/templates/yoga-studio/tier5-src/_shared/collection-query.ts +32 -5
  150. package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +2 -1
  151. package/templates/yoga-studio-owner/tier5-src/_shared/collection-query.ts +32 -5
  152. package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +2 -1
  153. package/templates/yoga-studio-owner/tier5-src/_shared/owner-editor-value.ts +10 -0
  154. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-event/index.ts +2 -0
  155. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-event-form/index.ts +4 -1
  156. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-manage/index.ts +18 -3
  157. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-post/index.ts +2 -0
  158. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -4
  159. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-search/index.ts +11 -0
  160. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-search/logic.ts +35 -1
  161. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-service-form/index.ts +2 -1
@@ -4,7 +4,7 @@
4
4
  // screen (himiOwnerLitePost.publish). Bound by buildForm ($service:himiOwnerLitePostForm.*).
5
5
 
6
6
  import { postBodyText, plainPostBody, postCoverUrl } from "../_shared/owner-post-content.js";
7
- import { editorSubmitValue, queuedDocument, editorChanged, editorRunKeys, resetHydratedEditorOnOlderRuntime, editorAfterSave, liveState, settleOverLive } from "../_shared/owner-editor-value.js";
7
+ import { editorSubmitValue, queuedDocument, editorChanged, editorRunKeys, resetHydratedEditorOnOlderRuntime, editorAfterSave, liveState, settleOverLive, holdsLoadedForm } from "../_shared/owner-editor-value.js";
8
8
  import { ricosUploadService } from "@himalaya/wix-rich-content-editor";
9
9
  import { wixCall } from "@himalaya/wix-site-media";
10
10
  import { wixMediaUrl, WIX_DETAIL_IMAGE } from "../_shared/himi-store.js";
@@ -165,18 +165,24 @@ const svc = defineService<PostFormState, {
165
165
  bodyChanged: (s: PostFormState, arg?: unknown) => PostFormState;
166
166
  submit: (s: PostFormState, values?: Record<string, unknown>) => Promise<PostFormState>;
167
167
  }>("himiOwnerLitePostForm", {
168
- state: shape({ mode: startMode, id: initialInput.id ?? "", bodyPending: startMode === "edit" }),
168
+ // The editor stays hidden until this run's load lands, however the form was opened (an id as input or in the params).
169
+ state: shape({ mode: startMode, id: initialInput.id ?? "", bodyPending: true }),
169
170
  // [rico] #3644 — this run's editor state and UI: a cold boot takes these from `state`, never from
170
171
  // the persisted snapshot (the editor seeds once; last run's sheet is not this run's).
171
172
  notHydrated: [...editorRunKeys("body"), "detailsOpen"],
173
+ // perVisit: a cached embed's warm return starts this run fresh, as a cold boot does (`__resetRunState`).
174
+ perVisit: [...editorRunKeys("body"), "detailsOpen"],
172
175
  actions: {
173
176
  load: async (s, arg) => {
174
177
  stashCopy(arg); // absorb the descriptor's onAppear copy-pack param
175
178
  // WS-C — nav-param input is PRIMARY (the canonical create-or-edit shell
176
179
  // bakes no id/mode); the onAppear `id` param is the #570 suffixed-build
177
180
  // fallback. An id ⇒ edit; no id anywhere ⇒ the create shell.
178
- const id = navInputId() || idFrom(arg, s.id);
179
- if (!id) return shape({ ...s, ...BODY_LOADED, mode: "create", id: "", bodyJson: "", status: "idle", error: "", demoNote: isOwnerPreviewDemo() ? copyParam("ownerCommon.demoSaveNote", DEMO_SAVE_NOTE) : "" });
181
+ // The held id is for the host's bare refresh only (no argument): an onAppear without an id is a create screen.
182
+ const id = navInputId() || idFrom(arg, arg === undefined ? s.id : "");
183
+ if (holdsLoadedForm(s, { id, mode: id ? "edit" : "create" }, "body")) return s;
184
+ // A form that held a record (the one just saved) opens blank.
185
+ if (!id) return shape({ ...(s.id ? {} : s), ...BODY_LOADED, mode: "create", id: "", bodyJson: "", status: "idle", error: "", demoNote: isOwnerPreviewDemo() ? copyParam("ownerCommon.demoSaveNote", DEMO_SAVE_NOTE) : "" });
180
186
  if (isOwnerPreviewDemo()) {
181
187
  const d = DEMO_POSTS.find((x) => x.id === id);
182
188
  if (d) {
@@ -254,6 +254,8 @@ const IDLE: State = {
254
254
 
255
255
  /** Rebuilt on `load`, because the allowlist arrives with the descriptor. */
256
256
  let coordinator: ReturnType<typeof createGroupedSearch> | undefined;
257
+ /** The allowlist the coordinator was built for. */
258
+ let coordinatorSources = "";
257
259
  let published: State = IDLE;
258
260
  const memory = localPreferences("ownerSearch", normalizeMemory);
259
261
 
@@ -279,6 +281,15 @@ const svc = defineService<State, {
279
281
  actions: {
280
282
  load: async (_state, arg) => {
281
283
  stashCopy(arg);
284
+ // The screen coming back re-runs its search behind what it shows: a warm worker's refresh calls `load` bare (no allowlist),
285
+ // and its onAppear repeats the allowlist the coordinator was built for.
286
+ const sources = str(arg, "sources");
287
+ if (coordinator && (!sources || sources === coordinatorSources)) {
288
+ await coordinator.revalidate();
289
+ remember();
290
+ return published;
291
+ }
292
+ coordinatorSources = sources;
282
293
  const allowed = (() => {
283
294
  try {
284
295
  return JSON.parse(str(arg, "sources") || "[]");
@@ -446,7 +446,13 @@ export function createGroupedSearch(
446
446
  };
447
447
  };
448
448
 
449
- const emit = () => { if (!disposed) publish(snapshot()); };
449
+ /** The revalidation running behind the shown rows (0: none): its snapshots are held back until it is done. */
450
+ let holding = 0, holds = 0;
451
+ /** The depth the running revalidation restores, so one that overlaps it starts from the owner's depth, not
452
+ * from its reset; and the revalidation itself, which a "look further" tapped meanwhile waits for. */
453
+ let heldDepth: Record<string, number> = {};
454
+ let revalidation: Promise<void> | undefined;
455
+ const emit = () => { if (!disposed && !holding) publish(snapshot()); };
450
456
 
451
457
  /** Identity merge: a re-fetched row REPLACES its predecessor in place, so a
452
458
  * refresh cannot reorder the list under the user's finger or duplicate a row
@@ -604,6 +610,7 @@ export function createGroupedSearch(
604
610
  * the wrong result set. */
605
611
  async search(raw: unknown): Promise<void> {
606
612
  if (disposed) return;
613
+ holding = 0;
607
614
  const next = normalizeQuery(raw);
608
615
  query = next;
609
616
  for (const id of order) {
@@ -627,6 +634,7 @@ export function createGroupedSearch(
627
634
  */
628
635
  async restore(raw: unknown, depth: Record<string, number> = {}): Promise<void> {
629
636
  if (disposed) return;
637
+ holding = 0;
630
638
  const next = normalizeQuery(raw);
631
639
  query = next;
632
640
  for (const id of order) {
@@ -637,8 +645,34 @@ export function createGroupedSearch(
637
645
  if (!next) return;
638
646
  await fanOut(order, depth);
639
647
  },
648
+ /** A returning screen (a cached embed's warm worker): the same search re-run to the depth each group
649
+ * shows, behind the rows it shows, and published once. Rows are a live claim about records, so they
650
+ * are re-fetched, never repainted; a search typed meanwhile takes over at once. */
651
+ async revalidate(): Promise<void> {
652
+ if (disposed || !query) return;
653
+ const depth: Record<string, number> = holding ? { ...heldDepth } : {};
654
+ for (const id of order) { const pages = groups.get(id)?.pages ?? 0; if (pages > Math.max(1, depth[id] ?? 0)) depth[id] = pages; }
655
+ heldDepth = depth;
656
+ const held = ++holds;
657
+ holding = held;
658
+ for (const id of order) {
659
+ groups.set(id, idleGroup(byId.get(id)!));
660
+ sourceGeneration.set(id, (sourceGeneration.get(id) ?? 0) + 1);
661
+ }
662
+ const run = (async () => {
663
+ try {
664
+ await fanOut(order, depth);
665
+ } finally {
666
+ if (holding === held) { holding = 0; heldDepth = {}; emit(); }
667
+ }
668
+ })();
669
+ revalidation = run;
670
+ await run;
671
+ },
640
672
  /** One group's next page. */
641
673
  async loadMore(id: unknown): Promise<void> {
674
+ // Tapped while a revalidation re-fetches behind the shown rows: page on from what it lands.
675
+ while (holding && revalidation) await revalidation;
642
676
  const adapter = typeof id === "string" ? byId.get(id) : undefined;
643
677
  if (!adapter || disposed || !query) return;
644
678
  await runSource(adapter, true);
@@ -117,7 +117,8 @@ const svc = defineService<ServiceFormState, {
117
117
  stashCopy(arg); // absorb the descriptor's onAppear copy-pack param
118
118
  // WS-C — nav-param input is PRIMARY (the canonical form bakes no id); the
119
119
  // onAppear `id` param is the #570 suffixed-build fallback.
120
- const id = navInputId() || idFrom(arg, s.id);
120
+ // The held id is for the host's bare refresh only (no argument): an onAppear without an id is a create screen.
121
+ const id = navInputId() || idFrom(arg, arg === undefined ? s.id : "");
121
122
  if (!id) return shape({ ...s, status: "error", error: copyParam("ownerServiceForm.errorNoService", "No service to edit.") });
122
123
  if (isOwnerPreviewDemo()) {
123
124
  const d = DEMO_SERVICES.find((x) => x.id === id);