forked from 1b-agent/fieldcraft-upstream
Ribbon: Hex Mesh and Partitioned Mesh replace the duplicate hex entries (#270)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
f4b6d1dbff
commit
70c5c9b26f
7 files changed
+69
-41
No files matched your search
@@ -58,7 +58,7 @@ pub fn matches(query: &str) -> Vec<Hit> {
|
||||
Hit { id: c.id, label: c.label, place: place.clone(), icon: c.id, soon },
|
||||
));
|
||||
}
|
||||
for m in c.more {
|
||||
for m in c.more.iter().chain(c.covers) {
|
||||
let label = crate::command_label(m);
|
||||
if q.is_empty() || format!("{label} {m}").to_lowercase().contains(&q) {
|
||||
hits.push((rank(label, m), Hit { id: m, label, place: place.clone(), icon: c.id, soon: None }));
|
||||
@@ -267,7 +267,7 @@ mod tests {
|
||||
let soon = hits.iter().position(|h| h.soon.is_some()).unwrap();
|
||||
assert!(hits.iter().skip(soon).all(|h| h.soon.is_some()), "coming soon last");
|
||||
assert_eq!(matches("").len(), {
|
||||
let mut ids: Vec<&str> = CATALOGUE.iter().flat_map(|c| std::iter::once(c.id).chain(c.more.iter().copied())).collect();
|
||||
let mut ids: Vec<&str> = CATALOGUE.iter().flat_map(|c| std::iter::once(c.id).chain(c.more.iter().chain(c.covers).copied())).collect();
|
||||
ids.sort();
|
||||
ids.dedup();
|
||||
ids.len()
|
||||
|
||||
@@ -423,6 +423,7 @@ pub fn describe(app: &ModelApp) -> serde_json::Value {
|
||||
"panel": c.panel,
|
||||
"command": c.command(),
|
||||
"more": c.more,
|
||||
"covers": c.covers,
|
||||
"coming_soon": c.milestone(),
|
||||
"enabled": c.command().is_some() && missing.is_none(),
|
||||
"unavailable": missing.map(|u| u.to_json()),
|
||||
|
||||
Reference in new issue
Block a user