Commit 4fde43e98e41

Vincent Demeester <vincent@sbr.pm>
2026-02-11 16:31:01
feat(org-todos): added borders to TODO blocks
Switched from Box to Container with DynamicBorder components. Provides subtle visual framing with borderMuted theme color.
1 parent 9a86043
Changed files (1)
dots
pi
agent
extensions
org-todos
dots/pi/agent/extensions/org-todos/index.ts
@@ -31,11 +31,12 @@
  */
 
 import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
+import { DynamicBorder } from "@mariozechner/pi-coding-agent";
 import { execSync } from "node:child_process";
 import { homedir } from "node:os";
 import { join } from "node:path";
 import * as chrono from "chrono-node";
-import { Box, Text } from "@mariozechner/pi-tui";
+import { Container, Text } from "@mariozechner/pi-tui";
 
 // Configuration
 const DEFAULT_ORG_FILE = join(homedir(), "desktop/org/todos.org");
@@ -279,10 +280,12 @@ export default function (pi: ExtensionAPI) {
       text = text.replace(/\[DONE\]/g, theme.bold(theme.fg("success", "[DONE]")));       // Green bold - completed
       text = text.replace(/\[CANX\]/g, theme.bold(theme.fg("error", "[CANX]")));         // Red bold - cancelled
       
-      // Wrap in Box with user message background for consistency
-      const box = new Box(1, 1, (t) => theme.bg("userMessageBg", t));
-      box.addChild(new Text(text, 0, 0));
-      return box;
+      // Wrap in Container with borders for visual separation
+      const container = new Container();
+      container.addChild(new DynamicBorder((s: string) => theme.fg("borderMuted", s)));
+      container.addChild(new Text(text, 1, 1));  // Add padding
+      container.addChild(new DynamicBorder((s: string) => theme.fg("borderMuted", s)));
+      return container;
     });
   }