repositories / pi-ext

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)

biome.json

Modified
2 - "$schema": "https://biomejs.dev/schemas/2.5.11/schema.json",
2 + "$schema": "https://biomejs.dev/schemas/2.5.12/schema.json",
3 3 "files": {
4 4 "includes": [
5 5 "**/*.ts",

extensions/ask/__tests__/harness.test.ts

Modified
351 351 const questions = __test.normalizeQuestions([
353 353 id: "wrap",
354 - question: "Which database should handle this unusually demanding workload?",
354 + question:
355 + "Which database should handle this unusually demanding workload?",
355 356 options: [
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);
378 + expect(
379 + withInput.filter(
380 + (line) => line.includes("free-form") || line.includes("enough to wrap"),
381 + ),
382 + ).toHaveLength(2);
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"] } },
386 + answers: {
387 + wrap: { answers: ["A free-form answer long enough to wrap"] },
388 + },

extensions/ask/ask-overlay.ts

Modified
3 3 import type { ExtensionContext, Theme } from "@earendil-works/pi-coding-agent";
4 4 import {
5 5 Editor,
6 6 type KeybindingsManager,
7 7 type SelectItem,
8 - truncateToWidth,
9 8 type TUI,
10 9 type TuiMouseEvent,
11 10 type TuiMouseEventResult,
11 + truncateToWidth,
12 12 visibleWidth,
13 13 wrapTextWithAnsi,
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")
135 - this.list.move(
136 - this.keybindings.matches(data, "tui.select.up") ? -1 : 1,
137 - );
135 + this.list.move(this.keybindings.matches(data, "tui.select.up") ? -1 : 1);
138 136 } else if (this.keybindings.matches(data, "tui.select.confirm")) {
139 137 this.confirm();
140 138 } else if (this.keybindings.matches(data, "tui.input.tab")) {
150 148 handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined {
151 - if (
152 - event.y >= this.listRow &&
153 - event.y < this.listRow + this.listHeight
154 - ) {
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[] {
173 168 const lines = [
174 - ...wrapStyled(this.theme.fg("accent", this.theme.bold(this.title)), width),
169 + ...wrapStyled(
170 + this.theme.fg("accent", this.theme.bold(this.title)),
171 + width,
172 + ),
175 173 ...wrapStyled(this.theme.fg("toolOutput", this.question.question), width),
185 183 lines.push(
187 185 ...wrapStyled(
188 - this.theme.fg(
189 - "accent",
190 - this.mode === "other" ? "Answer:" : "Notes:",
191 - ),
186 + this.theme.fg("accent", this.mode === "other" ? "Answer:" : "Notes:"),
192 187 width,
197 192 this.inputHeight = inputLines.length;
198 193 lines.push(...inputLines);
200 - lines.push("", ...wrapStyled(this.theme.fg("dim", this.footerHint()), width));
195 + lines.push(
196 + "",
197 + ...wrapStyled(this.theme.fg("dim", this.footerHint()), width),
198 + );
201 199 return lines;
385 383 : `${cursor ? "›" : " "} `;
386 384 const labelStyle = cursor ? "accent" : "toolOutput";
387 385 lines.push(
388 - ...wrapIndented(
389 - this.theme.fg(labelStyle, item.label),
390 - width,
391 - prefix,
392 - ),
386 + ...wrapIndented(this.theme.fg(labelStyle, item.label), width, prefix),
394 388 if (item.description) {
395 389 lines.push(
396 - ...wrapIndented(
397 - this.theme.fg("dim", item.description),
398 - width,
399 - " ",
400 - ),
390 + ...wrapIndented(this.theme.fg("dim", item.description), width, " "),
403 393 this.itemRows.push({ start, end: lines.length });