diff --git a/.changeset/ask-user-question-forms.md b/.changeset/ask-user-question-forms.md index d59a062..e727851 100644 --- a/.changeset/ask-user-question-forms.md +++ b/.changeset/ask-user-question-forms.md @@ -2,4 +2,4 @@ "@jmfederico/pi-web": patch --- -Add an `ask_user` session tool that lets agents post structured question sets as one chat-native browser form. The form uses the transcript's single scroll area, keeps its header visible, and always gives every question a Custom free-text answer. Agents end their run while the form waits; users can submit full or partial answers, unanswered questions are reported explicitly, pending forms survive browser and web/API reconnects, and closed forms remain readable in the transcript. Disable the tool from **Settings → Session daemon**, with `askUser: false`, or with `PI_WEB_ASK_USER=false`. +Add an `ask_user` session tool that lets agents post structured question sets as one chat-native browser form. The form uses the transcript's single scroll area, keeps its header visible, and always gives every question a Custom free-text answer with mobile-safe text sizing. Agents end their run while the form waits; users can submit full or partial answers, unanswered questions are reported explicitly, pending forms survive browser and web/API reconnects, and closed forms remain readable in the transcript. Disable the tool from **Settings → Session daemon**, with `askUser: false`, or with `PI_WEB_ASK_USER=false`. diff --git a/src/client/src/components/AskUserCard.test.ts b/src/client/src/components/AskUserCard.test.ts index 8c349b0..31a3f3b 100644 --- a/src/client/src/components/AskUserCard.test.ts +++ b/src/client/src/components/AskUserCard.test.ts @@ -82,6 +82,7 @@ describe("ask-user-card live form", () => { const textarea = requiredElement(root.querySelector("textarea"), "custom textarea"); const label = requiredElement(textarea.closest("label"), "custom label"); expect(label.textContent).toContain("Custom answer"); + expect(getComputedStyle(textarea).fontSize).toBe("16px"); expect(root.activeElement).toBe(textarea); textarea.value = "Svelte"; diff --git a/src/client/src/components/AskUserCard.ts b/src/client/src/components/AskUserCard.ts index b77f190..599123f 100644 --- a/src/client/src/components/AskUserCard.ts +++ b/src/client/src/components/AskUserCard.ts @@ -492,8 +492,7 @@ export class AskUserCard extends LitElement { background: var(--pi-bg); color: var(--pi-text); padding: 8px; - font: inherit; - line-height: 1.4; + font: var(--pi-control-font-size, 16px)/1.4 var(--pi-control-font-family, system-ui, sans-serif); } .form-footer { display: flex;