Skip to content

fix typescript build errors (tsc -b) - #646

Merged
bordalix merged 3 commits into
masterfrom
typescript_build_fixes
Jun 4, 2026
Merged

bordalix merged 3 commits into
masterfrom
typescript_build_fixes

Conversation

@bordalix

@bordalix bordalix commented Jun 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Simplified recovery locktime progress calculation to rely on time-based countdowns only.
  • Improvements

    • Enhanced animation easing curves across page transitions and overlay effects.
    • Refined notification connection logic for improved reliability.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 03d7711b-a341-4a8c-a028-3f5c144439da

📥 Commits

Reviewing files that changed from the base of the PR and between f875df8 and fc03c1f.

📒 Files selected for processing (3)
  • .gitignore
  • src/test/lib/format.test.ts
  • src/test/screens/settings/contracts.test.tsx
✅ Files skipped from review due to trivial changes (1)
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/test/screens/settings/contracts.test.tsx
  • src/test/lib/format.test.ts

Walkthrough

This PR updates type definitions, animation easing, test infrastructure, provider relay configuration, UI calculations, and middleware compatibility across the wallet application. Changes include new vite-plugin-eslint type declarations, BigInt asset representation in format tests, expanded test mock configurations, Framer Motion easing standardization, Nostr relay dependency switch, and TypeScript error suppression for Cloudflare runtime APIs.

Changes

Type system, animation, provider, and test infrastructure updates

Layer / File(s) Summary
Type definitions and build configuration
src/vite-plugin-eslint.d.ts, .gitignore
TypeScript module declaration added for vite-plugin-eslint with factory function and options interface; build cache output file added to .gitignore.
Format test suite updates for signed assets
src/test/lib/format.test.ts
Imports expanded to include Tx and Asset types; isIssuance and isBurn test cases converted to use BigInt(...) for asset amounts with positive/negative variations; "no assets" test cases changed from empty array to casted empty asset object.
Test mock infrastructure expansion
src/test/screens/mocks.ts, src/test/screens/settings/contracts.test.tsx, src/test/screens/wallet/receive-qrcode.test.tsx, src/test/screens/wallet/transaction.test.tsx
mockConfigContextValue expanded with Unit import, extended config fields (announcementsSeen, dismissedBanners, haptics, pubkey, delegate from env), and config helper functions; mockFlowContextValue adds lnurlInfo and setLnurlInfo; contract fixtures updated with createdAt/params; transaction fixture converted to BigInt; clipboard mock updated to accept and return value.
Animation easing standardization
src/lib/animations.ts
Framer Motion transition configurations across pageTransitionVariants, overlaySlideUp, walletLoadInChild, and onboardStaggerChild now use EASE_OUT_QUINT_TUPLE instead of EASE_OUT_QUINT for all transition.ease values.
Provider relay and UI calculation adjustments
src/providers/notifications.tsx, src/screens/Apps/Boltz/Settings.tsx
NotificationsProvider relay connection now depends on config.nostrBackup instead of config.nostr with early exit and cleanup when disabled; RecoveryRow locktime progress fallback that computed blocksAway from currentBlockHeight is removed.
Middleware TypeScript error suppression
functions/_middleware.ts
Cloudflare crypto.subtle.timingSafeEqual call in onRequest authentication now explicitly suppresses TypeScript error with @ts-expect-error directive; boolean expression reformatted while preserving authorization logic.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix typescript build errors (tsc -b)' directly and specifically describes the main change: resolving TypeScript compilation errors from the incremental build process.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch typescript_build_fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 3, 2026 •

Copy link
Copy Markdown

Deploying wallet-bitcoin with  Cloudflare Pages  Cloudflare Pages

Latest commit: fc03c1f
Status: ✅  Deploy successful!
Preview URL: https://a143a5ac.wallet-bitcoin.pages.dev
Branch Preview URL: https://typescript-build-fixes.wallet-bitcoin.pages.dev

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 3, 2026 •

Copy link
Copy Markdown

Deploying wallet-mutinynet with  Cloudflare Pages  Cloudflare Pages

Latest commit: fc03c1f
Status: ✅  Deploy successful!
Preview URL: https://48c854ec.arkade-wallet.pages.dev
Branch Preview URL: https://typescript-build-fixes.arkade-wallet.pages.dev

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 3, 2026 •

Copy link
Copy Markdown

