GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(pi): submit custom answers that match the hidden option (#42670) · Pipyakas/t3code@2fbb071

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/provider-pi/src/server
    • adapter.test.ts
    • adapter.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/provider-pi/src/server/adapter.test.ts‎

Copy file name to clipboardExpand all lines: packages/provider-pi/src/server/adapter.test.ts
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5684,7 +5684,7 @@ describe("PiAdapterV2", () => {
56845684
});
56855685
// The extension reads a bare number sent as the select's value as that option.
56865686
yield* answerWithCustomText("ui-ask", "2");
5687-
yield* answerWithCustomText("ui-ask-parallel", "5");
5687+
yield* answerWithCustomText("ui-ask-parallel", "3. Type something.");
56885688
// Parallel dialogs can arrive before the follow-up input, including a multi-select of the
56895689
// same question, which the extension asks as an input with a non-empty placeholder.
56905690
const multiSelectTitle = `How many replicas?\n\n${lines.join("\n")}\n\nEnter the numbers of all that apply.`;
@@ -5715,7 +5715,7 @@ describe("PiAdapterV2", () => {
57155715
assert.equal((yield* takeWaitingRequest()).title, "Anything else?");
57165716
for (const [id, value] of [
57175717
["ui-custom", "2"],
5718-
["ui-custom-parallel", "5"],
5718+
["ui-custom-parallel", "3. Type something."],
57195719
]) {
57205720
yield* fake.emit({
57215721
type: "extension_ui_request",
@@ -5724,6 +5724,14 @@ describe("PiAdapterV2", () => {
57245724
title: followUpTitle,
57255725
placeholder: "",
57265726
});
5727+
const nextTitle = `Next question after ${id}?`;
5728+
yield* fake.emit({
5729+
type: "extension_ui_request",
5730+
id: `next-${id}`,
5731+
method: "input",
5732+
title: nextTitle,
5733+
});
5734+
assert.equal((yield* takeWaitingRequest()).questions[0]?.id, `next-${id}`);
57275735
const inputResponse = yield* fake.takeRequest("extension_ui_response");
57285736
assert.deepEqual({ id: inputResponse["id"], value: inputResponse["value"] }, { id, value });
57295737
}
Collapse file

‎packages/provider-pi/src/server/adapter.ts‎

Copy file name to clipboardExpand all lines: packages/provider-pi/src/server/adapter.ts
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ interface PendingPiPrompt {
425425
* picks the select's last "Type something." line and answers the input dialog that follows.
426426
*/
427427
interface PiCustomAnswerRoute {
428-
readonly lines: ReadonlyArray<unknown>;
428+
readonly optionLines: ReadonlyArray<unknown>;
429429
readonly sentinel: string;
430430
readonly followUpTitlePrefix: string;
431431
}
@@ -3838,7 +3838,7 @@ export const makePiAdapterV2 = Effect.fn("makePiAdapterV2")(function* (
38383838
route !== undefined &&
38393839
typeof response["value"] === "string" &&
38403840
response["value"].trim().length > 0 &&
3841-
!route.lines.includes(response["value"])
3841+
!route.optionLines.includes(response["value"])
38423842
) {
38433843
customAnswerFollowUps.set(route.followUpTitlePrefix, [
38443844
...(customAnswerFollowUps.get(route.followUpTitlePrefix) ?? []),
@@ -4822,6 +4822,7 @@ function piAskUserSingleSelectQuestion(
48224822
if (!options.every((option, index) => lines[index] === rpivOptionLine(option, index))) {
48234823
continue;
48244824
}
4825+
const optionLines = lines.slice(0, -1);
48254826
return {
48264827
question: {
48274828
id: questionId,
@@ -4838,9 +4839,9 @@ function piAskUserSingleSelectQuestion(
48384839
},
48394840
// The follow-up repeats the option lines; only its trailing instruction is localized.
48404841
customAnswerRoute: {
4841-
lines,
4842+
optionLines,
48424843
sentinel,
4843-
followUpTitlePrefix: `${prefix}${text}\n\n${lines.slice(0, -1).join("\n")}\n\n`,
4844+
followUpTitlePrefix: `${prefix}${text}\n\n${optionLines.join("\n")}\n\n`,
48444845
},
48454846
};
48464847
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.