Harden missing font prompts for MCP sessions

This commit is contained in:
Luis Martinez committed 2026-09-23 01:30:42 -06:00
1 parent 133bfddba9
commit 31711a4134
7 files changed
+114 -15

No files matched your search

+15 -6
View File
@@ -17,6 +17,7 @@ fn muted_style(theme: &Theme) -> text::Style {
pub fn view_window<'a>(
fonts: &'a [String],
font_source: &'a str,
downloading: bool,
sizing: crate::ui::modal::ModalSizing,
) -> Element<'a, Message> {
let content_width = if matches!(sizing.width, Length::Fill) {
@@ -33,16 +34,24 @@ pub fn view_window<'a>(
.iter()
.map(|name| text(format!(" {name}")).size(12).into())
.collect();
let download = button(
text(if downloading {
crate::t!("Downloading...")
} else {
crate::t!("Download available")
})
.size(12),
)
.on_press_maybe((!downloading).then_some(Message::MissingFontsDownload))
.style(button::primary)
.padding([6, 14]);
let actions = row![
Space::new().width(content_width),
button(text(crate::t!("Skip")).size(12))
.on_press(Message::MissingFontsDismiss)
.on_press_maybe((!downloading).then_some(Message::MissingFontsDismiss))
.style(button::secondary)
.padding([6, 14]),
button(text(crate::t!("Download")).size(12))
.on_press(Message::MissingFontsDownload)
.style(button::primary)
.padding([6, 14]),
download,
]
.spacing(8);
@@ -50,7 +59,7 @@ pub fn view_window<'a>(
column![
text(crate::t!("Missing fonts")).size(20),
text(crate::t!(
"This drawing uses fonts that are not installed on this machine. Download them from the OpenCADStudio community font repository?"
"This drawing uses fonts that are not installed on this machine. OpenCADStudio can download any redistributable fonts that exist in the selected repository; unavailable fonts will keep using a substitute."
))
.size(11)
.style(muted_style),