Closed general

workspace: per-tab args for repeated app tabs; honor header: hidden on apply and export

Colby Knox · 1mo ago ·closed by Colby Knox

Three findings from applying adom/drone-layout-dc-00 on Colby's container with adom-cli 0.7.0 (the bench: editor over two adom/mjpeg-stream-viewer tabs with different args.url, and adom/drone-rf on the right).

  1. Two tabs of the SAME app get the FIRST tab's args. The file has Cam .35 with args.url = http://192.168.0.35:3000/stream and Cam .34 with .34; after apply both tabs' URLs carried url=...0.34 (and both showed the same camera). Expected: the app is launched once (correct, one server), but each tab's context query is built from ITS OWN args. Please key materialization per tab, not per app ref.

  2. Only keys listed in the dock manifest's context.query are forwarded, which is right; the viewer's manifest now lists bare (0.1.2). Worth a hint when a tab's args carry a key the manifest does not declare (WORKSPACE_ARG_UNDECLARED: <key> is not in <app>'s context.query, dropped), so authors learn why an arg vanished.

  3. Header visibility as part of the bench. Colby's bench hides the webview address bars on every app pane. The wiki now accepts an optional per-tab "header": "hidden" | "shown" on app and webview tabs (default shown; validated and normalized; live on prod after the next tag). Please: apply sets the tab's header state after creating it (adom-cli hydrogen webview set-header --panel-id <leaf> true or panelState.headerHidden in the D2 tab map); export writes header: "hidden" for tabs whose live panelState.headerHidden is true (today export strips it as user state); --dry-run lists it. The reference file: adom/drone-layout-dc-00 hydrogen/workspace.json.

2 Replies

Colby Knox · 1mo ago

More evidence from the same bench (adom/drone-layout-dc-00, adom-cli 0.7.0), a second apply after Hydrogen Cloud had already created its placeholder tabs:

  • Finding 1 again, other direction: this time BOTH camera tabs carried the LAST tab's args (url=...0.35), so it is one context per app ref, whichever tab wins. Per-tab args please.
  • Merge mode added the three tabs into ONE existing pane (the left-bottom leaf) instead of the file's leaves: Cam .35 and Cam .34 are separate leaves in the file, and Drone RF Wall is the right-hand leaf, yet all three landed in the leaf that already held the cloud's "Cam .35 (not started)" placeholder, while the right pane kept its placeholder. Merge should still respect the file's pane structure for tabs it creates: create the tab in the leaf the file puts it in (splitting as needed), and only fall back to "some existing pane" when the tree shape cannot be matched.
  • --dry-run said placeholders: [] and listed only installs and launches; it did not say where each tab would go or that the cloud's placeholders would remain. Listing planned tab placements would have made both of the above visible before touching the layout.

Net effect on Colby's screen after the CLI run: one pane with both cams (same stream), placeholders left in the other two panes. I fixed the live layout by hand with move-tab, remove-tab and set-header.

Colby Knox · 1mo ago

Fixed in adom-cli 0.7.1 (GH v0.7.1, wiki package 4.3.1). Re-test ran on gallia against adom/drone-layout-dc-00 exactly as prescribed (teardown, then a plain apply), verified by reading the live workspace back:

  • Per-tab args: apply launches each app once and materializes a URL per tab from that tab's own args. Cam .35 landed on proxy/36371/?...url=http%3A%2F%2F192.168.0.35%3A3000%2Fstream and Cam .34 on ...192.168.0.34..., one adom/mjpeg-stream-viewer instance serving both. An arg not in the app's context.query is dropped with WORKSPACE_ARG_UNDECLARED.
  • Merge uses the tree walker: the live tree after the plain (merge) apply is split horizontal 0.333 [split vertical 0.654 [VS Code | split horizontal 0.5 [Cam .35 | Cam .34]] | Drone RF Wall]: editor top-left, cams side by side under it, RF wall alone on the right two thirds. Merge reuses existing tabs by name (navigate), which is also what fills a Hydrogen Cloud "(not started)" placeholder whose name matches the file's displayName; a leaf whose every tab was reused closes its placeholder pane.
  • header: "hidden": honored on apply and written by export (from panelState.headerHidden). All three app tabs read back headerHidden: true. Two notes: header state is applied after the whole tree is built, with read-back verification and retry, because a setHeaderHidden sent right after POST /tabs races Hydrogen's async tab creation; and the resolved /workspace route currently strips per-tab header, so ref-sourced applies overlay it from the raw file (server side filed as adom/wiki#204).
  • --dry-run prints placements: per-leaf paths with each tab's name, panel, and header state, plus the launch plan and (with --replace) the displaced tabs.

One environmental find during the re-test: the first drone-rf launch wedged (listening on 8130 but never answering HTTP), which surfaced as a correct "(not available)" placeholder with the launch-step reason; after clearing the wedged process the same apply came up clean. Closing.

Log in to reply.