feat(hub): enlarge archive quotes panel and show full text on expand
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5493,7 +5493,7 @@ body.funds-fullscreen-open {
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 12px;
|
||||
min-height: 100%;
|
||||
min-height: calc(100vh - 200px);
|
||||
overflow: hidden;
|
||||
}
|
||||
.archive-panel-head {
|
||||
@@ -5527,9 +5527,12 @@ body.funds-fullscreen-open {
|
||||
font-size: 0.82rem;
|
||||
resize: vertical;
|
||||
}
|
||||
.archive-quote-form textarea {
|
||||
min-height: 110px;
|
||||
}
|
||||
.archive-quotes-list {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
min-height: 420px;
|
||||
overflow: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -5543,13 +5546,21 @@ body.funds-fullscreen-open {
|
||||
}
|
||||
.archive-quote-summary {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
grid-template-columns: auto 1fr auto;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
padding: 8px 10px;
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
}
|
||||
.archive-quote-open-hint {
|
||||
font-size: 0.7rem;
|
||||
color: var(--accent);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.archive-quote-card[open] .archive-quote-open-hint {
|
||||
color: var(--muted);
|
||||
}
|
||||
.archive-quote-summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
@@ -5572,9 +5583,21 @@ body.funds-fullscreen-open {
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
.archive-quote-full {
|
||||
padding: 10px 12px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border-soft);
|
||||
background: var(--panel);
|
||||
color: var(--text);
|
||||
font-size: 0.82rem;
|
||||
line-height: 1.55;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
max-height: none;
|
||||
}
|
||||
.archive-quote-edit {
|
||||
width: 100%;
|
||||
min-height: 72px;
|
||||
min-height: 160px;
|
||||
padding: 8px 10px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border-soft);
|
||||
@@ -5583,6 +5606,8 @@ body.funds-fullscreen-open {
|
||||
font-family: var(--font);
|
||||
font-size: 0.8rem;
|
||||
resize: vertical;
|
||||
line-height: 1.55;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.archive-quote-actions {
|
||||
display: flex;
|
||||
@@ -5914,8 +5939,11 @@ body.funds-fullscreen-open {
|
||||
min-height: 0;
|
||||
}
|
||||
.archive-quotes-panel {
|
||||
min-height: 280px;
|
||||
max-height: 320px;
|
||||
min-height: 360px;
|
||||
max-height: none;
|
||||
}
|
||||
.archive-quotes-list {
|
||||
min-height: 220px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -480,6 +480,22 @@
|
||||
return s.length > 36 ? s.slice(0, 36) + "…" : s;
|
||||
}
|
||||
|
||||
function quoteEditRows(text) {
|
||||
const t = String(text || "");
|
||||
const lines = t.split(/\n/).length;
|
||||
const wrapLines = Math.ceil(t.length / 26);
|
||||
return Math.min(32, Math.max(8, lines, wrapLines));
|
||||
}
|
||||
|
||||
function resizeQuoteTextarea(ta) {
|
||||
if (!ta) return;
|
||||
ta.style.height = "auto";
|
||||
const lines = String(ta.value || "").split("\n").length;
|
||||
const wrapLines = Math.ceil(String(ta.value || "").length / 26);
|
||||
ta.rows = Math.min(32, Math.max(8, lines, wrapLines));
|
||||
ta.style.height = Math.max(ta.scrollHeight, 160) + "px";
|
||||
}
|
||||
|
||||
function renderQuotes() {
|
||||
if (!elQuotesList) return;
|
||||
if (elQuotesCount) {
|
||||
@@ -500,11 +516,17 @@
|
||||
'<span class="archive-quote-preview">' +
|
||||
esc(quotePreview(q.content)) +
|
||||
"</span>" +
|
||||
'<span class="archive-quote-open-hint">查看</span>' +
|
||||
"</summary>" +
|
||||
'<div class="archive-quote-body">' +
|
||||
'<div class="archive-quote-full">' +
|
||||
esc(q.content || "(空)") +
|
||||
"</div>" +
|
||||
'<textarea class="archive-quote-edit" data-id="' +
|
||||
q.id +
|
||||
'" rows="4">' +
|
||||
'" rows="' +
|
||||
quoteEditRows(q.content) +
|
||||
'">' +
|
||||
esc(q.content) +
|
||||
"</textarea>" +
|
||||
'<div class="archive-quote-actions">' +
|
||||
@@ -519,6 +541,12 @@
|
||||
})
|
||||
.join("");
|
||||
|
||||
elQuotesList.querySelectorAll(".archive-quote-card").forEach(function (card) {
|
||||
card.addEventListener("toggle", function () {
|
||||
if (!card.open) return;
|
||||
resizeQuoteTextarea(card.querySelector(".archive-quote-edit"));
|
||||
});
|
||||
});
|
||||
elQuotesList.querySelectorAll(".archive-quote-save").forEach(function (btn) {
|
||||
btn.addEventListener("click", function () {
|
||||
const id = btn.getAttribute("data-id");
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" media="print" onload="this.media='all'" />
|
||||
<noscript><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" /></noscript>
|
||||
<link rel="stylesheet" href="/assets/app.css?v=20260612-time-close-table" />
|
||||
<link rel="stylesheet" href="/assets/app.css?v=20260612-archive-quotes" />
|
||||
<link rel="stylesheet" href="/assets/dashboard.css?v=20260612-dash-monitor-count" />
|
||||
</head>
|
||||
<body>
|
||||
@@ -302,7 +302,7 @@
|
||||
</div>
|
||||
<form id="archive-quote-form" class="archive-quote-form">
|
||||
<input id="archive-quote-date" type="date" required />
|
||||
<textarea id="archive-quote-content" rows="3" placeholder="今日复盘心得…" required></textarea>
|
||||
<textarea id="archive-quote-content" rows="5" placeholder="今日复盘心得…" required></textarea>
|
||||
<button type="submit" class="primary">添加语录</button>
|
||||
</form>
|
||||
<div id="archive-quotes-list" class="archive-quotes-list"></div>
|
||||
@@ -584,7 +584,7 @@
|
||||
<script src="https://unpkg.com/lightweight-charts@4.2.0/dist/lightweight-charts.standalone.production.js"></script>
|
||||
<script src="/assets/chart_draw.js?v=20260609-market-day-split"></script>
|
||||
<script src="/assets/chart.js?v=20260609-market-day-split"></script>
|
||||
<script src="/assets/archive.js?v=20260612-trade-row-click"></script>
|
||||
<script src="/assets/archive.js?v=20260612-archive-quotes"></script>
|
||||
<script src="/assets/funds.js?v=20260609-hub-funds-fold"></script>
|
||||
<script src="/assets/dashboard.js?v=20260612-dash-monitor-count"></script>
|
||||
<script src="/assets/ai_review_render.js?v=3"></script>
|
||||
|
||||
Reference in New Issue
Block a user