forge
Explore
Log in

Don't you dare go Hollow

A refused split keeps the clip in hand

Browse files at this commit

e063ed4897c879ebeda45ae9ea4cd9ce9d683895Ahmet Kaan GümüşParent: 35306fd
  • fix
    • a refused split keeps the clip in hand
Show full message
🐛 fix(timeline): a refused split keeps the clip in hand

`self.selected.clear()` sat after the if/else in `Player::cut`, so `s` on a seam or in a gap -- the engine's own refusal, worded "NOTHING TO SPLIT — the playhead is already on a cut" -- dropped the picked clip anyway: the next Delete, `x` or menu row then acted on nothing until the user picked the clip again. The sibling `Player::regroup` has always cleared inside its own success branch.
crates/app/src/player/timeline_edit.rsmodified+24 -47
@@ -50,12 +50,21 @@ impl Player {
5050 // not that.
5151 let cut = session.cut_at(f64::from(at) / self.fps);
5252 if cut {
53+ // Only a split that happened drops the selection: a refusal is
54+ // "NOTHING TO SPLIT", and the clip in hand is still the clip the
55+ // next Delete, `x` or menu acts on -- clearing it there left the
56+ // user with nothing picked and told them nothing about it. A
57+ // real split is the other way round: the cut it leaves makes the
58+ // picked index name a different clip, so the mark has to go.
59+ // [`Player::regroup`] below has always cleared inside its own
60+ // success branch; this is the same rule on the other half of the
61+ // pair.
62+ self.selected.clear();
5363 self.notify_user("SPLIT".into());
5464 } else {
5565 self.notify_user("NOTHING TO SPLIT — the playhead is already on a cut".into());
5666 }
5767 }
58- self.selected.clear();
5968 cx.notify();
6069 }
6170
@@ -72,10 +81,7 @@ impl Player {
7281 if session.regroup_at(session.now()) {
7382 self.selected.clear();
7483 } else {
75- self.notify_user(
76- "NOTHING TO REGROUP — no cut under the playhead"
77- .into(),
78- );
84+ self.notify_user("NOTHING TO REGROUP — no cut under the playhead".into());
7985 }
8086 }
8187 cx.notify();
@@ -97,9 +103,7 @@ impl Player {
97103 );
98104 }
99105 }
100- (Some(_), None) => {
101- self.notify_user("NOTHING DETACHED — nothing selected".into())
102- }
106+ (Some(_), None) => self.notify_user("NOTHING DETACHED — nothing selected".into()),
103107 (None, _) => {}
104108 }
105109 cx.notify();
@@ -126,9 +130,7 @@ impl Player {
126130 // index (a stroke nobody saw) is not a thing to group.
127131 let picks = self.marks().0;
128132 match (&mut self.session, self.selected.anchor(), picks.len()) {
129- (_, None, _) => {
130- self.notify_user("NOTHING GROUPED — nothing selected".into())
131- }
133+ (_, None, _) => self.notify_user("NOTHING GROUPED — nothing selected".into()),
132134 // The hand's group: every pick, one id.
133135 (Some(session), _, 2..) => {
134136 if let Err(e) = session.group_all(&picks) {
@@ -146,10 +148,9 @@ impl Player {
146148 self.notify_user(format!("NOT GROUPED — {e}").into());
147149 }
148150 }
149- None => self.notify_user(
150- "NOTHING TO GROUP WITH — no clip covers these frames"
151- .into(),
152- ),
151+ None => {
152+ self.notify_user("NOTHING TO GROUP WITH — no clip covers these frames".into())
153+ }
153154 },
154155 (None, ..) => {}
155156 }
@@ -237,9 +238,7 @@ impl Player {
237238 self.notify_user("NOTHING LIFTED — that half is no longer there".into());
238239 }
239240 }
240- (Some(_), None) => {
241- self.notify_user("NOTHING LIFTED — nothing selected".into())
242- }
241+ (Some(_), None) => self.notify_user("NOTHING LIFTED — nothing selected".into()),
243242 (None, _) => {}
244243 }
245244 cx.notify();
@@ -409,11 +408,7 @@ impl Player {
409408 // Everything else that could refuse (a clip that is not there)
410409 // cannot be dragged.
411410 false if from.kind != to.kind => self.notify_user(
412- format!(
413- "NOT ON {} — a {kind} clip takes a {lanes} lane",
414- to.label()
415- )
416- .into(),
411+ format!("NOT ON {} — a {kind} clip takes a {lanes} lane", to.label()).into(),
417412 ),
418413 // Picked up and put back down where it was: a click, and a click
419414 // says nothing.
@@ -535,10 +530,7 @@ impl Player {
535530 },
536531 // The row is greyed and says why in the list; here it says why at
537532 // the moment somebody tried to use it anyway.
538- (None, Some(_)) => Some(
539- "NOT PLACED — that subtitle track has no cues"
540- .to_string(),
541- ),
533+ (None, Some(_)) => Some("NOT PLACED — that subtitle track has no cues".to_string()),
542534 (_, None) => Some("NOT PLACED — no file open".to_string()),
543535 };
544536 match (text, marked) {
@@ -1293,12 +1285,7 @@ impl Player {
12931285 /// a project can gain, and the one remove that applies to this lane's kind
12941286 /// ([`oracle::lane_items`]). Nothing is selected -- a head owns no clip --
12951287 /// which is [`Player::open_gap_menu`]'s rule on the other empty target.
1296- pub(crate) fn open_head_menu(
1297- &mut self,
1298- lane: Lane,
1299- at: Point<Pixels>,
1300- cx: &mut Context<Self>,
1301- ) {
1288+ pub(crate) fn open_head_menu(&mut self, lane: Lane, at: Point<Pixels>, cx: &mut Context<Self>) {
13021289 if self.modal() || self.session.is_none() {
13031290 return;
13041291 }
@@ -1698,19 +1685,14 @@ impl Player {
16981685 [a, b] if a.0 == b.0 && a.1.abs_diff(b.1) == 1 => Some((a.0, a.1.min(b.1))),
16991686 _ => self.selected.anchor(),
17001687 }) else {
1701- self.notify_user(
1702- "NOTHING TO CROSSFADE — no audio clip selected".into(),
1703- );
1688+ self.notify_user("NOTHING TO CROSSFADE — no audio clip selected".into());
17041689 cx.notify();
17051690 return;
17061691 };
17071692 let frames = self.fps.round().max(1.) as u32;
17081693 if let Some(session) = &mut self.session {
17091694 if !session.crossfade(lane, idx, frames) {
1710- self.notify_user(
1711- "NOTHING TO CROSSFADE — no neighbour end to end"
1712- .into(),
1713- );
1695+ self.notify_user("NOTHING TO CROSSFADE — no neighbour end to end".into());
17141696 }
17151697 }
17161698 cx.notify();
@@ -1730,9 +1712,7 @@ impl Player {
17301712 [a, b] if a.0 == b.0 && a.1.abs_diff(b.1) == 1 => Some((a.0, a.1.min(b.1))),
17311713 _ => self.selected.anchor(),
17321714 }) else {
1733- self.notify_user(
1734- "NOTHING TO DISSOLVE — no video clip selected".into(),
1735- );
1715+ self.notify_user("NOTHING TO DISSOLVE — no video clip selected".into());
17361716 cx.notify();
17371717 return;
17381718 };
@@ -1747,10 +1727,7 @@ impl Player {
17471727 self.fps.round().max(1.) as u32
17481728 };
17491729 if !session.set_transition_out(lane, idx, frames) {
1750- self.notify_user(
1751- "NOTHING TO DISSOLVE — no neighbour end to end"
1752- .into(),
1753- );
1730+ self.notify_user("NOTHING TO DISSOLVE — no neighbour end to end".into());
17541731 } else if removing {
17551732 self.notify_user("DISSOLVE REMOVED — the clips cut again".into());
17561733 }
crates/app/src/tests/editing.rsmodified+131 -111
@@ -109,11 +109,9 @@ fn a_song_opens_the_window_by_itself() {
109109 // ...and it places, on the audio lane, through the door `insert_source`
110110 // uses: a second copy of the song at the playhead.
111111 session.seek(1.0);
112- assert!(
113- session
114- .place_stream_at(1.0, &path, 0, Some(Lane::A1))
115- .expect("its own file is on this timeline")
116- );
112+ assert!(session
113+ .place_stream_at(1.0, &path, 0, Some(Lane::A1))
114+ .expect("its own file is on this timeline"));
117115 assert_eq!(session.lane_clips(Lane::A1).len(), 2);
118116 assert!(session.lane_clips(Lane::V1).is_empty(), "still no picture");
119117
@@ -345,13 +343,11 @@ fn a_caption_is_deleted_by_the_same_row_and_stroke_every_box_is() {
345343 );
346344 // ...and the same reading with a clip under it is the clip menu, untouched:
347345 // the flag is off wherever a `Clip` was clicked.
348- assert!(
349- menu_items(Ctx {
350- timeline: true,
351- ..Ctx::default()
352- })
353- .contains(&ActionId::Cut)
354- );
346+ assert!(menu_items(Ctx {
347+ timeline: true,
348+ ..Ctx::default()
349+ })
350+ .contains(&ActionId::Cut));
355351 }
356352
357353 /// A timeline with a subtitle palette and an empty subtitle lane: what a
@@ -617,6 +613,20 @@ fn the_playhead_actions_still_work_with_a_caption_marked() {
617613 let clips = session.lane_clips(Lane::V1).len();
618614 assert!(session.cut_at(2.0), "the playhead splits the clip under it");
619615 assert_eq!(session.lane_clips(Lane::V1).len(), clips + 1);
616+ // The refusal is a real state and not a defence against nothing: the
617+ // playhead is standing on the seam the split just left, which is exactly the
618+ // stroke `Player::cut` words as "NOTHING TO SPLIT — the playhead is already
619+ // on a cut".
620+ assert!(
621+ !session.cut_at(2.0),
622+ "a second split on the seam is refused, which is the state the door's \
623+ selection gate is about"
624+ );
625+ assert_eq!(
626+ session.lane_clips(Lane::V1).len(),
627+ clips + 1,
628+ "and adds none"
629+ );
620630 assert!(session.regroup_at(2.0), "and the seam rejoins");
621631 assert_eq!(session.lane_clips(Lane::V1).len(), clips);
622632 assert_eq!(session.sub_lane(lane).len(), 1, "the caption is untouched");
@@ -939,16 +949,14 @@ fn the_clip_menu_dims_what_the_playhead_is_not_on_and_stays_in_the_window() {
939949 }
940950 assert!(!whole(ActionId::Delete, live).yes());
941951 assert!(!whole(ActionId::Paste, live).yes());
942- assert!(
943- whole(
944- ActionId::Paste,
945- Ctx {
946- clipboard: true,
947- ..live
948- }
949- )
950- .yes()
951- );
952+ assert!(whole(
953+ ActionId::Paste,
954+ Ctx {
955+ clipboard: true,
956+ ..live
957+ }
958+ )
959+ .yes());
952960 assert!(!whole(ActionId::CancelExport, live).yes());
953961 let busy = Ctx {
954962 exporting: true,
@@ -988,7 +996,10 @@ fn the_clip_menu_dims_what_the_playhead_is_not_on_and_stays_in_the_window() {
988996 assert_eq!(menu_at(point(px(10.), px(10.)), viewport, 150.), (10., 10.));
989997 assert_eq!(
990998 menu_at(point(px(700.), px(380.)), viewport, 150.),
991- (800. - crate::layout::MENU_EDGE - MENU_W, 400. - crate::layout::MENU_EDGE - 150.)
999+ (
1000+ 800. - crate::layout::MENU_EDGE - MENU_W,
1001+ 400. - crate::layout::MENU_EDGE - 150.
1002+ )
9921003 );
9931004 // A window smaller than the menu loses its bottom, never its top: the
9941005 // top-left margin wins over the bottom-right one, because the items are
@@ -1165,16 +1176,14 @@ fn a_menu_offers_only_what_applies_and_is_drawn_inside_the_window() {
11651176 assert!(row_enable(RowItem::RemoveWithClips, placed).yes());
11661177 let unplaced = row_items(live);
11671178 assert!(unplaced.contains(&RowItem::Remove) && !unplaced.contains(&RowItem::RemoveWithClips));
1168- assert!(
1169- !row_enable(
1170- RowItem::RemoveWithClips,
1171- RowCtx {
1172- exporting: true,
1173- ..placed
1174- }
1175- )
1176- .yes()
1177- );
1179+ assert!(!row_enable(
1180+ RowItem::RemoveWithClips,
1181+ RowCtx {
1182+ exporting: true,
1183+ ..placed
1184+ }
1185+ )
1186+ .yes());
11781187 assert!(!row_enable(RowItem::Add, RowCtx::default()).yes());
11791188 // Every refusal is short enough to sit in the hint column beside its
11801189 // label, the clip menu's rule.
@@ -1282,7 +1291,11 @@ fn the_hanging_menus_mount_at_the_room_root_and_their_rows_wear_chords_not_prose
12821291 }
12831292 // §9: no junk drawer. A label that fits the plate whole beside its
12841293 // chord, and never a sentence.
1285- assert!(item.label().split_whitespace().count() <= 4, "{}", item.label());
1294+ assert!(
1295+ item.label().split_whitespace().count() <= 4,
1296+ "{}",
1297+ item.label()
1298+ );
12861299 }
12871300 // The two removes must not read as the same verb now that the column
12881301 // beside them is empty.
@@ -1604,11 +1617,9 @@ fn adding_a_row_drops_the_whole_source_in_at_the_playhead() {
16041617 let frames = session.file_frames(&second);
16051618 // Through the engine door `insert_source` uses, with the row's own
16061619 // stream: the button, the drop and this are one call.
1607- assert!(
1608- session
1609- .place_stream_at(2.0, &second, 0, None)
1610- .expect("av2 is already on the timeline")
1611- );
1620+ assert!(session
1621+ .place_stream_at(2.0, &second, 0, None)
1622+ .expect("av2 is already on the timeline"));
16121623 // The whole of source 1 went in and nothing was painted over: the
16131624 // timeline is longer by exactly that file.
16141625 assert_eq!(session.timeline_duration(), 9.0);
@@ -1635,11 +1646,9 @@ fn adding_a_row_drops_the_whole_source_in_at_the_playhead() {
16351646 let path = session.sources()[0].path.clone();
16361647 let frames = session.file_frames(&path);
16371648 let end = session.timeline_duration();
1638- assert!(
1639- session
1640- .place_stream_at(end, &path, 1, None)
1641- .expect("the French track shares the timeline's parameters")
1642- );
1649+ assert!(session
1650+ .place_stream_at(end, &path, 1, None)
1651+ .expect("the French track shares the timeline's parameters"));
16431652 assert_eq!(session.sources()[1].audio_stream, 1);
16441653 assert_eq!(session.timeline_duration(), end * 2.0);
16451654 // Both rows are the same file, so both rows are that file's length --
@@ -1689,11 +1698,9 @@ fn a_row_dropped_on_the_open_bed_lands_under_the_pointer() {
16891698
16901699 // ...and what the release does with it: the frame back through the same
16911700 // rate every box is drawn at, into the door the Add button uses too.
1692- assert!(
1693- session
1694- .place_stream_at(f64::from(at) / fps, &second, 0, None)
1695- .expect("av2 is already on this timeline")
1696- );
1701+ assert!(session
1702+ .place_stream_at(f64::from(at) / fps, &second, 0, None)
1703+ .expect("av2 is already on this timeline"));
16971704 let head = |lane| {
16981705 session
16991706 .lane_clips(lane)
@@ -1727,11 +1734,9 @@ fn removing_a_row_is_refused_while_it_plays_and_takes_the_row_away() {
17271734 session.import(&asset("test_av2.mp4")).expect("av2 matches");
17281735 let second = session.sources()[1].path.clone();
17291736 let end = session.timeline_duration();
1730- assert!(
1731- session
1732- .place_stream_at(end, &second, 0, None)
1733- .expect("a file just imported is on this timeline")
1734- );
1737+ assert!(session
1738+ .place_stream_at(end, &second, 0, None)
1739+ .expect("a file just imported is on this timeline"));
17351740 let streams = HashMap::new();
17361741 let rows = |session: &PlaybackSession| {
17371742 library_rows(session.sources(), &streams, &HashMap::new(), None, |_| 0).len()
@@ -2058,11 +2063,9 @@ fn a_track_can_be_added_dropped_on_edited_and_taken_back() {
20582063 // A library row let go over that row: the same door the Add button
20592064 // uses, told which lane it was let go over.
20602065 let path = session.sources()[0].path.clone();
2061- assert!(
2062- session
2063- .place_stream_at(1.0, &path, 0, Some(v2))
2064- .expect("its own file is on this timeline")
2065- );
2066+ assert!(session
2067+ .place_stream_at(1.0, &path, 0, Some(v2))
2068+ .expect("its own file is on this timeline"));
20662069 assert_eq!(session.lane_clips(v2).len(), 1, "the drop landed on V2");
20672070 assert_eq!(session.lane_clips(v2)[0].start, 30, "at the playhead");
20682071 // ...with the sound it came with, on the row of its own the drop added:
@@ -2149,22 +2152,18 @@ fn a_selection_drag_moves_every_pick_by_the_same_delta() {
21492152
21502153 // clip0 on V1 at the fixture's own start; clip1 on V1 ten seconds in,
21512154 // appended to the open bed and rippling nothing.
2152- assert!(
2153- session
2154- .place_stream_at(10.0, &second, 0, None)
2155- .expect("av2 is on this timeline")
2156- );
2155+ assert!(session
2156+ .place_stream_at(10.0, &second, 0, None)
2157+ .expect("av2 is on this timeline"));
21572158 let clip0 = session.lane_clips(Lane::V1)[0];
21582159 let clip1 = session.lane_clips(Lane::V1)[1];
21592160 assert_eq!((clip0.start, clip1.start), (0, 300));
21602161
21612162 // clipC on a second video row, well past both of the above.
21622163 let v2 = session.add_lane(LaneKind::Video);
2163- assert!(
2164- session
2165- .place_stream_at(20.0, &path, 0, Some(v2))
2166- .expect("test_av.mp4 is on this timeline")
2167- );
2164+ assert!(session
2165+ .place_stream_at(20.0, &path, 0, Some(v2))
2166+ .expect("test_av.mp4 is on this timeline"));
21682167 let clip_c = session.lane_clips(v2)[0];
21692168 assert_eq!(clip_c.start, 600);
21702169
@@ -2217,28 +2216,22 @@ fn a_selection_drag_refuses_as_one_set_when_any_pick_cannot_land() {
22172216 session.import(&asset("test_av2.mp4")).expect("av2 matches");
22182217 let second = session.sources()[1].path.clone();
22192218
2220- assert!(
2221- session
2222- .place_stream_at(10.0, &second, 0, None)
2223- .expect("av2 is on this timeline")
2224- );
2219+ assert!(session
2220+ .place_stream_at(10.0, &second, 0, None)
2221+ .expect("av2 is on this timeline"));
22252222 let clip0 = session.lane_clips(Lane::V1)[0];
22262223 let clip1 = session.lane_clips(Lane::V1)[1];
22272224
22282225 let v2 = session.add_lane(LaneKind::Video);
2229- assert!(
2230- session
2231- .place_stream_at(0.0, &path, 0, Some(v2))
2232- .expect("test_av.mp4 is on this timeline")
2233- );
2226+ assert!(session
2227+ .place_stream_at(0.0, &path, 0, Some(v2))
2228+ .expect("test_av.mp4 is on this timeline"));
22342229 let clip_c = session.lane_clips(v2)[0];
22352230 // A clip clip1 is not picked, blocking the road on V2 the drag is about
22362231 // to try: clip1 dragged onto V2 lands its head inside this one.
2237- assert!(
2238- session
2239- .place_stream_at(10.0, &second, 0, Some(v2))
2240- .expect("av2 is on this timeline")
2241- );
2232+ assert!(session
2233+ .place_stream_at(10.0, &second, 0, Some(v2))
2234+ .expect("av2 is on this timeline"));
22422235 let blocker = session.lane_clips(v2)[1];
22432236 assert_eq!(blocker.start, 300);
22442237
@@ -2293,20 +2286,16 @@ fn a_three_pick_copy_paste_preserves_gaps_and_lane_assignment() {
22932286 session.import(&asset("test_av2.mp4")).expect("av2 matches");
22942287 let second = session.sources()[1].path.clone();
22952288
2296- assert!(
2297- session
2298- .place_stream_at(10.0, &second, 0, None)
2299- .expect("av2 is on this timeline")
2300- );
2289+ assert!(session
2290+ .place_stream_at(10.0, &second, 0, None)
2291+ .expect("av2 is on this timeline"));
23012292 let clip0 = session.lane_clips(Lane::V1)[0];
23022293 let clip1 = session.lane_clips(Lane::V1)[1];
23032294
23042295 let v2 = session.add_lane(LaneKind::Video);
2305- assert!(
2306- session
2307- .place_stream_at(20.0, &path, 0, Some(v2))
2308- .expect("test_av.mp4 is on this timeline")
2309- );
2296+ assert!(session
2297+ .place_stream_at(20.0, &path, 0, Some(v2))
2298+ .expect("test_av.mp4 is on this timeline"));
23102299 let clip_c = session.lane_clips(v2)[0];
23112300
23122301 // Copied in click order, out of the lanes each was clicked in -- exactly
@@ -2354,20 +2343,16 @@ fn a_colliding_set_paste_refuses_whole() {
23542343 session.import(&asset("test_av2.mp4")).expect("av2 matches");
23552344 let second = session.sources()[1].path.clone();
23562345
2357- assert!(
2358- session
2359- .place_stream_at(10.0, &second, 0, None)
2360- .expect("av2 is on this timeline")
2361- );
2346+ assert!(session
2347+ .place_stream_at(10.0, &second, 0, None)
2348+ .expect("av2 is on this timeline"));
23622349 let clip0 = session.lane_clips(Lane::V1)[0];
23632350 let clip1 = session.lane_clips(Lane::V1)[1];
23642351
23652352 let v2 = session.add_lane(LaneKind::Video);
2366- assert!(
2367- session
2368- .place_stream_at(20.0, &path, 0, Some(v2))
2369- .expect("test_av.mp4 is on this timeline")
2370- );
2353+ assert!(session
2354+ .place_stream_at(20.0, &path, 0, Some(v2))
2355+ .expect("test_av.mp4 is on this timeline"));
23712356 let clip_c = session.lane_clips(v2)[0];
23722357
23732358 let items = [(Lane::V1, clip0), (Lane::V1, clip1), (v2, clip_c)];
@@ -2422,11 +2407,9 @@ fn a_grouped_clip_on_an_added_lane_closes_its_hole_with_its_caption() {
24222407 let (mut session, sub_lane) = with_subtitle_lane();
24232408 let v2 = session.add_lane(LaneKind::Video);
24242409 let path = session.sources()[0].path.clone();
2425- assert!(
2426- session
2427- .place_stream_at(0.0, &path, 0, Some(v2))
2428- .expect("its own file is on this timeline")
2429- );
2410+ assert!(session
2411+ .place_stream_at(0.0, &path, 0, Some(v2))
2412+ .expect("its own file is on this timeline"));
24302413 session
24312414 .place_sub(sub_lane, 0, one_second(0))
24322415 .expect("the caption goes down");
@@ -2722,6 +2705,35 @@ fn escape_closes_a_card_before_it_can_ever_reach_deselect() {
27222705 }
27232706 }
27242707
2708+/// A refused split is not an edit, so it may not drop the clip in hand: the
2709+/// refused stroke is worded ("NOTHING TO SPLIT — the playhead is already on a
2710+/// cut") and the pick is still what the next `x`, `delete` or clip-menu row acts
2711+/// on. The clear rides the door's own answer, the way [`Player::regroup`]'s
2712+/// always has -- a split that happened is the other way round: the seam it
2713+/// leaves renumbers the lane, so a pick kept across it names the wrong clip.
2714+///
2715+/// A scan and not a drive: `self.selected` lives on `Player`, which needs a gpui
2716+/// `Context` this binary has no harness for. The state itself is driven in
2717+/// `the_playhead_actions_still_work_with_a_caption_marked`, which holds the real
2718+/// `cut_at` refusal this gate is about.
2719+#[test]
2720+fn a_refused_split_keeps_the_clip_in_hand() {
2721+ let body = fn_body("cut");
2722+ let (before, after) = body
2723+ .split_once("if cut {")
2724+ .expect("the split door no longer gates anything on its own answer");
2725+ assert!(
2726+ !before.contains("self.selected.clear()"),
2727+ "the split drops the selection before it knows the cut happened, so a \
2728+ refused split leaves the user with nothing picked and nothing told"
2729+ );
2730+ assert!(
2731+ after.contains("self.selected.clear()"),
2732+ "a split that happened no longer drops the selection, so the mark names \
2733+ a different clip on the far side of the seam"
2734+ );
2735+}
2736+
27252737 /// The other half: with nothing on screen to claim the key, bare escape falls
27262738 /// all the way through to `Player::act`, whose `ActionId::Deselect` arm is
27272739 /// the one place `self.selected` is emptied by a bare stroke rather than by
@@ -2802,13 +2814,21 @@ fn every_verb_the_spine_carried_is_a_right_click_row() {
28022814 // Every menu is a list of actions the keyboard already reaches, so every
28032815 // row can wear its chord (DESIGN §4): a row built here out of an id the
28042816 // registry never files would print an empty column.
2805- for action in MENU_ITEMS.into_iter().chain(BENCH_ITEMS).chain(heads.iter().copied()) {
2817+ for action in MENU_ITEMS
2818+ .into_iter()
2819+ .chain(BENCH_ITEMS)
2820+ .chain(heads.iter().copied())
2821+ {
28062822 assert!(
28072823 ActionId::ALL.contains(&action),
28082824 "{action:?} is a menu row and not a registered action"
28092825 );
28102826 }
2811- for list in [MENU_ITEMS.to_vec(), BENCH_ITEMS.to_vec(), lane_items(Lane::A1)] {
2827+ for list in [
2828+ MENU_ITEMS.to_vec(),
2829+ BENCH_ITEMS.to_vec(),
2830+ lane_items(Lane::A1),
2831+ ] {
28122832 let first = list.iter().position(|&a| destructive(a));
28132833 if let Some(first) = first {
28142834 assert!(