commit 2b35ec0f77163c6d0e8f12c6e80f29da6eecda09
parent d14a573e6113d15823b9850d74e54998ba94fab5
Author: triesap <tyson@radroots.org>
Date: Sat, 6 Jun 2026 22:54:19 -0700
app: enforce settings width token
Diffstat:
3 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/crates/desktop/src/source_guards.rs b/crates/desktop/src/source_guards.rs
@@ -657,7 +657,9 @@ const REQUIRED_WINDOW_COPY_KEYS: &[&str] = &[
"AppTextKey::ProductsEditorFieldUnit",
"AppTextKey::ProductsEditorFieldPrice",
"AppTextKey::ProductsEditorFieldStock",
+ "AppTextKey::ProductsEditorFieldAvailability",
"AppTextKey::ProductsEditorFieldStatus",
+ "AppTextKey::ProductsEditorAvailabilityEmpty",
"AppTextKey::ProductsEditorCloseAction",
"AppTextKey::ProductsEditorSaveAction",
"AppTextKey::ProductsEditorSaveFailed",
@@ -945,6 +947,20 @@ fn desktop_window_source_keeps_shell_reset_copy_keyed() {
}
#[test]
+fn desktop_window_source_uses_settings_width_theme_token() {
+ let source = include_str!("window.rs");
+
+ assert!(
+ !source.contains("Some(560.0)"),
+ "settings panel width caps must use APP_UI_THEME.shells.settings_panel_content_max_width_px"
+ );
+ assert!(
+ source.contains("settings_panel_content_max_width_px"),
+ "settings panel width token is not used by window.rs"
+ );
+}
+
+#[test]
fn desktop_launcher_source_keeps_shared_ui_boundary_enforced() {
for (path, source) in launcher_source_files() {
for (pattern, reason) in FORBIDDEN_LAUNCHER_UI_BYPASS_PATTERNS {
diff --git a/crates/desktop/src/window.rs b/crates/desktop/src/window.rs
@@ -7238,7 +7238,7 @@ impl SettingsWindowView {
return app_scroll_panel(
"settings-panel-scroll",
APP_UI_THEME.shells.settings_content_padding_px,
- Some(560.0),
+ Some(APP_UI_THEME.shells.settings_panel_content_max_width_px),
app_stack_v(APP_UI_THEME.shells.home_stack_gap_px)
.w_full()
.child(home_body_text(app_shared_text(
@@ -7259,7 +7259,7 @@ impl SettingsWindowView {
return app_scroll_panel(
"settings-panel-scroll",
APP_UI_THEME.shells.settings_content_padding_px,
- Some(560.0),
+ Some(APP_UI_THEME.shells.settings_panel_content_max_width_px),
app_stack_v(APP_UI_THEME.shells.home_stack_gap_px)
.w_full()
.child(home_body_text(app_shared_text(
@@ -7372,7 +7372,7 @@ impl SettingsWindowView {
app_scroll_panel(
"settings-panel-scroll",
APP_UI_THEME.shells.settings_content_padding_px,
- Some(560.0),
+ Some(APP_UI_THEME.shells.settings_panel_content_max_width_px),
app_stack_v(APP_UI_THEME.shells.home_stack_gap_px)
.w_full()
.child(home_body_text(app_shared_text(
diff --git a/i18n/locales/en/messages.json b/i18n/locales/en/messages.json
@@ -400,13 +400,13 @@
"products.editor.field.title": "Name",
"products.editor.field.subtitle": "Details",
"products.editor.field.category": "Category",
- "products.editor.field.unit": "Unit",
- "products.editor.field.price": "Price (USD)",
- "products.editor.field.stock": "Stock",
- "products.editor.field.availability": "Availability",
- "products.editor.field.status": "Status",
- "products.editor.availability.empty": "Add a fulfillment window in Farm settings before publishing.",
- "products.editor.action.close": "Close",
+ "products.editor.field.unit": "Unit",
+ "products.editor.field.price": "Price (USD)",
+ "products.editor.field.stock": "Stock",
+ "products.editor.field.availability": "Availability",
+ "products.editor.field.status": "Status",
+ "products.editor.availability.empty": "Add a fulfillment window in Farm settings before publishing.",
+ "products.editor.action.close": "Close",
"products.editor.action.save": "Save changes",
"products.editor.save_failed": "Couldn't save product details. Try again.",
"products.editor.invalid_price": "Enter dollars and cents, for example 6.50.",