feat(hub): enrich AI coach with fund history, closed trades, and chat uploads

- Add 15-day fund snapshot store and /api/hub/account on all instances

- Summary includes yesterday/today trades, fund columns, and section 5 操作建议

- Chat context distinguishes empty positions from local monitors

- Support image/document attachments in AI chat

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-07 08:54:20 +08:00
parent 51c59b073b
commit 62e48dab92
19 changed files with 947 additions and 106 deletions
+62 -4
View File
@@ -3719,15 +3719,73 @@ body.hub-page-ai #page-ai {
opacity: 1;
}
}
.ai-closed-trades-wrap {
margin: 0 0 12px;
}
.ai-closed-trades-title {
margin: 0 0 6px;
font-size: 0.82rem;
font-weight: 600;
color: var(--accent-2, var(--accent));
}
.ai-msg-attachments {
display: flex;
flex-wrap: wrap;
gap: 6px;
padding: 0 4px;
}
.ai-attach-chip {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 999px;
font-size: 0.72rem;
color: var(--muted);
background: var(--inset-surface);
border: 1px solid var(--border-soft);
}
.ai-chat-form {
display: grid;
grid-template-columns: 1fr auto;
gap: 8px;
align-items: end;
flex-shrink: 0;
padding-top: 4px;
border-top: 1px solid var(--border-soft);
}
.ai-chat-compose {
display: flex;
flex-direction: column;
gap: 8px;
}
.ai-chat-compose-actions {
display: flex;
align-items: center;
gap: 8px;
justify-content: flex-end;
}
.ai-chat-upload-btn {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 36px;
padding: 0 12px;
border-radius: 8px;
border: 1px solid var(--border-soft);
background: var(--inset-surface);
color: var(--text);
font-size: 0.82rem;
cursor: pointer;
}
.ai-chat-upload-btn:hover {
border-color: var(--accent);
color: var(--accent);
}
.ai-chat-files-label {
flex: 1;
min-width: 0;
font-size: 0.72rem;
color: var(--muted);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ai-chat-form textarea {
width: 100%;
resize: none;