Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/pages-editor/hooks/useChange

Cockpit client (features), next. Source: ui/client/features/pages-editor/hooks/useChange.tsx.

Type Aliases#

ChangeVerbId#

ChangeVerbId = "move" | "rename" | "extract" | "wrap" | "delete"

Defined in: ui/client/features/pages-editor/hooks/useChange.tsx:8

Variables#

CHANGE_VERBS#

const CHANGE_VERBS: object[]

Defined in: ui/client/features/pages-editor/hooks/useChange.tsx:15

's closed verb list — stable ids, never free text (docs/BLOCK-CONTRACT.md, "closed options"). Move/Rename run construct refactor move|rename (LLM-free, packages/core/plan.mjs's refactor.move/ refactor.rename); Extract, "Wrap in..." and Delete have no PLAN_FLOWS entry yet, so they are shown disabled rather than silently falling back to a model call.

Type Declaration#

available

available: boolean

id

id: ChangeVerbId

label

label: string

why?

optional why?: string

Functions#

useChange()#

useChange(feature, file, onImpactPreview?): object

Defined in: ui/client/features/pages-editor/hooks/useChange.tsx:25

Parameters#

feature

string

file

string

onImpactPreview?

(v) => void

Returns#

object

approve

approve: (onStarted) => Promise<void>

Parameters
onStarted

(processId) => void

Returns

Promise<void>

checked

checked: Record<string, boolean>

checkedCount

checkedCount: number

discard

discard: () => void

Returns

void

doPreview

doPreview: () => Promise<void>

Returns

Promise<void>

files

files: string[]

label

label: string

newName

newName: string

otherLayers

otherLayers: LayerInfo[]

preview

preview: RefactorPreview | null

previewStatus

previewStatus: Status

runError

runError: string | null

runStatus

runStatus: "done" | Status

setNewName

setNewName: Dispatch<SetStateAction<string>>

setToLayer

setToLayer: Dispatch<SetStateAction<string>>

setVerb

setVerb: Dispatch<SetStateAction<ChangeVerbId>>

toggleFile

toggleFile: (path) => void

Parameters
path

string

Returns

void

toLayer

toLayer: string

unit

unit: UnitLocation | null

verb

verb: ChangeVerbId