Replace screen.width with window.innerWidth in useMobile composable.
screen.width reports the physical screen size (0 in headless Chromium),
while window.innerWidth reflects the actual viewport — the correct metric
for responsive layout. The previous Object.defineProperty workaround in
wallet-provider.ts could not override the native Screen.prototype getter,
so screen.width remained 0, isMobile stayed true, and ConnectButton was
never rendered. Fix wallet-provider.ts to pass viewport/screen options
directly to browser.newContext() and remove the broken init-script shim.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace v-model with :value + @input on the number input in LocalSwapWidget.
Vue 3's vModelText directive coerces <input type="number"> values to numbers
via looseToNumber(), causing swapAmount to become a JS number (e.g. 0.05) after
Playwright fill(). viem's parseEther() requires a string and throws when passed
a number, triggering the "Enter a valid ETH amount" error.
The fix mirrors FInput's explicit @input handler which always reads
event.target.value as a string, keeping swapAmount typed as string throughout.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Initialize taxDue as ref<bigint>(0n) instead of ref<bigint>() so the
type is always bigint, eliminating the undefined in the Ref type and
making the bigint addition at line 219 type-safe without a null guard.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract shared Uniswap ABIs (WETH_ABI, SWAP_ROUTER_ABI, UNISWAP_FACTORY_ABI,
UNISWAP_POOL_ABI), utility functions (isRecord, coerceString, getErrorMessage,
ensureAddress), and the wrap→approve→exactInputSingle flow into a new composable
useSwapKrk(). Both LocalSwapWidget and CheatsView now delegate to this single
source of truth, so swap logic changes only need to be made in one place.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- LocalSwapWidget: move useWallet() to top-level <script setup> (was
incorrectly called inside async buyKrk() event handler)
- LocalSwapWidget + CheatsView: fix misleading toast — all transactions
are fully confirmed at that point, so say 'Swap complete' not 'Swap
submitted'
- LocalSwapWidget: add $KRK sigil to warning/hint text for consistency
with GetKrkView
- LocalSwapWidget: add comment on amountOutMinimum: 0n explaining it is
intentional for a no-MEV local anvil environment
- CheatsView: apply same useWallet() fix (pre-existing anti-pattern)
- docs/ENVIRONMENT.md: document VITE_ENABLE_LOCAL_SWAP and related
VITE_ variables in a new webapp env-var table
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add `VITE_ENABLE_LOCAL_SWAP` env var to config.ts (defaults false)
- Create LocalSwapWidget.vue: inline ETH→KRK swap (wrap→approve→exactInputSingle)
- GetKrkView.vue: show LocalSwapWidget when VITE_ENABLE_LOCAL_SWAP=true, Uniswap link otherwise
- docker-compose.yml: set VITE_ENABLE_LOCAL_SWAP=true for webapp service
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove redundant `node_modules/` entries from sub-directory .gitignore
files. The root `.gitignore` already has `**/node_modules/` which covers
all nested directories, making these per-package entries unnecessary.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- landing/eslint.config.js: ban imports from web-app paths (rule 1),
direct RPC clients from viem/@wagmi/vue (rule 2), and axios (rule 4)
- web-app/eslint.config.js: ban string interpolation inside GraphQL
query/mutation property values (rule 3); fixes 4 pre-existing violations
in usePositionDashboard, usePositions, useSnatchNotifications,
useWalletDashboard by migrating to variables: {} pattern
- services/ponder/eslint.config.js: ban findMany() calls that lack a
limit parameter to prevent unbounded indexed-data growth (rule 5)
All error messages follow the [what is wrong][rule][how to fix][where to
read more] template so agents and humans fix on the first try.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add trailing slash to node_modules entries in sub-package .gitignore
files so they match only directories, not files named node_modules.
The root .gitignore already uses **/node_modules/ (fixed in #203);
these per-package entries were also missing the slash.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace ambiguous .collapsed-body.history CSS selector with a
component-specific .history-body class in CollapseHistory.vue.
The old compound class shared a name with collapse.sass rules
(.collapsed-body.history { flex-direction: row }) and reviewers
could not confirm the selector matched. The new class is unique
to CollapseHistory, making the flex-column layout and purple
router-link colour unambiguous.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract relativeTime and formatTokenAmount to helper.ts, eliminating
duplicated logic between CollapseHistory and NotificationBell
- Use formatUnits (via formatTokenAmount) instead of Number(BigInt)/1e18
to avoid precision loss on large token amounts
- Fix allRecentSnatches emptying after mark-seen: now runs two parallel
queries — one filtered by lastSeen timestamp (unseen badge count) and
one unfiltered (panel history), so history is preserved after opening
- Remove dead no-op watch block from useSnatchNotifications
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>