mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-24 10:37:03 -06:00
Fix up merged PRs: cargo fmt, and the write_file tests may unwrap
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c448a3dba9
commit
a0facd60af
@@ -643,6 +643,8 @@ mod color_at_tests;
|
||||
|
||||
#[cfg(all(test, not(target_arch = "wasm32")))]
|
||||
mod tests {
|
||||
#![allow(clippy::unwrap_used, clippy::expect_used)]
|
||||
|
||||
use super::write_file;
|
||||
|
||||
fn scratch(name: &str) -> std::path::PathBuf {
|
||||
|
||||
@@ -1064,12 +1064,7 @@ impl Session {
|
||||
|| matches!(
|
||||
self.hit_test(p, tol),
|
||||
Some(
|
||||
Hit::Resize { .. }
|
||||
| Hit::Rotate { .. }
|
||||
| Hit::Adjust { .. }
|
||||
| Hit::Frame { .. }
|
||||
| Hit::TableColumn { .. }
|
||||
| Hit::TableRow { .. }
|
||||
Hit::Resize { .. } | Hit::Rotate { .. } | Hit::Adjust { .. } | Hit::Frame { .. } | Hit::TableColumn { .. } | Hit::TableRow { .. }
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
@@ -613,11 +613,7 @@ fn recent_list(app: &mut SlideApp, ui: &mut Ui, query: &str, limit: usize) {
|
||||
p.text(pos2(visible_right - 82.0, rect.center().y), Align2::RIGHT_CENTER, "(missing)", theme::font(11.0), t.text_dim);
|
||||
}
|
||||
}
|
||||
let resp = if missing {
|
||||
resp.on_hover_text(format!("{path} — this file can't be found"))
|
||||
} else {
|
||||
resp.on_hover_text(&path)
|
||||
};
|
||||
let resp = if missing { resp.on_hover_text(format!("{path} — this file can't be found")) } else { resp.on_hover_text(&path) };
|
||||
// Remove from the list: a real labelled widget on top of the row, with a code-drawn icon
|
||||
// (a text glyph would need a font that has it).
|
||||
let x = ui.allocate_rect(
|
||||
|
||||
@@ -1943,10 +1943,7 @@ mod tests {
|
||||
harness.get_by_label("missing.deckcraft").click();
|
||||
harness.run_steps(2);
|
||||
assert!(harness.state().toast.is_some(), "the open error was raised");
|
||||
assert!(
|
||||
harness.get_all_by_label_contains("missing.deckcraft").count() >= 2,
|
||||
"the open error is drawn on the page, next to the entry"
|
||||
);
|
||||
assert!(harness.get_all_by_label_contains("missing.deckcraft").count() >= 2, "the open error is drawn on the page, next to the entry");
|
||||
}
|
||||
|
||||
/// #172: a Recent entry can be removed from the list.
|
||||
|
||||
@@ -1096,8 +1096,11 @@ fn designer(app: &mut SlideApp, ui: &mut Ui) {
|
||||
idx,
|
||||
&deckcraft_render::RenderOpts { scale: px as f64 / d.slide_size.width.max(1.0), size: Some((px, h)), ..Default::default() },
|
||||
);
|
||||
let tex =
|
||||
ui.ctx().load_texture(format!("idea-{name}"), crate::textures::to_color_image(&img, false), crate::textures::editor_texture_options());
|
||||
let tex = ui.ctx().load_texture(
|
||||
format!("idea-{name}"),
|
||||
crate::textures::to_color_image(&img, false),
|
||||
crate::textures::editor_texture_options(),
|
||||
);
|
||||
cache.tex.push((name, tex, px, h));
|
||||
};
|
||||
for (id, _) in &ideas {
|
||||
|
||||
@@ -6,9 +6,9 @@ use deckcraft_model::{Presentation, SlideId};
|
||||
use egui::{Align2, Color32, CornerRadius, Rect, Sense, Stroke, Ui, WidgetInfo, WidgetType, pos2, vec2};
|
||||
use serde_json::json;
|
||||
|
||||
use crate::SlideApp;
|
||||
use crate::icons::{self, Icon};
|
||||
use crate::theme::{self, Tokens};
|
||||
use crate::SlideApp;
|
||||
|
||||
/// Sorter-only state. Nothing here is part of the document.
|
||||
#[derive(Debug, Default)]
|
||||
|
||||
Reference in New Issue
Block a user