feat(canvas): 云端 Agent - 缩减画布目录上下文并展示实时用量
This commit is contained in:
@@ -50,6 +50,320 @@
|
||||
font-size: var(--fs-label);
|
||||
}
|
||||
|
||||
.agent-context-ring {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
flex: none;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
min-width: 68px;
|
||||
height: 32px;
|
||||
padding: 3px 8px 3px 4px;
|
||||
border: 1px solid color-mix(in srgb, var(--agent-ink) 10%, transparent);
|
||||
border-radius: 999px;
|
||||
background: color-mix(in srgb, var(--agent-ink) 4%, transparent);
|
||||
color: var(--agent-caption);
|
||||
cursor: pointer;
|
||||
transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
|
||||
}
|
||||
|
||||
.agent-context-ring:hover,
|
||||
.agent-context-ring[aria-expanded="true"] {
|
||||
border-color: color-mix(in srgb, var(--agent-accent) 48%, transparent);
|
||||
background: var(--agent-surface-raised);
|
||||
color: var(--agent-ink);
|
||||
}
|
||||
|
||||
.agent-context-ring:focus-visible {
|
||||
outline: 2px solid var(--agent-focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.agent-context-ring-visual,
|
||||
.agent-context-ring-visual svg {
|
||||
display: block;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.agent-context-ring-visual svg {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.agent-context-ring circle {
|
||||
fill: none;
|
||||
stroke-linecap: round;
|
||||
}
|
||||
|
||||
.agent-context-ring-track {
|
||||
stroke: color-mix(in srgb, var(--agent-ink) 18%, transparent);
|
||||
stroke-width: 2.4;
|
||||
}
|
||||
|
||||
.agent-context-ring-value {
|
||||
stroke: var(--agent-accent, currentColor);
|
||||
stroke-width: 2.4;
|
||||
transition: stroke-dashoffset 240ms ease;
|
||||
}
|
||||
|
||||
.agent-context-ring-marker {
|
||||
fill: var(--agent-ink);
|
||||
stroke: none;
|
||||
}
|
||||
|
||||
.agent-context-ring.is-watch .agent-context-ring-value { stroke: #d9973b; }
|
||||
.agent-context-ring.is-compress .agent-context-ring-value,
|
||||
.agent-context-ring.is-compacting .agent-context-ring-value { stroke: #d4534e; }
|
||||
.agent-context-ring.is-compacting .agent-context-ring-visual svg { animation: agent-context-spin 1.4s linear infinite; }
|
||||
.agent-context-ring.is-unknown .agent-context-ring-value,
|
||||
.agent-context-ring.is-stale .agent-context-ring-value { stroke-dasharray: 4 6; }
|
||||
|
||||
.agent-context-meter-copy {
|
||||
display: grid;
|
||||
min-width: 0;
|
||||
line-height: 1;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.agent-context-meter-copy strong {
|
||||
color: var(--agent-ink);
|
||||
font-size: 11px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.agent-context-meter-copy small {
|
||||
margin-top: 2px;
|
||||
color: var(--agent-caption);
|
||||
font-size: 9px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@keyframes agent-context-spin {
|
||||
to { transform: rotate(270deg); }
|
||||
}
|
||||
|
||||
.agent-context-popover.ant-popover,
|
||||
.agent-context-popover .ant-popover-content,
|
||||
.agent-context-popover .ant-popover-inner {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.agent-context-popover .ant-popover-inner {
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
border: 1px solid color-mix(in srgb, var(--agent-ink) 12%, transparent);
|
||||
border-radius: 16px;
|
||||
background: var(--agent-surface-raised, var(--background));
|
||||
}
|
||||
|
||||
.agent-context-popover .ant-popover-inner-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.agent-context-panel {
|
||||
width: min(348px, calc(100vw - 32px));
|
||||
padding: 14px 15px 12px;
|
||||
color: var(--agent-ink, inherit);
|
||||
font-size: 12px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.agent-context-eyebrow {
|
||||
display: block;
|
||||
margin-bottom: 3px;
|
||||
color: var(--agent-caption);
|
||||
font-size: 10px;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.agent-context-panel-head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.agent-context-panel-head strong {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.015em;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.agent-context-phase {
|
||||
flex: none;
|
||||
border-radius: 999px;
|
||||
padding: 3px 8px;
|
||||
background: color-mix(in srgb, currentColor 12%, transparent);
|
||||
font-size: 10px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.agent-context-phase.is-watch { color: #9a6416; }
|
||||
.agent-context-phase.is-compress,
|
||||
.agent-context-phase.is-compacting { color: #a33b36; }
|
||||
|
||||
.agent-context-summary {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 4px;
|
||||
margin-top: 12px;
|
||||
color: var(--agent-caption);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.agent-context-summary strong {
|
||||
color: var(--agent-ink);
|
||||
font-size: 23px;
|
||||
letter-spacing: -0.04em;
|
||||
}
|
||||
|
||||
.agent-context-summary span {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.agent-context-summary em {
|
||||
margin-left: auto;
|
||||
color: var(--agent-caption);
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.agent-context-progress-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-top: 13px;
|
||||
color: var(--agent-caption);
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.agent-context-progress-head strong {
|
||||
color: var(--agent-ink);
|
||||
font-size: 13px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.agent-context-progress {
|
||||
position: relative;
|
||||
height: 12px;
|
||||
margin-top: 5px;
|
||||
overflow: visible;
|
||||
border: 0;
|
||||
border-radius: 999px;
|
||||
background: rgb(255 255 255 / 14%);
|
||||
background: color-mix(in srgb, var(--agent-ink, #fff) 24%, var(--agent-surface-raised, #252525));
|
||||
box-shadow: inset 0 0 0 1px rgb(255 255 255 / 10%);
|
||||
}
|
||||
|
||||
.agent-context-progress > span {
|
||||
display: block;
|
||||
height: 100%;
|
||||
min-width: 6px;
|
||||
border-radius: inherit;
|
||||
background: #8b93ff;
|
||||
background: linear-gradient(90deg, color-mix(in srgb, var(--agent-accent, #8b93ff) 58%, white), var(--agent-accent, #8b93ff));
|
||||
box-shadow: 0 0 12px color-mix(in srgb, var(--agent-accent, #8b93ff) 48%, transparent);
|
||||
transition: width 240ms ease;
|
||||
}
|
||||
|
||||
.agent-context-progress > i {
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
bottom: -3px;
|
||||
width: 1px;
|
||||
background: color-mix(in srgb, var(--agent-ink) 64%, transparent);
|
||||
}
|
||||
|
||||
.agent-context-detail {
|
||||
margin: 10px 0 0;
|
||||
color: var(--agent-caption);
|
||||
font-size: 11px;
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
.agent-context-breakdown {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
margin: 13px 0 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.agent-context-breakdown li {
|
||||
display: grid;
|
||||
grid-template-columns: 9px minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.agent-context-breakdown-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: color-mix(in srgb, var(--agent-accent) 62%, var(--agent-ink));
|
||||
}
|
||||
|
||||
.agent-context-breakdown-label {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
color: var(--agent-ink);
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.agent-context-breakdown-value {
|
||||
min-width: 58px;
|
||||
color: var(--agent-ink);
|
||||
font-variant-numeric: tabular-nums;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.agent-context-breakdown li.is-secondary .agent-context-breakdown-dot {
|
||||
background: color-mix(in srgb, var(--agent-ink) 42%, transparent);
|
||||
}
|
||||
|
||||
.agent-context-breakdown li.is-secondary .agent-context-breakdown-label,
|
||||
.agent-context-breakdown li.is-secondary .agent-context-breakdown-value {
|
||||
color: var(--agent-caption);
|
||||
}
|
||||
|
||||
.agent-context-breakdown li.is-muted .agent-context-breakdown-dot {
|
||||
background: color-mix(in srgb, var(--agent-ink) 24%, transparent);
|
||||
}
|
||||
|
||||
.agent-context-breakdown li.is-muted .agent-context-breakdown-label,
|
||||
.agent-context-breakdown li.is-muted .agent-context-breakdown-value {
|
||||
color: var(--agent-caption);
|
||||
}
|
||||
|
||||
.agent-context-panel-foot {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
margin-top: 13px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid color-mix(in srgb, var(--agent-ink) 9%, transparent);
|
||||
color: var(--agent-caption);
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.agent-context-note {
|
||||
margin: 6px 0 0;
|
||||
color: var(--agent-caption);
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.agent-context-ring.is-compacting .agent-context-ring-visual svg { animation: none; }
|
||||
.agent-context-ring-value,
|
||||
.agent-context-progress > span { transition: none; }
|
||||
}
|
||||
|
||||
.agent-header-actions .ant-btn {
|
||||
color: inherit;
|
||||
}
|
||||
@@ -335,6 +649,10 @@
|
||||
}
|
||||
.agent-panel-status { white-space: nowrap; }
|
||||
.agent-conversation { padding-inline: var(--space-4); }
|
||||
.agent-context-ring { min-width: 32px; padding-right: 4px; gap: 0; }
|
||||
.agent-context-meter-copy { display: none; }
|
||||
.agent-context-panel-foot { display: grid; }
|
||||
|
||||
.agent-welcome-actions button { padding-inline: var(--space-2); }
|
||||
}
|
||||
|
||||
@@ -613,15 +931,47 @@
|
||||
}
|
||||
|
||||
.agent-composer-toolbar {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
align-items: end;
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.agent-composer-submit {
|
||||
.agent-composer-controls {
|
||||
min-width: 0;
|
||||
justify-self: end;
|
||||
flex: 1 1 auto;
|
||||
flex-wrap: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.agent-composer-selection {
|
||||
min-width: 0;
|
||||
flex: 1 1 auto;
|
||||
flex-wrap: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.agent-composer-selection > .w-full {
|
||||
min-width: 0;
|
||||
max-width: 13rem;
|
||||
flex: 1 1 13rem;
|
||||
}
|
||||
|
||||
.agent-composer-selection .agent-composer-model-trigger,
|
||||
.agent-composer-selection .canvas-model-picker-label {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.agent-composer-selection > button {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.agent-composer-submit {
|
||||
display: flex;
|
||||
min-width: max-content;
|
||||
flex: 0 0 auto;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.canvas-agent-launcher {
|
||||
@@ -632,7 +982,7 @@
|
||||
border: 0;
|
||||
border-radius: 999px;
|
||||
background: transparent;
|
||||
padding: 7px;
|
||||
padding: 0;
|
||||
box-shadow: 0 16px 38px color-mix(in srgb, var(--canvas-agent-launcher-shadow) 64%, transparent);
|
||||
cursor: grab;
|
||||
touch-action: none;
|
||||
@@ -644,6 +994,15 @@
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.canvas-agent-launcher > .fluid-orb {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
z-index: 1;
|
||||
margin: 0;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.canvas-agent-launcher::before {
|
||||
position: absolute;
|
||||
inset: 3px;
|
||||
@@ -720,27 +1079,6 @@
|
||||
.canvas-agent-launcher { transition: none !important; }
|
||||
}
|
||||
|
||||
.agent-composer-send-hint {
|
||||
color: color-mix(in srgb, currentColor 52%, transparent);
|
||||
font-size: var(--fs-tiny);
|
||||
line-height: 16px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 面板宽度包含内边距;默认 448px 面板放不下完整快捷键说明,窄态降级为短文案而不是隐藏提示本身。 */
|
||||
.agent-composer-send-hint .agent-composer-send-hint-compact {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@container (max-width: 520px) {
|
||||
.agent-composer-send-hint .agent-composer-send-hint-full {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.agent-composer-send-hint .agent-composer-send-hint-compact {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
|
||||
.agent-tool-status {
|
||||
display: grid;
|
||||
|
||||
Reference in New Issue
Block a user