Skip to main content

max / alloy

Point the empty disk pane at the verb that writes install drives disk.rs's module docs claimed the empty state named `alloy image`, and it did not. `disk` is the verb that sounds like it writes disks, so that pane is where someone looking to make an install drive arrives, and it was leaving them to guess. Pinned with a test, since the claim drifted from the code once already.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-08-05 17:41 UTC
Signed with PGP, not checked
Commit: 151a0dede7fe53a5b18513dc3793280da0b9a838
Parent: f581c89
1 file changed, +23 insertions, -1 deletion
@@ -746,7 +746,15 @@
746 746 /// What an empty list should say, which is never just "nothing here".
747 747 fn empty_line(&self) -> String {
748 748 match self.tab() {
749 - Tab::Removable => "no removable drives attached. Plug one in and press r.".to_string(),
749 + // The install-drive pointer is here because this is where someone
750 + // looking to make one arrives: `disk` is the verb that sounds like
751 + // it writes disks, and the module docs promise the empty state says
752 + // otherwise rather than leaving them to guess.
753 + Tab::Removable => {
754 + "no removable drives attached. Plug one in and press r. To write an Alloy \
755 + install drive, use alloy image."
756 + .to_string()
757 + }
750 758 Tab::All => "no block devices; lsblk reported nothing".to_string(),
751 759 }
752 760 }
@@ -1230,6 +1238,20 @@
1230 1238 }
1231 1239
1232 1240 /// The removable tab is a filter, and the other tab proves it is one.
1241 + /// `disk` is the verb that sounds like it writes install drives, so the one
1242 + /// screen a would-be install-drive maker lands on has to name the verb that
1243 + /// does. The module docs claim this; without the test the claim drifted.
1244 + #[test]
1245 + fn the_empty_removable_tab_names_the_verb_that_writes_drives() {
1246 + let (mut view, mut log) = mock_view(Tab::Removable);
1247 + view.backend = Box::new(EmptyBackend);
1248 + view.refresh(&mut log);
1249 +
1250 + let empty = view.empty_line();
1251 + assert!(view.rows().is_empty());
1252 + assert!(empty.contains("alloy image"), "{empty}");
1253 + }
1254 +
1233 1255 #[test]
1234 1256 fn the_removable_tab_filters_and_the_all_tab_does_not() {
1235 1257 let (view, _log) = mock_view(Tab::Removable);