Tighten 期期 parameter UI: compact controls, less copy.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-19 08:10:12 +08:00
parent 3119486105
commit 79420904f4
3 changed files with 77 additions and 29 deletions
+16 -9
View File
@@ -300,9 +300,7 @@
function syncOoCloseModeUI() {
const enabled = !!state.ooCloseModeEnabled;
const row = $("hp-oo-close-mode-row");
const hint = $("hp-oo-close-mode-hint");
if (row) row.classList.toggle("hidden", !enabled);
if (hint) hint.classList.toggle("hidden", !enabled);
if (!enabled) state.ooCloseMode = "hold_expiry";
document.querySelectorAll(".hp-oo-close-mode").forEach(function (b) {
const on = b.getAttribute("data-oo-close") === state.ooCloseMode;
@@ -314,16 +312,23 @@
const line = $("hp-oo-budget-line");
if (!line) return;
const b = resolveOoBudget();
const modeLabel = state.ooSheetsMode === "split_budget" ? "均分预算" : "同张数";
const parts = [
"预算 min(交易×" + fmt(b.buf, 2) + ", 单笔) ≈ " + fmt(b.budget, 2) + " USDC",
"模式:" + modeLabel,
];
if (b.tradingCap != null) parts.push("交易×缓冲 " + fmt(b.tradingCap, 2));
if (b.tradeCap != null) parts.push("单笔上限 " + fmt(b.tradeCap, 2));
const sizeLabel = state.ooSheetsMode === "split_budget" ? "均分" : "同张数";
const closeLabel = !state.ooCloseModeEnabled
? ""
: state.ooCloseMode === "hold_expiry"
? "到期平"
: "全平";
const parts = ["可用 " + fmt(b.budget, 2) + "U", sizeLabel];
if (closeLabel) parts.push(closeLabel);
if (extra && extra.msg) parts.push(extra.msg);
else if (b.msg) parts.push(b.msg);
line.textContent = parts.join(" · ");
line.title =
"预算=min(交易×" +
fmt(b.buf, 2) +
", 单笔)" +
(b.tradingCap != null ? " · 交易×缓冲 " + fmt(b.tradingCap, 2) : "") +
(b.tradeCap != null ? " · 单笔 " + fmt(b.tradeCap, 2) : "");
line.classList.toggle("hp-oo-budget-warn", !!(extra && extra.msg) || !b.ok);
}
@@ -975,6 +980,7 @@
state.ooSheetsMode = b.getAttribute("data-oo-size") || "same_sheets";
syncOoSizeModeUI();
autoFillOoSheets();
updateOoBudgetLine(null);
});
});
document.querySelectorAll(".hp-oo-close-mode").forEach(function (b) {
@@ -983,6 +989,7 @@
state.ooCloseMode = b.getAttribute("data-oo-close") || "close_all";
state._ooCloseModeTouched = true;
syncOoCloseModeUI();
updateOoBudgetLine(null);
});
});
if ($("hp-preview-btn"))