feat(tui): interactive book level cursor with cumulative readout#33
Merged
feat(tui): interactive book level cursor with cumulative readout#33
Conversation
Market Detail view gains an order-book cursor. ↑/↓ activates a cursor at the best ask/bid; subsequent presses walk visually through the book, crossing the mid between best ask and best bid, clamping at the deepest visible level on each side. The selected row is highlighted. The bottom line of the book panel swaps from the buy/sell pressure bar to a cumulative readout for the selected level: side+index, price, qty, cumulative qty from top of book, cumulative notional (Σ price × qty level-by-level), and distance from mid in basis points. Cursor is cleared on: - first Esc press (second Esc exits Detail — familiar two-step) - D (depth change invalidates index bounds) - k / m (switching to chart or compare views) - entering Detail on a different instrument - WS/REST book update that shrinks the cursor's side to zero Pure helpers (cursor_up / cursor_down / clamp_cursor / cumulative_at / bps_from_mid) are unit-tested without AppState. 11 new tests cover movement, mid-crossing, clamping, empty-book edge cases, per-level notional math, and signed bps distance. Mutation-verified against broken mid-crossing and the naive cum_qty × last_price shortcut. Help overlay "Detail View" page updated to document ↑↓ + new Esc semantics. Refs #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #26 (Piece 2 — level-scroll cursor + cumulative-depth readout). Piece 1 shipped in #31.
Summary
Test plan
Design decisions worth flagging