refactor(tui): switch to global events and start passing workspace param (#21719)

This commit is contained in:
James Long
2026-04-10 10:47:27 -04:00
committed by GitHub
parent 44f38193c0
commit 42206da1f8
31 changed files with 850 additions and 246 deletions

View File

@@ -246,6 +246,7 @@ export namespace Worktree {
const boot = Effect.fnUntraced(function* (info: Info, startCommand?: string) {
const ctx = yield* InstanceState.context
const workspaceID = yield* InstanceState.workspaceID
const projectID = ctx.project.id
const extra = startCommand?.trim()
@@ -255,6 +256,8 @@ export namespace Worktree {
log.error("worktree checkout failed", { directory: info.directory, message })
GlobalBus.emit("event", {
directory: info.directory,
project: ctx.project.id,
workspace: workspaceID,
payload: { type: Event.Failed.type, properties: { message } },
})
return
@@ -272,6 +275,8 @@ export namespace Worktree {
log.error("worktree bootstrap failed", { directory: info.directory, message })
GlobalBus.emit("event", {
directory: info.directory,
project: ctx.project.id,
workspace: workspaceID,
payload: { type: Event.Failed.type, properties: { message } },
})
return false
@@ -281,6 +286,8 @@ export namespace Worktree {
GlobalBus.emit("event", {
directory: info.directory,
project: ctx.project.id,
workspace: workspaceID,
payload: {
type: Event.Ready.type,
properties: { name: info.name, branch: info.branch },