@bakers-build/addon-bakers-ui 0.11.1-next.6 → 0.11.1-next.8

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.
@@ -26,8 +26,7 @@ export declare class WorkspacePickerScreen extends AsyncModalScreen<WorkspaceOpt
26
26
  protected actions(): import("../../../Component/footer-actions/index.js").ActionItem[];
27
27
  handleInput(input: string, context: ScreenContext): boolean;
28
28
  activate(index: number, context: ScreenContext): boolean;
29
- /** Write the selection, then restart — the two steps a manual edit and a
30
- * cockpit switch share, ending in the SAME re-exec `bakers ui` took to boot. */
29
+ /** Restart scoped to the picked workspace; nothing is persisted. */
31
30
  private commit;
32
31
  select(index: number, context: ScreenContext): boolean;
33
32
  reset(): void;
@@ -4,12 +4,11 @@
4
4
  // short, dismissable action from wherever the operator already is, not a
5
5
  // destination of its own.
6
6
  //
7
- // The switch does three things, in order, on Enter: (1) refuse silently when
8
- // the choice is already active — a write and a restart over "the same" would
9
- // be a no-op with side effects; (2) ask the command owner to persist the
10
- // selection through the conductor config contract; (3) re-execute
11
- // this process via the seam `ui/src/bun-runtime.ts` exposes, so any conductor
12
- // reading the SAME config file re-binds on its next read.
7
+ // The switch does two things on Enter: (1) refuse when the choice is already
8
+ // active — a restart over "the same" would be a no-op with side effects;
9
+ // (2) re-execute `bakers ui` scoped to the picked workspace for that session
10
+ // only. It writes no configuration file: a pin that contradicts the
11
+ // committed project would stop the next start.
13
12
  import { actionItem } from '../../../Component/footer-actions/index.js';
14
13
  import { lineText, } from '../../../Component/section-list/index.js';
15
14
  import { AsyncModalScreen } from '../../../Screen/async-modal-screen.js';
@@ -123,29 +122,19 @@ export class WorkspacePickerScreen extends AsyncModalScreen {
123
122
  context.requestDraw();
124
123
  return true;
125
124
  }
126
- void this.commit(picked, context);
125
+ this.commit(picked, context);
127
126
  return true;
128
127
  }
