feat(account): add quota trend chart and multi-account risk gate

- Gate multi-account login, import, switch, backup quota polling, and vault controls behind explicit risk consent (accountSwitchRiskAccepted), restricting unaccepted sessions to active-account quota viewing
- Add collinear-compressed per-account quota history tracking and a full-bleed 184px AccountQuotaTrendCard supporting cycle, preset, all-time, and custom ranges with cycle-boundary pre-reset filtering and isolated impulse spike sanitization
- Unify Account tab controls onto shared SegmentedControl, CustomSelect, CustomDateTimePicker, .ctx-risk-mask, and global status/button primitives while removing bespoke .account-* CSS and balancing card padding
This commit is contained in:
fish
2026-11-25 03:42:33 +09:00
parent 1330b31ef7
commit e520efe84e
20 changed files with 4103 additions and 1235 deletions
+70 -267
View File
@@ -6271,15 +6271,15 @@ html[data-standalone="true"] .app-shell {
}
.account-toolbar-panel {
padding: 9px 12px;
gap: 8px;
padding: var(--space-3) var(--space-5);
gap: var(--space-2);
}
.account-toolbar-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
gap: var(--space-2);
flex-wrap: wrap;
}
@@ -6287,6 +6287,7 @@ html[data-standalone="true"] .app-shell {
.account-toolbar-right {
display: inline-flex;
align-items: center;
flex-wrap: wrap;
gap: 6px;
min-width: 0;
}
@@ -6295,32 +6296,19 @@ html[data-standalone="true"] .app-shell {
margin-left: auto;
}
.account-toolbar-btn {
display: inline-flex;
align-items: center;
gap: 5px;
min-height: calc(25px * var(--ui-font-scale, 1));
height: auto;
.account-toolbar-panel .btn-primary,
.account-toolbar-panel .btn-secondary {
min-height: calc(26px * var(--ui-font-scale, 1));
padding: 2px 10px;
font-size: var(--fs-md);
font-weight: 500;
border-radius: var(--radius-xs);
white-space: nowrap;
}
.account-toolbar-btn.is-open {
.account-toolbar-panel .btn-secondary.is-open {
color: var(--accent-primary);
background: var(--accent-primary-soft);
}
.account-reload-btn {
width: calc(25px * var(--ui-font-scale, 1));
height: calc(25px * var(--ui-font-scale, 1));
padding: 0;
border-radius: var(--radius-xs);
flex-shrink: 0;
}
.account-refresh-select {
flex: 0 0 auto;
width: auto;
@@ -6329,24 +6317,11 @@ html[data-standalone="true"] .app-shell {
.account-refresh-select .select-trigger {
width: auto;
min-height: calc(25px * var(--ui-font-scale, 1));
min-height: calc(26px * var(--ui-font-scale, 1));
height: auto;
padding: 2px 8px;
gap: 5px;
font-size: var(--fs-sm);
border: 1px solid var(--border-hairline);
border-radius: var(--radius-xs);
background: var(--surface-subtle);
}
[data-modern-ui="true"] .account-refresh-select .select-trigger {
border: none;
background: var(--modern-surface-subtle);
}
[data-modern-ui="true"] .account-refresh-select .select-trigger:hover,
[data-modern-ui="true"] .account-refresh-select.is-open .select-trigger {
background: var(--modern-surface-hover);
}
.account-refresh-select .select-menu {
@@ -6373,17 +6348,18 @@ html[data-standalone="true"] .app-shell {
color: var(--metric-danger);
}
.account-status-inline.is-info {
color: var(--text-secondary);
}
.account-import-drawer {
display: flex;
flex-direction: column;
gap: 5px;
align-items: stretch;
gap: 6px;
padding-top: 2px;
}
.account-import-drawer > .segmented {
align-self: flex-start;
}
.account-import-row {
display: flex;
align-items: center;
@@ -6397,176 +6373,20 @@ html[data-standalone="true"] .app-shell {
min-height: calc(26px * var(--ui-font-scale, 1));
}
.account-import-hint {
font-size: var(--fs-xs);
color: var(--text-muted);
}
.account-unlock-box {
display: flex;
flex-direction: column;
gap: 6px;
padding: 8px 10px;
border-radius: var(--radius-xs);
background: var(--surface-subtle);
}
.account-unlock-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.account-unlock-title {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: var(--fs-sm);
color: var(--text-secondary);
}
.account-unlock-title .svg-icon {
color: var(--metric-warn);
flex-shrink: 0;
}
.account-link-btn {
padding: 0;
border: none;
background: transparent;
font-size: var(--fs-xs);
color: var(--text-muted);
cursor: pointer;
white-space: nowrap;
}
.account-link-btn:hover {
color: var(--text-primary);
text-decoration: underline;
}
.account-reset-row {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 6px 10px;
padding-top: 4px;
}
.account-reset-row .settings-action-desc {
flex: 1 1 180px;
font-size: var(--fs-xs);
}
.account-pwd-tabs {
display: inline-flex;
align-items: center;
align-self: flex-start;
gap: 4px;
padding: 2px;
border-radius: var(--radius-xs);
background: var(--surface-subtle);
}
.account-pwd-tab {
padding: 2px 8px;
border: none;
border-radius: var(--radius-xs);
background: transparent;
font-size: var(--fs-xs);
font-weight: 500;
color: var(--text-secondary);
cursor: pointer;
}
.account-pwd-tab.is-active {
background: var(--bg-elevated);
color: var(--text-primary);
}
.account-card-btn.is-confirm-warn {
color: var(--accent-primary);
background: var(--accent-primary-soft);
font-weight: 600;
}
.account-confirm-danger-btn {
color: var(--metric-danger);
background: color-mix(in srgb, var(--metric-danger) 12%, transparent);
font-weight: 600;
}
.account-confirm-danger-btn:hover:not(:disabled) {
background: color-mix(in srgb, var(--metric-danger) 20%, transparent);
}
.account-flow-strip {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 6px 10px;
padding: 6px 9px;
border-radius: var(--radius-xs);
background: var(--surface-subtle);
font-size: var(--fs-sm);
}
.account-flow-strip.is-info {
background: var(--accent-primary-soft);
}
.account-flow-strip.is-info .account-flow-msg {
color: var(--accent-primary);
}
.account-flow-strip.is-ok {
background: color-mix(in srgb, var(--metric-ok) 10%, transparent);
}
.account-flow-strip.is-ok .account-flow-msg {
color: var(--metric-ok);
}
.account-flow-strip.is-warn {
background: color-mix(in srgb, var(--metric-warn) 10%, transparent);
color: var(--metric-warn);
}
.account-flow-strip.is-error {
background: color-mix(in srgb, var(--metric-danger) 10%, transparent);
}
.account-flow-strip.is-error .account-flow-msg {
color: var(--metric-danger);
}
.account-flow-link {
font-size: var(--fs-sm);
font-weight: 500;
color: var(--accent-primary);
text-decoration: none;
white-space: nowrap;
}
.account-flow-link:hover {
text-decoration: underline;
}
.account-cards-stack {
display: flex;
flex-direction: column;
gap: var(--space-3);
}
/* Optically symmetrical vertical padding: 11px + 3px header leading == 14px bottom bar-to-edge */
.account-card {
gap: 10px;
padding: 11px 14px;
padding: 11px var(--space-5) 14px;
}
.account-card-head {
min-height: calc(22px * var(--ui-font-scale, 1));
gap: 8px;
flex-wrap: wrap;
}
@@ -6580,14 +6400,10 @@ html[data-standalone="true"] .app-shell {
flex: 1 1 150px;
}
.account-active-dot {
background: var(--metric-ok);
box-shadow: 0 0 0 2px color-mix(in srgb, var(--metric-ok) 20%, transparent);
}
.account-card-email {
font-size: var(--fs-base);
font-weight: 600;
line-height: 1.3;
color: var(--text-primary);
overflow: hidden;
text-overflow: ellipsis;
@@ -6595,34 +6411,6 @@ html[data-standalone="true"] .app-shell {
max-width: 100%;
}
.account-tag {
display: inline-flex;
align-items: center;
min-height: calc(18px * var(--ui-font-scale, 1));
padding: 1px 6px;
font-size: var(--fs-xs);
font-weight: 600;
line-height: 1.2;
border-radius: var(--radius-xs);
border: none;
white-space: nowrap;
}
.account-tag.is-active {
color: var(--metric-ok);
background: color-mix(in srgb, var(--metric-ok) 12%, transparent);
}
.account-tag.is-tier {
color: var(--accent-primary);
background: var(--accent-primary-soft);
}
.account-tag.is-written {
color: var(--metric-warn);
background: color-mix(in srgb, var(--metric-warn) 12%, transparent);
}
.account-card-actions {
display: inline-flex;
align-items: center;
@@ -6631,21 +6419,16 @@ html[data-standalone="true"] .app-shell {
margin-left: auto;
}
.account-card-btn {
min-height: calc(23px * var(--ui-font-scale, 1));
height: auto;
.account-card-actions .btn-ghost-sm {
min-height: calc(22px * var(--ui-font-scale, 1));
padding: 1px 8px;
font-size: var(--fs-sm);
font-weight: 500;
border-radius: var(--radius-xs);
white-space: nowrap;
}
.account-icon-btn {
width: calc(23px * var(--ui-font-scale, 1));
height: calc(23px * var(--ui-font-scale, 1));
.account-card-actions .icon-btn {
width: calc(22px * var(--ui-font-scale, 1));
height: calc(22px * var(--ui-font-scale, 1));
min-width: calc(22px * var(--ui-font-scale, 1));
padding: 0;
border-radius: var(--radius-xs);
}
.account-pools-stack {
@@ -6654,18 +6437,11 @@ html[data-standalone="true"] .app-shell {
gap: 9px;
}
.account-pool-group {
display: flex;
flex-direction: column;
gap: 4px;
}
.account-pool-name {
.account-pool-label {
font-size: var(--fs-xs);
font-weight: 600;
color: var(--text-muted);
line-height: 1.25;
letter-spacing: 0.01em;
}
.account-pool-meters {
@@ -6691,34 +6467,61 @@ html[data-standalone="true"] .app-shell {
min-width: 0;
}
.account-meter-head {
/* Quota Trend Card minor layout helpers */
.account-trend-toprow {
gap: var(--space-2);
flex-wrap: wrap;
}
.account-trend-toprow .cons-cycle-pool-select {
flex: 0 0 auto;
}
.account-trend-subbar {
gap: 6px 8px;
flex-wrap: wrap;
}
.account-trend-email-select {
max-width: 156px;
}
.account-trend-legend {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 6px;
min-width: 0;
align-items: center;
flex-wrap: wrap;
gap: 6px 12px;
padding-top: 2px;
}
.settings-account-quota {
font-size: var(--fs-sm);
font-weight: 600;
.account-trend-leg-item {
display: inline-flex;
align-items: center;
gap: 5px;
font-size: var(--fs-xs);
color: var(--text-secondary);
}
.account-trend-leg-item strong {
color: var(--text-primary);
white-space: nowrap;
}
.account-meter-reset {
font-size: var(--fs-2xs);
color: var(--text-muted);
white-space: nowrap;
flex-shrink: 0;
.account-trend-tip-rows {
display: flex;
flex-direction: column;
gap: 4px;
}
.account-progress-track {
height: 5px;
.account-trend-tip-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
font-size: var(--fs-xs);
}
.account-empty-panel {
padding: 18px 14px;
padding: 16px var(--space-5);
align-items: center;
justify-content: center;
}