(label, kind, payload, opts)
| 238 | } |
| 239 | |
| 240 | function btn(label, kind, payload, opts) { |
| 241 | opts = opts || {}; |
| 242 | const cls = "btn" + (opts.primary ? " primary" : ""); |
| 243 | // While Autopilot runs, freeze manual actions so a stray click can't inject |
| 244 | // a competing prompt into the same session — except Stop and tab navigation. |
| 245 | const frozen = autopilotRunning && kind !== "autopilot_stop" && kind !== "autopilot_dismiss" && String(kind).indexOf("goto:") !== 0; |
| 246 | const dis = pending || frozen ? " disabled" : ""; |
| 247 | return ( |
| 248 | '<button class="' + cls + '" data-kind="' + esc(kind) + '" data-payload="' + |
| 249 | esc(JSON.stringify(payload || {})) + '"' + dis + ">" + esc(label) + "</button>" |
| 250 | ); |
| 251 | } |
| 252 | |
| 253 | // ---- tab renderers ------------------------------------------------------- |
| 254 |
no test coverage detected