129
- /** Write the selection, then restart — the two steps a manual edit and a
130
- * cockpit switch share, ending in the SAME re-exec `bakers ui` took to boot. */
131
- async commit(picked, context) {
132
- const selectWorkspace = context.services?.selectWorkspace;
128
+ /** Restart scoped to the picked workspace; nothing is persisted. */
129
+ commit(picked, context) {
133
130
  const restart = context.services?.restartProcess;
134
- if (!selectWorkspace || !restart) {
131
+ if (!restart) {
135
132
  this.lastMessage =
136
133
  'Cannot switch here: no project .bakers directory was resolved.';
137
134
  context.requestDraw();
138
135
  return;
139
136
  }
140
- try {
141
- await selectWorkspace(picked.name);
142
- }
143
- catch (error) {
144
- this.lastMessage = error instanceof Error ? error.message : String(error);
145
- context.requestDraw();
146
- return;
147
- }
148
- restart();
137
+ restart(picked.name);
149
138
  }
150
139
  select(index, context) {
151
140
  if (index < 0 || index >= this.candidates.length)
@@ -41,10 +41,13 @@ export async function runTicketTui(_document, _context, services, options = {})
41
41
  ? { conductorProcess: options.conductorProcess }
42
42
  : {}),
43
43
  ...(options.restartProcess
44
- ? { restartProcess: options.restartProcess }
45
- : {}),
46
- ...(options.selectWorkspace
47
- ? { selectWorkspace: options.selectWorkspace }
44
+ ? {
45
+ // Tear down first, so the child draws on a restored terminal.
46
+ restartProcess: (workspace) => {
47
+ finish();
48
+ options.restartProcess?.(workspace);
49
+ },
50
+ }
48
51
  : {}),
49
52
  ...(options.workspace !== undefined
50
53
  ? { workspace: options.workspace }
@@ -57,10 +57,9 @@ export interface BbUiLauncherOptions {
57
57
  /** BB-472 — the loaded connection config's absolute path, so the
58
58
  * workspace-picker screen can find `workspace_id`'s owning file. */
59
59
  configPath?: string | undefined;
60
- /** BB-472 — re-executes this process; the picker calls it after writing a
61
- * new workspace selection. Injected from `ui/src/bun-runtime.ts`. */
62
- restartProcess?: (() => void) | undefined;
63
- selectWorkspace?: ((name: string) => Promise<void>) | undefined;
60
+ /** BB-472 — re-executes this process scoped to the picked workspace; nothing
61
+ * is written. Injected from `ui/src/bun-runtime.ts`. */
62
+ restartProcess?: ((workspace: string) => void) | undefined;
64
63
  /** The connection's current user (uuid or name) — My work's "me". */
65
64
  currentUser?: string | undefined;
66
65
  /** Injected dropsh `buildProgram` (the entry passes dropsh's real one). */
@@ -29,9 +29,6 @@ export async function runBbUi(opts) {
29
29
  ...(opts.restartProcess !== undefined
30
30
  ? { restartProcess: opts.restartProcess }
31
31
  : {}),
32
- ...(opts.selectWorkspace !== undefined
33
- ? { selectWorkspace: opts.selectWorkspace }
34
- : {}),
35
32
  ...(opts.currentUser !== undefined
36
33
  ? { currentUser: opts.currentUser }
37
34
  : {}),
@@ -105,13 +105,11 @@ export interface RendererServices {
105
105
  /**
106
106
  * BB-472 — re-execute this process, injected from `ui/src/bun-runtime.ts`'s
107
107
  * `reExecUnderBun` by the conductor entry. The workspace-picker screen calls
108
- * it AFTER writing a new selection to the owning config, so a conductor
109
- * reading the same file picks up the write on its next read; absent ⇒ the
110
- * picker can write but not restart (e.g. under an injected test renderer).
108
+ * it with the picked name; the new process is scoped to that workspace for
109
+ * its session and no config file is written. Absent ⇒ the picker cannot
110
+ * switch.
111
111
  */
112
- restartProcess?: () => void;
113
- /** Persist a product-workspace name through the command owner's config contract. */
114
- selectWorkspace?: (name: string) => Promise<void>;
112
+ restartProcess?: (workspace: string) => void;
115
113
  /** BB-472 — the active workspace's uuid, unresolved name form. See
116
114
  * `TuiOptions.workspaceId`. */
117
115
  workspaceId?: string;
@@ -258,7 +256,6 @@ export interface TuiOptions {
258
256
  /** BB-472 — the RESOLVED workspace name the plugin's `run()` produced,
259
257
  * passed to the chrome verbatim. Absent ⇒ no workspace suffix. */
260
258
  workspace?: string | undefined;
261
- selectWorkspace?: ((name: string) => Promise<void>) | undefined;
262
259
  /** BB-472 — see `RendererServices.configPath`. */
263
260
  configPath?: string | undefined;
264
261
  currentUser?: string;
@@ -281,10 +278,10 @@ export interface TuiOptions {
281
278
  */
282
279
  conductorProcess?: ConductorProcessHost | undefined;
283
280
  /**
284
- * BB-472 — the re-exec seam the workspace-picker screen calls after
285
- * writing a new selection. See `RendererServices.restartProcess`.
281
+ * BB-472 — the re-exec seam the workspace-picker screen calls with the
282
+ * picked workspace name. See `RendererServices.restartProcess`.
286
283
  */
287
- restartProcess?: (() => void) | undefined;
284
+ restartProcess?: ((workspace: string) => void) | undefined;
288
285
  /** BB-257 R2: the parent picker's debounce, injectable for the tests.
289
286
  * Absent ⇒ a real `setTimeout`. */
290
287
  debounce?: Debounce | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakers-build/addon-bakers-ui",
3
- "version": "0.11.1-next.6",
3
+ "version": "0.11.1-next.8",
4
4
  "description": "bakers.build TUI: interactive terminal UI (dashboard, projects, tickets) as a dropsh `tui` renderer plugin.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -32,11 +32,11 @@
32
32
  "zustand": "^5.0.15"
33
33
  },
34
34
  "peerDependencies": {
35
- "@bakers-build/core": "^0.11.1-next.6",
36
- "@bakers-build/message": "^0.11.1-next.6"
35
+ "@bakers-build/core": "^0.11.1-next.8",
36
+ "@bakers-build/message": "^0.11.1-next.8"
37
37
  },
38
38
  "bakersBuild": {
39
- "commit": "897a16650fe7d61c4aec20c39915d51eaaf1f4e5",
39
+ "commit": "8807d1cd2569de7e4555aa0485037cec48ad1d1e",
40
40
  "channel": "next"
41
41
  }
42
42
  }