mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-03 07:03:18 +00:00
addNewWorkspaceItem mounts a plugin field on the New workspace screen, and useNewWorkspace() exposes host, project, isolation, base ref, branch and metadata with commands that follow the composer item rules: they act on the screen's state when they run, resolve once applied, reject while the screen is locked, and take JSON payloads. Host and project are read-only because a command that switched them would unmount the item that called it. The screen's pickable state (base selection, manual isolation, branch, metadata) moves into one plain store so pickers and plugin commands write to the same place; the screen reports derived facts to it on each render. The branch is sent as source.branchName only for a branch-off worktree, and metadata on workspace.create. Items render through ComposerControl with a new "field" surface (badge on desktop, full-width field when compact). Combobox ships here: Paseo owns the loading and error states, keeps previous results, and drops superseded searches.
18 lines
865 B
Markdown
18 lines
865 B
Markdown
# New workspace issues
|
|
|
|
Install this directory as a plugin and open New workspace. An **Issue** field appears beside the
|
|
project, host, and branch pickers: a field on a phone, a badge on desktop.
|
|
|
|
Choosing an issue:
|
|
|
|
- Calls `newWorkspace.setBranch(issue.branch)`, so a worktree is created on that branch name.
|
|
- Calls `newWorkspace.setMetadata({ "new-workspace-issues.issue": issue.id })`, so the created
|
|
workspace carries the issue id.
|
|
|
|
`Combobox` runs `search` when the list opens and again as the user types. Paseo shows the loading
|
|
and error states and drops results that a newer search replaced. The server handler in
|
|
[server/issues.ts](server/issues.ts) filters a fixed list; a real plugin would call its tracker.
|
|
|
|
[client/issue-field.tsx](client/issue-field.tsx) is the field; [index.client.tsx](index.client.tsx)
|
|
registers it with `addNewWorkspaceItem`.
|