```
feat(web-ui): 重构地图设置与目标列表页面并优化实时地图导航体验 - 重构地图设置页面布局,采用 flex 替代 grid,新增导航栏、标签页 和下载步骤组件,改善响应式断点适配 - 将目标列表管理从侧边抽屉方案改为全页面内联编辑器,包含表格视图 与分类侧栏,支持移动端卡片式降级展示 - 为实时地图屏幕添加半透明毛玻璃导航栏样式,支持 backdrop-filter 降级,并在地图模式下调整内容区域偏移量 - 修复地图渲染器在画布尺寸为 0 时的边界异常,增加宽高校验 - 优化 fitBounds 的 padding 计算,改为基于容器宽度的比例值并 限制最大值,避免小屏下地图偏移过大 - 新增 B5、B6、B7 三组 SVG 壁纸资源 ```
This commit is contained in:
+18
-1
@@ -32,7 +32,10 @@ impl Default for Appearance {
|
||||
impl Appearance {
|
||||
fn validate(&self) -> Result<()> {
|
||||
if !matches!(self.theme.as_str(), "graphite" | "blue" | "white")
|
||||
|| !matches!(self.wallpaper.as_str(), "B1" | "B2" | "B3" | "B4")
|
||||
|| !matches!(
|
||||
self.wallpaper.as_str(),
|
||||
"B1" | "B2" | "B3" | "B4" | "B5" | "B6" | "B7"
|
||||
)
|
||||
|| !matches!(self.fit.as_str(), "cover" | "contain")
|
||||
|| self.dim > 65
|
||||
|| self.blur > 16
|
||||
@@ -143,6 +146,20 @@ mod tests {
|
||||
assert_eq!(raw, "broken");
|
||||
}
|
||||
#[test]
|
||||
fn bright_wallpapers_persist_and_unknown_wallpapers_are_rejected() {
|
||||
let mut db = db();
|
||||
for wallpaper in ["B5", "B6", "B7"] {
|
||||
let mut prefs = load(&db).unwrap();
|
||||
prefs.wallpaper = wallpaper.into();
|
||||
save(&mut db, serde_json::to_value(prefs).unwrap()).unwrap();
|
||||
assert_eq!(load(&db).unwrap().wallpaper, wallpaper);
|
||||
}
|
||||
let mut prefs = load(&db).unwrap();
|
||||
prefs.wallpaper = "B8".into();
|
||||
assert!(save(&mut db, serde_json::to_value(prefs).unwrap()).is_err());
|
||||
assert_eq!(load(&db).unwrap().wallpaper, "B7");
|
||||
}
|
||||
#[test]
|
||||
fn new_default_does_not_replace_saved_legacy_appearance() {
|
||||
let mut db = db();
|
||||
assert_eq!(load(&db).unwrap().wallpaper, "B4");
|
||||
|
||||
Reference in New Issue
Block a user