diff --git a/app/desktop/src/main/kotlin/io/github/cubsync/desktop/Theme.kt b/app/desktop/src/main/kotlin/io/github/cubsync/desktop/Theme.kt index e19296f..c2edd5f 100644 --- a/app/desktop/src/main/kotlin/io/github/cubsync/desktop/Theme.kt +++ b/app/desktop/src/main/kotlin/io/github/cubsync/desktop/Theme.kt @@ -58,19 +58,25 @@ data class CubColors( internal val DarkCubColors = CubColors( isDark = true, - // The phone's dark palette, value for value. The desktop had its own near-black set - // (#0F1116 against #141318), so the two ends looked like two products side by side — - // and the phone's is the one the design tokens name. - background = Color(0xFF141318), - surface = Color(0xFF141318), - surfaceRaised = Color(0xFF1F1F26), - surfaceSunken = Color(0xFF26252C), + // `html[data-theme="dark"]`, value for value — the desktop's own dark set, not the + // phone's. Taking the phone's (#141318 for both the canvas and the panels) put every + // card on the colour it was meant to stand on, and a window of one flat black field + // is what "深色模式看不清" looks like: nothing separates, so nothing reads. + background = Color(0xFF0F1116), + surface = Color(0xFF181B21), + surfaceRaised = Color(0xFF1E222A), + surfaceSunken = Color(0xFF242932), outline = Color(0xFF2A2F39), - outlineFaint = Color(0xFF232229), - outlineStrong = Color(0xFF3A3942), - text = Color(0xFFE6E1E9), - textDim = Color(0xFFC9C5D0), - textFaint = Color(0xFF8E8A97), + outlineFaint = Color(0xFF22262E), + outlineStrong = Color(0xFF343A46), + text = Color(0xFFE8EBF1), + // `--dim` is #98A1B0 and `--dim-2` is #6D7686 in the prototype. Both were raised for + // the dark window: at 11–12sp these two carry every explanatory line, and on a panel + // the prototype's own values read as grey-on-grey — the complaint that started this. + // The structure (canvas, panel, raised, sunken) is still the prototype's, value for + // value; only the two text weights moved, and `决策记录` says why. + textDim = Color(0xFFC2CAD8), + textFaint = Color(0xFF97A0AE), accent = Color(0xFF1E88E5), // `color-mix(in srgb, var(--win-accent) 14%, transparent)` — translucent on purpose, // so it composites over whatever it is put on exactly as the prototype's does. @@ -81,10 +87,10 @@ internal val DarkCubColors = CubColors( success = Color(0xFF2E9E5B), conflict = Color(0xFFF0731F), info = Color(0xFF3B82F6), - rail = Color(0xFF1F1F26), - hover = Color(0xFF26252C), - selected = Color(0x2E4C6EF5), - selectedLine = Color(0xFF4C6EF5), + rail = Color(0xFF181B21), + hover = Color(0xFF232833), + selected = Color(0xFF1D2C3E), + selectedLine = Color(0xFF2B5F8F), ) internal val LightCubColors = CubColors( diff --git a/app/desktop/src/main/kotlin/io/github/cubsync/desktop/ui/Components.kt b/app/desktop/src/main/kotlin/io/github/cubsync/desktop/ui/Components.kt index 48727e7..25b8e27 100644 --- a/app/desktop/src/main/kotlin/io/github/cubsync/desktop/ui/Components.kt +++ b/app/desktop/src/main/kotlin/io/github/cubsync/desktop/ui/Components.kt @@ -278,7 +278,7 @@ fun SettingRow( ) { Column(Modifier.weight(1f)) { Text(label, style = CubType.label, color = colors.text) - if (hint.isNotEmpty()) Text(hint, style = CubType.meta, color = colors.textFaint) + if (hint.isNotEmpty()) Text(hint, style = CubType.meta, color = colors.textDim) } control() } @@ -312,7 +312,7 @@ fun Toggle(checked: Boolean, enabled: Boolean = true, onChange: (Boolean) -> Uni fun KeyValueRow(key: String, value: String, dim: Boolean = false) { val colors = CubTheme.colors Row(Modifier.fillMaxWidth().padding(vertical = 2.dp), verticalAlignment = Alignment.Top) { - Text(key, style = CubType.meta, color = colors.textFaint, modifier = Modifier.width(96.dp)) + Text(key, style = CubType.meta, color = colors.textDim, modifier = Modifier.width(96.dp)) Text( value.ifEmpty { "—" }, style = CubType.body, @@ -459,7 +459,7 @@ fun EmptyState(text: String, detail: String = "", action: (@Composable () -> Uni Text(text, style = CubType.body, color = colors.textDim) if (detail.isNotEmpty()) { Spacer(Modifier.height(4.dp)) - Text(detail, style = CubType.meta, color = colors.textFaint) + Text(detail, style = CubType.meta, color = colors.textDim) } if (action != null) { Spacer(Modifier.height(10.dp)) diff --git a/app/desktop/src/main/kotlin/io/github/cubsync/desktop/ui/ConnectScreen.kt b/app/desktop/src/main/kotlin/io/github/cubsync/desktop/ui/ConnectScreen.kt index b57a69a..75e7197 100644 --- a/app/desktop/src/main/kotlin/io/github/cubsync/desktop/ui/ConnectScreen.kt +++ b/app/desktop/src/main/kotlin/io/github/cubsync/desktop/ui/ConnectScreen.kt @@ -251,7 +251,10 @@ private fun NegotiationCard(state: AppState, modifier: Modifier) { Spacer(Modifier.height(14.dp)) Kv("本机版本 / 远端版本") { - "${BuildInfo.PROTOCOL_VERSION * 100} / ${(peer?.protocolVersion ?: 0) * 100}" + // No peer is not version zero: an em dash says "nothing to compare with", + // where 0 read as a build from before the protocol existed. + val remote = peer?.protocolVersion?.let { "${it * 100}" } ?: DASH + "${BuildInfo.PROTOCOL_VERSION * 100} / $remote" } Kv("比对到的能力位") { "$agreed / $total" } Kv("v3 老版本远端") { "仅退出双向模式(清晰提示,不错位)" } diff --git a/app/desktop/src/test/kotlin/io/github/cubsync/desktop/Preview.kt b/app/desktop/src/test/kotlin/io/github/cubsync/desktop/Preview.kt index e6c5cbd..ec718ea 100644 --- a/app/desktop/src/test/kotlin/io/github/cubsync/desktop/Preview.kt +++ b/app/desktop/src/test/kotlin/io/github/cubsync/desktop/Preview.kt @@ -128,6 +128,12 @@ object Preview { view: DisplayMode? = null, displayMenu: Boolean = false, ): AppState { + // Each state starts from the same tree: the scratch area is emptied here rather + // than once per JVM, so a screen cannot be photographed with whatever the test + // before it happened to leave behind. + runCatching { scratch.toFile().deleteRecursively() } + Files.createDirectories(scratch) + val directory = Files.createTempDirectory("cubsync-preview-") val log = AppLog(now = { NOW }) val desktop = DesktopSettings.inStateDirectory(directory) diff --git a/app/desktop/src/test/resources/screenshots/windows/00-transfer.png b/app/desktop/src/test/resources/screenshots/windows/00-transfer.png index 1c16c24..580addb 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/00-transfer.png and b/app/desktop/src/test/resources/screenshots/windows/00-transfer.png differ diff --git a/app/desktop/src/test/resources/screenshots/windows/01-connect.png b/app/desktop/src/test/resources/screenshots/windows/01-connect.png index fe03f8d..419c5ca 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/01-connect.png and b/app/desktop/src/test/resources/screenshots/windows/01-connect.png differ diff --git a/app/desktop/src/test/resources/screenshots/windows/02-sync.png b/app/desktop/src/test/resources/screenshots/windows/02-sync.png index 30506e7..e305969 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/02-sync.png and b/app/desktop/src/test/resources/screenshots/windows/02-sync.png differ diff --git a/app/desktop/src/test/resources/screenshots/windows/03-jobs.png b/app/desktop/src/test/resources/screenshots/windows/03-jobs.png index 4266db9..4942a79 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/03-jobs.png and b/app/desktop/src/test/resources/screenshots/windows/03-jobs.png differ diff --git a/app/desktop/src/test/resources/screenshots/windows/04-job-detail.png b/app/desktop/src/test/resources/screenshots/windows/04-job-detail.png index d4280fe..da257f6 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/04-job-detail.png and b/app/desktop/src/test/resources/screenshots/windows/04-job-detail.png differ diff --git a/app/desktop/src/test/resources/screenshots/windows/05-logs.png b/app/desktop/src/test/resources/screenshots/windows/05-logs.png index a1b6ee3..cc10985 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/05-logs.png and b/app/desktop/src/test/resources/screenshots/windows/05-logs.png differ diff --git a/app/desktop/src/test/resources/screenshots/windows/06-settings.png b/app/desktop/src/test/resources/screenshots/windows/06-settings.png index 6b8b3c0..7b150c1 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/06-settings.png and b/app/desktop/src/test/resources/screenshots/windows/06-settings.png differ diff --git a/app/desktop/src/test/resources/screenshots/windows/07-transfer-light.png b/app/desktop/src/test/resources/screenshots/windows/07-transfer-light.png index d19705f..960bf74 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/07-transfer-light.png and b/app/desktop/src/test/resources/screenshots/windows/07-transfer-light.png differ diff --git a/app/desktop/src/test/resources/screenshots/windows/08-transfer-compare.png b/app/desktop/src/test/resources/screenshots/windows/08-transfer-compare.png index 91572a2..067f790 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/08-transfer-compare.png and b/app/desktop/src/test/resources/screenshots/windows/08-transfer-compare.png differ diff --git a/app/desktop/src/test/resources/screenshots/windows/09-transfer-card.png b/app/desktop/src/test/resources/screenshots/windows/09-transfer-card.png index 4f505aa..43e0923 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/09-transfer-card.png and b/app/desktop/src/test/resources/screenshots/windows/09-transfer-card.png differ diff --git a/app/desktop/src/test/resources/screenshots/windows/10-transfer-viewmenu.png b/app/desktop/src/test/resources/screenshots/windows/10-transfer-viewmenu.png index fcfec3b..678480f 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/10-transfer-viewmenu.png and b/app/desktop/src/test/resources/screenshots/windows/10-transfer-viewmenu.png differ diff --git a/app/desktop/src/test/resources/screenshots/windows/11-transfer-compact.png b/app/desktop/src/test/resources/screenshots/windows/11-transfer-compact.png index 47ba7b6..e16f081 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/11-transfer-compact.png and b/app/desktop/src/test/resources/screenshots/windows/11-transfer-compact.png differ diff --git a/app/desktop/src/test/resources/screenshots/windows/12-transfer-thumb.png b/app/desktop/src/test/resources/screenshots/windows/12-transfer-thumb.png index da887cd..98c5750 100644 Binary files a/app/desktop/src/test/resources/screenshots/windows/12-transfer-thumb.png and b/app/desktop/src/test/resources/screenshots/windows/12-transfer-thumb.png differ