Deploying tmp-boltz-upstream-mainnet-arkade-wallet with  Cloudflare Pages  Cloudflare Pages

Latest commit: fc03c1f
Status: ✅  Deploy successful!
Preview URL: https://0a0e34bf.tmp-boltz-upstream-mainnet-arkade-wallet.pages.dev
Branch Preview URL: https://typescript-build-fixes.tmp-boltz-upstream-mainnet-arkade-wallet.pages.dev

View logs

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — #646

PR fixes TypeScript build errors (tsc -b). Most changes are correct and necessary. A few issues need addressing.


🔴 Must Fix

1. tsconfig.tsbuildinfo should NOT be committed — tsconfig.tsbuildinfo

This is a compiler cache artifact. It's machine-specific, changes on every build, and will cause noisy diffs on every future PR. Add it to .gitignore and remove it from this PR:

echo 'tsconfig.tsbuildinfo' >> .gitignore
git rm --cached tsconfig.tsbuildinfo

2. Partial<Tx> weakens type safety unnecessarily — src/lib/format.ts:121-126

Both isIssuance and isBurn access tx.type and tx.amount unconditionally. With Partial<Tx>, these become string | undefined and number | undefined, meaning the functions silently return false on incomplete data instead of surfacing a type error at the call site.

All production callers (TransactionsList.tsx:39-40, Transaction.tsx:36-37) pass full Tx objects. The only motivation is making tests pass without providing all required fields — but the tests in this PR already provide type, amount, and assets, so they'd pass with Pick<Tx, 'type' | 'amount'> & Partial<Pick<Tx, 'assets'>> too.

Preferred fix: keep the signature as Tx, and in the test file, cast partial objects with as Tx (which is the existing pattern for test mocks in this codebase). This keeps production call sites type-safe. If you really want a narrower type, use Pick<Tx, 'type' | 'amount' | 'assets'> — not Partial<Tx>.


🟡 Nits / Minor

3. @ts-expect-error on timingSafeEqual — functions/_middleware.ts:36

The comment is fine — crypto.subtle.timingSafeEqual is indeed a Cloudflare runtime extension not in the standard SubtleCrypto typings. But a cleaner fix would be to add a Cloudflare Workers type package (@cloudflare/workers-types) to devDependencies. Low priority, not blocking.

4. BigInt(-5_000) vs -5_000n — src/test/screens/wallet/transaction.test.tsx:257

The original code used -5_000n (bigint literal). The PR changes it to BigInt(-5_000). This is functionally equivalent but the literal form is more idiomatic. Was this changed to fix a build error? If so, that suggests a tsconfig issue with the target setting rather than a code issue.


✅ Looks Good

  • EASE_OUT_QUINT → EASE_OUT_QUINT_TUPLE (src/lib/animations.ts): Correct fix. Framer Motion expects [number, number, number, number] tuple, not number[]. Clean.

  • config.nostr → config.nostrBackup (src/providers/notifications.tsx:59,67): This is a bug fix. The Config type has no nostr field — only nostrBackup. The old code was accessing an undefined property (always falsy), meaning the relay connection logic was effectively dead code. Good catch.

  • Boltz blocksAway removal (src/screens/Apps/Boltz/Settings.tsx:341-342): Acceptable. The removed branch handled block-height-based locktimes (< 500_000_000). If the SDK no longer provides currentBlockHeight on SubmarineRecoveryInfo, this dead code was causing a type error. The UI degrades gracefully (shows "try again later" instead of "X blocks to go").

  • Mock updates (src/test/screens/mocks.ts, contracts.test.tsx): Correct — adds required fields (createdAt, params, Unit, lnurlInfo, etc.) to match updated type definitions. The mock now properly satisfies the full context type shapes.

  • vite-plugin-eslint.d.ts: Clean ambient module declaration. Fine.

  • Test BigInt updates (format.test.ts): Asset amounts changed from number to BigInt to match updated Asset type. Correct.

  • pnpm-lock.yaml: Just dependency resolution bumps from @testing-library/dom. Fine.


Summary: Two real issues — the committed build artifact and the Partial<Tx> type weakening. The rest is solid cleanup work. Fix those two and this is good to merge.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/vite-plugin-eslint.d.ts (1)

4-9: 💤 Low value

Index signature defeats type-checking on known option keys.

