Fix BorderedLoader to pass theme to DynamicBorder

BorderedLoader receives theme as a parameter but was creating
DynamicBorder() without passing it, causing DynamicBorder to
fall back to the global theme variable which is undefined when
loaded via jiti (separate module cache).

Added doc comment to DynamicBorder explaining the jiti issue.
This commit is contained in:
Mario Zechner 2026-01-02 01:21:07 +01:00
parent 3ad5a168e7
commit af4c66117b
2 changed files with 10 additions and 7 deletions

View file

@ -8,7 +8,8 @@ export class BorderedLoader extends Container {
constructor(tui: TUI, theme: Theme, message: string) {
super();
this.addChild(new DynamicBorder());
const borderColor = (s: string) => theme.fg("border", s);
this.addChild(new DynamicBorder(borderColor));
this.loader = new CancellableLoader(
tui,
(s) => theme.fg("accent", s),
@ -19,7 +20,7 @@ export class BorderedLoader extends Container {
this.addChild(new Spacer(1));
this.addChild(new Text(theme.fg("muted", "esc cancel"), 1, 0));
this.addChild(new Spacer(1));
this.addChild(new DynamicBorder());
this.addChild(new DynamicBorder(borderColor));
}
get signal(): AbortSignal {