mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-19 12:49:32 +01:00
Merge branch 'relnext/security-notices': security notices, starting with the OpenCode Console breach
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
f744c503c5
12 files changed
+1805
-29
No files matched your search
@@ -9742,6 +9742,292 @@ kbd {
|
||||
.toast-warning { border-color: rgba(234, 179, 8, 0.4); }
|
||||
.toast-info { border-color: rgba(59, 130, 246, 0.4); }
|
||||
|
||||
/* Security notice card (security-notices.json; showSecurityNotice / showUpdateNotice in
|
||||
panels-ui.js). Its own card in the toast stack, never the plain pill, and in the SAME
|
||||
container, so it shares the toasts' position and z-index. Theme tokens only, so every skin
|
||||
reads. Small amber text and the primary button use --notice-ink: --yellow on the dark
|
||||
skins, and on the light skins --yellow darkened a step, because their --yellow alone is
|
||||
under 4.5:1 for 11-12px text on white (3.9 to 4.4 measured). The primary button's label is
|
||||
--bg-card (dark on the dark skins' light amber, white on the light skins' dark amber). The
|
||||
entrance animates opacity and transform only, and nothing moves under
|
||||
prefers-reduced-motion.
|
||||
|
||||
The card is capped to the room below the stack's top and scrolls inside itself: the
|
||||
container is fixed and does not scroll, so on a short screen (a phone in landscape) the
|
||||
buttons at the bottom were otherwise off-screen and unreachable. The accent bar down the
|
||||
left edge (amber running into red) is therefore a background layer, not a positioned
|
||||
child: a background stays put while the content scrolls. */
|
||||
.security-notice {
|
||||
--notice-ink: var(--yellow);
|
||||
display: grid;
|
||||
grid-template-columns: auto minmax(0, 1fr) auto;
|
||||
column-gap: 0.75rem;
|
||||
align-items: start;
|
||||
box-sizing: border-box;
|
||||
width: min(420px, calc(100vw - 1rem));
|
||||
max-height: calc(var(--app-height, 100dvh) - var(--header-height) - 1rem);
|
||||
padding: 0.85rem 0.55rem 0.9rem 1.05rem;
|
||||
background:
|
||||
linear-gradient(180deg, var(--yellow), var(--red)) left top / 4px 100% no-repeat,
|
||||
linear-gradient(180deg, color-mix(in srgb, var(--yellow) 9%, transparent), transparent 6rem),
|
||||
var(--bg-card);
|
||||
border: 1px solid color-mix(in srgb, var(--yellow) 32%, var(--border));
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.16);
|
||||
color: var(--text);
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.45;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
pointer-events: auto;
|
||||
opacity: 0;
|
||||
transform: translateY(-6px) scale(0.985);
|
||||
transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
|
||||
}
|
||||
|
||||
.security-notice.show {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
html:is([data-skin="paper-gray"], [data-skin="solarized-light"], [data-skin="catppuccin-latte"], [data-skin="rose-pine-dawn"]) .security-notice {
|
||||
--notice-ink: color-mix(in srgb, var(--yellow) 85%, black);
|
||||
}
|
||||
|
||||
/* The update toast carrying a notice is still an update: its frame takes the accent colour,
|
||||
and the amber is left to the warning section inside it. */
|
||||
.security-notice.update-notice {
|
||||
background:
|
||||
linear-gradient(var(--accent), var(--accent)) left top / 4px 100% no-repeat,
|
||||
var(--bg-card);
|
||||
border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
|
||||
}
|
||||
|
||||
.security-notice-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
border-radius: 50%;
|
||||
color: var(--notice-ink);
|
||||
background: color-mix(in srgb, var(--yellow) 15%, transparent);
|
||||
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--yellow) 30%, transparent);
|
||||
}
|
||||
|
||||
.security-notice-icon svg {
|
||||
width: 1.1rem;
|
||||
height: 1.1rem;
|
||||
}
|
||||
|
||||
/* The update toast carrying a notice leads with the release, in the accent colour. */
|
||||
.security-notice-icon.update-notice-icon {
|
||||
color: var(--accent);
|
||||
background: color-mix(in srgb, var(--accent) 14%, transparent);
|
||||
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
|
||||
}
|
||||
|
||||
.security-notice-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.3rem;
|
||||
min-width: 0;
|
||||
padding-top: 0.1rem;
|
||||
}
|
||||
|
||||
.security-notice-eyebrow {
|
||||
color: var(--notice-ink);
|
||||
font-size: 0.66rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.09em;
|
||||
line-height: 1.3;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.security-notice-title {
|
||||
color: var(--text);
|
||||
font-size: 0.9rem;
|
||||
font-weight: 700;
|
||||
line-height: 1.3;
|
||||
overflow-wrap: anywhere;
|
||||
text-wrap: balance;
|
||||
}
|
||||
|
||||
/* Chinese has no spaces, so a balanced title would break inside a word (遭入 / 侵).
|
||||
Break only at the spaces and punctuation the title has; overflow-wrap above still
|
||||
rescues a run that cannot fit. */
|
||||
:lang(zh) .security-notice-title {
|
||||
word-break: keep-all;
|
||||
}
|
||||
|
||||
.security-notice-body,
|
||||
.update-notice-text {
|
||||
margin: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.security-notice-body {
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
.update-notice-text {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
/* One warning section per notice inside the update toast. */
|
||||
.security-notice-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
margin-top: 0.4rem;
|
||||
padding: 0.6rem 0.7rem 0.65rem;
|
||||
border: 1px solid color-mix(in srgb, var(--yellow) 26%, transparent);
|
||||
border-radius: 8px;
|
||||
background: color-mix(in srgb, var(--yellow) 7%, transparent);
|
||||
}
|
||||
|
||||
.security-notice-section-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
color: var(--notice-ink);
|
||||
}
|
||||
|
||||
.security-notice-section-head svg {
|
||||
flex-shrink: 0;
|
||||
width: 0.95rem;
|
||||
height: 0.95rem;
|
||||
}
|
||||
|
||||
.security-notice-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.45rem 0.8rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
/* The update toast's buttons share their row, and when it wraps (a phone, a long label)
|
||||
each fills its own, so the two never sit at odd widths one under the other. */
|
||||
.update-notice .security-notice-actions {
|
||||
column-gap: 0.6rem;
|
||||
}
|
||||
|
||||
.update-notice .security-notice-actions > button {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.security-notice-primary,
|
||||
.security-notice-secondary,
|
||||
.security-notice-quiet {
|
||||
font: inherit;
|
||||
font-size: 0.78rem;
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.security-notice-primary {
|
||||
padding: 0.45rem 0.85rem;
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--btn-radius);
|
||||
background: var(--notice-ink);
|
||||
color: var(--bg-card);
|
||||
}
|
||||
|
||||
.security-notice-primary:hover {
|
||||
background: color-mix(in srgb, var(--notice-ink) 86%, var(--text));
|
||||
}
|
||||
|
||||
.security-notice-secondary {
|
||||
padding: 0.45rem 0.85rem;
|
||||
border: 1px solid var(--border-light);
|
||||
border-radius: var(--btn-radius);
|
||||
background: transparent;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.security-notice-secondary:hover {
|
||||
background: var(--control-bg-hover);
|
||||
}
|
||||
|
||||
.security-notice-quiet {
|
||||
padding: 0.45rem 0.15rem;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--text-dim);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.security-notice-quiet:hover {
|
||||
color: var(--text);
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 3px;
|
||||
}
|
||||
|
||||
.security-notice-close {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
margin-top: -0.3rem;
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
background: none;
|
||||
color: var(--text-dim);
|
||||
font-size: 1.15rem;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.security-notice-close:hover {
|
||||
background: var(--control-bg-hover);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.security-notice button:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* Phones: the full width minus the stack's 0.5rem gutters, and every button grows to fill
|
||||
its row (so one that wraps fills its own instead of sitting stray at the left). On a touch
|
||||
pointer, below, buttons are at least --touch-target-min tall and the × gets a touch-sized
|
||||
box, its negative margin keeping the glyph where it sits on a desktop. */
|
||||
@media (max-width: 599px) {
|
||||
.security-notice {
|
||||
width: calc(100vw - 1rem);
|
||||
}
|
||||
|
||||
.security-notice-actions > button {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
}
|
||||
|
||||
/* Touch sizing follows the pointer, not the width: a phone turned to landscape is wider
|
||||
than 599px and still needs fingertip-sized targets. */
|
||||
@media (pointer: coarse) {
|
||||
.security-notice-actions > button {
|
||||
min-height: var(--touch-target-min);
|
||||
}
|
||||
|
||||
.security-notice-close {
|
||||
width: var(--touch-target-min);
|
||||
height: var(--touch-target-min);
|
||||
margin: -0.75rem -0.5rem 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.security-notice {
|
||||
transform: none;
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Notification Bell Button */
|
||||
.btn-icon-header.btn-notifications {
|
||||
position: relative;
|
||||
|
||||
Reference in new issue
Block a user