Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
53 changes: 53 additions & 0 deletions .github/release-notes/v1.9.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Changes since [1.9.0](https://github.com/ops-software/mini-oled-dock/releases/tag/v1.9.0).

A fix release for the first live test of 1.9.0 on a real PC. The dock bar is unchanged. Tasks and Folio are still alphas.

### Both apps

- **The window always shows the current state.** After a page switch, a navigation, new data, a search or a notice, Tasks and Folio could keep an old picture of a part of the window. They now repaint every part that changed, and focus rings are drawn whole. A new sample repaints only what it changed, never the whole window.

### Tasks

- **Search finds apps and background processes in Groups.** A group made of one process had no row of its own for the filter to look at, so a search missed it. It is found now.
- **Esc** clears the search, then leaves the search field, then clears the extra selection; it no longer closes the window.
- **No freeze at a custom display scale.** At some custom scaling values a dashed line of a chart (the network's "sent" series) could make Tasks stop responding. It is always drawn now.
- **Details.** The command band and the row menu name the program and offer **Close** for a process that shows a window and responds. Ctrl+N opens Run new task there as on Processes. A process that shows a window carries the name of its app, as on Processes. Efficiency mode shows a leaf in the Status column. The search hint is shorter ("Search processes") so it fits its field. The columns narrow to fit the window, the widest first, when the column chooser adds one or the window gets narrower.

### Folio

- **The mouse wheel scrolls the lists again.** In 1.9.0 a wheel turn over a list of files did not move it. A tab switch while a list still scrolls no longer leaves the rest of the scroll for the next wheel turn.
- **A tab's close button** lights its whole tab, as moving over the tab does.
- **Undo.** After a paste answered "keep both", Ctrl+Z takes back only the new item (a copy goes to the Recycle Bin, a moved file goes back) and leaves the older one; 1.9.0 refused, saying files were replaced. A paste that replaced files, or merged a folder into a folder of the same name (also a move stopped inside such a merge), still cannot be undone, and the notice says how many items replaced older ones. When the last change was made in another folder, Ctrl+Z and Ctrl+Y no longer change that folder out of sight: a notice names the change and its folder with **Undo there** or **Redo there**, and the **More** menu names the folder too.
- **The row menu** starts with **Cut**, **Copy** and **Paste**, as in File Explorer, each available or not as on the command bar; on one folder, Paste goes into that folder.
- **A path typed in the address row** opens its folder and gives the keyboard to the list, as in File Explorer.
- **A notice on the status line** is shown whole: the drive figures and the operations chip make room for it.
- **Language.** With the language set to automatic, Folio now follows the language of Windows like the other apps, from its first window and when the setting changes while it runs. It was English before.
- **A file without an extension** shows the plain file picture; it could show a folder's.
- **Accessibility.** The release build of Folio now serves its UI Automation tree, as Tasks does, and the popup menus of both apps expose their items to screen readers, with the focus moving through them.

### Dark system menus and dialogs

The classic "Show more options" menu and the system dialogs are dark again: Folio asks for the dark mode again just before it shows the classic menu, and each app asks for it before its first window. The classic menu no longer lists an entry twice.

### Known limits

The limits of 1.9.0 that this list does not change still hold.

- The table of Tasks has no horizontal scroll; at a very narrow window with all columns shown some cells can still be cut.
- A folder merge that was stopped after it started counts as "replaced" in the undo refusal even when nothing had changed yet, to be safe.
- Folio does not restore items from the Recycle Bin, and does not change the protected places; a change that needs administrator rights is refused.
- Golden pictures changed on purpose are regenerated by the CI job.

### Live checks

Not yet run.

### Install / update

Requires Windows 11. Download `dock.exe` and run it from a terminal:

```powershell
.\dock.exe --install
```

It asks for administrator rights, replaces the installed dock and restarts it. Settings are kept. Or use **Settings, Updates, Update now** from a running 1.4.2 or later. The apps follow on the dock's next sync.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dock"
version = "1.9.0"
version = "1.9.1"
edition = "2021"
rust-version = "1.87"
description = "A minimal, ultra-light, OLED-black floating dock for Windows 11, written in Rust with no UI framework."
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ Every build carries the same asInvoker manifest (see [Install](#install)); `DOCK

| Version | Date | Highlights |
|---|---|---|
| [1.9.1](.github/release-notes/v1.9.1.md) | unreleased | Fixes of the first live test of 1.9.0: the windows of Tasks and Folio always show the current state, Tasks search in groups, Esc and Details commands and columns, Folio mouse wheel, undo after keep both and in another folder, row menu, typed paths, language, icons and accessibility, dark system menus and dialogs again |
| [1.9.0](.github/release-notes/v1.9.0.md) | unreleased | Tasks and Folio polished to stand in for Windows Task Manager and File Explorer (Tasks: resource strip, command band, Performance and Details pages; Folio: icons, search, details pane, cut, copy, paste and changes to real files behind refusals of system places), one accent colour for both apps in Settings, Appearance, and dark system menus only where a menu can show |
| [1.8.1](.github/release-notes/v1.8.1.md) | unreleased | Every suite window has the dock's thin rim, dark system menus, Tasks and Folio labelled Alpha, an opt-in Reserve screen space (AppBar), and fixes: an install no longer records a task or key it found as its own, the Folio operations host exits when idle, the dock and Tasks start by safer paths |
| [1.8.0](.github/release-notes/v1.8.0.md) | unreleased | The suite: Tasks and Folio as betas (installed by the dock's sync, off the Start menu with one switch), Suite and Safety pages in Settings, `--recover`, `--install --from`, a journal of the changes the suite makes to Windows with Undo all, a Ctrl+Shift+Esc option that cannot be switched on while Tasks is beta, and a stricter start of the dock's elevated children and watchdog |
Expand Down
7 changes: 5 additions & 2 deletions apps/files/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "files"
version = "1.9.0"
version = "1.9.1"
edition = "2021"
rust-version = "1.87"
description = "The files app of the suite: its engine roles (ops host, shell host) and, later, its window."
Expand All @@ -25,7 +25,10 @@ path = "examples/files_faultext/lib.rs"
crate-type = ["cdylib"]

[features]
default = []
default = ["a11y"]
# The AccessKit bridge of the kit (UI Automation for Narrator), as in tasks.exe: without it the window and its menus
# answer a client with the bare window. The dock's build stays without it.
a11y = ["oled-ui/a11y"]

[dependencies]
oled-trust = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions apps/files/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl Real {
let _root = oled_sys::datadir::open_existing(false);
let watch = oled_config::theme::ThemeWatch::open();
self.lang_setting = oled_ui::theme_lang(watch.current().language);
self.lang = UiLang::from_lang(self.lang_setting);
self.lang = crate::langfile::resolve_lang(self.lang_setting);
let install_dir = std::env::current_exe().ok().and_then(|p| p.parent().map(std::path::Path::to_path_buf));
crate::langfile::load_lang_file(install_dir.as_deref(), self.lang.italian);
let (Some(hub), Some(services)) = (self.hub.clone(), self.services.take()) else {
Expand Down Expand Up @@ -441,7 +441,7 @@ impl StepRunner for Real {
/// window's formats and in every main window, which rebuilds what it caches (Msg::Lang).
pub fn on_theme_change(shared: &Shared, cx: &mut LoopCx, file: &oled_config::theme::ThemeFile) {
let setting = oled_ui::theme_lang(file.language);
let lang = UiLang::from_lang(setting);
let lang = crate::langfile::resolve_lang(setting);
if lang == shared.lang.get() {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/files/src/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ pub fn home_paint(s: &FilesScreen, cx: &mut PaintCx) {
}
}
for (i, it) in h.items.iter().enumerate() {
if !cx.visible(it.rect) {
if !cx.visible_ringed(it.rect) {
continue;
}
let id = h.node(i);
Expand Down
7 changes: 4 additions & 3 deletions apps/files/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,11 @@ pub fn file_art(ext: &[u8]) -> Art {
}
}

/// Whether the class icon of `ext` is wanted: never for a family of the art (its art is the icon) nor for a program
/// (its own icon or the program art); for every other extension, and none.
/// Whether the class icon of `ext` is wanted: never for a family of the art (its art is the icon), for a program (its
/// own icon or the program art) nor for a file without an extension (the class of no extension can come back as a
/// folder's icon: such a file keeps the generic page); for every other extension.
pub fn wants_class_icon(ext: &[u8]) -> bool {
family_of(ext).is_none() && !is_program(ext)
!ext.is_empty() && family_of(ext).is_none() && !is_program(ext)
}

/// The art of a drive root: the drive holding the Windows folder, a removable drive, a network drive; any other is a
Expand Down
7 changes: 7 additions & 0 deletions apps/files/src/langfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ use std::path::Path;
use oled_sys::lang::{LangFile, LANG_MAX_BYTES};
use oled_trust::manifest::release::Version;

/// The language of the process for a setting, the way every app of the suite takes it: the setting is applied to the
/// process first (`auto` then reads Windows' language), then the kit's language is read back.
pub fn resolve_lang(setting: oled_sys::i18n::Lang) -> oled_ui::UiLang {
oled_sys::i18n::apply(setting);
oled_ui::UiLang::from_lang(setting)
}

/// True when the folder is an installed image: dock.exe and suite.json sit beside files.exe.
fn is_installed(dir: &Path) -> bool {
dir.join("dock.exe").is_file() && dir.join("suite.json").is_file()
Expand Down
4 changes: 4 additions & 0 deletions apps/files/src/listing/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ mod tests {
let only = |families: FamilySet, text: &str| ViewFilter { query: text.into(), families };
s.set_view_filter(only(FamilySet::default().toggled(NameFamily::Images), ""));
assert_eq!(shown(&s), ["a.png", "b.JPG"]);
// A row the filter hides has no row at all: the table drops it from the selection and the focus.
let id = |s: &EntryStore, n: &str| s.find(n.as_bytes()).expect("the entry is live");
assert_eq!(s.row_of(id(&s, "c.txt")), None);
assert_eq!(s.row_of(id(&s, "b.JPG")), Some(1));
assert_eq!(s.unfiltered_len(), 5, "the hidden file is not counted, the other kinds are");
s.set_view_filter(only(FamilySet::default().toggled(NameFamily::Images).toggled(NameFamily::Folders), "a"));
assert_eq!(shown(&s), ["data", "a.png"], "a folder with an a in it, and the image: both families and the text");
Expand Down
45 changes: 43 additions & 2 deletions apps/files/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
use files_engine::exit;

fn main() {
// Every role can own a system-drawn menu (the shell host shows the classic one): dark, as the suite always is.
oled_sys::darkmenu::init();
let args: Vec<String> = std::env::args().skip(1).collect();
// Before the first window: a role that owns a surface Windows draws (a menu, a dialog, a file dialog) is dark, as
// the suite always is.
if owns_system_surface(&role(&args)) {
oled_sys::darkmenu::init();
}
std::process::exit(run(&args));
}

Expand All @@ -24,6 +27,17 @@ enum Role<'a> {
Window,
}

/// Whether a role can own anything Windows draws: the window (its caption menu and the file dialogs it opens), the shell
/// host (the classic context menu and the property sheets) and the operations host (the shell's conflict and
/// confirmation dialogs). The other roles show nothing: a usage error, the debug test client and the message-only
/// window of the instance tests.
fn owns_system_surface(r: &Role<'_>) -> bool {
match r {
Role::Ops | Role::Shell | Role::Window => true,
Role::TestClient(_) | Role::TestIpc | Role::Usage => false,
}
}

fn role(args: &[String]) -> Role<'_> {
match args.first().map(String::as_str) {
Some("--role=ops") => Role::Ops,
Expand Down Expand Up @@ -72,6 +86,33 @@ mod tests {
a.iter().map(|s| s.to_string()).collect()
}

/// Every role of files.exe, by what it can show: the three that own a surface of Windows' opt in, the rest do not.
#[test]
fn system_surface_roles() {
for (r, want) in [
(Role::Window, true),
(Role::Shell, true),
(Role::Ops, true),
(Role::TestClient("x"), false),
(Role::TestIpc, false),
(Role::Usage, false),
] {
assert_eq!(owns_system_surface(&r), want, "{r:?}");
}
for a in [&["--role=ops"][..], &["--role=shell"], &[], &["C:\\x"], &["--bogus"]] {
let a = args(a);
let wants = !matches!(role(&a), Role::Usage);
assert_eq!(owns_system_surface(&role(&a)), wants, "{a:?}");
}
let main = include_str!("main.rs");
let main = main.split("#[cfg(test)]").next().unwrap();
assert_eq!(main.matches("oled_sys::darkmenu::init();").count(), 1, "one opt-in, before the dispatch");
assert!(
main.find("oled_sys::darkmenu::init();") < main.find("std::process::exit(run(&args))"),
"before the first window"
);
}

#[test]
fn role_table() {
assert_eq!(role(&args(&["--role=ops", "--proto=1"])), Role::Ops);
Expand Down
31 changes: 30 additions & 1 deletion apps/files/src/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ pub mod pick {
pub const PIN: u32 = 0x2003;
/// The background menu's "Show more options": the system menu of the folder itself.
pub const MORE_BACKGROUND: u32 = 0x2004;
/// The row menu's Paste on one folder: into that folder, as File Explorer's does.
pub const PASTE_INTO: u32 = 0x2005;
/// The toolbar View menu's Details row (the only view of the first version: checked, nothing to switch).
pub const VIEW_DETAILS: u32 = 0x2132;
/// SORT_COL + the column's ColKind.
Expand Down Expand Up @@ -154,7 +156,9 @@ pub fn build_context(s: &FilesScreen) -> Vec<MenuItem> {
return background_items(s);
}
let folders = h.folders == h.count;
let mut items = vec![cmd_item(Cmd::Open)];
let mut items = clip_items(s, &h);
items.push(MenuItem::Separator);
items.push(cmd_item(Cmd::Open));
if folders {
items.push(row(
s,
Expand Down Expand Up @@ -193,6 +197,25 @@ pub fn build_context(s: &FilesScreen) -> Vec<MenuItem> {
items
}

/// Cut, Copy and Paste at the top of the row menu, as in File Explorer, each on or off as the command bar has it, with
/// the bar's reason as its note. On one folder Paste goes into that folder (no chord: Ctrl+V pastes into the open
/// folder); on anything else into the open folder, as Ctrl+V does.
fn clip_items(s: &FilesScreen, h: &Held) -> Vec<MenuItem> {
let lang = s.shared.lang.get();
let a = toolmenus::avail(s);
let into_folder = h.count == 1 && h.folders == 1;
let (paste, paste_chord) =
if into_folder { (pick::PASTE_INTO, None) } else { (Cmd::Paste as u32, Some(Cmd::Paste)) };
let clip_row = |id: u32, label: Text, glyph: Glyph, chord: Option<Cmd>, why: Option<toolmenus::Why>| {
toolmenus::item(s, id, label, Some(glyph), chord, None, why)
};
vec![
clip_row(Cmd::Cut as u32, t(k::FILES_CMD_CUT, lang), Glyph::CmdCut, Some(Cmd::Cut), a.cut),
clip_row(Cmd::Copy as u32, t(k::FILES_CMD_COPY, lang), Glyph::CmdCopy, Some(Cmd::Copy), a.copy),
clip_row(paste, t(k::FILES_CMD_PASTE, lang), Glyph::CmdPaste, paste_chord, a.paste),
]
}

/// The menu of the empty space of the list.
fn background_items(s: &FilesScreen) -> Vec<MenuItem> {
let lang = s.shared.lang.get();
Expand Down Expand Up @@ -334,6 +357,10 @@ pub fn on_pick(s: &mut FilesScreen, cx: &mut EventCx, id: CommandId) -> Reply {
Reply::None
}
pick::PIN => Reply::None,
pick::PASTE_INTO => match selected(s).as_slice() {
[folder] => crate::clip_files::paste(s, cx, Some(folder.clone())),
_ => Reply::None,
},
pick::MORE_BACKGROUND => {
let at = focus_anchor(s);
let dir: Vec<WidePath> = folder(s).into_iter().collect();
Expand Down Expand Up @@ -465,6 +492,8 @@ pub fn cmd(s: &mut FilesScreen, cx: &mut EventCx, c: Cmd) -> Reply {
if folder(s).is_none() {
return Reply::None;
}
// Paste's state as the clipboard is now, as a right click reads it.
crate::clip_files::look(s, cx);
let at = focus_anchor(s);
// The focused row is the target when nothing is selected.
let t = s.tabs.active_mut();
Expand Down
5 changes: 3 additions & 2 deletions apps/files/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,8 @@ impl FilesTable {

/// The row's icon, never none: a folder draws its art at once (a known folder by its path, never by its name) and
/// never a Windows icon; a file its own icon once it has arrived, else its family's art, the program art for a
/// program, its class icon once that has arrived, else the generic page.
/// program, its class icon once that has arrived, else the generic page. A file without an extension always draws
/// the generic page (icons::wants_class_icon).
fn icon_ref(&self, id: EntryId, is_dir: bool, name: &[u8]) -> IconRef {
let art = |a: Art| IconRef(ART_REF + art_index(a) as u32);
if is_dir {
Expand All @@ -508,7 +509,7 @@ impl FilesTable {
if fallback != Art::FileGeneric {
return art(fallback);
}
let class = if ext.is_empty() { Some(&SLOT_NO_EXT) } else { self.icons.class.get(ext) };
let class = if ext.is_empty() { None } else { self.icons.class.get(ext) };
match class {
Some(&s) if self.icons.filled(s) => IconRef(s),
_ => art(Art::FileGeneric),
Expand Down
1 change: 1 addition & 0 deletions apps/files/src/ops/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ impl Runner for RealRunner {
bin_off: crate::ops::classify::bin_turned_off,
places: places::system(),
look: places::look,
keep_both: false,
};
run(op, work, &ctx);
ops.lock().unwrap_or_else(|e| e.into_inner()).remove(&op);
Expand Down
Loading
Loading