Skip to content

fix: show available margin in edit margin modal#141

Open
autochamchikim-pixel wants to merge 1 commit into
capofficial:mainfrom
autochamchikim-pixel:fix/show-edit-margin-available
Open

fix: show available margin in edit margin modal#141
autochamchikim-pixel wants to merge 1 commit into
capofficial:mainfrom
autochamchikim-pixel:fix/show-edit-margin-available

Conversation

@autochamchikim-pixel
Copy link
Copy Markdown

Summary

  • Shows an Available row in the Add/Remove Margin modal.
  • For Add mode, the row uses the connected wallet balance for the position asset.
  • For Remove mode, the row uses the removable position margin plus funding.
  • The available value is clickable and fills the amount input, matching the existing pool deposit/withdraw UX.

Test plan

  • node -e "const fs=require('fs'); const svelte=require('svelte/compiler'); svelte.compile(fs.readFileSync('src/components/modals/EditMargin.svelte','utf8'), {filename:'src/components/modals/EditMargin.svelte'}); console.log('svelte_compile_ok')"
  • Attempted full npm run build; the container killed Rollup with exit 137 after dependency install, likely memory-related, before surfacing code errors.

Closes #19

@autochamchikim-pixel
Copy link
Copy Markdown
Author

Requesting assignment/consideration for #19. I opened this PR to resolve the bounty: #141

@autochamchikim-pixel autochamchikim-pixel force-pushed the fix/show-edit-margin-available branch from 3bdba50 to 179c4f5 Compare May 13, 2026 05:46
@autochamchikim-pixel
Copy link
Copy Markdown
Author

Pushed a small follow-up quality pass: zero balances now render as 0 instead of -, the available value only fills the input when loaded, and ERC20 approval is gated to Add mode so Remove mode keeps showing the remove action.

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.

Show available margin in Add/Remove margin modal

1 participant