Plugin docks are nodes
· 2 min read
A plugin's dock is a subtree the editor makes for it. draw(S, k, host) is
handed its path, and S.kit fills it with rows instead of drawing them.

What a plugin is handed
hostnames four places:headfor verbs,sidefor pages,bodyfor rows andfoot. Each is a node, from one scene fragment per dock.strip(S, host, name, controls)puts a row of controls on one of them, androws(S, host, name, specs)puts rows on the body.node(host, name)answers the node itself, for a plugin adding a shape the kit has no verb for.- A control is the
widgettable the editor's own rows are built from, plus anonthe editor calls with what the reader changed.
pub fn draw(S, k, host) {
let field = S.kit.field;
let rows = S.kit.rows;
rows(S, host, "body", [
field(S, "token", "abcd1234efgh5678", #{ mask: true, copy: true }),
]);
}
What that buys
- A plugin's controls are widget nodes, so a theme role dresses them and the same layout places them.
- A plugin cannot draw outside its dock. The host is its subtree, and no
uihandle reaches past it. kit.rnwent from 49ui::*calls to 1.counter.rn,userdata.rnand the Gamend dock are all on it.
The verbs
section(title)andempty(text)answer a row.field(S, label, value, opts)masks withmaskand copies withcopy.tree(S, id, value, opts)answers rows for a map or a list, andeditmakes its leaves fields.files(S, id, opts)answers a row per file under a folder; TOML and JSON open as editable trees.tabs(S, host, id, names)andpages(S, host, id, groups)fill the head or the sidebar, and answer which one is open.
A floating window still draws. windows takes draw(S, k) and the ui
verbs, because a window has no node of its own yet.
