Skip to content

Commit 4f1c32e

Browse files
Pigbibicursoragent
andcommitted
Move reserve amount inputs under margin control on the left column.
Place min reserved cash and reserve ratio beneath allow-margin in margin-policy-stack so the left column is filled and the right column only shows reserve policy mode. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 14bb9be commit 4f1c32e

3 files changed

Lines changed: 25 additions & 14 deletions

File tree

tests/strategy_switch_worker_validation.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ assert.ok(indexHtml.includes('qmt: { label: "QMT"'));
4545
assert.ok(indexHtml.includes('cn_industry_etf_rotation'));
4646
assert.ok(indexHtml.includes('id="income-layer-section"'));
4747
assert.ok(indexHtml.includes('id="option-overlay-section"'));
48+
assert.ok(indexHtml.includes('id="margin-policy-stack"'));
49+
assert.ok(indexHtml.includes('class="margin-policy-stack"'));
4850
assert.ok(indexHtml.includes('id="reserve-policy-stack"'));
4951
assert.ok(indexHtml.includes('class="reserve-policy-stack"'));
5052
assert.ok(indexHtml.includes('id="reserve-amounts-row"'));
5153
assert.ok(indexHtml.includes('class="reserve-amounts-row"'));
52-
assert.equal(indexHtml.includes('id="margin-policy-stack"'), false);
5354
assert.ok(indexHtml.includes("cash_only_execution_mode: item.cash_only_execution_mode"));
5455
assert.ok(indexHtml.includes("function incomeLayerFieldsConfigured("));
5556
assert.ok(indexHtml.includes("function effectiveIncomeLayerForAccount("));

web/strategy-switch-console/index.html

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -352,14 +352,21 @@
352352
min-width: 0;
353353
}
354354

355+
.margin-policy-stack {
356+
display: grid;
357+
gap: 14px;
358+
min-width: 0;
359+
}
360+
355361
.reserve-amounts-row {
356362
display: grid;
357363
grid-template-columns: repeat(2, minmax(0, 1fr));
358364
gap: 14px;
359365
min-width: 0;
360366
}
361367

362-
.reserve-policy-stack.policy-stack-muted {
368+
.reserve-policy-stack.policy-stack-muted,
369+
.reserve-amounts-row.policy-stack-muted {
363370
opacity: 0.58;
364371
}
365372

@@ -1437,17 +1444,11 @@ <h3 class="execution-cash-policy-heading" data-i18n="executionCashPolicyTitle">
14371444
<p class="execution-cash-policy-note" id="execution-cash-policy-note" data-i18n="executionCashPolicyNote">允许融资与预留现金覆盖不能同时生效。</p>
14381445
<p class="execution-cash-policy-note qmt-platform-cash-note" id="qmt-platform-cash-note" hidden data-i18n="qmtPlatformCashNote">A 股 QMT 不使用 margin / 平台预留现金;现金约束在策略参数 execution_cash_reserve_ratio 内配置。</p>
14391446
<div class="execution-cash-policy-grid" id="execution-cash-policy-grid">
1440-
<label class="control-block cash-only-mode-block policy-block" id="cash-only-policy-block">
1441-
<span data-i18n="cashOnlyExecutionMode">允许融资</span>
1442-
<select id="cash-only-execution-mode-select"></select>
1443-
<span class="selection-meta" id="cash-only-execution-mode-meta"></span>
1444-
</label>
1445-
1446-
<div class="reserve-policy-stack" id="reserve-policy-stack">
1447-
<label class="control-block reserve-policy-block policy-block" id="reserve-policy-block">
1448-
<span data-i18n="reservedCashMode">预留现金策略</span>
1449-
<select id="reserve-policy-mode-select"></select>
1450-
<span class="selection-meta" id="reserve-policy-mode-meta" data-i18n="reservedCashModeMeta">选择是否沿用、清空或覆盖平台预留现金。</span>
1447+
<div class="margin-policy-stack" id="margin-policy-stack">
1448+
<label class="control-block cash-only-mode-block policy-block" id="cash-only-policy-block">
1449+
<span data-i18n="cashOnlyExecutionMode">允许融资</span>
1450+
<select id="cash-only-execution-mode-select"></select>
1451+
<span class="selection-meta" id="cash-only-execution-mode-meta"></span>
14511452
</label>
14521453

14531454
<div class="reserve-amounts-row" id="reserve-amounts-row">
@@ -1464,6 +1465,14 @@ <h3 class="execution-cash-policy-heading" data-i18n="executionCashPolicyTitle">
14641465
</label>
14651466
</div>
14661467
</div>
1468+
1469+
<div class="reserve-policy-stack" id="reserve-policy-stack">
1470+
<label class="control-block reserve-policy-block policy-block" id="reserve-policy-block">
1471+
<span data-i18n="reservedCashMode">预留现金策略</span>
1472+
<select id="reserve-policy-mode-select"></select>
1473+
<span class="selection-meta" id="reserve-policy-mode-meta" data-i18n="reservedCashModeMeta">选择是否沿用、清空或覆盖平台预留现金。</span>
1474+
</label>
1475+
</div>
14671476
</div>
14681477
</div>
14691478

@@ -3801,6 +3810,7 @@ <h2 data-i18n="summary">切换摘要</h2>
38013810
el("min-reserve-block").classList.toggle("policy-block-muted", marginBlocksReserve);
38023811
el("reserve-ratio-block").classList.toggle("policy-block-muted", marginBlocksReserve);
38033812
el("reserve-policy-stack").classList.toggle("policy-stack-muted", marginBlocksReserve);
3813+
el("reserve-amounts-row").classList.toggle("policy-stack-muted", marginBlocksReserve);
38043814
el("reserve-policy-mode-meta").textContent = marginBlocksReserve
38053815
? t("executionCashMarginBlocksReserve")
38063816
: t("reservedCashModeMeta");

web/strategy-switch-console/page_asset.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)