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
-2
View File
@@ -35,11 +35,9 @@
@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);
}
}
+11
View File
@@ -48,6 +48,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;
+9 -7
View File
@@ -263,7 +263,7 @@
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 {
@@ -314,6 +314,7 @@
font-size: var(--fs-md);
flex-shrink: 0;
font-family: var(--font-mono);
white-space: nowrap;
}
.select-checkbox {
@@ -569,7 +570,6 @@
display: flex;
flex-direction: row;
align-items: stretch;
gap: 5px;
min-height: 0;
overflow: hidden;
}
@@ -578,6 +578,7 @@
flex: 1;
min-width: 0;
min-height: 0;
padding-right: 6px;
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: none;
@@ -591,10 +592,11 @@
}
.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;
@@ -610,7 +612,7 @@
}
.scrollbar-rail.is-inactive {
display: none !important;
visibility: hidden;
opacity: 0 !important;
pointer-events: none;
}
+91 -5
View File
@@ -737,15 +737,101 @@
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 {
font-size: var(--fs-sm);
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);
}