fix(pi-extension): guard status bar render when ui has no theme (#279)
syncStatus guarded setStatus but used theme.fg unguarded, so a Pi host exposing setStatus without a theme threw TypeError on session_start (and agent_start/agent_end/setMode). Require both before rendering. Add tests for the render path (previously untested) and the theme-absent degradation. Follow-up to #275 / #84.
This commit is contained in:
@@ -63,7 +63,7 @@ export default function ponytailExtension(pi) {
|
||||
function syncStatus(ctx) {
|
||||
if (ctx) lastCtx = ctx;
|
||||
const c = ctx || lastCtx;
|
||||
if (!c?.ui?.setStatus) return;
|
||||
if (!c?.ui?.setStatus || !c.ui.theme?.fg) return;
|
||||
const theme = c.ui.theme;
|
||||
if (currentMode === "off") {
|
||||
c.ui.setStatus("ponytail", "");
|
||||
|
||||
Reference in New Issue
Block a user