From 35859e773699476076278c2cc1379c2807ac9ac1 Mon Sep 17 00:00:00 2001 From: Jannik Wappler <167129173+RavoxX@users.noreply.github.com> Date: Tue, 13 Oct 2026 09:36:19 +0300 Subject: [PATCH] #3262: Add scrollbar visibility preferences --- crates/engine/src/prefs.rs | 5 ++ crates/engine/src/prefs/tests.rs | 20 ++++++ crates/ui-egui/src/canvas.rs | 11 +++- crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 2 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 2 + crates/ui-egui/src/i18n/fr.tsv | 2 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 2 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 2 + crates/ui-egui/src/i18n/ko.tsv | 2 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 2 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 2 + crates/ui-egui/src/i18n/sr.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 2 + crates/ui-egui/src/i18n/vi.tsv | 2 + crates/ui-egui/src/i18n/zh-hans.tsv | 2 + crates/ui-egui/src/i18n/zh-hant.tsv | 2 + crates/ui-egui/src/prefs_ui.rs | 3 + crates/ui-egui/src/theme.rs | 94 +++++++++++++++++++++++++++++ docs/gaps.md | 7 ++- docs/scorecard.md | 4 +- docs/ui-design.md | 6 ++ docs/ui-parity.md | 4 +- 29 files changed, 179 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/prefs.rs b/crates/engine/src/prefs.rs index 378f71c18e..247ad5e133 100644 --- a/crates/engine/src/prefs.rs +++ b/crates/engine/src/prefs.rs @@ -83,6 +83,7 @@ choice!( LinuxDisplayServer { Auto = "auto", X11 = "x11" } default Auto ); choice!(UiFontSize { Tiny = "tiny", Small = "small", Medium = "medium", Large = "large" } default Small); +choice!(ScrollbarVisibility { Default = "default", Always = "always", AutoHide = "autoHide", Hidden = "hidden" } default Default); choice!(LogDestination { Metadata = "metadata", TextFile = "textFile", Both = "both" } default Metadata); choice!(LogDetail { SessionsOnly = "sessionsOnly", Concise = "concise", Detailed = "detailed" } default Concise); choice!(Ask { Always = "always", Never = "never", Ask = "ask" } default Always); @@ -265,6 +266,8 @@ pub struct Interface { /// Command ids and the control protocol stay English. pub language: String, pub ui_font_size: UiFontSize, + /// Default follows the theme; other modes apply to panel and canvas scrollbars (#3262). + pub scrollbar_visibility: ScrollbarVisibility, pub show_channels_in_color: bool, pub dynamic_color_sliders: bool, /// Draw menu item colours set with Edit › Menus. @@ -302,6 +305,7 @@ impl Default for Interface { ui_scale: UiScale::Auto, language: "auto".into(), ui_font_size: UiFontSize::Small, + scrollbar_visibility: ScrollbarVisibility::Default, show_channels_in_color: false, dynamic_color_sliders: true, show_menu_colors: true, @@ -1101,6 +1105,7 @@ pub fn choices(path: &str) -> Option<&'static [&'static str]> { "interface.canvasBorder" => CanvasBorder::NAMES, "interface.uiScale" => UiScale::NAMES, "interface.uiFontSize" => UiFontSize::NAMES, + "interface.scrollbarVisibility" => ScrollbarVisibility::NAMES, "historyLog.destination" => LogDestination::NAMES, "historyLog.detail" => LogDetail::NAMES, "fileHandling.imagePreviews" | "fileHandling.maximizePsdCompatibility" => Ask::NAMES, diff --git a/crates/engine/src/prefs/tests.rs b/crates/engine/src/prefs/tests.rs index 6bb34a9706..704e5cc439 100644 --- a/crates/engine/src/prefs/tests.rs +++ b/crates/engine/src/prefs/tests.rs @@ -22,6 +22,26 @@ fn defaults_match_photoshop() { } } +#[test] +fn scrollbar_visibility_round_trips_and_old_preferences_keep_the_theme_default() { + let old = serde_json::from_value::(json!({"interface": {"uiFontSize": "small"}})).unwrap(); + assert_eq!(old.interface.scrollbar_visibility, ScrollbarVisibility::Default); + assert_eq!(choices("interface.scrollbarVisibility"), Some(ScrollbarVisibility::NAMES)); + let mut s = Session::new(); + for mode in ScrollbarVisibility::NAMES { + s.execute("prefs.set", json!({"values": {"interface.scrollbarVisibility": mode}})).unwrap(); + let saved = s.prefs().to_json(); + let loaded: Preferences = serde_json::from_value(saved.clone()).unwrap(); + assert_eq!(loaded.interface.scrollbar_visibility, s.prefs().interface.scrollbar_visibility); + assert_eq!(saved["interface"]["scrollbarVisibility"], json!(mode)); + } + let before = s.prefs().to_json(); + assert!(s.execute("prefs.set", json!({"values": {"interface.scrollbarVisibility": "sometimes"}})).is_err()); + assert_eq!(s.prefs().to_json(), before); + s.execute("prefs.reset", json!({"path": "interface.scrollbarVisibility"})).unwrap(); + assert_eq!(s.prefs().interface.scrollbar_visibility, ScrollbarVisibility::Default); +} + /// #2264: the Studio workspace dot pattern can be hidden without changing themes. #[test] fn canvas_dot_grid_can_be_disabled_persisted_and_reset() { diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 9cf6da73e6..3cf3807f9f 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -3748,8 +3748,15 @@ pub fn canvas_view(app: &mut PhotocraftApp, ui: &mut egui::Ui, idx: usize, rect: // Scrollbars (scrollbars.rs): drawn over the canvas edges, they take the pointer there. let t0 = crate::gpu_canvas::now_ms(); let before = view.center; - let over_bars = app.ui.view.shows_scrollbars() - && crate::scrollbars::show(ui, rect, &mut view, flip, aspect, app.session.prefs().tools.overscroll, egui::Id::new(("pc-canvas", idx))); + let bar_mode = app.session.prefs().interface.scrollbar_visibility; + let show_bars = app.ui.view.shows_scrollbars() + && match bar_mode { + photocraft_engine::prefs::ScrollbarVisibility::Hidden => false, + photocraft_engine::prefs::ScrollbarVisibility::AutoHide => ui.rect_contains_pointer(rect) || ui.input(|i| i.pointer.any_down()), + _ => true, + }; + let over_bars = + show_bars && crate::scrollbars::show(ui, rect, &mut view, flip, aspect, app.session.prefs().tools.overscroll, egui::Id::new(("pc-canvas", idx))); ctx.data_mut(|d| d.insert_temp(bars_id, over_bars)); if view.center != before { ctx.request_repaint(); diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 201ce4a2ea..f64f28d39e 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -3727,3 +3727,4 @@ navigator Zoom Zvětšení Step {step} is waiting for its dialog Krok {step} čeká na svůj dialog @plural {n} action|{n} actions {n} akce|{n} akce|{n} akcí Auto Add/Delete Automaticky přidat/odstranit + Scrollbar Visibility Viditelnost posuvníků diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index d8cac0f730..524292bfc8 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -2759,3 +2759,5 @@ curves Smooth Glätten Step {step} is waiting for its dialog Schritt {step} wartet auf seinen Dialog @plural {n} action|{n} actions {n} Aktion|{n} Aktionen Auto Add/Delete Autom. hinzuf./löschen + Scrollbar Visibility Sichtbarkeit der Scrollleisten + Hidden Ausgeblendet diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 337ca4584d..9b895e15ef 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -3816,3 +3816,4 @@ curves Smooth Εξομάλυνση Step {step} is waiting for its dialog Το βήμα {step} περιμένει το παράθυρο διαλόγου του @plural {n} action|{n} actions {n} ενέργεια|{n} ενέργειες Auto Add/Delete Αυτόματη προσθήκη/διαγραφή + Scrollbar Visibility Ορατότητα γραμμών κύλισης diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 3f262bb12e..f97a61e78c 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -2800,3 +2800,5 @@ curves Smooth Suavizar Step {step} is waiting for its dialog El paso {step} está esperando su cuadro de diálogo @plural {n} action|{n} actions {n} acción|{n} acciones Auto Add/Delete Añadir/eliminar automáticamente + Scrollbar Visibility Visibilidad de las barras de desplazamiento + Hidden Oculto diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 31663c2404..db68c18af7 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3120,3 +3120,5 @@ curves Smooth Lisser Step {step} is waiting for its dialog L’étape {step} attend sa boîte de dialogue @plural {n} action|{n} actions {n} action|{n} actions Auto Add/Delete Ajout/suppr. auto + Scrollbar Visibility Visibilité des barres de défilement + Hidden Masqué diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 545a29aa36..190ea0c913 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -4040,3 +4040,4 @@ cameraRaw Yellow Sárga Loaded Camera Raw settings from {file} Camera Raw-beállítások betöltve innen: {file} Loaded Camera Raw settings from {file} ({n} not supported) Camera Raw-beállítások betöltve innen: {file} ({n} nem támogatott) Auto Add/Delete Automatikus hozzáadás/törlés + Scrollbar Visibility Görgetősávok láthatósága diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 2923b01a98..fcce926d49 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -3107,3 +3107,5 @@ curves Smooth Haluskan Step {step} is waiting for its dialog Langkah {step} menunggu dialognya @plural {n} action|{n} actions {n} tindakan Auto Add/Delete Tambah/Hapus Otomatis + Scrollbar Visibility Visibilitas bilah gulir + Hidden Tersembunyi diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index a4d8805e5a..13343c724c 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -4083,3 +4083,4 @@ navigator Zoom Zoom Step {step} is waiting for its dialog Il passaggio {step} attende la sua finestra di dialogo @plural {n} action|{n} actions {n} azione|{n} azioni Auto Add/Delete Aggiungi/elimina automaticamente + Scrollbar Visibility Visibilità delle barre di scorrimento diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index d22fec547e..2b3a0ef872 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3796,3 +3796,5 @@ curves Smooth スムーズ Clear Brush Controls ブラシのコントロールを消去 Reset All Locked Settings ロックされた設定をすべて初期化 Copy Texture to Other Tools テクスチャを他のツールにコピー + Scrollbar Visibility スクロールバーの表示 + Hidden 非表示 diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 56f3f5bf07..67734b47a4 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3289,3 +3289,5 @@ curves Smooth 매끄럽게 Step {step} is waiting for its dialog {step}단계가 대화 상자를 기다리고 있습니다 @plural {n} action|{n} actions 액션 {n}개 Auto Add/Delete 자동 추가/삭제 + Scrollbar Visibility 스크롤 막대 표시 + Hidden 숨김 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 3fbe7cf2c8..cefce44688 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -3878,3 +3878,4 @@ curves Smooth Vloeiend maken Step {step} is waiting for its dialog Stap {step} wacht op zijn dialoogvenster @plural {n} action|{n} actions {n} handeling|{n} handelingen Auto Add/Delete Automatisch toevoegen/verwijderen + Scrollbar Visibility Zichtbaarheid van schuifbalken diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 98adf9dcec..190ae2e028 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -3716,3 +3716,5 @@ curves Smooth Wygładź Step {step} is waiting for its dialog Krok {step} czeka na swoje okno dialogowe @plural {n} action|{n} actions {n} operacja|{n} operacje|{n} operacji Auto Add/Delete Automatyczne dodawanie/usuwanie + Scrollbar Visibility Widoczność pasków przewijania + Hidden Ukryte diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index f2f1034a1e..3d38b99a05 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -3908,3 +3908,4 @@ layerLabel No Color Sem cor Step {step} is waiting for its dialog A etapa {step} está aguardando sua caixa de diálogo @plural {n} action|{n} actions {n} ação|{n} ações Auto Add/Delete Adicionar/excluir automaticamente + Scrollbar Visibility Visibilidade das barras de rolagem diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 9a65752621..bda4872f3a 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3064,3 +3064,5 @@ curves Smooth Сгладить Step {step} is waiting for its dialog Шаг {step} ожидает своего диалога @plural {n} action|{n} actions {n} операция|{n} операции|{n} операций Auto Add/Delete Автодобавление/удаление + Scrollbar Visibility Видимость полос прокрутки + Hidden Скрыто diff --git a/crates/ui-egui/src/i18n/sr.tsv b/crates/ui-egui/src/i18n/sr.tsv index 2c56ff9ab0..b43e0a0b37 100644 --- a/crates/ui-egui/src/i18n/sr.tsv +++ b/crates/ui-egui/src/i18n/sr.tsv @@ -4194,3 +4194,4 @@ shape Appearance Izgled # Custom print paper (#3820) Paper Width Širina papira Paper Height Visina papira + Scrollbar Visibility Vidljivost traka za pomeranje diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 1eb8e16f42..f02cebc67d 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3851,3 +3851,4 @@ cameraData Lens Lens Loaded Camera Raw settings from {file} Camera Raw ayarları {file} dosyasından yüklendi Loaded Camera Raw settings from {file} ({n} not supported) Camera Raw ayarları {file} dosyasından yüklendi ({n} desteklenmiyor) Auto Add/Delete Otomatik Ekle/Sil + Scrollbar Visibility Kaydırma çubuklarının görünürlüğü diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 921b7b1e03..885ff271f4 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3817,3 +3817,5 @@ curves Smooth Згладити Step {step} is waiting for its dialog Крок {step} очікує на свій діалог @plural {n} action|{n} actions {n} операція|{n} операції|{n} операцій Auto Add/Delete Автододавання/видалення + Scrollbar Visibility Видимість смуг прокручування + Hidden Приховано diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 68acfe2db2..4735ad8642 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3604,3 +3604,5 @@ curves Smooth Làm mượt Import .GRD Nhập .GRD Choose a gradient file (.grd). Chọn tệp chuyển sắc (.grd). Auto Add/Delete Tự động thêm/xóa + Scrollbar Visibility Hiển thị thanh cuộn + Hidden Ẩn diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index d8fc715989..8312e1e76b 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2724,3 +2724,5 @@ curves Smooth 平滑 Step {step} is waiting for its dialog 步骤 {step} 正在等待其对话框 @plural {n} action|{n} actions {n} 个动作 Auto Add/Delete 自动添加/删除 + Scrollbar Visibility 滚动条可见性 + Hidden 隐藏 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1219fa31d6..0efd0b7d12 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -2709,3 +2709,5 @@ curves Smooth 平滑 Step {step} is waiting for its dialog 步驟 {step} 正在等待其對話框 @plural {n} action|{n} actions {n} 個動作 Auto Add/Delete 自動增加/刪除 + Scrollbar Visibility 捲軸可見性 + Hidden 隱藏 diff --git a/crates/ui-egui/src/prefs_ui.rs b/crates/ui-egui/src/prefs_ui.rs index cf0ff51969..ace094314c 100644 --- a/crates/ui-egui/src/prefs_ui.rs +++ b/crates/ui-egui/src/prefs_ui.rs @@ -423,6 +423,7 @@ pub fn tick(app: &mut PhotocraftApp, ctx: &egui::Context) { sync_rulers(app); sync_display_scale(app, ctx); sync_appearance(app, ctx); + crate::theme::sync_scrollbars(ctx, app.session.prefs().interface.scrollbar_visibility); crate::theme::set_ui_font_size(ctx, app.session.prefs().interface.ui_font_size); presets_store(app); sync_tooltips(app, ctx); @@ -1038,6 +1039,7 @@ fn humanize(key: &str) -> String { "appearanceMode" => return "Appearance Mode".into(), "darkTheme" => return "Dark Theme".into(), "lightTheme" => return "Light Theme".into(), + "scrollbarVisibility" => return "Scrollbar Visibility".into(), _ => {} } // These controls appear only for WebP, so reuse the existing translated labels. @@ -1070,6 +1072,7 @@ fn humanize(key: &str) -> String { fn choice_label(v: &str) -> String { match v { + "autoHide" => "Auto Hide".into(), "cm" => "Centimeters".into(), "mm" => "Millimeters".into(), "75" | "80" | "85" | "90" | "95" | "100" | "125" | "150" | "175" | "200" | "250" | "300" => format!("{v}%"), diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index eb61cfbeaf..bdf34fac5e 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -1054,6 +1054,48 @@ pub fn apply(ctx: &egui::Context, kind: ThemeKind) { let style = ctx.global_style(); ctx.set_style_of(egui::Theme::Light, Arc::clone(&style)); ctx.set_style_of(egui::Theme::Dark, style); + ctx.data_mut(|d| d.remove::(egui::Id::new("pc-scrollbar-visibility"))); +} + +/// Apply the saved override once per change, including after a theme switch. +pub(crate) fn sync_scrollbars(ctx: &egui::Context, mode: photocraft_engine::prefs::ScrollbarVisibility) { + use photocraft_engine::prefs::ScrollbarVisibility; + let id = egui::Id::new("pc-scrollbar-visibility"); + if ctx.data(|d| d.get_temp::(id)) == Some(mode) { + return; + } + let t = Tokens::get(ctx); + let mut scroll = match mode { + ScrollbarVisibility::Always => egui::style::ScrollStyle::solid(), + ScrollbarVisibility::AutoHide | ScrollbarVisibility::Hidden => egui::style::ScrollStyle::floating(), + ScrollbarVisibility::Default if t.bevel => egui::style::ScrollStyle::solid(), + ScrollbarVisibility::Default => egui::style::ScrollStyle::thin(), + }; + if scroll.floating { + scroll.interact_handle_opacity = 1.0; + scroll.interact_background_opacity = 0.4; + if mode == ScrollbarVisibility::Default { + scroll.floating_width = 4.0; + } + } + if mode == ScrollbarVisibility::Hidden { + scroll.bar_width = 0.0; + scroll.floating_width = 0.0; + scroll.floating_allocated_width = 0.0; + scroll.bar_inner_margin = 0.0; + scroll.bar_outer_margin = 0.0; + scroll.dormant_handle_opacity = 0.0; + scroll.active_handle_opacity = 0.0; + scroll.interact_handle_opacity = 0.0; + scroll.dormant_background_opacity = 0.0; + scroll.active_background_opacity = 0.0; + scroll.interact_background_opacity = 0.0; + } + ctx.global_style_mut(|s| s.spacing.scroll = scroll); + let style = ctx.global_style(); + ctx.set_style_of(egui::Theme::Light, Arc::clone(&style)); + ctx.set_style_of(egui::Theme::Dark, style); + ctx.data_mut(|d| d.insert_temp(id, mode)); } /// Seconds the pointer rests on a control before its tooltip shows. @@ -1071,6 +1113,58 @@ pub fn canvas_bg(t: &Tokens) -> Color32 { mod tests { use super::*; + #[test] + fn scrollbar_visibility_applies_in_every_theme_and_survives_theme_changes() { + use photocraft_engine::prefs::ScrollbarVisibility as Mode; + let ctx = egui::Context::default(); + for kind in ThemeKind::ALL { + apply(&ctx, kind); + let original = ctx.global_style().spacing.scroll; + sync_scrollbars(&ctx, Mode::Default); + assert_eq!(ctx.global_style().spacing.scroll, original); + sync_scrollbars(&ctx, Mode::Always); + assert!(!ctx.global_style().spacing.scroll.floating); + assert!(ctx.global_style().spacing.scroll.bar_width > 0.0); + sync_scrollbars(&ctx, Mode::AutoHide); + assert!(ctx.global_style().spacing.scroll.floating); + assert_eq!(ctx.global_style().spacing.scroll.dormant_handle_opacity, 0.0); + sync_scrollbars(&ctx, Mode::Hidden); + assert_eq!(ctx.global_style().spacing.scroll.bar_width, 0.0); + apply(&ctx, kind); + sync_scrollbars(&ctx, Mode::Hidden); + assert_eq!(ctx.global_style().spacing.scroll.bar_width, 0.0, "theme changes retain the saved override"); + sync_scrollbars(&ctx, Mode::Default); + assert_eq!(ctx.global_style().spacing.scroll, original); + } + } + + #[test] + fn hidden_scrollbars_keep_wheel_scrolling_available() { + let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(300.0, 120.0)).build_ui_state( + |ui, offset: &mut f32| { + let area = egui::ScrollArea::vertical().max_height(100.0).show(ui, |ui| { + for i in 0..30 { + ui.label(format!("Row {i}")); + } + }); + *offset = area.state.offset.y; + }, + 0.0, + ); + sync_scrollbars(&h.ctx, photocraft_engine::prefs::ScrollbarVisibility::Hidden); + h.run(); + h.hover_at(egui::pos2(30.0, 40.0)); + h.event(egui::Event::MouseWheel { + unit: egui::MouseWheelUnit::Line, + delta: egui::vec2(0.0, -3.0), + phase: egui::TouchPhase::Move, + modifiers: egui::Modifiers::NONE, + }); + h.run(); + assert!(*h.state() > 0.0); + assert_eq!(h.ctx.global_style().spacing.scroll.allocated_width(), 0.0); + } + fn text_sizes(ctx: &egui::Context) -> Vec { let mut sizes = Vec::new(); // The plugin queues changed fonts at the end of a pass; egui applies them next pass. diff --git a/docs/gaps.md b/docs/gaps.md index 65102e2d0e..58f4e430d5 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Where PhotoCraft falls short of Photoshop -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-12 · **Change:** minor (G1: CMYK Invert, Posterize and Threshold on the inks, 16-bit Lab Invert; Photoshop-oracle floor 145/258; G11: `.atn` import maps 112 events: Select and Mask, Filter Gallery Spatter, Ripple, Crystallize, Pattern Fill layers, mask targeting, Step Backward, nudges in points, Bitmap mode; G5: Free Transform H/V skew fields; G9: toolbar tool shortcut editing; refreshed against main: G2, G5, G7, G9, G10, G13, G14, G17 items that landed; G10: DPX read and write, #1049; G4: checkbox-only Brush Settings rows; G11: Load/Save Actions `.atn` landed, AUTO-219-2 partial; G5: hold-a-key spring-loaded tools landed, #2672; G1: #2465 fixed) · **Target:** Adobe Photoshop 2026 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-13 · **Change:** minor (scrollbar visibility preference, #3262; G1: CMYK Invert, Posterize and Threshold on the inks, 16-bit Lab Invert; Photoshop-oracle floor 145/258; G11: `.atn` import maps 112 events: Select and Mask, Filter Gallery Spatter, Ripple, Crystallize, Pattern Fill layers, mask targeting, Step Backward, nudges in points, Bitmap mode; G5: Free Transform H/V skew fields; G9: toolbar tool shortcut editing; refreshed against main: G2, G5, G7, G9, G10, G13, G14, G17 items that landed; G10: DPX read and write, #1049; G4: checkbox-only Brush Settings rows; G11: Load/Save Actions `.atn` landed, AUTO-219-2 partial; G5: hold-a-key spring-loaded tools landed, #2672; G1: #2465 fixed) · **Target:** Adobe Photoshop 2026 Every known shortfall against Photoshop 2026 (27.11.0), one entry each, ranked by user impact on the way to beta. This is the work list agents pick from: take the highest-ranked entry that @@ -180,9 +180,11 @@ what an agent can't finish alone. - **Estimate:** 60–110 h. ### G9. Panels, preferences and workspace +- **Progress (2026-10-13):** scrollbar visibility can follow the theme, stay expanded, auto-hide + or be hidden; panel and canvas scrolling remain available (#3262). - **Progress (2026-10-12):** toolbar tool shortcuts can be reassigned, removed and reset (#4086), with saved bindings, matching toolbar hints and regression coverage (`ui-egui/src/tool_shortcuts.rs`). -- **Missing:** 27 of 156 preferences do nothing (scorecard prefs audit); panel groups can't +- **Missing:** 26 of 157 preferences do nothing (scorecard prefs audit); panel groups can't float or tear off into OS windows (UI-217-5, #1828, #1213, #2305); Color panel lacks wheel and slider modes (UI-217-17, #2569); more themes (UI-217-11, #2661); layer clipboard (UI-217-23, #2670); tool-specific context menus beyond brushes, selections and Pen @@ -252,6 +254,7 @@ what an agent can't finish alone. | Date | Change | Summary | |---|---|---| +| 2026-10-13 | minor | Scrollbar visibility preference for panels and the canvas (#3262), with live application, theme retention and wheel-scrolling coverage | | 2026-10-12 | minor | G5: Free Transform options bar H/V skew fields done | | 2026-10-12 | minor | G11: `.atn` import maps 112 events (Select and Mask, Spatter, Ripple, Crystallize, Pattern Fill, mask targeting, Step Backward, points, Bitmap) | | 2026-10-12 | minor | G9: toolbar tool shortcut editing (#4086); the remaining workspace gaps stay open | diff --git a/docs/scorecard.md b/docs/scorecard.md index 1ad3f3aa3d..86684f0511 100644 --- a/docs/scorecard.md +++ b/docs/scorecard.md @@ -9,7 +9,7 @@ Generated by `cargo xtask scorecard` from `perf/budgets.toml`, `perf/baseline.js | [Performance](#performance) | 3 | 22 | 22 | 56 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 17 not run, 5 not measurable yet (baseline 2026-10-05) | | [File compatibility](#file-compatibility) | 6 | 13 | 8 | io corpus: oracle ≥ 146/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 236/309, round trip ≥ 308/309; photoshop oracles: oracle ≥ 145/256, round trip ≥ 258/256 | | [Tools](#tools) | 28 | 14 | 1 | | -| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 26 of 156 (target 0) | +| [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 26 of 157 (target 0) | | [Type](#type) | 4 | 3 | 2 | | | [Automation](#automation) | 5 | 2 | 4 | 631 of 631 menu items live (100.0%) | | [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 28 of 28 crates; panic_hunt present | @@ -176,7 +176,7 @@ Corpus floors (`crates/io/tests/corpus.rs`): the enforced minimums; the corpus t ## Workspace and UI -**Settings that do nothing: 26 of 156** (target 0, #204). Counted by the prefs audit (`xtask/src/scorecard.rs`): a `Preferences` field counts as read when code outside the prefs model (`prefs.rs` except its `impl Session` blocks; tests excluded; the schema-driven dialog never names a field) accesses `section.field`, or `.section` and `.field` in the same file, or calls a section method that reads `self.field`. It is a heuristic lower bound: a generic name can look read when it isn't. +**Settings that do nothing: 26 of 157** (target 0, #204). Counted by the prefs audit (`xtask/src/scorecard.rs`): a `Preferences` field counts as read when code outside the prefs model (`prefs.rs` except its `impl Session` blocks; tests excluded; the schema-driven dialog never names a field) accesses `section.field`, or `.section` and `.field` in the same file, or calls a section method that reads `self.field`. It is a heuristic lower bound: a generic name can look read when it isn't. Unread: `general.color_picker`, `general.animated_zoom`, `general.zoom_resizes_windows`, `workspace.auto_show_hidden_panels`, `workspace.enable_floating_document_window_docking`, `file_handling.save_in_background`, `performance.cache_levels`, `performance.legacy_compositing`, `scratch_disks.disks`, `units_and_rulers.column_width`, `units_and_rulers.gutter`, `plug_ins.show_extension_panels`, `plug_ins.allow_scripts_to_connect`, `plug_ins.generator_enabled`, `type_.text_engine`, `type_.recent_fonts`, `enhanced_controls.scrubby_slider_acceleration`, `enhanced_controls.touch_gestures`, `raw_defaults.color_space`, `raw_defaults.bit_depth`, `raw_defaults.resolution`, `raw_defaults.sharpen_for`, `raw_defaults.open_as_smart_object`, `raw_defaults.apply_auto_tone`, `integrations.allow_agent_control`, `integrations.control_port`. diff --git a/docs/ui-design.md b/docs/ui-design.md index 4636cdb7cd..651b1b95bf 100644 --- a/docs/ui-design.md +++ b/docs/ui-design.md @@ -164,6 +164,12 @@ On Windows and Linux, System Title Bar displays “Applies at next launch.” be including before editing and after Apply. Saving this preference does not restart the app or change the current window's decorations; the next launch reads the saved choice. +Interface → Scrollbar Visibility applies immediately. Default follows the selected theme. +Always keeps scrollbars expanded when the content needs them; Auto Hide uses overlay bars +that appear while hovering or scrolling. Hidden removes the bars while keeping wheel, +trackpad and keyboard scrolling available. The setting also applies to the canvas in +Standard Screen Mode and survives restarts and theme changes (#3262). + ## High DPI and 4K displays Edit → Preferences → Interface → UI Scale applies immediately. Auto follows the operating diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 2f620ecdc3..93be1fe40d 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI parity: tools, handles, modifiers and feel -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-12 · **Change:** minor (Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows) · **Target:** Adobe Photoshop 2026 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-13 · **Change:** minor (scrollbar visibility preference, #3262; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows) · **Target:** Adobe Photoshop 2026 How PhotoCraft's direct manipulation compares with Photoshop 2026 (27.11.0): the toolbox, the handles and modifier keys of each gesture, nudging, snapping, numeric precision, navigation, @@ -155,6 +155,7 @@ Triangle and Curvature Pen (minus legacy Rounded Rectangle and Targeted Adjustme | Ruler corner and gaps drawn as Photoshop | partial | #2600, #2601, #2551 | | Guides stored as f64 | missing | `Vec` (UI-217-20) | | Geometry precision | partial | `geom::Point` f64, paths f64; paint internals mostly f32 | +| Scrollbar visibility preference | done | Default, Always, Auto Hide and Hidden apply to panels and the canvas; live settings, theme changes and scrolling are covered (#3262) | | Numeric fields: arithmetic, scrubby labels | partial | units in expressions and double-click reset missing (UI-217-13) | ## Navigation @@ -216,6 +217,7 @@ Paragraph; the rest open as in-app floating windows. | Date | Change | Summary | |---|---|---| +| 2026-10-13 | minor | Scrollbar visibility preference for panels and the canvas (#3262), with live application, theme retention and wheel-scrolling coverage | | 2026-10-10 | major | First version, from a source audit against Photoshop 2026 27.11.0's shortcuts file and the open issues | | 2026-10-10 | minor | Fixed Crop live resize snapping feedback and outdated-camera rendering, applied ratios immediately to centred inscribed previews, and removed two-point options-bar overflow; added pointer, rendering, dropdown/Enter, Swap/X and scrolling regressions | | 2026-10-11 | minor | Flick panning done: releasing a moving Hand drag (tool, Space or middle button) glides and decays, gated by Enable Flick Panning |