Skip to content

Commit cc95de4

Browse files
Merge pull request #14 from SpeechlessPanda/dark-mode-v0.1.3-repair
fix: complete dark mode readability repair
2 parents 4f68645 + 1ec9cf5 commit cc95de4

8 files changed

Lines changed: 136 additions & 12 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GitHub 登录配置:[docs/guides/github-oauth-app-setup.md](docs/guides/github
1414

1515
## 当前版本与交接状态
1616

17-
1. 当前版本:v1.3.0
17+
1. 当前版本:v0.1.3
1818
2. 当前支持框架:Hexo、Hugo。
1919
3. 当前支持主题(10 个):
2020
- Hexo:Landscape、Next、Butterfly、Fluid、Volantis。

e2e/electron/editorial-workbench.spec.mjs

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,10 @@ test("editorial workbench journey keeps workspace context across core entry poin
422422
expect(darkPalette.panelBackground).not.toBe(lightPalette.panelBackground);
423423
expect(darkPalette.panelBorder).not.toBe(lightPalette.panelBorder);
424424
await expect(page.locator(".shell-topbar-title")).toHaveCSS("color", darkTextPalette.inkColor);
425+
await expect(page.locator('[data-sidebar-entry="account"] .sidebar-entry-label')).toHaveCSS(
426+
"color",
427+
darkTextPalette.highlightColor,
428+
);
425429
await expect(page.locator('[data-summary-item="workspace"] strong')).toHaveCSS(
426430
"color",
427431
darkTextPalette.inkColor,
@@ -433,6 +437,10 @@ test("editorial workbench journey keeps workspace context across core entry poin
433437

434438
await navigateToTab("博客创建");
435439
await expect(workspaceSurface).toBeVisible();
440+
await expect(workspaceSurface.locator(".page-kicker")).toHaveCSS(
441+
"color",
442+
darkTextPalette.highlightColor,
443+
);
436444
await expect(workspaceSurface.locator(".workspace-section-heading h2").first()).toHaveCSS(
437445
"color",
438446
darkTextPalette.inkColor,
@@ -445,6 +453,10 @@ test("editorial workbench journey keeps workspace context across core entry poin
445453
"color",
446454
darkTextPalette.inkColor,
447455
);
456+
await expect(workspaceSurface.locator(".page-signal .section-eyebrow").first()).toHaveCSS(
457+
"color",
458+
darkTextPalette.highlightColor,
459+
);
448460
await workspaceThemePreviewTrigger.click();
449461
await expect(workspaceThemePreviewOverlay).toBeVisible();
450462
await expect(workspaceThemePreviewOverlay.locator(".theme-preview-dialog-copy h3")).toHaveCSS(
@@ -465,6 +477,10 @@ test("editorial workbench journey keeps workspace context across core entry poin
465477
await expect(themeSurface).toBeVisible();
466478
await expect(themeSurface.locator(".page-title")).toHaveCSS("color", darkTextPalette.inkColor);
467479
await expect(themeStudioHelper).toHaveCSS("color", darkTextPalette.mutedColor);
480+
await expect(themeSurface.locator(".theme-studio-heading .section-eyebrow").first()).toHaveCSS(
481+
"color",
482+
darkTextPalette.highlightColor,
483+
);
468484
await expect(themeSurface.locator(".theme-studio-heading h2").first()).toHaveCSS(
469485
"color",
470486
darkTextPalette.inkColor,
@@ -484,6 +500,10 @@ test("editorial workbench journey keeps workspace context across core entry poin
484500

485501
await navigateToTab("发布与备份");
486502
await expect(publishSurface).toBeVisible();
503+
await expect(publishWorkbenchSurface.locator(".section-eyebrow").first()).toHaveCSS(
504+
"color",
505+
darkTextPalette.highlightColor,
506+
);
487507
await expect(publishWorkbenchSurface.locator(".workflow-section-heading h2").first()).toHaveCSS(
488508
"color",
489509
darkTextPalette.inkColor,
@@ -497,9 +517,17 @@ test("editorial workbench journey keeps workspace context across core entry poin
497517

498518
await navigateToTab("导入恢复");
499519
await expect(importGithubWorkbench).toBeVisible();
520+
await expect(importSurface.locator(".page-kicker")).toHaveCSS(
521+
"color",
522+
darkTextPalette.highlightColor,
523+
);
500524
await expect(importPageLead).toHaveCSS("color", darkTextPalette.mutedColor);
501525
await expect(importResultNote).toHaveCSS("color", darkTextPalette.mutedColor);
502526
await expect(importPageLink).toHaveCSS("color", darkTextPalette.highlightColor);
527+
await expect(importSurface.locator("label").first()).toHaveCSS(
528+
"color",
529+
darkTextPalette.highlightColor,
530+
);
503531
await expect(importDeployRepoSelect).toHaveValue(
504532
"https://github.com/editorial-e2e/editorial-e2e.github.io.git",
505533
);
@@ -513,6 +541,10 @@ test("editorial workbench journey keeps workspace context across core entry poin
513541
await expect(importDestinationInput).toHaveValue("");
514542

515543
await navigateToTab("教程中心");
544+
await expect(page.locator("#tutorial-home .page-kicker")).toHaveCSS(
545+
"color",
546+
darkTextPalette.highlightColor,
547+
);
516548
await expect(page.locator("#tutorial-home .tutorial-directory-card h3").first()).toHaveCSS(
517549
"color",
518550
darkTextPalette.inkColor,
@@ -538,6 +570,20 @@ test("editorial workbench journey keeps workspace context across core entry poin
538570
darkTextPalette.mutedColor,
539571
);
540572

573+
await openShellPopupFromEntry({
574+
entry: shellAccountEntry,
575+
activeBlock: shellAccountBlock,
576+
});
577+
await expect(shellAccountBlock.locator(".status-label").first()).toHaveCSS(
578+
"color",
579+
darkTextPalette.highlightColor,
580+
);
581+
await expect(shellRefreshAuthButton).toBeFocused();
582+
await expect(shellUpdatesBlock).toBeVisible();
583+
await expect(shellEnvironmentBlock).toBeVisible();
584+
await shellPopupDismiss.click();
585+
await expect(shellSidebarPopupOverlay).toBeHidden();
586+
541587
await openShellPopupFromEntry({
542588
entry: shellAppearanceEntry,
543589
activeBlock: shellAppearanceBlock,
@@ -553,16 +599,6 @@ test("editorial workbench journey keeps workspace context across core entry poin
553599
const restoredLightPalette = await expectRepresentativeSurfacesToMatchAppearance("light");
554600
expect(restoredLightPalette).toEqual(lightPalette);
555601

556-
await openShellPopupFromEntry({
557-
entry: shellAccountEntry,
558-
activeBlock: shellAccountBlock,
559-
});
560-
await expect(shellRefreshAuthButton).toBeFocused();
561-
await expect(shellUpdatesBlock).toBeVisible();
562-
await expect(shellEnvironmentBlock).toBeVisible();
563-
await shellPopupDismiss.click();
564-
await expect(shellSidebarPopupOverlay).toBeHidden();
565-
566602
await navigateToTab("博客创建");
567603
await expect(workspaceSurface).toBeVisible();
568604
await setScrollTop(0);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blog-for-everyone",
3-
"version": "1.3.0",
3+
"version": "0.1.3",
44
"description": "Beginner-friendly blog builder platform for Hexo and Hugo",
55
"main": "src/main/main.js",
66
"author": "BlogForEveryone",

scripts/e2e-real-workspace-verify.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ async function main() {
210210
rows
211211
};
212212

213+
fs.mkdirSync(path.dirname(REPORT_PATH), { recursive: true });
213214
fs.writeFileSync(REPORT_PATH, `${JSON.stringify(report, null, 2)}\n`, 'utf8');
214215
console.log(JSON.stringify(report, null, 2));
215216

src/renderer/src/App.facade.test.mjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,33 @@ test("App shell styles route dark editorial titles and primary text through the
191191
"expected dark popup theme tokens to match the approved warmer shell palette",
192192
);
193193
});
194+
195+
test("App shell styles keep dark metadata labels and mixed card surfaces readable across the workflow shell", async () => {
196+
const stylesSource = await readFile(stylesPath, "utf8");
197+
198+
assert.match(
199+
stylesSource,
200+
/\.layout--editorial\[data-shell-appearance="dark"\] \.page-kicker,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.section-eyebrow,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.status-label,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] label,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.sidebar-entry-label[\s\S]*color:\s*var\(--shell-highlight\);/,
201+
"expected dark workflow labels, eyebrows, and field labels to use a brighter shell highlight token",
202+
);
203+
assert.match(
204+
stylesSource,
205+
/\.layout--editorial\[data-shell-appearance="dark"\] \.context-card,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.info-card,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.tutorial-directory-card,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.tutorial-flow-card,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.tutorial-action-panel,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.theme-studio-card,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.theme-asset-preview-card[\s\S]*background:[\s\S]*var\(--shell-panel-alt\);[\s\S]*(border-color:\s*var\(--shell-line\);|border:\s*1px solid var\(--shell-line\);)[\s\S]*color:\s*var\(--shell-ink\);/,
206+
"expected mixed workflow cards to switch fully onto dark shell surfaces instead of keeping light-card backgrounds in dark mode",
207+
);
208+
assert.match(
209+
stylesSource,
210+
/\.shell-popup-theme\[data-shell-appearance="dark"\] \.status-label[\s\S]*color:\s*var\(--shell-highlight\);/,
211+
"expected popup section labels to use the brighter shell highlight token in dark mode",
212+
);
213+
assert.match(
214+
stylesSource,
215+
/\.shell-popup-theme\[data-shell-appearance="dark"\] \.shell-popup-block[\s\S]*background:[\s\S]*var\(--shell-panel-alt\);[\s\S]*(border-color:\s*var\(--shell-line\);|border:\s*1px solid var\(--shell-line\);)[\s\S]*color:\s*var\(--shell-ink\);/,
216+
"expected popup blocks to use dark shell card surfaces instead of inheriting lighter mixed backgrounds",
217+
);
218+
assert.match(
219+
stylesSource,
220+
/\.layout--editorial\[data-shell-appearance="dark"\] \.shell-topbar \.page-kicker,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.shell-summary \.status-label,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.shell-popup-panel \.status-label,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.sidebar-entry-label[\s\S]*color:\s*var\(--shell-highlight\);/,
221+
"expected shell-specific metadata labels to keep the brighter highlight token instead of falling back to muted dark-shell copy",
222+
);
223+
});

src/renderer/src/styles.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2712,6 +2712,14 @@ a:hover {
27122712
color: var(--shell-muted);
27132713
}
27142714

2715+
.layout--editorial[data-shell-appearance="dark"] .page-kicker,
2716+
.layout--editorial[data-shell-appearance="dark"] .section-eyebrow,
2717+
.layout--editorial[data-shell-appearance="dark"] .status-label,
2718+
.layout--editorial[data-shell-appearance="dark"] label,
2719+
.layout--editorial[data-shell-appearance="dark"] .sidebar-entry-label {
2720+
color: var(--shell-highlight);
2721+
}
2722+
27152723
.layout--editorial[data-shell-appearance="dark"] .modal-panel {
27162724
background:
27172725
linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
@@ -2769,6 +2777,23 @@ a:hover {
27692777
text-decoration-color: rgba(245, 234, 223, 0.72);
27702778
}
27712779

2780+
.layout--editorial[data-shell-appearance="dark"] .context-card,
2781+
.layout--editorial[data-shell-appearance="dark"] .info-card,
2782+
.layout--editorial[data-shell-appearance="dark"] .tutorial-directory-card,
2783+
.layout--editorial[data-shell-appearance="dark"] .tutorial-flow-card,
2784+
.layout--editorial[data-shell-appearance="dark"] .tutorial-action-panel,
2785+
.layout--editorial[data-shell-appearance="dark"] .theme-studio-card,
2786+
.layout--editorial[data-shell-appearance="dark"] .theme-asset-preview-card {
2787+
background:
2788+
linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
2789+
var(--shell-panel-alt);
2790+
border: 1px solid var(--shell-line);
2791+
color: var(--shell-ink);
2792+
box-shadow:
2793+
0 18px 34px rgba(var(--shell-shadow-rgb), 0.28),
2794+
inset 0 1px 0 rgba(255, 255, 255, 0.04);
2795+
}
2796+
27722797
.layout--editorial .workflow-inline-panel {
27732798
background: var(--shell-panel-alt);
27742799
border: 1px dashed var(--shell-line);
@@ -2844,6 +2869,13 @@ a:hover {
28442869
color: var(--shell-muted);
28452870
}
28462871

2872+
.layout--editorial[data-shell-appearance="dark"] .shell-topbar .page-kicker,
2873+
.layout--editorial[data-shell-appearance="dark"] .shell-summary .status-label,
2874+
.layout--editorial[data-shell-appearance="dark"] .shell-popup-panel .status-label,
2875+
.layout--editorial[data-shell-appearance="dark"] .sidebar-entry-label {
2876+
color: var(--shell-highlight);
2877+
}
2878+
28472879
.layout--editorial .sidebar-nav {
28482880
display: grid;
28492881
gap: 16px;
@@ -2999,6 +3031,21 @@ a:hover {
29993031
--shell-selected-line: rgba(255, 255, 255, 0.22);
30003032
}
30013033

3034+
.shell-popup-theme[data-shell-appearance="dark"] .status-label {
3035+
color: var(--shell-highlight);
3036+
}
3037+
3038+
.shell-popup-theme[data-shell-appearance="dark"] .shell-popup-block {
3039+
background:
3040+
linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
3041+
var(--shell-panel-alt);
3042+
border-color: var(--shell-line);
3043+
color: var(--shell-ink);
3044+
box-shadow:
3045+
0 18px 34px rgba(var(--shell-shadow-rgb), 0.28),
3046+
inset 0 1px 0 rgba(255, 255, 255, 0.04);
3047+
}
3048+
30023049
.shell-popup-overlay {
30033050
position: fixed;
30043051
inset: 0;

src/renderer/src/views/ThemeConfigView.redesign.test.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,9 @@ test("ThemeConfigView keeps dark editorial studio titles and primary asset text
169169
/\.layout--editorial\[data-shell-appearance="dark"\] \.theme-studio-note \.section-helper,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.theme-studio-status-card \.status-detail,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.theme-asset-preview-card span[\s\S]*color:\s*var\(--shell-muted\);/,
170170
"expected theme studio supporting copy to use the shell muted token in dark mode",
171171
);
172+
assert.match(
173+
stylesSource,
174+
/\.layout--editorial\[data-shell-appearance="dark"\] \.theme-studio-card,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.theme-asset-preview-card[\s\S]*background:[\s\S]*var\(--shell-panel-alt\);[\s\S]*border-color:\s*var\(--shell-line\);[\s\S]*color:\s*var\(--shell-ink\);/,
175+
"expected theme studio cards and asset preview cards to stop using light card surfaces in dark mode",
176+
);
172177
});

src/renderer/src/views/TutorialCenterView.redesign.test.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,9 @@ test("TutorialCenterView keeps dark-mode tutorial titles and body copy on readab
131131
/\.layout--editorial\[data-shell-appearance="dark"\] \.tutorial-directory-card \.section-helper,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.tutorial-flow-card \.checklist,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.tutorial-action-panel \.section-helper,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.tutorial-lesson-card \.section-helper,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.tutorial-lesson-card \.checklist,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.tutorial-callout \.section-helper[\s\S]*color:\s*var\(--shell-muted\);/,
132132
"expected tutorial body copy and checklist text to use the shell muted token in dark mode",
133133
);
134+
assert.match(
135+
stylesSource,
136+
/\.layout--editorial\[data-shell-appearance="dark"\] \.tutorial-directory-card,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.tutorial-flow-card,[\s\S]*\.layout--editorial\[data-shell-appearance="dark"\] \.tutorial-action-panel[\s\S]*background:[\s\S]*var\(--shell-panel-alt\);[\s\S]*border-color:\s*var\(--shell-line\);[\s\S]*color:\s*var\(--shell-ink\);/,
137+
"expected tutorial directory and workflow cards to use dark shell card surfaces instead of retaining light card styling",
138+
);
134139
});

0 commit comments

Comments
 (0)