pi-ext
bugabingas pi extensions
owned by admin
chore: refresh Biome formatting
d57a1ef83e06b299ee936d296e07106bb3aa33f5
Oliver Krylow <o.krylow@isp-insoft.de> ·
SSH signature · not checked
Browse filesCompare with HEAD
Changed files (3)
2 - "$schema":
"https://biomejs.dev/schemas/2.5.11/schema.json",
2 + "$schema":
"https://biomejs.dev/schemas/2.5.12/schema.json",
extensions/ask/__tests__/harness.test.ts
Modified351 351 const questions
= __test.
normalizeQuestions([
354 - question:
"Which database should handle this unusually demanding workload?",
355 + "Which database should handle this unusually demanding workload?",
357 358 label:
"Postgres with replication (Recommended)",
375 376 const withInput
= session.
component()?.
render(
24)
?? [];
376 377 expect(withInput.
every((line)
=> visibleWidth(line)
<= 24)).
toBe(
true);
377 - expect(withInput.
filter((line)
=> line.
includes(
"free-form")
|| line.
includes(
"enough to wrap"))).
toHaveLength(
2);
380 + (line)
=> line.
includes(
"free-form")
|| line.
includes(
"enough to wrap"),
378 383 session.
component()?.
handleInput(
"\r");
379 384 await expect(flow).resolves.
toEqual({
380 385 status:
"answered",
381 - answers: { wrap: { answers: [
"A free-form answer long enough to wrap"] } },
387 + wrap: { answers: [
"A free-form answer long enough to wrap"] },
extensions/ask/ask-overlay.ts
Modified 3 3 import type { ExtensionContext, Theme }
from "@earendil-works/pi-coding-agent";
6 6 type KeybindingsManager,
11 10 type TuiMouseEventResult,
14 14 }
from "@earendil-works/pi-tui";
132 132 this.keybindings.
matches(data,
"tui.select.up")
|| 133 133 this.keybindings.
matches(data,
"tui.select.down")
136 - this.keybindings.
matches(data,
"tui.select.up")
? -1 : 1,
135 + this.list.
move(this.keybindings.
matches(data,
"tui.select.up")
? -1 : 1);
138 136 }
else if (this.keybindings.
matches(data,
"tui.select.confirm")) {
140 138 }
else if (this.keybindings.
matches(data,
"tui.input.tab")) {
150 148 handleMouse(
event: TuiMouseEvent): TuiMouseEventResult
| undefined {
152 - event.
y >= this.listRow
&& 153 - event.
y < this.listRow
+ this.listHeight
149 + if (
event.
y >= this.listRow
&& event.
y < this.listRow
+ this.listHeight) {
155 150 return this.list.
handleMouse(
156 151 localMouseEvent(
event, this.listRow, this.listHeight),
172 167 render(width: number): string[] {
174 - ...wrapStyled(this.theme.
fg(
"accent", this.theme.
bold(this.
title)), width),
170 + this.theme.
fg(
"accent", this.theme.
bold(this.
title)),
175 173 ...wrapStyled(this.theme.
fg(
"toolOutput", this.question.question), width),
190 - this.mode
=== "other" ? "Answer:" : "Notes:",
186 + this.theme.
fg(
"accent", this.mode
=== "other" ? "Answer:" : "Notes:"),
197 192 this.inputHeight
= inputLines.
length;
198 193 lines.
push(
...inputLines);
200 - lines.
push(
"",
...wrapStyled(this.theme.
fg(
"dim", this.
footerHint()), width));
197 + ...wrapStyled(this.theme.
fg(
"dim", this.
footerHint()), width),
385 383 :
`${cursor ? "›" : " "} `;
386 384 const labelStyle
= cursor
? "accent" : "toolOutput";
389 - this.theme.
fg(labelStyle, item.
label),
386 + ...wrapIndented(this.theme.
fg(labelStyle, item.
label), width, prefix),
394 388 if (item.
description) {
397 - this.theme.
fg(
"dim", item.
description),
390 + ...wrapIndented(this.theme.
fg(
"dim", item.
description), width,
" "),
403 393 this.itemRows.
push({ start, end: lines.
length });