Repository navigation
fix(frontend): name instance types and price change in RI exchange - #1363
Merged
Merged
Conversation
…e approve and quote The Execute confirm already names instance types and the hourly price change (LeanerCloud#781), but two money surfaces still showed the opaque view: the quote summary listed raw source and target hourly prices with no delta, and the Approve confirm in exchange history led with the target offering UUID as one run-on sentence. The quote summary now adds an Hourly Price Change row, and the Approve confirm uses the same labeled lines as Execute (Exchange: 2 x m5.large (ri ids), For: 1 x m5.xlarge (offering id)), so the user can see what an irreversible exchange swaps before committing. The confirm body builders move to riexchange-confirm.ts so the Execute and Approve dialogs share one formatter and riexchange.ts shrinks. The two openExchangeModal describes now re-seed listTargetOfferings, since a resetAllMocks elsewhere in the file broke them under --randomize. Refs LeanerCloud#709 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Conflicts: - frontend/src/riexchange.ts (imports): kept LeanerCloud#709's riexchange-confirm import and main's narrowed lib/column-filters import plus the new lib/column-filter-popover import (LeanerCloud#1315). - frontend/src/riexchange.ts (confirm builders): kept main's new revealExchangeHistory() (LeanerCloud#1375); dropped main's in-file ExchangeConfirmParts/HOURS_PER_MONTH/buildExchangeConfirmBody because LeanerCloud#709 moved them to riexchange-confirm.ts. Main's only change to that builder (LeanerCloud#1350: quote.Region is now required, so `?? ''` was removed) is ported into riexchange-confirm.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Independent review (IAmJSD's agent, fresh context, given only the diff, the issue and the PR text): APPROVE Blocking:
|
Collaborator
Author
|
Local verification at
|
IAmJSD
marked this pull request as ready for review
October 24, 2026 19:27
Collaborator
Author
|
Marked ready and merged by IAmJSD's agent, at IAmJSD's request (IAmJSD reviewed the before/after screenshots; cristim is traveling), after the independent review and local verification above, all at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The RI exchange Execute confirm was already fixed on main by #781, but two related surfaces still showed the opaque view: the quote summary listed raw source and target hourly prices with no delta, and the Approve confirm in Exchange History led with the target offering UUID in one run-on paragraph. This PR adds an hourly price change row to the quote summary and gives the Approve confirm the same labeled, instance-type-first lines as Execute.
Refs #709
Partial: the Approve confirm still cannot show a price delta, because exchange history records carry no hourly prices (needs a backend change), and Payment Due stays the exact raw string.
What changed
frontend/src/riexchange-confirm.tswithhourlyPriceDelta(),buildExchangeConfirmBody()(moved unchanged fromriexchange.ts) and a newbuildApproveConfirmBody().frontend/src/riexchange.ts: the quote summary gets an "Hourly Price Change" row (for example-0.0200 USD/hr, about -14.60 USD/month), and the Approve dialog usesbuildApproveConfirmBody().<uuid>)", "Region", then the warning. It falls back to ids when the history record has no instance types.riexchange-confirm.test.ts, a quote-summary test inriexchange.test.ts, and updated assertions intests-e2e/ri-exchange-confirmation.spec.ts.Why this approach
The in-app Execute and Approve confirms now share one formatter, so they can't drift apart again. Main's email deep-link approve confirm (
riexchange-deeplink.ts, #1353) still has its own wording; it could move tobuildApproveConfirmBody()in a follow-up. Moving the builders out also shrinksriexchange.ts(2125 lines on main, 2061 here, well over the 500-line guideline) instead of growing it. The exact offering id stays next to the instance type, as the #781 follow-up wanted. Payment Due stays as the exact raw string because the execute cap (max_payment_due_usd) is that string, and rounding it on screen would hide what is sent.Screenshots
Screenshots were taken before this branch was merged with main; before = main at a14dc8f. After is this branch. Both are headless Chromium at 1440x900 against the repo's mocked e2e API.
1 x <offering UUID> (m5.xlarge); after, labeled lines with "Exchange: 2 x m5.large" and "For: 1 x m5.xlarge (offering ...)".Verification
Run on this branch's head
87e4a930, fromfrontend/:frontend/src/riexchange.tsresolved, see the merge commit.riexchange-confirm.test.ts(6 tests) and a quote-summary test inriexchange.test.ts.--randomizeoverriexchange.test.ts: 80/80.e2e-local.sh, full suite): 201 passed.ri-exchange-confirmation.spec.tsnow asserts the quote-summary delta and the Approve instance-type lines.scripts/test-git-secrets-allowlist.sh: 137 PASS, 0 FAIL.Notes for review
Label:valuewith no space) is unchanged.Overlaps
None. This branch merges cleanly with every other open UI branch.
Note for the UI owner
This changes UI code that @cristim owns. IAmJSD reviewed the before/after screenshots and asked for it to be merged; any design point you disagree with can be a follow-up.
🤖 Generated with Claude Code