The [key: string]: unknown member means typos like cahce won't be flagged and all option values widen to unknown. If the goal is a faithful stub for tsc -b, consider dropping the index signature so the explicit options are actually enforced; keep it only if downstream call sites pass options beyond the three declared.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/vite-plugin-eslint.d.ts` around lines 4 - 9, The VitePluginESLintOptions
interface currently includes a permissive index signature that masks typos and
widens types; remove the `[key: string]: unknown` entry from
VitePluginESLintOptions so the declared properties (include, exclude, cache) are
strictly type-checked, or if arbitrary extra options are required keep the index
signature but narrow it (e.g., to `any` or a union) and document why—locate the
interface named VitePluginESLintOptions and update it accordingly to enforce
correct option names like include/exclude/cache.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/providers/notifications.tsx`:
- Around line 58-67: The useEffect starts an async connectRelay() without
cancellation, so if config.nostrBackup flips false while connectRelay is pending
it may still set relay.current and reopen the relay; modify connectRelay (or
wrap its call in the effect) to be cancelable: create a local "active" flag or
AbortController inside the useEffect, pass it into connectRelay (or check it
after await), and in the effect cleanup set active = false (or abort) and ensure
any pending promise does not assign relay.current or call relay.current.close()
when inactive; reference the useEffect block, connectRelay function,
relay.current, and config.nostrBackup when making the change.

In `@src/test/screens/wallet/receive-qrcode.test.tsx`:
- Line 32: The mock copy function copyToClipboardMock is declaring an untyped
parameter (v) which triggers noImplicitAny under strict typing; update the mock
declaration for copyToClipboardMock to explicitly type the parameter (e.g.,
annotate v as string or another appropriate type used in tests) so the vi.fn
callback has a typed parameter and returns Promise of that type (for example use
v: string). Ensure the change targets the copyToClipboardMock definition so all
usages in the test keep type safety.

---

Nitpick comments:
In `@src/vite-plugin-eslint.d.ts`:
- Around line 4-9: The VitePluginESLintOptions interface currently includes a
permissive index signature that masks typos and widens types; remove the `[key:
string]: unknown` entry from VitePluginESLintOptions so the declared properties
(include, exclude, cache) are strictly type-checked, or if arbitrary extra
options are required keep the index signature but narrow it (e.g., to `any` or a
union) and document why—locate the interface named VitePluginESLintOptions and
update it accordingly to enforce correct option names like
include/exclude/cache.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a5163a17-2f9c-4570-883c-fdac3268d07a

📥 Commits

Reviewing files that changed from the base of the PR and between 0098371 and f875df8.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • functions/_middleware.ts
  • src/lib/animations.ts
  • src/lib/format.ts
  • src/providers/notifications.tsx
  • src/screens/Apps/Boltz/Settings.tsx
  • src/test/lib/format.test.ts
  • src/test/screens/mocks.ts
  • src/test/screens/settings/contracts.test.tsx
  • src/test/screens/wallet/receive-qrcode.test.tsx
  • src/test/screens/wallet/transaction.test.tsx
  • src/vite-plugin-eslint.d.ts
  • tsconfig.tsbuildinfo
💤 Files with no reviewable changes (1)
  • src/screens/Apps/Boltz/Settings.tsx

Comment on lines 58 to +67
useEffect(() => {
if (!config.nostr) {
if (!config.nostrBackup) {
if (relay.current) {
if (relay.current.connected) relay.current.close()
relay.current = undefined
}
return
}
connectRelay()
}, [config.nostr])
}, [config.nostrBackup])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Prevent stale relay connections from in-flight async connect

Line 66 starts an async connect without cancellation. If nostrBackup is turned off before connect resolves, the pending promise can still set relay.current afterward, reopening a relay while disabled.

Suggested fix
-  useEffect(() => {
-    if (!config.nostrBackup) {
-      if (relay.current) {
-        if (relay.current.connected) relay.current.close()
-        relay.current = undefined
-      }
-      return
-    }
-    connectRelay()
-  }, [config.nostrBackup])
+  useEffect(() => {
+    let cancelled = false
+
+    const closeRelay = () => {
+      if (relay.current) {
+        if (relay.current.connected) relay.current.close()
+        relay.current = undefined
+      }
+    }
+
+    if (!config.nostrBackup) {
+      closeRelay()
+      return
+    }
+
+    ;(async () => {
+      const nextRelay = await Relay.connect('wss://relay.primal.net')
+      if (cancelled || !config.nostrBackup) {
+        if (nextRelay.connected) nextRelay.close()
+        return
+      }
+      relay.current = nextRelay
+    })()
+
+    return () => {
+      cancelled = true
+      closeRelay()
+    }
+  }, [config.nostrBackup])
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
useEffect(() => {
if (!config.nostr) {
if (!config.nostrBackup) {
if (relay.current) {
if (relay.current.connected) relay.current.close()
relay.current = undefined
}
return
}
connectRelay()
}, [config.nostr])
}, [config.nostrBackup])
useEffect(() => {
let cancelled = false
const closeRelay = () => {
if (relay.current) {
if (relay.current.connected) relay.current.close()
relay.current = undefined
}
}
if (!config.nostrBackup) {
closeRelay()
return
}
;(async () => {
const nextRelay = await Relay.connect('wss://relay.primal.net')
if (cancelled || !config.nostrBackup) {
if (nextRelay.connected) nextRelay.close()
return
}
relay.current = nextRelay
})()
return () => {
cancelled = true
closeRelay()
}
}, [config.nostrBackup])
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/providers/notifications.tsx` around lines 58 - 67, The useEffect starts
an async connectRelay() without cancellation, so if config.nostrBackup flips
false while connectRelay is pending it may still set relay.current and reopen
the relay; modify connectRelay (or wrap its call in the effect) to be
cancelable: create a local "active" flag or AbortController inside the
useEffect, pass it into connectRelay (or check it after await), and in the
effect cleanup set active = false (or abort) and ensure any pending promise does
not assign relay.current or call relay.current.close() when inactive; reference
the useEffect block, connectRelay function, relay.current, and
config.nostrBackup when making the change.


