Skip to content

Feat/sortable position table#213

Open
Escelit wants to merge 2 commits into
Dgetsylver:mainfrom
Escelit:feat/sortable-position-table
Open

Feat/sortable position table#213
Escelit wants to merge 2 commits into
Dgetsylver:mainfrom
Escelit:feat/sortable-position-table

Conversation

@Escelit
Copy link
Copy Markdown
Contributor

@Escelit Escelit commented May 30, 2026

Summary

Makes the portfolio position strip sortable and adds a compact one-row-per-position table view.

Changes

index.html

  • Wrapped #portfolio-summary in a new #portfolio-summary-wrap containing a header bar with four sort buttons (Asset, Lev, HF, P&L) and a compact/expanded toggle.

main.ts

  • Replaced renderPortfolioSummary with a version that sorts entries before rendering and supports two layouts.
  • Sort state (posSortCol, posSortDir) and view preference (posViewCompact) are loaded from and persisted to localStorage.
  • Compact mode: <table> with one row per position showing asset, equity, leverage, HF, APY, P&L.
  • Expanded mode: existing card layout, now also showing unrealised P&L when a PnL entry exists.
  • Second click on the active column reverses direction; clicking a new column resets to ascending.

style.css

  • Styles for the sort button bar, active/arrow indicators, compact table rows, and hover/active states.

Acceptance criteria

  • Click column header to sort; second click reverses
  • Compact view shows one row per position
  • Sort column, direction, and view preference persist in localStorage

Closes #16

Escelit added 2 commits May 30, 2026 10:40
- Add Safe Max button next to leverage slider; snaps to highest
  leverage where projected HF >= user-configured floor
- Add HF floor input in settings dropdown (default 1.2, min 1.01)
- Persist floor value in localStorage under safeMaxHfFloor key
- Sort by asset, leverage, HF, unrealised P&L; second click reverses
- Compact view renders a one-row-per-position table; expanded keeps cards
- Sort column, direction, and view preference persisted in localStorage
- P&L column shows unrealised gain/loss when a PnL entry exists
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@Escelit Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

A14: Sortable position table + compact view toggle

1 participant