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
  •  
  •  
  •  
71 changes: 71 additions & 0 deletions .github/release-notes/v1.9.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
Changes since [1.8.1](https://github.com/ops-software/mini-oled-dock/releases/tag/v1.8.1).

This release is a big polish of the two apps, Tasks and Folio, so that they can stand in for Windows Task Manager and File Explorer in everyday use. Both are still alphas. The dock bar looks and behaves as before; the one new setting is the accent colour of the suite.

### Tasks

- **A new frame.** A left bar with the pages (it folds to icons), a page head with the title, the search and the view switch, a status line, and a **Settings** menu. The window opens at 1100 x 720 on a first start, and the page head, the resource strip and the pages fit every window size down to the small ones.
- **Processes.** Rows show the program name only, with its icon (a placeholder tile until the icon arrives). Group heads show a count, members show their role, service hosts show their service. A **Status** column says "Not responding" with an attention dot. CPU, memory, disk and network cells take the colour of their resource. An empty search says so and offers **Clear search**.
- **A resource strip** on top of Processes: a verdict line ("Everything normal", or what is wrong, for instance an app that does not respond) and four cells (CPU, Memory, Disk, Network) with small history charts. It has a line mode for tight windows and a close button.
- **A command band** over the list, also in the row menu: **Close**, **End task**, **Efficiency mode**, **Priority** (five levels, with **Restore**), **Open file location**, **Properties**, **Search online**, **Copy path**, **Go to details**, and **Restart Windows Explorer**. Each command says why when it is not available, and a tooltip says what it does. A process that is Realtime is shown but never changed. Efficiency mode and priority are refused for a process without an image. **Open file location** opens the file's folder in Folio with the file selected.
- **Performance.** A page with a list of resources (CPU, Memory, each disk, each network adapter) and a large chart for the chosen one with a read-out under the pointer, 60 samples of history, per-processor view, processor speed and facts, uptime, and who is using the resource. **Copy data** copies what the page shows.
- **Details.** A flat list of every process with Name, PID, Status, User, CPU, Memory and Image, and Priority, Threads, Handles, Session, Command line and Path from the column chooser. The user, command line, priority and efficiency are read only for the rows on screen. The columns you choose are kept.
- **Run new task.** A sheet (Ctrl+N) with history and **Browse**; the dock's launcher can also start it.
- Search, Filter and keyboard: F6 visits the command band, and the page chords reach the pages.

### Folio

- **A new frame.** A labelled command bar that folds the commands that do not fit into **More**, an address row, a sidebar (Quick access, This PC with a capacity bar for each drive, Network, Recycle Bin) and a status line that never lets its parts collide. Commands that cannot work in the place you are in say so and stay visible.
- **Our own icons.** Folders, known folders, drives, places and the families of files (documents, images, audio, video, archives, code and the like) have a coloured picture from the first frame. Programs and shortcuts show their own Windows icon once it is read, a shortcut's icon from the link file's bytes, never by resolving the link.
- **Search and filter** in the open folder (accent-insensitive), a **Filter** menu by family, and restyled empty, loading and error pages.
- **A details pane** (**Details** switch, Alt+Shift+P) with the facts of the selection.
- **Cut, Copy and Paste of files, New folder, Rename, Delete (to the Recycle Bin or permanently), Undo and Redo** work on real folders now. See "Real files" below.

### The suite

- **Accent colour.** Settings, Appearance has a row of swatches and a picker for one accent colour (`accent` in `config.json`, `#RRGGBB`, white by default, which means no accent) used by Tasks and Folio. A colour that cannot be read against the chosen background is refused with a line that says why.
- **One look for both apps**: new kit controls (icon buttons, segmented switches, toggles, text fields, tooltips that also show on keyboard focus), new line icons, line charts with a read-out, and a 2 px focus ring in the apps. Under high contrast the figures use the window text colour.
- The apps can ask the dock to open its Settings on the Appearance page.

### Real files

Folio changes real files only through its operations host, one step at a time, and the host refuses before it asks Windows:

- Never changed: the Windows folder, the program folders and the shared program data, the names Windows keeps at the root of a volume, and the Users folder, the profiles, the known folders and the temporary folder themselves (what is inside the user's own folders can be changed). A volume's root is never removed.
- Whatever your own rights do not allow is refused with a notice, so no elevation prompt ever appears for a change made from Folio. Items are judged through a handle (real path, not the name typed), and a destination reached through a junction or a link is judged by its target.
- A permanent delete always asks first on the bar. Paste refuses items of the Recycle Bin and a folder into itself. Cut items are drawn faded until pasted, and Ctrl+Z undoes.

Proof: the tests of these commands run against a test folder in the unit and window tests, and the switches that turn real data on (changes, and Cut, Copy and Paste) are meant to ship only when the Files disposable CI job is green on throwaway volumes (NTFS with a small Recycle Bin, a FAT32 disk, a network share on the same machine) with its recorded proofs. That job runs on the release pull request, not on a PC, and has not run yet for this build: if it is not green, the two switch commits are reverted before release and Folio goes back to refusing changes outside a test folder.

### Fixes

- **Dark system menus** are now asked for only by the programs that can show a menu; the dock's helper children and the watchdog no longer load the theme library.
- **Start shortcut names** follow the language set in `config.json` from the install on (the install used to name them in English and the dock renamed them at its next sync); a shortcut the sync removes has its journal entry closed, so the journal never names a missing file. Someone else's shortcut under the same name is never removed.
- Folio's helper no longer loads a shortcut through the shell's link object, and a crash while loading a file type disables that type alone, not a whole request.
- An elevated Tasks starts Folio and the browser through the desktop shell, with your rights rather than its own.
- Tasks starts Folio with the file alone (`--select`); Folio opens the folder with the file selected.
- A refresh in Folio keeps the search narrowing; a cached folder comes back whole.
- A line cell that shows only a value keeps its whole tooltip.

### Known limits

The limits of 1.8.1 that this list does not change still hold. Tasks and Folio are alphas.

- Tasks has Processes, Performance and Details. Startup apps, Services, Users and App history are not in it yet: use Windows Task Manager and the Services console for them.
- Folio does not restore items from the Recycle Bin (it refuses to move them out under their bin names and offers File Explorer), and does not change the places listed under "Real files".
- A change that needs administrator rights is refused; Folio never asks for them.
- Golden pictures changed on purpose are regenerated by the CI job; the Files disposable proof above is part of the release pull request.

### 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.8.1"
version = "1.9.0"
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ Shift changes only apps; on every other part it is the same as without Shift. Sh
| `keyboard` | `{ "win_numbers": true, "win_t": true, "win_b": true, "peek": true }` | The Win-key chords the dock owns, see [Keyboard](#keyboard): `win_numbers` Win+1...9/0 (also with Shift and Alt), `win_t` Win+T and Win+Shift+T, `win_b` Win+B, `peek` the digit numbers shown while Win is held (needs `win_numbers`). A key you leave out stays on. `true` or `false` alone (`"keyboard": false`) sets all four. A wrong type in one switch is ignored (it stays on). Settings has one switch for all four. All off while `hide_native_taskbar` is `false`; the chords also go to remote-desktop and VM windows and a UAC prompt |
| `window_previews` | `true` | Live previews of an app's windows when the pointer rests on an app with two or more |
| `reserve_space` | `false` | With `autohide` `false`, the bar reserves its strip of the screen like the Windows taskbar (an AppBar), so maximized windows end above it instead of under it (Settings → Bar → **Reserve screen space**). Nothing is reserved with `autohide` `true`, while the bar is hidden or over a full-screen app; the strip is given back when the dock exits, and a dock that died leaves a marker (`appbar-state`, next to `taskbar-state`) so the watchdog or the next start frees it |
| `accent` | `"#FFFFFF"` | Since 1.9.0: the accent colour of Tasks and Folio as `#RRGGBB` (Settings, Appearance). White means no accent; a colour that cannot be read against the background is refused. It reaches the apps through `suite\theme.json` |
| `hide_native_taskbar` | `true` | Hide the Windows taskbar while the dock runs |
| `show_date` / `date_format` | `true` / `"ddd d MMM"` | Date under the time (Windows date picture) |
| `time_format` / `show_seconds` | `"HH:mm"` / `false` | Clock format (Windows time picture) |
Expand Down Expand Up @@ -373,6 +374,7 @@ Every build carries the same asInvoker manifest (see [Install](#install)); `DOCK

| Version | Date | Highlights |
|---|---|---|
| [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 |
| [1.7.0](.github/release-notes/v1.7.0.md) | unreleased | The exe asks for no rights itself and each mode gets the level it needs, a helper at your own level reads the Start catalogue and icons, Push reveal at the screen edge, a wrong value in `config.json` loses only its own key, the look is written to `suite\theme.json`, the loader reads system DLLs only |
Expand Down
7 changes: 6 additions & 1 deletion apps/files/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "files"
version = "1.8.1"
version = "1.9.0"
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 Down Expand Up @@ -71,6 +71,11 @@ windows-core = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }

# The tests only (resolver 2 keeps these out of files.exe's build): the disposable tests place files on the clipboard
# through the shell's data object and answer Windows' conflict dialog through UI Automation.
[dev-dependencies]
windows = { workspace = true, features = ["Win32_System_Com_StructuredStorage", "Win32_UI_Accessibility"] }

[build-dependencies]
embed-manifest = "1.5.1"
winresource = "0.1.19"
Expand Down
52 changes: 2 additions & 50 deletions apps/files/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,17 @@ use oled_trust::frame::files::{InstanceCmd, Location};
use oled_ui::host::{EventLoop, LoopCx, WindowRef};
use oled_ui::theme::ThemeSpec;
use oled_ui::{PointP, Screen, UiLang};
use windows::core::PWSTR;
use windows::Win32::Foundation::FILETIME;
use windows::Win32::System::Com::CoTaskMemFree;
use windows::Win32::System::SystemInformation::GetSystemTimeAsFileTime;
use windows::Win32::System::Threading::{GetCurrentProcess, GetProcessTimes};
use windows::Win32::UI::Shell::{
FOLDERID_Desktop, FOLDERID_Documents, FOLDERID_Downloads, FOLDERID_Music, FOLDERID_Pictures, FOLDERID_Profile,
FOLDERID_Videos, SHGetKnownFolderPath, SHGetStockIconInfo, KF_FLAG_DEFAULT, SHGSI_ICON, SHSTOCKICONINFO,
SIID_FOLDER,
};
use windows::Win32::UI::WindowsAndMessaging::DestroyIcon;

use crate::bg::Lane;
use crate::cli::{self, Cli};
use crate::format::Fmt;
use crate::hub::Hub;
use crate::instance::{self, Elevation, ForwardError, InstanceNames, Ipc, MutexState};
use crate::listing::{Batch, CancelToken, EnumJob, Gen, WidePath};
use crate::msg::{JobDone, KnownName, Msg};
use crate::msg::{JobDone, Msg};
use crate::services::{self, Services};
use crate::session::{Session, SessionStore};
use crate::types::TypeNames;
Expand Down Expand Up @@ -237,8 +229,7 @@ impl Real {

fn start_jobs(&mut self) {
let Some(services) = &self.services else { return };
services.bg.run(0, Lane::Local, Box::new(|| Some(JobDone::StockFolderIcon(stock_folder_icon()))));
services.bg.run(0, Lane::Local, Box::new(|| Some(JobDone::KnownFolders(known_folders()))));
services.bg.run(0, Lane::Local, Box::new(|| Some(JobDone::KnownFolders(crate::knownfolders::read()))));
}

fn config(&mut self) -> Flow {
Expand Down Expand Up @@ -516,42 +507,3 @@ fn process_start() -> Instant {
let since = ticks(&at).saturating_sub(ticks(&created)).min(10 * 10_000_000);
now.checked_sub(Duration::from_nanos(since * 100)).unwrap_or(now)
}

/// Shell32's own stock folder icon (no extension, no host round trip): (side px, premultiplied BGRA bytes).
fn stock_folder_icon() -> Option<(u16, Arc<[u8]>)> {
let mut info = SHSTOCKICONINFO { cbSize: std::mem::size_of::<SHSTOCKICONINFO>() as u32, ..Default::default() };
// SAFETY: `info` has cbSize set and lives for the call.
unsafe { SHGetStockIconInfo(SIID_FOLDER, SHGSI_ICON, &mut info) }.ok()?;
let bgra = crate::decor::gdi::hicon_to_bgra(info.hIcon);
// SAFETY: the icon was made for us by the call above and is not used after this line.
let _ = unsafe { DestroyIcon(info.hIcon) };
let b = bgra?;
let side = u16::try_from(b.w).ok().filter(|s| *s > 0 && b.w == b.h)?;
Some((side, Arc::from(crate::decor::gdi::to_bytes(&b))))
}

/// The seven known folders KnownName names, the ones that exist.
fn known_folders() -> Vec<(KnownName, WidePath)> {
let ids = [
(KnownName::Desktop, &FOLDERID_Desktop),
(KnownName::Downloads, &FOLDERID_Downloads),
(KnownName::Documents, &FOLDERID_Documents),
(KnownName::Pictures, &FOLDERID_Pictures),
(KnownName::Music, &FOLDERID_Music),
(KnownName::Videos, &FOLDERID_Videos),
(KnownName::Profile, &FOLDERID_Profile),
];
let mut out = Vec::new();
for (name, id) in ids {
// SAFETY: a known folder id and default flags; the returned string is freed below.
let Ok(p): Result<PWSTR, _> = (unsafe { SHGetKnownFolderPath(id, KF_FLAG_DEFAULT, None) }) else { continue };
// SAFETY: `p` is the NUL-terminated string returned by the call above, read once.
let units: Vec<u16> = unsafe { p.as_wide() }.to_vec();
// SAFETY: allocated with CoTaskMemAlloc by SHGetKnownFolderPath; not used afterwards.
unsafe { CoTaskMemFree(Some(p.0 as *const std::ffi::c_void)) };
if let Ok(path) = WidePath::new(&units) {
out.push((name, path));
}
}
out
}
Loading
Loading