Skip to content

feat(ai): add live preview choices and fix question, plan and usage flows - #3268

Merged
abose merged 8 commits into
mainfrom
ai
Oct 9, 2026
Merged

abose merged 8 commits into
mainfrom
ai

Conversation

@abose

@abose abose commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Visual choices can now be previewed on the current page, answered reliably, and applied to source without leaving temporary effects behind. This PR also fixes pending-question and plan handling, prices Codex usage by the reported service tier, and includes the matching Pro UI and usage-calendar fixes.

Changes

  • Extend askInLivePreview with structured choices, reusable HTML/CSS/JS assets, per-choice parameters and explicit cleanup/reload behavior. Document shared hover/click handling, scoped runtime hooks, and separate Pin & try / Choose controls. Add localized preview status and pending-question messages.
  • Preserve composer drafts while an answer is required. Follow both per-question and whole-query SDK cancellation, ignore stale confirmation IDs, and leave chat-question timeout policy to the SDK.
  • Delegate Auto file permissions to the SDK, including outside-project writes; retain the outside-project confirmation in AI Edit Mode. Synchronize mode changes with the active query before file operations. Report successful internal plan saves separately from real write errors so Pro can show consistent feedback, Reject and Auto approval.
  • Normalize Codex's per-response tier and estimate API-equivalent costs using validated model, tier and long-context rates. Lazily prepare cached prices on the first cost calculation, share concurrent loads, and retain working prices after failures. Leave Claude-reported costs and historical usage unchanged.
  • Require source consumption after editorDocs discovery. Fix the permission fixture's missing pricing dependency and give the Markdown splash test an explicit document instead of depending on lightbox cleanup.
  • Pin Pro to fe635413d0e32b2b4de3fb91ff9d7fa96f18d044, including the floating question renderer, selected-element visual guidance, usage-calendar rollover and tooltip placement fixes.

Verification

Coverage Recorded local result
Permissions / plan review / chat questions 35 / 21 / 18 passing cases on each of Linux, macOS and Windows
CLI connector / pricing cache / connector peers / usage ledger 57 / 16 / 33 / 37 passing cases on each native platform
Latest usage calendar 26 passing cases on each native platform
Live Preview choices / legacy questions / question reminder / Ask AI dialog 34 / 32 / 6 / 42 passing cases on Linux and macOS
Selected-element context / send / CLI composer 10 / 13 / 17 passing cases on Linux
Full unit category during CI-fix verification Linux 3,115; Windows 3,112 passing cases
Chromium Live Preview CI command 334 passing cases at the earlier question-suite snapshot; not a run of the final expanded suite

Real Haiku and Sonnet runs verify temporary previews, selection, restoration and reusable assets. The user's exact selected-section prompt opens three in-page choices in 12.073 seconds with the final attachment guidance. A live Codex session reported Standard, Fast and Ultrafast on consecutive responses; sample-tier chart totals matched expected costs. SDK-owned question expiry was also observed. Lint, whitespace, commit hooks and the Pro pin check passed.

For pushed core head f38f24e96, CI is still running and currently includes failed Chromium Windows production, Linux desktop production and Mac M1 desktop production jobs. These new failures have not been diagnosed by this PR-description update. Final Windows/browser verification of the expanded question renderer remains outstanding; earlier local passes do not imply current-head CI completion. The intermittent Recent Projects timeout also remains unconfirmed.

Integration and limits

Companion UI: phoenix-pro#283. Question findings and measurements distinguish passing behavior from model-design limitations, including Haiku sometimes omitting the suggested Pin & try control.

Pricing refresh uses the separately deployed Accounts GET /external-model-pricing endpoint (login-service 7d1ef3c), with bundled/cached fallback. Estimates use API rates, not subscription charges; older Codex responses without tier metadata retain the Standard estimate. The maintainer has configured a Codex Web reminder for pricing changes; catalog updates remain manual.

abose added 2 commits October 9, 2026 13:54
Add the reminder's localized heading, explanatory text and actions. Style
the amber banner with consistent padding, aligned close and Show question
buttons, and wrapping for narrow panels. Escape grid spans so the LESS
compiler preserves their placement.

Advance the Phoenix Pro pin to d9550d3 for the matching composer guard,
question lifecycle handling and registered integration tests.

Verification: 14 question composer, 19 composer focus and 13 Live Preview
send checks pass on each of Linux, macOS and Windows (138 total). LESS
build and targeted lint pass; the real Haiku flow is verified in the app.
Observe the AskUserQuestion hook's cancellation signal as well as the query
signal, and notify the panel when that specific answer wait ends. Ignore
explicit stale confirmation IDs instead of answering another pending card.
Leave timeout policy and durations entirely to the Claude SDK.

