feat: ship persistent ai playground and alerts foundation

This commit is contained in:
linkong committed 2026-04-10 15:57:34 +08:00
1 parent 60f5ff9bab
commit 89a71e6f29
31 files changed
+4754 -669

No files matched your search

+682 -3
View File
@@ -190,6 +190,11 @@ body {
min-height: 0;
}
.playground-page {
height: 100%;
min-height: 0;
}
.playground-page__grid {
flex: 1 1 auto;
min-height: 0;
@@ -198,11 +203,15 @@ body {
}
.playground-page__body {
flex: 1 1 auto;
min-height: 0;
display: flex;
overflow: hidden;
}
.playground-shell {
flex: 1 1 auto;
height: 100%;
min-height: 0;
display: flex;
gap: 12px;
@@ -303,6 +312,7 @@ body {
.playground-card--workspace {
flex: 1 1 auto;
height: 100%;
}
.playground-card--workspace .ant-card-body,
@@ -310,6 +320,405 @@ body {
overflow: hidden;
}
.playground-chat {
flex: 1 1 auto;
min-height: 0;
}
.playground-chat .ant-card-body {
display: flex;
flex-direction: column;
gap: 14px;
padding: 16px 18px 18px;
min-height: 0;
overflow: hidden;
}
.playground-chat__messages {
flex: 1 1 auto;
min-height: 0;
height: 100%;
overflow: auto;
display: flex;
flex-direction: column;
gap: 14px;
padding-right: 4px;
overscroll-behavior: contain;
}
.playground-chat__messages-shell {
position: relative;
flex: 1 1 auto;
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
.playground-chat__scroll-bottom.ant-btn {
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 12px;
width: 38px;
height: 38px;
border-radius: 999px;
border: 1px solid rgba(15, 23, 42, 0.1);
background: rgba(255, 255, 255, 0.94);
color: #0f172a;
box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
backdrop-filter: blur(8px);
}
.playground-chat__scroll-bottom.ant-btn:hover,
.playground-chat__scroll-bottom.ant-btn:focus {
background: #ffffff !important;
color: #0f766e !important;
border-color: rgba(15, 118, 110, 0.2) !important;
}
.playground-chat__composer {
flex: 0 0 auto;
border-top: 1px solid rgba(148, 163, 184, 0.18);
padding-top: 14px;
}
.playground-chat__input-wrap {
border-radius: 18px;
border: 1px solid rgba(148, 163, 184, 0.22);
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
padding: 12px;
}
.playground-chat__input.ant-input {
border: 0;
box-shadow: none;
padding: 6px 2px 2px;
resize: none;
background: transparent;
margin-top: 10px;
}
.playground-chat__input.ant-input:focus,
.playground-chat__input.ant-input-focused {
box-shadow: none;
}
.playground-chat__actions {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-top: 10px;
padding-top: 10px;
border-top: 1px solid rgba(148, 163, 184, 0.16);
}
.playground-chat__hints {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.playground-chat__send-button.ant-btn {
width: 40px;
height: 40px;
border-radius: 999px;
border: 1px solid rgba(15, 23, 42, 0.12);
background: #0f172a;
color: #f8fafc;
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}
.playground-chat__send-button.ant-btn:hover,
.playground-chat__send-button.ant-btn:focus {
background: #111827 !important;
color: #ffffff !important;
border-color: transparent !important;
}
.playground-chat__send-button--stop.ant-btn {
background: #7f1d1d;
}
.playground-chat__send-button--stop.ant-btn:hover,
.playground-chat__send-button--stop.ant-btn:focus {
background: #991b1b !important;
}
.playground-message {
display: flex;
align-items: flex-end;
gap: 10px;
}
.playground-message--system,
.playground-message--assistant {
justify-content: flex-start;
}
.playground-message--user {
flex-direction: row-reverse;
}
.playground-message__avatar {
flex: 0 0 auto;
}
.playground-message__body {
display: flex;
flex-direction: column;
min-width: 0;
max-width: min(100%, 760px);
}
.playground-message__body--editing {
width: min(100%, 760px);
flex: 0 1 min(100%, 760px);
}
.playground-message__avatar-inner {
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}
.playground-message__avatar-inner--assistant,
.playground-message__avatar-inner--system {
background: linear-gradient(135deg, #0f766e, #14b8a6) !important;
color: #f8fafc !important;
}
.playground-message__avatar-inner--user {
background: linear-gradient(135deg, #0f172a, #334155) !important;
color: #f8fafc !important;
}
.playground-message__bubble {
width: 100%;
border-radius: 18px;
padding: 14px 16px;
box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
border: 1px solid rgba(148, 163, 184, 0.18);
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
}
.playground-message--assistant .playground-message__bubble {
background:
linear-gradient(180deg, rgba(232, 244, 255, 0.95), rgba(240, 249, 255, 0.98));
border-color: rgba(56, 189, 248, 0.26);
}
.playground-message--system .playground-message__bubble {
background:
linear-gradient(180deg, rgba(255, 250, 235, 0.98), rgba(254, 249, 195, 0.72));
border-color: rgba(245, 158, 11, 0.24);
}
.playground-message--user .playground-message__bubble {
background:
linear-gradient(180deg, rgba(15, 118, 110, 0.94), rgba(13, 148, 136, 0.96));
border-color: rgba(15, 118, 110, 0.28);
color: #f8fafc;
}
.playground-message__bubble--loading {
display: inline-flex;
align-items: center;
gap: 10px;
}
.playground-message__head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-bottom: 10px;
}
.playground-message__head .ant-tag {
margin-inline-end: 0;
}
.playground-message__phase {
margin-bottom: 8px;
}
.playground-message__phase .ant-typography {
font-size: 12px;
color: #64748b;
}
.playground-message__thinking {
margin-bottom: 10px;
padding: 10px 12px;
border-radius: 12px;
border: 1px dashed rgba(148, 163, 184, 0.35);
background: rgba(255, 255, 255, 0.45);
}
.playground-message__thinking .ant-typography {
display: block;
margin-bottom: 6px;
font-size: 12px;
}
.playground-message--user .playground-message__head .ant-typography,
.playground-message--user .playground-message__content {
color: #f8fafc;
}
.playground-message__content {
margin: 0;
white-space: pre-wrap;
word-break: break-word;
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
font-size: 12px;
line-height: 1.65;
}
.playground-message__editor {
display: flex;
flex-direction: column;
gap: 10px;
width: 100%;
}
.playground-message__editor-input,
.playground-message__editor-input.ant-input,
.playground-message__editor-input.ant-input-affix-wrapper,
.playground-message__editor .ant-input-textarea,
.playground-message__editor .ant-input-textarea-show-count {
display: block;
width: 100%;
min-width: 0;
}
.playground-message__editor-input.ant-input,
.playground-message__editor .ant-input-textarea textarea.ant-input {
border-radius: 14px;
padding: 10px 12px;
background: rgba(255, 255, 255, 0.94);
color: #0f172a;
width: 100% !important;
min-width: 0;
}
.playground-message__editor-actions {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
}
.playground-message__editor-meta {
display: flex;
flex-wrap: wrap;
gap: 8px;
min-width: 0;
justify-content: flex-start;
flex: 1 1 auto;
}
.playground-message__editor-meta .ant-tag {
margin-inline-end: 0;
}
.playground-message__editor-buttons {
display: flex;
justify-content: flex-end;
gap: 8px;
flex: 0 0 auto;
margin-left: auto;
}
.playground-message__editor-buttons .ant-btn {
border-radius: 999px;
padding-inline: 12px;
font-size: 12px;
line-height: 1;
min-width: 56px;
}
.playground-message__editor-buttons .ant-btn-default {
border-color: rgba(148, 163, 184, 0.3);
color: #475569;
background: rgba(255, 255, 255, 0.82);
}
.playground-message__editor-buttons .ant-btn-default:hover,
.playground-message__editor-buttons .ant-btn-default:focus {
color: #0f172a !important;
border-color: rgba(100, 116, 139, 0.34) !important;
background: rgba(255, 255, 255, 0.92) !important;
}
.playground-message__editor-buttons .ant-btn-primary {
border-color: transparent;
background: linear-gradient(135deg, #0f172a, #334155);
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}
.playground-message__editor-buttons .ant-btn-primary:hover,
.playground-message__editor-buttons .ant-btn-primary:focus {
background: linear-gradient(135deg, #020617, #1e293b) !important;
border-color: transparent !important;
}
.playground-message__markdown {
font-size: 13px;
line-height: 1.7;
}
.playground-message__markdown .markdown-renderer {
color: inherit;
}
.playground-message__markdown .markdown-renderer > :last-child {
margin-bottom: 0;
}
.playground-message__markdown .markdown-renderer code {
background: rgba(15, 23, 42, 0.08);
}
.playground-message--assistant .playground-message__markdown .markdown-renderer blockquote {
background: rgba(255, 255, 255, 0.42);
}
.playground-message__meta {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 12px;
}
.playground-message__detail-action {
margin-top: 8px;
}
.playground-message__detail-action .ant-btn {
padding-inline: 0;
}
.playground-message__actions {
display: flex;
align-items: center;
gap: 2px;
margin-top: 6px;
padding-inline: 6px;
}
.playground-message__actions .ant-btn {
color: #64748b;
}
.playground-message__actions .ant-btn:hover {
color: #0f172a !important;
background: rgba(148, 163, 184, 0.12) !important;
}
.playground-tabs,
.playground-tabs .ant-tabs-content-holder,
.playground-tabs .ant-tabs-content,
@@ -397,6 +806,30 @@ body {
gap: 8px;
}
.playground-preset-strip--chat {
gap: 8px;
margin-bottom: 14px;
}
.playground-preset-strip__actions .ant-tag-checkable {
margin-inline-end: 0;
margin-bottom: 4px;
border-radius: 999px;
padding: 4px 12px;
}
.playground-preset-strip__actions .ant-tag-checkable-checked {
background: linear-gradient(135deg, #0f766e, #14b8a6);
color: #f8fafc;
border-color: transparent;
}
.playground-preset-strip__actions .ant-tag-checkable:not(.ant-tag-checkable-checked) {
background: rgba(15, 118, 110, 0.08);
border-color: rgba(15, 118, 110, 0.16);
color: #0f766e;
}
.playground-form__actions {
display: flex;
gap: 12px;
@@ -534,6 +967,11 @@ body {
gap: 12px;
}
.playground-service-modal__body {
display: grid;
gap: 12px;
}
.playground-note.ant-alert {
padding: 10px 12px;
}
@@ -621,6 +1059,21 @@ body {
gap: 12px;
}
.playground-chat__messages::-webkit-scrollbar {
width: 8px;
}
.playground-chat__messages::-webkit-scrollbar-thumb {
background: rgba(148, 163, 184, 0.82);
border-radius: 999px;
border: 2px solid transparent;
background-clip: padding-box;
}
.playground-chat__messages::-webkit-scrollbar-track {
background: transparent;
}
.playground-result__blocks-head {
display: flex;
align-items: center;
@@ -638,6 +1091,52 @@ body {
scrollbar-color: rgba(148, 163, 184, 0.88) transparent;
}
.playground-result__blocks-scroll--raw {
max-height: 240px;
}
.playground-result-modal .ant-modal-content {
overflow: hidden;
}
.playground-result-modal__body {
display: flex;
flex-direction: column;
gap: 14px;
height: min(76vh, 760px);
min-height: 0;
}
.playground-result-modal__head {
flex: 0 0 auto;
display: grid;
gap: 12px;
}
.playground-result-modal__content {
flex: 1 1 auto;
min-height: 0;
overflow: auto;
padding-right: 6px;
scrollbar-width: thin;
scrollbar-color: rgba(148, 163, 184, 0.88) transparent;
}
.playground-result-modal__content::-webkit-scrollbar {
width: 8px;
}
.playground-result-modal__content::-webkit-scrollbar-thumb {
background: rgba(148, 163, 184, 0.82);
border-radius: 999px;
border: 2px solid transparent;
background-clip: padding-box;
}
.playground-result-modal__content::-webkit-scrollbar-track {
background: transparent;
}
@media (max-width: 1200px) {
.playground-page__header {
align-items: flex-start;
@@ -652,9 +1151,7 @@ body {
}
.playground-shell__sidebar {
flex: 0 0 auto;
min-width: 0;
max-width: none;
display: none;
}
.playground-result__meta,
@@ -662,6 +1159,23 @@ body {
align-items: stretch;
flex-direction: column;
}
.playground-chat__actions {
align-items: center;
flex-direction: row;
justify-content: space-between;
gap: 10px;
}
.playground-chat__hints {
flex: 1 1 auto;
min-width: 0;
}
.playground-chat__send-button.ant-btn {
margin-left: auto;
flex: 0 0 auto;
}
}
@@ -1072,7 +1586,71 @@ body {
line-height: 1.5;
}
.alerts-page__body {
overflow: hidden;
}
.alerts-page__tabs,
.alerts-page__tabs .ant-tabs-content-holder,
.alerts-page__tabs .ant-tabs-content,
.alerts-page__tabs .ant-tabs-tabpane {
min-width: 0;
min-height: 0;
width: 100%;
height: 100%;
}
.alerts-page__tabs {
display: flex;
flex-direction: column;
}
.alerts-page__tabs .ant-tabs-nav {
flex: 0 0 auto;
margin-bottom: 8px;
}
.alerts-page__tabs .ant-tabs-content-holder {
flex: 1 1 auto;
overflow: hidden;
}
.alerts-page__tabs .ant-tabs-tabpane {
display: flex;
flex-direction: column;
overflow: hidden;
}
.alerts-tab-panel {
flex: 1 1 auto;
min-width: 0;
min-height: 0;
overflow: auto;
padding-right: 4px;
scrollbar-width: thin;
scrollbar-color: rgba(148, 163, 184, 0.88) transparent;
}
.alerts-tab-panel__head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16px;
}
.alerts-tab-panel__subtitle {
margin-top: 4px;
color: rgba(0, 0, 0, 0.45);
font-size: 13px;
line-height: 1.5;
}
@media (max-width: 960px) {
.alerts-tab-panel__head {
flex-direction: column;
align-items: stretch;
}
.bgp-page__brief-head {
flex-direction: column;
}
@@ -1100,6 +1678,22 @@ body {
margin-top: 14px;
}
.bgp-page__brief-facts {
display: grid;
gap: 8px;
}
.bgp-page__brief-fact-list {
display: grid;
gap: 8px;
}
.bgp-page__brief-fact-item {
display: flex;
align-items: flex-start;
gap: 8px;
}
.bgp-page__brief-meta .ant-descriptions-view {
background: #f7f8fa;
border-radius: 12px;
@@ -1107,6 +1701,8 @@ body {
}
.bgp-page__brief-modal-body {
display: grid;
gap: 14px;
max-height: calc(100vh - 180px);
overflow: auto;
padding-right: 6px;
@@ -1114,6 +1710,89 @@ body {
scrollbar-color: rgba(148, 163, 184, 0.88) transparent;
}
.bgp-page__brief-evidence {
display: grid;
gap: 12px;
}
.bgp-page__brief-evidence-card {
border-radius: 12px;
}
.alerts-brief-drawer {
display: flex;
flex-direction: column;
gap: 12px;
}
.alerts-brief-drawer__loading {
min-height: 160px;
display: flex;
align-items: center;
justify-content: center;
}
.alerts-brief-fact {
display: flex;
align-items: flex-start;
gap: 8px;
}
.alerts-brief-content {
white-space: pre-wrap;
margin-bottom: 0 !important;
}
.system-alerts-page__body,
.bgp-alerts-page__body,
.situational-alerts-page__body {
overflow: hidden;
}
.system-alerts-page__stack,
.bgp-alerts-page__stack,
.situational-alerts-page__stack {
flex: 1 1 auto;
min-width: 0;
min-height: 0;
display: flex;
flex-direction: column;
}
.system-alerts-page__table-card,
.bgp-alerts-page__table-card {
flex: 1 1 auto;
min-width: 0;
min-height: 0;
}
.system-alerts-page__table-card .ant-card-body,
.bgp-alerts-page__table-card .ant-card-body {
min-width: 0;
min-height: 0;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.system-alerts-page__table-region,
.bgp-alerts-page__table-region {
flex: 1 1 auto;
min-width: 0;
min-height: 0;
}
.bgp-alerts-page__tabs,
.bgp-alerts-page__tabs .ant-tabs-content-holder,
.bgp-alerts-page__tabs .ant-tabs-content,
.bgp-alerts-page__tabs .ant-tabs-tabpane {
min-width: 0;
min-height: 0;
width: 100%;
height: 100%;
}
.bgp-page__brief-modal {
max-width: min(920px, calc(100vw - 32px));
}