fix(panel): replace native width input, fix select menu open reflow, and gate context window settings behind risk consent

- Replace native <input type="number"> in popover width settings with CustomNumberInput stepper and hide native number spinbuttons globally
- Eliminate single/multi-select option reflow on open by removing scale(0.985) GPU layer teardown in anim-popover-in, floating .scrollbar-rail without flex width squeeze, and reconciling options before unhiding .select-menu
- Gate Model Context Settings behind a persistent risk consent mask (contextWindowRiskAccepted, default false and re-locked on factory reset)
This commit is contained in:
fish
2026-11-16 18:10:31 +09:00
parent 3b36ade911
commit 4670dd0a0e
17 changed files with 503 additions and 102 deletions
+111 -14
View File
@@ -184,6 +184,17 @@ input {
color: inherit;
}
input[type="number"] {
appearance: textfield;
-moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
.app-shell {
display: flex;
flex-direction: column;
@@ -290,11 +301,9 @@ html[data-standalone="true"] .app-shell {
@keyframes anim-popover-in {
from {
opacity: 0;
transform: translate3d(0, -3px, 0) scale(0.985);
}
to {
opacity: 1;
transform: translate3d(0, 0, 0) scale(1);
}
}
@@ -576,7 +585,7 @@ html[data-standalone="true"] .app-shell {
box-shadow: var(--shadow-popover);
padding: 4px;
z-index: 60;
animation: anim-popover-in var(--dur-fast) var(--ease-fast);
animation: anim-popover-in var(--dur-instant) var(--ease-fast);
}
.select-option {
@@ -627,6 +636,7 @@ html[data-standalone="true"] .app-shell {
font-size: var(--fs-md);
flex-shrink: 0;
font-family: var(--font-mono);
white-space: nowrap;
}
.select-checkbox {
@@ -882,7 +892,6 @@ html[data-standalone="true"] .app-shell {
display: flex;
flex-direction: row;
align-items: stretch;
gap: 5px;
min-height: 0;
overflow: hidden;
}
@@ -891,6 +900,7 @@ html[data-standalone="true"] .app-shell {
flex: 1;
min-width: 0;
min-height: 0;
padding-right: 6px;
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: none;
@@ -904,10 +914,11 @@ html[data-standalone="true"] .app-shell {
}
.scrollbar-rail {
position: relative;
flex-shrink: 0;
width: 5px;
margin: 2px 0;
position: absolute;
top: 2px;
right: 0;
bottom: 2px;
width: 4px;
border-radius: var(--radius-pill);
background: color-mix(in srgb, var(--border-hairline) 35%, transparent);
z-index: 15;
@@ -923,7 +934,7 @@ html[data-standalone="true"] .app-shell {
}
.scrollbar-rail.is-inactive {
display: none !important;
visibility: hidden;
opacity: 0 !important;
pointer-events: none;
}
@@ -4015,12 +4026,23 @@ html[data-standalone="true"] .app-shell {
display: none !important;
}
.settings-number-wrap .settings-text-input {
width: 68px;
.settings-number-wrap .number-input {
height: 24px;
padding: 0 6px;
text-align: right;
font-variant-numeric: tabular-nums;
background: var(--surface-subtle);
}
.settings-number-wrap .num-step-btn {
width: 22px;
background: transparent;
}
.settings-number-wrap .num-field {
width: 48px;
min-width: 48px;
padding: 0 4px;
text-align: center;
font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
font-size: var(--fs-md);
}
.settings-number-unit {
@@ -4028,6 +4050,81 @@ html[data-standalone="true"] .app-shell {
color: var(--text-secondary);
}
/* --- 其他页:模型上下文设置风险警告遮罩 --- */
.ctx-risk-stage {
display: grid;
grid-template-columns: minmax(0, 1fr);
position: relative;
}
.ctx-controls-body {
grid-area: 1 / 1;
display: flex;
flex-direction: column;
gap: var(--space-3);
min-width: 0;
transition:
filter var(--dur-fast) var(--ease-fast),
opacity var(--dur-fast) var(--ease-fast);
}
.ctx-controls-body.is-locked {
filter: blur(4px);
opacity: 0.24;
pointer-events: none;
user-select: none;
}
.ctx-risk-mask {
grid-area: 1 / 1;
z-index: 5;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
gap: var(--space-2);
padding: var(--space-3) var(--space-4);
border-radius: var(--radius-xs);
border: 1px solid color-mix(in srgb, var(--metric-warn) 42%, var(--border-hairline));
background: color-mix(in srgb, var(--surface-panel) 88%, var(--metric-warn) 7%);
}
.ctx-risk-mask[hidden] {
display: none !important;
}
.ctx-risk-head {
display: inline-flex;
align-items: center;
gap: 6px;
color: var(--metric-warn);
}
.ctx-risk-icon {
color: var(--metric-warn);
flex-shrink: 0;
}
.ctx-risk-title {
font-size: var(--fs-base);
font-weight: 600;
color: var(--metric-warn);
}
.ctx-risk-desc {
margin: 0;
font-size: var(--fs-sm);
line-height: 1.5;
color: var(--text-primary);
}
.ctx-risk-accept-btn {
margin-top: 2px;
height: 26px;
padding: 0 var(--space-3);
font-size: var(--fs-md);
}
/* --- src/styles/overlay.css --- */
/*
* 双栖模式顶栏胶囊与悬浮面板样式表 (overlay.css).