mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-13 17:31:09 -06:00
Remove the dead Cloud button from the top bar (#3832)
* Remove the dead Cloud button from the top bar A clickable top-bar button that does nothing confuses users and contradicts LightCraft's no-cloud design; removing it ends the confusion while save status stays visible through toasts (lib.rs save_status) and library.info. Drop the cloud entry from the top bar's right-hand icon loop in topbar.rs, which also removes its tied warning badge; nothing else in the repo references it. Test: top_bar_has_no_cloud_widget failed before the change and passes after. * Top bar: the cloud icon only shows as the warning that saving is failing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: eliets2 <287273517+eliets2@users.noreply.github.com> Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
eliets2
FredApps
parent
2a35db6bcf
commit
b2007e06a9
@@ -172,9 +172,9 @@ fn filter_button(app: &mut LightcraftApp, ui: &mut egui::Ui, t: &Tokens, sr: Rec
|
||||
fn right_icons(app: &mut LightcraftApp, ui: &mut egui::Ui, t: &Tokens, full: Rect) -> f32 {
|
||||
// right icons
|
||||
let mut x = full.right() - 18.0;
|
||||
// saving is failing: the cloud icon turns into a warning until a save succeeds
|
||||
// saving is failing: a warning shows until a save succeeds (nothing is shown otherwise)
|
||||
let unsaved = app.session.unsaved().map(|(n, e)| unsaved_tip(n, e));
|
||||
let cloud_tip = unsaved.as_deref().unwrap_or("Local library — no cloud account needed");
|
||||
let cloud_tip = unsaved.as_deref().unwrap_or_default();
|
||||
// Import Photos… beside Export, always one click away, with the key it is bound to now
|
||||
let mac = ui.ctx().os() == egui::os::OperatingSystem::Mac;
|
||||
let import_tip = match crate::shortcuts::shortcut_of(&app.ui.settings.keymap, "file.addPhotos") {
|
||||
@@ -189,6 +189,10 @@ fn right_icons(app: &mut LightcraftApp, ui: &mut egui::Ui, t: &Tokens, full: Rec
|
||||
("import", Icon::Plus, import_tip.as_str(), "file.addPhotos"),
|
||||
("bell", Icon::Bell, "Activity", "panel.activity"),
|
||||
] {
|
||||
let warn = id == "cloud" && unsaved.is_some();
|
||||
if id == "cloud" && !warn {
|
||||
continue;
|
||||
}
|
||||
let r = Rect::from_center_size(pos2(x, full.center().y), vec2(28.0, 28.0));
|
||||
let tip = crate::i18n::tr(tip);
|
||||
let resp = ui.interact(r, egui::Id::unique(("top", id)), Sense::click());
|
||||
@@ -196,7 +200,6 @@ fn right_icons(app: &mut LightcraftApp, ui: &mut egui::Ui, t: &Tokens, full: Rec
|
||||
let resp = resp.on_hover_text(tip);
|
||||
crate::widgets::announce(&resp, name);
|
||||
register(ui, format!("icon:{id}"), r);
|
||||
let warn = id == "cloud" && unsaved.is_some();
|
||||
let colour = if warn {
|
||||
t.caution
|
||||
} else if resp.hovered() {
|
||||
|
||||
@@ -190,6 +190,15 @@ fn the_top_bar_button_and_settings_cards_drive_the_mode() {
|
||||
assert_eq!(crate::theme::current(&h.view.ctx), Some(ThemeKind::Charcoal));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn top_bar_has_no_cloud_widget() {
|
||||
// LightCraft has no cloud service: the icon only shows as the warning that saving is failing
|
||||
// (`tests/unsaved.rs`), not as a button that does nothing.
|
||||
let mut h = Headless::new(app(), [1400.0, 900.0], 1.0);
|
||||
h.settle(T);
|
||||
assert!(!h.app.widgets.iter().any(|(id, _)| id == "icon:cloud"), "the top bar still registers a dead cloud button");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn interface_settings_fit_small_windows_and_stack_theme_choices() {
|
||||
// Desktop windows have a 900×560 minimum; also stress a smaller headless viewport.
|
||||
|
||||
Reference in New Issue
Block a user