Clarify that the documentation locator must be followed by reading its source;
the preference registry can supplement an explicitly requested docs lookup.
Advance the Pro pin for matching question cleanup, tests and task tracking.

Validation: 18 question composer integration specs pass on each of macOS,
Windows and Linux; TD-3 passes with real Haiku 5.5; targeted ESLint and diff
checks pass. The user approved committing with the natural SDK timeout
observation still pending.
@abose abose changed the title feat(ai): style pending-question composer reminders feat(ai): guide pending questions and follow SDK cancellation Oct 9, 2026
abose added 3 commits October 9, 2026 15:28
Let the SDK decide Auto Edit and Write permissions, including paths outside
the project. Keep Phoenix's outside-project confirmation in AI Edit Mode,
and limit explicit Plan-write approval to the approved call.

Apply runtime permission changes to the active streaming SDK query. Order
mode changes, wait before file operations, and cancel safely on update
failure or timeout. Reassert the selected mode after leaving Plan Mode.

Mark internal plan writes as handled only after saving succeeds, so Pro can
remove misleading rejection cards without hiding real filesystem errors.
Add the Reject label and matching plan-action styles for Pro 9a0063e.

Register 35 isolated Node-backed Jasmine cases for permission decisions,
mode changes, failures and structured plan results using the shared runner.

Validation: all 35 cases pass on native Linux, macOS and Windows. Combined
with Plan Review and Question Composer, 222 focused checks pass. Earlier
full unit runs passed on all three platforms; final real Auto/Edit/Plan
prompts, lint, LESS builds and whitespace checks pass.
Pin Phoenix Pro to 9a0063e so builds include the matching plan review
controls, unconditional Auto approval and structured plan-save handling.

Validation: tracking JSON parses and the pin matches Pro HEAD. The paired
core and Pro changes passed 74 focused checks on each of Linux, macOS and
Windows, plus the recorded live plan and permission flows.
Read the service tier from each completed Codex response and estimate cost
from a validated catalog with explicit model, tier and long-context rates.
Keep bundled prices as the fallback and reject unsupported or stale
catalogs without changing active prices or recalculating saved usage.

Prepare cached prices on first use with a bounded wait and retry after
failure. Share concurrent preparation, preserve usage deduplication, and
leave provider-reported costs and zero-token events independent of loading.

Advance the Pro pin for matching lazy file caching, tier usage names and
chart coverage.

Validation: 57 CLI connector, 16 pricing-cache and 33 connector-peer cases
pass on each native platform. Ledger and calendar suites also pass on
Linux, macOS and Windows. Changed-file lint and whitespace checks pass.
@abose abose changed the title feat(ai): guide pending questions and follow SDK cancellation feat(ai): fix question and plan handling and price CLI service tiers Oct 9, 2026
Extend askInLivePreview with structured choices, reusable CSS and script
files, per-choice parameters and explicit reload-on-cleanup behavior.
Document scoped page hooks, interactive pin-and-choose controls and the
shared preview lifecycle. Update model guidance and localized question
status messages for the matching Pro implementation.

Fix the permission-test fixture's missing pricing dependency and give the
Markdown splash test its own document instead of depending on the file
left by lightbox cleanup. Advance the Pro pin to include the question
renderer, shared floating controls, usage rollover and tooltip fixes.

Validation: recorded Linux/macOS question suites pass 34/32/6/42 cases;
Linux guidance suites pass 10/13/17. Permission cases pass 35 on macOS and
Windows, with full unit runs of 3115 on Linux and 3112 on Windows. The
Chromium Live Preview CI command passes 334 cases at the earlier question
suite snapshot. Latest Windows/browser question coverage remains pending.
Changed-file lint, whitespace checks and Pro pin consistency pass.
@abose abose changed the title feat(ai): fix question and plan handling and price CLI service tiers feat(ai): add live preview choices and fix question, plan and usage flows Oct 9, 2026
abose added 2 commits October 9, 2026 22:47
Pin Phoenix Pro to 1c46aac, which replaces optional chaining in the Live
Preview question code that the release build's terser 3.17 cannot parse.
This fixes the releaseProd failure in makeJSDist on brackets-min.js.

Validation: tracking JSON parses and the pin matches Pro HEAD.
@abose
abose merged commit a1ee375 into main Oct 9, 2026
17 of 18 checks passed
@abose
abose deleted the ai branch October 9, 2026 18:53
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant