Fix options position bar layout so Put badge and contract id display on one line.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-09 17:37:24 +08:00
parent 3d11b91869
commit af7a397816
2 changed files with 26 additions and 9 deletions
+23 -6
View File
@@ -3305,23 +3305,39 @@ html[data-theme="light"] .options-estimate-row {
align-items: center;
gap: 6px;
min-width: 0;
flex: 1;
flex: 1 1 auto;
flex-wrap: nowrap;
overflow: hidden;
}
.opt-pos-bar .pos-side-badge {
white-space: nowrap;
flex-shrink: 0;
padding: 2px 6px;
font-size: 0.62rem;
line-height: 1.15;
}
.opt-pos-cards--accordion .opt-pos-bar-meta {
display: none;
}
.opt-pos-bar-side {
display: flex;
align-items: center;
gap: 10px;
flex-direction: column;
align-items: flex-end;
justify-content: center;
gap: 1px;
flex-shrink: 0;
font-variant-numeric: tabular-nums;
min-width: 3.6rem;
}
.opt-pos-bar-title {
font-size: 0.72rem;
font-size: 0.68rem;
font-weight: 600;
color: #fff;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 11rem;
flex: 1 1 auto;
min-width: 5.5rem;
}
.opt-pos-bar-meta {
font-size: 0.66rem;
@@ -3335,9 +3351,10 @@ html[data-theme="light"] .options-estimate-row {
}
.opt-pos-bar-pnl,
.opt-pos-bar-roi {
font-size: 0.72rem;
font-size: 0.68rem;
font-weight: 600;
white-space: nowrap;
line-height: 1.15;
}
.opt-pos-bar-chevron {
display: inline-block;
+3 -3
View File
@@ -482,15 +482,15 @@
'<button type="button" class="opt-pos-bar" aria-expanded="' + (expanded ? "true" : "false") + '">' +
'<span class="opt-pos-bar-main">' +
'<span class="opt-pos-bar-chevron" aria-hidden="true">▶</span>' +
'<strong class="opt-pos-bar-title">' + inst + "</strong>" +
'<strong class="opt-pos-bar-title" title="' + inst + '">' + inst + "</strong>" +
'<span class="pos-side-badge ' + sideCls + '">' + optTypeLabel(p.opt_type) + "</span>" +
'<span class="opt-pos-bar-meta">行权 ' + fmt(p.strike, 0) + " · " + fmt(p.pos, 0) + "张</span>" +
"</span>" +
'<span class="opt-pos-bar-side">' +
(expAttr
? '<span class="opt-pos-bar-cd">到期 <span class="opt-expiry-cd" data-opt-exp-ms="' + expAttr + '">—</span></span>'
? '<span class="opt-pos-bar-cd"><span class="opt-expiry-cd" data-opt-exp-ms="' + expAttr + '">—</span></span>'
: "") +
'<span class="opt-pos-bar-pnl ' + uplCls + '">' + fmt(p.upl, 2) + " USDC</span>" +
'<span class="opt-pos-bar-pnl ' + uplCls + '">' + fmt(p.upl, 2) + "</span>" +
'<span class="opt-pos-bar-roi ' + uplCls + '">' +
(p.upl_ratio_pct != null ? fmt(p.upl_ratio_pct, 2) + "%" : "—") + "</span>" +
"</span>" +