Skip to content

fix(pi): show an extension dialog's title once - #22463

Open
only21mil wants to merge 2 commits into
pingdotgg:mainfrom
only21mil:r10/h5-1
Open

only21mil wants to merge 2 commits into
pingdotgg:mainfrom
only21mil:r10/h5-1

Conversation

@only21mil

@only21mil only21mil commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A Pi extension that asks with ctx.ui.select(title, options) or ctx.ui.editor(title) shows the whole title twice in the pending question panel, once in the header row and again as the question. An input dialog without a placeholder does the same. A long or multi-line title, like the ones rpiv-ask-user-question sends, also fills the header row, runs past the card edge and leaves no room for the collapsed preview.

Pi's RPC select and editor requests carry only a title (plus options or prefill), with no message or placeholder. piQuestion set header: title and fell back to question = title, so both fields got the same text.

Change

When a Pi dialog has no message or placeholder, piQuestion now shows the title once, as the question, under the "Question" header that the Codex, Grok and Antigravity adapters already use when a question has no header of its own. An input dialog with a placeholder keeps its title as the header, as before. Answers are keyed by question id, so the responses sent to Pi do not change.

This covers the duplicated title in #17895. On current main the expanded question already keeps its line breaks (screenshots below), so this PR does not touch the renderers.

Scope and approval

Fixes the duplicated-title part of #17895, which has no maintainer triage yet. I'm submitting it as a very small, focused fix for an obvious bug. The panel showed the same text twice, and the issue's expected behavior is that the title appears once. The change touches only the line the issue's diagnosis names. It doesn't change any default, setting or answer sent to Pi. Prior PRs: none. No open or closed PR references #17895 or changes piQuestion.

Verification

  • Focused tests, from packages/provider-pi: vp test run src/server/adapter.test.ts -t "input dialog|empty select option|editor prefill". The existing select and editor tests now also assert the header and question, and a new test pins an input dialog with a placeholder. With main's adapter.ts, the two title-only cases fail because the header is the title, and the placeholder case passes. With this change all three pass.
  • Full packages/provider-pi suite: 127 of 127 pass. tsc-rs --noEmit exits 0. vp fmt --check passes on both files. vp lint exits 0 with main's existing unused layer warning.
  • Real Pi in the web app. I ran Pi 1.3.0 in RPC mode with one extension command, /merge-target, that calls ctx.ui.select with a five-line title and the options main and dev, plus a placeholder local model entry so T3 lists Pi as available. No model request is made. Pi sends {"method":"select","title":"Merge target\n\nWhich branch should this change merge into?\n\n...","options":["main","dev"]} with no message or placeholder. The T3 server and web dev server ran from source with a fresh state dir, once with main's adapter.ts and once with this branch, in Chrome 155 at 1920x1081. Each time I picked /merge-target from the composer menu, sent it and captured the panel as it opened, then clicked the header row to collapse it.

Main, panel open: the whole title is the header row, running past the card edge over the toggle icon, and it repeats as the question.

Main: the full title fills the header row and repeats as the question

This branch, panel open: the header reads "Question" and the title appears once, with its line breaks.

Branch: the header reads Question and the title appears once

Main, collapsed: the header row still holds the full title, so the preview has no room.

Main collapsed: the header row holds the full title

This branch, collapsed: "Question" followed by a truncated preview of the title.

Branch collapsed: Question followed by a truncated preview

This branch, after clicking main: the panel closes and the extension's own notice, "Merge target: main", shows that Pi received the answer.

Branch: after answering, the thread shows the extension's notice Merge target: main

Focused tests with main's adapter.ts, captured before #22557 deleted the bare input test: three failures, each with the title where "Question" was expected.

Focused tests on main: three header assertions fail

Focused tests on this branch, same earlier run: all four pass.

Focused tests on this branch: all four pass

Not checked:

  • Mobile. PendingUserInputCard renders the same header and question fields, so I expect the same result there, but I did not run a simulator or emulator.
  • Pi editor and bare input dialogs in the app. A unit test covers editor; bare input takes the same no-message, no-placeholder branch.
  • The rpiv-ask-user-question extension itself. The test extension sends the same request shape, a multi-line title with options.
  • The desktop app, Windows and macOS.

Production fix, tests, PR description and images written with Claude Opus 5.5 in T3 Code Nightly.

🤖 Generated with Claude Opus 5.5 in T3 Code Nightly

Pi's select and editor dialogs, and input dialogs without a placeholder,
carry only a title. piQuestion used that title as both the header and the
question, so the pending question panel showed it twice, and a long title
filled the header row too. Show the title once, as the question, under
the "Question" header other providers already use. Input dialogs with a
placeholder keep the title as the header.

Refs pingdotgg#17895

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Oct 20, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at eb2deca

Macroscope's review found this PR approvable — This narrowly fixes duplicated extension-dialog titles in the Pi provider by separating titles from messages/placeholders while preserving request and response behavior. Focused tests cover title-only dialogs and placeholder-based inputs.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6919386a-24bd-4a0b-a958-d9a3790fb21a
📥 Commits

Reviewing files that changed from the base of the PR and between eb2deca and f64f2b2.

📒 Files selected for processing: 1
  • packages/provider-pi/src/server/adapter.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The Pi adapter now maps dialog titles and detail text to generated question headers and question text. Tests verify the mapping for input, select, and editor dialogs.

Changes: Pi dialog question labels

Layer / File(s) Summary
Dialog question mapping
packages/provider-pi/src/server/adapter.ts, packages/provider-pi/src/server/adapter.test.ts
piQuestion uses the title as the header and the message or placeholder as the question when detail text is present. Otherwise, it uses "Question" as the header and the title as the question. Tests cover input, select, and editor dialogs.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to f64f2

The dialog-label change is consistent with its stated behavior and is ready to merge.

Architecture risk: 🔵 Low · up to f64f2

The change affects 1 system.

Changed systems: packages/provider-pi

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/provider-pi (library) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/provider-pi/src/server/adapter.ts: piQuestion now avoids repeating the title: dialog message or placeholder text becomes the question, the header uses the title, and dialogs without detail use "Question" as the header while retaining the title as the question.
  • observed — Modified behavior in packages/provider-pi/src/server/adapter.test.ts: Added a test asserting that an input dialog maps title to the question header and placeholder to the question text.
  • observed — Modified behavior in packages/provider-pi/src/server/adapter.test.ts: Updated the select-dialog test to expect the default "Question" header while retaining "Pick a tag" as the question text.
  • observed — Modified behavior in packages/provider-pi/src/server/adapter.test.ts: Updated the editor-dialog test to expect the default "Question" header.
Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preventing an extension dialog title from appearing twice in Pi dialogs.
Description check Passed The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the bug, implementation, testing, manual verification, limitations, and approval rationale…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the bug, implementation, testing, manual verification, limitations, and approval rationale.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant