fix: restore destructive dialog buttons and document recent updates

Destructive confirmation buttons lost their styling outside the notes page, including the draft-discard Portal. Share button sizing, typography, disabled feedback and theme-aware hover colors across callers, with Electron and contrast regression coverage and design documentation.

Include the update article draft covering v0.13.8 through v0.13.16 and the separately identified 5116613 follow-up, its verification record and article index. The article remains unpublished with screenshots and release details pending.

Validation: 37 focused tests passed, including real Electron capture; typecheck, lint and staged whitespace checks passed. No model calls. The previously documented unrelated HeartbeatCenter full-suite failure was not rerun.

Release note: Destructive confirmation buttons, including the discard-note-draft dialog, now display consistent styling, keyboard focus and disabled feedback in light and dark themes.
This commit is contained in:
mesalogo
2026-09-27 15:34:01 +08:00
parent 0f0b6ac21d
commit 11facf0392
10 changed files with 427 additions and 19 deletions
@@ -431,10 +431,10 @@ describe('WorkspacePrimitives', () => {
/\.field small\s*\{[^}]*font-size:\s*var\(--font-caption\);/u
)
expect(stylesheet).toMatch(
/\.primary-button:disabled\s*\{[^}]*cursor:\s*not-allowed;/u
/\.primary-button:disabled,\s*\.secondary-button:disabled,\s*\.danger-solid:disabled\s*\{[^}]*cursor:\s*not-allowed;[^}]*opacity:\s*0\.55;/u
)
expect(stylesheet).toMatch(
/\.secondary-button:disabled\s*\{[^}]*cursor:\s*not-allowed;/u
/\.danger-solid:hover:not\(:disabled\)\s*\{[^}]*background:\s*var\(--danger-solid-hover\);/u
)
expect(stylesheet).toMatch(
/\.danger-button:disabled\s*\{[^}]*cursor:\s*not-allowed;/u
@@ -476,7 +476,7 @@ describe('WorkspacePrimitives', () => {
/button\s*>\s*svg\s*\{[^}]*display:\s*block;[^}]*flex:\s*0 0 auto;/u
)
expect(stylesheet).toMatch(
/\.primary-button,\s*\.secondary-button,\s*\.danger-button\s*\{[^}]*display:\s*inline-flex;[^}]*align-items:\s*center;[^}]*justify-content:\s*center;[^}]*gap:\s*var\(--space-2\);/u
/\.primary-button,\s*\.secondary-button,\s*\.danger-solid,\s*\.danger-button\s*\{[^}]*display:\s*inline-flex;[^}]*align-items:\s*center;[^}]*justify-content:\s*center;[^}]*gap:\s*var\(--space-2\);/u
)
expect(stylesheet).toMatch(
/button:focus-visible,\s*input:focus-visible,\s*select:focus-visible,\s*textarea:focus-visible\s*\{[^}]*outline:\s*2px solid var\(--accent\);/u
@@ -822,7 +822,8 @@ describe('WorkspacePrimitives', () => {
['success', 'success-subtle'],
['danger', 'danger-subtle'],
['text-on-accent', 'accent-solid'],
['text-on-accent', 'danger-solid']
['text-on-accent', 'danger-solid'],
['text-on-accent', 'danger-solid-hover']
] as const
for (const [foreground, background] of textPairs) {
expect(
+15 -14
View File
@@ -21,6 +21,7 @@
--accent-subtle: #e8f4ff;
--danger: #c53640;
--danger-solid: #aa2630;
--danger-solid-hover: #8e2028;
--danger-strong: #b72d37;
--danger-border: #efbcc2;
--danger-subtle: #fff1f2;
@@ -2428,16 +2429,6 @@
margin-block: var(--space-2);
}
.magic-notes-page .danger-solid {
min-height: var(--control-height);
padding: 0 13px;
border: 1px solid var(--danger-solid);
border-radius: var(--radius-control);
background: var(--danger-solid);
color: var(--text-on-accent);
cursor: pointer;
}
@container magic-notes-page (max-width: 800px) {
.magic-notes-layout {
grid-template-columns: minmax(0, 1fr);
@@ -12314,6 +12305,7 @@ details.settings-section > :not(summary) + :not(summary) {
.primary-button,
.secondary-button,
.danger-solid,
.danger-button {
display: inline-flex;
align-items: center;
@@ -12336,7 +12328,9 @@ details.settings-section > :not(summary) + :not(summary) {
background: var(--accent-solid-hover);
}
.primary-button:disabled {
.primary-button:disabled,
.secondary-button:disabled,
.danger-solid:disabled {
cursor: not-allowed;
opacity: 0.55;
}
@@ -12347,9 +12341,15 @@ details.settings-section > :not(summary) + :not(summary) {
color: var(--text-secondary);
}
.secondary-button:disabled {
cursor: not-allowed;
opacity: 0.55;
.danger-solid {
border: 1px solid var(--danger-solid);
background: var(--danger-solid);
color: var(--text-on-accent);
}
.danger-solid:hover:not(:disabled) {
border-color: var(--danger-solid-hover);
background: var(--danger-solid-hover);
}
.danger-ghost {
@@ -16304,6 +16304,7 @@ details.settings-section > :not(summary) + :not(summary) {
--accent-subtle: #123b5b;
--danger: #ff9faa;
--danger-solid: #ad3441;
--danger-solid-hover: #962d38;
--danger-strong: #ffb0b9;
--danger-border: #71404a;
--danger-subtle: #421f2a;