// Mock clipboard helper so we can assert it was called with the QR value
const copyToClipboardMock = vi.fn(() => Promise.resolve())
const copyToClipboardMock = vi.fn((v) => Promise.resolve(v))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check whether test files are in tsc -b scope and whether noImplicitAny/strict is enabled
fd -t f 'tsconfig*.json' --exec sh -c 'echo "=== $1 ==="; cat "$1"' _ {}

Repository: arkade-os/wallet

Length of output: 669


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== package.json scripts ==="
cat package.json | node -e "const fs=require('fs');const p=JSON.parse(fs.readFileSync(0,'utf8'));console.log(JSON.stringify(p.scripts,null,2))"

echo
echo "=== tsconfig files ==="
fd -t f 'tsconfig*.json' .

echo
echo "=== tsconfig include/exclude/refs ==="
for f in $(fd -t f 'tsconfig*.json'); do
  echo "---- $f ----"
  node - <<PY
const fs=require('fs');
const f=process.argv[1];
const j=JSON.parse(fs.readFileSync(f,'utf8'));
console.log('compilerOptions:', JSON.stringify(j.compilerOptions||{},null,2));
console.log('include:', JSON.stringify(j.include||null));
console.log('exclude:', JSON.stringify(j.exclude||null));
console.log('references:', JSON.stringify(j.references||null));
PY "$f"
done

echo
echo "=== search for tsc -b usage ==="
rg -n --hidden --glob '!*node_modules*' "tsc\s+-b|tsc\.json|noImplicitAny" package.json tsconfig*.json .github . || true

echo
echo "=== locate the test snippet ==="
rg -n "copyToClipboardMock\s*=\s*vi\.fn\(" -S src/test/screens/wallet/receive-qrcode.test.tsx

echo
echo "=== try locate vitest type declarations (if installed) ==="
if [ -d node_modules ]; then
  fd -t f -i 'vitest' node_modules --max-results 20 || true
  fd -t f 'vitest.*d.ts' node_modules --max-results 20 || true
  # Grep for vi.fn signature
  vitest_dts="$(fd -t f 'index.d.ts' node_modules --max-results 200 | head -n 1 || true)"
  echo "Found sample d.ts: $vitest_dts"
fi

echo "=== end ==="

Repository: arkade-os/wallet

Length of output: 1660


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== tsconfig.json ==="
cat tsconfig.json

echo
echo "=== package.json scripts containing tsc/typecheck ==="
node - <<'NODE'
const fs=require('fs');
const pkg=JSON.parse(fs.readFileSync('package.json','utf8'));
const hits=Object.entries(pkg.scripts||{}).filter(([k,v])=>/tsc|typecheck|noEmit|build:ts/i.test(v));
console.log(hits.map(([k,v])=>`${k}: ${v}`).join('\n') || '(none)');
NODE

