fix(control-ui): keep context usage fresh (#71297)

Patch live session usage metadata into the Control UI session list, coalesce overlapping refreshes, and add a compact action when fresh context usage is high.

Keep session refresh loading separate from session mutation ownership so background refreshes cannot re-enable mutation UI or overwrite delete/restore state mid-flight.

Co-authored-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
This commit is contained in:
Val Alexander
2026-04-24 19:20:12 -05:00
committed by GitHub
parent d399ac74f7
commit da773175f2
10 changed files with 496 additions and 21 deletions

View File

@@ -151,16 +151,19 @@
align-self: center;
display: inline-flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
gap: 8px;
padding: 7px 14px;
margin: 0 auto 8px;
max-width: calc(100% - 20px);
border-radius: var(--radius-full);
border: 1px solid color-mix(in srgb, var(--ctx-color, #d97706) 35%, transparent);
background: var(--ctx-bg, rgba(217, 119, 6, 0.12));
color: var(--ctx-color, #d97706);
font-size: 13px;
line-height: 1.2;
white-space: nowrap;
white-space: normal;
user-select: none;
animation: fade-in 0.2s var(--ease-out);
}
@@ -177,6 +180,52 @@
font-variant-numeric: tabular-nums;
}
.context-notice__action {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 5px;
height: 24px;
padding: 0 9px;
border-radius: var(--radius-full);
border: 1px solid color-mix(in srgb, currentColor 38%, transparent);
background: color-mix(in srgb, currentColor 12%, transparent);
color: currentColor;
font: inherit;
font-size: 12px;
line-height: 1;
cursor: pointer;
transition:
background 150ms ease-out,
border-color 150ms ease-out,
opacity 150ms ease-out;
}
.context-notice__action:hover:not(:disabled) {
background: color-mix(in srgb, currentColor 18%, transparent);
border-color: color-mix(in srgb, currentColor 55%, transparent);
}
.context-notice__action:disabled {
cursor: not-allowed;
opacity: 0.65;
}
.context-notice__action svg {
width: 13px;
height: 13px;
flex-shrink: 0;
stroke: currentColor;
fill: none;
stroke-width: 1.7px;
stroke-linecap: round;
stroke-linejoin: round;
}
.context-notice__action--busy svg {
animation: compaction-spin 1s linear infinite;
}
/* Chat compose - sticky at bottom */
.chat-compose {
position: sticky;