Theme · Importing: a long name gives way, four-digit colors read

A read theme's name is an Ellipsis that gives way beside its mode badge,
so a long name keeps the badge inside a 280px box. parse_hex reads #rgba
as VS Code does, each digit doubled, so a theme with a four-digit color
reads. Tests hold the badge inside the box and read #0008 as black at
0x88 alpha.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-09-27 17:32:21 -04:00
1 parent d5cfaeb19c
commit 106faca970
5 files changed
+60 -13

No files matched your search

+15 -5
View File
@@ -13,6 +13,7 @@ use crate::{
forms::DropZone,
primitives::Severity,
theme::{ActiveTheme, Mode, TextSize},
typography::Ellipsis,
};
/// What the importer read last: a theme and the file it came from, or why the file did not read.
@@ -127,13 +128,22 @@ pub(super) fn read_row(
.gap_2()
.child(
div()
.flex_1()
.min_w_0()
.font_weight(FontWeight::MEDIUM)
.child(read.name.clone().map_or(file.clone(), SharedString::from)),
.child(Ellipsis::new(
read.name.clone().map_or(file.clone(), SharedString::from),
)),
)
.child(Badge::new(match read.mode {
Mode::Light => "Light",
Mode::Dark => "Dark",
})),
.child(
div()
.flex_none()
.debug_selector(|| "theme-import-mode".into())
.child(Badge::new(match read.mode {
Mode::Light => "Light",
Mode::Dark => "Dark",
})),
),
)
.child(
div()