Commit graph

79 commits

Author SHA1 Message Date
openhands
e4ed1474e1 fix: P&L percentage line understates tax cost when taxDue > 0 (#504)
Include taxDue in taxCostPercent computation so the Tax% and Net%
shown in the header P&L line are consistent with the Tax Cost card
and Total row, which already use taxDue + taxPaid.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 15:32:21 +00:00
openhands
18a2d4138e fix: Misleading 'Tax Paid' label — value includes unpaid tax due (#374)
taxPaidGes = taxDue + taxPaid, so the displayed value includes both
outstanding tax and historically paid tax. Rename the UI label from
'Tax Paid' to 'Tax Cost' to accurately reflect the combined amount.
Update the matching E2E test selector accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 11:51:45 +00:00
openhands
0063e94007 fix: \total\ computed has no undefined guard — shows initial stake amount during loading (#424)
When profit or taxPaidGes were undefined (data still loading), the
computed returned props.amount due to the ?? 0 fallbacks. The computed
now returns undefined until both values are loaded, and the template
guard is simplified to total !== undefined.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 06:31:49 +00:00
openhands
372f49f6a5 fix: wrap unstakePosition polling loop in try/finally to prevent loading lock (#448)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 04:18:52 +00:00
openhands
e85ff85950 fix: CollapseActive.vue: fixed 5-second delay in unstakePosition() should be replaced with polling (#448)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 03:44:04 +00:00
openhands
5b69d9ee3d fix: address review findings in sell KRK widget
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 12:39:15 +00:00
openhands
36c798605f fix: feat: Add sell KRK widget to get-krk page (#456)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 12:03:36 +00:00
openhands
2483630a2d fix: add eslint-disable for Promise+setTimeout in CollapseActive.vue (#442)
No push event exists for Ponder indexing completion; grandfathered with
justification comment per the no-fixed-delays rule exception policy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 22:10:06 +00:00
openhands
748557bc83 fix: lint: Ban waitForTimeout, setTimeout-as-delay, and fixed sleep patterns (#442)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 20:58:01 +00:00
openhands
5623768025 fix: Double trigger of loadLiquidityStats on initial mount (#361)
Remove redundant onMounted call that fired loadLiquidityStats() a second
time. The watch() with { immediate: true } already handles the initial
load and all subsequent dependency changes, making onMounted redundant.
Also remove now-unused onMounted import.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 07:52:02 +00:00
openhands
feaa226f24 fix: Array.isArray slot0 fallback branch is unreachable dead code (#362) 2026-03-03 07:11:09 +00:00
openhands
e866266511 fix: update CheatsView to import utilities from @harb/utils
isRecord, coerceString, getErrorMessage, ensureAddress were removed
from useSwapKrk.ts but CheatsView.vue still imported them from there.
Update CheatsView to import from @harb/utils directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 05:54:29 +00:00
openhands
59ae30bb37 fix: Generic utilities (isRecord, coerceString, getErrorMessage, ensureAddress) have no shared home (#363)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 05:37:14 +00:00
openhands
d00b78f338 fix: apply formatTokenAmount to Total row and guard against NaN/Infinity
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 03:32:06 +00:00
openhands
8f5910d30a fix: Raw number rendering for \taxPaidGes\ and \profit\ after load (#375)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 03:03:22 +00:00
openhands
f8baa02efc fix: hide stats on first-open error and guard Total row against undefined
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 02:23:06 +00:00
openhands
c0e1079006 fix: suppress no-console lint error in CollapseActive error handler
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 02:00:05 +00:00
openhands
8e600ec5fd fix: \loadActivePositionData\ has no error handling — silent failure on RPC error (#377)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 01:51:48 +00:00
openhands
68601c255a fix: getByRole('button', { name: 'Buy' }).last() fragility is duplicated across e2e/01 and this scenario (#398)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 23:13:05 +00:00
openhands
f612090eeb fix: cleanup: Remove swap functionality from cheats page after #393 fix (#400)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 06:32:48 +00:00
openhands
0675694779 fix: bug: Desktop Connect button never renders at 1280px width (#399)
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>
2026-03-02 04:35:51 +00:00
openhands
6876e84735 fix: bug: Get KRK page swap widget broken with Playwright fill() (#393)
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>
2026-03-01 18:15:50 +00:00
openhands
bcebbd47c9 fix: \taxDue\ ref lacks null guard before bigint arithmetic (#329)
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>
2026-02-28 13:51:04 +00:00
openhands
57903329bf fix: \{{ taxPaidGes }}\ and \{{ profit }}\ render empty during async load (#330)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 13:21:06 +00:00
openhands
e5a5486499 fix: Structural duplication of swap ABIs and buyKrk() across LocalSwapWidget and CheatsView (#353)
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>
2026-02-28 09:32:02 +00:00
openhands
cf4e401d03 fix: address review feedback on LocalSwapWidget and CheatsView
- 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>
2026-02-27 10:32:04 +00:00
openhands
bce4059de9 fix: Get KRK: inline swap widget for local dev, Uniswap link for production (#136)
- 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>
2026-02-27 06:55:41 +00:00
openhands
63ddf14a5c fix: CollapseActive: null guard on total computed + remove redundant BigInt casts (#309)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 20:42:17 +00:00
openhands
dd2e2ec25c fix: Consolidate redundant/broken gitignore node_modules entries (#204)
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>
2026-02-25 21:13:16 +00:00
openhands
ca8e4737fe fix: Fix collapse component formatting: taxPaid display, string coercion, BigInt precision (#260)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 08:06:49 +00:00
openhands
d1d943e5fd fix: Micro-fixes: dead comment, timer null, AbortController, address guard, catch reset (#261)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 07:24:48 +00:00
openhands
bef804ca80 fix: Dead comment in NavbarLayout.vue (#258)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 06:42:34 +00:00
openhands
e394d68772 fix: Remove unused components from web-app (#242)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 00:24:29 +00:00
openhands
ca68c339ed fix: CollapseHistory: format profit display + fix package.json name for stable lock file (#245)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 23:43:15 +00:00
openhands
8c43d3890c fix: Move BigInt formatting functions from helper.ts to kraiken-lib/format (#246)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 23:00:58 +00:00
openhands
0d761744df fix: Add architectural lint rules with agent-friendly error messages (#232)
- 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>
2026-02-24 20:44:17 +00:00
openhands
ff29f79d8a fix: CollapseHistory: show "—" instead of "0" profit when data unavailable (#207)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 19:54:15 +00:00
openhands
f3f428f514 fix: Extract duplicated \formatTokenAmount\ to helper.ts (#209)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 19:18:45 +00:00
openhands
14da7d9a09 fix: Title (#212)
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>
2026-02-24 17:32:47 +00:00
openhands
deaa87e55a fix: address review findings for snatch notifications (#151)
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>
2026-02-24 09:47:27 +00:00
openhands
2fffd2a567 fix: address review findings for snatch notifications (#151)
- 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>
2026-02-24 09:18:28 +00:00
openhands
60d0859eb3 fix: Snatch notifications and position history (#151)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 08:47:24 +00:00
openhands
878d1337df fix: Clean up dead code and stale domain references across landing + web-app (#189)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 13:04:02 +00:00
openhands
ecbd167997 fix: address review — extract inline style, tighten disclaimer copy 2026-02-22 17:16:54 +00:00
openhands
6304cca556 fix: replace Start Earning messaging with accurate staking positioning (#173) 2026-02-22 11:34:48 +00:00
johba
1e0822eaa2 fix: clean URLs, contract addresses, gitmodule (#16, #58, #147) (#162) 2026-02-20 17:28:59 +01:00
johba
d9b5131101 fix: Get KRK local swap, WalletCard on all variants (#146, #150) (#165) 2026-02-20 09:18:51 +01:00
johba
b3b7ab72f9 feat: wallet transaction history table (#155) (#164) 2026-02-20 09:18:10 +01:00
johba
db3633425a feat: shared @harb/web3 package + landing wallet connect (#157) (#159) 2026-02-19 20:18:27 +01:00
johba
66106077ba feat: wallet P&L with average cost basis tracking (#156) (#158) 2026-02-19 16:22:23 +01:00