echo
echo "=== repo search for tsc -b / tsc / typecheck in CI (workflows) ==="
rg -n --hidden --glob '!.pnpm-store/**' --glob '!.git/**' "tsc\s+-b|tsc(\s|$)|typecheck" .github package.json tsconfig*.json . || true

echo
echo "=== test snippet location ==="
rg -n "copyToClipboardMock\s*=\s*vi\.fn\(" src/test/screens/wallet/receive-qrcode.test.tsx

Repository: arkade-os/wallet

Length of output: 892


Annotate v in copyToClipboardMock to avoid implicit-any under strict typechecking

src/test/screens/wallet/receive-qrcode.test.tsx has an untyped parameter: vi.fn((v) => Promise.resolve(v)). With tsconfig.json using "strict": true and including **/*.tsx, noImplicitAny can surface a TS error if tests are typechecked via tsc/tsc -b.

Proposed fix
-const copyToClipboardMock = vi.fn((v) => Promise.resolve(v))
+const copyToClipboardMock = vi.fn((v: string) => Promise.resolve(v))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const copyToClipboardMock = vi.fn((v) => Promise.resolve(v))
const copyToClipboardMock = vi.fn((v: string) => Promise.resolve(v))
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/test/screens/wallet/receive-qrcode.test.tsx` at line 32, The mock copy
function copyToClipboardMock is declaring an untyped parameter (v) which
triggers noImplicitAny under strict typing; update the mock declaration for
copyToClipboardMock to explicitly type the parameter (e.g., annotate v as string
or another appropriate type used in tests) so the vi.fn callback has a typed
parameter and returns Promise of that type (for example use v: string). Ensure
the change targets the copyToClipboardMock definition so all usages in the test
keep type safety.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review — new commit fa62417 ("arkana fixes")

Both must-fix items from my previous review are resolved:

  1. ✅ tsconfig.tsbuildinfo removed from the repo and added to .gitignore.
  2. ✅ Partial<Tx> reverted to Tx in src/lib/format.ts:121,125. Tests now use as Tx casts — correct pattern for partial test fixtures.

Minor observation (not blocking)

The test for "sent tx with amount 0 but no assets" changed from assets: [] to assets: [{} as Asset]. This no longer tests the empty-array path explicitly, but the first assertion in that same test ({ type: 'sent', amount: 0 } as Tx) exercises the tx.assets ?? [] nullish coalescing → empty array → some() returns false path, so coverage is preserved. Fine.

Previous nits (not blocking, unchanged):

  • @ts-expect-error on timingSafeEqual (functions/_middleware.ts:36) — acceptable, @cloudflare/workers-types would be cleaner long-term
  • BigInt(-5_000) vs -5_000n (src/test/screens/wallet/transaction.test.tsx:257) — functionally equivalent, idiomatic form preferred but not worth blocking

No protocol-critical changes in this PR. LGTM.

@bordalix
bordalix merged commit 9174048 into master Jun 4, 2026
6 checks passed
bordalix added a commit that referenced this pull request Jun 4, 2026
* fix typescript build errors (tsc -b)

* arkana fixes
@bordalix
bordalix deleted the typescript_build_fixes branch June 8, 2026 13:52
bordalix added a commit that referenced this pull request Jul 7, 2026
* feat(wallet): redesign bitcoin home

Port the scoped home redesign foundation and bitcoin-only wallet home from the draft branch. Adds shared motion and haptics helpers, redesigned home header/hero/actions/assets/upsells/activity preview, hides bottom navigation for home-launched wallet flows, and wires scan/swap interactions without pulling in passkeys or prototype asset accounts.

* fix(wallet): use real assets on redesigned home

* fix(wallet): polish settings and activity follow-ups

Remove the bottom nav from the redesigned wallet flow and align the settings screens with the draft redesign, including the Arkade Mint entry under General.

Refresh the full Activity page before showing an empty state, keep the home activity preview hidden when empty, and use the shared secondary/drawer styling for the swap coming-soon sheet.

* chore(deps): update pnpm lockfile

* test(e2e): follow redesigned navigation

Update Playwright helpers and specs to navigate through the redesigned home header, settings entry points, and Boltz deep link instead of the removed bottom nav.

* test(e2e): align home and settings assertions

Use the settings header text rendered by the shared Header component and assert the redesigned zero-balance home through stable test ids.

* test(e2e): navigate app screens without reload

* tests fixes

* Guard BigInt coercion to prevent render-time crashes

* fix polling leak

* lint

* Add a fallback for --pill-navbar-footer-clearance in settings padding

* Remove overriding aria-label on settings rows.

* fix(settings): address Arkade Mint review feedback

* fix tests

* fix test

* feat(wallet): add bitcoin detail page (#630)

* feat(wallet): add bitcoin detail page

Add a bitcoin-only wallet detail screen opened from the home asset row, with the Liveline price chart, current price, percentage badge, holdings, wallet actions, and bitcoin-filtered recent activity.

Share the existing swap coming-soon drawer between home and the detail page, and cover the bitcoin row navigation with a wallet screen regression test.

* fix(wallet): harden bitcoin chart loading

Remove the invalid fiat conversion path from the bitcoin detail chart, use CoinGecko max data for non-USD all-time charts, cache chart responses per fiat/range, fetch Coinbase all-time chunks sequentially, and guard the holdings balance before BigInt conversion.

* fix(wallet): pause bitcoin chart while hovering

* fix tests

* fix test

* use graph worker

* default chart period one week

* remove console.log

* new marketData file

* fixes

---------

Co-authored-by: Sahil Chaturvedi <sahilc0@users.noreply.github.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>

* feat(wallet): align recent activity with prototype (#628)

* chore(dev): support mnemonic wallet auto-init

Allow local dev auto-init to use VITE_DEV_MNEMONIC in addition to VITE_DEV_NSEC, so demo wallets can be restored from the current seed phrase without using the broken legacy default key.

* feat(wallet): align recent activity with prototype

Update the home recent activity list, full activity view, and transaction receipt details to match the prototype visuals while keeping the shared Activity header from PR 627. Add swap/account asset rendering, receipt-style detail rows, and measured virtual rows for taller activity entries.

* fix(wallet): address activity review feedback

Guard the round waiting screen when no info logs exist, cancel delayed polling on unmount, preserve the safer settlement status flow, remove incomplete BRL fiat support, and share token ticker mapping helpers across activity and asset views.

* fix send max with fiat ' + tests

---------

Co-authored-by: Sahil Chaturvedi <sahilc0@users.noreply.github.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>

* feat(send): align send form with redesign prototype (#629)

Port the draft send-flow field shell, asset selector, amount max control, and button safety polish on top of PR 627.

Add dev mnemonic auto-init support so local wallets can boot from mnemonic-based seeds without falling back to stale nsec state.

Co-authored-by: Sahil Chaturvedi <sahilc0@users.noreply.github.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>

* feat(wallet): align recent activity with prototype (#628)

* chore(dev): support mnemonic wallet auto-init

Allow local dev auto-init to use VITE_DEV_MNEMONIC in addition to VITE_DEV_NSEC, so demo wallets can be restored from the current seed phrase without using the broken legacy default key.

* feat(wallet): align recent activity with prototype

Update the home recent activity list, full activity view, and transaction receipt details to match the prototype visuals while keeping the shared Activity header from PR 627. Add swap/account asset rendering, receipt-style detail rows, and measured virtual rows for taller activity entries.

* fix(wallet): address activity review feedback

Guard the round waiting screen when no info logs exist, cancel delayed polling on unmount, preserve the safer settlement status flow, remove incomplete BRL fiat support, and share token ticker mapping helpers across activity and asset views.

* fix send max with fiat ' + tests

---------

Co-authored-by: Sahil Chaturvedi <sahilc0@users.noreply.github.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>

* fix tests

* fix navigation

* remove border from video container in scan

* change toggle bg color when selected to purple

* fix(wallet): address home redesign review feedback

* fix flacky test

* fix flacky test

* contracts view: copy encoded params, empty state, active/inactive sections (#645)

* show encoded contract params and allow copying

* show encoded contract params and allow copying

* improve contracts view: empty state, active/inactive sections, label and createdAt

* address review: guard encodeArkContract, createdAt fallback, unique card key

Wrap encodeArkContract in try/catch via useMemo and render the parameters row only when encoding succeeds, so a contract with missing/malformed params can no longer white-screen the Contracts screen. Show 'Unknown' instead of an empty string when createdAt is absent. Use contract.address as the React key. Update tests with createdAt/params and add an empty-state case.

* fix buttons overflow in input

* fix other value when bip21 has amount

* remove excessive bottom padding on content-shell

* less sensible pull-to-refresh

* fix typescript build errors (tsc -b) (#646)

* fix typescript build errors (tsc -b)

* arkana fixes

* build fixes

* remove console.log

* validate asset mint amount is not too large

* validate asset mint amount

* validate mint values

* fixes

* refactor mint form

* remove console.log

* fix e2e tests

* feat(settings): move advanced tools into settings (#652)

* feat(settings): move advanced tools into settings

Remove the root Apps surface and keep developer-focused tools under Settings > Advanced. Add Boltz and Arkade Mint entries there, rename the main settings group to Display, and update navigation tab ownership so these flows return through settings instead of an apps tab.

Also refresh bun.lock to match the dependency versions declared on the PR 627 base and update affected settings/e2e tests.

* re-order menu options

* fix e2e tests

* fix test

---------

Co-authored-by: Sahil Chaturvedi <sahilc0@users.noreply.github.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>

* feat(settings): support bitcoin currency units (#653)

* feat(settings): support bitcoin currency units

Add BTC as a selectable currency and replace display preferences with bitcoin unit options for BTC, sats, and BIP-177 notation.

Format wallet totals, transactions, send/receive flows, portfolio rows, and the Bitcoin detail view with the selected bitcoin unit while keeping the detail market price in fiat.

Convert fiat-like asset balances into selected-currency totals and add focused coverage for CHF asset conversion, settings options, formatting, and Bitcoin detail display.

* fix e2e test

* Several fixes

---------

Co-authored-by: Sahil Chaturvedi <sahilc0@users.noreply.github.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>

* fallback to btc currency if price feed fails

* add useEffect missing dependencies to InputAmount

* fix e2e test

* arkana fixes

* Fix Settings / Display

* change Fiats type to Currencies
change Settings menu option names

* fix(wallet): address arkana wallet review

* fix other value when clicking send max

* update regtest link

* update price chart proxy url

* fix build errors

* style(settings): polish contracts screen (#664)

Redesign the dev-mode contracts screen with a full-width summary, clearer contract cards, copyable code fields, and subtle motion feedback.

Update the contracts screen tests to cover the new summary and metadata layout.

Co-authored-by: Sahil Chaturvedi <sahilc0@users.noreply.github.com>

* feat(settings): add currency icons (#663)

Add reusable leading content support to the settings Select component and use it on the currency picker so each option shows a circular bitcoin or country currency mark.

Extend TokenLogo with the remaining fiat currency marks used by settings, add selector icon styling, and update the fiat settings tests to distinguish row icons from the selected-state checkmark.

Co-authored-by: Sahil Chaturvedi <sahilc0@users.noreply.github.com>

* Fixes

* Remove onboarding button (#678)

* remove 'complete boarding' button

* Upgrade ts-sdk 0.4.36 - boltz-swap 0.3.41 (#676)

* prevent double keys in local storage (#677)

* prevent double keys in local storage

* fix circular dependency

* add tests

* fix SVGs

* remove "Complete boarding button"

---------

Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com>

* Clean qrcode (#681)

* remove 'complete boarding' button

* fix SVGs

* remove "Complete boarding button"

* clean qr code ui

* remove console.log

* clean Reminder (#683)

* clean Reminder

* fix color

* fix duplicate init with devMnemonic

* fix test

* update regtest commit

* mini fixes

* fix test

* fix test

* persist value; fix toggle currency (#705)

* fix bitcoin balance in btc page

* fix server url input

* add error messages inline

* fix tests

* fix import

* fix secondary value when not useFiat

* fix flash of unlock screen (#710)

* bug fix in privacyAmount

* remove dead code

* click on asset card to view asset

* add test for clicking asset card in homepage

* fixes in input amount

* lnurl fix

* add unit tests

* bug fix

* fix test

* remove currencyDisplay from config (#713)

* remove currencyDisplay from config

* rabbit fixes

* fix test

* remove option from upsellsSection

* only show btc and registered assets on homepage

* fix import path

* rename config.fiat to config.currency

* fix test

---------

Co-authored-by: Sahil Chaturvedi <sahilc0@users.noreply.github.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>
Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com>
@coderabbitai coderabbitai Bot mentioned this pull request Aug 2, 2026
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