Tighten 期期 parameter UI: compact controls, less copy.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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"))
|
||||
|
||||
@@ -3253,17 +3253,42 @@ html[data-theme="light"] .opt-be-dist-down {
|
||||
color: #ff8a8a;
|
||||
}
|
||||
.hedge-plan-page-wrap .hp-oo-legs {
|
||||
margin-top: 8px;
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
.hedge-plan-page-wrap .hp-oo-size-row {
|
||||
.hedge-plan-page-wrap .hp-oo-controls {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 10px 14px;
|
||||
margin: 10px 0 4px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
.hedge-plan-page-wrap .hp-oo-ctrl {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
.hedge-plan-page-wrap .hp-oo-ctrl-lab {
|
||||
font-size: 0.72rem;
|
||||
color: var(--muted, #8b949e);
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
.hedge-plan-page-wrap .hp-oo-seg {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin: 6px 0 2px;
|
||||
gap: 6px;
|
||||
}
|
||||
.hedge-plan-page-wrap .hp-oo-seg .btn-secondary {
|
||||
flex: 1 1 auto;
|
||||
min-width: 4.5em;
|
||||
justify-content: center;
|
||||
padding: 5px 8px;
|
||||
}
|
||||
.hedge-plan-page-wrap .hp-oo-size-mode.active,
|
||||
.hedge-plan-page-wrap .hp-oo-close-mode.active {
|
||||
@@ -3271,13 +3296,25 @@ html[data-theme="light"] .opt-be-dist-down {
|
||||
color: var(--text, #fff);
|
||||
background: rgba(0, 212, 255, 0.12);
|
||||
}
|
||||
.hedge-plan-page-wrap #hp-oo-close-mode-row.hidden,
|
||||
.hedge-plan-page-wrap #hp-oo-close-mode-hint.hidden {
|
||||
.hedge-plan-page-wrap #hp-oo-close-mode-row.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
.hedge-plan-page-wrap .hp-oo-controls:has(#hp-oo-close-mode-row.hidden) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.hedge-plan-page-wrap .hp-oo-meta {
|
||||
margin: 4px 0 0;
|
||||
font-size: 0.75rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.hedge-plan-page-wrap #hp-oo-budget-line.hp-oo-budget-warn {
|
||||
color: #ff8a8a;
|
||||
}
|
||||
@media (max-width: 720px) {
|
||||
.hedge-plan-page-wrap .hp-oo-controls {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
.hedge-plan-page-wrap .hp-oo-leg-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
Reference in New Issue
Block a user