Fixes for M-02 to M-14, G-01 to G-14, K-02 to K-04, X-04 to X-14, not yet reviewed

Committed before review so Windows and WSL builds can start.
Each fix was tested and mutation-checked here; the codex review
of each item is still to come, so tasks/BUGS.md stays unticked.

M-02 is mid-review: round 1 findings are fixed (apps/ely-mark/src/tally.rs).
K-01 stays deferred. The ElyMark window test mark-outside.sh failed
once at its crash-recovery step in the last run; not yet looked into.
This commit is contained in:
ZacharyZhang-NY committed 2026-10-10 02:29:19 -04:00
1 parent 6505f35669
commit d59159cea2
75 files changed
+1482 -354

No files matched your search

+30 -2
View File
@@ -31,7 +31,8 @@ actions!(
/// Insert and View; View checks what is on.
pub fn menus((grid, guides, remarks): (bool, bool, bool), cx: &App) -> [Menu; 2] {
let label = |key: &str| Deck::text(cx, key, &[]);
let insert = Menu::new(label("menu.insert")).items([
let media = ely_platform::media::BUILT.then(|| MenuItem::action(label("show.insert.media"), InsertMedia));
let insert = [
MenuItem::action(label("show.insert.text"), InsertTextBox),
MenuItem::separator(),
MenuItem::action(label("show.insert.rectangle"), InsertRectangle),
@@ -42,12 +43,16 @@ pub fn menus((grid, guides, remarks): (bool, bool, bool), cx: &App) -> [Menu; 2]
MenuItem::action(label("show.insert.connector"), InsertConnector),
MenuItem::separator(),
MenuItem::action(label("show.insert.picture"), InsertPicture),
MenuItem::action(label("show.insert.media"), InsertMedia),
]
.into_iter()
.chain(media)
.chain([
MenuItem::action(label("show.insert.table"), InsertTable),
MenuItem::action(label("show.insert.chart"), InsertChart),
MenuItem::separator(),
MenuItem::action(label("show.insert.remark"), InsertRemark),
]);
let insert = Menu::new(label("menu.insert")).items(insert);
let view = Menu::new(label("menu.view")).items([
MenuItem::action(label("show.view.remarks"), ShowRemarks).checked(remarks),
MenuItem::separator(),
@@ -150,3 +155,26 @@ impl Deck {
self.object_command("guide.add", &[kind, &x.to_string(), &y.to_string()], cx);
}
}
#[cfg(test)]
mod tests {
#[test]
fn insert_media_shows_only_where_it_plays() {
let cx = gpui::TestAppContext::single();
cx.update(ely_gpui_component::init_for_tests);
let (offered, total) = cx.update(|cx| {
ely_ui::settings::install_defaults(cx);
ely_ui::i18n::install(cx);
let media = crate::deck::Deck::text(cx, "show.insert.media", &[]);
let [insert, _] = super::menus((false, false, false), cx);
let names = insert.items.iter().filter_map(|item| match item {
gpui::MenuItem::Action { name, .. } => Some(name.clone()),
_ => None,
});
let names: Vec<_> = names.collect();
(names.iter().any(|name| *name == media), names.len())
});
assert_eq!(offered, ely_platform::media::BUILT);
assert!(total >= 11, "the rest stay: {total}");
}
}