feat: add streaming unified review assistant

This commit is contained in:
leefer
2026-07-23 00:25:43 +08:00
parent 7d8d270e98
commit 0f4bed17c9
11 changed files with 638 additions and 1 deletions
+58
View File
@@ -11530,3 +11530,61 @@ button.account-role-badge:focus-visible { outline: 2px solid var(--blue); outlin
.trade-log-form-grid,
.trade-log-text-grid { grid-template-columns: 1fr; }
}
.assistant-button.member-locked-control { color: var(--text-secondary); opacity: 0.72; }
.assistant-dialog { width: min(820px, calc(100vw - 32px)); max-height: min(860px, calc(100dvh - 32px)); }
.assistant-messages { min-height: 320px; max-height: min(540px, calc(100dvh - 340px)); overflow-y: auto; padding: 18px; background: var(--surface-muted); scroll-behavior: smooth; }
.assistant-message { max-width: 88%; margin-bottom: 14px; }
.assistant-message.user { margin-left: auto; }
.assistant-message-label { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; color: var(--text-secondary); font-size: 10px; }
.assistant-message.user .assistant-message-label { justify-content: flex-end; }
.assistant-message-content {
padding: 11px 13px;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--surface);
font-size: 13px;
line-height: 1.72;
overflow-wrap: anywhere;
}
.assistant-message.user .assistant-message-content { border-color: #bed2eb; background: var(--action-soft); }
.assistant-message.is-error .assistant-message-content { border-color: #efc5c8; background: var(--market-up-soft); color: #8b2f34; }
.assistant-message-content p { margin: 0 0 8px; }
.assistant-message-content p:last-child { margin-bottom: 0; }
.assistant-thinking { color: var(--text-secondary); }
.assistant-stream-caret {
display: inline-block;
width: 6px;
height: 14px;
margin: 0 0 -2px 3px;
background: var(--action);
animation: assistant-caret 900ms steps(1) infinite;
}
@keyframes assistant-caret { 50% { opacity: 0; } }
.assistant-quick-prompts { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface); }
.assistant-quick-prompts button { min-height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text-secondary); cursor: pointer; font: inherit; font-size: 11px; transition: border-color var(--motion-fast) ease, color var(--motion-fast) ease, background-color var(--motion-fast) ease; }
.assistant-quick-prompts button:hover { border-color: var(--action); background: var(--action-soft); color: var(--action); }
.assistant-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 14px 18px; border-top: 1px solid var(--border); }
.assistant-form textarea { width: 100%; min-height: 76px; max-height: 180px; resize: vertical; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--text); font: inherit; line-height: 1.6; }
.assistant-form textarea:focus { border-color: var(--action); outline: 2px solid color-mix(in srgb, var(--action) 20%, transparent); outline-offset: 1px; }
.assistant-form-actions { display: flex; gap: 8px; }
.assistant-disclaimer { margin: 0; padding: 0 18px 14px; color: var(--text-secondary); font-size: 10px; }
@media (max-width: 720px) {
.assistant-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: 8px auto; }
.assistant-messages { min-height: 260px; max-height: calc(100dvh - 390px); padding: 13px; }
.assistant-message { max-width: 96%; }
.assistant-form { grid-template-columns: 1fr; }
.assistant-form textarea { font-size: 16px; }
.assistant-form-actions { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
.assistant-stream-caret { animation: none; }
.assistant-messages { scroll-behavior: auto; }
}