feat(hub-ai): paste screenshots in chat and include position TP/SL in coach context

Let users paste images into AI chat with removable pending attachments, and feed exchange/monitor stop-loss and take-profit into trading coach snapshots so replies reflect actual protection on open positions.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-14 01:53:24 +08:00
parent 42c06c0f38
commit 28a23008f3
5 changed files with 389 additions and 45 deletions
+48 -11
View File
@@ -4467,14 +4467,8 @@ body.hub-page-ai #page-ai {
width: 100%;
}
body.hub-page-ai .ai-chat-files-label {
flex: 1;
min-width: 0;
font-size: 0.68rem;
}
body.hub-page-ai .ai-chat-files-label:empty {
display: none;
body.hub-page-ai .ai-chat-pending-list {
width: 100%;
}
body.hub-page-ai .ai-chat-upload-btn,
@@ -5140,15 +5134,58 @@ body.hub-page-ai #page-ai {
border-color: var(--accent);
color: var(--accent);
}
.ai-chat-files-label {
flex: 1;
min-width: 0;
.ai-chat-pending-list {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.ai-chat-pending-list[hidden] {
display: none;
}
.ai-chat-pending-chip {
display: inline-flex;
align-items: center;
gap: 4px;
max-width: 100%;
padding: 2px 4px 2px 8px;
border-radius: 999px;
font-size: 0.72rem;
color: var(--text);
background: var(--inset-surface);
border: 1px solid var(--border-soft);
}
.ai-chat-pending-kind {
flex-shrink: 0;
font-size: 0.65rem;
color: var(--muted);
}
.ai-chat-pending-name {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ai-chat-pending-del {
flex-shrink: 0;
min-width: 22px;
min-height: 22px;
padding: 0;
border: none;
border-radius: 999px;
background: transparent;
color: var(--muted);
font-size: 0.95rem;
line-height: 1;
cursor: pointer;
}
.ai-chat-pending-del:hover {
color: var(--red);
background: color-mix(in srgb, var(--red) 12%, transparent);
}
.ai-chat-pending-del:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.ai-chat-form textarea {
width: 100%;
resize: none;