TUI: press Enter on book-cursor level to prefill place-order modal

オープン
#34 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@llcro がすでに取り組んでいます。

2026年5月6日 から。

  • #35 @llcro による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
rust
領域
cli

調査の方向性

Market Detail view の book_cursor 処理と、t で開かれる既存の PlaceOrderWorkflow から始め、paper_engine の経路も追跡します。Enter ブランチと prefill の導出を追加し、bid/ask のサイド反転と paper-mode の動作を確認します。Detail View のヘルプオーバーレイとアクティブカーソルのフッターを更新し、モーダルに選択した指値価格と数量が表示されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Context

#33 (merged as part of #26 Piece 2) added an interactive book-level cursor on Market Detail view. The cursor lets the user inspect a specific price level — but they can't yet act on it. The natural next step: pressing Enter on a selected level opens the place-order workflow prefilled with that price.

This is the punchline of the cursor work. Without it, Piece 2 is look-but-don't-touch.

Proposed behavior

On Market Detail view with `book_cursor` active, pressing Enter:

  1. Opens the existing place-order workflow (`PlaceOrderWorkflow`, same one `t` triggers).

  2. Prefills:

    • instrument = `detail_instrument`
    • side: opposite of cursor side — `BookCursor::Bid() → SELL` (you're selling into the bid), `BookCursor::Ask() → BUY` (you're buying from the ask).
    • order type = LIMIT (price-aware — MARKET wouldn't make sense given we're explicitly using the selected price).
    • price = the selected level's price, formatted per the instrument's price tick.
    • qty = the selected level's qty. User is free to override. Rationale: "how much is at this level" is a common starting quote; the user will almost always adjust.
  3. Cursor clears on entry (consistent with how `t`, `k`, `m`, `D` already clear it).

UX questions to resolve during implementation

  • Is prefilling qty the right default? Alternatives: leave it empty (force user to type), or use the selected level's cumulative qty (i.e. "sweep through this level"). I lean empty or level-qty. Cumulative is a power-user ask; wait for demand.
  • LIMIT vs LIMIT_POST_ONLY? Limit orders that cross the spread immediately become takers. For maker-intent users the POST_ONLY variant is safer. Propose: LIMIT by default, user can flip to POST_ONLY in the modal.
  • Paper mode? Prefill must work in paper mode too (routes through `paper_engine` instead of REST). Already how `t` behaves; nothing new here, just don't forget to test it.

Scope

In scope:

  • Wire `Enter` on Detail view (only when `book_cursor.is_some()`).
  • Prefill logic in `PlaceOrderWorkflow::new_with_prefill` or an equivalent constructor.
  • Tests: prefill derivation is pure logic — cursor + book → workflow init params. Mutation-verify the side flip (ask → BUY, bid → SELL).
  • Help overlay "Detail View" page updated with `Enter: place limit @ level`.
  • Footer hint updated when cursor active: add `Enter:trade@level`.

Out of scope:

  • Multi-level sweeps / aggregation.
  • MARKET prefill (doesn't make semantic sense when the user explicitly picked a price).
  • Stop / OCO / OTOCO prefill from the cursor — separate workflows, can extend later if demanded.
  • Mouse-click on level to set cursor then Enter — separate UX polish (click-only trade would need a double-click or modifier to avoid accidents).

Risk

  • Low. Reuses `PlaceOrderWorkflow`; new code is the prefill constructor + one Enter branch.
  • Biggest risk: wrong side flip (buying into a bid is not what the user meant). Tests and a clear footer label (`SELL @ 78,550` shown in the modal header) mitigate.

Related

  • #26 — parent feature (Pieces 1 + 2 now merged).
  • #33 — Piece 2 PR; shipped the `book_cursor` state this issue builds on.
  • #32 — session persistence; orthogonal but might eventually persist a "default prefill qty mode" (empty vs level-qty) if users have strong preferences.

Agent-native parity

The equivalent agent action is `cdcx trade limit --side SELL --price

--qty ` — already shipped. An MCP-side helper that reads the book and emits the corresponding trade params would cleanly mirror the TUI binding; file as a separate issue only if we hear demand.

主要言語
Rust
スター
27
フォーク
9
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

crypto-com/cdcx-cli のほかの issue

crypto-com/cdcx-cli の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。