Skip to content

fix(fe): words for a cross-chain quote step, and Builder pinch follow-ups - #282

Merged
Lexirieru merged 4 commits into
mainfrom
fix/fe-quote-words-pinch
Nov 12, 2026
Merged

Lexirieru merged 4 commits into
mainfrom
fix/fe-quote-words-pinch

Conversation

@AncungAulia

Copy link
Copy Markdown
Contributor

@Lexirieru Two small FE follow-ups: words for the new cross-chain quote (#278), and your four notes on the Builder pinch (#274).

Cross-chain quote step (#273, #278)

Builder pinch, your notes on #274 (useCanvasView.ts)

  1. Any new press, a mouse one too, forgets the last pinch, so a click on empty canvas after a pinch closes the settings again.
  2. The second finger and the pinch's moves stop at the canvas (stopPropagation), so they don't reach the card under them.
  3. A finger lifted outside the canvas is still let go: there's also a pointerup / pointercancel listener on the window.
  4. A pinch starts from the view on screen (current), not where an easing zoom was heading (target), so it no longer jumps once.

apps/fe/CLAUDE.md updated for both.

Tests (local, on main 8579686)

  • bun run typecheck, eslint on the changed files: pass.
  • bun run test: 276/276 (new expectations in chat-steps for the quote line).
  • Not run: next build (CI runs it), and integration and load tests (the FE has none).
  • Not checked on a phone, and no cross-chain quote seen in a browser yet.

🤖 Generated with Claude Code

AncungAulia and others added 3 commits November 12, 2026 22:25
The engine's crosschain_quote (#278) had no words in the FE, so its
step row fell back to "Using a tool". It now reads "Getting a
cross-chain quote", then "Got a cross-chain quote" with what would
arrive where ("9.97 USDC on Base"), adding "signed by NEAR Intents"
only when the engine checked the quote's signature.

Tests: typecheck, eslint, vitest 276/276 (new expectations in
chat-steps for a signed and an unsigned quote).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Any new press, a mouse one too, forgets the last pinch, so a click
  on empty canvas after a pinch closes the settings again.
- A pinch starts from the view on screen, not where an easing zoom
  was heading, so it no longer jumps once.
- The second finger and the pinch's moves stop at the canvas, so they
  don't reach the card under them.
- A finger lifted outside the canvas is still let go (pointerup on
  the window), so no stale touch starts a pinch later.

Tests: typecheck, eslint, vitest 276/276. Not checked on a phone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"9.97 USDC on Base, signed by NEAR Intents" was cut off on a phone's
line (about 343 px). The step now reads "Got a cross-chain quote
9.97 USDC on Base"; the Mind states the quote's proof in its reply
(#278), and the opened step still shows it.

Tests: typecheck, vitest tests/chat-steps.test.ts 16/16.

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

Copy link
Copy Markdown
Contributor

@AncungAulia thanks, both parts look right.

Tests:

  • bun run lint, bun run typecheck, and bun run test 276/276 on this branch.
  • The pinch notes are handled as written: a mouse press resets pinched, the pinch starts from current, and the window gets pointerup/pointercancel. Not tried on a phone.

One change before merge, the chain name. Checked in Chrome on a local stack with a real 1Click quote, the step reads "Got a cross-chain quote 49.984601 USDC on Arb". to.chain is 1Click's blockchain id, so capitalising it gives "Arb", "Sol", "Eth", "Bsc", "Pol", "Op", "Avax". Could you map the ids to names? For example:

const CHAIN_NAMES: Record<string, string> = {
  eth: "Ethereum", arb: "Arbitrum", base: "Base", sol: "Solana", pol: "Polygon", bsc: "BNB Chain", op: "Optimism",
  avax: "Avalanche", tron: "Tron", ton: "TON", sui: "Sui", aptos: "Aptos", stellar: "Stellar", gnosis: "Gnosis",
  scroll: "Scroll", monad: "Monad", xlayer: "X Layer", hypercore: "Hyperliquid",
}

Fall back to the id itself for anything not listed. Maybe also trim the amount to a few decimals (49.984601 → 49.98), as the Mind's reply does.

After that I'll merge.

@Lexirieru

Copy link
Copy Markdown
Contributor

@AncungAulia reminder for this one: the step still reads "… on Arb". The chain id → name map from my comment above (Arbitrum, Solana, BNB Chain, …) and a few decimals on the amount, then I'll merge.

Axel checked #282 with a real 1Click quote: the step read "49.984601
USDC on Arb", since to.chain is 1Click's chain id. Ids now map to
names (Arbitrum, Solana, BNB Chain, …; CHAIN_NAMES, from Axel's list),
an unknown id shows as it is, and the amount is cut, never rounded
up, to two decimals (shortAmount: 49.984601 -> 49.98, 0.004512 ->
0.0045): "49.98 USDC on Arbitrum".

Tests: typecheck, eslint, vitest tests/chat-steps.test.ts 16/16 (new
expectations for chain names and amounts).

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

Copy link
Copy Markdown
Contributor Author

@Lexirieru Done in 7c9a639:

  • Chain names: 1Click's ids map to names with your list (CHAIN_NAMES in runs/data/steps.ts). An id that isn't listed shows as it is.
  • Amount: cut to two decimals, never rounded up (shortAmount). A small amount keeps its first figures.
  • Examples:
    • 49.984601 on arb → "Got a cross-chain quote 49.98 USDC on Arbitrum"
    • 12 on bsc → "12 USDC on BNB Chain"
    • 0.004512 → "0.0045"

Tests: typecheck, eslint, vitest run tests/chat-steps.test.ts 16/16 (new expectations for the names and amounts). Not checked against a live quote in a browser.

🤖 Generated with Claude Code

@Lexirieru
Lexirieru merged commit 80b346f into main Nov 12, 2026
1 check passed
@Lexirieru

Copy link
Copy Markdown
Contributor

Merged with Axel's approval; main deploys after its CI. Tested locally: lint, typecheck, bun run test 276/276; shortAmount cuts by text, never rounds up. "49.98 USDC on Arbitrum" reads well. Thanks @AncungAulia.

@Lin1er

Lin1er commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Live on the hosted demo: main 80b346f (automatic deploy after the merge).

  • Before: 55726c0, and the box matched git at that revision. CI: passed: build.
  • GET /v1/health → {"ok":true,"engine":true,"revision":"80b346f"}. No rollback.
  • Rollback target: 55726c0 (/opt/hellonear/release-old).

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.

3 participants