ci: build against bread-ecosystem's shared Arch CI image, add check.yml
All checks were successful
check / check (push) Successful in 26s

Same fix as breadpad: build inside the shared pinned Arch container
(bread-ecosystem/ci/, cloned at the sha in ci/bread-ecosystem.rev)
instead of building natively against whatever's on the runner host.
Adds check.yml (clippy + test on feature/**/fix/**) as a fast-fail gate
before anything reaches main.

Turning on clippy -D warnings for the first time surfaced 10 pre-existing
warnings (int_plus_one, ptr_arg on &mut Vec params, collapsible_if,
collapsible_match) across layout.rs, mirror.rs, profile.rs, and the
config/mirror TUI views — all fixed exactly per clippy's suggested diffs,
verified behavior-preserving (the mirror_view.rs collapse in particular:
confirmed the "do nothing" fallthrough when mirror.result is None is
unchanged, since that was already the fallthrough behavior of the
original nested if with no matching else on the outer condition).

Verified locally: build, clippy, and test all pass through the new
container path.
This commit is contained in:
Breadway 2026-08-05 14:02:47 +08:00
parent c692b597b3
commit d73eacf40f
12 changed files with 97 additions and 53 deletions

View file

@ -210,33 +210,33 @@ pub fn handle_mouse(event: MouseEvent, state: &mut AppState) {
}
}
}
r if r >= 7 => {
r if r >= 7
// Result panel: Apply is on the line with buttons.
// Rough column check: col < 20 = Apply, col >= 20 = Cancel
if state.mirror.result.is_some() {
let col = event.column;
if col < 20 {
// Activate Apply
state.mirror.focused = FIELDS.iter().position(|&f| f == MirrorField::Apply).unwrap_or(3);
if let Some(result) = state.mirror.result.clone() {
state.push_undo();
let src_name = state.monitors[state.mirror.source_idx].name.clone();
let tgt_idx = state.mirror.target_idx;
state.monitors[tgt_idx].active_mode = result.mirror_mode.clone();
state.monitors[tgt_idx].mirror_of = Some(src_name.clone());
state.dirty = true;
state.mirror.result = None;
state.mirror.focused = 0;
state.set_status(
format!("Mirror set: {}{} at {}", src_name, state.monitors[tgt_idx].name, result.mirror_mode),
crate::ui::StatusLevel::Success,
);
}
} else {
// Cancel
&& state.mirror.result.is_some() =>
{
let col = event.column;
if col < 20 {
// Activate Apply
state.mirror.focused = FIELDS.iter().position(|&f| f == MirrorField::Apply).unwrap_or(3);
if let Some(result) = state.mirror.result.clone() {
state.push_undo();
let src_name = state.monitors[state.mirror.source_idx].name.clone();
let tgt_idx = state.mirror.target_idx;
state.monitors[tgt_idx].active_mode = result.mirror_mode.clone();
state.monitors[tgt_idx].mirror_of = Some(src_name.clone());
state.dirty = true;
state.mirror.result = None;
state.mirror.focused = 0;
state.set_status(
format!("Mirror set: {}{} at {}", src_name, state.monitors[tgt_idx].name, result.mirror_mode),
crate::ui::StatusLevel::Success,
);
}
} else {
// Cancel
state.mirror.result = None;
state.mirror.focused = 0;
}
}
_ => {}