diff --git a/.github/release-notes/v1.9.0.md b/.github/release-notes/v1.9.0.md new file mode 100644 index 00000000..9007d4ad --- /dev/null +++ b/.github/release-notes/v1.9.0.md @@ -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. diff --git a/Cargo.lock b/Cargo.lock index 107d2bdb..fe6238f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,7 +37,7 @@ dependencies = [ [[package]] name = "dock" -version = "1.8.1" +version = "1.9.0" dependencies = [ "embed-manifest", "oled-config", @@ -70,7 +70,7 @@ checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" [[package]] name = "files" -version = "1.8.1" +version = "1.9.0" dependencies = [ "embed-manifest", "oled-config", @@ -93,7 +93,7 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "gallery" -version = "1.8.1" +version = "1.9.0" dependencies = [ "embed-manifest", "oled-config", @@ -293,7 +293,7 @@ dependencies = [ [[package]] name = "tasks" -version = "1.8.1" +version = "1.9.0" dependencies = [ "embed-manifest", "oled-config", diff --git a/Cargo.toml b/Cargo.toml index f2526fb2..ccc80475 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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." diff --git a/README.md b/README.md index f8dedb0c..7b1f9fb4 100644 --- a/README.md +++ b/README.md @@ -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) | @@ -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 | diff --git a/apps/files/Cargo.toml b/apps/files/Cargo.toml index 4b887df3..caf878d4 100644 --- a/apps/files/Cargo.toml +++ b/apps/files/Cargo.toml @@ -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." @@ -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" diff --git a/apps/files/src/app.rs b/apps/files/src/app.rs index 1f795960..c9e5de43 100644 --- a/apps/files/src/app.rs +++ b/apps/files/src/app.rs @@ -7,17 +7,9 @@ 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}; @@ -25,7 +17,7 @@ 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; @@ -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 { @@ -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::() 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 = (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 = 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 -} diff --git a/apps/files/src/bar.rs b/apps/files/src/bar.rs index d9f25606..57be6083 100644 --- a/apps/files/src/bar.rs +++ b/apps/files/src/bar.rs @@ -1,6 +1,6 @@ -//! The inline bar that asks before a permanent delete (P3-files-app 2.2, F3.2, U3). It replaces the status items when -//! a Del meets an item that cannot go to the Recycle Bin, takes the keyboard while open, and only a fresh Enter (never -//! a repeat) or its Delete button sends DeletePermanent. A Del on the open bar, pressed again or held, is consumed and +//! The inline bar that asks before a permanent delete. It replaces the status items when a Del meets an item that +//! cannot go to the Recycle Bin, or when Shift+Del (or the menu's Delete permanently) asks for one, takes the keyboard +//! while open, and only a fresh Enter (never a repeat) or its Delete button sends DeletePermanent. A Del on the open bar, pressed again or held, is consumed and //! sends nothing: the key that opened the bar never confirms it. Esc, Cancel, a navigation, a selection change or a //! tab switch close it and nothing is sent. @@ -44,6 +44,8 @@ struct Open { at: Location, sel: (usize, Option), redo: bool, + /// Asked for (Shift+Del): every item could go to the bin, and the question says the delete is for good. + asked: bool, } pub struct RecycleBar { @@ -98,6 +100,11 @@ impl RecycleBar { self.open.as_ref().map_or(&[], |o| o.yes.as_slice()) } + /// The open bar asks about a delete the user asked for (Shift+Del), not about items the bin cannot take. + pub fn is_asked(&self) -> bool { + self.open.as_ref().is_some_and(|o| o.asked) + } + /// A Del waits for its classification. pub fn is_pending(&self) -> bool { self.pending.is_some() @@ -124,11 +131,20 @@ fn snapshot(t: &Tab) -> (usize, Option) { /// Opens the bar over the active tab: yes may go to the bin, no cannot. pub(crate) fn open(s: &mut FilesScreen, cx: &mut EventCx, yes: Vec, no: Vec, redo: bool) { let tab = s.tabs.active(); - let o = Open { yes, no, tab: tab.id, at: tab.nav.location().clone(), sel: snapshot(tab), redo }; + let o = Open { yes, no, tab: tab.id, at: tab.nav.location().clone(), sel: snapshot(tab), redo, asked: false }; s.bar.open = Some(o); cx.relayout(); } +/// Shift+Del and the menu's Delete permanently: the bar asks whether the items go for good; nothing is sent before its +/// fresh Enter or its Delete button. +pub(crate) fn ask_permanent(s: &mut FilesScreen, cx: &mut EventCx, items: Vec) { + open(s, cx, Vec::new(), items, false); + if let Some(o) = s.bar.open.as_mut() { + o.asked = true; + } +} + /// Closes the bar; nothing is sent. fn close(s: &mut FilesScreen, cx: &mut EventCx) -> Reply { s.bar.open = None; @@ -166,11 +182,16 @@ pub fn bar_layout(s: &mut FilesScreen, cx: &mut LayoutCx, r: RectP) { } let lang = cx.lang(); let n = o.no.len() as u64; + let (one, other) = if o.asked { + (k::FILES_OPS_CONFIRM_DELETE_ONE, k::FILES_OPS_CONFIRM_DELETE_OTHER) + } else { + (k::FILES_OPS_NONRECYCLABLE_ONE, k::FILES_OPS_NONRECYCLABLE_OTHER) + }; let text = if n == 1 { - t(k::FILES_OPS_NONRECYCLABLE_ONE, lang) + t(one, lang) } else { let fmt = s.shared.fmt.borrow().clone(); - tf(k::FILES_OPS_NONRECYCLABLE_OTHER, lang, &[("n", &fmt.count(n))]) + tf(other, lang, &[("n", &fmt.count(n))]) }; let bar = &mut s.bar; bar.rect = r; diff --git a/apps/files/src/chrome.rs b/apps/files/src/chrome.rs index e41acd26..c11a2096 100644 --- a/apps/files/src/chrome.rs +++ b/apps/files/src/chrome.rs @@ -6,7 +6,7 @@ use oled_ui::host::Caption; use oled_ui::model::FgRole; use oled_ui::node::Text; use oled_ui::theme::TypeRole; -use oled_ui::tokens::{CAPTION_BTN_W, TAB_ROW_H, TITLEBAR_H}; +use oled_ui::tokens::{CAPTION_BTN_W, TITLEBAR_H}; use oled_ui::widgets::{CaptionButtons, CaptionOut, TabStrip, TextLabel}; use oled_ui::{ CaptionHit, Event, EventCx, Key, LayoutCx, PaintCx, PointP, RectP, Reply, Scale, Screen, Widget, WidgetId, @@ -27,9 +27,12 @@ const ID_BETA: WidgetId = WidgetId(22); const BETA_GAP: i32 = 12; const BETA_W: i32 = 48; const TABS_GAP: i32 = 8; +/// The tab row under a system caption (logical px): tabs of 32 centred in it. +pub const TAB_ROW_H: i32 = 38; -/// What the strip shows, to tell a change from a repaint: key, label, tip, busy, error. -type Sig = (u64, String, String, bool, bool); +/// What the strip shows, to tell a change from a repaint: key, label, tip, busy, error, and the art (its address in +/// the window's book: a new book or another art is a change). +type Sig = (u64, String, String, bool, bool, usize); pub struct Chrome { strip: TabStrip, @@ -59,7 +62,7 @@ impl Default for Chrome { impl Chrome { pub fn new() -> Chrome { Chrome { - strip: TabStrip::new(ID_STRIP), + strip: TabStrip::new(ID_STRIP).with_click_look(), buttons: CaptionButtons::new(ID_BUTTONS), beta: TextLabel::new(ID_BETA, Text::Borrowed(""), TypeRole::Caption, FgRole::Tertiary), rects: ChromeRects::default(), @@ -148,7 +151,7 @@ pub fn layout(s: &mut FilesScreen, cx: &mut LayoutCx, r: RectP) -> RectP { let caption = cx.effective_caption(); let rc = rects(caption, r.w(), cx.scale()); let lang = cx.lang(); - let (specs, selected) = (s.tabs.specs(lang), s.tabs.active().id.0 as u64); + let (specs, selected) = (tab::specs_of(s, lang), s.tabs.active().id.0 as u64); let sig = sig_of(&specs, selected); let me = &mut s.chrome; if sig != me.sig { @@ -178,7 +181,9 @@ fn sig_of(specs: &[oled_ui::widgets::TabSpec], selected: u64) -> (Vec, u64) let v = specs .iter() .map(|t| { - (t.key, t.label.to_string(), t.tip.as_ref().map(|x| x.to_string()).unwrap_or_default(), t.busy, t.error) + let tip = t.tip.as_ref().map(|x| x.to_string()).unwrap_or_default(); + let art = t.icon.as_ref().map_or(0, |i| std::rc::Rc::as_ptr(i) as usize); + (t.key, t.label.to_string(), tip, t.busy, t.error, art) }) .collect(); (v, selected) @@ -199,7 +204,7 @@ pub fn paint(s: &FilesScreen, cx: &mut PaintCx) { /// them). pub(crate) fn sync(s: &mut FilesScreen, cx: &mut EventCx) { let lang = s.shared.lang.get(); - let (specs, selected) = (s.tabs.specs(lang), s.tabs.active().id.0 as u64); + let (specs, selected) = (tab::specs_of(s, lang), s.tabs.active().id.0 as u64); let sig = sig_of(&specs, selected); let me = &mut s.chrome; if sig != me.sig || me.stale { diff --git a/apps/files/src/clip_files.rs b/apps/files/src/clip_files.rs new file mode 100644 index 00000000..4f76b40e --- /dev/null +++ b/apps/files/src/clip_files.rs @@ -0,0 +1,501 @@ +//! Cut, Copy and Paste of files through the clipboard. Copy and Cut put the selection on the kit's +//! clipboard as files (CF_HDROP and its drop effect, as File Explorer puts them) from the UI thread; Paste reads the +//! file list any program put there and asks the operations host for a copy or a move into the open folder (or the +//! folder a menu's Paste was invoked on), through ops_ui::request and its gate, with Windows' own dialog on a name +//! clash. The window looks at the clipboard only when it activates, when an input arrives (before the command bar lays +//! out, and so before any menu opens) and on Paste itself: the kit has no listener and nothing polls. The cut belongs +//! to the process: its items draw at half alpha until they are pasted, the clipboard's sequence number moves on, or +//! Esc. Once a paste of cut items has finished, the clipboard is emptied as File Explorer does; nothing ever asks the +//! program that put the items there to delete them. The checks and the paths' forms are pure functions; the bytes of +//! the format itself are the kit's (host/clipboard.rs), which writes and reads it. + +use std::collections::{HashMap, HashSet}; +use std::ffi::OsString; +use std::os::windows::ffi::{OsStrExt, OsStringExt}; +use std::path::PathBuf; +use std::rc::Rc; + +use oled_trust::frame::files::Location; +use oled_ui::{DropEffect, EventCx, Reply}; + +use crate::keys::Cmd; +use crate::listing::WidePath; +use crate::ops::checks::{folded, within}; +use crate::ops_ui::{self, name_of, MutReq}; +use crate::status::{self, Notice, NoticeAct}; +use crate::toolmenus::Why; +use crate::tr::{k, t, tf}; +use crate::window::{self, FilesScreen}; + +// ---- the pure part ---------------------------------------------------------------------------------------------- + +/// The names of cut items by their folder: what a listing's rows look up to draw at half alpha. +#[derive(Debug, Default, PartialEq, Eq)] +pub struct CutNames { + by_dir: HashMap>>, +} + +impl CutNames { + pub fn of(items: &[WidePath]) -> CutNames { + let mut by_dir: HashMap>> = HashMap::new(); + for p in items { + let (Some(dir), Some(name)) = (p.parent(), p.file_name()) else { continue }; + let mut wtf8 = Vec::new(); + crate::listing::collate::utf16_to_wtf8(name, &mut wtf8); + by_dir.entry(dir).or_default().insert(wtf8.into_boxed_slice()); + } + CutNames { by_dir } + } + + /// The entry `name` (WTF-8, as a listing holds it) of the folder `dir` is cut. + pub fn has(&self, dir: &WidePath, name: &[u8]) -> bool { + self.by_dir.get(dir).is_some_and(|names| names.contains(name)) + } +} + +/// What this process put on the clipboard as cut, with the clipboard's sequence number right after it did. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Cut { + pub items: Vec, + pub seq: u32, +} + +/// The process's cut, shared by its windows (Shared.clip). The serial moves on with every change, so that each window +/// knows when its tables must look again. +#[derive(Debug, Default)] +pub struct ClipState { + cut: Option, + names: Option>, + serial: u64, +} + +impl ClipState { + pub fn cut(&self) -> Option<&Cut> { + self.cut.as_ref() + } + + pub fn names(&self) -> Option> { + self.names.clone() + } + + pub fn serial(&self) -> u64 { + self.serial + } + + /// A new cut, or none: every window's rows follow. + pub fn set_cut(&mut self, cut: Option) { + self.names = cut.as_ref().map(|c| Rc::new(CutNames::of(&c.items))); + self.cut = cut; + self.serial += 1; + } +} + +/// What one window knows of the clipboard since it last looked. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct Seen { + /// The clipboard held files: Paste may run. + pub has_files: bool, + /// The ClipState serial this window's tables draw. + pub serial: u64, +} + +/// Why a paste is refused before anything reaches the operations host. +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum Refused { + /// A path that is not an absolute file-system path (a device, a relative path, a name too long). + BadPath, + /// The item is on the clipboard twice. + Twice(String), + /// The destination is the item or lies inside it: a folder into itself. + IntoItself(String), + /// An item of a Recycle Bin: there it carries the bin's own name ($R...), and only File Explorer restores it under + /// its original one. + InBin, +} + +/// What a paste does once it passed the checks. +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum Plan { + Copy(Vec), + Move(Vec), + /// Nothing to paste, or a move of items that are all in the destination already. + Nothing, +} + +/// The items of a copy that are in the destination already, apart from the others: each part is its own copy, so that +/// the shell names the copies of the first and Windows' own dialog still asks about a clash of the second. Pure. +pub fn split_own(items: Vec, dest: &WidePath) -> (Vec, Vec) { + let key = folded(dest.units()); + items.into_iter().partition(|p| p.parent().is_some_and(|d| folded(d.units()) == key)) +} + +/// The items as the clipboard holds them. +pub fn to_clip(items: &[WidePath]) -> Vec { + items.iter().map(|p| PathBuf::from(OsString::from_wide(p.units()))).collect() +} + +/// The clipboard's paths as the engine takes them; one path that is not an absolute file-system path refuses them all, +/// and so does one in a Recycle Bin (in_bin). +pub fn from_clip(paths: &[PathBuf]) -> Result, Refused> { + paths + .iter() + .map(|p| match WidePath::new(&p.as_os_str().encode_wide().collect::>()) { + Ok(w) if in_bin(&w) => Err(Refused::InBin), + Ok(w) => Ok(w), + Err(_) => Err(Refused::BadPath), + }) + .collect() +} + +/// `p` is a Recycle Bin's folder or lies in one: a component, its trailing dots and spaces dropped as Win32 drops them, +/// is $Recycle.Bin (compared as Windows compares names), at a volume's root or at a volume mounted in a folder. The +/// bin's items carry its own names there ($R...): a paste would move or copy them under those names. Pure. +fn in_bin(p: &WidePath) -> bool { + let bin = folded(&"$Recycle.Bin".encode_utf16().collect::>()); + p.units().split(|&c| c == u16::from(b'\\')).any(|c| { + let end = c.iter().rposition(|&u| u != u16::from(b'.') && u != u16::from(b' ')).map_or(0, |i| i + 1); + folded(c.get(..end).unwrap_or_default()) == bin + }) +} + +/// A paste of `items` into `dest` with the clipboard's drop effect. Refused when an item is there twice (compared as +/// Windows compares names) or when the destination is an item or lies inside one; a move leaves out the items already +/// in `dest` (a cut pasted into its own folder changes nothing). A copy into the items' own folder is a copy: the +/// shell names it as File Explorer does. +pub fn plan(items: Vec, dest: &WidePath, effect: DropEffect) -> Result { + let mut seen = HashSet::with_capacity(items.len()); + for p in &items { + if !seen.insert(folded(p.units())) { + return Err(Refused::Twice(name_of(p))); + } + if within(dest, p) { + return Err(Refused::IntoItself(name_of(p))); + } + } + let dest_key = folded(dest.units()); + let items = match effect { + DropEffect::Copy => items, + DropEffect::Move => { + items.into_iter().filter(|p| p.parent().is_none_or(|d| folded(d.units()) != dest_key)).collect() + } + }; + Ok(match (items.is_empty(), effect) { + (true, _) => Plan::Nothing, + (false, DropEffect::Copy) => Plan::Copy(items), + (false, DropEffect::Move) => Plan::Move(items), + }) +} + +// ---- the window --------------------------------------------------------------------------------------------------- + +fn live(s: &FilesScreen) -> bool { + s.shared.paste_live.get() +} + +/// The open folder, when the active tab lists one. +fn open_folder(s: &FilesScreen) -> Option { + match s.tabs.active().nav.location() { + Location::Fs(p) => Some(p.clone()), + _ => None, + } +} + +/// Looks at the clipboard: whether it holds files (Paste's state), and whether the process's cut is still what it +/// holds (a new sequence number ends the cut). True when what the window shows changed. Nothing is read while the +/// clipboard commands wait for their switch. +pub fn look(s: &mut FilesScreen, cx: &mut EventCx) -> bool { + if !live(s) { + return false; + } + let (has, seq) = { + let c = cx.clipboard(); + (c.has_files(), c.sequence()) + }; + let mut changed = std::mem::replace(&mut s.clip.has_files, has) != has; + if s.shared.clip.borrow().cut().is_some_and(|c| c.seq != seq) { + end_cut(s); + changed = true; + } + changed +} + +/// The process's cut ends: every window's rows draw as before. +fn end_cut(s: &mut FilesScreen) { + s.shared.clip.borrow_mut().set_cut(None); + window::bump_all(&s.shared); +} + +/// This window's tables follow the process's cut (from settle, after every event and message). True when they had to. +pub fn sync(s: &mut FilesScreen) -> bool { + let (serial, names) = { + let c = s.shared.clip.borrow(); + (c.serial(), c.names()) + }; + if s.clip.serial == serial { + return false; + } + s.clip.serial = serial; + for t in s.tabs.iter_mut() { + t.table.model_mut().set_cut_names(names.clone()); + } + true +} + +/// Cut, Copy and Paste: their keys, their buttons and the More menu's rows. +pub fn cmd(s: &mut FilesScreen, cx: &mut EventCx, c: Cmd) -> Reply { + match c { + Cmd::Cut | Cmd::Copy => { + let items = crate::menu::selected(s); + put_checked(s, cx, items, c == Cmd::Cut) + } + Cmd::Paste => paste(s, cx, None), + _ => Reply::None, + } +} + +/// Copy or Cut of `items` of the open folder, under the switch and the gate's answer for the folder: while either +/// says no, the not-available notice and nothing on the clipboard. +pub fn put_checked(s: &mut FilesScreen, cx: &mut EventCx, items: Vec, cut: bool) -> Reply { + if !live(s) { + crate::menu::not_in_beta(s, cx); + return Reply::Redraw; + } + // Home and the other pages list no folder: nothing to put. + let Some(dir) = open_folder(s) else { return Reply::None }; + if !s.toolbar.may_change(&dir) { + crate::menu::not_in_beta(s, cx); + return Reply::Redraw; + } + put(s, cx, items, cut) +} + +/// The items on the clipboard as files, to copy or (`cut`) to move; a cut draws them at half alpha. A clipboard +/// another program holds: the notice, and the cut stays as it was. +fn put(s: &mut FilesScreen, cx: &mut EventCx, items: Vec, cut: bool) -> Reply { + if items.is_empty() { + return Reply::None; + } + let effect = if cut { DropEffect::Move } else { DropEffect::Copy }; + if !cx.clipboard().set_files(&to_clip(&items), effect) { + status::notice(s, cx, Notice::new(t(k::FILES_CLIP_BUSY, cx.lang()))); + return Reply::Relayout; + } + let seq = cx.clipboard().sequence(); + s.clip.has_files = true; + // What the clipboard held is gone: an earlier cut ends, a new one begins. + if cut || s.shared.clip.borrow().cut().is_some() { + s.shared.clip.borrow_mut().set_cut(cut.then_some(Cut { items, seq })); + window::bump_all(&s.shared); + } + Reply::Relayout +} + +/// Paste into `into` (the folder a menu's Paste was invoked on) or the open folder: the clipboard's files, checked, +/// then a copy or a move through ops_ui::request. A move carries the clipboard's sequence number, so that its end +/// empties the clipboard when it still holds them (paste_done); the same move asked again while it runs is dropped. +pub fn paste(s: &mut FilesScreen, cx: &mut EventCx, into: Option) -> Reply { + if !live(s) { + crate::menu::not_in_beta(s, cx); + return Reply::Redraw; + } + look(s, cx); + if into.as_ref().is_some_and(|d| !folder_here(s, d)) { + return Reply::None; + } + let Some(dest) = into.or_else(|| open_folder(s)) else { return Reply::None }; + if !s.toolbar.may_change(&dest) { + crate::menu::not_in_beta(s, cx); + return Reply::Redraw; + } + let Some(clip) = cx.clipboard().files() else { + s.clip.has_files = false; + return Reply::Relayout; + }; + let seq = cx.clipboard().sequence(); + let planned = from_clip(&clip.paths).and_then(|items| plan(items, &dest, clip.effect)); + match planned { + Err(why) => refused(s, cx, &why), + Ok(Plan::Nothing) => Reply::None, + Ok(Plan::Copy(items)) => { + let (own, others) = split_own(items, &dest); + for items in [others, own].into_iter().filter(|part| !part.is_empty()) { + ops_ui::request(s, cx, MutReq::Copy { items, dest: dest.clone() }); + } + Reply::Relayout + } + Ok(Plan::Move(items)) => { + if s.shared.ops.borrow().moving(seq) { + return Reply::None; + } + ops_ui::request(s, cx, MutReq::Move { items, dest, clip: Some(seq) }); + Reply::Relayout + } + } +} + +/// `p` is the folder the active tab lists or a folder listed in it: where a menu's Paste may go. +fn folder_here(s: &FilesScreen, p: &WidePath) -> bool { + let l = s.tabs.active().table.model().listing(); + if p == l.dir() { + return true; + } + let (Some(parent), Some(name)) = (p.parent(), p.file_name()) else { return false }; + if &parent != l.dir() { + return false; + } + let mut wtf8 = Vec::new(); + crate::listing::collate::utf16_to_wtf8(name, &mut wtf8); + l.find(&wtf8).is_some_and(|id| l.is_dir(id)) +} + +/// A refused paste: why, in the status line (File Explorer offered for paths this window does not take). +fn refused(s: &mut FilesScreen, cx: &mut EventCx, why: &Refused) -> Reply { + let lang = cx.lang(); + let notice = match why { + Refused::BadPath | Refused::InBin => Notice { + action: Some((t(k::FILES_ACTION_OPEN_EXPLORER_ARROW, lang), NoticeAct::OpenInExplorer)), + ..Notice::new(t(k::FILES_CLIP_BAD, lang)) + }, + Refused::Twice(name) => Notice::new(tf(k::FILES_CLIP_TWICE, lang, &[("name", name)])), + Refused::IntoItself(name) => Notice::new(tf(k::FILES_CLIP_INTO_ITSELF, lang, &[("name", name)])), + }; + status::notice(s, cx, notice); + Reply::Relayout +} + +/// Esc while a cut waits: the cut ends and, when the clipboard still holds it, the clipboard is emptied, so that a +/// later Paste cannot move what no longer looks cut. True when there was a cut. +pub fn escape(s: &mut FilesScreen, cx: &mut EventCx) -> bool { + let Some(seq) = s.shared.clip.borrow().cut().map(|c| c.seq) else { return false }; + cx.clipboard().clear_if(seq); + s.clip.has_files = cx.clipboard().has_files(); + end_cut(s); + true +} + +/// A move of the clipboard's files finished: the clipboard is emptied when it still holds them (as File Explorer does +/// after a paste of cut items), and the process's cut of them ends. +pub fn paste_done(s: &mut FilesScreen, cx: &mut EventCx, seq: u32) { + cx.clipboard().clear_if(seq); + if s.shared.clip.borrow().cut().is_some_and(|c| c.seq == seq) { + end_cut(s); + } + s.clip.has_files = cx.clipboard().has_files(); +} + +/// Paste's reason while it cannot run, for the command bar (toolmenus::avail). +pub fn paste_why(s: &FilesScreen) -> Option { + (!s.clip.has_files).then_some(Why::ClipboardEmpty) +} + +#[cfg(test)] +mod tests { + use super::*; + + fn p(s: &str) -> WidePath { + WidePath::parse(s).unwrap() + } + + #[test] + fn a_folder_never_goes_into_itself() { + let dir = p(r"C:\made-up\projects"); + for dest in [r"C:\made-up\projects", r"C:\made-up\projects\2026", r"c:\MADE-UP\Projects\2026\q4"] { + for effect in [DropEffect::Copy, DropEffect::Move] { + assert_eq!( + plan(vec![dir.clone()], &p(dest), effect), + Err(Refused::IntoItself("projects".into())), + "{dest} {effect:?}" + ); + } + } + let sibling = p(r"C:\made-up\projects-old"); + assert_eq!(plan(vec![dir.clone()], &sibling, DropEffect::Move), Ok(Plan::Move(vec![dir.clone()]))); + let root = p(r"D:\"); + assert_eq!(plan(vec![root], &p(r"D:\backup"), DropEffect::Copy), Err(Refused::IntoItself("D:\\".into()))); + } + + #[test] + fn the_same_item_twice_is_refused() { + let a = p(r"C:\made-up\notes.txt"); + let again = p(r"C:\MADE-UP\Notes.TXT"); + let dest = p(r"C:\made-up\elsewhere"); + assert_eq!(plan(vec![a.clone(), again], &dest, DropEffect::Copy), Err(Refused::Twice("Notes.TXT".into()))); + assert_eq!(plan(vec![a.clone()], &dest, DropEffect::Copy), Ok(Plan::Copy(vec![a]))); + } + + #[test] + fn a_move_into_its_own_folder_changes_nothing_and_a_copy_is_a_copy() { + let dir = p(r"C:\made-up\documents"); + let a = p(r"C:\made-up\documents\notes.txt"); + let b = p(r"C:\made-up\other\plan.pdf"); + assert_eq!(plan(vec![a.clone()], &dir, DropEffect::Move), Ok(Plan::Nothing)); + assert_eq!(plan(vec![a.clone()], &p(r"c:\made-up\DOCUMENTS"), DropEffect::Move), Ok(Plan::Nothing)); + assert_eq!(plan(vec![a.clone(), b.clone()], &dir, DropEffect::Move), Ok(Plan::Move(vec![b])), "the others go"); + assert_eq!(plan(vec![a.clone()], &dir, DropEffect::Copy), Ok(Plan::Copy(vec![a])), "the shell names the copy"); + assert_eq!(plan(Vec::new(), &dir, DropEffect::Copy), Ok(Plan::Nothing)); + } + + #[test] + fn a_copy_keeps_the_items_already_in_the_destination_apart() { + let dir = p(r"C:\made-up\documents"); + let a = p(r"C:\made-up\documents\notes.txt"); + let b = p(r"C:\made-up\documents\2026\plan.pdf"); + let c = p(r"C:\MADE-UP\Documents\photo.png"); + assert_eq!(split_own(vec![a.clone(), b.clone(), c.clone()], &dir), (vec![a, c], vec![b])); + assert_eq!(split_own(Vec::new(), &dir), (Vec::new(), Vec::new())); + } + + #[test] + fn clipboard_paths_round_trip_and_odd_ones_are_refused() { + let items = vec![p("C:\\made-up\\f\u{f6}lder\\a.txt"), p(r"\\server\share\b.txt")]; + let clip = to_clip(&items); + assert_eq!(clip[0], PathBuf::from("C:\\made-up\\f\u{f6}lder\\a.txt")); + assert_eq!(from_clip(&clip), Ok(items)); + // A lone surrogate survives the round trip (NTFS allows it in a name). + let lone = WidePath::new(&[u16::from(b'C'), u16::from(b':'), u16::from(b'\\'), 0xD800]).unwrap(); + assert_eq!(from_clip(&to_clip(std::slice::from_ref(&lone))), Ok(vec![lone])); + for bad in [r"notes.txt", r"\\.\PhysicalDrive0", r"C:notes.txt", r"\\?\GLOBALROOT\x"] { + assert_eq!(from_clip(&[PathBuf::from(bad)]), Err(Refused::BadPath), "{bad}"); + } + } + + #[test] + fn items_of_a_recycle_bin_are_never_pasted() { + let dest = p(r"C:\made-up\b"); + for bin in [ + r"C:\$Recycle.Bin\S-1-5-21-1000-2000-3000-1001\$RAB12CD.docx", + r"D:\$RECYCLE.BIN\S-1-5-21-9\$RX1\inner.txt", + r"C:\$Recycle.Bin", + r"C:\$Recycle.Bin. \S-1-5-18\desktop.ini", + r"C:\made-up\mount\$recycle.bin\S-1-5-18\$R1.txt", + r"\\server\share\$Recycle.Bin\S-1-5-21\$R1.txt", + r"\\?\E:\$Recycle.Bin\S-1-5-21\$R2.txt", + "E:/$Recycle.Bin/S-1-5-21/$R3.txt", + ] { + let clip = [PathBuf::from(r"C:\made-up\a.txt"), PathBuf::from(bin)]; + for effect in [DropEffect::Copy, DropEffect::Move] { + let planned = from_clip(&clip).and_then(|items| plan(items, &dest, effect)); + assert_eq!(planned, Err(Refused::InBin), "{bin} {effect:?}"); + } + } + let ok = [r"C:\made-up\$Recycle.Bin.old\a.txt", r"C:\made-up\Recycle.Bin\a.txt", r"C:\made-up\$RAB12CD.docx"]; + for fine in ok { + assert!(from_clip(&[PathBuf::from(fine)]).is_ok(), "{fine}"); + } + } + + #[test] + fn cut_names_find_rows_by_folder_and_name() { + let names = CutNames::of(&[p(r"C:\made-up\a\notes.txt"), p(r"C:\made-up\b\plan.pdf")]); + assert!(names.has(&p(r"C:\made-up\a"), b"notes.txt")); + assert!(!names.has(&p(r"C:\made-up\b"), b"notes.txt"), "another folder"); + assert!(names.has(&p(r"C:\made-up\b"), b"plan.pdf")); + let mut st = ClipState::default(); + assert_eq!((st.serial(), st.names()), (0, None)); + st.set_cut(Some(Cut { items: vec![p(r"C:\made-up\a\notes.txt")], seq: 7 })); + assert_eq!(st.serial(), 1); + assert!(st.names().is_some_and(|n| n.has(&p(r"C:\made-up\a"), b"notes.txt"))); + st.set_cut(None); + assert_eq!((st.serial(), st.names(), st.cut()), (2, None, None)); + } +} diff --git a/apps/files/src/details_pane.rs b/apps/files/src/details_pane.rs new file mode 100644 index 00000000..270dc833 --- /dev/null +++ b/apps/files/src/details_pane.rs @@ -0,0 +1,899 @@ +//! The details pane at the right of the list: the art and name of what is selected, its type, a few facts and the +//! buttons that open it. Nothing selected shows the open folder; several items show the first one's art, a count, the +//! files' total size and the types. Everything comes from the listing the window already holds: no content is read +//! and no code of others runs in this process. A program's or a shortcut's own icon is asked of the shell host at 48 +//! px exactly and drawn at the size it came in, never enlarged. + +use std::rc::Rc; + +use oled_sys::i18n::S; +use oled_trust::frame::files::{CallKind, Gen, ItemRef, Location, ShellEvt, ShellReq}; +use oled_ui::art::Art; +use oled_ui::gfx::image::IconBitmap; +use oled_ui::model::{Align, ListModel, RowKey}; +use oled_ui::node::{Node, NodeId, Role, Text}; +use oled_ui::text::Trim; +use oled_ui::theme::Ink; +use oled_ui::widgets::{Button, ButtonKind, ButtonOut}; +use oled_ui::{Event, EventCx, LayoutCx, PaintCx, PointP, RectP, Reply, Scale, TypeRole, UiLang, Widget, WidgetId}; + +use crate::format::{Fmt, LocalTime}; +use crate::icons; +use crate::keys::Cmd; +use crate::listing::{TabId, WidePath}; +use crate::model::{id_of, push_wtf8_lossy}; +use crate::nav::Page; +use crate::services::ReqOwner; +use crate::shell::crumbs; +use crate::shell_client::ShellReply; +use crate::toolbar::place_name; +use crate::tr::{k, t, tf}; +use crate::types::TypeNames; +use crate::window::FilesScreen; + +/// Logical px: the pane's width, the window width below which it hides by itself, the padding, the card. +pub const PANE_W: i32 = 276; +pub const HIDE_BELOW: i32 = 960; +const PAD_X: i32 = 18; +const PAD_Y: i32 = 16; +const CARD_H: i32 = 150; +const CARD_R: i32 = 7; +const ART_PX: i32 = 64; +/// The Windows icon of a program or a shortcut, asked for at this size and never drawn larger. +pub const ICON_PX: i32 = 48; +const NAME_GAP: i32 = 14; +const KIND_GAP: i32 = 2; +const FACTS_GAP: i32 = 12; +const FACTS_PAD: i32 = 10; +const ROW_H: i32 = 24; +const BUTTONS_GAP: i32 = 16; +const BUTTON_GAP: i32 = 8; +const NAME_LINES: usize = 3; +const RIM_ALPHA: u32 = 20; +const KEY_GAP: i32 = 8; +const TYPES_SHOWN: usize = 3; +const TYPES_KEPT: usize = 16; + +const ID_PRIMARY: WidgetId = WidgetId(400); +const ID_SECOND: WidgetId = WidgetId(401); +const ID_PANE: WidgetId = WidgetId(402); + +/// The owner tab of the pane's icon request: no real tab has this id, so the table's own requests never see it as theirs. +pub const PANE_TAB: TabId = TabId(u32::MAX); + +const ATTR_READONLY: u32 = 0x1; +const ATTR_HIDDEN: u32 = 0x2; +const ATTR_SYSTEM: u32 = 0x4; +const ATTR_DIRECTORY: u32 = 0x10; + +/// The size of the Windows icon request in device px: 48 logical px exactly. +pub fn icon_request_px(scale: Scale) -> u16 { + u16::try_from(scale.px(ICON_PX)).unwrap_or(48) +} + +/// The side an icon that came in at `got` px is drawn at when the slot is `slot` px: never larger than it came. +pub fn icon_draw_px(got: u32, slot: u32) -> u32 { + got.min(slot) +} + +/// Whether the pane is on: the saved choice, a folder page, and a window at least HIDE_BELOW wide (logical px). +pub fn visible(saved: bool, folder_page: bool, window_logical_w: i32) -> bool { + saved && folder_page && window_logical_w >= HIDE_BELOW +} + +/// What the buttons under the facts are. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Buttons { + None, + /// Open and Open with. + File, + /// Open and Open in a new tab. + Folder, +} + +/// What the card draws. +#[derive(Clone, Debug, PartialEq)] +pub struct Content { + pub art: Art, + /// The path whose own Windows icon is wanted (programs and shortcuts), when there is one. + pub icon: Option, + pub title: String, + pub kind: String, + pub facts: Vec<(String, String)>, + pub buttons: Buttons, +} + +/// One item as the listing holds it. +#[derive(Clone, Debug)] +pub struct ItemData { + pub name: String, + pub ext: Vec, + pub is_dir: bool, + pub attrs: u32, + pub size: u64, + pub mtime: i64, + pub ctime: i64, +} + +/// "None", or "Hidden, Read-only, System" for the bits that are set. +pub fn attrs_text(attrs: u32, lang: UiLang) -> String { + let mut parts: Vec = Vec::new(); + for (bit, key) in [ + (ATTR_HIDDEN, k::FILES_PANE_ATTR_HIDDEN), + (ATTR_READONLY, k::FILES_PANE_ATTR_READONLY), + (ATTR_SYSTEM, k::FILES_PANE_ATTR_SYSTEM), + ] { + if attrs & bit != 0 { + parts.push(t(key, lang)); + } + } + if parts.is_empty() { + return t(k::FILES_PANE_ATTR_NONE, lang).into_owned(); + } + parts.iter().map(|p| &**p).collect::>().join(", ") +} + +fn fact(key: S, lang: UiLang, value: String) -> (String, String) { + (t(key, lang).into_owned(), value) +} + +/// The facts of one item: its size (files only), the times, the folder it is in and its attributes. +pub fn item_facts(it: &ItemData, parent: &str, fmt: &Fmt, now: LocalTime, lang: UiLang) -> Vec<(String, String)> { + let mut rows = Vec::new(); + if !it.is_dir { + rows.push(fact(k::FILES_PANE_SIZE, lang, fmt.size(it.size, false))); + } + rows.push(fact(k::FILES_PANE_MODIFIED, lang, fmt.modified(it.mtime, now, false))); + rows.push(fact(k::FILES_PANE_CREATED, lang, fmt.modified(it.ctime, now, false))); + rows.push(fact(k::FILES_PANE_FOLDER, lang, parent.to_string())); + rows.push(fact(k::FILES_PANE_ATTRIBUTES, lang, attrs_text(it.attrs, lang))); + rows +} + +/// The facts of the open folder when nothing is selected: its items, when it changed, its drive and the room left. +pub fn folder_facts( + items: u32, + mtime: Option, + drive: Option<(String, Option)>, + fmt: &Fmt, + now: LocalTime, + lang: UiLang, +) -> Vec<(String, String)> { + let mut rows = vec![fact(k::FILES_PANE_ITEMS, lang, fmt.count(u64::from(items)))]; + if let Some(ft) = mtime { + rows.push(fact(k::FILES_PANE_MODIFIED, lang, fmt.modified(ft, now, false))); + } + if let Some((name, free)) = drive { + let value = match free { + Some(f) => { + tf(k::FILES_PANE_DRIVE_FREE, lang, &[("name", &name), ("free", &fmt.size(f, false))]).into_owned() + } + None => name, + }; + rows.push(fact(k::FILES_PANE_DRIVE, lang, value)); + } + rows +} + +/// What several selected items add up to. +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct Totals { + pub count: usize, + pub files: usize, + pub folders: usize, + pub bytes: u64, + /// The type names in the order they were met, each once. + pub kinds: Vec, +} + +/// The facts of several items: the files' total size (with the folders counted aside) and the types. +pub fn many_facts(tot: &Totals, fmt: &Fmt, lang: UiLang) -> Vec<(String, String)> { + let mut rows = Vec::new(); + if tot.files > 0 { + let size = fmt.size(tot.bytes, false); + let value = match tot.folders { + 0 => size, + 1 => tf(k::FILES_PANE_PLUS_FOLDER, lang, &[("size", &size)]).into_owned(), + n => tf(k::FILES_PANE_PLUS_FOLDERS, lang, &[("size", &size), ("n", &fmt.count(n as u64))]).into_owned(), + }; + rows.push(fact(k::FILES_PANE_TOTAL_SIZE, lang, value)); + } + let shown: Vec<&str> = tot.kinds.iter().take(TYPES_SHOWN).map(String::as_str).collect(); + let mut types = shown.join(", "); + if tot.kinds.len() > TYPES_SHOWN { + let more = (tot.kinds.len() - TYPES_SHOWN).to_string(); + types = tf(k::FILES_PANE_TYPES_MORE, lang, &[("list", &types), ("n", &more)]).into_owned(); + } + rows.push(fact(k::FILES_PANE_TYPES, lang, types)); + rows +} + +/// The name cut into at most `max_lines` lines that fit `max_w`: whole lines break at the last space when there is one, +/// else at the character; what is left after the last whole line goes on the last line as it is, for the painter to +/// shorten in the middle. +pub fn break_lines(name: &str, max_w: i32, width: &mut dyn FnMut(&str) -> i32, max_lines: usize) -> Vec { + let mut lines: Vec = Vec::new(); + let mut rest = name; + while !rest.is_empty() && lines.len() + 1 < max_lines { + if width(rest) <= max_w { + break; + } + let bounds: Vec = rest.char_indices().map(|(i, c)| i + c.len_utf8()).collect(); + let (mut lo, mut hi) = (0usize, bounds.len()); + while lo < hi { + let mid = (lo + hi).div_ceil(2); + if width(&rest[..bounds[mid - 1]]) <= max_w { + lo = mid; + } else { + hi = mid - 1; + } + } + let fit = bounds.get(lo.max(1) - 1).copied().unwrap_or(rest.len()); + let cut = rest[..fit].rfind(' ').filter(|p| *p > 0).map_or(fit, |p| p + 1); + lines.push(rest[..cut].trim_end().to_string()); + rest = &rest[cut..]; + } + if !rest.is_empty() { + lines.push(rest.to_string()); + } + lines +} + +/// The pane's state: where the last layout put things, the buttons and the Windows icon of the shown item. +pub struct Pane { + shown: bool, + rect: RectP, + sep: RectP, + laid: Laid, + content: Option, + primary: Button, + second: Button, + /// The Windows icon that came for `icon.0`. + icon: Option<(WidePath, Rc)>, + /// The path the host was asked about last, and the generation of that request while it is on the wire. + asked: Option, + flight: Option, + art: Option<(Art, u32, Rc)>, + /// The open folder's time, by folder (read once per folder). + folder_time: Option<(WidePath, Option)>, + forced_time: Option, +} + +#[derive(Default)] +struct Laid { + card: RectP, + art: Option<(Rc, PointP, i32)>, + name: Vec<(String, RectP)>, + kind: RectP, + facts_sep: Option<(i32, i32, i32)>, + rows: Vec<(RectP, RectP)>, + primary: RectP, + second: RectP, +} + +impl std::fmt::Debug for Pane { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("Pane") + } +} + +impl Default for Pane { + fn default() -> Pane { + Pane::new() + } +} + +impl Pane { + pub fn new() -> Pane { + let e = || Text::Borrowed(""); + Pane { + shown: false, + rect: RectP::EMPTY, + sep: RectP::EMPTY, + laid: Laid::default(), + content: None, + primary: Button::new(ID_PRIMARY, e(), ButtonKind::Primary), + second: Button::new(ID_SECOND, e(), ButtonKind::Plate), + icon: None, + asked: None, + flight: None, + art: None, + folder_time: None, + forced_time: None, + } + } + + /// Whether the last layout showed the pane, and where. + pub fn shown(&self) -> bool { + self.shown + } + + pub fn rect(&self) -> RectP { + self.rect + } + + /// What the last layout drew (tests and scenes read it). + pub fn content(&self) -> Option<&Content> { + self.content.as_ref() + } + + /// The button rects of the last layout: the primary one and the second (empty when absent). + pub fn button_rects(&self) -> (RectP, RectP) { + (self.laid.primary, self.laid.second) + } + + /// The primary button's node: where F6 puts the keyboard. None when the pane has no button. + pub fn focus_node(&self) -> Option { + (!self.laid.primary.is_empty()).then(|| self.primary.node_id()) + } + + /// The path whose Windows icon the pane waits for, if any. + pub fn wants_icon(&self) -> Option<&WidePath> { + let want = self.content.as_ref()?.icon.as_ref()?; + (self.icon.as_ref().is_none_or(|(p, _)| p != want)).then_some(want) + } + + /// For scenes and tests: the time of the open folder, in place of the file system's. + pub fn force_folder_time(&mut self, ft: Option) { + self.forced_time = ft; + } + + /// For scenes and tests: hands the pane a Windows icon as the host would. + pub fn set_icon(&mut self, path: WidePath, px: u16, bgra: &[u8]) -> bool { + let n = usize::from(px) * usize::from(px); + if px == 0 || bgra.len() < n * 4 { + return false; + } + let pixels: Vec = + bgra.chunks_exact(4).take(n).map(|c| u32::from_le_bytes([c[0], c[1], c[2], c[3]])).collect(); + self.icon = Some((path, Rc::new(IconBitmap { width: u32::from(px), height: u32::from(px), pixels }))); + true + } + + /// The side the Windows icon is drawn at now (0: none), for tests. + pub fn icon_side(&self) -> u32 { + self.laid.art.as_ref().map_or(0, |(_, _, side)| *side as u32) + } +} + +/// The Windows icon the pane shows, if it is the one of the item shown. +fn own_icon<'a>(pane: &'a Pane, c: &Content) -> Option<&'a Rc> { + let (p, img) = pane.icon.as_ref()?; + (c.icon.as_ref() == Some(p)).then_some(img) +} + +fn type_name(shared: &crate::window::Shared, it: &ItemData, lang: UiLang) -> String { + if it.is_dir { + return t(k::FILES_PANE_TYPE_FOLDER, lang).into_owned(); + } + match if it.ext.is_empty() { None } else { shared.types.get(&it.ext) } { + Some(n) => n.to_string(), + None => TypeNames::fallback(&it.ext, lang), + } +} + +fn item_of(m: &crate::model::FilesTable, key: RowKey) -> Option { + let id = id_of(key); + let listing = m.listing(); + let e = listing.entry(id)?; + let mut name = String::new(); + push_wtf8_lossy(&mut name, listing.name(id)?); + Some(ItemData { + name, + ext: listing.ext(id).unwrap_or_default().to_ascii_lowercase(), + is_dir: e.attrs & ATTR_DIRECTORY != 0, + attrs: e.attrs, + size: e.size, + mtime: e.mtime, + ctime: e.ctime, + }) +} + +/// The drive of a folder on a lettered drive, as the cache knows it: its title and free bytes. +fn drive_of(s: &FilesScreen, p: &WidePath, lang: UiLang) -> Option<(String, Option)> { + let text = p.to_string_lossy(); + let b = text.as_bytes(); + if b.get(1) != Some(&b':') || !b.first()?.is_ascii_alphabetic() { + return None; + } + let letter = b[0].to_ascii_uppercase(); + let drives = s.shared.drives.borrow(); + let d = drives.all().iter().find(|d| d.letter == letter)?; + Some((crate::sidebar::drive_title(d, lang), d.free)) +} + +/// The time the file system holds for a folder (one read per folder; a path that cannot be read has none). +fn read_folder_time(p: &WidePath) -> Option { + use std::os::windows::fs::MetadataExt; + let md = std::fs::metadata(std::path::PathBuf::from(p.to_string_lossy())).ok()?; + i64::try_from(md.last_write_time()).ok().filter(|t| *t > 0) +} + +/// What the pane shows for the window now. +pub fn gather(s: &mut FilesScreen, lang: UiLang) -> Content { + let fmt = s.shared.fmt.borrow().clone(); + let now = s.shared.services.clock.local_now(); + let here = s.tabs.active().nav.location().clone(); + let folder_name = place_name(&here, lang); + let (selected, first_key, tot, first, dir) = { + let table = &s.tabs.active().table; + let m = table.model(); + let sel = table.selection(); + let n = sel.count(ListModel::len(m)); + let mut first_key: Option = None; + let mut tot = Totals { count: n, ..Totals::default() }; + let mut first: Option = None; + if n > 0 { + sel.for_each(m, &mut |_, key| { + let Some(it) = item_of(m, key) else { return }; + if first_key.is_none() { + first_key = Some(key); + } + if it.is_dir { + tot.folders += 1; + } else { + tot.files += 1; + tot.bytes += it.size; + } + if n > 1 && tot.kinds.len() < TYPES_KEPT { + let name = type_name(&s.shared, &it, lang); + if !tot.kinds.contains(&name) { + tot.kinds.push(name); + } + } + if first.is_none() { + first = Some(it); + } + }); + } + (n, first_key, tot, first, m.listing().dir().clone()) + }; + let known = s.shared.known.borrow().clone(); + let drives = s.shared.drives.borrow().all().to_vec(); + let path_of = |key: RowKey| s.tabs.active().table.model().path_of(key); + let single = match (first, first_key) { + (Some(it), Some(key)) if selected > 0 => Some((it, key)), + _ => None, + }; + let Some((it, key)) = single else { + let art = icons::location_art(&here, &known, &drives); + let mtime = folder_time(s, &dir); + let drive = drive_of(s, &dir, lang); + let items = ListModel::len(s.tabs.active().table.model()) as u32; + return Content { + art, + icon: None, + title: folder_name, + kind: t(k::FILES_PANE_TYPE_FOLDER, lang).into_owned(), + facts: folder_facts(items, mtime, drive, &fmt, now, lang), + buttons: Buttons::None, + }; + }; + let path = path_of(key); + let art = if it.is_dir { + path.as_ref().map_or(Art::Folder, |p| icons::place_art(p, &known, &drives)) + } else { + icons::file_art(&it.ext) + }; + if selected > 1 { + let title = tf(k::FILES_PANE_SELECTED, lang, &[("n", &fmt.count(selected as u64))]).into_owned(); + return Content { + art, + icon: None, + title, + kind: String::new(), + facts: many_facts(&tot, &fmt, lang), + buttons: Buttons::None, + }; + } + let icon = path.filter(|p| { + !it.is_dir + && icons::wants_item_icon(&it.ext, it.attrs, p.units()) + && !s.shared.services.shell.disabled(CallKind::Icon, &crumbs::ext_of(p)) + }); + Content { + art, + icon, + title: it.name.clone(), + kind: type_name(&s.shared, &it, lang), + facts: item_facts(&it, &folder_name, &fmt, now, lang), + buttons: if it.is_dir { Buttons::Folder } else { Buttons::File }, + } +} + +fn folder_time(s: &mut FilesScreen, dir: &WidePath) -> Option { + if let Some(ft) = s.pane.forced_time { + return Some(ft); + } + if let Some((d, ft)) = &s.pane.folder_time { + if d == dir { + return *ft; + } + } + let ft = read_folder_time(dir); + s.pane.folder_time = Some((dir.clone(), ft)); + ft +} + +/// The pane's place at the right of `body`; returns the rest for the list. A hidden pane leaves `body` whole. +pub fn layout(s: &mut FilesScreen, cx: &mut LayoutCx, body: RectP, window_w: i32) -> RectP { + let page = s.tabs.active().nav.page(); + let folder_page = + matches!(page, Page::Listing | Page::Empty | Page::Loading { .. } | Page::Busy | Page::StillLoading) + && matches!(s.tabs.active().nav.location(), Location::Fs(_)); + let saved = s.shared.opts.borrow().details_pane; + let on = visible(saved, folder_page, cx.scale().logical(window_w)); + s.pane.shown = on; + s.pane.laid = Laid::default(); + s.pane.content = None; + if !on { + s.pane.rect = RectP::EMPTY; + s.pane.sep = RectP::EMPTY; + return body; + } + let w = cx.px(PANE_W).min(body.w()); + let rect = RectP { l: body.r - w, ..body }; + let sep_w = cx.px(1).max(1); + s.pane.rect = rect; + s.pane.sep = RectP { r: rect.l + sep_w, ..rect }; + let lang = s.shared.lang.get(); + let content = gather(s, lang); + lay_out(s, cx, rect, &content); + s.pane.content = Some(content); + RectP { r: rect.l, ..body } +} + +fn lay_out(s: &mut FilesScreen, cx: &mut LayoutCx, rect: RectP, c: &Content) { + let lang = s.shared.lang.get(); + let sep_w = cx.px(1).max(1); + // The pane's node goes first: the buttons laid out after it are on top of it for the pointer. + cx.push(Node::new(NodeId::new(ID_PANE, 0), Role::Pane, rect).label(t(k::FILES_PANE_NAME, lang)).description( + Text::Owned(if c.kind.is_empty() { c.title.clone() } else { format!("{}, {}", c.title, c.kind) }), + )); + let inner = RectP { + l: rect.l + sep_w + cx.px(PAD_X) - sep_w, + r: rect.r - cx.px(PAD_X), + t: rect.t + cx.px(PAD_Y), + b: rect.b, + }; + let mut laid = Laid::default(); + // The card, with the art or the Windows icon centred in it. + let card = RectP { b: inner.t + cx.px(CARD_H), ..inner }; + laid.card = card; + let device = |v: i32| u32::try_from(cx.px(v)).unwrap_or(0); + let own = own_icon(&s.pane, c).cloned(); + let (img, side) = match own { + Some(img) => { + let side = i32::try_from(icon_draw_px(img.width, device(ICON_PX))).unwrap_or(0); + (Some(img), side) + } + None => { + let px = device(ART_PX); + let cached = s.pane.art.as_ref().filter(|(a, p, _)| *a == c.art && *p == px).map(|(_, _, i)| Rc::clone(i)); + let img = cached.unwrap_or_else(|| { + let made = s.art.shared(c.art, px); + s.pane.art = Some((c.art, px, Rc::clone(&made))); + made + }); + (Some(img), i32::try_from(px).unwrap_or(0)) + } + }; + if let Some(img) = img { + let side = side.min(card.w()).min(card.h()); + let at = PointP { x: card.l + (card.w() - side) / 2, y: card.t + (card.h() - side) / 2 }; + laid.art = Some((img, at, side)); + } + // The name: up to three lines, the last shortened in the middle. + let mut y = card.b + cx.px(NAME_GAP); + let role = TypeRole::Subtitle; + let line_h = cx.px(role.spec().line); + let font = cx.font(role); + let lines = break_lines(&c.title, inner.w(), &mut |text| cx.text().width(text, font), NAME_LINES); + for line in lines { + let r = RectP { l: inner.l, r: inner.r, t: y, b: y + line_h }; + laid.name.push((line, r)); + y += line_h; + } + y += cx.px(KIND_GAP); + if !c.kind.is_empty() { + let h = cx.px(TypeRole::Caption.spec().line); + laid.kind = RectP { l: inner.l, r: inner.r, t: y, b: y + h }; + y += h; + } + // The facts: a rule above, padding, rows of 24. + y += cx.px(FACTS_GAP); + laid.facts_sep = Some((inner.l, inner.r, y)); + y += cx.px(FACTS_PAD); + let row_h = cx.px(ROW_H); + let cap_font = cx.font(TypeRole::Caption); + for (key, _) in &c.facts { + let kw = cx.text().width(key, cap_font).min(inner.w()); + let key_r = RectP { l: inner.l, r: inner.l + kw, t: y, b: y + row_h }; + let val_r = RectP { l: (inner.l + kw + cx.px(KEY_GAP)).min(inner.r), r: inner.r, t: y, b: y + row_h }; + laid.rows.push((key_r, val_r)); + y += row_h; + } + // The buttons. + let (primary, second) = (&mut s.pane.primary, &mut s.pane.second); + if c.buttons != Buttons::None { + y += cx.px(BUTTONS_GAP); + let h = cx.px(cx.tokens().size.click_h); + let gap = cx.px(BUTTON_GAP); + primary.set_label(t(k::FILES_MENU_OPEN, lang)); + *second = match c.buttons { + Buttons::Folder => Button::new(ID_SECOND, t(k::FILES_MENU_OPEN_NEW_TAB, lang), ButtonKind::Plate), + _ => Button::new(ID_SECOND, t(k::FILES_PANE_OPEN_WITH, lang), ButtonKind::Plate).with_chevron(), + }; + let second_w = second.preferred(cx).w; + let min_primary = cx.px(88); + if c.buttons == Buttons::Folder && second_w + gap + min_primary > inner.w() { + laid.primary = RectP { l: inner.l, r: inner.r, t: y, b: y + h }; + laid.second = RectP { l: inner.l, r: inner.r, t: y + h + gap, b: y + 2 * h + gap }; + } else { + let sw = second_w.min(inner.w() - gap - min_primary); + laid.second = RectP { l: inner.r - sw, r: inner.r, t: y, b: y + h }; + laid.primary = RectP { l: inner.l, r: laid.second.l - gap, t: y, b: y + h }; + } + primary.layout(cx, laid.primary); + second.layout(cx, laid.second); + } + s.pane.laid = laid; +} + +/// The pane, the separator on its left and the buttons. +pub fn paint(s: &FilesScreen, cx: &mut PaintCx) { + let p = &s.pane; + let Some(c) = p.content.as_ref().filter(|_| p.shown) else { return }; + let tk = cx.tokens().color.clone(); + let hot = if cx.tokens().high_contrast { tk.fg_primary } else { tk.fg_hot }; + let rim = Ink { a: RIM_ALPHA, ..tk.fg_primary }; + let one = cx.px(1).max(1); + let (rect, sep) = (p.rect, p.sep); + let laid = &p.laid; + let (primary, second) = (&p.primary, &p.second); + cx.with_clip(rect, &mut |cx| { + cx.fill(sep, 0, tk.separator); + cx.stroke(laid.card, cx.px(CARD_R), one, rim); + if let Some((img, at, side)) = &laid.art { + cx.image(img, *at, *side, 255); + } + let last = laid.name.len().saturating_sub(1); + for (i, (line, r)) in laid.name.iter().enumerate() { + let trim = if i == last { Trim::Middle { tail: 10 } } else { Trim::None }; + cx.text_in(line, TypeRole::Subtitle, *r, Align::Start, trim, hot); + } + if !c.kind.is_empty() { + cx.text_in(&c.kind, TypeRole::Caption, laid.kind, Align::Start, Trim::End, tk.fg_secondary); + } + if let Some((l, r, y)) = laid.facts_sep { + cx.fill(RectP { l, r, t: y, b: y + one }, 0, tk.separator); + } + for ((key, value), (key_r, val_r)) in c.facts.iter().zip(&laid.rows) { + cx.text_in(key, TypeRole::Caption, *key_r, Align::Start, Trim::End, tk.fg_tertiary); + cx.text_in(value, TypeRole::Caption, *val_r, Align::End, Trim::End, tk.fg_primary); + } + if !laid.primary.is_empty() { + primary.paint(cx); + second.paint(cx); + } + }); +} + +/// The buttons' clicks: Open, and Open with (the system's choice) or Open in a new tab. +pub fn event(s: &mut FilesScreen, cx: &mut EventCx, ev: &Event) -> Option { + if !s.pane.shown || s.pane.laid.primary.is_empty() { + return None; + } + if let Some(ButtonOut::Clicked) = s.pane.primary.event(cx, ev) { + return Some(crate::keys::run(s, cx, Cmd::Open)); + } + if let Some(ButtonOut::Clicked) = s.pane.second.event(cx, ev) { + let folder = matches!(s.pane.content.as_ref().map(|c| c.buttons), Some(Buttons::Folder)); + return Some(if folder { + crate::keys::run(s, cx, Cmd::OpenNewTab) + } else { + crate::menu::on_pick(s, cx, oled_ui::CommandId(crate::menu::pick::OPEN_WITH)) + }); + } + None +} + +/// Alt+Shift+P and the Details button: the saved choice flips, in every window. +pub fn cmd(s: &mut FilesScreen, _cx: &mut EventCx, c: Cmd) -> Reply { + if c != Cmd::DetailsPane { + return Reply::None; + } + let on = !s.shared.opts.borrow().details_pane; + s.shared.services.options.modify(&mut |o| o.details_pane = on); + let now = s.shared.services.options.get(); + *s.shared.opts.borrow_mut() = now; + crate::window::bump_all(&s.shared); + Reply::Relayout +} + +/// Whether the pane is on for a window `window_w` logical px wide, as the Details button shows it. +pub fn is_on(s: &FilesScreen, window_w: i32) -> bool { + let page = s.tabs.active().nav.page(); + let folder_page = + matches!(page, Page::Listing | Page::Empty | Page::Loading { .. } | Page::Busy | Page::StillLoading) + && matches!(s.tabs.active().nav.location(), Location::Fs(_)); + visible(s.shared.opts.borrow().details_pane, folder_page, window_w) +} + +/// After a layout: asks the shell host for the Windows icon of the item shown, once per item. Nothing before the first +/// frame or before the host is warm (the rows' own requests wait the same way). +pub fn ask_icon(s: &mut FilesScreen, px: u16) { + let shared = Rc::clone(&s.shared); + if !shared.first_frame_done.get() || !shared.host_warm.get() { + return; + } + let Some(path) = s.pane.wants_icon().cloned() else { return }; + if s.pane.asked.as_ref() == Some(&path) { + return; + } + let gen = Gen(shared.next_req.get() + 1); + shared.next_req.set(gen.0); + let shell = &shared.services.shell; + let req = shell.next_req(); + shared.req_owner.borrow_mut().insert(req, ReqOwner::Icons { win: s.win, tab: PANE_TAB, gen }); + shell.request(ShellReq::Icons { req, gen, items: vec![ItemRef::Path(path.clone())], px }); + s.pane.asked = Some(path); + s.pane.flight = Some(gen); +} + +/// A reply of the pane's own Icons request. +pub fn on_icon_reply(s: &mut FilesScreen, cx: &mut EventCx, owner: ReqOwner, reply: &ShellReply) { + let ReqOwner::Icons { gen, .. } = owner else { return }; + if s.pane.flight != Some(gen) { + return; + } + match reply { + ShellReply::Evt(ShellEvt::Icon { gen: g, px, .. }) if *g == gen => { + if px.w == 0 || px.w != px.h { + return; + } + if let Some(path) = s.pane.asked.clone() { + if s.pane.set_icon(path, px.w, &px.bgra[..]) { + cx.relayout(); + } + } + } + ShellReply::Evt(ShellEvt::ReqDone { .. } | ShellEvt::Failed { .. }) | ShellReply::Fallback { .. } => { + s.pane.flight = None; + } + ShellReply::Evt(_) => {} + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn en() -> UiLang { + UiLang::EN + } + + fn it() -> UiLang { + UiLang::IT + } + + fn at() -> LocalTime { + LocalTime { year: 2026, month: 11, day: 21, hour: 14, minute: 40 } + } + + fn doc() -> ItemData { + ItemData { + name: "report.docx".into(), + ext: b"docx".to_vec(), + is_dir: false, + attrs: 0x20, + size: 1_240_000, + mtime: crate::fakes::FT_2026_11_21, + ctime: crate::fakes::FT_2026_11_21 - 864_000_000_000, + } + } + + #[test] + fn attributes_name_the_bits_in_both_languages() { + assert_eq!(attrs_text(0x20, en()), "None"); + assert_eq!(attrs_text(0x20, it()), "Nessuno"); + assert_eq!(attrs_text(ATTR_HIDDEN | ATTR_READONLY | 0x20, en()), "Hidden, Read-only"); + assert_eq!(attrs_text(ATTR_HIDDEN | ATTR_READONLY, it()), "Nascosto, Sola lettura"); + assert_eq!(attrs_text(ATTR_SYSTEM, it()), "Sistema"); + } + + #[test] + fn a_file_has_five_facts_a_folder_four() { + let f = item_facts(&doc(), "Projects", &Fmt::fixed_en(), at(), en()); + let keys: Vec<&str> = f.iter().map(|r| r.0.as_str()).collect(); + assert_eq!(keys, ["Size", "Last modified", "Created", "Folder", "Attributes"]); + assert_eq!(f[3].1, "Projects"); + let f = item_facts(&doc(), "Progetti", &Fmt::fixed_it(), at(), it()); + let keys: Vec<&str> = f.iter().map(|r| r.0.as_str()).collect(); + assert_eq!(keys, ["Dimensione", "Ultima modifica", "Creato", "Cartella", "Attributi"]); + let dir = ItemData { is_dir: true, ..doc() }; + let f = item_facts(&dir, "Progetti", &Fmt::fixed_it(), at(), it()); + assert_eq!(f.len(), 4, "a folder has no size here"); + assert_eq!(f[0].0, "Ultima modifica"); + } + + #[test] + fn the_open_folder_says_its_items_time_and_drive() { + let f = folder_facts( + 15, + Some(crate::fakes::FT_2026_11_21), + Some(("System (C:)".into(), Some(412_000_000_000))), + &Fmt::fixed_en(), + at(), + en(), + ); + let keys: Vec<&str> = f.iter().map(|r| r.0.as_str()).collect(); + assert_eq!(keys, ["Items", "Last modified", "Drive"]); + assert_eq!(f[0].1, "15"); + assert!(f[2].1.starts_with("System (C:), ") && f[2].1.ends_with(" free"), "{}", f[2].1); + let f = folder_facts(1, None, None, &Fmt::fixed_it(), at(), it()); + assert_eq!(f.len(), 1, "a time or a drive that is not known leaves its row out"); + assert_eq!(f[0].0, "Elementi"); + } + + #[test] + fn several_items_add_up_files_and_name_the_folders_aside() { + let tot = Totals { + count: 4, + files: 2, + folders: 2, + bytes: 3_000_000, + kinds: vec!["Folder".into(), "PDF File".into()], + }; + let f = many_facts(&tot, &Fmt::fixed_en(), en()); + assert_eq!((f[0].0.as_str(), f[1].0.as_str()), ("Total size", "Types")); + assert!(f[0].1.ends_with(", plus 2 folders"), "{}", f[0].1); + let f = many_facts(&tot, &Fmt::fixed_it(), it()); + assert!(f[0].1.ends_with(", più 2 cartelle"), "{}", f[0].1); + assert_eq!(f[1].1, "Folder, PDF File"); + let one = Totals { folders: 1, ..tot.clone() }; + assert!(many_facts(&one, &Fmt::fixed_it(), it())[0].1.ends_with(", più 1 cartella")); + let only = Totals { files: 0, bytes: 0, folders: 3, count: 3, kinds: vec!["Cartella".into()] }; + let f = many_facts(&only, &Fmt::fixed_it(), it()); + assert_eq!(f.len(), 1, "folders have no total size"); + let kinds: Vec = (0..5).map(|i| format!("T{i}")).collect(); + let many = Totals { kinds, files: 5, count: 5, ..Totals::default() }; + assert_eq!(many_facts(&many, &Fmt::fixed_en(), en())[1].1, "T0, T1, T2 and 2 more"); + } + + fn width(s: &str) -> i32 { + s.chars().count() as i32 + } + + #[test] + fn a_long_name_takes_three_lines_and_leaves_the_rest_for_the_middle_ellipsis() { + let name = "contract draft for the apartment on the long street 07 with all the annexes and the signatures of everyone.docx"; + let lines = break_lines(name, 20, &mut |s| width(s), 3); + assert_eq!(lines.len(), 3); + assert!(lines[0].chars().count() <= 20 && lines[1].chars().count() <= 20); + assert!(lines[2].chars().count() > 20, "the last line keeps what is left for the painter to shorten"); + assert_eq!(break_lines("short.txt", 20, &mut |s| width(s), 3), ["short.txt"]); + let one_word = "x".repeat(50); + let lines = break_lines(&one_word, 20, &mut |s| width(s), 3); + assert_eq!((lines[0].len(), lines[1].len(), lines[2].len()), (20, 20, 10)); + assert!(break_lines("", 20, &mut |s| width(s), 3).is_empty()); + } + + #[test] + fn the_windows_icon_is_asked_at_48_logical_px_and_never_enlarged() { + assert_eq!(icon_request_px(Scale { dpi: 96 }), 48); + assert_eq!(icon_request_px(Scale { dpi: 144 }), 72); + assert_eq!(icon_request_px(Scale { dpi: 192 }), 96); + assert_eq!(icon_draw_px(48, 48), 48); + assert_eq!(icon_draw_px(32, 48), 32, "a smaller icon stays as small as it came"); + assert_eq!(icon_draw_px(256, 48), 48); + } + + #[test] + fn the_pane_hides_under_960_and_on_pages_without_a_folder() { + assert!(visible(true, true, 960)); + assert!(!visible(true, true, 959)); + assert!(!visible(false, true, 1600)); + assert!(!visible(true, false, 1600)); + } +} diff --git a/apps/files/src/fakes.rs b/apps/files/src/fakes.rs index 35677793..c2e177f9 100644 --- a/apps/files/src/fakes.rs +++ b/apps/files/src/fakes.rs @@ -19,7 +19,8 @@ use crate::format::LocalTime; use crate::hub::{Collect, Hub}; use crate::listing::{ natural_cmp, Anchor, ApplyStats, Batch, BatchSink, CancelToken, Diff, Entry, EntryId, EntryStore, EnumError, - EnumJob, Gen, GroupBy, IdMap, RawEntry, SortDir, SortDone, SortJob, SortKey, TabId, Visibility, WidePath, + EnumJob, Gen, GroupBy, IdMap, RawEntry, SortDir, SortDone, SortJob, SortKey, TabId, ViewFilter, Visibility, + WidePath, }; use crate::model::Listing; use crate::msg::Msg; @@ -107,9 +108,12 @@ impl Fakes { } } - /// Shared::new over services(), an empty session and no type names. + /// Shared::new over services(), an empty session and no type names; no known folders, and Windows on C: (the + /// made-up drives' system drive) whatever machine runs it. pub fn shared(&self, lang: UiLang) -> Rc { - Shared::new(Arc::clone(&self.hub), self.services(), lang, Session::default(), TypeNames::empty()) + let shared = Shared::new(Arc::clone(&self.hub), self.services(), lang, Session::default(), TypeNames::empty()); + *shared.known.borrow_mut() = Rc::new(crate::knownfolders::KnownFolders::new(Vec::new(), Some(b'C'))); + shared } /// Another window's Collect, attached to the hub. @@ -232,6 +236,7 @@ pub struct FakeListing { key: SortKey, sdir: SortDir, vis: Visibility, + view: ViewFilter, dead: u32, asked: Cell>, } @@ -259,6 +264,7 @@ impl FakeListing { key: SortKey::Name, sdir: SortDir::Asc, vis: Visibility::default(), + view: ViewFilter::default(), dead: 0, asked: Cell::new(None), } @@ -289,12 +295,21 @@ impl FakeListing { self.slots.iter().enumerate().filter(|(_, s)| s.is_some()).map(|(i, _)| EntryId(i as u32)) } - fn visible(&self, s: &Slot) -> bool { + fn visible_base(&self, s: &Slot) -> bool { let hidden = s.e.attrs & ATTR_HIDDEN != 0; let system = hidden && s.e.attrs & ATTR_SYSTEM != 0; (!hidden || self.vis.hidden) && (!system || self.vis.protected_system) } + fn visible(&self, s: &Slot) -> bool { + if !self.visible_base(s) { + return false; + } + let q = crate::listing::filter::fold_search(self.view.query.as_bytes()); + let named = q.is_empty() || crate::listing::filter::fold_search(&s.name).windows(q.len()).any(|w| w == q); + named && self.view.families.passes(crate::listing::family_of(s.e.attrs & ATTR_DIR != 0, &s.ext)) + } + fn cmp(&self, a: EntryId, b: EntryId) -> Ordering { let (Some(x), Some(y)) = (self.slot(a), self.slot(b)) else { return a.cmp(&b) }; let (dx, dy) = (x.e.attrs & ATTR_DIR != 0, y.e.attrs & ATTR_DIR != 0); @@ -444,6 +459,13 @@ impl Listing for FakeListing { self.vis = v; self.rebuild(); } + fn set_view_filter(&mut self, v: ViewFilter) { + self.view = v; + self.rebuild(); + } + fn unfiltered_len(&self) -> u32 { + self.slots.iter().flatten().filter(|s| self.visible_base(s)).count() as u32 + } fn needs_compact(&self) -> bool { self.dead > 64 && self.dead as usize > self.order.len() } @@ -599,6 +621,8 @@ impl EnumService for FakeEnum { /// One call of FakeOps. #[derive(Clone, Debug, PartialEq, Eq)] pub enum OpsCall { + Copy(Vec, WidePath), + Move(Vec, WidePath), Recycle(Vec), DeletePermanent(Vec), Rename(WidePath, String), @@ -657,6 +681,12 @@ impl FakeOps { } impl OpsService for FakeOps { + fn copy(&self, items: &[ItemRef], dest: &WidePath) -> Result { + self.mutate(OpsCall::Copy(items.to_vec(), dest.clone())) + } + fn move_to(&self, items: &[ItemRef], dest: &WidePath) -> Result { + self.mutate(OpsCall::Move(items.to_vec(), dest.clone())) + } fn recycle(&self, items: &[ItemRef]) -> Result { self.mutate(OpsCall::Recycle(items.to_vec())) } diff --git a/apps/files/src/gate.rs b/apps/files/src/gate.rs index a38a1b63..a2ed4f3c 100644 --- a/apps/files/src/gate.rs +++ b/apps/files/src/gate.rs @@ -1,7 +1,11 @@ -//! The real-data gate (P3-files-app U2, F3.1). Until the FS-3 rows a to c are recorded, the window changes files only -//! inside the test and live roots under %TEMP% (P1-files-engine's TempRoot and LiveRoot): every item and destination -//! must lie in %TEMP%\mod-files-live-* or %TEMP%\mod-files-test-*, and no component from that root down to the item -//! may be a reparse point. The orchestrator flips REAL_DATA_MUTATIONS in its own reviewed commit. +//! The real-data gate. REAL_DATA_MUTATIONS is on: every change the window asks for goes to the operations host, which +//! refuses the places it never changes (a volume's root, the Windows and program folders, the folders Windows keeps +//! at a volume's root, and the kept folders: ops/places.rs), the items the user's rights do not allow (before +//! IFileOperation, so no elevation prompt) and, in a debug build, everything outside FILES_TEST_ROOT. A permanent +//! delete still asks on the bar first. With the switch off, the window changes files only inside the test and live +//! roots under %TEMP%: every item and destination must lie in %TEMP%\mod-files-live-* or %TEMP%\mod-files-test-*, +//! and no component from that root down to the item may be a reparse point; the commands stay visible, disabled, +//! and their keys show the not-available notice. The switch is flipped, and reverted, in a commit of its own. use windows::core::PCWSTR; use windows::Win32::Globalization::{CompareStringOrdinal, CSTR_EQUAL}; @@ -11,8 +15,13 @@ use windows::Win32::Storage::FileSystem::{ use crate::listing::WidePath; -/// False until FS-3 rows a to c are recorded and their constants set (SPEC-files 8.1). -pub const REAL_DATA_MUTATIONS: bool = false; +/// On once the disposable job's records of the recycle classes, the conflict dialog and the mutations are green. +pub const REAL_DATA_MUTATIONS: bool = true; + +/// On once the clipboard operations (Cut, Copy and Paste of files) have their recorded proofs on the disposable volumes +/// (disposable/paste.json). While it is false the three commands stay on the bar, disabled, and their chords show the +/// not-available notice. It is flipped, and reverted, in a commit of its own. +pub const PASTE_LIVE: bool = true; /// The roots' name prefixes (P1-files-engine D2). const ROOT_PREFIXES: [&str; 2] = ["mod-files-live-", "mod-files-test-"]; @@ -30,6 +39,46 @@ pub fn may_mutate(paths: &[&WidePath]) -> bool { } } +/// may_mutate for the UI thread: a path that cannot lie in a root by its text alone (not under TEMP in its short or +/// long form, then a root-named folder) is refused by a string comparison, with no disk access; only a path that has +/// the shape of a root goes on to the gate's reads. (A share or a disconnected drive would block the thread.) +pub fn may_mutate_quick(paths: &[&WidePath]) -> bool { + if REAL_DATA_MUTATIONS { + return !paths.is_empty(); + } + static TEMPS: std::sync::OnceLock> = std::sync::OnceLock::new(); + let temps = TEMPS.get_or_init(|| { + let mut v = Vec::new(); + if let Ok(t) = WidePath::parse(&std::env::temp_dir().to_string_lossy()) { + if let Some(l) = long_path(&t) { + v.push(l); + } + v.push(t); + } + v + }); + match WidePath::parse(&std::env::temp_dir().to_string_lossy()) { + Ok(temp) => may_mutate_quick_with(paths, temps, &temp, &attrs_of, &long_of), + Err(_) => false, + } +} + +/// The seam of may_mutate_quick: the text prefilter, then may_mutate_with. +pub fn may_mutate_quick_with( + paths: &[&WidePath], + temps: &[WidePath], + temp: &WidePath, + attrs: &dyn Fn(&WidePath) -> Option, + long: &dyn Fn(&WidePath) -> Option, +) -> bool { + may_have_root_shape(paths, temps) && may_mutate_with(paths, temp, attrs, long) +} + +/// The pure prefilter of may_mutate_quick: every path starts with one of the TEMP forms and a root-named folder. +pub fn may_have_root_shape(paths: &[&WidePath], temps: &[WidePath]) -> bool { + !paths.is_empty() && paths.iter().all(|p| temps.iter().any(|t| root_shape(p.units(), t.units()).is_some())) +} + /// The pure core. TMP may be an 8.3 form, so `temp` is compared in its long form too. Every path, in its long form, /// must lie under `temp` in a root named mod-files-live-* or /// mod-files-test-* (compared ordinally, ignoring case), and that root and every existing component below it down to @@ -54,16 +103,17 @@ fn starts_ci(s: &[u16], prefix: &[u16]) -> bool { s.get(..prefix.len()).is_some_and(|head| same_ci(head, prefix)) } -fn inside_a_root(q: &WidePath, temp: &WidePath, attrs: &dyn Fn(&WidePath) -> Option) -> bool { - let (units, t) = (q.units(), temp.units()); +/// The text after TEMP and its separator when the path starts with TEMP and the next component is named like a root +/// (mod-files-live-* or mod-files-test-*), with the length of that component. Pure: no disk is read. +fn root_shape<'a>(units: &'a [u16], t: &[u16]) -> Option<(&'a [u16], usize)> { if !starts_ci(units, t) { - return false; + return None; } // After TEMP: one separator (already in TEMP when it is a drive root), then the root component. let rest = match units.get(t.len()..) { Some(r) if t.last() == Some(&BS) => r, Some([sep, r @ ..]) if *sep == BS => r, - _ => return false, + _ => return None, }; let root_len = rest.iter().position(|&u| u == BS).unwrap_or(rest.len()); let root = rest.get(..root_len).unwrap_or_default(); @@ -71,9 +121,14 @@ fn inside_a_root(q: &WidePath, temp: &WidePath, attrs: &dyn Fn(&WidePath) -> Opt let p: Vec = p.encode_utf16().collect(); root.len() > p.len() && starts_ci(root, &p) }); - if !named { + named.then_some((rest, root_len)) +} + +fn inside_a_root(q: &WidePath, temp: &WidePath, attrs: &dyn Fn(&WidePath) -> Option) -> bool { + let units = q.units(); + let Some((rest, root_len)) = root_shape(units, temp.units()) else { return false; - } + }; // The root and every component below it, down to the item: no reparse point among those that exist. let first = units.len() - rest.len() + root_len; let mut ends: Vec = diff --git a/apps/files/src/home.rs b/apps/files/src/home.rs index a79c7b50..0ffd6355 100644 --- a/apps/files/src/home.rs +++ b/apps/files/src/home.rs @@ -2,15 +2,17 @@ //! places and the two hand-offs, in one scrollable page. One Tab stop per section, the arrows rove inside it. use oled_trust::frame::files::Location; +use oled_ui::art::Art; use oled_ui::model::Align; use oled_ui::node::{Actions, Focusable, Node, NodeFlags, NodeId, Role, Text}; use oled_ui::text::{LayoutOpts, Trim}; use oled_ui::theme::TypeRole; use oled_ui::widgets::{ScrollBar, ScrollOut}; -use oled_ui::{Event, EventCx, Glyph, Key, LayoutCx, MouseButton, PaintCx, PointP, RectP, Reply, Widget, WidgetId}; +use oled_ui::{Event, EventCx, Key, LayoutCx, MouseButton, PaintCx, PointP, RectP, Reply, Widget, WidgetId}; use crate::drives::{DriveInfo, DriveKind}; use crate::handoff::{self, Target}; +use crate::icons; use crate::keys::Cmd; use crate::listing::WidePath; use crate::pins; @@ -55,7 +57,8 @@ pub enum Shape { pub struct HItem { pub section: u8, pub shape: Shape, - pub glyph: Glyph, + /// Its art: a folder's by its path, a drive's by its kind, the places' own. + pub art: Art, pub label: String, /// The label's lines of a tile, with their widths (physical px). lines: Vec<(String, i32)>, @@ -137,11 +140,13 @@ pub fn content(s: &FilesScreen) -> Vec { let lang = shared.lang.get(); let fmt = shared.fmt.borrow().clone(); let like = shared.opts.borrow().sizes_like_explorer; + let known = shared.known.borrow(); + let drives = shared.drives.borrow(); let mut out = Vec::new(); - let blank = |section: u8, shape: Shape, glyph: Glyph, label: String, go: Go| HItem { + let blank = |section: u8, shape: Shape, art: Art, label: String, go: Go| HItem { section, shape, - glyph, + art, label, lines: Vec::new(), detail: None, @@ -151,31 +156,32 @@ pub fn content(s: &FilesScreen) -> Vec { rect: RectP::EMPTY, }; for p in pins::paths(shared) { - let mut it = blank(0, Shape::Tile, Glyph::Folder, place_name(&p), Go::Folder(p.clone())); + let art = icons::place_art(&p, &known, drives.all()); + let mut it = blank(0, Shape::Tile, art, place_name(&p), Go::Folder(p.clone())); it.disabled = s.side.is_missing(&p); out.push(it); } - let drives = shared.drives.borrow(); + let system = known.system_drive(); for d in drives.all().iter().filter(|d| d.kind != DriveKind::Network) { - out.push(drive_item(d, 1, lang, &fmt, like)); + out.push(drive_item(d, 1, lang, &fmt, like, system)); } for d in drives.all().iter().filter(|d| d.kind == DriveKind::Network) { - out.push(drive_item(d, 2, lang, &fmt, like)); + out.push(drive_item(d, 2, lang, &fmt, like, system)); } for p in sidebar::network_places(shared) { - out.push(blank(2, Shape::Row, Glyph::Network, p.to_string_lossy(), Go::Folder(p))); + out.push(blank(2, Shape::Row, Art::DriveNetwork, p.to_string_lossy(), Go::Folder(p))); } out.push(blank( 3, Shape::Row, - Glyph::Delete, + Art::RecycleBin, t(k::FILES_SIDE_RECYCLE_BIN, lang).into_owned(), Go::Handoff(Target::RecycleBin), )); out.push(blank( 3, Shape::Row, - Glyph::Monitor, + Art::ThisPc, t(k::FILES_HOME_PHONES, lang).into_owned(), Go::Handoff(Target::ThisPc), )); @@ -183,7 +189,14 @@ pub fn content(s: &FilesScreen) -> Vec { out } -fn drive_item(d: &DriveInfo, section: u8, lang: oled_ui::UiLang, fmt: &crate::format::Fmt, like: bool) -> HItem { +fn drive_item( + d: &DriveInfo, + section: u8, + lang: oled_ui::UiLang, + fmt: &crate::format::Fmt, + like: bool, + system: Option, +) -> HItem { let net = d.kind == DriveKind::Network; let detail = match (d.free, d.total, net || !d.ready) { (Some(f), Some(t), false) => Some( @@ -201,7 +214,7 @@ fn drive_item(d: &DriveInfo, section: u8, lang: oled_ui::UiLang, fmt: &crate::fo HItem { section, shape: Shape::Row, - glyph: if net { Glyph::Network } else { Glyph::Disk }, + art: icons::drive_art(d.kind, d.letter, system), label: drive_title(d, lang), lines: Vec::new(), detail, @@ -348,7 +361,15 @@ pub fn home_paint(s: &FilesScreen, cx: &mut PaintCx) { continue; } let id = h.node(i); - let ink = if it.disabled { c.fg_disabled } else { c.fg_secondary }; + // A drive that is not ready draws its art at half alpha. + let op = if it.disabled { 128 } else { 255 }; + let art = |cx: &mut PaintCx, a: Art, at: PointP, size: i32| { + let px = u32::try_from(size).unwrap_or(0); + match s.art.image(a, px) { + Some(b) => cx.image(b, at, size, op), + None => cx.image(&s.art.shared(a, px), at, size, op), + } + }; if !it.disabled { let t = cx.hover_t(id); if cx.pressed(id) { @@ -362,7 +383,7 @@ pub fn home_paint(s: &FilesScreen, cx: &mut PaintCx) { Shape::Tile => { let icon = cx.px(ICON); let gx = it.rect.l + (it.rect.w() - icon) / 2; - cx.glyph(RectP::wh(gx, it.rect.t + cx.px(8), icon, icon), it.glyph, ink); + art(cx, it.art, PointP { x: gx, y: it.rect.t + cx.px(8) }, icon); let line_h = cx.px(16); for (n, (text, w)) in it.lines.iter().enumerate() { let room = RectP { @@ -384,16 +405,9 @@ pub fn home_paint(s: &FilesScreen, cx: &mut PaintCx) { } Shape::Row => { let icon = cx.px(ICON_ROW); - cx.glyph( - RectP::wh( - it.rect.l + cx.px(10), - it.rect.t + (it.rect.h() - icon) / 2 - cx.px(if it.used_pct.is_some() { 2 } else { 0 }), - icon, - icon, - ), - it.glyph, - ink, - ); + let lift = cx.px(if it.used_pct.is_some() { 2 } else { 0 }); + let at = PointP { x: it.rect.l + cx.px(10), y: it.rect.t + (it.rect.h() - icon) / 2 - lift }; + art(cx, it.art, at, icon); let text_r = RectP { l: it.rect.l + cx.px(ICON_LABEL), r: it.rect.r - cx.px(10), @@ -428,12 +442,7 @@ pub fn home_paint(s: &FilesScreen, cx: &mut PaintCx) { cx.fill(bar, cx.px(2), c.slider_rail); } let fill = RectP { r: bar.l + bar.w() * pct.min(100) as i32 / 100, ..bar }; - let ink = if pct > BAR_ATTENTION { - c.accent_attention - } else { - oled_ui::Ink { a: 230, ..c.fg_primary } - }; - cx.fill(fill, cx.px(2), ink); + cx.fill(fill, cx.px(2), bar_ink(&c, hc, pct)); } } } @@ -550,6 +559,17 @@ pub fn cmd(s: &mut FilesScreen, cx: &mut EventCx, c: Cmd) -> Reply { Reply::None } +/// The fill of a drive's capacity bar: the disk hue, attention above the limit, the accent (Highlight) in high contrast. +pub fn bar_ink(c: &oled_ui::ColorTokens, high_contrast: bool, pct: u64) -> oled_ui::Ink { + if bar_attention(pct) { + c.accent_attention + } else if high_contrast { + c.accent_ui + } else { + c.res_disk + } +} + /// Whether a drive's bar is in the attention colour. pub fn bar_attention(pct: u64) -> bool { pct > BAR_ATTENTION diff --git a/apps/files/src/icons.rs b/apps/files/src/icons.rs index 9b104eca..91acb051 100644 --- a/apps/files/src/icons.rs +++ b/apps/files/src/icons.rs @@ -1,31 +1,304 @@ -//! Icons in the table (P3-files-app 2.2; FB-OPEN fills it, F2.2): class icons through ClassIcons, item icons from the -//! shell host for the visible rows only. The table's icon table is written only through FilesTable::set_icon. +//! Icons (P3-files-app 2.2; FB-OPEN fills it, F2.2): our colour art for folders, known folders, drives, places and the +//! file families, drawn from the first frame; Windows' icons for the rest: class icons through ClassIcons, and item +//! icons (programs, icon files, shortcuts) from the shell host for the visible rows only. The table's icon table is +//! written only through FilesTable::set_icon. +use std::cell::OnceCell; use std::collections::HashMap; use std::rc::Rc; use std::sync::Arc; -use oled_trust::frame::files::{Gen, ItemRef, ShellEvt, ShellReq}; +use oled_trust::frame::files::{CallKind, Gen, ItemRef, Location, ShellEvt, ShellReq}; +use oled_ui::art::{compose, family_of_ext, Art, Family}; +use oled_ui::gfx::image::IconBitmap; use oled_ui::model::ListModel; -use oled_ui::EventCx; +use oled_ui::theme::HcColors; +use oled_ui::{EventCx, Scale, Tokens}; use crate::decor::cache::IconRef; -use crate::listing::{EntryId, TabId}; +use crate::drives::{DriveInfo, DriveKind}; +use crate::knownfolders::{KnownFolders, KnownName}; +use crate::listing::{EntryId, TabId, WidePath}; use crate::model::{id_of, IconKey}; use crate::services::ReqOwner; -use crate::shell::images::OWN_ICON_EXTS; +use crate::shell::crumbs; +use crate::shell::images::{LINK_EXT, OWN_ICON_EXTS}; use crate::shell_client::ShellReply; use crate::window::{FilesScreen, Shared}; +/// Logical px of the art in rows, sidebar entries, tabs and Home's rows; and on Home's tiles. +pub const ART_S: i32 = oled_ui::tokens::ICON_S; +pub const ART_L: i32 = 32; + +/// How many arts there are (art_index's range). +pub const ART_COUNT: usize = 29; + +/// A dense index of every art, for the book's cells. +pub fn art_index(a: Art) -> usize { + match a { + Art::Folder => 0, + Art::Desktop => 1, + Art::Downloads => 2, + Art::Documents => 3, + Art::Pictures => 4, + Art::Music => 5, + Art::Videos => 6, + Art::Home => 7, + Art::ThisPc => 8, + Art::DriveSystem => 9, + Art::DriveFixed => 10, + Art::DriveRemovable => 11, + Art::DriveNetwork => 12, + Art::RecycleBin => 13, + Art::File(f) => { + 14 + match f { + Family::Document => 0, + Family::Pdf => 1, + Family::Sheet => 2, + Family::Presentation => 3, + Family::Image => 4, + Family::Audio => 5, + Family::Video => 6, + Family::Archive => 7, + Family::Text => 8, + } + } + Art::FileGeneric => 23, + Art::Program => 24, + Art::ProcWindows => 25, + Art::ProcService => 26, + Art::ProcHardware => 27, + Art::ProcPending => 28, + } +} + +/// Every art in art_index order. +const ARTS: [Art; ART_COUNT] = [ + Art::Folder, + Art::Desktop, + Art::Downloads, + Art::Documents, + Art::Pictures, + Art::Music, + Art::Videos, + Art::Home, + Art::ThisPc, + Art::DriveSystem, + Art::DriveFixed, + Art::DriveRemovable, + Art::DriveNetwork, + Art::RecycleBin, + Art::File(Family::Document), + Art::File(Family::Pdf), + Art::File(Family::Sheet), + Art::File(Family::Presentation), + Art::File(Family::Image), + Art::File(Family::Audio), + Art::File(Family::Video), + Art::File(Family::Archive), + Art::File(Family::Text), + Art::FileGeneric, + Art::Program, + Art::ProcWindows, + Art::ProcService, + Art::ProcHardware, + Art::ProcPending, +]; + +/// The art of an index of art_index. +pub fn art_at(i: usize) -> Option { + ARTS.get(i).copied() +} + +/// What a window's art depends on: the device px of its two sizes and the high-contrast colours. Never the accent. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct ArtKey { + pub small: u32, + pub large: u32, + pub hc: Option, +} + +impl ArtKey { + /// The key of a window at `scale` with `tokens` (under high contrast the art takes the window's two colours). + pub fn of(scale: Scale, tokens: &Tokens) -> ArtKey { + let c = &tokens.color; + let hc = tokens.high_contrast.then_some(HcColors { + window: c.bg.rgb, + window_text: c.fg_primary.rgb, + highlight: c.fill_selected.rgb, + highlight_text: c.fg_hot.rgb, + gray_text: c.fg_disabled.rgb, + }); + let px = |v: i32| u32::try_from(scale.px(v)).unwrap_or(0); + ArtKey { small: px(ART_S), large: px(ART_L), hc } + } +} + +/// A window's art: each piece composed on first use, once per (art, device px, high contrast), and shared with the +/// window's tables, which read it through a shared reference. A DPI or high-contrast change replaces the whole book +/// (ArtBook::new with the new key): nothing composed for the old key survives. At most two entries per art. +pub struct ArtBook { + key: ArtKey, + small: [OnceCell>; ART_COUNT], + large: [OnceCell>; ART_COUNT], +} + +impl std::fmt::Debug for ArtBook { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "ArtBook({:?}, {} composed)", self.key, self.len()) + } +} + +impl ArtBook { + pub fn new(key: ArtKey) -> ArtBook { + ArtBook { + key, + small: std::array::from_fn(|_| OnceCell::new()), + large: std::array::from_fn(|_| OnceCell::new()), + } + } + + /// A book before the window's first layout (sizes 0: it composes nothing visible). + pub fn empty() -> ArtBook { + ArtBook::new(ArtKey { small: 0, large: 0, hc: None }) + } + + pub fn key(&self) -> ArtKey { + self.key + } + + /// Pieces composed so far. + pub fn len(&self) -> usize { + self.small.iter().chain(&self.large).filter(|c| c.get().is_some()).count() + } + + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + fn cell(&self, art: Art, device_px: u32) -> Option<&OnceCell>> { + let i = art_index(art); + if device_px == self.key.small { + self.small.get(i) + } else if device_px == self.key.large { + self.large.get(i) + } else { + None + } + } + + /// The art at one of the book's two sizes; None at any other size. + pub fn image(&self, art: Art, device_px: u32) -> Option<&IconBitmap> { + let cell = self.cell(art, device_px)?; + Some(cell.get_or_init(|| Rc::new(compose(art, device_px, self.key.hc.as_ref())))) + } + + /// The art at the small size (rows, entries, tabs). + pub fn small(&self, art: Art) -> &IconBitmap { + let i = art_index(art).min(ART_COUNT - 1); + self.small[i].get_or_init(|| Rc::new(compose(art, self.key.small, self.key.hc.as_ref()))) + } + + /// A shared handle of the art for a widget that keeps one (a tab, a sidebar entry); a size the book does not keep + /// is composed for this caller alone. + pub fn shared(&self, art: Art, device_px: u32) -> Rc { + match self.cell(art, device_px) { + Some(c) => Rc::clone(c.get_or_init(|| Rc::new(compose(art, device_px, self.key.hc.as_ref())))), + None => Rc::new(compose(art, device_px, self.key.hc.as_ref())), + } + } +} + +/// A family of the art, by the lower-case extension. +fn family_of(ext: &[u8]) -> Option { + std::str::from_utf8(ext).ok().filter(|e| !e.is_empty()).and_then(family_of_ext) +} + +/// Programs: their own icon from the shell host, the program art until it comes (and if it never does). +fn is_program(ext: &[u8]) -> bool { + ext.eq_ignore_ascii_case(b"exe") || ext.eq_ignore_ascii_case(b"scr") +} + +/// What a file of extension `ext` draws until a Windows icon arrives, and if none does: its family's art, the program +/// art for exe and scr, the generic page for everything else. +pub fn file_art(ext: &[u8]) -> Art { + match family_of(ext) { + Some(f) => Art::File(f), + None if is_program(ext) => Art::Program, + None => Art::FileGeneric, + } +} + +/// 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. +pub fn wants_class_icon(ext: &[u8]) -> bool { + 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 +/// fixed drive. +pub fn drive_art(kind: DriveKind, letter: u8, system: Option) -> Art { + match kind { + DriveKind::Removable => Art::DriveRemovable, + DriveKind::Network => Art::DriveNetwork, + _ if system == Some(letter.to_ascii_uppercase()) => Art::DriveSystem, + _ => Art::DriveFixed, + } +} + +/// The art of the folder at `p`: a drive root by its drive's kind (a drive the scan has not reported yet counts as +/// fixed), a share's root the network drive, a known folder its own (by path, never by name), any other the folder. +pub fn place_art(p: &WidePath, known: &KnownFolders, drives: &[DriveInfo]) -> Art { + if p.is_root() { + if p.is_unc() { + return Art::DriveNetwork; + } + let letter = p.units().first().and_then(|u| u8::try_from(*u).ok()).unwrap_or(b'C').to_ascii_uppercase(); + let kind = drives.iter().find(|d| d.letter.eq_ignore_ascii_case(&letter)).map_or(DriveKind::Fixed, |d| d.kind); + return drive_art(kind, letter, known.system_drive()); + } + known.name_of(p).and_then(KnownName::art).unwrap_or(Art::Folder) +} + +/// The art of a tab's location: its folder's (a search, its root's); Home the home art; the options page the program. +pub fn location_art(at: &Location, known: &KnownFolders, drives: &[DriveInfo]) -> Art { + match at { + Location::Fs(p) | Location::Search { root: p, .. } => place_art(p, known, drives), + Location::Home => Art::Home, + Location::Options => Art::Program, + } +} + +/// Keeps the window's book in step with its scale and high-contrast state (a change replaces the book) and gives it to +/// every tab's table that does not hold it yet. Layout calls it first, so the first frame already draws the art. +pub fn sync_art(s: &mut FilesScreen, scale: Scale, tokens: &Tokens) { + let key = ArtKey::of(scale, tokens); + if s.art.key() != key { + s.art = Rc::new(ArtBook::new(key)); + } + let known = s.shared.known.borrow().clone(); + for t in s.tabs.iter_mut() { + let m = t.table.model_mut(); + if !Rc::ptr_eq(m.art(), &s.art) { + m.set_art(Rc::clone(&s.art)); + } + if !Rc::ptr_eq(m.known(), &known) { + m.set_known(Rc::clone(&known)); + } + } +} + /// Per-item icons the table keeps (FilesTable's own LRU): the window's record of what it asked for follows the same /// number, so a row whose icon was dropped is asked for again. pub const ITEM_ICONS_MAX: usize = 512; /// Whether a file's own icon is asked of the host: an extension of the host's list (shell::images::OWN_ICON_EXTS: the -/// icon is inside the file; shortcuts, consoles, command files and customised folders name an icon location outside -/// themselves that the shell would resolve and load, which can reach a remote server, so they keep their class or -/// folder icon), no link, nothing offline or dehydrated (the attributes the listing already holds), and a location of -/// the form `X:\...` (never UNC, a device or a URL; the host checks the drive kind and the file again before any load). +/// icon is inside the file) or a shortcut (shell::images::LINK_EXT: the host reads the link without resolving it and +/// loads an icon only from a local location that passes the same checks; consoles, command files and customised +/// folders name an icon location the shell would resolve and load, which can reach a remote server, so they keep +/// their class or folder icon), no link, nothing offline or dehydrated (the attributes the listing already holds), and +/// a location of the form `X:\...` (never UNC, a device or a URL; the host checks the drive kind and the file again +/// before any load). pub fn wants_item_icon(ext: &[u8], attrs: u32, path: &[u16]) -> bool { const REPARSE_POINT: u32 = 0x400; const OFFLINE: u32 = 0x1000; @@ -33,7 +306,7 @@ pub fn wants_item_icon(ext: &[u8], attrs: u32, path: &[u16]) -> bool { const RECALL_ON_DATA_ACCESS: u32 = 0x40_0000; let local_form = matches!(path, [l, c, ..] if u8::try_from(*l).is_ok_and(|b| b.is_ascii_alphabetic()) && *c == u16::from(b':')); - OWN_ICON_EXTS.iter().any(|e| e.as_bytes() == ext) + (OWN_ICON_EXTS.iter().any(|e| e.as_bytes() == ext) || ext == LINK_EXT.as_bytes()) && attrs & (REPARSE_POINT | OFFLINE | RECALL_ON_OPEN | RECALL_ON_DATA_ACCESS) == 0 && local_form } @@ -100,11 +373,12 @@ pub fn request_visible(s: &mut FilesScreen, cx: &mut EventCx) { cx.redraw(); } ask_items(s, &shared, tab, px, &visible.item_rows); + crate::details_pane::ask_icon(s, crate::details_pane::icon_request_px(cx.scale())); } /// What the visible rows need. struct Visible { - /// Distinct lower-case extensions of the files shown. + /// Distinct lower-case extensions of the files shown whose class icon is wanted. exts: Vec>, /// Rows (entry, path) whose icon is the item's own. item_rows: Vec<(EntryId, crate::listing::WidePath)>, @@ -115,6 +389,7 @@ impl Visible { let table = &s.tabs.active().table; let model = table.model(); let listing = model.listing(); + let shell = &s.shared.services.shell; let mut v = Visible { exts: Vec::new(), item_rows: Vec::new() }; for row in table.visible_rows() { let key = ListModel::key(model, row); @@ -128,10 +403,16 @@ impl Visible { if is_dir { continue; } - if let Some(p) = model.path_of(key).filter(|p| wants_item_icon(&ext, attrs, p.units())) { + // A pair the breakers turned off is left out row by row: the host blames an end on the item it was loading, + // while the client checks a request by its first item only. The other rows are still asked. + let asked = |p: &WidePath| { + wants_item_icon(&ext, attrs, p.units()) && !shell.disabled(CallKind::Icon, &crumbs::ext_of(p)) + }; + if let Some(p) = model.path_of(key).filter(asked) { v.item_rows.push((id, p)); } - if !v.exts.iter().any(|x| **x == *ext) { + // A family of the art and a program never ask for their class icon: the art stands in. + if wants_class_icon(&ext) && !v.exts.iter().any(|x| **x == *ext) { v.exts.push(ext.into_boxed_slice()); } } @@ -193,6 +474,9 @@ fn ask_items(s: &mut FilesScreen, shared: &Shared, tab: TabId, px: u16, rows: &[ /// dropped. pub fn on_icon_reply(s: &mut FilesScreen, cx: &mut EventCx, owner: ReqOwner, reply: &ShellReply) { let ReqOwner::Icons { tab, gen, .. } = owner else { return }; + if tab == crate::details_pane::PANE_TAB { + return crate::details_pane::on_icon_reply(s, cx, owner, reply); + } let Some((listing_gen, epoch)) = s.tabs.by_id(tab).map(|t| (t.table.model().listing().gen(), t.table.model().item_epoch())) else { diff --git a/apps/files/src/keys.rs b/apps/files/src/keys.rs index a49aecaa..e199811d 100644 --- a/apps/files/src/keys.rs +++ b/apps/files/src/keys.rs @@ -1,6 +1,6 @@ //! The keyboard (P3-files-app 2.2, SPEC-files 5.4.1 within F1-F4): every command with its chords, label, parity with //! File Explorer and slice; the command table built from it; and run(), which hands each command to its owner's -//! module. Keys the tables do not name (Ctrl+C/X/V, the filter chords, F7, F8, F11 and the rest of F5-F7) are not +//! module. Keys the tables do not name (F7, F8, F11 and the rest of F5-F7) are not //! bound, so Windows' or the kit's default applies. use oled_sys::i18n::S; @@ -10,7 +10,10 @@ use oled_ui::{Chord, CommandId, CommandTable, EventCx, Key, Mods, Reply, UiLang} use crate::tr::{k, t_any, tf}; use crate::window::FilesScreen; -use crate::{about, home, menu, open, ops_ui, pathline, rename, sidebar, tab, toolmenus, window}; +use crate::{ + about, clip_files, details_pane, home, menu, open, ops_ui, pathline, rename, sidebar, tab, toolbar, toolmenus, + window, +}; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[repr(u32)] @@ -62,6 +65,11 @@ pub enum Cmd { OpenInExplorer, Escape, About, + Cut, + Copy, + Paste, + FocusSearch, + DetailsPane, } /// How a row compares with File Explorer's key: the same, ours only, or to verify live. @@ -168,6 +176,11 @@ pub const TABLE: &[KeyRow] = &[ row(Cmd::OpenInExplorer, &[Named("Ctrl+Shift+O")], k::FILES_ACTION_OPEN_EXPLORER, Ours, F2), row(Cmd::Escape, &[Named("Esc")], k::FILES_CMD_ESCAPE, Same, F1a), row(Cmd::About, &[], k::FILES_MORE_ABOUT, Ours, F4), + row(Cmd::Cut, &[Named("Ctrl+X")], k::FILES_CMD_CUT, Same, F3), + row(Cmd::Copy, &[Named("Ctrl+C")], k::FILES_CMD_COPY, Same, F3), + row(Cmd::Paste, &[Named("Ctrl+V")], k::FILES_CMD_PASTE, Same, F3), + row(Cmd::FocusSearch, &[Named("Ctrl+F"), Named("Ctrl+E"), Named("F3")], k::FILES_CMD_SEARCH, Same, F4), + row(Cmd::DetailsPane, &[Named("Alt+Shift+P")], k::FILES_CMD_DETAILS_PANE, Same, F4), ]; /// A row's label: its key (the window's table or the kit's), Tab1-Tab8 with their digit, About with the app's name. @@ -184,6 +197,16 @@ fn label(r: &KeyRow, lang: UiLang) -> oled_ui::node::Text { t_any(r.label, lang) } +/// The line glyph a command carries in menus (the others show none). +pub fn menu_glyph(cmd: Cmd) -> Option { + match cmd { + Cmd::CopyPath => Some(oled_ui::Glyph::CmdCopy), + Cmd::Properties => Some(oled_ui::Glyph::LineInfo), + Cmd::OpenInExplorer => Some(oled_ui::Glyph::LineExternal), + _ => None, + } +} + /// CommandId(cmd as u32) for every row: its first chord as the chord, its second as the alt chord, a third through a /// second command (THIRD_CHORD + cmd). A chord the table cannot bind is left out and logged. pub fn command_table(lang: UiLang) -> CommandTable { @@ -192,6 +215,9 @@ pub fn command_table(lang: UiLang) -> CommandTable { let chords: Vec = r.chords.iter().filter_map(ChordSrc::chord).collect(); let text = label(r, lang); let mut c = UiCmd::new(CommandId(r.cmd as u32), text.clone()); + if let Some(g) = menu_glyph(r.cmd) { + c = c.glyph(g); + } if let Some(&first) = chords.first() { c = c.chord(first); } @@ -253,8 +279,11 @@ pub fn run(s: &mut FilesScreen, cx: &mut EventCx, cmd: Cmd) -> Reply { Cmd::Open | Cmd::Properties | Cmd::OpenInExplorer => open::cmd(s, cx, cmd), Cmd::OurMenu | Cmd::SystemMenu | Cmd::CopyPath => menu::cmd(s, cx, cmd), Cmd::HiddenItems => toolmenus::cmd(s, cx, cmd), + Cmd::Cut | Cmd::Copy | Cmd::Paste => clip_files::cmd(s, cx, cmd), Cmd::Recycle | Cmd::DeletePermanent | Cmd::Undo | Cmd::Redo | Cmd::OpsFlyout => ops_ui::cmd(s, cx, cmd), Cmd::Rename | Cmd::NewFolder => rename::cmd(s, cx, cmd), Cmd::About => about::cmd(s, cx, cmd), + Cmd::FocusSearch => toolbar::focus_search(s, cx), + Cmd::DetailsPane => details_pane::cmd(s, cx, cmd), } } diff --git a/apps/files/src/knownfolders.rs b/apps/files/src/knownfolders.rs new file mode 100644 index 00000000..eb6a8864 --- /dev/null +++ b/apps/files/src/knownfolders.rs @@ -0,0 +1,217 @@ +//! The current user's known folders (Desktop, Downloads, Documents, Pictures, Music, Videos and the profile): read once +//! per process through SHGetKnownFolderPath on a background job, kept in session.json so the next start knows them +//! before its first frame, and matched by path (never by name) wherever a folder draws its art: the list, the tabs, +//! the sidebar and Home. The drive that holds the Windows folder rides along: its root draws the system drive. + +use std::collections::BTreeMap; + +use oled_ui::art::Art; +use windows::core::PWSTR; +use windows::Win32::System::Com::CoTaskMemFree; +use windows::Win32::System::SystemInformation::GetSystemWindowsDirectoryW; +use windows::Win32::UI::Shell::{ + FOLDERID_Desktop, FOLDERID_Documents, FOLDERID_Downloads, FOLDERID_Music, FOLDERID_Pictures, FOLDERID_Profile, + FOLDERID_Videos, SHGetKnownFolderPath, KF_FLAG_DEFAULT, +}; + +use crate::listing::WidePath; +use crate::ops::checks::same_path; + +/// A known folder of the current user. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum KnownName { + Desktop, + Downloads, + Documents, + Pictures, + Music, + Videos, + Profile, +} + +impl KnownName { + /// Every name, in the order of the read. + pub const ALL: [KnownName; 7] = [ + KnownName::Desktop, + KnownName::Downloads, + KnownName::Documents, + KnownName::Pictures, + KnownName::Music, + KnownName::Videos, + KnownName::Profile, + ]; + + /// The art the folder draws; None for the profile, which draws the plain folder. + pub fn art(self) -> Option { + Some(match self { + KnownName::Desktop => Art::Desktop, + KnownName::Downloads => Art::Downloads, + KnownName::Documents => Art::Documents, + KnownName::Pictures => Art::Pictures, + KnownName::Music => Art::Music, + KnownName::Videos => Art::Videos, + KnownName::Profile => return None, + }) + } + + /// The name's key in session.json ("downloads"). + pub fn key(self) -> &'static str { + match self { + KnownName::Desktop => "desktop", + KnownName::Downloads => "downloads", + KnownName::Documents => "documents", + KnownName::Pictures => "pictures", + KnownName::Music => "music", + KnownName::Videos => "videos", + KnownName::Profile => "profile", + } + } + + /// The name of a session.json key. + pub fn from_key(key: &str) -> Option { + KnownName::ALL.into_iter().find(|n| n.key() == key) + } +} + +/// The known folders' paths and the letter of the drive holding the Windows folder. +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct KnownFolders { + list: Vec<(KnownName, WidePath)>, + system_drive: Option, +} + +impl KnownFolders { + /// `system_drive` is upper-cased. + pub fn new(list: Vec<(KnownName, WidePath)>, system_drive: Option) -> KnownFolders { + KnownFolders { list, system_drive: system_drive.map(|d| d.to_ascii_uppercase()) } + } + + /// The paths session.json kept from an earlier read (unknown keys and paths that do not parse are skipped). + pub fn from_session(known: &BTreeMap, system_drive: Option) -> KnownFolders { + let list = + KnownName::ALL.into_iter().filter_map(|n| Some((n, WidePath::parse(known.get(n.key())?).ok()?))).collect(); + KnownFolders::new(list, system_drive) + } + + pub fn list(&self) -> &[(KnownName, WidePath)] { + &self.list + } + + /// The letter of the drive that holds the Windows folder, upper case. + pub fn system_drive(&self) -> Option { + self.system_drive + } + + /// The known folder at `p`: the same path, compared without case. A folder that only has a known folder's name + /// is not one. + pub fn name_of(&self, p: &WidePath) -> Option { + self.list.iter().find(|(_, k)| same_path(k, p)).map(|(n, _)| *n) + } + + /// The known folders with art directly inside `dir`: their names in lower case (for a compare without case), and + /// their art. + pub fn arts_inside(&self, dir: &WidePath) -> Vec<(String, Art)> { + self.list + .iter() + .filter(|(_, k)| k.parent().is_some_and(|p| same_path(&p, dir))) + .filter_map(|(n, k)| Some((String::from_utf16_lossy(k.file_name()?).to_lowercase(), n.art()?))) + .collect() + } +} + +/// The art of the folder named `name` (WTF-8) inside a folder whose known children are `inside` +/// (KnownFolders::arts_inside): a known folder's own, else None. Allocates nothing (it runs for every folder row +/// painted); a name that is not valid Unicode is no known folder's. +pub fn art_by_child_name(inside: &[(String, Art)], name: &[u8]) -> Option { + if inside.is_empty() { + return None; + } + let name = std::str::from_utf8(name).ok()?; + let lower = || name.chars().flat_map(char::to_lowercase); + inside.iter().find(|(n, _)| lower().eq(n.chars())).map(|(_, a)| *a) +} + +/// The read of the background job: SHGetKnownFolderPath for every name, the ones that exist. +pub fn read() -> 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 = (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 = 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 +} + +/// The letter of the drive holding the Windows folder (GetSystemWindowsDirectoryW, no file is touched), upper case. +pub fn system_drive() -> Option { + let mut buf = [0u16; 260]; + // SAFETY: a writable buffer whose length the call reads from the slice. + let n = unsafe { GetSystemWindowsDirectoryW(Some(&mut buf)) } as usize; + match buf.get(..n.min(buf.len())) { + Some([l, c, ..]) if *c == u16::from(b':') => { + u8::try_from(*l).ok().filter(u8::is_ascii_alphabetic).map(|b| b.to_ascii_uppercase()) + } + _ => None, + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn wp(s: &str) -> WidePath { + WidePath::parse(s).expect("a made-up path parses") + } + + #[test] + fn keys_round_trip() { + for n in KnownName::ALL { + assert_eq!(KnownName::from_key(n.key()), Some(n)); + } + assert_eq!(KnownName::from_key("Downloads"), None, "session.json keys are lower case"); + } + + #[test] + fn matched_by_path_without_case() { + let k = KnownFolders::new(vec![(KnownName::Downloads, wp(r"C:\Users\made-up\Downloads"))], Some(b'c')); + assert_eq!(k.system_drive(), Some(b'C')); + assert_eq!(k.name_of(&wp(r"c:\users\MADE-UP\downloads")), Some(KnownName::Downloads)); + assert_eq!(k.name_of(&wp(r"D:\Downloads")), None, "the name alone is not the folder"); + let inside = k.arts_inside(&wp(r"C:\USERS\made-up")); + assert_eq!(art_by_child_name(&inside, b"downloads"), Some(Art::Downloads)); + assert_eq!(art_by_child_name(&inside, b"Documents"), None); + assert!(k.arts_inside(&wp(r"D:\")).is_empty()); + } + + #[test] + fn the_profile_has_no_art_of_its_own() { + let k = KnownFolders::new(vec![(KnownName::Profile, wp(r"C:\Users\made-up"))], None); + assert_eq!(k.name_of(&wp(r"C:\Users\made-up")), Some(KnownName::Profile)); + assert!(k.arts_inside(&wp(r"C:\Users")).is_empty()); + } + + #[test] + fn from_session_skips_what_does_not_parse() { + let mut m = BTreeMap::new(); + m.insert("videos".to_string(), r"D:\made-up\Videos".to_string()); + m.insert("unknown".to_string(), r"D:\x".to_string()); + m.insert("music".to_string(), "not a path".to_string()); + let k = KnownFolders::from_session(&m, Some(b'C')); + assert_eq!(k.list(), &[(KnownName::Videos, wp(r"D:\made-up\Videos"))]); + } +} diff --git a/apps/files/src/lib.rs b/apps/files/src/lib.rs index a59d2d4f..36ed2096 100644 --- a/apps/files/src/lib.rs +++ b/apps/files/src/lib.rs @@ -26,7 +26,9 @@ pub mod bar; pub mod bg; pub mod chrome; pub mod cli; +pub mod clip_files; pub mod complete; +pub mod details_pane; pub mod drives; #[doc(hidden)] pub mod fakes; @@ -38,6 +40,7 @@ pub mod hub; pub mod icons; pub mod instance; pub mod keys; +pub mod knownfolders; pub mod langfile; pub mod linger; pub mod live; diff --git a/apps/files/src/listing/filter.rs b/apps/files/src/listing/filter.rs index 119ef00a..1334f250 100644 --- a/apps/files/src/listing/filter.rs +++ b/apps/files/src/listing/filter.rs @@ -1,13 +1,56 @@ -//! The name filter (ST4): a case-insensitive substring of the name. ASCII names against an ASCII query (the common -//! case) are compared byte by byte with an ASCII fold; any other pair is folded to lower-case WTF-8 first. +//! The name filter (ST4): a case- and accent-insensitive substring of the name. ASCII names against an ASCII query +//! (the common case) are compared byte by byte with an ASCII fold; any other pair is folded (lower case, accents +//! removed) first. The view filter adds the families of a name (the Filter menu) to the query. -use super::arena::lower_wtf8; +use oled_ui::art::{family_of_ext, Family}; #[derive(Clone, Debug, PartialEq, Eq)] pub struct FilterQuery { pub text: Box, } // v1: case-insensitive substring of the name +/// The letter a lower-case accented letter stands for (Latin-1 and Latin Extended-A); None for any other. +fn base_letter(c: char) -> Option { + Some(match c { + 'à'..='å' | 'ā' | 'ă' | 'ą' => 'a', + 'ç' | 'ć' | 'ĉ' | 'ċ' | 'č' => 'c', + 'ď' | 'đ' => 'd', + 'è'..='ë' | 'ē' | 'ĕ' | 'ė' | 'ę' | 'ě' => 'e', + 'ĝ' | 'ğ' | 'ġ' | 'ģ' => 'g', + 'ĥ' | 'ħ' => 'h', + 'ì'..='ï' | 'ĩ' | 'ī' | 'ĭ' | 'į' | 'ı' => 'i', + 'ĵ' => 'j', + 'ķ' => 'k', + 'ĺ' | 'ļ' | 'ľ' | 'ŀ' | 'ł' => 'l', + 'ñ' | 'ń' | 'ņ' | 'ň' => 'n', + 'ò'..='ö' | 'ø' | 'ō' | 'ŏ' | 'ő' => 'o', + 'ŕ' | 'ŗ' | 'ř' => 'r', + 'ś' | 'ŝ' | 'ş' | 'š' => 's', + 'ţ' | 'ť' | 'ŧ' => 't', + 'ù'..='ü' | 'ũ' | 'ū' | 'ŭ' | 'ů' | 'ű' | 'ų' => 'u', + 'ŵ' => 'w', + 'ý' | 'ÿ' | 'ŷ' => 'y', + 'ź' | 'ż' | 'ž' => 'z', + _ => return None, + }) +} + +/// A name as the search compares it: lower case, accents removed (a combining mark is dropped, an accented letter +/// becomes its base letter; the sharp s stays itself). +pub fn fold_search(name: &[u8]) -> Vec { + let text = String::from_utf8_lossy(name); + let mut out = String::with_capacity(text.len()); + for c in text.chars() { + for l in c.to_lowercase() { + if ('\u{300}'..='\u{36f}').contains(&l) { + continue; + } + out.push(base_letter(l).unwrap_or(l)); + } + } + out.into_bytes() +} + /// A query prepared once for a whole list. pub(crate) struct Needle { lower: Vec, @@ -16,7 +59,7 @@ pub(crate) struct Needle { impl Needle { pub fn new(q: &FilterQuery) -> Self { - let lower = lower_wtf8(q.text.as_bytes()); + let lower = fold_search(q.text.as_bytes()); let ascii = lower.is_ascii(); Needle { lower, ascii } } @@ -33,14 +76,115 @@ impl Needle { match (self.ascii, name.is_ascii()) { (true, true) => name.windows(n).any(|w| w.eq_ignore_ascii_case(&self.lower)), (false, true) => false, // the folded query holds a non-ASCII character that no ASCII name has - _ => lower_wtf8(name).windows(n).any(|w| w == self.lower.as_slice()), + _ => fold_search(name).windows(n).any(|w| w == self.lower.as_slice()), } } } +/// The families the Filter menu offers: folders, then the kinds of file by extension, then the rest. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum NameFamily { + Folders, + Documents, + Sheets, + Images, + Audio, + Video, + Archives, + Programs, + Other, +} + +impl NameFamily { + /// Every family, in the menu's order. + pub const ALL: [NameFamily; 9] = [ + NameFamily::Folders, + NameFamily::Documents, + NameFamily::Sheets, + NameFamily::Images, + NameFamily::Audio, + NameFamily::Video, + NameFamily::Archives, + NameFamily::Programs, + NameFamily::Other, + ]; + + fn bit(self) -> u16 { + 1 << (self as u16) + } +} + +/// The extensions of the Programs family. +const PROGRAMS: [&str; 6] = ["exe", "msi", "bat", "cmd", "ps1", "scr"]; + +/// The family of an entry: a folder, else its extension's family (Document, PDF and text files are Documents; +/// spreadsheets and presentations Sheets), Programs by extension, anything else Other. +pub fn family_of(is_dir: bool, ext: &[u8]) -> NameFamily { + if is_dir { + return NameFamily::Folders; + } + let Ok(ext) = std::str::from_utf8(ext) else { return NameFamily::Other }; + if PROGRAMS.iter().any(|p| p.eq_ignore_ascii_case(ext)) { + return NameFamily::Programs; + } + match family_of_ext(ext) { + Some(Family::Document | Family::Pdf | Family::Text) => NameFamily::Documents, + Some(Family::Sheet | Family::Presentation) => NameFamily::Sheets, + Some(Family::Image) => NameFamily::Images, + Some(Family::Audio) => NameFamily::Audio, + Some(Family::Video) => NameFamily::Video, + Some(Family::Archive) => NameFamily::Archives, + None => NameFamily::Other, + } +} + +/// A set of families (empty: every family passes). +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct FamilySet(u16); + +impl FamilySet { + pub fn is_empty(self) -> bool { + self.0 == 0 + } + + pub fn contains(self, f: NameFamily) -> bool { + self.0 & f.bit() != 0 + } + + /// The set with `f` flipped. + pub fn toggled(self, f: NameFamily) -> FamilySet { + FamilySet(self.0 ^ f.bit()) + } + + /// Whether an entry of family `f` passes: any family when the set is empty. + pub fn passes(self, f: NameFamily) -> bool { + self.is_empty() || self.contains(f) + } + + /// The families in the set, in the menu's order. + pub fn members(self) -> Vec { + NameFamily::ALL.into_iter().filter(|f| self.contains(*f)).collect() + } +} + +/// What the open folder is narrowed to: a name search and a set of families, together. +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct ViewFilter { + pub query: Box, + pub families: FamilySet, +} + +impl ViewFilter { + /// Whether it narrows the list at all. + pub fn is_active(&self) -> bool { + !self.query.is_empty() || !self.families.is_empty() + } +} + #[cfg(test)] mod tests { use super::super::store::tests::{batch, names, order_names, store}; + use super::super::store::EntryStore; use super::super::Gen; use super::*; @@ -76,10 +220,96 @@ mod tests { assert_eq!(count("École"), 1); assert_eq!(count("ss"), 0, "sharp s is not folded to ss"); assert_eq!(count("ß"), 1); - assert_eq!(count("é"), 1); + assert_eq!(count("é"), 2, "an accent does not tell names apart: the e of Straße and of ÉCOLE"); assert_eq!(count("LAIN"), 1); } + #[test] + fn filter_ignores_accents_both_ways() { + let mut s = store(); + s.append(batch( + 1, + &[("Café menu.txt".into(), 0x20), ("cafe-bar.txt".into(), 0x20), ("Naïve.doc".into(), 0x20)], + true, + )); + s.merge_pending(); + let count = |t: &str| s.filter(&q(t), Gen(1)).0.len(); + assert_eq!(count("cafe"), 2, "plain letters find the accented name"); + assert_eq!(count("café"), 2, "an accented query finds the plain name"); + assert_eq!(count("NAIVE"), 1); + assert_eq!(count("naïve"), 1); + assert_eq!(count("menu.t"), 1, "a substring, not a prefix"); + assert_eq!(count("zzz"), 0); + } + + #[test] + fn folding_keeps_the_sharp_s_and_drops_combining_marks() { + assert_eq!(fold_search("Straße".as_bytes()), "straße".as_bytes()); + assert_eq!(fold_search("e\u{301}".as_bytes()), b"e", "e and a combining acute"); + assert_eq!(fold_search("ÀÉÎÕÜ".as_bytes()), b"aeiou"); + } + + #[test] + fn families_by_extension() { + let f = |d: bool, e: &str| family_of(d, e.as_bytes()); + assert_eq!(f(true, ""), NameFamily::Folders); + for e in ["doc", "docx", "pdf", "txt", "md", "RTF"] { + assert_eq!(f(false, e), NameFamily::Documents, "{e}"); + } + for e in ["xls", "xlsx", "csv", "ppt", "pptx"] { + assert_eq!(f(false, e), NameFamily::Sheets, "{e}"); + } + assert_eq!(f(false, "png"), NameFamily::Images); + assert_eq!(f(false, "flac"), NameFamily::Audio); + assert_eq!(f(false, "mkv"), NameFamily::Video); + assert_eq!(f(false, "zip"), NameFamily::Archives); + for e in ["exe", "msi", "bat", "cmd", "ps1", "SCR"] { + assert_eq!(f(false, e), NameFamily::Programs, "{e}"); + } + assert_eq!(f(false, "xyz"), NameFamily::Other); + assert_eq!(f(false, ""), NameFamily::Other); + } + + #[test] + fn the_view_filter_narrows_the_order_and_counts_what_it_hides() { + let mut s = store(); + s.append(batch( + 1, + &[ + ("data".into(), 0x10), + ("a.png".into(), 0x20), + ("b.JPG".into(), 0x20), + ("c.txt".into(), 0x20), + ("ab.mp3".into(), 0x20), + (".hidden.png".into(), 0x22), + ], + true, + )); + s.merge_pending(); + let shown = |s: &EntryStore| order_names(s); + assert_eq!(shown(&s).len(), 5); + 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"]); + 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"); + s.set_view_filter(ViewFilter::default()); + assert_eq!(shown(&s).len(), 5, "no filter: the whole order again"); + } + + #[test] + fn family_sets_toggle_and_pass() { + let none = FamilySet::default(); + assert!(none.passes(NameFamily::Other), "an empty set lets everything through"); + let imgs = none.toggled(NameFamily::Images).toggled(NameFamily::Video); + assert!(imgs.passes(NameFamily::Images) && imgs.passes(NameFamily::Video)); + assert!(!imgs.passes(NameFamily::Audio)); + assert_eq!(imgs.members(), vec![NameFamily::Images, NameFamily::Video]); + assert!(imgs.toggled(NameFamily::Images).toggled(NameFamily::Video).is_empty()); + assert!(!ViewFilter::default().is_active()); + } + #[test] fn filter_stale_gen_is_empty() { let mut s = store(); diff --git a/apps/files/src/listing/mod.rs b/apps/files/src/listing/mod.rs index bf54b0d5..1ec5f495 100644 --- a/apps/files/src/listing/mod.rs +++ b/apps/files/src/listing/mod.rs @@ -18,7 +18,7 @@ pub mod types; pub use collate::{Collator, LogicalCollator, SortKeyCollator}; pub use diff::Diff; pub use enum_worker::{stat_one, Enumerator, FindEnumerator, OwnedEntry}; -pub use filter::FilterQuery; +pub use filter::{family_of, FamilySet, FilterQuery, NameFamily, ViewFilter}; pub use natural::{name_key, natural_cmp, natural_cmp_keyed, self_check, NameKey}; pub use pool::{is_network, BatchSink, EnumJob, EnumPool, MakeEnumerator, PoolStats}; pub use sort::{GroupBy, SortDir, SortDone, SortJob, SortKey}; diff --git a/apps/files/src/listing/store.rs b/apps/files/src/listing/store.rs index 897fb653..501da105 100644 --- a/apps/files/src/listing/store.rs +++ b/apps/files/src/listing/store.rs @@ -9,7 +9,7 @@ use std::sync::atomic::{AtomicBool, Ordering as Atomic}; use super::arena::{fold_eq, fold_hash, ExtTable, NameArena, ENTRY_CHUNK}; use super::diff::Diff; -use super::filter::{FilterQuery, Needle}; +use super::filter::{family_of, FilterQuery, Needle, ViewFilter}; use super::sort::{rec_cmp, rec_of, sort_recs, GroupBy, Rec, SortDir, SortDone, SortJob, SortKey, ATTR_DIR}; use super::types::{Batch, Entry, EntryId, EnumError, RawEntry}; use super::{Gen, WidePath}; @@ -89,6 +89,9 @@ pub struct EntryStore { key: SortKey, sdir: SortDir, vis: Visibility, + /// What the open folder is narrowed to (the search and the families), and the search's prepared query. + view: ViewFilter, + view_needle: Option, /// Bumped by everything that makes an outstanding SortJob stale (a new sort, visibility, compaction). sort_gen: u64, /// A SortJob has been made and not yet adopted: changes are listed in `changed`. @@ -117,6 +120,8 @@ impl EntryStore { key: SortKey::Name, sdir: SortDir::Asc, vis: Visibility::default(), + view: ViewFilter::default(), + view_needle: None, sort_gen: 0, job_out: AtomicBool::new(false), changed: Vec::new(), @@ -167,6 +172,28 @@ impl EntryStore { self.full_sort(); } + /// Narrows the order to the entries whose name holds the query and whose family is in the set (the options' + /// visibility still applies first). + pub fn set_view_filter(&mut self, v: ViewFilter) { + if v == self.view { + return; + } + self.view_needle = (!v.query.is_empty()).then(|| Needle::new(&FilterQuery { text: v.query.clone() })); + self.view = v; + self.sort_gen += 1; + self.job_out.store(false, Atomic::Relaxed); + self.changed.clear(); + self.full_sort(); + } + + /// The entries the options' visibility lets through, whatever the view filter says: what the filter narrows. + pub fn unfiltered_len(&self) -> u32 { + if !self.view.is_active() { + return self.order.0.len() as u32; + } + (0..self.total).filter(|i| self.live_entry(EntryId(*i)).is_some_and(|e| self.visible_base(e))).count() as u32 + } + pub fn sort(&mut self, key: SortKey, dir: SortDir, group: GroupBy) -> &Permutation { let GroupBy::None = group; self.key = key; @@ -402,11 +429,26 @@ impl EntryStore { } fn visible(&self, e: &Entry) -> bool { + self.visible_base(e) && (!self.view.is_active() || self.passes_view(e)) + } + + fn visible_base(&self, e: &Entry) -> bool { let hidden = e.attrs & ATTR_HIDDEN != 0; let system = e.attrs & ATTR_SYSTEM != 0; (!hidden || self.vis.hidden) && !(hidden && system && !self.vis.protected_system) } + /// The view filter's verdict on an entry: its name holds the query and its family is in the set. + fn passes_view(&self, e: &Entry) -> bool { + if let Some(needle) = &self.view_needle { + if !self.arena.get(e.name_off, e.name_len).is_some_and(|n| needle.matches(n)) { + return false; + } + } + self.view.families.is_empty() + || self.view.families.passes(family_of(e.attrs & ATTR_DIR != 0, self.exts.text(e.ext))) + } + fn desc(&self) -> bool { self.sdir == SortDir::Desc } diff --git a/apps/files/src/menu.rs b/apps/files/src/menu.rs index 6d7ed5f1..e3ba827d 100644 --- a/apps/files/src/menu.rs +++ b/apps/files/src/menu.rs @@ -44,6 +44,8 @@ pub mod pick { pub const SORT_DESC: u32 = 0x2121; pub const VIEW_EXTENSIONS: u32 = 0x2130; pub const VIEW_COMPACT: u32 = 0x2131; + /// The More menu's accent colour item: the dock's Appearance page. + pub const ACCENT: u32 = 0x2140; } /// Windows are opened at most this many at a time by one "Open in new window" pick. @@ -238,6 +240,7 @@ pub fn open_context(s: &mut FilesScreen, cx: &mut EventCx, row: Option, if folder(s).is_none() { return Reply::None; } + crate::clip_files::look(s, cx); if row.is_none() { // The empty space: the folder's own menu, whatever the selection was (the system menu of it too). s.tabs.active_mut().table.set_selection(cx, Selection::None); @@ -359,7 +362,7 @@ fn host_down(s: &mut FilesScreen, cx: &mut EventCx) { status::notice(s, cx, Notice { action: Some(retry), ..Notice::new(t(k::FILES_MENU_HOST_DOWN, lang)) }); } -fn not_in_beta(s: &mut FilesScreen, cx: &mut EventCx) { +pub(crate) fn not_in_beta(s: &mut FilesScreen, cx: &mut EventCx) { let lang = cx.lang(); let open = (t(k::FILES_ACTION_OPEN_EXPLORER_ARROW, lang), NoticeAct::OpenInExplorer); status::notice(s, cx, Notice { action: Some(open), ..Notice::new(t(k::FILES_MENU_NOT_IN_BETA, lang)) }); @@ -395,14 +398,31 @@ pub enum Mapped { Delete(Vec), /// rename::begin_path: the first item, when it is in the folder shown. Rename(WidePath), + /// Cut (true) or Copy of the items: clip_files::put_checked. + Clip(bool, Vec), + /// Paste into the folder: clip_files::paste. + Paste(WidePath), /// The not_in_beta notice with [Open in File Explorer]. NotInBeta, Nothing, } -/// U4's mapping of the verbs the shell host does not run itself; `dir` is the folder the tab shows. +/// U4's mapping of the verbs the shell host does not run itself; `dir` is the folder the tab shows. The clipboard +/// verbs follow PASTE_LIVE. pub fn map_verb(verb: CanonVerb, paths: Vec, dir: &WidePath) -> Mapped { + map_verb_with(verb, paths, dir, crate::gate::PASTE_LIVE) +} + +/// map_verb with the clipboard commands' switch given: on, Cut and Copy take the menu's items and Paste goes into the +/// menu's folder (the folder shown, for the menu of its background); Paste as a shortcut is not ours. +pub fn map_verb_with(verb: CanonVerb, paths: Vec, dir: &WidePath, paste_live: bool) -> Mapped { match verb { + CanonVerb::Cut | CanonVerb::Copy if paste_live => Mapped::Clip(verb == CanonVerb::Cut, paths), + CanonVerb::Paste if paste_live => match paths.as_slice() { + [] => Mapped::Paste(dir.clone()), + [one] => Mapped::Paste(one.clone()), + _ => Mapped::Nothing, + }, CanonVerb::Delete => Mapped::Delete(paths), CanonVerb::Rename => match paths.into_iter().next() { Some(first) if first.parent().as_ref() == Some(dir) => Mapped::Rename(first), @@ -414,7 +434,13 @@ pub fn map_verb(verb: CanonVerb, paths: Vec, dir: &WidePath) -> Mapped fn intercepted(s: &mut FilesScreen, cx: &mut EventCx, verb: CanonVerb, paths: Vec) { let dir = s.tabs.active().table.model().listing().dir().clone(); - match map_verb(verb, paths, &dir) { + match map_verb_with(verb, paths, &dir, s.shared.paste_live.get()) { + Mapped::Clip(cut, items) => { + crate::clip_files::put_checked(s, cx, items, cut); + } + Mapped::Paste(into) => { + crate::clip_files::paste(s, cx, Some(into)); + } Mapped::Delete(items) => { ops_ui::delete_flow(s, cx, items); } diff --git a/apps/files/src/model.rs b/apps/files/src/model.rs index 5da13f1f..d4368a58 100644 --- a/apps/files/src/model.rs +++ b/apps/files/src/model.rs @@ -3,23 +3,28 @@ use std::any::Any; use std::borrow::Cow; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; use std::rc::Rc; use std::sync::Arc; +use oled_ui::art::Art; use oled_ui::gfx::image::IconBitmap; use oled_ui::model::{ Align, Badge, CellKind, CellOut, ColId, FgRole, IconRef, ListModel, RowKey, Selection, TableModel, }; +use oled_ui::node::Text; use oled_ui::text::Trim; use oled_ui::theme::TypeRole; use oled_ui::UiLang; +use crate::clip_files::CutNames; use crate::format::{Fmt, LocalTime}; +use crate::icons::{art_at, art_index, file_art, ArtBook}; +use crate::knownfolders::{art_by_child_name, KnownFolders}; use crate::listing::collate::wtf8_to_utf16; use crate::listing::{ rescan_merge, Anchor, ApplyStats, Batch, Diff, Entry, EntryId, EntryStore, EnumError, Gen, GroupBy, IdMap, SortDir, - SortDone, SortJob, SortKey, Visibility, WidePath, + SortDone, SortJob, SortKey, ViewFilter, Visibility, WidePath, }; use crate::tr::{gen, k, t}; use crate::types::TypeNames; @@ -47,6 +52,10 @@ pub trait Listing { fn sort_job(&self, key: SortKey, dir: SortDir) -> SortJob; fn adopt(&mut self, done: SortDone); fn set_visibility(&mut self, v: Visibility); + /// Narrows the order to a name search and a set of families. + fn set_view_filter(&mut self, v: ViewFilter); + /// The entries the options' visibility lets through, before the view filter narrows them. + fn unfiltered_len(&self) -> u32; fn needs_compact(&self) -> bool; fn compact(&mut self) -> IdMap; /// Overflow rescan, tab revalidation, the navigation cache: by name, survivors keep their ids. @@ -116,6 +125,12 @@ impl Listing for EntryStore { fn set_visibility(&mut self, v: Visibility) { EntryStore::set_visibility(self, v); } + fn set_view_filter(&mut self, v: ViewFilter) { + EntryStore::set_view_filter(self, v); + } + fn unfiltered_len(&self) -> u32 { + EntryStore::unfiltered_len(self) + } fn needs_compact(&self) -> bool { EntryStore::needs_compact(self) } @@ -164,12 +179,12 @@ impl Default for ViewOpts { } } -/// An icon the table holds: a class icon by extension, an item's own icon, or the folder icon. +/// A Windows icon the table holds: a class icon by extension or an item's own icon. Folders, drives and the file +/// families draw the window's art (ArtBook) instead. #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub enum IconKey { Class(Box<[u8]>), Item(EntryId), - Folder, } /// File attribute bits and reparse tags the cells read (attributes only: no file is ever opened). @@ -186,9 +201,10 @@ mod attr { pub const TAG_SYMLINK: u32 = 0xA000_000C; } -/// Icon slots: 0 is the folder icon, 1 the generic file glyph (the class icon of an empty extension). -const SLOT_FOLDER: u32 = 0; -const SLOT_GENERIC: u32 = 1; +/// Icon slot 0 is the class icon of files without an extension. +const SLOT_NO_EXT: u32 = 0; +/// An IconRef at or above this is a piece of the window's art (ART_REF + art_index), not a slot of the icon table. +const ART_REF: u32 = 0xFFFF_0000; /// Per-item icons kept beyond this many are dropped oldest first. const MAX_ITEM_ICONS: usize = 512; /// A name longer than this many characters gets the full name as its tip. @@ -210,7 +226,7 @@ struct IconTable { impl IconTable { fn new() -> IconTable { - IconTable { slots: vec![None, None], class: HashMap::new(), item: HashMap::new(), free: Vec::new(), stamp: 0 } + IconTable { slots: vec![None], class: HashMap::new(), item: HashMap::new(), free: Vec::new(), stamp: 0 } } fn bitmap(&self, slot: u32) -> Option<&IconBitmap> { @@ -260,8 +276,7 @@ impl IconTable { self.stamp += 1; let stamp = self.stamp; let slot = match key { - IconKey::Folder => SLOT_FOLDER, - IconKey::Class(ext) if ext.is_empty() => SLOT_GENERIC, + IconKey::Class(ext) if ext.is_empty() => SLOT_NO_EXT, IconKey::Class(ext) => { let mut lower = ext.into_vec(); lower.make_ascii_lowercase(); @@ -307,6 +322,15 @@ pub struct FilesTable { lang: UiLang, /// Moves every time the per-item icons are dropped. item_epoch: u64, + /// The window's art, and the known folders whose art the folders of this listing may draw. + art: Rc, + known: Rc, + /// The known folders directly inside the listing's folder: (lower-case name, art). + known_here: Vec<(String, Art)>, + /// Entries on the clipboard as cut: drawn at half alpha until pasted or the cut is dropped. + cut: HashSet, + /// The process's cut by folder and name: it outlives a listing (the same folder listed again stays cut). + cut_names: Option>, } impl FilesTable { @@ -318,7 +342,63 @@ impl FilesTable { opts: ViewOpts, now: LocalTime, ) -> FilesTable { - FilesTable { listing, fmt, types, opts, icons: IconTable::new(), now, gen: 0, lang: UiLang::EN, item_epoch: 0 } + FilesTable { + listing, + fmt, + types, + opts, + icons: IconTable::new(), + now, + gen: 0, + lang: UiLang::EN, + item_epoch: 0, + art: Rc::new(ArtBook::empty()), + known: Rc::new(KnownFolders::default()), + known_here: Vec::new(), + cut: HashSet::new(), + cut_names: None, + } + } + + /// The entries on the clipboard as cut (empty: none); they draw their icon and name at half alpha. + pub fn set_cut(&mut self, ids: impl IntoIterator) { + self.cut = ids.into_iter().collect(); + self.bump(); + } + + /// The process's cut (None: nothing is cut): the rows of this listing's folder it names draw at half alpha. + pub fn set_cut_names(&mut self, names: Option>) { + self.cut_names = names; + self.bump(); + } + + /// The window's art (a DPI or high-contrast change brings a new book). + pub fn set_art(&mut self, art: Rc) { + self.art = art; + self.bump(); + } + + pub fn art(&self) -> &Rc { + &self.art + } + + /// The known folders (read once per process; a fresh read replaces them). + pub fn set_known(&mut self, known: Rc) { + self.known = known; + self.known_here = self.known.arts_inside(self.listing.dir()); + self.bump(); + } + + pub fn known(&self) -> &Rc { + &self.known + } + + /// The art a row draws now: Some for a folder and for a file shown with our art, None for a file whose Windows + /// icon (its own or its class icon) has arrived. + pub fn art_of(&self, row: usize) -> Option { + let id = *self.listing.order().get(row)?; + let r = self.icon_ref(id, self.listing.is_dir(id), self.listing.name(id)?); + r.0.checked_sub(ART_REF).and_then(|i| art_at(i as usize)) } pub fn listing(&self) -> &dyn Listing { @@ -334,6 +414,8 @@ impl FilesTable { /// Swaps the listing; the one that was shown is handed back. pub fn replace(&mut self, l: Box) -> Box { let old = std::mem::replace(&mut self.listing, l); + self.known_here = self.known.arts_inside(self.listing.dir()); + self.cut.clear(); // Entry ids belong to one listing: no per-item icon outlives it. self.drop_item_icons(); old @@ -410,20 +492,27 @@ impl FilesTable { out } - fn icon_slot(&self, id: EntryId, is_dir: bool) -> Option { - if let Some(&s) = self.icons.item.get(&id) { - return Some(s); + /// 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. + 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 { + return art(art_by_child_name(&self.known_here, name).unwrap_or(Art::Folder)); + } + if let Some(&s) = self.icons.item.get(&id).filter(|s| self.icons.filled(**s)) { + return IconRef(s); + } + let ext = self.listing.ext(id).unwrap_or_default(); + let fallback = file_art(ext); + if fallback != Art::FileGeneric { + return art(fallback); + } + let class = if ext.is_empty() { Some(&SLOT_NO_EXT) } else { self.icons.class.get(ext) }; + match class { + Some(&s) if self.icons.filled(s) => IconRef(s), + _ => art(Art::FileGeneric), } - let slot = if is_dir { - SLOT_FOLDER - } else { - let ext = self.listing.ext(id).unwrap_or_default(); - match self.icons.class.get(ext) { - Some(&s) if self.icons.filled(s) => s, - _ => SLOT_GENERIC, - } - }; - self.icons.filled(slot).then_some(slot) } fn badge_of(e: &Entry) -> Option { @@ -468,15 +557,17 @@ impl FilesTable { let len = out.text.len() as u32; match dot { Some(d) if self.opts.show_extensions => { - // The dot is ASCII and the lossy writer keeps every byte length, so the offset is the same. - out.push_span(0, d as u32, FgRole::Primary).push_span(d as u32, len, FgRole::Secondary); + // The dot is ASCII and the lossy writer keeps every byte length, so the offset is the same. The base + // name is Ink 1, the extension Ink 3. + out.push_span(0, d as u32, FgRole::Primary).push_span(d as u32, len, FgRole::Tertiary); } _ => { out.push_span(0, len, FgRole::Primary); } } - out.icon = self.icon_slot(id, is_dir).map(IconRef); + out.icon = Some(self.icon_ref(id, is_dir, name)); out.dim_icon = e.attrs & (attr::HIDDEN | attr::SYSTEM) != 0; + out.cut = self.cut.contains(&id) || self.cut_names.as_ref().is_some_and(|c| c.has(self.listing.dir(), name)); out.badge = Self::badge_of(e); if out.text.chars().count() > TIP_NAME_CHARS { let mut full = String::with_capacity(name.len()); @@ -598,6 +689,10 @@ impl ListModel for FilesTable { } impl TableModel for FilesTable { + fn hover_hint(&self, row: usize) -> Option { + (row < self.listing.order().len()).then(|| t(k::FILES_HINT_OPEN, self.lang)) + } + fn cell(&self, row: usize, col: ColId, out: &mut CellOut) { out.clear(); let Some(&id) = self.listing.order().get(row) else { return }; @@ -626,7 +721,10 @@ impl TableModel for FilesTable { } } - fn icon(&self, icon: IconRef, _px: i32) -> Option<&IconBitmap> { - self.icons.bitmap(icon.0) + fn icon(&self, icon: IconRef, px: i32) -> Option<&IconBitmap> { + match icon.0.checked_sub(ART_REF).and_then(|i| art_at(i as usize)) { + Some(a) => Some(self.art.image(a, u32::try_from(px).unwrap_or(0)).unwrap_or_else(|| self.art.small(a))), + None => self.icons.bitmap(icon.0), + } } } diff --git a/apps/files/src/msg.rs b/apps/files/src/msg.rs index 7cdcf425..74d06a08 100644 --- a/apps/files/src/msg.rs +++ b/apps/files/src/msg.rs @@ -1,8 +1,6 @@ //! What a worker thread or another window sends to a window (P3-files-app 2.2), through hub::Hub into Screen::data. //! Every field is plain data, so a Msg crosses threads. -use std::sync::Arc; - use oled_trust::frame::files::{Change, InstanceCmd, OpId}; use crate::drives::DriveInfo; @@ -82,22 +80,11 @@ pub enum JobDone { gen: Gen, done: SortDone, }, - /// Stored in Shared.session.known. + /// Stored in Shared.session.known and Shared.known. KnownFolders(Vec<(KnownName, WidePath)>), - /// F1a.10 step 5, IconKey::Folder: (px, premultiplied BGRA). - StockFolderIcon(Option<(u16, Arc<[u8]>)>), } -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] -pub enum KnownName { - Desktop, - Downloads, - Documents, - Pictures, - Music, - Videos, - Profile, -} +pub use crate::knownfolders::KnownName; /// p.send(Box::new(m)): false once the window is gone. pub fn post_msg(p: &oled_ui::host::Proxy, m: Msg) -> bool { diff --git a/apps/files/src/names.rs b/apps/files/src/names.rs index 7e7d02bd..d4d561e4 100644 --- a/apps/files/src/names.rs +++ b/apps/files/src/names.rs @@ -46,3 +46,5 @@ pub const TIMER_CHIP: u8 = 6; pub const TIMER_LINGER: u8 = 7; pub const TIMER_PRESPAWN: u8 = 8; pub const TIMER_NOTICE: u8 = 9; +/// The search field's debounce. +pub const TIMER_SEARCH: u8 = 10; diff --git a/apps/files/src/ops/checks.rs b/apps/files/src/ops/checks.rs index b3e6edbe..1c91985d 100644 --- a/apps/files/src/ops/checks.rs +++ b/apps/files/src/ops/checks.rs @@ -1,14 +1,17 @@ -//! Checks every item and name passes before an operation is queued (OP2), and again by the runner before each chunk +//! Checks every item and name passes before an operation is queued, and again by the runner before each chunk //! reaches IFileOperation. Pure. //! -//! - check_item: a volume root or a share root is refused (Root) for Recycle, DeletePermanent, Move and Rename (open -//! point 10); in a debug build started with FILES_TEST_ROOT, every item and destination outside those roots is -//! refused (OutsideTestRoot, rule D3). +//! - check_item: a volume root or a share root is refused (Root) for Recycle, DeletePermanent, Move and Rename; so is +//! every place this host never changes (places.rs: the Windows folder, the program folders, the names Windows keeps +//! at a volume's root, the kept folders), whatever the build switches say; in a debug build started with +//! FILES_TEST_ROOT, every item and destination outside those roots is refused (OutsideTestRoot). //! - check_name: the one name of a Rename or NewFolder. //! - same_parent: a Recycle or DeletePermanent selection comes from one folder. use oled_trust::frame::files::{ItemRef, OpKind, Refusal, WidePath, MAX_NAME_UNITS}; +use super::places::Places; + /// The test roots: FILES_TEST_ROOT=[;...] in a debug build. None (no fence) when the variable is unset or /// in a release build; a set variable with a part that is not an absolute path fences everything out (Some(empty)). pub fn test_roots_from(debug: bool, var: Option<&str>) -> Option> { @@ -70,12 +73,13 @@ pub fn within(p: &WidePath, root: &WidePath) -> bool { p.len() == r.len() || r.last() == Some(&u16::from(b'\\')) || p.get(r.len()) == Some(&u16::from(b'\\')) } -/// An item (or destination) of an operation of `kind`. -pub fn check_item(p: &WidePath, kind: OpKind, roots: Option<&[WidePath]>) -> Result<(), Refusal> { +/// An item (or destination) of an operation of `kind`: the volume's root, then the places, then the test roots. +pub fn check_item(p: &WidePath, kind: OpKind, roots: Option<&[WidePath]>, places: &Places) -> Result<(), Refusal> { let destructive = matches!(kind, OpKind::Recycle | OpKind::DeletePermanent | OpKind::Move | OpKind::Rename); if destructive && p.is_root() { return Err(Refusal::Root); } + places.check(p, kind)?; if let Some(roots) = roots { if !roots.iter().any(|r| within(p, r)) { return Err(Refusal::OutsideTestRoot); @@ -142,21 +146,29 @@ mod tests { WidePath::parse(s).unwrap() } + fn none() -> Places { + Places::default() + } + const DESTRUCTIVE: [OpKind; 4] = [OpKind::Recycle, OpKind::DeletePermanent, OpKind::Move, OpKind::Rename]; #[test] fn roots_are_refused_for_destructive_kinds() { for root in ["C:\\", "\\\\srv\\share", "D:\\"] { for kind in DESTRUCTIVE { - assert_eq!(check_item(&p(root), kind, None), Err(Refusal::Root), "{root} {kind:?}"); + assert_eq!(check_item(&p(root), kind, None, &none()), Err(Refusal::Root), "{root} {kind:?}"); } for kind in [OpKind::Copy, OpKind::NewFolder] { - assert_eq!(check_item(&p(root), kind, None), Ok(()), "a root may be copied from or into: {root}"); + assert_eq!( + check_item(&p(root), kind, None, &none()), + Ok(()), + "a root may be copied from or into: {root}" + ); } } for kind in DESTRUCTIVE { - assert_eq!(check_item(&p("C:\\a"), kind, None), Ok(())); - assert_eq!(check_item(&p("\\\\srv\\share\\a"), kind, None), Ok(())); + assert_eq!(check_item(&p("C:\\a"), kind, None, &none()), Ok(())); + assert_eq!(check_item(&p("\\\\srv\\share\\a"), kind, None, &none()), Ok(())); } } @@ -164,15 +176,27 @@ mod tests { fn test_roots_fence_everything_else() { let roots = [p("C:\\T\\mod-files-test-1-0"), p("C:\\T\\mod-files-test-1-1")]; let r = Some(&roots[..]); - assert_eq!(check_item(&p("C:\\T\\mod-files-test-1-0\\a.txt"), OpKind::DeletePermanent, r), Ok(())); - assert_eq!(check_item(&p("c:\\t\\MOD-FILES-TEST-1-1\\x\\y"), OpKind::Move, r), Ok(()), "case-insensitive"); - assert_eq!(check_item(&p("C:\\T\\mod-files-test-1-0"), OpKind::Copy, r), Ok(()), "the root itself"); + assert_eq!(check_item(&p("C:\\T\\mod-files-test-1-0\\a.txt"), OpKind::DeletePermanent, r, &none()), Ok(())); + assert_eq!( + check_item(&p("c:\\t\\MOD-FILES-TEST-1-1\\x\\y"), OpKind::Move, r, &none()), + Ok(()), + "case-insensitive" + ); + assert_eq!(check_item(&p("C:\\T\\mod-files-test-1-0"), OpKind::Copy, r, &none()), Ok(()), "the root itself"); for out in ["C:\\T\\mod-files-test-1-00\\a", "C:\\T\\a", "C:\\T\\mod-files-test-1", "D:\\x"] { - assert_eq!(check_item(&p(out), OpKind::DeletePermanent, r), Err(Refusal::OutsideTestRoot), "{out}"); - assert_eq!(check_item(&p(out), OpKind::Copy, r), Err(Refusal::OutsideTestRoot), "{out}"); + assert_eq!( + check_item(&p(out), OpKind::DeletePermanent, r, &none()), + Err(Refusal::OutsideTestRoot), + "{out}" + ); + assert_eq!(check_item(&p(out), OpKind::Copy, r, &none()), Err(Refusal::OutsideTestRoot), "{out}"); } - assert_eq!(check_item(&p("C:\\x"), OpKind::Copy, Some(&[])), Err(Refusal::OutsideTestRoot), "empty fence"); - assert_eq!(check_item(&p("C:\\"), OpKind::Recycle, r), Err(Refusal::Root), "Root is checked first"); + assert_eq!( + check_item(&p("C:\\x"), OpKind::Copy, Some(&[]), &none()), + Err(Refusal::OutsideTestRoot), + "empty fence" + ); + assert_eq!(check_item(&p("C:\\"), OpKind::Recycle, r, &none()), Err(Refusal::Root), "Root is checked first"); assert!(within(&p("C:\\a\\b"), &p("C:\\")), "a drive root holds everything on it"); } diff --git a/apps/files/src/ops/flags.rs b/apps/files/src/ops/flags.rs index 1b953655..c70879fc 100644 --- a/apps/files/src/ops/flags.rs +++ b/apps/files/src/ops/flags.rs @@ -1,13 +1,21 @@ -//! The IFileOperation flags of each operation (OP2). Pure: the host passes its own pre-flight collision count for the -//! chunk being run (never a number from the UI), the FS-3 a constant and the test switch. +//! The IFileOperation flags of each operation. Pure: the host passes its own pre-flight collision count for the +//! chunk being run (never a number from the UI), the dialogs-under-silent constant and the test switch. //! //! - Copy, Move: FOF_ALLOWUNDO | FOF_NOCONFIRMMKDIR | FOF_SILENT, except that "Decide each" (AskSystem) with collisions //! in the chunk runs without FOF_SILENT unless the system's dialogs show under it (DIALOGS_UNDER_SILENT); ReplaceAll //! adds FOF_NOCONFIRMATION. SkipAll is never a flag: the pre-flight removes the colliding items. //! - Recycle: FOF_ALLOWUNDO | FOF_WANTNUKEWARNING | FOF_SILENT, never FOF_NOCONFIRMATION. -//! - DeletePermanent: FOF_NOCONFIRMATION | FOF_SILENT, never FOF_ALLOWUNDO. -//! - Rename: FOF_ALLOWUNDO | FOF_SILENT. NewFolder: FOF_SILENT | FOF_RENAMEONCOLLISION. +//! - DeletePermanent: FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI, never FOF_ALLOWUNDO. +//! - Rename: FOF_ALLOWUNDO | FOF_SILENT | FOF_NOERRORUI. NewFolder: FOF_SILENT | FOF_RENAMEONCOLLISION | +//! FOF_NOERRORUI. //! - test_no_ui (a debug build with FILES_TEST_NO_UI=1) adds FOF_NOERRORUI and nothing else. +//! +//! No elevation prompt: the shell offers one from its error dialog ("You need permission ... Continue") and, under +//! FOF_NOERRORUI, only with FOFX_SHOWELEVATIONPROMPT, which no kind ever carries (nor FOFX_REQUIREELEVATION). The +//! kinds that need no dialog of Windows (DeletePermanent, Rename, NewFolder) run under FOF_NOERRORUI: an item the +//! user's rights cannot change fails and is reported, a nested one of a permanent delete included. Recycle keeps the +//! error UI so that FOF_WANTNUKEWARNING's question is never lost; the runner refuses an item whose rights do not +//! allow it before any IFileOperation exists (places.rs), so Windows has no rights to ask for. use oled_trust::frame::files::{Conflicts, OpKind}; use windows::Win32::UI::Shell::{ @@ -30,9 +38,9 @@ pub fn op_flags(kind: OpKind, c: Conflicts, collisions: u32, dialogs_under_silen f } OpKind::Recycle => FOF_ALLOWUNDO.0 | FOF_WANTNUKEWARNING.0 | FOF_SILENT.0, - OpKind::DeletePermanent => FOF_NOCONFIRMATION.0 | FOF_SILENT.0, - OpKind::Rename => FOF_ALLOWUNDO.0 | FOF_SILENT.0, - OpKind::NewFolder => FOF_SILENT.0 | FOF_RENAMEONCOLLISION.0, + OpKind::DeletePermanent => FOF_NOCONFIRMATION.0 | FOF_SILENT.0 | FOF_NOERRORUI.0, + OpKind::Rename => FOF_ALLOWUNDO.0 | FOF_SILENT.0 | FOF_NOERRORUI.0, + OpKind::NewFolder => FOF_SILENT.0 | FOF_RENAMEONCOLLISION.0 | FOF_NOERRORUI.0, // Never run as such: an undo or a resume runs as the concrete kinds of its plan. OpKind::Undo | OpKind::Resume => FOF_ALLOWUNDO.0 | FOF_SILENT.0, }; @@ -48,7 +56,7 @@ pub fn test_no_ui_from(debug: bool, var: Option<&str>) -> bool { debug && var == Some("1") } -/// FILES_TEST_DIALOGS_UNDER_SILENT=1 overrides the FS-3 a constant in a debug build only. Pure. +/// FILES_TEST_DIALOGS_UNDER_SILENT=1 overrides the dialogs-under-silent constant in a debug build only. Pure. pub fn dialogs_under_silent_from(debug: bool, constant: bool, var: Option<&str>) -> bool { constant || (debug && var == Some("1")) } @@ -56,6 +64,7 @@ pub fn dialogs_under_silent_from(debug: bool, constant: bool, var: Option<&str>) #[cfg(test)] mod tests { use super::*; + use windows::Win32::UI::Shell::{FOFX_REQUIREELEVATION, FOFX_SHOWELEVATIONPROMPT}; const KINDS: [OpKind; 8] = [ OpKind::Copy, @@ -70,16 +79,17 @@ mod tests { const CONFLICTS: [Conflicts; 3] = [Conflicts::AskSystem, Conflicts::ReplaceAll, Conflicts::SkipAll]; /// The pinned value of every combination without test_no_ui (FOF_ALLOWUNDO 64, FOF_NOCONFIRMMKDIR 512, - /// FOF_SILENT 4, FOF_NOCONFIRMATION 16, FOF_WANTNUKEWARNING 16384, FOF_RENAMEONCOLLISION 8). + /// FOF_SILENT 4, FOF_NOCONFIRMATION 16, FOF_WANTNUKEWARNING 16384, FOF_RENAMEONCOLLISION 8, FOF_NOERRORUI 1024). fn pinned(kind: OpKind, c: Conflicts, collisions: u32, dus: bool) -> u32 { match (kind, c, collisions, dus) { (OpKind::Copy | OpKind::Move, Conflicts::AskSystem, 1, false) => 576, (OpKind::Copy | OpKind::Move, Conflicts::ReplaceAll, _, _) => 596, (OpKind::Copy | OpKind::Move, _, _, _) => 580, (OpKind::Recycle, _, _, _) => 16_452, - (OpKind::DeletePermanent, _, _, _) => 20, - (OpKind::Rename | OpKind::Undo | OpKind::Resume, _, _, _) => 68, - (OpKind::NewFolder, _, _, _) => 12, + (OpKind::DeletePermanent, _, _, _) => 1_044, + (OpKind::Rename, _, _, _) => 1_092, + (OpKind::Undo | OpKind::Resume, _, _, _) => 68, + (OpKind::NewFolder, _, _, _) => 1_036, } } @@ -129,10 +139,16 @@ mod tests { assert_eq!(!has(FOF_SILENT.0), loud, "FOF_SILENT is dropped only for Decide-each with collisions"); assert_eq!( f & !FOF_NOERRORUI.0, - op_flags(kind, c, collisions, dus, false), + op_flags(kind, c, collisions, dus, false) & !FOF_NOERRORUI.0, "test_no_ui adds only NOERRORUI" ); - assert_eq!(has(FOF_NOERRORUI.0), tnu); + let quiet = matches!(kind, OpKind::DeletePermanent | OpKind::Rename | OpKind::NewFolder); + assert_eq!( + has(FOF_NOERRORUI.0), + tnu || quiet, + "{kind:?}: Windows' error dialogs only where a question waits" + ); + assert!(!has(FOFX_SHOWELEVATIONPROMPT.0) && !has(FOFX_REQUIREELEVATION.0), "never an elevation prompt"); }); } diff --git a/apps/files/src/ops/host.rs b/apps/files/src/ops/host.rs index 37a46f20..f015d587 100644 --- a/apps/files/src/ops/host.rs +++ b/apps/files/src/ops/host.rs @@ -27,6 +27,7 @@ use windows::Win32::UI::WindowsAndMessaging::{ use super::checks::{check_item, check_name, item_path, same_parent}; use super::consts::{MAX_RUNNING, PAUSE_OK, STAGE_IN_MEMORY, STAGE_MAX}; use super::journal::{self, JKind, Journal, PathRepr, StagedItems}; +use super::places::{self, Places}; use super::runner::{run, RunCtx, RunStats}; pub use super::runner::{JournalCtx, OpJob, Prepared, Work}; use super::undo::{self, UndoFs}; @@ -55,6 +56,8 @@ pub struct HostConfig { /// Staged items one operation may hold (STAGE_MAX; tests lower it). pub stage_max: u64, pub fs: Box, + /// The places this host never changes (places::system; tests pass their own). + pub places: Arc, } /// One entry of ops-done.json: an operation that finished while no UI was attached. @@ -73,7 +76,15 @@ pub struct DoneEntry { impl HostConfig { /// The production settings over the data folder `data`. pub fn new(data: OwnDir, pid: u32, created: u64, roots: Option>) -> HostConfig { - HostConfig { data, pid, created, roots, stage_max: STAGE_MAX, fs: Box::new(undo::OsFs) } + HostConfig { + data, + pid, + created, + roots, + stage_max: STAGE_MAX, + fs: Box::new(undo::OsFs), + places: places::system(), + } } } @@ -338,7 +349,10 @@ impl Host { ), OpReq::Rename { op, item, to } => { let roots = s.cfg.roots.clone(); - if let Err(r) = check_item(&item, OpKind::Rename, roots.as_deref()).and_then(|()| check_name(&to)) { + let places = s.cfg.places.clone(); + if let Err(r) = + check_item(&item, OpKind::Rename, roots.as_deref(), &places).and_then(|()| check_name(&to)) + { return send(refused(op, r, &name_text(&item))); } let job = OpJob { @@ -352,10 +366,13 @@ impl Host { } OpReq::NewFolder { op, parent, name } => { let roots = s.cfg.roots.clone(); + let places = s.cfg.places.clone(); if let Err(r) = - check_item(&parent, OpKind::NewFolder, roots.as_deref()).and_then(|()| check_name(&name)) + check_item(&parent, OpKind::NewFolder, roots.as_deref(), &places).and_then(|()| check_name(&name)) { - return send(refused(op, r, &name)); + // A refused name is named; any other refusal names the folder it was asked of. + let detail = if r == Refusal::BadName { name.to_string() } else { name_text(&parent) }; + return send(refused(op, r, &detail)); } let job = OpJob { kind: OpKind::NewFolder, @@ -392,7 +409,7 @@ impl Host { } Ok(k) => { let plan = undo::plan(op, &UndoRecord { kind: k, ..rec }); - if let Err((why, detail)) = check_plan(&plan, s.cfg.roots.as_deref()) { + if let Err((why, detail)) = check_plan(&plan, s.cfg.roots.as_deref(), &s.cfg.places) { return send(refused(op, why, &detail)); } self.enqueue(&mut s, op, Work::Planned(OpKind::Undo, plan), &send); @@ -430,7 +447,7 @@ impl Host { } match resume_plan(&s.cfg, op, of) { Ok((plan, missing, obsolete)) => { - if let Err((why, detail)) = check_plan(&plan, s.cfg.roots.as_deref()) { + if let Err((why, detail)) = check_plan(&plan, s.cfg.roots.as_deref(), &s.cfg.places) { return send(refused(op, why, &detail)); } if s.running.contains_key(&op) || s.queue.iter().any(|(o, _)| *o == op) { @@ -469,8 +486,9 @@ impl Host { return send(refused(op, Refusal::NoItems, "")); }; let roots = s.cfg.roots.clone(); + let places = s.cfg.places.clone(); if let Some(d) = &dest { - if let Err(r) = check_item(d, OpKind::Copy, roots.as_deref()) { + if let Err(r) = check_item(d, OpKind::Copy, roots.as_deref(), &places) { staged.remove_spill(); return send(refused(op, r, &name_text(d))); } @@ -485,7 +503,7 @@ impl Host { break; }; for item in &chunk { - if let Err(r) = check_item(item, kind, roots.as_deref()) { + if let Err(r) = check_item(item, kind, roots.as_deref(), &places) { bad = Some((r, name_text(item))); break 'all; } @@ -651,13 +669,13 @@ fn retire(s: &mut State, op: OpId) { } /// Every item and destination of a plan passes the checks before it is queued. -fn check_plan(plan: &[Prepared], roots: Option<&[WidePath]>) -> Result<(), (Refusal, String)> { +fn check_plan(plan: &[Prepared], roots: Option<&[WidePath]>, places: &Places) -> Result<(), (Refusal, String)> { for c in plan { for item in &c.items { - check_item(item, c.kind, roots).map_err(|r| (r, name_text(item)))?; + check_item(item, c.kind, roots, places).map_err(|r| (r, name_text(item)))?; } if let Some(d) = &c.dest { - check_item(d, OpKind::Copy, roots).map_err(|r| (r, name_text(d)))?; + check_item(d, OpKind::Copy, roots, places).map_err(|r| (r, name_text(d)))?; } } Ok(()) @@ -922,6 +940,8 @@ impl Runner for RealRunner { hook_record: None, slow_post_ms: base.slow_post_ms, bin_off: crate::ops::classify::bin_turned_off, + places: places::system(), + look: places::look, }; run(op, work, &ctx); ops.lock().unwrap_or_else(|e| e.into_inner()).remove(&op); diff --git a/apps/files/src/ops/mod.rs b/apps/files/src/ops/mod.rs index 6a6beeea..629975c6 100644 --- a/apps/files/src/ops/mod.rs +++ b/apps/files/src/ops/mod.rs @@ -1,4 +1,4 @@ -//! The ops host's parts (SPEC-files 5.5.1, 5.5.9, 5.4.7): the journal, the flags, the item checks and the recycle +//! The ops host's parts: the journal, the flags, the item checks, the places it never changes and the recycle //! classifier; then the runner, sink, pre-flight, coalescer, constants, undo, request dispatch and session handling. pub mod binrec; @@ -9,6 +9,7 @@ pub mod consts; pub mod flags; pub mod host; pub mod journal; +pub mod places; pub mod preflight; pub mod resume; pub mod runner; diff --git a/apps/files/src/ops/places.rs b/apps/files/src/ops/places.rs new file mode 100644 index 00000000..fb10e22a --- /dev/null +++ b/apps/files/src/ops/places.rs @@ -0,0 +1,480 @@ +//! The places the operations host never changes, whatever the build switches say, and what it asks the disk of an +//! item before IFileOperation exists. +//! +//! - Sealed: the Windows folder, the program folders and the shared program data. Nothing at or below them changes, +//! as an item or as a destination, by any kind of operation. +//! - At the root of every volume or share, the names Windows keeps there for itself (every name that starts with '$', +//! System Volume Information, Recovery, Config.Msi and the like): sealed too, except that an item inside a +//! $Recycle.Bin folder may be moved out of it (an undo restores a recycled item that way). +//! - Kept: the Users folder, every profile in it, this user's profile, its known folders and the temporary folder. +//! What lies inside them may change; they themselves, and any item that holds one of them or a sealed place, are +//! never deleted, renamed or moved. +//! +//! Places::check is pure over the text of a path (each component's trailing dots and spaces dropped, as Win32 drops +//! them). The runner also checks the real path of each top-level item and of the folder that gains something, read +//! through a handle (look: 8.3 aliases, substituted drives and links on the way resolved), whether it is the root of a +//! volume (a mount folder included), and whether the user's own rights allow the access the operation needs: when +//! Windows refuses it, the operation is refused (Refusal::Elevated) before IFileOperation could offer an elevation +//! prompt. An item is judged as itself (a link in its last component is the link); the folder that gains something +//! is judged through a link in its last component (a junction, a directory symbolic link, a mount folder), since +//! IFileOperation writes into the link's target. The probe opens a handle and closes it unused; it never changes the +//! item. + +use std::sync::{Arc, OnceLock}; + +use oled_trust::frame::files::{OpKind, Refusal, WidePath}; +use windows::core::{PCWSTR, PWSTR}; +use windows::Win32::Foundation::{CloseHandle, ERROR_ACCESS_DENIED, HANDLE}; +use windows::Win32::Storage::FileSystem::{ + CreateFileW, GetFinalPathNameByHandleW, GetVolumePathNameW, DELETE, FILE_ADD_FILE, FILE_ADD_SUBDIRECTORY, + FILE_FLAG_BACKUP_SEMANTICS, FILE_FLAG_OPEN_NO_RECALL, FILE_FLAG_OPEN_REPARSE_POINT, FILE_NAME_NORMALIZED, + FILE_SHARE_DELETE, FILE_SHARE_READ, FILE_SHARE_WRITE, GETFINALPATHNAMEBYHANDLE_FLAGS, OPEN_EXISTING, + VOLUME_NAME_DOS, +}; +use windows::Win32::System::Com::CoTaskMemFree; +use windows::Win32::System::SystemInformation::GetSystemWindowsDirectoryW; +use windows::Win32::UI::Shell::{ + FOLDERID_Desktop, FOLDERID_Documents, FOLDERID_Downloads, FOLDERID_Favorites, FOLDERID_LocalAppData, + FOLDERID_LocalAppDataLow, FOLDERID_Music, FOLDERID_Pictures, FOLDERID_Profile, FOLDERID_ProgramData, + FOLDERID_ProgramFiles, FOLDERID_ProgramFilesX86, FOLDERID_Programs, FOLDERID_Public, FOLDERID_PublicDesktop, + FOLDERID_PublicDocuments, FOLDERID_PublicDownloads, FOLDERID_PublicMusic, FOLDERID_PublicPictures, + FOLDERID_PublicVideos, FOLDERID_RoamingAppData, FOLDERID_SkyDrive, FOLDERID_StartMenu, FOLDERID_Startup, + FOLDERID_UserProfiles, FOLDERID_Videos, SHGetKnownFolderPath, KF_FLAG_DEFAULT, +}; + +use super::checks::{same_path, within}; + +const BS: u16 = b'\\' as u16; + +/// The names Windows keeps at the root of a volume for itself, besides every name that starts with '$'. +const ROOT_SYSTEM: [&str; 10] = [ + "System Volume Information", + "Recovery", + "Config.Msi", + "Boot", + "bootmgr", + "BOOTNXT", + "pagefile.sys", + "hiberfil.sys", + "swapfile.sys", + "Documents and Settings", +]; + +/// The bin's folder at a volume's root: what lies inside it may only be moved out (a restore). +const BIN: &str = "$Recycle.Bin"; + +/// The places of this machine the host never changes (see the module comment). +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct Places { + /// Nothing at or below these changes. + pub sealed: Vec, + /// These folders themselves are never deleted, renamed or moved, nor is anything that holds one. + pub kept: Vec, + /// Folders whose every direct child is kept too (the Users folder: every profile). + pub kept_parents: Vec, +} + +/// The kinds that take an item away from where it is. +pub fn removes(kind: OpKind) -> bool { + matches!(kind, OpKind::Recycle | OpKind::DeletePermanent | OpKind::Move | OpKind::Rename) +} + +fn same_name(a: &[u16], b: &str) -> bool { + let b: Vec = b.encode_utf16().collect(); + same_path_units(a, &b) +} + +fn same_path_units(a: &[u16], b: &[u16]) -> bool { + a.len() == b.len() && super::checks::folded(a) == super::checks::folded(b) +} + +/// Each component without its trailing dots and spaces, as Win32 resolves a path that is not in its \\?\ form (the +/// shell is given that form below MAX_PATH): "C:\Windows. \x" names C:\Windows\x. None when nothing is trimmed. +fn trimmed(p: &WidePath) -> Option { + let u = p.units(); + let dirty = u.split(|&c| c == BS).any(|c| c.last().is_some_and(|&l| l == u16::from(b'.') || l == u16::from(b' '))); + if !dirty { + return None; + } + let mut out: Vec = Vec::with_capacity(u.len()); + for (i, c) in u.split(|&c| c == BS).enumerate() { + if i > 0 { + out.push(BS); + } + let mut end = c.len(); + while end > 0 && matches!(c.get(end - 1), Some(&l) if l == u16::from(b'.') || l == u16::from(b' ')) { + end -= 1; + } + out.extend_from_slice(c.get(..end).unwrap_or_default()); + } + WidePath::new(&out).ok() +} + +/// The units of the volume's or share's root ("X:\" or "\\srv\share"), then the rest after its separator. +fn split_root(u: &[u16]) -> (usize, &[u16]) { + if u.starts_with(&[BS, BS]) { + let mut seps = u.iter().enumerate().skip(2).filter(|(_, &c)| c == BS).map(|(i, _)| i); + let _server_end = seps.next(); + match seps.next() { + Some(share_end) => (share_end, u.get(share_end + 1..).unwrap_or_default()), + None => (u.len(), &[]), + } + } else { + (3.min(u.len()), u.get(3..).unwrap_or_default()) + } +} + +impl Places { + /// Ok when an operation of `kind` may act on `p`: an item of the operation, or its destination (checked as Copy, + /// or as NewFolder for the folder a new item appears in). Root when `p` is a place this host never changes. + pub fn check(&self, p: &WidePath, kind: OpKind) -> Result<(), Refusal> { + match trimmed(p) { + Some(t) => self.check_text(&t, kind).and_then(|()| self.check_text(p, kind)), + None => self.check_text(p, kind), + } + } + + fn check_text(&self, p: &WidePath, kind: OpKind) -> Result<(), Refusal> { + let (_, rest) = split_root(p.units()); + let mut comps = rest.split(|&c| c == BS).filter(|c| !c.is_empty()); + if let Some(first) = comps.next() { + let system = first.first() == Some(&u16::from(b'$')) || ROOT_SYSTEM.iter().any(|n| same_name(first, n)); + let restore = kind == OpKind::Move && same_name(first, BIN) && comps.next().is_some(); + if system && !restore { + return Err(Refusal::Root); + } + } + if self.sealed.iter().any(|s| within(p, s)) { + return Err(Refusal::Root); + } + if removes(kind) { + let holds = self.sealed.iter().chain(&self.kept).any(|s| within(s, p)); + let profile = p.parent().is_some_and(|q| self.kept_parents.iter().any(|k| same_path(&q, k))); + if holds || profile { + return Err(Refusal::Root); + } + } + Ok(()) + } +} + +/// This machine's places, read once per process (the Windows folder, the known folders, the temporary folder). +pub fn system() -> Arc { + static PLACES: OnceLock> = OnceLock::new(); + PLACES.get_or_init(|| Arc::new(read_system())).clone() +} + +fn known(id: &windows::core::GUID) -> Option { + // SAFETY: a known folder id and default flags; the returned string is freed below. + let p: PWSTR = unsafe { SHGetKnownFolderPath(id, KF_FLAG_DEFAULT, None) }.ok()?; + // SAFETY: `p` is the NUL-terminated string returned by the call above, read once. + let units: Vec = 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)) }; + WidePath::new(&units).ok() +} + +/// Each path, and its long form when it differs (a path given with 8.3 aliases). +fn with_long(list: Vec) -> Vec { + let mut out = Vec::with_capacity(list.len() * 2); + for p in list { + if let Some(l) = super::sink::long_form(&p) { + out.push(l); + } + out.push(p); + } + out +} + +fn read_system() -> Places { + let mut sealed = Vec::new(); + let mut buf = [0u16; 260]; + // SAFETY: a writable buffer whose length the call reads from the slice. + let n = unsafe { GetSystemWindowsDirectoryW(Some(&mut buf)) } as usize; + if let Some(w) = buf.get(..n).and_then(|u| WidePath::new(u).ok()) { + sealed.push(w); + } + sealed.extend( + [&FOLDERID_ProgramFiles, &FOLDERID_ProgramFilesX86, &FOLDERID_ProgramData].into_iter().filter_map(known), + ); + let kept_ids = [ + &FOLDERID_UserProfiles, + &FOLDERID_Profile, + &FOLDERID_Public, + &FOLDERID_PublicDesktop, + &FOLDERID_PublicDocuments, + &FOLDERID_PublicDownloads, + &FOLDERID_PublicMusic, + &FOLDERID_PublicPictures, + &FOLDERID_PublicVideos, + &FOLDERID_Desktop, + &FOLDERID_Documents, + &FOLDERID_Downloads, + &FOLDERID_Pictures, + &FOLDERID_Music, + &FOLDERID_Videos, + &FOLDERID_Favorites, + &FOLDERID_SkyDrive, + &FOLDERID_RoamingAppData, + &FOLDERID_LocalAppData, + &FOLDERID_LocalAppDataLow, + &FOLDERID_StartMenu, + &FOLDERID_Programs, + &FOLDERID_Startup, + ]; + let mut kept: Vec = kept_ids.into_iter().filter_map(known).collect(); + if let Ok(t) = WidePath::parse(&std::env::temp_dir().to_string_lossy()) { + kept.push(t); + } + let kept_parents: Vec = known(&FOLDERID_UserProfiles).into_iter().collect(); + Places { sealed: with_long(sealed), kept: with_long(kept), kept_parents: with_long(kept_parents) } +} + +/// The access an operation needs on a path. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Need { + /// The item leaves its folder (delete, recycle, rename, move): DELETE on it. + Remove, + /// Something new appears in the folder (a new folder, a rename's new name, a copy or a move into it): adding a + /// file and a folder to the folder IFileOperation writes into, a link in its last component followed. + Add, +} + +/// What an operation of `kind` needs on each of its items and on the folder that gains something (the destination, +/// or a renamed item's own folder). Pure. +pub fn needs(kind: OpKind) -> (Option, Option) { + match kind { + OpKind::Recycle | OpKind::DeletePermanent => (Some(Need::Remove), None), + OpKind::Rename | OpKind::Move => (Some(Need::Remove), Some(Need::Add)), + OpKind::Copy | OpKind::NewFolder => (None, Some(Need::Add)), + // Never run as such: an undo or a resume runs as the concrete kinds of its plan. + OpKind::Undo | OpKind::Resume => (None, None), + } +} + +/// What the runner learns of one path before IFileOperation exists. +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct Look { + /// Its real path (8.3 aliases, substituted drives and links on the way resolved, and for Need::Add a link in its + /// last component too); None when it cannot be opened. + pub real: Option, + /// It is the root of a volume, a volume mounted in a folder included. + pub volume_root: bool, + /// Windows refused the access the operation needs with the user's own rights. + pub denied: bool, +} + +/// The runner's seam for look (tests pass their own). +pub type LookFn = fn(&WidePath, Option) -> Look; + +/// The form the shell is given (runner::parsing_form), NUL-terminated. +fn call_form(p: &WidePath) -> Vec { + super::runner::parsing_form(p) +} + +/// Opens `path` with `access` (never recalling a cloud file; a link in its last component followed only when +/// `follow`, else opened as itself); the handle or the error code. +fn open(path: &[u16], access: u32, follow: bool) -> Result { + let mut flags = FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_NO_RECALL; + if !follow { + flags |= FILE_FLAG_OPEN_REPARSE_POINT; + } + // SAFETY: `path` is NUL-terminated and lives for the call; no security attributes, no template. + let h = unsafe { + CreateFileW( + PCWSTR(path.as_ptr()), + access, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + None, + OPEN_EXISTING, + flags, + None, + ) + }; + h.map_err(|e| (e.code().0 as u32) & 0xFFFF) +} + +fn final_path(h: HANDLE) -> Option { + let mut buf = vec![0u16; 1024]; + for _ in 0..2 { + let flags = GETFINALPATHNAMEBYHANDLE_FLAGS(FILE_NAME_NORMALIZED.0 | VOLUME_NAME_DOS.0); + // SAFETY: a live handle of this thread; the buffer is writable for its whole length. + let n = unsafe { GetFinalPathNameByHandleW(h, &mut buf, flags) } as usize; + if n == 0 { + return None; + } + if n < buf.len() { + return WidePath::new(buf.get(..n)?).ok(); + } + buf.resize(n + 1, 0); + } + None +} + +fn is_volume_root(form: &[u16], p: &WidePath) -> bool { + let mut buf = vec![0u16; 1024]; + // SAFETY: `form` is NUL-terminated; the buffer is writable for its whole length. + if unsafe { GetVolumePathNameW(PCWSTR(form.as_ptr()), &mut buf) }.is_err() { + return p.is_root(); + } + let n = buf.iter().position(|&u| u == 0).unwrap_or(buf.len()); + match buf.get(..n).and_then(|u| WidePath::new(u).ok()) { + Some(v) => same_path(&v, p), + None => p.is_root(), + } +} + +/// The system's look: one handle with the access `need` asks for (DELETE, or adding a file and a folder), its final +/// path, closed at once; when that access is refused, a second handle with no access at all gives the real path. For +/// Need::Add both handles follow a link in the folder's last component, so the real path and the rights are those of +/// the folder IFileOperation writes into; otherwise a link is opened as itself (an operation on a link acts on the +/// link). A dangling link or a path that cannot be opened has no real path. +pub fn look(p: &WidePath, need: Option) -> Look { + let form = call_form(p); + let follow = need == Some(Need::Add); + let access = match need { + Some(Need::Remove) => DELETE.0, + Some(Need::Add) => FILE_ADD_FILE.0 | FILE_ADD_SUBDIRECTORY.0, + None => 0, + }; + let mut out = Look { volume_root: is_volume_root(&form, p), ..Look::default() }; + let h = match open(&form, access, follow) { + Ok(h) => Some(h), + Err(code) => { + out.denied = access != 0 && code == ERROR_ACCESS_DENIED.0; + if access != 0 { + open(&form, 0, follow).ok() + } else { + None + } + } + }; + if let Some(h) = h { + out.real = final_path(h); + // SAFETY: the handle opened above, closed once. + let _ = unsafe { CloseHandle(h) }; + } + out +} + +#[cfg(test)] +mod tests { + use super::*; + + fn p(s: &str) -> WidePath { + WidePath::parse(s).unwrap() + } + + fn places() -> Places { + Places { + sealed: vec![p(r"C:\Windows"), p(r"C:\Program Files"), p(r"C:\ProgramData")], + kept: vec![p(r"C:\Users"), p(r"C:\Users\made-up"), p(r"C:\Users\made-up\Documents")], + kept_parents: vec![p(r"C:\Users")], + } + } + + const ALL: [OpKind; 6] = + [OpKind::Copy, OpKind::Move, OpKind::Recycle, OpKind::DeletePermanent, OpKind::Rename, OpKind::NewFolder]; + + #[test] + fn nothing_in_a_sealed_place_changes() { + let pl = places(); + for path in + [r"C:\Windows", r"c:\WINDOWS\System32\drivers\etc\hosts", r"C:\Program Files\App", r"C:\ProgramData\x"] + { + for kind in ALL { + assert_eq!(pl.check(&p(path), kind), Err(Refusal::Root), "{path} {kind:?}"); + } + } + assert_eq!(pl.check(&p(r"C:\Windows. \win.ini"), OpKind::DeletePermanent), Err(Refusal::Root), "trailing dot"); + assert_eq!(pl.check(&p(r"C:\Windows \System32"), OpKind::NewFolder), Err(Refusal::Root), "trailing space"); + assert_eq!(pl.check(&p(r"C:\WindowsApps\x"), OpKind::DeletePermanent), Ok(()), "whole components only"); + assert_eq!(pl.check(&p(r"C:\Program Files (x86)\x"), OpKind::Rename), Ok(()), "only the folders it names"); + } + + #[test] + fn kept_folders_stay_but_their_contents_may_change() { + let pl = places(); + for path in [r"C:\Users", r"C:\Users\made-up", r"C:\Users\made-up\Documents", r"C:\Users\Someone Else"] { + for kind in [OpKind::Move, OpKind::Recycle, OpKind::DeletePermanent, OpKind::Rename] { + assert_eq!(pl.check(&p(path), kind), Err(Refusal::Root), "{path} {kind:?}"); + } + for kind in [OpKind::Copy, OpKind::NewFolder] { + assert_eq!(pl.check(&p(path), kind), Ok(()), "a kept folder may gain items: {path} {kind:?}"); + } + } + for kind in ALL { + assert_eq!(pl.check(&p(r"C:\Users\made-up\Documents\notes.txt"), kind), Ok(()), "{kind:?}"); + assert_eq!(pl.check(&p(r"C:\Users\made-up\Projects"), kind), Ok(()), "{kind:?}"); + } + assert_eq!(pl.check(&p(r"C:\Users\made-up\Documents."), OpKind::Recycle), Err(Refusal::Root)); + assert_eq!(pl.check(&p(r"C:\Users\Someone Else\x.txt"), OpKind::Recycle), Ok(()), "inside a profile"); + } + + #[test] + fn an_item_that_holds_a_kept_or_sealed_place_stays() { + let pl = Places { kept: vec![p(r"D:\Data\Documents")], ..places() }; + assert_eq!(pl.check(&p(r"D:\Data"), OpKind::DeletePermanent), Err(Refusal::Root)); + assert_eq!(pl.check(&p(r"D:\Data"), OpKind::Copy), Ok(()), "a copy of it takes nothing away"); + assert_eq!(pl.check(&p(r"D:\Data2"), OpKind::DeletePermanent), Ok(())); + } + + #[test] + fn the_names_windows_keeps_at_a_root() { + let pl = Places::default(); + for path in [ + r"D:\$Recycle.Bin", + r"D:\$WinREAgent\x", + r"C:\System Volume Information", + r"E:\recovery\x", + r"C:\pagefile.sys", + r"\\srv\share\$Recycle.Bin\S-1-5-21\$R1.txt", + r"C:\Documents and Settings\x", + ] { + for kind in [OpKind::Recycle, OpKind::DeletePermanent, OpKind::Rename, OpKind::NewFolder, OpKind::Copy] { + assert_eq!(pl.check(&p(path), kind), Err(Refusal::Root), "{path} {kind:?}"); + } + } + assert_eq!(pl.check(&p(r"C:\$Recycle.Bin\S-1-5-21\$R1.txt"), OpKind::Move), Ok(()), "a restore"); + assert_eq!(pl.check(&p(r"C:\$Recycle.Bin"), OpKind::Move), Err(Refusal::Root), "never the bin itself"); + assert_eq!(pl.check(&p(r"C:\$Recycle.Bin\S-1-5-21"), OpKind::Copy), Err(Refusal::Root), "nothing goes in"); + for ok in [r"D:\Data\$money", r"D:\Data\Recovery", r"D:\Boots", r"\\srv\share\x\pagefile.sys"] { + assert_eq!(pl.check(&p(ok), OpKind::DeletePermanent), Ok(()), "{ok}: below the root"); + } + } + + #[test] + fn this_machine_has_its_places() { + let pl = system(); + let win = std::env::var("SystemRoot").ok().and_then(|w| WidePath::parse(&w).ok()); + if let Some(w) = win { + assert!(pl.sealed.iter().any(|s| same_path(s, &w)), "the Windows folder is sealed: {:?}", pl.sealed); + assert_eq!(pl.check(&w, OpKind::NewFolder), Err(Refusal::Root)); + } + let temp = WidePath::parse(&std::env::temp_dir().to_string_lossy()).unwrap(); + assert!(pl.kept.iter().any(|k| same_path(k, &temp))); + assert!(!pl.kept_parents.is_empty() && pl.kept.len() > 6, "{pl:?}"); + } + + #[test] + fn what_each_kind_needs() { + assert_eq!(needs(OpKind::Recycle), (Some(Need::Remove), None)); + assert_eq!(needs(OpKind::DeletePermanent), (Some(Need::Remove), None)); + assert_eq!(needs(OpKind::Rename), (Some(Need::Remove), Some(Need::Add))); + assert_eq!(needs(OpKind::Move), (Some(Need::Remove), Some(Need::Add))); + assert_eq!(needs(OpKind::NewFolder), (None, Some(Need::Add))); + assert_eq!(needs(OpKind::Copy), (None, Some(Need::Add))); + } + + #[test] + fn the_system_look_reads_and_changes_nothing() { + let windows = std::env::var("SystemRoot").ok().and_then(|w| WidePath::parse(&w).ok()); + if let Some(w) = windows { + let l = look(&w, None); + assert!(l.real.as_ref().is_some_and(|r| same_path(r, &w)), "{l:?}"); + assert!(!l.volume_root && !l.denied); + let drive = WidePath::new(w.units().get(..3).unwrap()).unwrap(); + assert!(look(&drive, None).volume_root); + } + } +} diff --git a/apps/files/src/ops/runner.rs b/apps/files/src/ops/runner.rs index dd13beac..e7a4d27f 100644 --- a/apps/files/src/ops/runner.rs +++ b/apps/files/src/ops/runner.rs @@ -22,15 +22,16 @@ use windows::Win32::System::Com::{ }; use windows::Win32::UI::Shell::{ FileOperation, IFileOperation, IFileOperationProgressSink, IShellItem, SHCreateItemFromParsingName, - SHCreateItemFromRelativeName, COPYENGINE_E_RECYCLE_BIN_NOT_FOUND, FILEOPERATION_FLAGS, + SHCreateItemFromRelativeName, COPYENGINE_E_RECYCLE_BIN_NOT_FOUND, FILEOPERATION_FLAGS, FOF_RENAMEONCOLLISION, }; use super::binrec::{bin_record, forget_record, Forgot}; -use super::checks::check_item; +use super::checks::{check_item, same_path, within}; use super::classify::bin_turned_off; use super::consts::{CHUNK_ITEMS, DIALOGS_UNDER_SILENT, OWNER_ACROSS_PROCESSES, RESTORE_FROM_BIN}; use super::flags::op_flags; use super::journal::{EndKind, Header, JournalWriter, PathRepr, Pre, Record, St, StagedItems, VERSION}; +use super::places::{self, needs, removes, LookFn, Places}; use super::preflight::{preflight, skip_present, target_name}; use super::sink::{PostHook, Sink, SinkState}; use crate::own_files::OwnDir; @@ -136,6 +137,10 @@ pub struct RunCtx { pub slow_post_ms: u32, /// Whether an item's volume has its Recycle Bin turned off: classify::bin_turned_off (tests pass their own). pub bin_off: fn(&WidePath) -> bool, + /// The places this host never changes (places::system; tests pass their own). + pub places: Arc, + /// What the disk says of an item before IFileOperation exists: places::look (tests pass their own). + pub look: LookFn, } impl RunCtx { @@ -156,6 +161,8 @@ impl RunCtx { hook_record: None, slow_post_ms: 0, bin_off: bin_turned_off, + places: places::system(), + look: places::look, } } } @@ -194,7 +201,7 @@ pub fn undo_kind(kind: OpKind) -> Option { } /// The string form SHCreateItemFromParsingName gets: the plain path up to 259 units, the \\?\ form beyond. -fn parsing_form(p: &WidePath) -> Vec { +pub(crate) fn parsing_form(p: &WidePath) -> Vec { if p.units().len() <= 259 { let mut v = p.units().to_vec(); v.push(0); @@ -367,6 +374,14 @@ fn queued(w: &mut JournalWriter, work: &Work) { let _ = w.flush(Instant::now()); } +/// A copy whose every item is in the destination folder already (a paste into the items' own folder): no item is a +/// clash (preflight), and the shell names each copy as File Explorer does only under FOF_RENAMEONCOLLISION; otherwise +/// it finds the source and the destination to be the same file. +fn own_folder_copy(p: &Prepared) -> bool { + let in_dest = |d: &WidePath| p.items.iter().all(|s| s.parent().is_some_and(|f| same_path(&f, d))); + p.kind == OpKind::Copy && !p.items.is_empty() && p.dest.as_ref().is_some_and(in_dest) +} + /// Where item `k` of a chunk lands (for the journal): dest\name for Copy and Move, its new name for Rename. fn dest_of( kind: OpKind, @@ -423,6 +438,59 @@ fn refuse(ctx: &RunCtx, op: OpId, why: Refusal, item: &WidePath, out: &mut Outco out.result = Some(OpResult::Refused); } +/// What the disk says of a chunk before any IFileOperation exists (places.rs): each top-level item's real path passes +/// the places too, so an 8.3 alias, a substituted drive or a link on the way cannot hide one; so does the real path of +/// the folder that gains something (the destination, a new folder's parent, a renamed item's own folder), read with a +/// link in its last component followed, as IFileOperation follows it; a volume's root (a volume mounted in a folder +/// included) is never deleted, renamed or moved; and the user's own rights must allow what the operation needs on +/// each item and on that folder, else the chunk is refused with Elevated: IFileOperation would offer an elevation +/// prompt, and this host never shows one. The path at fault comes back. +fn on_disk(p: &Prepared, ctx: &RunCtx) -> Result<(), (Refusal, WidePath)> { + let (item_need, folder_need) = needs(p.kind); + let real_passes = |l: &places::Look, kind: OpKind| match &l.real { + Some(r) if removes(kind) && r.is_root() => Err(Refusal::Root), + Some(r) => ctx.places.check(r, kind), + None => Ok(()), + }; + let folder = |d: &WidePath, at: &WidePath| -> Result<(), (Refusal, WidePath)> { + let l = (ctx.look)(d, folder_need); + real_passes(&l, OpKind::Copy).map_err(|r| (r, at.clone()))?; + if l.denied { + return Err((Refusal::Elevated, at.clone())); + } + Ok(()) + }; + for (k, item) in p.items.iter().enumerate() { + let l = (ctx.look)(item, item_need); + if removes(p.kind) && l.volume_root { + return Err((Refusal::Root, item.clone())); + } + real_passes(&l, p.kind).map_err(|r| (r, item.clone()))?; + if l.denied { + return Err((Refusal::Elevated, item.clone())); + } + if p.kind == OpKind::Rename { + // The new name appears in the item's own folder. + if let Some(to) = dest_of(p.kind, item, None, p.name.as_deref(), &p.names, k) { + ctx.places.check(&to, OpKind::NewFolder).map_err(|r| (r, item.clone()))?; + } + if let Some(parent) = item.parent() { + folder(&parent, item)?; + } + } + } + if let Some(d) = &p.dest { + folder(d, d)?; + if p.kind == OpKind::NewFolder { + let made = p.name.as_deref().and_then(|n| d.join(&n.encode_utf16().collect::>()).ok()); + if let Some(made) = made { + ctx.places.check(&made, OpKind::NewFolder).map_err(|r| (r, d.clone()))?; + } + } + } + Ok(()) +} + fn run_chunk(p: &Prepared, ctx: &RunCtx, st: &Rc>, out: &mut Outcome) { let base = out.index; out.index = out.index.saturating_add(p.items.len() as u32); @@ -430,18 +498,21 @@ fn run_chunk(p: &Prepared, ctx: &RunCtx, st: &Rc>, out: &mut out.result = Some(OpResult::Cancelled); return; } - // Every item and destination passes the checks before any IFileOperation exists. + // Every item and destination passes the checks before any IFileOperation exists, by its text, then on disk. let roots = ctx.roots.as_deref(); for item in &p.items { - if let Err(why) = check_item(item, p.kind, roots) { + if let Err(why) = check_item(item, p.kind, roots, &ctx.places) { return refuse(ctx, p.op, why, item, out); } } if let Some(d) = &p.dest { - if let Err(why) = check_item(d, OpKind::Copy, roots) { + if let Err(why) = check_item(d, OpKind::Copy, roots, &ctx.places) { return refuse(ctx, p.op, why, d, out); } } + if let Err((why, at)) = on_disk(p, ctx) { + return refuse(ctx, p.op, why, &at, out); + } if !matches!( p.kind, OpKind::Copy | OpKind::Move | OpKind::Recycle | OpKind::DeletePermanent | OpKind::Rename | OpKind::NewFolder @@ -475,7 +546,10 @@ fn run_chunk(p: &Prepared, ctx: &RunCtx, st: &Rc>, out: &mut if keep.is_empty() && p.kind != OpKind::NewFolder { return; } - let flags = op_flags(p.kind, p.conflicts, collisions, ctx.dialogs_under_silent, ctx.test_no_ui); + let mut flags = op_flags(p.kind, p.conflicts, collisions, ctx.dialogs_under_silent, ctx.test_no_ui); + if own_folder_copy(p) { + flags |= FOF_RENAMEONCOLLISION.0; + } ctx.stats.created.fetch_add(1, Ordering::Relaxed); // SAFETY: COM is initialised on this thread (run); FileOperation is the shell's in-process class. let fo: IFileOperation = match unsafe { CoCreateInstance(&FileOperation, None, CLSCTX_ALL) } { @@ -532,7 +606,7 @@ fn forget_records(moved: &[(WidePath, Vec)], ctx: &RunCtx, st: &Rc)], ctx: &RunCtx, st: &Rc) -> bool { + roots.is_none_or(|r| r.iter().any(|root| within(rec, root))) +} + /// Queues one operation per kept item; an item or destination the shell cannot parse fails alone, and so does a /// Recycle item on a volume whose bin is turned off. True when at least one operation was queued. fn queue_items( @@ -630,6 +711,20 @@ mod tests { } } + #[test] + fn a_record_in_a_volumes_own_bin_is_judged_by_the_fence_alone() { + // A volume's real bin lies at its root, where the places refuse every name that starts with '$'. The record is + // the bin's own bookkeeping, never a user's item: only the test fence judges it, else the record of every item + // restored from a real bin would stay behind as an orphan. + let rec = WidePath::parse(r"C:\$Recycle.Bin\S-1-5-21-1\$IAB12CD.txt").unwrap(); + let bin = rec.parent().unwrap(); + let other = WidePath::parse(r"C:\T\mod-files-test-1-0").unwrap(); + assert!(record_in_fence(&rec, None), "no fence (a release build)"); + assert!(record_in_fence(&rec, Some(&[other.clone(), bin])), "the bin folder the item went back from"); + assert!(!record_in_fence(&rec, Some(std::slice::from_ref(&other))), "a bin folder outside the fence"); + assert!(!record_in_fence(&rec, Some(&[])), "an empty fence holds nothing"); + } + #[test] fn parsing_form_switches_at_260() { let short = WidePath::parse(&format!("C:\\{}", "a".repeat(256))).unwrap(); diff --git a/apps/files/src/ops_ui.rs b/apps/files/src/ops_ui.rs index bc178bed..a86e5674 100644 --- a/apps/files/src/ops_ui.rs +++ b/apps/files/src/ops_ui.rs @@ -38,9 +38,12 @@ use crate::undo::{self, UndoEntry}; use crate::window::{self, FilesScreen, Shared, WinKind}; use crate::{bar, bg, names}; -/// A change the window asks for. +/// A change the window asks for. Copy and Move are a paste into dest; a Move's clip is the clipboard's sequence number +/// while it held the items (the move's end empties the clipboard when it still does). #[derive(Clone, Debug, PartialEq, Eq)] pub enum MutReq { + Copy { items: Vec, dest: WidePath }, + Move { items: Vec, dest: WidePath, clip: Option }, Recycle(Vec), DeletePermanent(Vec), Rename { item: WidePath, to: String }, @@ -56,6 +59,9 @@ pub enum MutReq { fn paths_of(shared: &Shared, r: &MutReq) -> Option> { let joined = |dir: &WidePath, name: &str| dir.join(&name.encode_utf16().collect::>()).ok(); Some(match r { + MutReq::Copy { items, dest } | MutReq::Move { items, dest, .. } => { + items.iter().chain(std::iter::once(dest)).cloned().collect() + } MutReq::Recycle(items) | MutReq::DeletePermanent(items) => items.clone(), MutReq::Rename { item, to } => vec![item.clone(), joined(&item.parent()?, to)?], MutReq::NewFolder { parent, name } => vec![parent.clone(), joined(parent, name)?], @@ -74,8 +80,8 @@ fn item_refs(items: &[WidePath]) -> Vec { } /// The gate, then the OpsService call. A destination that cannot be formed: the forbidden-name notice, nothing sent. -/// Refused by the gate: the preview_gate notice, nothing sent. The host unavailable: host_lost with Retry. Refused by -/// the host: its reason. Accepted: on_accepted, Some(op). +/// Refused by the gate: the not-available notice with Open in File Explorer, nothing sent. The host unavailable: +/// host_lost with Retry. Refused by the host: its reason (refusal_notice). Accepted: on_accepted, Some(op). pub fn request(s: &mut FilesScreen, cx: &mut EventCx, r: MutReq) -> Option { let lang = cx.lang(); let Some(paths) = paths_of(&s.shared, &r) else { @@ -83,12 +89,15 @@ pub fn request(s: &mut FilesScreen, cx: &mut EventCx, r: MutReq) -> Option return None; }; let refs: Vec<&WidePath> = paths.iter().collect(); - if !gate::may_mutate(&refs) { - status::notice(s, cx, Notice::new(t(k::FILES_OPS_PREVIEW_GATE, lang))); + let pasted = matches!(r, MutReq::Copy { .. } | MutReq::Move { .. }); + if !gate::may_mutate(&refs) || (pasted && !s.shared.paste_live.get()) { + crate::menu::not_in_beta(s, cx); return None; } let ops = std::rc::Rc::clone(&s.shared.services.ops); let res = match &r { + MutReq::Copy { items, dest } => ops.copy(&item_refs(items), dest), + MutReq::Move { items, dest, .. } => ops.move_to(&item_refs(items), dest), MutReq::Recycle(items) => ops.recycle(&item_refs(items)), MutReq::DeletePermanent(items) => ops.delete_permanent(&item_refs(items)), MutReq::Rename { item, to } => ops.rename(item, to), @@ -108,7 +117,8 @@ pub fn request(s: &mut FilesScreen, cx: &mut EventCx, r: MutReq) -> Option None } Err(OpsError::Refused(why)) => { - status::notice(s, cx, Notice::new(refusal_text(&why, lang))); + let fmt = s.shared.fmt.borrow().clone(); + status::notice(s, cx, refusal_notice(&why, "", 0, lang, &fmt)); None } } @@ -179,6 +189,10 @@ pub struct OpRow { /// The row to focus once this delete's removals arrive (SPEC-files 5.4.6), and whether they did. pub focus: Option>, pub focus_due: bool, + /// A failed item's rights were short (rights_hr): its window was told once, with Open in File Explorer. + pub rights_noted: bool, + /// A move of the clipboard's files: the clipboard's sequence number then (taken once it is done). + pub clip: Option, } impl OpRow { @@ -206,6 +220,8 @@ impl OpRow { redo: false, focus: None, focus_due: false, + rights_noted: false, + clip: None, } } @@ -278,6 +294,11 @@ impl OpsModel { self.rows.iter().filter(|r| r.state.running()).count() } + /// A move of the clipboard's files of sequence number `seq` is asked for or running. + pub fn moving(&self, seq: u32) -> bool { + self.rows.iter().any(|r| r.state.running() && r.clip == Some(seq)) + } + /// The items an operation was asked to change (none for an operation of an earlier process). pub fn items_of(&self, op: OpId) -> Vec { match self.row(op) { @@ -426,6 +447,11 @@ impl OpsModel { } } +/// The undo kinds whose operation Redo can ask for again. +fn redoable(k: UndoKind) -> bool { + !matches!(k, UndoKind::MoveBack | UndoKind::RecycleCopies) +} + /// The kind an undo record undoes. fn forward_kind(k: UndoKind) -> OpKind { match k { @@ -447,6 +473,8 @@ pub fn on_accepted(s: &mut FilesScreen, cx: &mut EventCx, op: OpId, r: &MutReq) let _ = cx; let shared = Rc::clone(&s.shared); let (kind, items, folder, name) = match r { + MutReq::Copy { items, dest } => (OpKind::Copy, items.clone(), Some(dest.clone()), None), + MutReq::Move { items, dest, .. } => (OpKind::Move, items.clone(), Some(dest.clone()), None), MutReq::Recycle(v) => (OpKind::Recycle, v.clone(), v.first().and_then(WidePath::parent), None), MutReq::DeletePermanent(v) => (OpKind::DeletePermanent, v.clone(), v.first().and_then(WidePath::parent), None), MutReq::Rename { item, to } => (OpKind::Rename, vec![item.clone()], item.parent(), Some(to.clone())), @@ -484,6 +512,9 @@ pub fn on_accepted(s: &mut FilesScreen, cx: &mut EventCx, op: OpId, r: &MutReq) if let MutReq::Undo(rec) = r { row.undo_of = Some(rec.clone()); } + if let MutReq::Move { clip, .. } = r { + row.clip = *clip; + } m.rows.retain(|x| x.op != op); m.rows.push(row); redo @@ -523,28 +554,63 @@ pub fn refusal_text(r: &Refusal, lang: UiLang) -> Text { refusal_text_with(r, "", 0, lang, &Fmt::fixed_en()) } -/// The text of a refusal with its detail (the name an undo found changed) and, for Replaced, the count the undo -/// record carries. Undo refusals are shown as they are (F3.3); the rest map to the nearest text the table has. +/// The text of a refusal with its detail (the name an undo found changed, the item or folder refused) and, for +/// Replaced, the count the undo record carries. Undo refusals are shown as they are; a place the host never changes +/// and rights the user lacks say so, with the name when there is one; the rest map to the nearest text the table has. pub fn refusal_text_with(r: &Refusal, detail: &str, replaced: u32, lang: UiLang, fmt: &Fmt) -> Text { + let named = |with: oled_sys::i18n::S, without: oled_sys::i18n::S| { + if detail.is_empty() { + t(without, lang) + } else { + tf(with, lang, &[("name", detail)]) + } + }; match r { Refusal::Replaced => tf(k::FILES_OPS_UNDO_REPLACED, lang, &[("n", &fmt.count(u64::from(replaced)))]), Refusal::Changed => tf(k::FILES_OPS_UNDO_CHANGED, lang, &[("name", detail)]), Refusal::NotEmpty => tf(k::FILES_OPS_UNDO_NOT_EMPTY, lang, &[("name", detail)]), Refusal::OutsideTestRoot => t(k::FILES_OPS_PREVIEW_GATE, lang), Refusal::BadName => t(k::FILES_RENAME_FORBIDDEN, lang), - Refusal::Root - | Refusal::BadPath - | Refusal::MixedParents - | Refusal::TooMany - | Refusal::Elevated - | Refusal::PauseUnsupported => t(k::FILES_MENU_NOT_IN_BETA, lang), + Refusal::Root => named(k::FILES_OPS_REFUSED_PLACE, k::FILES_OPS_REFUSED_PLACE_PLAIN), + Refusal::Elevated => named(k::FILES_OPS_REFUSED_RIGHTS, k::FILES_OPS_REFUSED_RIGHTS_PLAIN), + Refusal::BadPath | Refusal::MixedParents | Refusal::TooMany | Refusal::PauseUnsupported => { + t(k::FILES_MENU_NOT_IN_BETA, lang) + } Refusal::NoItems | Refusal::UnknownOp | Refusal::OpInUse => t(k::FILES_OPS_HOST_LOST, lang), } } +/// A refusal as its notice: a place the host never changes and rights the user lacks offer Open in File Explorer +/// (File Explorer can do it, or ask for an administrator's rights); any other refusal is its text alone. +pub fn refusal_notice(r: &Refusal, detail: &str, replaced: u32, lang: UiLang, fmt: &Fmt) -> Notice { + let text = refusal_text_with(r, detail, replaced, lang, fmt); + let action = matches!(r, Refusal::Root | Refusal::Elevated) + .then(|| (t(k::FILES_ACTION_OPEN_EXPLORER_ARROW, lang), NoticeAct::OpenInExplorer)); + Notice { action, ..Notice::new(text) } +} + +/// The HRESULTs of an item the user's own rights could not change (access denied, an elevation the shell would ask +/// for, a privilege not held). +pub fn rights_hr(hr: i32) -> bool { + use windows::Win32::Foundation::{ERROR_ELEVATION_REQUIRED, ERROR_PRIVILEGE_NOT_HELD, E_ACCESSDENIED}; + use windows::Win32::UI::Shell::{ + COPYENGINE_E_ACCESS_DENIED_DEST, COPYENGINE_E_ACCESS_DENIED_SRC, COPYENGINE_E_REQUIRES_ELEVATION, + }; + [ + E_ACCESSDENIED, + ERROR_ELEVATION_REQUIRED.to_hresult(), + ERROR_PRIVILEGE_NOT_HELD.to_hresult(), + COPYENGINE_E_REQUIRES_ELEVATION, + COPYENGINE_E_ACCESS_DENIED_SRC, + COPYENGINE_E_ACCESS_DENIED_DEST, + ] + .iter() + .any(|h| h.0 == hr) +} + fn render(p: &Pend, lang: UiLang, fmt: &Fmt) -> Notice { match p { - Pend::Refused { why, detail, replaced } => Notice::new(refusal_text_with(why, detail, *replaced, lang, fmt)), + Pend::Refused { why, detail, replaced } => refusal_notice(why, detail, *replaced, lang, fmt), Pend::HostLost => Notice::new(t(k::FILES_OPS_HOST_LOST, lang)), Pend::Pending { of, kind, done, total } => { let (done, total) = (fmt.count(u64::from(*done)), fmt.count(u64::from(*total))); @@ -690,9 +756,17 @@ fn on_evt(shared: &Shared, e: OpEvt, active: u32) -> bool { OpEvt::ItemFailed { op, item, hr } => { let Some(r) = m.row_mut(op) else { return false }; r.failed = r.failed.saturating_add(1); + // Rights the user lacks (a nested item of a permanent delete, under FOF_NOERRORUI): the window hears it + // once, with Open in File Explorer, which can ask an administrator. + let rights = rights_hr(hr) && !r.rights_noted; + r.rights_noted |= rights; + let (win, name) = (r.win, name_of(&item)); if r.failures.len() < FAILURES_KEPT { r.failures.push((item, win_message(hr))); } + if rights { + m.notice(win, Pend::Refused { why: Refusal::Elevated, detail: name, replaced: 0 }); + } true } OpEvt::Finished { op, result, undo, items, failed, .. } => { @@ -710,7 +784,8 @@ fn on_evt(shared: &Shared, e: OpEvt, active: u32) -> bool { } r.done = r.total; if result == OpResult::Done { - redo = r.undo_of.clone().map(|rec| (op, rec)); + // Copies and moves are not done again (Redo has nothing for them): their undo pushes no redo. + redo = r.undo_of.clone().filter(|rec| redoable(rec.kind)).map(|rec| (op, rec)); } true } @@ -776,11 +851,16 @@ pub fn on_fwd_ops(s: &mut FilesScreen, cx: &mut EventCx) { let now = cx.now_ms(); let shared = Rc::clone(&s.shared); let fmt = shared.fmt.borrow().clone(); - let (notices, acks, focus) = { + let (notices, acks, focus, clips) = { let mut m = shared.ops.borrow_mut(); m.stamp(now); let notices = m.take_notices_in(s.win, cx.lang(), &fmt); let acks = m.take_acks(s.win); + // A paste of the clipboard's cut items that is done: the clipboard is emptied once (clip_files::paste_done). + let mut clips = Vec::new(); + for r in m.rows.iter_mut().filter(|r| r.win == s.win && r.state == OpState::Done) { + clips.extend(r.clip.take()); + } let mut focus = Vec::new(); for r in m.rows.iter_mut().filter(|r| r.win == s.win && r.focus_due) { r.focus_due = false; @@ -790,11 +870,14 @@ pub fn on_fwd_ops(s: &mut FilesScreen, cx: &mut EventCx) { focus.push((folder, name)); } } - (notices, acks, focus) + (notices, acks, focus, clips) }; for n in notices { status::notice(s, cx, n); } + for seq in clips { + crate::clip_files::paste_done(s, cx, seq); + } for of in acks { shared.services.ops.ack_done(of); } @@ -1032,7 +1115,7 @@ pub fn f3_items(s: &FilesScreen, sel: &[WidePath]) -> Vec { out } -/// Recycle, DeletePermanent, Undo, Redo, OpsFlyout. +/// Recycle (the classified Del flow), DeletePermanent (the bar), Undo, Redo, OpsFlyout. pub fn cmd(s: &mut FilesScreen, cx: &mut EventCx, c: Cmd) -> Reply { match c { Cmd::Recycle => { @@ -1040,12 +1123,14 @@ pub fn cmd(s: &mut FilesScreen, cx: &mut EventCx, c: Cmd) -> Reply { delete_flow(s, cx, items) } Cmd::DeletePermanent => { + // Shift+Del and the menu's Delete permanently ask first: the bar, and only its fresh Enter (or its Delete + // button) sends DeletePermanent. let items = selected(s); if items.is_empty() { return Reply::None; } - request(s, cx, MutReq::DeletePermanent(items)); - Reply::Redraw + bar::ask_permanent(s, cx, items); + Reply::Relayout } Cmd::Undo => undo::undo(s, cx), Cmd::Redo => undo::redo(s, cx), @@ -1078,22 +1163,43 @@ fn counted(n: u64, one: oled_sys::i18n::S, other: oled_sys::i18n::S, lang: UiLan } } -/// What a running operation does: "Deleting 14 items", "Renaming notes.txt". +/// The name of an operation's folder as the address row names it ("Download", "D:"). +fn folder_name(r: &OpRow, lang: UiLang) -> String { + let at = r.folder.clone().map(oled_trust::frame::files::Location::Fs); + at.map(|l| crate::toolbar::place_name(&l, lang)).unwrap_or_default() +} + +/// A count and a folder's name in one of two keys (one item, more). +fn counted_in(n: u64, one: oled_sys::i18n::S, other: oled_sys::i18n::S, name: &str, lang: UiLang, fmt: &Fmt) -> Text { + if n == 1 { + tf(one, lang, &[("name", name)]) + } else { + tf(other, lang, &[("n", &fmt.count(n)), ("name", name)]) + } +} + +/// What a running operation does: "Deleting 14 items", "Renaming notes.txt", "Copying to Download: 3 items". pub fn what_text(r: &OpRow, lang: UiLang, fmt: &Fmt) -> Text { let n = r.count.max(r.items.len() as u64); let item_name = r.items.first().map(name_of).unwrap_or_default(); match r.kind { + OpKind::Copy => { + counted_in(n, k::FILES_OPS_COPYING_ONE, k::FILES_OPS_COPYING_OTHER, &folder_name(r, lang), lang, fmt) + } + OpKind::Move => { + counted_in(n, k::FILES_OPS_MOVING_ONE, k::FILES_OPS_MOVING_OTHER, &folder_name(r, lang), lang, fmt) + } OpKind::Recycle => counted(n, k::FILES_OPS_RECYCLING_ONE, k::FILES_OPS_RECYCLING_OTHER, lang, fmt), OpKind::Rename => tf(k::FILES_OPS_RENAMING, lang, &[("name", &item_name)]), OpKind::NewFolder => tf(k::FILES_OPS_CREATING, lang, &[("name", r.name.as_deref().unwrap_or_default())]), OpKind::Undo => match r.undo_of.as_ref().map(|u| u.kind) { Some(UndoKind::RenameBack) => tf(k::FILES_OPS_RENAMING, lang, &[("name", &undo_to_name(r))]), - Some(UndoKind::RecycleNewFolder) => { + Some(UndoKind::RecycleNewFolder | UndoKind::RecycleCopies) => { counted(n, k::FILES_OPS_RECYCLING_ONE, k::FILES_OPS_RECYCLING_OTHER, lang, fmt) } _ => counted(n, k::FILES_OPS_RESTORING_ONE, k::FILES_OPS_RESTORING_OTHER, lang, fmt), }, - OpKind::DeletePermanent | OpKind::Copy | OpKind::Move | OpKind::Resume => { + OpKind::DeletePermanent | OpKind::Resume => { counted(n, k::FILES_OPS_DELETING_ONE, k::FILES_OPS_DELETING_OTHER, lang, fmt) } } @@ -1104,10 +1210,18 @@ fn undo_to_name(r: &OpRow) -> String { r.undo_of.as_ref().and_then(|u| u.entries.first()).map(|e| name_of(&e.to)).unwrap_or_default() } -/// What a finished operation did: "Deleted 14 items", "Renamed to b.txt". +/// What a finished operation did: "Deleted 14 items", "Renamed to b.txt", "Copied 3 items to Download". pub fn done_text(r: &OpRow, lang: UiLang, fmt: &Fmt) -> Text { let n = r.count.max(r.items.len() as u64); match r.kind { + OpKind::Copy => { + let name = folder_name(r, lang); + counted_in(n, k::FILES_OPS_DONE_COPIED_ONE, k::FILES_OPS_DONE_COPIED_OTHER, &name, lang, fmt) + } + OpKind::Move => { + let name = folder_name(r, lang); + counted_in(n, k::FILES_OPS_DONE_MOVED_ONE, k::FILES_OPS_DONE_MOVED_OTHER, &name, lang, fmt) + } OpKind::Recycle => counted(n, k::FILES_OPS_DONE_RECYCLED_ONE, k::FILES_OPS_DONE_RECYCLED_OTHER, lang, fmt), OpKind::Rename => tf(k::FILES_OPS_DONE_RENAMED, lang, &[("name", r.name.as_deref().unwrap_or_default())]), OpKind::NewFolder => tf(k::FILES_OPS_DONE_CREATED, lang, &[("name", r.name.as_deref().unwrap_or_default())]), @@ -1116,12 +1230,12 @@ pub fn done_text(r: &OpRow, lang: UiLang, fmt: &Fmt) -> Text { let back = r.undo_of.as_ref().and_then(|u| u.entries.first()).map(|e| name_of(&e.from)); tf(k::FILES_OPS_DONE_RENAMED, lang, &[("name", &back.unwrap_or_default())]) } - Some(UndoKind::RecycleNewFolder) => { + Some(UndoKind::RecycleNewFolder | UndoKind::RecycleCopies) => { counted(n, k::FILES_OPS_DONE_RECYCLED_ONE, k::FILES_OPS_DONE_RECYCLED_OTHER, lang, fmt) } _ => tf(k::FILES_OPS_DONE_RESTORED_OTHER, lang, &[("n", &fmt.count(n))]), }, - OpKind::DeletePermanent | OpKind::Copy | OpKind::Move | OpKind::Resume => { + OpKind::DeletePermanent | OpKind::Resume => { counted(n, k::FILES_OPS_DONE_DELETED_ONE, k::FILES_OPS_DONE_DELETED_OTHER, lang, fmt) } } @@ -1181,7 +1295,13 @@ pub fn chip_text(m: &OpsModel, undo_top: Option, now: u64, lang: UiLang, f [] => {} [one] => { let what = what_text(one, lang, fmt); - let text = tf(k::FILES_OPS_CHIP, lang, &[("what", &what), ("p", &p.to_string())]); + // A paste reads "Copying to Download: 3 items, 62 %". + let key = if matches!(one.kind, OpKind::Copy | OpKind::Move) { + k::FILES_OPS_CHIP_PASTE + } else { + k::FILES_OPS_CHIP + }; + let text = tf(key, lang, &[("what", &what), ("p", &p.to_string())]); return Some(ChipText { text, failed: None, undo: None, attention: None, count: None }); } many => { @@ -1277,6 +1397,11 @@ impl Flyout { self.open } + /// The chip's backdrop (the chip and the margin that hides what runs under it), when a chip is shown. + pub fn chip_back(&self) -> Option { + self.chip.text.as_ref().map(|_| self.chip.back) + } + /// The chip's rect and text as laid out. pub fn chip(&self) -> Option<(RectP, String)> { let c = self.chip.text.as_ref()?; diff --git a/apps/files/src/options.rs b/apps/files/src/options.rs index 1babcfbe..b974bf5f 100644 --- a/apps/files/src/options.rs +++ b/apps/files/src/options.rs @@ -83,7 +83,7 @@ options! { since: 1, reason: "The sidebar can be hidden.", ui: None, }, /// 160..=400. - pub sidebar_width: u16 = 200 => { + pub sidebar_width: u16 = 224 => { json: "sidebar_width", slot: 7, fmt: Raw, gap: false, guide: "The sidebar's width in pixels, from 160 to 400.", since: 1, reason: "The sidebar can be resized.", ui: None, @@ -117,6 +117,12 @@ options! { guide: "Set once the pins of the system's Quick access have been imported: true or false.", since: 1, reason: "The import runs once.", ui: None, }, + /// The details pane at the right of the list. + pub details_pane: bool = true => { + json: "details_pane", slot: 13, fmt: Raw, gap: true, + guide: "Show the details pane at the right of the list: true or false. A window narrower than 960 px hides it by itself without changing this.", + since: 1, reason: "The pane can be hidden.", ui: None, + }, } } diff --git a/apps/files/src/pathline.rs b/apps/files/src/pathline.rs index 7831e6bd..b0060c62 100644 --- a/apps/files/src/pathline.rs +++ b/apps/files/src/pathline.rs @@ -23,8 +23,8 @@ const COMMAND_MAX: usize = 8 * 1024; pub(crate) const ID_PATH: WidgetId = WidgetId(23); -/// The height of the bar's cell: the toolbar's button row (logical px). -const CELL_H: i32 = 28; +/// The height of the path field (logical px). +const CELL_H: i32 = 32; /// One segment of the shown location: its label, the place a click on it goes to, and its own folder name (what the /// level below it focuses when a click comes back up to this one). @@ -141,7 +141,7 @@ impl Default for PathLine { impl PathLine { pub fn new() -> PathLine { PathLine { - bar: PathBar::new(ID_PATH), + bar: PathBar::new(ID_PATH).with_click_look(), shown: None, segs: Vec::new(), completer: Completer::new(), @@ -196,8 +196,17 @@ pub fn layout(s: &mut FilesScreen, cx: &mut LayoutCx, r: RectP) { let offline = *s.tabs.active().nav.page() == Page::Offline; let h = cx.px(CELL_H); let top = (r.t + r.b) / 2 - h / 2; + s.chrome.path.follow(lang, &at); + // The art of the first segment's place, drawn before its name. + let art = { + let known = s.shared.known.borrow(); + let drives = s.shared.drives.borrow(); + let px = s.art.key().small; + let first = s.chrome.path.segs.first(); + first.map(|g| s.art.shared(crate::icons::location_art(&g.at, &known, drives.all()), px)) + }; let me = &mut s.chrome.path; - me.follow(lang, &at); + me.bar.set_first_art(art); me.bar.set_offline(offline); me.bar.layout(cx, RectP { t: top, b: top + h, ..r }); } diff --git a/apps/files/src/preview/command_bar.rs b/apps/files/src/preview/command_bar.rs new file mode 100644 index 00000000..82ec5a3c --- /dev/null +++ b/apps/files/src/preview/command_bar.rs @@ -0,0 +1,203 @@ +//! Preview scenes of the address row and command bar: the window at three widths, each menu open, the tooltip of +//! a disabled button, the keyboard focus on Rename with its tooltip, and the hover hint of a row. + +use std::rc::Rc; + +use oled_ui::harness::Harness; +use oled_ui::host::Caption; +use oled_ui::{CommandId, PointL, SizeL}; + +use super::fixtures::{self, settle, ROOT}; +use super::{Cells, Scene}; +use crate::fakes::Fakes; +use crate::format::Fmt; +use crate::keys::Cmd; +use crate::toolbar; +use crate::toolmenus::{btn, DockLink}; +use crate::window::FilesScreen; + +/// A dock that is, or is not, running; nothing is posted. +struct FakeDock(bool); + +impl DockLink for FakeDock { + fn running(&self) -> bool { + self.0 + } + + fn open_appearance(&self) -> bool { + self.0 + } +} + +fn documents(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + fakes.enumr.queue(&fixtures::wp(ROOT), fixtures::documents()); + fixtures::open(fakes, fmt, ROOT) +} + +/// The folder is one where files may change (a test or live root), and a dock runs. +fn live(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + let s = documents(fakes, fmt); + s.toolbar().force_changes(Some(true)); + *s.shared().dock.borrow_mut() = Rc::new(FakeDock(true)); + s +} + +/// The folder is a real one (files may not change) and no dock runs: what a first start shows. +fn real(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + let s = documents(fakes, fmt); + s.toolbar().force_changes(Some(false)); + *s.shared().dock.borrow_mut() = Rc::new(FakeDock(false)); + s +} + +/// The physical px of the render to the logical px the harness takes. +fn at(h: &mut Harness, width: i32, r: oled_ui::RectP) -> PointL { + let scale = f64::from(h.render().w) / f64::from(width); + let logical = |px: i32| (f64::from(px) / scale).round() as i32; + PointL { x: logical((r.l + r.r) / 2), y: logical((r.t + r.b) / 2) } +} + +/// Clicks the bar's button `id` at the centre of its own rect. +pub fn click_command(h: &mut Harness, width: i32, id: u32) { + let r = h.screen().toolbar().bar().rect_of(CommandId(id)); + if let Some(r) = r { + let p = at(h, width, r); + h.click(p); + } + h.render(); +} + +/// Moves the keyboard focus to the bar's node `target`: Tab to the bar's one stop, then the arrows. +fn focus_node(h: &mut Harness, target: Option) { + h.render(); + let Some(target) = target else { return }; + for _ in 0..24 { + if h.focused() == Some(target) { + return; + } + let on_bar = h.focused().is_some_and(|n| n.owner() == target.owner()); + h.key(if on_bar { "Right" } else { "Tab" }); + h.render(); + } +} + +/// The More button: focused with the keys, opened with Enter. +pub fn open_more(h: &mut Harness) { + let target = toolbar::more_node(h.screen()); + focus_node(h, target); + h.key("Enter"); + h.render(); +} + +fn open_button(h: &mut Harness, width: i32, id: u32) { + h.render(); + click_command(h, width, id); +} + +const WIDE: SizeL = SizeL { w: 1280, h: 720 }; +const MIDDLE: SizeL = SizeL { w: 900, h: 600 }; +const NARROW: SizeL = SizeL { w: 640, h: 480 }; + +fn scene( + name: &'static str, + size: SizeL, + cells: Cells, + build: fn(&Fakes, Fmt) -> FilesScreen, + script: fn(&mut Harness, &Fakes), +) -> Scene { + Scene { name, size, cells, caption: Caption::System, build, script } +} + +fn wide(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + h.key("Home").key("Down").key("Down"); + h.render(); +} + +fn middle(h: &mut Harness, fakes: &Fakes) { + wide(h, fakes); +} + +fn narrow(h: &mut Harness, fakes: &Fakes) { + wide(h, fakes); +} + +fn nothing_selected(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + h.render(); +} + +fn menu_new(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + open_button(h, MIDDLE.w, btn::NEW); +} + +fn menu_sort(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + open_button(h, MIDDLE.w, btn::SORT); +} + +fn menu_view(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + open_button(h, MIDDLE.w, btn::VIEW); +} + +fn menu_more(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + open_more(h); +} + +/// More at 640: the buttons that folded are its first rows. +fn menu_more_narrow(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + open_more(h); +} + +/// Paste is off while the clipboard commands wait for their switch: its tooltip says so. +fn tip_disabled(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + h.screen_mut().toolbar_mut().preview_tip(Some(CommandId(Cmd::Paste as u32))); + h.render(); +} + +/// The keyboard focus on Rename, with its tooltip. +fn focus_rename(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + h.key("Home").key("Down").key("Down"); + h.render(); + let target = toolbar::command_node(h.screen(), Cmd::Rename as u32); + focus_node(h, target); + h.screen_mut().toolbar_mut().preview_tip(Some(CommandId(Cmd::Rename as u32))); + h.render(); +} + +/// The pointer rests on a row: after the hover delay its hint shows after the name. +fn hover_hint(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + let r = h.screen().tabs().active().table.row_rect(1); + if let Some(r) = r { + let p = at(h, MIDDLE.w, r); + h.hover(p); + h.advance(600); + } + h.render(); +} + +/// This file's scenes. +pub fn scenes() -> Vec { + vec![ + scene("cmdbar_wide", WIDE, Cells::Full12, live, wide), + scene("cmdbar_middle", MIDDLE, Cells::Four, live, middle), + scene("cmdbar_narrow", NARROW, Cells::Four, live, narrow), + scene("cmdbar_alpha", MIDDLE, Cells::Four, real, nothing_selected), + scene("cmdbar_menu_new", MIDDLE, Cells::Four, live, menu_new), + scene("cmdbar_menu_sort", MIDDLE, Cells::Four, live, menu_sort), + scene("cmdbar_menu_view", MIDDLE, Cells::Four, live, menu_view), + scene("cmdbar_menu_more", MIDDLE, Cells::Four, live, menu_more), + scene("cmdbar_menu_more_nodock", MIDDLE, Cells::Four, real, menu_more), + scene("cmdbar_menu_more_narrow", NARROW, Cells::Four, live, menu_more_narrow), + scene("cmdbar_tip_disabled", MIDDLE, Cells::Four, real, tip_disabled), + scene("cmdbar_focus_rename", MIDDLE, Cells::Four, live, focus_rename), + scene("cmdbar_hover_hint", MIDDLE, Cells::Full12, live, hover_hint), + ] +} diff --git a/apps/files/src/preview/details_pane.rs b/apps/files/src/preview/details_pane.rs new file mode 100644 index 00000000..908f5481 --- /dev/null +++ b/apps/files/src/preview/details_pane.rs @@ -0,0 +1,176 @@ +//! Preview scenes of the details pane: a file, a program with its Windows icon at 48 px, a folder, nothing selected, +//! several items with folders among them, a long name, the pane switched off, a window too narrow for it, the keyboard +//! on it and the View menu that switches it. + +use std::rc::Rc; + +use oled_trust::frame::files::{ItemRef, Pixels, ShellEvt, ShellReq}; +use oled_ui::harness::Harness; +use oled_ui::host::Caption; +use oled_ui::SizeL; + +use super::command_bar::click_command; +use super::fixtures::{self, settle, ROOT}; +use super::{Cells, Scene}; +use crate::drives::{DriveInfo, DriveKind}; +use crate::fakes::Fakes; +use crate::format::Fmt; +use crate::options::FilesOptions; +use crate::shell_client::ShellReply; +use crate::toolmenus::btn; +use crate::window::FilesScreen; + +const WIDE: SizeL = SizeL { w: 1280, h: 720 }; +const MIDDLE: SizeL = SizeL { w: 900, h: 600 }; + +/// The rows of fixtures::documents(), in the order the list shows them (the hidden file is not listed). +const INVOICES: usize = 0; +const PROJECTS: usize = 2; +const REPORT_V3: usize = 7; +const SETUP: usize = 8; + +fn documents(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + fakes.enumr.queue(&fixtures::wp(ROOT), fixtures::documents()); + let s = fixtures::open(fakes, fmt, ROOT); + s.shared().drives.borrow_mut().set(DriveInfo { + letter: b'C', + label: Some("System".into()), + kind: DriveKind::Fixed, + free: Some(412_000_000_000), + total: Some(1_810_000_000_000), + ready: true, + }); + s +} + +fn documents_off(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + fakes.options.set(FilesOptions { details_pane: false, ..FilesOptions::default() }); + documents(fakes, fmt) +} + +/// The list's first row, then `n` rows down. +fn pick(h: &mut Harness, n: usize) { + h.key("Home"); + for _ in 0..n { + h.key("Down"); + } + h.render(); +} + +fn file(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + pick(h, REPORT_V3); +} + +fn folder(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + pick(h, PROJECTS); +} + +fn nothing(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + h.screen_mut().pane_mut().force_folder_time(Some(fixtures::NOW - 3 * 24 * 600_000_000 * 60)); + h.render(); +} + +/// A folder and two files. +fn several(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + pick(h, PROJECTS); + h.key("Shift+Down").key("Shift+Down"); + h.render(); +} + +/// A folder with one file whose name runs past three lines. +fn long_listing(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + let name = "contract draft for the apartment on the long street 07 with every annex, the signatures of everyone \ + and the notes of the notary, final version after the last review of the board.docx"; + let rows = [(name, false, 48_500u64, fixtures::NOW - 14 * 24 * 600_000_000 * 60)]; + fakes.enumr.queue(&fixtures::wp(ROOT), crate::fakes::listing(&rows)); + fixtures::open(fakes, fmt, ROOT) +} + +fn long_name(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + pick(h, 0); +} + +fn focused(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + pick(h, REPORT_V3); + h.key("F6"); + h.render(); +} + +fn view_menu(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + pick(h, REPORT_V3); + click_command(h, WIDE.w, btn::VIEW); +} + +/// A made-up program icon: a soft square, premultiplied BGRA. +fn made_up_icon(side: u16) -> Pixels { + let n = usize::from(side); + let mut bgra = Vec::with_capacity(n * n * 4); + for y in 0..n { + for x in 0..n { + let inside = x >= n / 8 && x < n - n / 8 && y >= n / 8 && y < n - n / 8; + let (b, g, r, a) = if inside { (230u32, 150 + (y * 90 / n) as u32, 60, 255u32) } else { (0, 0, 0, 0) }; + bgra.extend_from_slice(&[b as u8, g as u8, r as u8, a as u8]); + } + } + Pixels { w: side, h: side, bgra: bgra.into_boxed_slice() } +} + +/// The program: the host is warm, the pane asks for its Windows icon, and the answer comes back. +fn program(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + let shared = Rc::clone(h.screen().shared()); + shared.first_frame_done.set(true); + shared.host_warm.set(true); + pick(h, SETUP - 1); + h.key("Down").key("Up").key("Down"); + let want = ItemRef::Path(fixtures::wp(&format!(r"{ROOT}\setup-tool-1.4.2.exe"))); + // The pane's own request is the one for a single item at the largest size (the rows ask at their row size). + let asked = fakes + .shell + .requests() + .into_iter() + .filter_map(|r| match r { + ShellReq::Icons { req, gen, items, px } if items == [want.clone()] => Some((req, gen, px)), + _ => None, + }) + .max_by_key(|(_, _, px)| *px); + if let Some((req, gen, px)) = asked { + fakes.shell.reply(ShellReply::Evt(ShellEvt::Icon { req, gen, index: 0, px: made_up_icon(px) })); + fakes.pump(h, 1); + } + h.render(); +} + +fn scene( + name: &'static str, + size: SizeL, + cells: Cells, + build: fn(&Fakes, Fmt) -> FilesScreen, + script: fn(&mut Harness, &Fakes), +) -> Scene { + Scene { name, size, cells, caption: Caption::System, build, script } +} + +/// This file's scenes. +pub fn scenes() -> Vec { + let _ = INVOICES; + vec![ + scene("details_file", WIDE, Cells::Full12, documents, file), + scene("details_program", WIDE, Cells::Four, documents, program), + scene("details_folder", WIDE, Cells::Four, documents, folder), + scene("details_none", WIDE, Cells::Four, documents, nothing), + scene("details_several", WIDE, Cells::Four, documents, several), + scene("details_long_name", WIDE, Cells::Four, long_listing, long_name), + scene("details_focus", WIDE, Cells::Four, documents, focused), + scene("details_off", WIDE, Cells::Four, documents_off, file), + scene("details_narrow", MIDDLE, Cells::Four, documents, file), + scene("details_view_menu", WIDE, Cells::Four, documents, view_menu), + ] +} diff --git a/apps/files/src/preview/f2_menu.rs b/apps/files/src/preview/f2_menu.rs index df3d56cb..2ce60cdb 100644 --- a/apps/files/src/preview/f2_menu.rs +++ b/apps/files/src/preview/f2_menu.rs @@ -33,14 +33,10 @@ fn context_menu_background(h: &mut Harness, fakes: &Fakes) { h.render(); } -/// The More button, the last of the right cluster: clicked at the centre of its own rect. +/// The More button of the command bar, reached with the keyboard. fn more_menu(h: &mut Harness, fakes: &Fakes) { settle(h, fakes); - let scale = f64::from(h.render().w) / f64::from(WINDOW_SIZE.w); - let r = crate::toolbar::right_rects(h.screen())[3]; - let logical = |px: i32| (f64::from(px) / scale).round() as i32; - h.click(PointL { x: logical((r.l + r.r) / 2), y: logical((r.t + r.b) / 2) }); - h.render(); + super::command_bar::open_more(h); } fn scene(name: &'static str, script: fn(&mut Harness, &Fakes)) -> Scene { diff --git a/apps/files/src/preview/f3_ops.rs b/apps/files/src/preview/f3_ops.rs index 2ceef1bd..2b3c80ee 100644 --- a/apps/files/src/preview/f3_ops.rs +++ b/apps/files/src/preview/f3_ops.rs @@ -1,9 +1,10 @@ //! Preview scenes of FC-OPS (F3.2, F3.4): the chip while a delete runs, the chip waiting for a Windows dialog, the -//! flyout with a running, a finished and a failed operation, and the recycle bar. Made-up names; system caption. +//! flyout with a running, a finished and a failed operation, the recycle bar, the bar asking before a permanent +//! delete, and the notice of rights the user lacks. Made-up names; system caption. use std::sync::Arc; -use oled_trust::frame::files::{OpEvt, OpId, OpKind, UndoKind}; +use oled_trust::frame::files::{OpEvt, OpId, OpKind, Refusal, UndoKind}; use oled_ui::harness::Harness; use oled_ui::host::Caption; use oled_ui::SizeL; @@ -125,6 +126,23 @@ fn bar(h: &mut Harness, fakes: &Fakes) { h.render(); } +/// Shift+Del on the installer: the bar asks whether it goes for good. +fn bar_permanent(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + h.key("End"); + h.key("Shift+Del"); + h.render(); +} + +/// The helper refused a delete whose rights the user lacks: why, with File Explorer. +fn notice_rights(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + let detail = "report-final-v2.pdf".into(); + fakes.ops.emit(OpsEvent::Evt(OpEvt::Refused { op: OpId(21), why: Refusal::Elevated, detail })); + fakes.pump(h, 1); + h.render(); +} + fn scene( name: &'static str, cells: Cells, @@ -141,5 +159,7 @@ pub fn scenes() -> Vec { scene("ops_chip_needs_input", Cells::Full12, documents, needs_input), scene("ops_flyout", Cells::Full12, three_ops, flyout), scene("ops_bar", Cells::Four, with_bar, bar), + scene("ops_bar_permanent", Cells::Four, documents, bar_permanent), + scene("ops_notice_rights", Cells::Four, documents, notice_rights), ] } diff --git a/apps/files/src/preview/f3_rename.rs b/apps/files/src/preview/f3_rename.rs index 35c55144..c3ba8a0f 100644 --- a/apps/files/src/preview/f3_rename.rs +++ b/apps/files/src/preview/f3_rename.rs @@ -15,7 +15,10 @@ const SIZE: SizeL = SizeL { w: 800, h: 360 }; fn documents(fakes: &Fakes, fmt: Fmt) -> FilesScreen { fakes.enumr.queue(&fixtures::wp(ROOT), fixtures::documents()); - fixtures::open(fakes, fmt, ROOT) + let s = fixtures::open(fakes, fmt, ROOT); + // The field is the subject: files may change in this made-up folder, whatever the build switches say. + s.toolbar().force_changes(Some(true)); + s } /// F2 on the fourth row (the long docx name). diff --git a/apps/files/src/preview/icons.rs b/apps/files/src/preview/icons.rs new file mode 100644 index 00000000..10fb507b --- /dev/null +++ b/apps/files/src/preview/icons.rs @@ -0,0 +1,247 @@ +//! Preview scenes of the icons: the art of the known folders, of every file family and of the folders, drive roots and +//! places in the tabs and the sidebar; and Windows' icons of programs, shortcuts and other kinds before and after they +//! arrive, with hidden and cut items at half alpha. Every name and path is made up. + +use std::rc::Rc; +use std::sync::Arc; + +use oled_trust::frame::files::Location; +use oled_ui::harness::Harness; +use oled_ui::host::Caption; +use oled_ui::{PointL, SizeL}; + +use super::fixtures::{self, settle, NOW}; +use super::{Cells, Scene}; +use crate::drives::{DriveInfo, DriveKind}; +use crate::fakes::Fakes; +use crate::format::Fmt; +use crate::knownfolders::{KnownFolders, KnownName}; +use crate::listing::{Batch, Gen, RawEntry, WidePath}; +use crate::model::IconKey; +use crate::msg::{Fwd, Msg}; +use crate::options::FilesOptions; +use crate::sidebar::days_from_civil; +use crate::tab; +use crate::window::{FilesScreen, Shared}; + +const ART_SIZE: SizeL = SizeL { w: 860, h: 700 }; +const WINDOWS_SIZE: SizeL = SizeL { w: 800, h: 500 }; + +/// The made-up user's profile, which holds the known folders. +const PROFILE: &str = r"C:\Users\made-up"; +/// The folder of programs, shortcuts and other kinds. +const TOOLS: &str = r"C:\made-up\tools"; + +const ATTR_DIR: u32 = 0x10; +const ATTR_ARCHIVE: u32 = 0x20; +const ATTR_HIDDEN: u32 = 0x2; +const DAY: i64 = 864_000_000_000; +const GB: u64 = 1_000_000_000; + +/// A listing of (name, attributes, size), dated a day apart before NOW. +fn batch(rows: &[(&str, u32, u64)]) -> Batch { + let mut b = Batch { gen: Gen(0), names: Vec::new(), entries: Vec::new(), done: true, error: None, elapsed_us: 0 }; + for (i, (name, attrs, size)) in rows.iter().enumerate() { + let name_off = b.names.len() as u32; + b.names.extend_from_slice(name.as_bytes()); + let mtime = NOW - (i as i64 + 1) * DAY; + b.entries.push(RawEntry { + name_off, + name_len: name.len() as u16, + attrs: *attrs, + reparse_tag: 0, + size: *size, + mtime, + ctime: mtime, + }); + } + b +} + +/// The six known folders with art inside PROFILE, and the profile itself. +fn known() -> KnownFolders { + let names = [ + (KnownName::Desktop, "Desktop"), + (KnownName::Downloads, "Downloads"), + (KnownName::Documents, "Documents"), + (KnownName::Pictures, "Pictures"), + (KnownName::Music, "Music"), + (KnownName::Videos, "Videos"), + ]; + let mut list: Vec<(KnownName, WidePath)> = + names.iter().map(|(n, dir)| (*n, fixtures::wp(&format!(r"{PROFILE}\{dir}")))).collect(); + list.push((KnownName::Profile, fixtures::wp(PROFILE))); + KnownFolders::new(list, Some(b'C')) +} + +/// The profile: the known folders, a plain folder, and one file of every family and a program. +fn profile_rows() -> Batch { + batch(&[ + ("Desktop", ATTR_DIR, 0), + ("Documents", ATTR_DIR, 0), + ("Downloads", ATTR_DIR, 0), + ("Music", ATTR_DIR, 0), + ("Pictures", ATTR_DIR, 0), + ("Videos", ATTR_DIR, 0), + ("projects", ATTR_DIR, 0), + ("backup-2026.zip", ATTR_ARCHIVE, 912_000_000), + ("budget-2026.xlsx", ATTR_ARCHIVE, 86_400), + ("concert.mp3", ATTR_ARCHIVE, 7_100_000), + ("contract-draft.docx", ATTR_ARCHIVE, 48_500), + ("holiday.jpg", ATTR_ARCHIVE, 3_820_000), + ("invoice-114.pdf", ATTR_ARCHIVE, 2_960_000), + ("notes.txt", ATTR_ARCHIVE, 2_100), + ("pitch.pptx", ATTR_ARCHIVE, 8_400_000), + ("setup-tool-1.4.2.exe", ATTR_ARCHIVE, 74_200_000), + ("walkthrough.mp4", ATTR_ARCHIVE, 412_000_000), + ]) +} + +/// A window of `fakes` at `dir` knowing the made-up known folders, with pins and a recent network place. +fn window(fakes: &Fakes, fmt: Fmt, dir: &str, opts: FilesOptions) -> FilesScreen { + fakes.options.set(opts); + let shared = fakes.shared(fmt.lang()); + *shared.fmt.borrow_mut() = Rc::new(fmt); + *shared.known.borrow_mut() = Rc::new(known()); + crate::drives::scan(&shared); + plug_usb(&shared); + shared + .session + .borrow_mut() + .network_recent + .push((r"\\made-up-server\projects".into(), days_from_civil(2026, 11, 21))); + let tab = shared.new_tab(); + FilesScreen::new(shared, 1, Location::Fs(fixtures::wp(dir)), None, tab) +} + +/// A made-up removable drive E: beside the made-up drives (the first frame's scan replaces the list: the scene puts it +/// back after). +fn plug_usb(shared: &Shared) { + shared.drives.borrow_mut().set(DriveInfo { + letter: b'E', + label: Some("USB".into()), + kind: DriveKind::Removable, + free: Some(11 * GB), + total: Some(32 * GB), + ready: true, + }); +} + +/// The first frame and the listing, then the removable drive again. +fn with_usb(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + plug_usb(&Rc::clone(h.screen().shared())); + h.send(Box::new(Msg::Fwd(Fwd::Bump))); + h.render(); +} + +/// The profile listed, a tab for each kind of place, and pinned folders (a known one and a plain one). +fn art_window(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + fakes.enumr.queue(&fixtures::wp(PROFILE), profile_rows()); + let pins = [format!(r"{PROFILE}\Downloads"), r"C:\made-up\projects".to_string()]; + let opts = FilesOptions { pins: pins.to_vec(), ..FilesOptions::default() }; + let mut s = window(fakes, fmt, PROFILE, opts); + for p in &pins { + s.side.seed_exists(&fixtures::wp(p), true); + } + let shared = Rc::clone(s.shared()); + let places = [ + Location::Fs(fixtures::wp(&format!(r"{PROFILE}\Downloads"))), + Location::Fs(fixtures::wp(r"C:\")), + Location::Fs(fixtures::wp(r"E:\")), + Location::Fs(fixtures::wp(r"Z:\")), + Location::Fs(fixtures::wp(r"\\made-up-server\projects")), + Location::Home, + ]; + for at in places { + s.tabs_mut().open(tab::new_tab(&shared, 1, at), false); + } + s +} + +/// Programs, shortcuts and other kinds, a hidden file and folder, and a file cut to the clipboard. +fn windows_window(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + fakes.enumr.queue( + &fixtures::wp(TOOLS), + batch(&[ + ("hidden-folder", ATTR_DIR | ATTR_HIDDEN, 0), + ("app-ready.exe", ATTR_ARCHIVE, 12_400_000), + ("app-waiting.exe", ATTR_ARCHIVE, 9_800_000), + ("cursor.cur", ATTR_ARCHIVE, 4_200), + ("hidden-notes.txt", ATTR_ARCHIVE | ATTR_HIDDEN, 310), + ("installer.msi", ATTR_ARCHIVE, 31_000_000), + ("moved-report.pdf", ATTR_ARCHIVE, 3_400_000), + ("readme", ATTR_ARCHIVE, 900), + ("shortcut-ready.lnk", ATTR_ARCHIVE, 1_400), + ("shortcut-waiting.lnk", ATTR_ARCHIVE, 1_400), + ("site.url", ATTR_ARCHIVE, 120), + ]), + ); + // The class icon of .url has arrived; the others have not. + fakes.icons.set_icon(b"url"); + window(fakes, fmt, TOOLS, FilesOptions { hidden_items: true, ..FilesOptions::default() }) +} + +/// A made-up Windows icon, `px` square, premultiplied BGRA: a disc of `rgb` with a white square inside, so a row +/// that shows it is told apart from our art at a glance. +fn made_up_icon(px: u16, rgb: (u8, u8, u8)) -> Arc<[u8]> { + let n = i32::from(px.max(1)); + let mut v = Vec::with_capacity((n * n * 4) as usize); + let (c, r2) = (n - 1, (n - 1) * (n - 1)); + for y in 0..n { + for x in 0..n { + let (dx, dy) = (2 * x - c, 2 * y - c); + let inside = dx * dx + dy * dy <= r2; + let mark = (n / 3..n - n / 3).contains(&x) && (n / 3..n - n / 3).contains(&y); + let px = match (inside, mark) { + (true, true) => [255, 255, 255, 255], + (true, false) => [rgb.2, rgb.1, rgb.0, 255], + _ => [0, 0, 0, 0], + }; + v.extend_from_slice(&px); + } + } + v.into() +} + +/// The listing, the item icons of app-ready.exe and shortcut-ready.lnk, moved-report.pdf cut, and app-ready.exe +/// selected with the pointer. +fn arrived(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + h.advance(600); + fakes.pump(h, 1); + h.render(); + let s = h.screen_mut(); + let px = u16::try_from(s.art.key().small).unwrap_or(16); + let table = s.tabs.active_mut().table.model_mut(); + let id = |t: &crate::model::FilesTable, name: &str| t.listing().find(name.as_bytes()); + if let Some(app) = id(table, "app-ready.exe") { + table.set_icon(IconKey::Item(app), px, made_up_icon(px, (46, 120, 210))); + } + if let Some(link) = id(table, "shortcut-ready.lnk") { + table.set_icon(IconKey::Item(link), px, made_up_icon(px, (214, 140, 40))); + } + let cut = id(table, "moved-report.pdf"); + table.set_cut(cut); + h.render(); + h.click(PointL { x: 420, y: 160 }); + h.render(); +} + +fn scene( + name: &'static str, + size: SizeL, + cells: Cells, + build: fn(&Fakes, Fmt) -> FilesScreen, + script: fn(&mut Harness, &Fakes), +) -> Scene { + Scene { name, size, cells, caption: Caption::System, build, script } +} + +/// This file's scenes. +pub fn scenes() -> Vec { + vec![ + scene("icons_art", ART_SIZE, Cells::Full12, art_window, with_usb), + scene("icons_windows", WINDOWS_SIZE, Cells::Four, windows_window, arrived), + ] +} diff --git a/apps/files/src/preview/mod.rs b/apps/files/src/preview/mod.rs index 0659013b..b3773cb2 100644 --- a/apps/files/src/preview/mod.rs +++ b/apps/files/src/preview/mod.rs @@ -1,6 +1,8 @@ //! Offscreen renders (P3-files-app 2.2, F1a.12): the registry of scenes every group adds to, the golden cells, and //! files.exe --preview, which renders them through the kit Harness over fakes::Fakes (no window, no mutex, no host). +pub mod command_bar; +pub mod details_pane; pub mod f1a; pub mod f1b; pub mod f2_menu; @@ -13,6 +15,10 @@ pub mod f4_path; pub mod f4_side; pub mod f4_tabs; pub mod fixtures; +pub mod icons; +pub mod paste; +pub mod places; +pub mod search; use std::path::Path; @@ -58,6 +64,12 @@ pub fn scenes() -> Vec { f4_path::scenes, f4_side::scenes, f4_inst::scenes, + icons::scenes, + command_bar::scenes, + places::scenes, + search::scenes, + details_pane::scenes, + paste::scenes, ] { all.extend(part()); } diff --git a/apps/files/src/preview/paste.rs b/apps/files/src/preview/paste.rs new file mode 100644 index 00000000..47433132 --- /dev/null +++ b/apps/files/src/preview/paste.rs @@ -0,0 +1,138 @@ +//! Preview scenes of Cut, Copy and Paste: two rows cut and drawn at half alpha, Paste off with its tooltip while the +//! clipboard holds no files, a copy running in the chip, and the flyout after a paste with its Undo. Made-up names; +//! system caption; the clipboard commands on whatever the build's switch says. + +use oled_trust::frame::files::{OpEvt, OpId, OpKind, OpResult, UndoEntry, UndoKind}; +use oled_ui::harness::Harness; +use oled_ui::host::Caption; +use oled_ui::model::ListModel; +use oled_ui::{CommandId, SizeL}; + +use super::fixtures::{self, settle, ROOT}; +use super::{Cells, Scene}; +use crate::fakes::Fakes; +use crate::format::Fmt; +use crate::keys::Cmd; +use crate::ops_client::{OpsEvent, UndoRecord}; +use crate::ops_ui::OpRow; +use crate::window::FilesScreen; + +const WINDOW_SIZE: SizeL = SizeL { w: 800, h: 500 }; +/// The progress line's tween (DUR_PROGRESS) is over. +const SETTLED_MS: u32 = 300; +/// The folder the paste goes into. +const DOWNLOAD: &str = r"C:\made-up\Download"; +const PASTE: OpId = OpId(31); + +/// The documents folder, a folder where files may change, with the clipboard commands on. +fn documents(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + fakes.enumr.queue(&fixtures::wp(ROOT), fixtures::documents()); + let s = fixtures::open(fakes, fmt, ROOT); + s.shared().paste_live.set(true); + s.toolbar().force_changes(Some(true)); + s +} + +/// Down to the row named `name`. +fn to_row(h: &mut Harness, name: &str) { + h.key("Home"); + for _ in 0..64 { + let t = &h.screen().tabs().active().table; + let at = t.focused().and_then(|k| ListModel::row_of(t.model(), k)); + if at.map(|r| ListModel::label(t.model(), r).to_string()).as_deref() == Some(name) { + return; + } + h.key("Down"); + } +} + +/// The two reports cut: their rows at half alpha once the focus is back on the first row; Paste is on. +fn cut_rows(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + to_row(h, "report-final-v2.pdf"); + h.key("Shift+Down").key("Ctrl+X").key("Home"); + h.render(); +} + +/// The clipboard holds no files: Paste is off and its tooltip says why. +fn paste_off(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + h.key("Home"); + h.screen_mut().toolbar_mut().preview_tip(Some(CommandId(Cmd::Paste as u32))); + h.render(); +} + +/// A paste of three items into Download, as the window asked for it. +fn asked(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + let s = documents(fakes, fmt); + let mut row = OpRow::new(PASTE, OpKind::Copy, 1); + let download = fixtures::wp(DOWNLOAD); + row.items = ["notes.txt", "report-final-v3.pdf", "photos-raw.zip"] + .iter() + .filter_map(|n| fixtures::wp(ROOT).join(&n.encode_utf16().collect::>()).ok()) + .collect(); + (row.count, row.folder) = (3, Some(download)); + s.shared().ops.borrow_mut().insert(row); + s +} + +/// The copy at 62 %: "Copying to Download: 3 items, 62 %". +fn chip(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + fakes.ops.emit(OpsEvent::Evt(OpEvt::Started { op: PASTE, kind: OpKind::Copy, items: 3, bytes: 0 })); + let progress = OpEvt::Progress { op: PASTE, done: 620, total: 1_000, bps: 0, current: "".into() }; + fakes.ops.emit(OpsEvent::Evt(progress)); + fakes.pump(h, 1); + h.advance(SETTLED_MS); + h.render(); +} + +/// The paste done, its undo on the stack: the flyout open over it with Undo. +fn flyout_done(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + let download = fixtures::wp(DOWNLOAD); + let entries = ["notes.txt", "report-final-v3.pdf", "photos-raw.zip"] + .iter() + .filter_map(|n| { + let units: Vec = n.encode_utf16().collect(); + let from = fixtures::wp(ROOT).join(&units).ok()?; + let to = download.join(&units).ok()?; + Some(UndoEntry { from, to, size: 1, mtime: 2, dir: false, bin: None }) + }) + .collect(); + let record = UndoRecord { of: PASTE, kind: UndoKind::RecycleCopies, replaced: 0, entries }; + fakes.ops.emit(OpsEvent::Evt(OpEvt::Started { op: PASTE, kind: OpKind::Copy, items: 3, bytes: 0 })); + fakes.ops.emit(OpsEvent::Undo(record)); + let finished = OpEvt::Finished { + op: PASTE, + result: OpResult::Done, + undo: Some(UndoKind::RecycleCopies), + replaced: 0, + items: 3, + failed: 0, + }; + fakes.ops.emit(OpsEvent::Evt(finished)); + fakes.pump(h, 1); + h.key("Ctrl+J"); + h.advance(SETTLED_MS); + h.render(); +} + +fn scene( + name: &'static str, + cells: Cells, + build: fn(&Fakes, Fmt) -> FilesScreen, + script: fn(&mut Harness, &Fakes), +) -> Scene { + Scene { name, size: WINDOW_SIZE, cells, caption: Caption::System, build, script } +} + +/// This file's scenes. +pub fn scenes() -> Vec { + vec![ + scene("paste_cut_rows", Cells::Four, documents, cut_rows), + scene("paste_off_tooltip", Cells::Four, documents, paste_off), + scene("paste_chip_copying", Cells::Full12, asked, chip), + scene("paste_flyout_done", Cells::Four, asked, flyout_done), + ] +} diff --git a/apps/files/src/preview/places.rs b/apps/files/src/preview/places.rs new file mode 100644 index 00000000..34cf3d88 --- /dev/null +++ b/apps/files/src/preview/places.rs @@ -0,0 +1,168 @@ +//! Preview scenes of the sidebar's places and the status line: Quick access with the known folders, the pinned ones and a +//! hovered pin, This PC with drives (one nearly full, one not ready), the network places and the hand-offs, and the +//! status line with a selection, a drive's capacity and a running operation. Made-up names and drives. + +use std::rc::Rc; + +use oled_trust::frame::files::{Location, OpEvt, OpId, OpKind}; +use oled_ui::harness::Harness; +use oled_ui::host::Caption; +use oled_ui::{PointL, SizeL}; + +use super::fixtures::{self, settle}; +use super::{Cells, Scene}; +use crate::drives::{DriveInfo, DriveKind}; +use crate::fakes::Fakes; +use crate::format::Fmt; +use crate::knownfolders::{KnownFolders, KnownName}; +use crate::msg::{Fwd, Msg}; +use crate::ops_client::OpsEvent; +use crate::options::FilesOptions; +use crate::sidebar::{days_from_civil, key_of}; +use crate::window::FilesScreen; + +const SIZE: SizeL = SizeL { w: 1000, h: 860 }; +/// A window narrow enough that the drive block and the selection give way in the status line. +const NARROW: SizeL = SizeL { w: 520, h: 600 }; +const USER: &str = r"C:\made-up\user"; +const PINS: [&str; 2] = [r"C:\made-up\projects", r"D:\made-up\media"]; +const GB: u64 = 1_000_000_000; +/// The pin's tween and the chip's progress tween are over. +const SETTLED_MS: u32 = 300; + +fn known() -> Vec<(KnownName, crate::listing::WidePath)> { + [ + (KnownName::Desktop, "Desktop"), + (KnownName::Downloads, "Downloads"), + (KnownName::Documents, "Documents"), + (KnownName::Pictures, "Pictures"), + (KnownName::Music, "Music"), + (KnownName::Videos, "Videos"), + ] + .into_iter() + .map(|(n, d)| (n, fixtures::wp(&format!(r"{USER}\{d}")))) + .collect() +} + +/// A window open at `at` with every section filled: the six known folders, two pins, three drives (C: a third full, +/// D: at 95 %, E: not ready), a mapped drive and a recent network place. +fn window(fakes: &Fakes, fmt: Fmt, at: &str) -> FilesScreen { + fakes.options.set(FilesOptions { pins: PINS.iter().map(|p| p.to_string()).collect(), ..FilesOptions::default() }); + fakes.enumr.queue(&fixtures::wp(at), fixtures::documents()); + let shared = fakes.shared(fmt.lang()); + *shared.fmt.borrow_mut() = Rc::new(fmt); + *shared.known.borrow_mut() = Rc::new(KnownFolders::new(known(), Some(b'C'))); + crate::drives::scan(&shared); + shared + .session + .borrow_mut() + .network_recent + .push((r"\\made-up-server\projects".into(), days_from_civil(2026, 11, 21))); + let tab = shared.new_tab(); + let mut s = FilesScreen::new(shared, 1, Location::Fs(fixtures::wp(at)), None, tab); + for p in PINS { + s.side.seed_exists(&fixtures::wp(p), true); + } + for (_, p) in known() { + s.side.seed_exists(&p, true); + } + s +} + +/// The drives of the story, put in after the made-up scan's own answers have come: C: a third full, D: at 95 %, E: not +/// ready. +fn tune_drives(h: &mut Harness) { + let shared = Rc::clone(h.screen().shared()); + { + let mut d = shared.drives.borrow_mut(); + let fixed = |letter, label: &str, free, total| DriveInfo { + letter, + label: Some(label.to_string()), + kind: DriveKind::Fixed, + free: Some(free), + total: Some(total), + ready: true, + }; + d.set(fixed(b'C', "System", 640 * GB, 1_990 * GB)); + d.set(fixed(b'D', "Data", 50 * GB, 1_000 * GB)); + d.set(DriveInfo { letter: b'E', label: None, kind: DriveKind::Optical, free: None, total: None, ready: false }); + } + h.send(Box::new(Msg::Fwd(Fwd::Bump))); + h.render(); +} + +/// The first frame, the drives of the story and the listing. +fn settled(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + tune_drives(h); +} + +fn in_documents(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + window(fakes, fmt, &format!(r"{USER}\Documents")) +} + +fn on_data(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + window(fakes, fmt, PINS[1]) +} + +/// One file selected: the line counts it and its size. +fn selected(h: &mut Harness, fakes: &Fakes) { + settled(h, fakes); + h.key("Home").key("Down").key("Down").key("Down").key("Down"); + h.render(); +} + +/// The pointer on a pinned folder: its plate and its trailing pin show. +fn hovered_pin(h: &mut Harness, fakes: &Fakes) { + settled(h, fakes); + let key = key_of(0, "pin", PINS[0]); + let side = &h.screen().side; + let (rect, pane) = (side.entry_rect(key).expect("the pin is shown"), side.pane()); + // The pane is 224 logical px wide, so its physical width gives the scale. + let to_l = |v: i32| (i64::from(v) * 224 / i64::from(pane.w())) as i32; + let at = PointL { x: to_l(rect.l + rect.w() / 3), y: to_l((rect.t + rect.b) / 2) }; + h.hover(at); + h.advance(SETTLED_MS); + h.render(); +} + +/// A delete running while one file is selected. +fn running(h: &mut Harness, fakes: &Fakes) { + selected(h, fakes); + fakes.ops.emit(OpsEvent::Evt(OpEvt::Started { + op: OpId(7), + kind: OpKind::DeletePermanent, + items: 2_000, + bytes: 0, + })); + fakes.ops.emit(OpsEvent::Evt(OpEvt::Progress { + op: OpId(7), + done: 1_240, + total: 2_000, + bps: 0, + current: "".into(), + })); + fakes.pump(h, 1); + h.advance(SETTLED_MS); + h.render(); +} + +fn scene( + name: &'static str, + cells: Cells, + build: fn(&Fakes, Fmt) -> FilesScreen, + script: fn(&mut Harness, &Fakes), +) -> Scene { + Scene { name, size: SIZE, cells, caption: Caption::System, build, script } +} + +/// This file's scenes. +pub fn scenes() -> Vec { + vec![ + scene("places", Cells::Full12, in_documents, selected), + scene("places_hover", Cells::Four, in_documents, hovered_pin), + scene("places_full_drive", Cells::Four, on_data, settled), + scene("places_status_op", Cells::Four, in_documents, running), + Scene { size: NARROW, ..scene("places_status_narrow", Cells::Four, in_documents, running) }, + ] +} diff --git a/apps/files/src/preview/search.rs b/apps/files/src/preview/search.rs new file mode 100644 index 00000000..68e9b474 --- /dev/null +++ b/apps/files/src/preview/search.rs @@ -0,0 +1,142 @@ +//! Preview scenes of the search in the open folder, the Filter menu and the page states: the empty field, the +//! matches, nothing found, the narrow window's icon and its open field, the Filter menu and the folder narrowed by a +//! family, and the empty, denied, offline and loading pages. + +use oled_ui::harness::Harness; +use oled_ui::host::Caption; +use oled_ui::{CommandId, SizeL}; + +use super::command_bar::click_command; +use super::fixtures::{self, settle, ROOT}; +use super::{Cells, Scene}; +use crate::fakes::Fakes; +use crate::format::Fmt; +use crate::listing::EnumError; +use crate::toolmenus::btn; +use crate::window::FilesScreen; + +const MIDDLE: SizeL = SizeL { w: 900, h: 600 }; +const WIDE: SizeL = SizeL { w: 1280, h: 720 }; +const NARROW: SizeL = SizeL { w: 640, h: 480 }; +const STATE: SizeL = SizeL { w: 900, h: 560 }; + +fn documents(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + fakes.enumr.queue(&fixtures::wp(ROOT), fixtures::documents()); + fixtures::open(fakes, fmt, ROOT) +} + +/// What the field holds is applied after the debounce, and the list is drawn again. +fn typed(h: &mut Harness, fakes: &Fakes, text: &str) { + settle(h, fakes); + h.key("Ctrl+F"); + h.type_text(text); + h.advance(200); + h.render(); +} + +fn empty_field(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); +} + +fn focused_field(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + h.key("Ctrl+F"); + h.render(); +} + +fn matches(h: &mut Harness, fakes: &Fakes) { + typed(h, fakes, "REPORT"); +} + +fn no_match(h: &mut Harness, fakes: &Fakes) { + typed(h, fakes, "preventivo"); +} + +fn narrow_icon(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); +} + +fn narrow_open(h: &mut Harness, fakes: &Fakes) { + typed(h, fakes, "rep"); +} + +/// Whether the bar still shows the Filter button (a narrow cell folds it into More). +fn filter_shown(h: &Harness) -> bool { + h.screen().toolbar().bar().rect_of(CommandId(btn::FILTER)).is_some() +} + +fn filter_menu(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + click_command(h, WIDE.w, btn::FILTER); +} + +/// Documents checked in the Filter menu: the button is on and the status line says so. +fn filter_on(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + click_command(h, WIDE.w, btn::FILTER); + if filter_shown(h) { + h.key("Down").key("Down").key("Enter"); + } + h.render(); + h.advance(200); + h.render(); +} + +fn page_empty(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + let dir = format!(r"{ROOT}\none"); + fakes.enumr.queue(&fixtures::wp(&dir), crate::fakes::listing(&[])); + fixtures::open(fakes, fmt, &dir) +} + +fn failing(fakes: &Fakes, fmt: Fmt, err: EnumError) -> FilesScreen { + let dir = format!(r"{ROOT}\locked"); + fakes.enumr.queue_error(&fixtures::wp(&dir), err); + fixtures::open(fakes, fmt, &dir) +} + +fn page_denied(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + failing(fakes, fmt, EnumError::AccessDenied) +} + +fn page_offline(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + failing(fakes, fmt, EnumError::Offline { waited_ms: 4_000 }) +} + +/// Nothing is queued: the listing never answers, and the sweep and its word show once 300 ms have gone. +fn page_loading(fakes: &Fakes, fmt: Fmt) -> FilesScreen { + fixtures::open(fakes, fmt, r"C:\made-up\slow") +} + +fn after_busy_delay(h: &mut Harness, fakes: &Fakes) { + settle(h, fakes); + h.advance(350); + h.render(); +} + +fn scene( + name: &'static str, + size: SizeL, + cells: Cells, + build: fn(&Fakes, Fmt) -> FilesScreen, + script: fn(&mut Harness, &Fakes), +) -> Scene { + Scene { name, size, cells, caption: Caption::System, build, script } +} + +/// This file's scenes. +pub fn scenes() -> Vec { + vec![ + scene("search_empty", MIDDLE, Cells::Four, documents, empty_field), + scene("search_focused", MIDDLE, Cells::Four, documents, focused_field), + scene("search_matches", MIDDLE, Cells::Full12, documents, matches), + scene("search_no_match", MIDDLE, Cells::Four, documents, no_match), + scene("search_narrow_icon", NARROW, Cells::Four, documents, narrow_icon), + scene("search_narrow_open", NARROW, Cells::Four, documents, narrow_open), + scene("filter_menu", WIDE, Cells::Four, documents, filter_menu), + scene("filter_on", WIDE, Cells::Four, documents, filter_on), + scene("page_empty", STATE, Cells::Four, page_empty, settle), + scene("page_denied", STATE, Cells::Full12, page_denied, settle), + scene("page_offline", STATE, Cells::Four, page_offline, settle), + scene("page_loading", STATE, Cells::Four, page_loading, after_busy_delay), + ] +} diff --git a/apps/files/src/rename.rs b/apps/files/src/rename.rs index bae86aa3..135c9877 100644 --- a/apps/files/src/rename.rs +++ b/apps/files/src/rename.rs @@ -1,5 +1,6 @@ -//! Rename in place and new folder (P3-files-app 2.2; FC-RENAME fills it, F3.7, F3.8): the field sits on the cell; -//! every change goes through ops_ui::request. +//! Rename in place and new folder: the field sits on the cell; every change goes through ops_ui::request. While +//! files may not change in the folder (a build switch, or a folder outside the test roots), F2, the slow second click, +//! the menu's Rename and Ctrl+Shift+N show the not-available notice with Open in File Explorer and open nothing. use oled_trust::frame::files::{Location, OpId}; use oled_ui::model::{CellOut, ColId, ListModel, RowKey, ScrollTo, Selection, TableModel}; @@ -11,6 +12,7 @@ use crate::listing::collate::utf16_to_wtf8; use crate::listing::{TabId, WidePath}; use crate::model::{id_of, key_of, push_wtf8_lossy, ColKind}; use crate::ops_ui::{self, MutReq}; +use crate::toolmenus::{self, Why}; use crate::tr::{k, t, tf}; use crate::window::FilesScreen; @@ -127,6 +129,15 @@ fn row_key_of(s: &FilesScreen, p: &WidePath) -> Option { listing.find(&name).map(key_of) } +/// F2 and the slow second click on a row: the field, or, while files may not change here, the not-available notice. +pub fn ask(s: &mut FilesScreen, cx: &mut EventCx, key: RowKey) -> Reply { + if toolmenus::avail(s).rename == Some(Why::NotInAlpha) { + crate::menu::not_in_beta(s, cx); + return Reply::Redraw; + } + begin(s, cx, key) +} + /// Selects, focuses and scrolls to the row, then begins its rename. fn begin_on(s: &mut FilesScreen, cx: &mut EventCx, key: RowKey) -> Reply { let t = s.tabs.active_mut(); @@ -137,6 +148,10 @@ fn begin_on(s: &mut FilesScreen, cx: &mut EventCx, key: RowKey) -> Reply { /// The menu's Rename and an intercepted Rename. pub fn begin_path(s: &mut FilesScreen, cx: &mut EventCx, p: &WidePath) -> Reply { + if toolmenus::avail(s).rename == Some(Why::NotInAlpha) { + crate::menu::not_in_beta(s, cx); + return Reply::Redraw; + } match row_key_of(s, p) { Some(key) => begin_on(s, cx, key), None => Reply::None, @@ -226,8 +241,17 @@ pub fn event(s: &mut FilesScreen, cx: &mut EventCx, ev: &Event) -> Option None } -/// Ctrl+Shift+N: a folder with a free name in the shown folder; its row enters rename once the host reports it. +/// Ctrl+Shift+N: a folder with a free name in the shown folder; its row enters rename once the host reports it. It +/// follows New folder's own reason (toolmenus::avail): its switch off, the notice; no folder shown, nothing. pub fn new_folder(s: &mut FilesScreen, cx: &mut EventCx) -> Reply { + match toolmenus::avail(s).new_folder { + Some(Why::NotInAlpha) => { + crate::menu::not_in_beta(s, cx); + return Reply::Redraw; + } + Some(_) => return Reply::None, + None => {} + } let Location::Fs(dir) = s.tabs.active().nav.location().clone() else { return Reply::None }; let lang = cx.lang(); let base = t(k::FILES_RENAME_NEW_FOLDER_NAME, lang).to_string(); @@ -262,7 +286,7 @@ pub fn cmd(s: &mut FilesScreen, cx: &mut EventCx, c: Cmd) -> Reply { Cmd::Rename => { let table = &s.tabs.active().table; match table.focused().or_else(|| table.selection().single()) { - Some(key) => begin(s, cx, key), + Some(key) => ask(s, cx, key), None => Reply::None, } } diff --git a/apps/files/src/services.rs b/apps/files/src/services.rs index f99b1779..66eac441 100644 --- a/apps/files/src/services.rs +++ b/apps/files/src/services.rs @@ -9,7 +9,7 @@ use std::rc::Rc; use std::sync::Arc; use std::time::Instant; -use oled_trust::frame::files::{CallKind, ItemRef, OpId, ReqId, ShellReq}; +use oled_trust::frame::files::{CallKind, Conflicts, ItemRef, OpId, ReqId, ShellReq}; use crate::bg::{Bg, JobFn, Lane}; use crate::decor::cache::{ClassIconSource, ClassIcons, IconRef, CLASS_ICONS_IN_UI}; @@ -32,6 +32,10 @@ pub trait EnumService { /// Every change of user files: the ops host through IFileOperation. Only ops_ui::request calls the mutating methods. pub trait OpsService { + /// A paste: copies of the items into `dest`; a name clash asks in Windows' own dialog. + fn copy(&self, items: &[ItemRef], dest: &WidePath) -> Result; + /// A paste of cut items: moved into `dest`; a name clash asks in Windows' own dialog. + fn move_to(&self, items: &[ItemRef], dest: &WidePath) -> Result; fn recycle(&self, items: &[ItemRef]) -> Result; fn delete_permanent(&self, items: &[ItemRef]) -> Result; fn rename(&self, item: &WidePath, to: &str) -> Result; @@ -209,6 +213,12 @@ impl RealOps { } impl OpsService for RealOps { + fn copy(&self, items: &[ItemRef], dest: &WidePath) -> Result { + self.client().copy(items, dest, Conflicts::AskSystem) + } + fn move_to(&self, items: &[ItemRef], dest: &WidePath) -> Result { + self.client().move_to(items, dest, Conflicts::AskSystem) + } fn recycle(&self, items: &[ItemRef]) -> Result { self.client().recycle(items) } diff --git a/apps/files/src/shell/images.rs b/apps/files/src/shell/images.rs index 47634b9f..f94cdb16 100644 --- a/apps/files/src/shell/images.rs +++ b/apps/files/src/shell/images.rs @@ -1,9 +1,16 @@ //! Icons and thumbnails in the shell host (SH9): per item, IShellItemImageFactory::GetImage of the asked size inside a //! crumbs guard, the bitmap read to premultiplied BGRA (decor::gdi), one Icon or Thumb frame per item that worked, -//! then ReqDone. Work of a generation that CancelGen dropped stops between items. A bitmap larger than -//! MAX_PIXELS_SIDE is skipped (GetImage returns the asked size; a larger one is a broken handler). In a debug build -//! with FILES_FAULT_DLL and the fault point "icon" or "thumb", the fault DLL's FaultIcon::Extract or -//! FaultThumb::GetThumbnail runs in the same guard instead. +//! then ReqDone. A shortcut's icon is read without the shell's link handling: the link file is read through one +//! handle and parsed from its bytes (lnk), never resolved and never bound to the namespace, and its icon is read as +//! data (iconres) through one handle on a local file that passes the same checks as any item, by name before the open +//! and on the handle after it (pinned; link_icon_with). Work of a generation that CancelGen dropped stops between +//! items. A bitmap larger than MAX_PIXELS_SIDE is skipped (GetImage returns the asked size; a larger one is a broken +//! handler). In a debug build with FILES_FAULT_DLL and the fault point "icon" or "thumb", the fault DLL's +//! FaultIcon::Extract or FaultThumb::GetThumbnail runs in the same guard instead. + +pub mod iconres; +pub mod lnk; +pub mod pinned; use std::cell::RefCell; use std::collections::HashMap; @@ -12,21 +19,26 @@ use crate::drives::DriveKind; use oled_trust::frame::files::{CallKind, Gen, ItemRef, Pixels, ReqId, ShellEvt, WidePath, MAX_PIXELS_SIDE}; use windows::core::{w, Interface, HSTRING, PCWSTR}; use windows::Win32::Foundation::SIZE; +use windows::Win32::Globalization::{MultiByteToWideChar, CP_ACP, MB_ERR_INVALID_CHARS}; use windows::Win32::Graphics::Gdi::{DeleteObject, HBITMAP, HGDIOBJ}; use windows::Win32::Storage::FileSystem::{GetDriveTypeW, GetFileAttributesW, INVALID_FILE_ATTRIBUTES}; use windows::Win32::System::Com::{IBindCtx, STGM_READ}; +use windows::Win32::System::Environment::ExpandEnvironmentStringsW; +use windows::Win32::System::SystemInformation::GetSystemWindowsDirectoryW; use windows::Win32::System::WindowsProgramming::GetPrivateProfileStringW; use windows::Win32::UI::Shell::{ IExtractIconW, IInitializeWithItem, IShellItem, IShellItemImageFactory, IThumbnailProvider, SHCreateItemFromParsingName, SIIGBF, SIIGBF_ICONONLY, SIIGBF_INCACHEONLY, SIIGBF_THUMBNAILONLY, WTS_ALPHATYPE, }; -use windows::Win32::UI::WindowsAndMessaging::{DestroyIcon, HICON}; +use windows::Win32::UI::WindowsAndMessaging::{CreateIconFromResourceEx, DestroyIcon, HICON, LR_DEFAULTCOLOR}; use crate::decor::gdi::{self, Bgra}; use crate::gate; use crate::shell::crumbs; use crate::shell::host::{self, fault, HostCfg}; use crate::shell::writer::Writer; +use lnk::{LinkParts, LinkText}; +use pinned::Pinned; /// Whether an image may be loaded from the item at `path` (UTF-16, no NUL): only `X:\...` or `\\?\X:\...` on a drive /// of kind Fixed. UNC, `\\?\UNC\`, device paths (`\\.\`, `\\?\GLOBALROOT`), WebDAV shares, any `scheme:`, relative @@ -76,6 +88,60 @@ pub fn attrs_allow_icon(attrs: u32) -> bool { /// (icons::wants_item_icon reads this list). pub const OWN_ICON_EXTS: [&str; 5] = ["exe", "ico", "scr", "cur", "ani"]; +/// Shortcuts: the one kind outside OWN_ICON_EXTS whose per-item icon the UI asks for. The link file itself passes the +/// checks of any item; the host then reads it through one handle and parses its bytes (read_link: no shell link +/// object, so nothing is resolved, bound or reached on the network) and reads an icon only from a location of +/// LINK_ICON_SOURCES that passes the same checks (extract_icon). +pub const LINK_EXT: &str = "lnk"; + +/// The kinds a shortcut's icon may be extracted from: files read as data (the icon resources of a PE file, or an icon +/// file), never loaded. A 16-bit icon library gives no icon. +pub const LINK_ICON_SOURCES: [&str; 4] = ["exe", "dll", "ico", "icl"]; + +/// What the host reads from a link file: its icon location (empty when it names none) with its index, and its target +/// path as written (environment variables unexpanded; empty when the link names no local path that can be learned +/// without the shell namespace: a link known only by its item-ID list, or only on a share). +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct LinkFacts { + pub icon: Vec, + pub index: i32, + pub target: Vec, +} + +/// The file a shortcut's icon would come from, and its index: the icon location when the link names one, else its +/// target (its icon is the target's own, index 0); environment variables expanded through `expand`. None when the +/// link names neither, or the result is not an absolute path. +pub fn link_icon_source(facts: &LinkFacts, expand: impl Fn(&[u16]) -> Vec) -> Option<(WidePath, i32)> { + let (raw, index) = if !facts.icon.is_empty() { + (&facts.icon, facts.index) + } else if !facts.target.is_empty() { + (&facts.target, 0) + } else { + return None; + }; + let units = expand(raw); + WidePath::new(&units).ok().map(|p| (p, index)) +} + +/// A shortcut's icon with the host's seams: `read` parses the link (never resolving it), `expand` expands variables, +/// `check` is allowed_with's rule for LINK_ICON_SOURCES, and `extract` reads the icon of a location that passed it. +/// Nothing is extracted from a location the check refuses (a share, a URL, a device, a removable or network drive, a +/// link or offline component), nor when the link names no location. +pub fn link_icon_with( + link: &WidePath, + read: impl FnOnce(&WidePath) -> Option, + expand: impl Fn(&[u16]) -> Vec, + check: impl FnOnce(&WidePath) -> bool, + extract: impl FnOnce(&WidePath, i32) -> Option, +) -> Option { + let facts = read(link)?; + let (at, index) = link_icon_source(&facts, expand)?; + if !check(&at) { + return None; + } + extract(&at, index) +} + /// Thumbnails (no caller yet): extensions whose image the shell builds from a location named inside the file (a /// shortcut's target, a console's icon element, a command file's IconFile, a connector's iconReference, a theme's /// wallpaper). A class id (`name.{CLSID}`) is refused by may_load_icon_from in every component. The first caller of @@ -101,7 +167,7 @@ fn names_other_location(ext: &str) -> bool { } /// The extension of a path's last component, lower case and whole (crumbs::ext_of cuts it for its slot). -fn ext_whole(p: &WidePath) -> String { +pub fn ext_whole(p: &WidePath) -> String { let name = p.file_name().map(String::from_utf16_lossy).unwrap_or_default(); name.rfind('.').and_then(|dot| name.get(dot + 1..)).map(str::to_lowercase).unwrap_or_default() } @@ -138,10 +204,51 @@ pub fn allowed_with( is_junction: impl Fn(&WidePath) -> bool, long_of: impl Fn(&WidePath) -> Option, ) -> bool { - const DIRECTORY: u32 = 0x10; let ext = ext_whole(p); let kind_ok = if is_thumb { !names_other_location(&ext) } else { OWN_ICON_EXTS.contains(&ext.as_str()) }; - if !kind_ok || !may_load_icon_from(p.units(), &drive_kind) { + kind_ok && location_allowed_with(p, drive_kind, attrs_of, is_junction, long_of) +} + +/// The check before an item's icon is loaded (`run` without thumbnails): a shortcut's own location passes the item +/// rules under its own kind (LINK_EXT); every other item allowed_with's. The UI asks exactly for what this allows on a +/// local fixed drive (icons::wants_item_icon). +pub fn icon_allowed_with( + p: &WidePath, + drive_kind: impl Fn(u16) -> DriveKind, + attrs_of: impl Fn(&WidePath) -> Option, + is_junction: impl Fn(&WidePath) -> bool, + long_of: impl Fn(&WidePath) -> Option, +) -> bool { + if ext_whole(p) == LINK_EXT { + allowed_kind_with(p, &[LINK_EXT], drive_kind, attrs_of, is_junction, long_of) + } else { + allowed_with(p, false, drive_kind, attrs_of, is_junction, long_of) + } +} + +/// allowed_with for a kind the caller has already judged: a shortcut itself (LINK_EXT), and the file its icon comes +/// from (LINK_ICON_SOURCES). +pub fn allowed_kind_with( + p: &WidePath, + kinds: &[&str], + drive_kind: impl Fn(u16) -> DriveKind, + attrs_of: impl Fn(&WidePath) -> Option, + is_junction: impl Fn(&WidePath) -> bool, + long_of: impl Fn(&WidePath) -> Option, +) -> bool { + kinds.contains(&ext_whole(p).as_str()) && location_allowed_with(p, drive_kind, attrs_of, is_junction, long_of) +} + +/// The location part of allowed_with: the pure rule, the folders above, the item's attributes and its long form. +fn location_allowed_with( + p: &WidePath, + drive_kind: impl Fn(u16) -> DriveKind, + attrs_of: impl Fn(&WidePath) -> Option, + is_junction: impl Fn(&WidePath) -> bool, + long_of: impl Fn(&WidePath) -> Option, +) -> bool { + const DIRECTORY: u32 = 0x10; + if !may_load_icon_from(p.units(), &drive_kind) { return false; } let mut folders: Vec = std::iter::successors(p.parent(), WidePath::parent).collect(); @@ -231,10 +338,23 @@ pub fn run(req: ReqId, gen: Gen, items: &[ItemRef], px: u16, thumbs: Option>::new()); let long_of = |d: &WidePath| longs.borrow_mut().entry(d.clone()).or_insert_with(|| gate::long_path(d)).clone(); - let check = |p: &WidePath| allowed_with(p, is_thumb, drive_kind, file_attrs, is_junction, long_of); + let is_link = |p: &WidePath| !is_thumb && ext_whole(p) == LINK_EXT; + let check = |p: &WidePath| { + if is_thumb { + allowed_with(p, true, drive_kind, file_attrs, is_junction, long_of) + } else { + icon_allowed_with(p, drive_kind, file_attrs, is_junction, long_of) + } + }; + let source_ok = + |q: &WidePath| allowed_kind_with(q, &LINK_ICON_SOURCES, drive_kind, file_attrs, is_junction, long_of); run_with(req, gen, items, is_thumb, &|e| w.send(e), &check, &mut |p, ext| { let _g = crumbs::enter(kind, ext); - image_of(p, px, thumbs, cfg) + if is_link(p) { + link_icon_with(p, read_link, expand_vars, source_ok, |q, index| extract_icon(q, index, px)) + } else { + image_of(p, px, thumbs, cfg) + } }); } @@ -295,6 +415,112 @@ fn image_of(p: &WidePath, px: u16, thumbs: Option, cfg: &HostCfg) -> Optio bitmap(bmp) } +/// A link file's facts: the file is opened once and judged on its handle (Pinned, a kind of LINK_EXT), its bytes are +/// read through that handle and parsed (lnk::parse_link). No shell link object is created, so the link's item-ID list +/// is never bound to the namespace and nothing it names is resolved or reached. An advertised (installer) shortcut is +/// not read: its icon belongs to the installer. +pub fn read_link(p: &WidePath) -> Option { + let file = Pinned::open(p, &[LINK_EXT], drive_kind)?; + let parts = lnk::parse_link(&file.read_all(lnk::MAX_LINK_BYTES)?)?; + Some(link_facts(parts, decode_ansi)) +} + +/// LinkParts as LinkFacts, ANSI text through `decode` (text it cannot decode counts as absent). +pub fn link_facts(parts: LinkParts, decode: impl Fn(&[u8]) -> Option>) -> LinkFacts { + let text = |t: Option| match t { + Some(LinkText::Wide(w)) => w, + Some(LinkText::Ansi(a)) => decode(&a).unwrap_or_default(), + None => Vec::new(), + }; + LinkFacts { icon: text(parts.icon), index: parts.index, target: text(parts.target) } +} + +/// Bytes of the system's ANSI code page as UTF-16; None when they do not decode. +fn decode_ansi(bytes: &[u8]) -> Option> { + if bytes.is_empty() { + return Some(Vec::new()); + } + // SAFETY: a readable byte slice whose length is passed; no output buffer (the length is counted). + let n = unsafe { MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, bytes, None) }; + let mut out = vec![0u16; usize::try_from(n).ok().filter(|&n| n > 0)?]; + // SAFETY: the same bytes and a writable buffer of the counted length. + let got = unsafe { MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, bytes, Some(&mut out)) }; + (usize::try_from(got).ok() == Some(out.len())).then_some(out) +} + +/// ExpandEnvironmentStringsW (the host's own environment: no file is touched); the text unchanged on failure. +fn expand_vars(s: &[u16]) -> Vec { + let mut src = s.to_vec(); + src.push(0); + let mut out = vec![0u16; 1024]; + // SAFETY: a NUL-terminated source and a writable buffer whose length is passed. + let n = unsafe { ExpandEnvironmentStringsW(PCWSTR(src.as_ptr()), Some(&mut out)) } as usize; + if n == 0 || n > out.len() { + return s.to_vec(); + } + out.truncate(n.saturating_sub(1)); + out +} + +/// The icon at `index` of a local resource file or icon file, at `px`: the file is opened once and judged on its +/// handle (Pinned, a kind of LINK_ICON_SOURCES), its icon image is read through that handle as data (iconres: the +/// file is never loaded and never reopened by name) and handed to user32 as data. A system file whose icons Windows +/// keeps in its resource file (mun_for) is read from that file, pinned the same way and only at that exact path. +pub fn extract_icon(p: &WidePath, index: i32, px: u16) -> Option { + let file = Pinned::open(p, &LINK_ICON_SOURCES, drive_kind)?; + let mut image = iconres::icon_image(&file, index, px); + if image.is_none() && !iconres::has_icon_groups(&file) { + let mun = windows_dir().and_then(|w| mun_for(file.path(), &w))?; + let res = Pinned::open(&mun, &["mun"], drive_kind).filter(|r| same_path(r.path(), &mun))?; + image = iconres::icon_image(&res, index, px); + } + icon_from_image(&image?, px) +} + +/// Where Windows keeps the resources of a file of its own folders: `\SystemResources\.mun` for a file +/// directly in `\System32` or `\SysWOW64`, `windows` being the system's Windows folder. None for +/// any other file. +pub fn mun_for(file: &WidePath, windows: &WidePath) -> Option { + let dir = file.parent()?; + let system = ["System32", "SysWOW64"].iter().any(|d| { + let units: Vec = d.encode_utf16().collect(); + windows.join(&units).is_ok_and(|s| same_path(&s, &dir)) + }); + if !system { + return None; + } + let mut name = file.file_name()?.to_vec(); + name.extend(".mun".encode_utf16()); + let folder: Vec = "SystemResources".encode_utf16().collect(); + windows.join(&folder).ok()?.join(&name).ok() +} + +/// Two paths are the same text, ASCII letters compared without case (no other folding: a difference refuses). +fn same_path(a: &WidePath, b: &WidePath) -> bool { + let fold = |u: u16| if (u16::from(b'a')..=u16::from(b'z')).contains(&u) { u - 32 } else { u }; + a.units().len() == b.units().len() && a.units().iter().zip(b.units()).all(|(&x, &y)| fold(x) == fold(y)) +} + +/// The system's Windows folder (GetSystemWindowsDirectoryW), never the environment's. +fn windows_dir() -> Option { + let mut buf = [0u16; 260]; + // SAFETY: a writable buffer whose length is passed. + let n = unsafe { GetSystemWindowsDirectoryW(Some(&mut buf)) } as usize; + WidePath::new(buf.get(..n).filter(|s| !s.is_empty())?).ok() +} + +/// One icon image (iconres::image_ok passed) as an icon of `px` pixels: CreateIconFromResourceEx reads the bytes as +/// data. +fn icon_from_image(image: &[u8], px: u16) -> Option { + let side = i32::from(px); + // SAFETY: a readable buffer whose length is passed; the icon made is owned here and destroyed below. + let icon = unsafe { CreateIconFromResourceEx(image, true, 0x0003_0000, side, side, LR_DEFAULTCOLOR) }.ok()?; + let b = gdi::hicon_to_bgra(icon); + // SAFETY: the icon made above, destroyed once. + let _ = unsafe { DestroyIcon(icon) }; + b +} + /// Reads and deletes a bitmap. fn bitmap(bmp: HBITMAP) -> Option { let b = gdi::hbitmap_to_bgra(bmp); @@ -334,3 +560,117 @@ fn fault_thumb(dll: &std::path::Path, p: &WidePath, px: u16) -> Option { unsafe { thumb.GetThumbnail(u32::from(px), &mut bmp, &mut alpha) }.ok()?; bitmap(bmp) } + +#[cfg(test)] +mod tests { + use super::iconres::tests::{dib, ico, sample}; + use super::lnk::tests::{info, string, Link}; + use super::lnk::{HAS_ICON_LOCATION, IS_UNICODE}; + use super::*; + use crate::testkit::TempRoot; + + fn wide(p: &std::path::Path) -> WidePath { + WidePath::parse(&p.to_string_lossy()).expect("a temp path") + } + + /// The host's own seams on real files: the check by name, then the pinned reads. + fn icon_of_link(lnk: &WidePath) -> Option { + let source_ok = |q: &WidePath| { + allowed_kind_with(q, &LINK_ICON_SOURCES, drive_kind, file_attrs, folder_is_junction, gate::long_path) + }; + link_icon_with(lnk, read_link, expand_vars, source_ok, |q, i| extract_icon(q, i, 32)) + } + + /// A link whose LinkInfo names `dir` + `name`. + fn link_to(dir: &str, name: &str) -> Vec { + let mut l = Link::new(); + l.info = Some(info(dir, name, true)); + l.bytes() + } + + #[test] + fn a_shortcut_icon_is_read_from_its_local_target_as_data() { + let root = TempRoot::new("link-icon"); + let art = root.file("art.ico", &ico(&[(16, 32, dib(16, 0xFF10_2030)), (32, 32, dib(32, 0xFF20_40C0))])); + let dir = format!("{}\\", root.path().display()); + let lnk = wide(&root.file("a.lnk", &link_to(&dir, "art.ico"))); + let facts = read_link(&lnk).expect("read"); + assert_eq!(String::from_utf16_lossy(&facts.target), art.display().to_string()); + let b = icon_of_link(&lnk).expect("an icon"); + assert_eq!((b.w, b.h), (32, 32)); + assert_eq!(b.px.first(), Some(&0xFF20_40C0), "the 32-pixel image"); + // A program's icon group, from its resources. + root.file("app.exe", &sample(false)); + let app = wide(&root.file("app.lnk", &link_to(&dir, "app.exe"))); + assert_eq!(icon_of_link(&app).and_then(|b| b.px.first().copied()), Some(0xFF00_0002)); + // An icon location in ANSI text, decoded in the system code page. + let mut l = Link::new(); + l.strings = vec![(HAS_ICON_LOCATION, string(&art.display().to_string(), false))]; + let named = wide(&root.file("named.lnk", &l.bytes())); + assert_eq!(icon_of_link(&named).and_then(|b| b.px.first().copied()), Some(0xFF20_40C0)); + } + + /// A link that names its target only through an item-ID list, a link held open by a writer, a target that is a + /// folder link and a target of another kind all get no icon (the UI keeps the generic shortcut art). + #[test] + fn unknown_or_unsafe_targets_get_no_icon() { + let root = TempRoot::new("link-none"); + let dir = format!("{}\\", root.path().display()); + root.file("art.ico", &ico(&[(32, 32, dib(32, 0xFF20_40C0))])); + let mut l = Link::new(); + l.flags = IS_UNICODE; + l.id_list = Some(vec![0x14, 0, 0x1F, 0x50, 0xE0, 0x4F, 0xD0, 0x20, 0xEA, 0x3A, 0x69, 0x10, 0xA2, 0xD8]); + let ids = wide(&root.file("ids.lnk", &l.bytes())); + assert_eq!(read_link(&ids), Some(LinkFacts::default()), "nothing learned from the ID list"); + assert!(icon_of_link(&ids).is_none()); + let held = wide(&root.file("held.lnk", &link_to(&dir, "art.ico"))); + let writer = pinned::tests::try_writer(&root.at("held.lnk")).expect("a writer"); + assert!(read_link(&held).is_none(), "a link open for writing is not read"); + drop(writer); + assert!(icon_of_link(&held).is_some()); + let target = root.dir("target"); + root.junction("joined.ico", &target); + let joined = wide(&root.file("joined.lnk", &link_to(&dir, "joined.ico"))); + assert!(icon_of_link(&joined).is_none(), "a link as the source"); + root.file("notes.txt", b"text"); + let notes = wide(&root.file("notes.lnk", &link_to(&dir, "notes.txt"))); + assert!(icon_of_link(¬es).is_none(), "a document target"); + root.file("broken.ico", &[0, 0, 1, 0, 1, 0, 32, 32, 0, 0, 1, 0, 32, 0, 0xFF, 0xFF, 0, 0, 22, 0, 0, 0]); + let broken = wide(&root.file("broken.lnk", &link_to(&dir, "broken.ico"))); + assert!(icon_of_link(&broken).is_none(), "an icon file whose image runs past its end"); + } + + #[test] + fn link_facts_decode_ansi_text_or_drop_it() { + let parts = LinkParts { + icon: Some(LinkText::Ansi(b"C:\\a.ico".to_vec())), + index: 4, + target: Some(LinkText::Wide("C:\\b.exe".encode_utf16().collect())), + }; + let ascii = |b: &[u8]| b.is_ascii().then(|| b.iter().map(|&c| u16::from(c)).collect()); + let facts = link_facts(parts.clone(), ascii); + assert_eq!(facts.icon, "C:\\a.ico".encode_utf16().collect::>()); + assert_eq!((facts.index, facts.target.len()), (4, 8)); + let facts = link_facts(parts, |_| None); + assert!(facts.icon.is_empty(), "text that does not decode is absent"); + assert_eq!(decode_ansi(b"C:\\made-up\\a.ico"), Some("C:\\made-up\\a.ico".encode_utf16().collect())); + assert_eq!(decode_ansi(b""), Some(Vec::new())); + } + + #[test] + fn system_files_read_their_icons_from_the_resource_folder() { + let p = |s: &str| WidePath::parse(s).expect("a path"); + let win = p(r"C:\Windows"); + let mun = |s: &str| mun_for(&p(s), &win).map(|m| m.to_string_lossy()); + let want = Some(r"C:\Windows\SystemResources\shell32.dll.mun".to_string()); + assert_eq!(mun(r"C:\Windows\System32\shell32.dll"), want); + assert_eq!(mun(r"c:\windows\system32\shell32.dll"), Some(r"C:\Windows\SystemResources\shell32.dll.mun".into())); + assert_eq!(mun(r"C:\Windows\SysWOW64\a.exe"), Some(r"C:\Windows\SystemResources\a.exe.mun".into())); + for other in [r"C:\Windows\System32\sub\a.dll", r"C:\Windows\a.exe", r"C:\made-up\System32\a.dll"] { + assert_eq!(mun(other), None, "{other}"); + } + assert!(same_path(&p(r"C:\A\b.dll"), &p(r"c:\a\B.DLL"))); + assert!(!same_path(&p(r"C:\A\b.dll"), &p(r"C:\A\b.dl"))); + assert!(!same_path(&p("C:\\\u{c0}"), &p("C:\\\u{e0}")), "only ASCII letters fold"); + } +} diff --git a/apps/files/src/shell/images/iconres.rs b/apps/files/src/shell/images/iconres.rs new file mode 100644 index 00000000..3ceab763 --- /dev/null +++ b/apps/files/src/shell/images/iconres.rs @@ -0,0 +1,662 @@ +//! Icons read from a file's bytes as data, for the shell host: the icon resources of a PE file (an exe or a dll, read +//! through its section table and resource directory, never loaded) or the images of an icon file, every size and +//! offset checked against the file. What comes out is the bytes of one icon image (a DIB or a PNG whose header is +//! checked here), which the host hands to user32 as data (CreateIconFromResourceEx). A 16-bit (NE) file, a cursor and +//! anything else give nothing. + +use std::cmp::Reverse; + +/// Random access to a file's bytes: an open handle in the host, a slice in the tests. +pub trait ReadAt { + /// The file's size in bytes. + fn size(&self) -> u64; + /// Fills `buf` from `off`; false when the file is shorter or the read fails. + fn read_at(&self, off: u64, buf: &mut [u8]) -> bool; +} + +impl ReadAt for [u8] { + fn size(&self) -> u64 { + self.len() as u64 + } + + fn read_at(&self, off: u64, buf: &mut [u8]) -> bool { + let Ok(start) = usize::try_from(off) else { return false }; + match start.checked_add(buf.len()).and_then(|end| self.get(start..end)) { + Some(s) => { + buf.copy_from_slice(s); + true + } + None => false, + } + } +} + +/// The most bytes read for one structure (a directory, an icon group, an icon image): 256 x 256 pixels at 32 bits with +/// their mask are under 300 KiB, a PNG is smaller. +pub const MAX_READ: usize = 4 << 20; + +/// RT_ICON and RT_GROUP_ICON. +const RT_ICON: u32 = 3; +const RT_GROUP_ICON: u32 = 14; +/// A section table longer than this is not read. +const MAX_SECTIONS: usize = 1024; +/// The high bit of a resource entry: a name string (in the name) or a subdirectory (in the offset). +const HIGH: u32 = 0x8000_0000; + +fn u16_at(b: &[u8], at: usize) -> Option { + b.get(at..at.checked_add(2)?)?.try_into().ok().map(u16::from_le_bytes) +} + +fn u32_at(b: &[u8], at: usize) -> Option { + b.get(at..at.checked_add(4)?)?.try_into().ok().map(u32::from_le_bytes) +} + +/// `len` bytes from `off`, all inside the file and at most MAX_READ. +fn read(f: &R, off: u64, len: usize) -> Option> { + if len > MAX_READ || off.checked_add(len as u64)? > f.size() { + return None; + } + let mut v = vec![0; len]; + f.read_at(off, &mut v).then_some(v) +} + +/// The entry to draw at `px`, of entries given as (side, bits per pixel): the smallest side at least `px`, else the +/// largest; among equal sides the most bits. None for no entry. +pub fn pick(entries: &[(u32, u16)], px: u16) -> Option { + let px = u32::from(px); + let key = |&(side, bits): &(u32, u16)| { + if side >= px { + (0, side, Reverse(bits)) + } else { + (1, u32::MAX - side, Reverse(bits)) + } + }; + entries.iter().enumerate().min_by_key(|(_, e)| key(e)).map(|(i, _)| i) +} + +/// Whether `data` is one icon image user32 can read as data: a PNG whose header names 1 to 1024 pixels a side, or a +/// DIB (a BITMAPINFOHEADER of 1 to 256 pixels a side, uncompressed, 1 to 32 bits) whose colour table, colour rows and +/// mask rows (none needed at 32 bits) all lie inside the data. +pub fn image_ok(data: &[u8]) -> bool { + const PNG: [u8; 8] = [0x89, b'P', b'N', b'G', 0x0D, 0x0A, 0x1A, 0x0A]; + if data.starts_with(&PNG) { + let side = |at: usize| data.get(at..at + 4).and_then(|s| s.try_into().ok()).map(u32::from_be_bytes); + let ihdr = data.get(12..16) == Some(b"IHDR".as_slice()); + let sides_ok = [side(16), side(20)].iter().all(|s| s.is_some_and(|v| (1..=1024).contains(&v))); + return ihdr && data.len() >= 33 && sides_ok; + } + let field = |at: usize| u32_at(data, at).map(u64::from); + let (Some(40), Some(w), Some(h2), Some(planes), Some(bits), Some(0), Some(used)) = + (field(0), field(4), field(8), u16_at(data, 12), u16_at(data, 14), field(16), field(32)) + else { + return false; + }; + let h = h2 / 2; + if !(1..=256).contains(&w) || h2 % 2 != 0 || !(1..=256).contains(&h) || planes != 1 { + return false; + } + if ![1, 4, 8, 16, 24, 32].contains(&bits) { + return false; + } + let bits = u64::from(bits); + let palette = if bits <= 8 && used == 0 { 1 << bits } else { used }; + if palette > 256 || (bits <= 8 && palette > 1 << bits) { + return false; + } + let colour_row = (w * bits).div_ceil(32) * 4; + let mask_row = w.div_ceil(32) * 4; + let mask = if bits == 32 { 0 } else { mask_row * h }; + 40 + palette * 4 + colour_row * h + mask <= data.len() as u64 +} + +/// The image data of the icon at `index` drawn at `px`: from a PE file's resources (an index of 0 or more counts the +/// icon groups in their directory's order, names first; a negative one is the group whose id is -index) or from an +/// icon file (index 0 only). None for any other file, an index it does not have, and anything out of bounds. +pub fn icon_image(f: &R, index: i32, px: u16) -> Option> { + let head = read(f, 0, 4)?; + if head.starts_with(b"MZ") { + return pe_icon(f, index, px); + } + if head == [0, 0, 1, 0] && index == 0 { + return ico_icon(f, px); + } + None +} + +/// Whether a PE file has an icon group directory (a system file whose icons Windows keeps in a separate resource file +/// has none). +pub fn has_icon_groups(f: &R) -> bool { + Pe::read(f).is_some_and(|pe| pe.type_dir(f, RT_GROUP_ICON).is_some()) +} + +/// An icon file: its directory, the entry for `px`, and that entry's image. +fn ico_icon(f: &R, px: u16) -> Option> { + let count = usize::from(u16_at(&read(f, 0, 6)?, 4)?); + let dir = read(f, 6, count.checked_mul(16)?)?; + let entries: Vec<&[u8]> = dir.chunks_exact(16).collect(); + let sides: Vec<(u32, u16)> = entries.iter().map(|e| (side(e[0]), u16_at(e, 6).unwrap_or(0))).collect(); + let e = entries.get(pick(&sides, px)?)?; + let len = usize::try_from(u32_at(e, 8)?).ok()?; + let img = read(f, u64::from(u32_at(e, 12)?), len)?; + image_ok(&img).then_some(img) +} + +/// A directory's width or height byte: 0 is 256. +fn side(b: u8) -> u32 { + if b == 0 { + 256 + } else { + u32::from(b) + } +} + +/// A PE file's icon group at `index`, its entry for `px`, and that icon's image. +fn pe_icon(f: &R, index: i32, px: u16) -> Option> { + let pe = Pe::read(f)?; + let groups = pe.entries(f, pe.type_dir(f, RT_GROUP_ICON)?)?; + let (_, at) = if index >= 0 { + *groups.get(usize::try_from(index).ok()?)? + } else { + let id = index.checked_neg().and_then(|i| u32::try_from(i).ok()).filter(|&i| i <= 0xFFFF)?; + *groups.iter().find(|(name, _)| *name == id)? + }; + let group = pe.first_leaf(f, at)?; + if u16_at(&group, 0)? != 0 || u16_at(&group, 2)? != 1 { + return None; + } + let count = usize::from(u16_at(&group, 4)?); + let entries: Vec<&[u8]> = group.get(6..6 + count * 14)?.chunks_exact(14).collect(); + let sides: Vec<(u32, u16)> = entries.iter().map(|e| (side(e[0]), u16_at(e, 6).unwrap_or(0))).collect(); + let id = u32::from(u16_at(entries.get(pick(&sides, px)?)?, 12)?); + let icons = pe.entries(f, pe.type_dir(f, RT_ICON)?)?; + let (_, at) = *icons.iter().find(|(name, _)| *name == id)?; + let img = pe.first_leaf(f, at)?; + image_ok(&img).then_some(img) +} + +#[derive(Clone, Copy)] +struct Section { + va: u64, + raw_size: u64, + raw_ptr: u64, +} + +/// A PE file's sections and the file range of its resource directory (from its start to the end of its section). +struct Pe { + sections: Vec
, + rsrc: (u64, u64), +} + +impl Pe { + /// The headers of a PE file with a resource directory; None for anything else. + fn read(f: &R) -> Option { + let dos = read(f, 0, 64)?; + if !dos.starts_with(b"MZ") { + return None; + } + let nt = u64::from(u32_at(&dos, 0x3C)?); + let head = read(f, nt, 24)?; + if !head.starts_with(b"PE\0\0") { + return None; + } + let count = usize::from(u16_at(&head, 6)?); + let opt_size = usize::from(u16_at(&head, 20)?); + let opt = read(f, nt + 24, opt_size)?; + let dirs = match u16_at(&opt, 0)? { + 0x10B => 96, + 0x20B => 112, + _ => return None, + }; + if u32_at(&opt, dirs - 4)? < 3 || count > MAX_SECTIONS { + return None; + } + let rva = u64::from(u32_at(&opt, dirs + 16)?); + if rva == 0 { + return None; + } + let table = read(f, nt + 24 + opt_size as u64, count * 40)?; + // A section whose raw data runs past the end of the file is never read from. + let sections: Vec
= table + .chunks_exact(40) + .map(|s| Section { + va: u64::from(u32_at(s, 12).unwrap_or(0)), + raw_size: u64::from(u32_at(s, 16).unwrap_or(0)), + raw_ptr: u64::from(u32_at(s, 20).unwrap_or(0)), + }) + .filter(|s| s.raw_ptr + s.raw_size <= f.size()) + .collect(); + let home = sections.iter().find(|s| rva >= s.va && rva - s.va < s.raw_size)?; + let rsrc = (home.raw_ptr + (rva - home.va), home.raw_ptr + home.raw_size); + Some(Pe { sections, rsrc }) + } + + /// The file offset of `len` bytes at `rva`, all inside one section's raw data. + fn file_offset(&self, rva: u64, len: u64) -> Option { + let inside = |s: &&Section| rva >= s.va && (rva - s.va).checked_add(len).is_some_and(|e| e <= s.raw_size); + let s = self.sections.iter().find(inside)?; + Some(s.raw_ptr + (rva - s.va)) + } + + /// `len` bytes at `rel` from the resource directory's start, all inside its section. + fn rsrc_bytes(&self, f: &R, rel: u32, len: usize) -> Option> { + let at = self.rsrc.0 + u64::from(rel); + if at.checked_add(len as u64)? > self.rsrc.1 { + return None; + } + read(f, at, len) + } + + /// The (name, offset) entries of the directory at `rel`, named ones first as stored. + fn entries(&self, f: &R, rel: u32) -> Option> { + let head = self.rsrc_bytes(f, rel, 16)?; + let count = usize::from(u16_at(&head, 12)?) + usize::from(u16_at(&head, 14)?); + let body = self.rsrc_bytes(f, rel.checked_add(16)?, count * 8)?; + Some(body.chunks_exact(8).map(|e| (u32_at(e, 0).unwrap_or(0), u32_at(e, 4).unwrap_or(0))).collect()) + } + + /// The subdirectory of the resource type `id` in the root directory. + fn type_dir(&self, f: &R, id: u32) -> Option { + let (_, at) = self.entries(f, 0)?.into_iter().find(|(name, _)| *name == id)?; + (at & HIGH != 0).then_some(at & !HIGH) + } + + /// The data of the first language under a name's entry `at` (a subdirectory whose first entry is a leaf). + fn first_leaf(&self, f: &R, at: u32) -> Option> { + if at & HIGH == 0 { + return None; + } + let (_, leaf) = *self.entries(f, at & !HIGH)?.first()?; + if leaf & HIGH != 0 { + return None; + } + let entry = self.rsrc_bytes(f, leaf, 16)?; + let (rva, size) = (u64::from(u32_at(&entry, 0)?), u32_at(&entry, 4)?); + let len = usize::try_from(size).ok()?; + read(f, self.file_offset(rva, u64::from(size))?, len) + } +} + +#[cfg(test)] +pub(crate) mod tests { + use super::*; + + /// A resource name: an id, or a string (stored before the ids). + #[derive(Clone)] + enum N { + Id(u32), + Str(&'static str), + } + + /// The names of one resource type, each with its data. + type Names = Vec<(N, Vec)>; + + /// The bytes of a resource section at `base_rva` holding `types` (type id, then each name and its data), one + /// language each. + fn rsrc(types: &[(u32, Names)], base_rva: u32) -> Vec { + let dir = |n: usize| 16 + 8 * n; + let mut at = dir(types.len()); + let type_at: Vec = types + .iter() + .map(|(_, names)| { + let here = at; + at += dir(names.len()); + here + }) + .collect(); + let all = types.iter().map(|(_, names)| names.len()).sum::(); + let (mut lang_at, mut entry_at) = (Vec::new(), Vec::new()); + for _ in 0..all { + lang_at.push(at); + at += dir(1); + } + for _ in 0..all { + entry_at.push(at); + at += 16; + } + let mut out = vec![0u8; at]; + let put32 = |b: &mut Vec, at: usize, v: u32| b[at..at + 4].copy_from_slice(&v.to_le_bytes()); + let put16 = |b: &mut Vec, at: usize, v: u16| b[at..at + 2].copy_from_slice(&v.to_le_bytes()); + put16(&mut out, 14, types.len() as u16); + let mut k = 0; + for (t, (id, names)) in types.iter().enumerate() { + put32(&mut out, 16 + 8 * t, *id); + put32(&mut out, 16 + 8 * t + 4, HIGH | type_at[t] as u32); + let named = names.iter().filter(|(n, _)| matches!(n, N::Str(_))).count(); + put16(&mut out, type_at[t] + 12, named as u16); + put16(&mut out, type_at[t] + 14, (names.len() - named) as u16); + for (j, (name, data)) in names.iter().enumerate() { + let e = type_at[t] + 16 + 8 * j; + let name_value = match name { + N::Id(i) => *i, + N::Str(s) => { + let here = out.len(); + out.extend_from_slice(&(s.len() as u16).to_le_bytes()); + out.extend(s.encode_utf16().flat_map(|u| u.to_le_bytes())); + HIGH | here as u32 + } + }; + put32(&mut out, e, name_value); + put32(&mut out, e + 4, HIGH | lang_at[k] as u32); + put16(&mut out, lang_at[k] + 14, 1); + put32(&mut out, lang_at[k] + 16, 0x409); + put32(&mut out, lang_at[k] + 20, entry_at[k] as u32); + while out.len() % 4 != 0 { + out.push(0); + } + let data_at = out.len(); + out.extend_from_slice(data); + put32(&mut out, entry_at[k], base_rva + data_at as u32); + put32(&mut out, entry_at[k] + 4, data.len() as u32); + k += 1; + } + } + out + } + + const RSRC_RVA: u32 = 0x1000; + const RSRC_PTR: usize = 0x200; + + /// A PE32+ file (PE32 when `pe32`) with one section, the resource section `section`. + fn pe(section: &[u8], pe32: bool) -> Vec { + let mut b = vec![0u8; 0x40]; + b[..2].copy_from_slice(b"MZ"); + b[0x3C..0x40].copy_from_slice(&0x40u32.to_le_bytes()); + b.extend_from_slice(b"PE\0\0"); + let opt_size: u16 = if pe32 { 0xE0 } else { 0xF0 }; + let mut coff = vec![0u8; 20]; + coff[..2].copy_from_slice(&0x8664u16.to_le_bytes()); + coff[2..4].copy_from_slice(&1u16.to_le_bytes()); + coff[16..18].copy_from_slice(&opt_size.to_le_bytes()); + b.extend(coff); + let mut opt = vec![0u8; usize::from(opt_size)]; + let (magic, dirs): (u16, usize) = if pe32 { (0x10B, 96) } else { (0x20B, 112) }; + opt[..2].copy_from_slice(&magic.to_le_bytes()); + opt[dirs - 4..dirs].copy_from_slice(&16u32.to_le_bytes()); + opt[dirs + 16..dirs + 20].copy_from_slice(&RSRC_RVA.to_le_bytes()); + opt[dirs + 20..dirs + 24].copy_from_slice(&(section.len() as u32).to_le_bytes()); + b.extend(opt); + let raw_size = section.len().div_ceil(0x200) * 0x200; + let mut sec = vec![0u8; 40]; + sec[..6].copy_from_slice(b".rsrc\0"); + sec[8..12].copy_from_slice(&(section.len() as u32).to_le_bytes()); + sec[12..16].copy_from_slice(&RSRC_RVA.to_le_bytes()); + sec[16..20].copy_from_slice(&(raw_size as u32).to_le_bytes()); + sec[20..24].copy_from_slice(&(RSRC_PTR as u32).to_le_bytes()); + b.extend(sec); + b.resize(RSRC_PTR, 0); + b.extend_from_slice(section); + b.resize(RSRC_PTR + raw_size, 0); + b + } + + /// A 32-bit DIB icon image of `w` pixels a side, every pixel `argb`, with its mask. + pub(crate) fn dib(w: u32, argb: u32) -> Vec { + let mut b = Vec::new(); + for v in [40u32, w, 2 * w] { + b.extend_from_slice(&v.to_le_bytes()); + } + b.extend_from_slice(&1u16.to_le_bytes()); + b.extend_from_slice(&32u16.to_le_bytes()); + b.resize(40, 0); + for _ in 0..w * w { + b.extend_from_slice(&argb.to_le_bytes()); + } + b.resize(b.len() + (w.div_ceil(32) * 4 * w) as usize, 0); + b + } + + /// An icon group naming (side, bits, icon id) entries. + fn group(entries: &[(u8, u16, u16)]) -> Vec { + let mut b = [0u16, 1, entries.len() as u16].iter().flat_map(|v| v.to_le_bytes()).collect::>(); + for &(side, bits, id) in entries { + b.extend_from_slice(&[side, side, 0, 0]); + b.extend_from_slice(&1u16.to_le_bytes()); + b.extend_from_slice(&bits.to_le_bytes()); + b.extend_from_slice(&0u32.to_le_bytes()); + b.extend_from_slice(&id.to_le_bytes()); + } + b + } + + /// An icon file holding `images` as (side, bits, data). + pub(crate) fn ico(images: &[(u8, u16, Vec)]) -> Vec { + let mut b = [0u16, 1, images.len() as u16].iter().flat_map(|v| v.to_le_bytes()).collect::>(); + let mut at = 6 + 16 * images.len(); + for (side, bits, data) in images { + b.extend_from_slice(&[*side, *side, 0, 0]); + b.extend_from_slice(&1u16.to_le_bytes()); + b.extend_from_slice(&bits.to_le_bytes()); + b.extend_from_slice(&(data.len() as u32).to_le_bytes()); + b.extend_from_slice(&(at as u32).to_le_bytes()); + at += data.len(); + } + for (_, _, data) in images { + b.extend_from_slice(data); + } + b + } + + /// A PE whose icon groups are: "MAIN" (named) with 16 and 32 pixel images, id 5 with a 48 pixel image, id 9 with + /// a 16 pixel one. Each image's pixel value tells which it is. + pub(crate) fn sample(pe32: bool) -> Vec { + let icons = vec![ + (N::Id(1), dib(16, 0xFF00_0001)), + (N::Id(2), dib(32, 0xFF00_0002)), + (N::Id(3), dib(48, 0xFF00_0003)), + (N::Id(4), dib(16, 0xFF00_0004)), + ]; + let groups = vec![ + (N::Str("MAIN"), group(&[(16, 32, 1), (32, 32, 2)])), + (N::Id(5), group(&[(48, 32, 3)])), + (N::Id(9), group(&[(16, 32, 4)])), + ]; + pe(&rsrc(&[(RT_ICON, icons), (RT_GROUP_ICON, groups)], RSRC_RVA), pe32) + } + + /// Which sample image came back: the low byte of its first pixel. + fn which(img: Option>) -> Option { + img.and_then(|i| i.get(40).copied()) + } + + #[test] + fn pick_prefers_the_smallest_side_that_fits_then_the_most_bits() { + let e = [(16, 32), (32, 8), (32, 32), (48, 32), (256, 32)]; + assert_eq!(pick(&e, 16), Some(0)); + assert_eq!(pick(&e, 20), Some(2)); + assert_eq!(pick(&e, 32), Some(2)); + assert_eq!(pick(&e, 40), Some(3)); + assert_eq!(pick(&e, 300), Some(4), "nothing fits: the largest"); + assert_eq!(pick(&[], 32), None); + } + + #[test] + fn icon_groups_are_counted_in_directory_order_or_named_by_id() { + for pe32 in [false, true] { + let f = sample(pe32); + let f: &[u8] = &f; + assert_eq!(which(icon_image(f, 0, 16)), Some(1), "the first group, named, at 16"); + assert_eq!(which(icon_image(f, 0, 32)), Some(2), "the first group at 32"); + assert_eq!(which(icon_image(f, 1, 32)), Some(3), "the second group (id 5)"); + assert_eq!(which(icon_image(f, 2, 32)), Some(4), "the third group (id 9)"); + assert_eq!(icon_image(f, 3, 32), None, "no fourth group"); + assert_eq!(which(icon_image(f, -9, 32)), Some(4), "the group whose id is 9"); + assert_eq!(which(icon_image(f, -5, 32)), Some(3), "the group whose id is 5"); + assert_eq!(icon_image(f, -1, 32), None, "no group with id 1"); + assert_eq!(icon_image(f, i32::MIN, 32), None); + assert_eq!(icon_image(f, -0x1_0000, 32), None); + assert!(has_icon_groups(f)); + } + } + + #[test] + fn a_pe_without_icon_groups_has_none() { + let only_icons = pe(&rsrc(&[(RT_ICON, vec![(N::Id(1), dib(16, 0xFF00_0001))])], RSRC_RVA), false); + let f: &[u8] = &only_icons; + assert!(!has_icon_groups(f)); + assert_eq!(icon_image(f, 0, 16), None); + // A group naming an icon the file does not have. + let lost = pe(&rsrc(&[(RT_GROUP_ICON, vec![(N::Id(1), group(&[(16, 32, 7)]))])], RSRC_RVA), false); + assert_eq!(icon_image(&lost[..], 0, 16), None); + } + + #[test] + fn icon_files_give_their_best_image_at_index_zero_only() { + let f = ico(&[(16, 32, dib(16, 0xFF00_0001)), (32, 32, dib(32, 0xFF00_0002)), (0, 32, dib(64, 0xFF00_0003))]); + let f: &[u8] = &f; + assert_eq!(which(icon_image(f, 0, 16)), Some(1)); + assert_eq!(which(icon_image(f, 0, 24)), Some(2)); + assert_eq!(which(icon_image(f, 0, 100)), Some(3), "a side byte of 0 is 256"); + assert_eq!(icon_image(f, 1, 16), None); + assert_eq!(icon_image(f, -1, 16), None); + // A cursor file (type 2) and a 16-bit executable are not read. + let mut cursor = f.to_vec(); + cursor[2] = 2; + assert_eq!(icon_image(&cursor[..], 0, 16), None); + let mut ne = [0u8; 0x80]; + ne[..2].copy_from_slice(b"MZ"); + ne[0x3C] = 0x40; + ne[0x40..0x42].copy_from_slice(b"NE"); + assert_eq!(icon_image(&ne[..], 0, 16), None); + assert_eq!(icon_image(&[][..], 0, 16), None); + } + + #[test] + fn image_checks() { + assert!(image_ok(&dib(32, 0xFF00_0000))); + assert!(image_ok(&dib(256, 0xFF00_0000))); + let mut png = vec![0x89, b'P', b'N', b'G', 0x0D, 0x0A, 0x1A, 0x0A, 0, 0, 0, 13]; + png.extend_from_slice(b"IHDR"); + png.extend_from_slice(&256u32.to_be_bytes()); + png.extend_from_slice(&256u32.to_be_bytes()); + png.resize(33, 0); + assert!(image_ok(&png)); + let mut wide_png = png.clone(); + wide_png[16..20].copy_from_slice(&5000u32.to_be_bytes()); + assert!(!image_ok(&wide_png), "a PNG too large"); + assert!(!image_ok(&png[..32]), "a PNG header cut short"); + let set = |at: usize, v: u32| { + let mut d = dib(16, 0); + d[at..at + 4].copy_from_slice(&v.to_le_bytes()); + d + }; + for (what, d) in [ + ("header size", set(0, 12)), + ("no width", set(4, 0)), + ("too wide", set(4, 300)), + ("odd height", set(8, 31)), + ("no height", set(8, 0)), + ("negative height", set(8, u32::MAX)), + ("compressed", set(16, 1)), + ("palette past 8 bits", set(32, 300)), + ] { + assert!(!image_ok(&d), "{what}"); + } + let mut d = dib(16, 0); + d[14..16].copy_from_slice(&7u16.to_le_bytes()); + assert!(!image_ok(&d), "7 bits"); + let d = dib(16, 0); + assert!(!image_ok(&d[..d.len() - 16 * 16 * 4 - 1]), "rows past the data"); + let mut d8 = dib(16, 0); + d8[14..16].copy_from_slice(&8u16.to_le_bytes()); + d8.resize(40 + 256 * 4 + 16 * 16 + 4 * 16 - 1, 0); + assert!(!image_ok(&d8), "an 8-bit image without its whole mask"); + d8.push(0); + assert!(image_ok(&d8), "an 8-bit image with its palette, rows and mask"); + } + + /// Every pointer of a PE is checked: a resource directory, a data entry or a section outside the file or its + /// section give nothing. + #[test] + fn broken_pe_pointers_give_nothing() { + let good = sample(false); + assert!(icon_image(&good[..], 0, 16).is_some()); + let nt = 0x40usize; + let opt = nt + 24; + let sec = opt + 0xF0; + let field = |at: usize, v: u32| { + let mut b = good.clone(); + b[at..at + 4].copy_from_slice(&v.to_le_bytes()); + b + }; + for (what, b) in [ + ("e_lfanew past the end", field(0x3C, 0x7FFF_FFF0)), + ("e_lfanew at the end", field(0x3C, good.len() as u32 - 8)), + ("resource rva outside every section", field(opt + 112 + 16, 0x9000)), + ("section raw data past the end", field(sec + 20, 0x7FFF_0000)), + ("section raw size past the end", field(sec + 16, 0x7FFF_0000)), + ("no data directories", field(opt + 108, 2)), + ("a type directory past the section", field(RSRC_PTR + 16 + 8 + 4, HIGH | 0x7FFF_0000)), + ] { + assert_eq!(icon_image(&b[..], 0, 16), None, "{what}"); + } + let mut b = good.clone(); + b[opt..opt + 2].copy_from_slice(&0x30Bu16.to_le_bytes()); + assert_eq!(icon_image(&b[..], 0, 16), None, "an unknown optional header"); + let mut b = good.clone(); + b[nt..nt + 2].copy_from_slice(b"PX"); + assert_eq!(icon_image(&b[..], 0, 16), None, "no PE signature"); + let mut b = good.clone(); + b[nt + 6..nt + 8].copy_from_slice(&5000u16.to_le_bytes()); + assert_eq!(icon_image(&b[..], 0, 16), None, "a section table past the end"); + // Every data entry pointed outside the section, then given a size past it. + let s = &good[RSRC_PTR..]; + let entries: Vec = (0..s.len() - 16) + .step_by(4) + .filter(|&i| u32_at(s, i).is_some_and(|rva| (RSRC_RVA..RSRC_RVA + 0x1000).contains(&rva))) + .filter(|&i| u32_at(s, i + 12) == Some(0) && u32_at(s, i + 4).is_some_and(|n| n > 0 && n < 0x10000)) + .collect(); + assert!(!entries.is_empty()); + for e in entries { + for (rva, size) in [(0x9000u32, None), (RSRC_RVA, Some(0x10_0000u32))] { + let mut b = good.clone(); + b[RSRC_PTR + e..RSRC_PTR + e + 4].copy_from_slice(&rva.to_le_bytes()); + if let Some(n) = size { + b[RSRC_PTR + e + 4..RSRC_PTR + e + 8].copy_from_slice(&n.to_le_bytes()); + } + let got = icon_image(&b[..], 0, 16).or(icon_image(&b[..], 0, 32)); + assert!(got.as_ref().is_none_or(|i| image_ok(i))); + } + } + } + + fn rng(seed: &mut u64) -> u64 { + *seed ^= *seed >> 12; + *seed ^= *seed << 25; + *seed ^= *seed >> 27; + seed.wrapping_mul(0x2545_F491_4F6C_DD1D) + } + + /// Malformed PE and icon files: random bytes of the headers, directories and groups overwritten with random or + /// extreme values, and random cuts. None panics, and every image returned passes image_ok and fits the file. + #[test] + fn malformed_files_never_panic() { + let extremes = [0u8, 0xFF, 0x7F, 0x80, 0x01, 0x10]; + let mut seed = 0x0123_4567_89AB_CDEFu64; + let pe_file = sample(false); + let ico_file = ico(&[(16, 32, dib(16, 1)), (32, 32, dib(32, 2))]); + for (file, hot) in [(&pe_file, RSRC_PTR + 0x200), (&ico_file, 6 + 32 + 48)] { + for _ in 0..10_000 { + let mut b = file.clone(); + for _ in 0..1 + rng(&mut seed) % 4 { + // Mostly in the structures, sometimes anywhere. + let span = if rng(&mut seed).is_multiple_of(4) { b.len() } else { hot.min(b.len()) }; + let at = (rng(&mut seed) % span as u64) as usize; + let r = rng(&mut seed); + b[at] = if r.is_multiple_of(2) { + extremes[(r >> 8) as usize % extremes.len()] + } else { + (r >> 16) as u8 + }; + } + if rng(&mut seed).is_multiple_of(5) { + b.truncate((rng(&mut seed) % b.len() as u64) as usize); + } + let index = [0, 1, 2, -5, -9, i32::MIN][(rng(&mut seed) % 6) as usize]; + let px = [16u16, 32, 48, 256][(rng(&mut seed) % 4) as usize]; + let got = icon_image(&b[..], index, px); + assert!(got.is_none_or(|i| image_ok(&i) && i.len() <= b.len())); + let _ = has_icon_groups(&b[..]); + } + } + } +} diff --git a/apps/files/src/shell/images/lnk.rs b/apps/files/src/shell/images/lnk.rs new file mode 100644 index 00000000..b7c08e53 --- /dev/null +++ b/apps/files/src/shell/images/lnk.rs @@ -0,0 +1,533 @@ +//! The shortcut reader of the shell host: a link file (MS-SHLLINK) read from its bytes alone, every size and offset +//! checked against them, so the shell's link object is never created. That object's path query binds a link's item-ID +//! list to the shell namespace, which can load the namespace extension the file names: this reader skips the ID list +//! unread. It takes the header's flags and icon index, the LinkInfo's local base path and common path suffix, the +//! StringData's icon location and the ExtraData's two environment blocks. A link with the wrong header, an installer +//! (Darwin) id, or any size or offset out of its bytes gives nothing; a link whose target is known only through its +//! ID list (or only on a network share) has no target. + +/// The most bytes of a link file the host reads; a larger file is refused unread. +pub const MAX_LINK_BYTES: u64 = 1 << 20; + +/// Text as a link stores it: UTF-16 units, or bytes of the system's ANSI code page (the host decodes them). +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum LinkText { + Wide(Vec), + Ansi(Vec), +} + +/// What a link says about its icon: the icon location (the icon block's expandable one first, then the StringData's), +/// the header's icon index, and the target (the environment block's expandable path first, then the LinkInfo's local +/// path). None where the link names nothing that can be learned without the namespace. +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct LinkParts { + pub icon: Option, + pub index: i32, + pub target: Option, +} + +const HEADER_SIZE: usize = 0x4C; +/// CLSID 00021401-0000-0000-C000-000000000046 as the header stores it. +const LINK_CLSID: [u8; 16] = [0x01, 0x14, 0x02, 0, 0, 0, 0, 0, 0xC0, 0, 0, 0, 0, 0, 0, 0x46]; + +pub(crate) const HAS_ID_LIST: u32 = 0x1; +pub(crate) const HAS_LINK_INFO: u32 = 0x2; +pub(crate) const HAS_NAME: u32 = 0x4; +pub(crate) const HAS_RELATIVE_PATH: u32 = 0x8; +pub(crate) const HAS_WORKING_DIR: u32 = 0x10; +pub(crate) const HAS_ARGUMENTS: u32 = 0x20; +pub(crate) const HAS_ICON_LOCATION: u32 = 0x40; +pub(crate) const IS_UNICODE: u32 = 0x80; +pub(crate) const FORCE_NO_LINK_INFO: u32 = 0x100; +pub(crate) const HAS_EXP_STRING: u32 = 0x200; +pub(crate) const HAS_DARWIN_ID: u32 = 0x1000; +pub(crate) const HAS_EXP_ICON: u32 = 0x4000; + +pub(crate) const ENV_BLOCK: u32 = 0xA000_0001; +pub(crate) const DARWIN_BLOCK: u32 = 0xA000_0006; +pub(crate) const ICON_ENV_BLOCK: u32 = 0xA000_0007; +/// The size of both environment blocks: size and signature, 260 ANSI bytes, 260 UTF-16 units. +pub(crate) const ENV_BLOCK_SIZE: usize = 0x314; + +fn u16_at(b: &[u8], at: usize) -> Option { + b.get(at..at.checked_add(2)?)?.try_into().ok().map(u16::from_le_bytes) +} + +fn u32_at(b: &[u8], at: usize) -> Option { + b.get(at..at.checked_add(4)?)?.try_into().ok().map(u32::from_le_bytes) +} + +fn usize_at(b: &[u8], at: usize) -> Option { + u32_at(b, at).and_then(|v| usize::try_from(v).ok()) +} + +/// The bytes from `at` to the first NUL, which must lie inside `b`. +fn ansi_z(b: &[u8], at: usize) -> Option<&[u8]> { + let tail = b.get(at..)?; + tail.get(..tail.iter().position(|&c| c == 0)?) +} + +/// The UTF-16 units from `at` to the first NUL unit, which must lie inside `b`. +fn wide_z(b: &[u8], at: usize) -> Option> { + let units: Vec = b.get(at..)?.chunks_exact(2).map(|c| u16::from_le_bytes([c[0], c[1]])).collect(); + let n = units.iter().position(|&u| u == 0)?; + Some(units[..n].to_vec()) +} + +/// A StringData string or a block's field, cut at its first NUL: Wide for UTF-16 bytes, else Ansi. +fn text_of(raw: &[u8], unicode: bool) -> LinkText { + if unicode { + let units = raw.chunks_exact(2).map(|c| u16::from_le_bytes([c[0], c[1]])); + LinkText::Wide(units.take_while(|&u| u != 0).collect()) + } else { + LinkText::Ansi(raw.iter().copied().take_while(|&c| c != 0).collect()) + } +} + +/// None for an empty text. +fn non_empty(t: LinkText) -> Option { + let empty = match &t { + LinkText::Wide(w) => w.is_empty(), + LinkText::Ansi(a) => a.is_empty(), + }; + (!empty).then_some(t) +} + +/// The local path of a LinkInfo (its base path and common path suffix, UTF-16 when the header carries the Unicode +/// offsets): Some(None) when it names no local path (only a share), None when a size or offset breaks a bound. +fn local_path(info: &[u8]) -> Option> { + const VOLUME_ID_AND_LOCAL_BASE_PATH: u32 = 0x1; + let header = usize_at(info, 4)?; + if !(0x1C..=info.len()).contains(&header) { + return None; + } + if u32_at(info, 8)? & VOLUME_ID_AND_LOCAL_BASE_PATH == 0 { + return Some(None); + } + // Every string starts after the header, and every one the header declares is checked, used or not. + let at = |field: usize| usize_at(info, field).filter(|&o| o >= header); + let mut path = ansi_z(info, at(16)?)?.to_vec(); + path.extend_from_slice(ansi_z(info, at(24)?)?); + if header >= 0x24 && (usize_at(info, 28)? != 0 || usize_at(info, 32)? != 0) { + let mut wide = wide_z(info, at(28)?)?; + wide.extend(wide_z(info, at(32)?)?); + return Some(non_empty(LinkText::Wide(wide))); + } + Some(non_empty(LinkText::Ansi(path))) +} + +/// The path of an environment block (its UTF-16 field first, then its ANSI one): Some(None) when both are empty, None +/// when the block has the wrong size or a field has no NUL. +fn env_path(block: &[u8]) -> Option> { + if block.len() != ENV_BLOCK_SIZE { + return None; + } + let wide = wide_z(block.get(268..)?, 0)?; + if !wide.is_empty() { + return Some(Some(LinkText::Wide(wide))); + } + Some(non_empty(LinkText::Ansi(ansi_z(block.get(8..268)?, 0)?.to_vec()))) +} + +/// A link file's icon facts, read from its bytes only (see the module text). None for anything that is not a well +/// formed shell link, and for an advertised (installer) shortcut, whose icon belongs to the installer. +pub fn parse_link(b: &[u8]) -> Option { + if usize_at(b, 0)? != HEADER_SIZE || b.get(4..20)? != LINK_CLSID || b.len() < HEADER_SIZE { + return None; + } + let flags = u32_at(b, 20)?; + if flags & HAS_DARWIN_ID != 0 { + return None; + } + let index = i32::from_le_bytes(b.get(56..60)?.try_into().ok()?); + let mut at = HEADER_SIZE; + if flags & HAS_ID_LIST != 0 { + // Skipped unread: its size, then that many bytes. + at = at.checked_add(2)?.checked_add(usize::from(u16_at(b, at)?))?; + if at > b.len() { + return None; + } + } + let mut local = None; + if flags & HAS_LINK_INFO != 0 { + let end = at.checked_add(usize_at(b, at)?)?; + let info = b.get(at..end)?; + let path = local_path(info)?; + if flags & FORCE_NO_LINK_INFO == 0 { + local = path; + } + at = end; + } + let unicode = flags & IS_UNICODE != 0; + let mut icon_location = None; + for bit in [HAS_NAME, HAS_RELATIVE_PATH, HAS_WORKING_DIR, HAS_ARGUMENTS, HAS_ICON_LOCATION] { + if flags & bit == 0 { + continue; + } + let units = usize::from(u16_at(b, at)?); + let start = at.checked_add(2)?; + let end = start.checked_add(if unicode { units.checked_mul(2)? } else { units })?; + let raw = b.get(start..end)?; + if bit == HAS_ICON_LOCATION { + icon_location = non_empty(text_of(raw, unicode)); + } + at = end; + } + let (mut env, mut icon_env) = (None, None); + // The ExtraData blocks, up to the terminal block (a size under 4) or the end of the file. + while let Some(size) = usize_at(b, at) { + if size < 4 { + break; + } + let end = at.checked_add(size)?; + let block = b.get(at..end)?; + match u32_at(block, 4)? { + ENV_BLOCK => env = env_path(block)?, + ICON_ENV_BLOCK => icon_env = env_path(block)?, + DARWIN_BLOCK => return None, + _ => {} + } + at = end; + } + let icon = icon_env.filter(|_| flags & HAS_EXP_ICON != 0).or(icon_location); + let target = env.filter(|_| flags & HAS_EXP_STRING != 0).or(local); + Some(LinkParts { icon, index, target }) +} + +#[cfg(test)] +pub(crate) mod tests { + use super::*; + + /// A link file built field by field, for the parser's tests. + #[derive(Clone, Default)] + pub(crate) struct Link { + pub(crate) flags: u32, + pub(crate) index: i32, + pub(crate) id_list: Option>, + pub(crate) info: Option>, + pub(crate) strings: Vec<(u32, Vec)>, + pub(crate) extra: Vec>, + pub(crate) terminal: bool, + } + + impl Link { + pub(crate) fn new() -> Link { + Link { terminal: true, ..Link::default() } + } + + pub(crate) fn bytes(&self) -> Vec { + let mut flags = self.flags; + let mut b = Vec::new(); + b.extend_from_slice(&(HEADER_SIZE as u32).to_le_bytes()); + b.extend_from_slice(&LINK_CLSID); + if self.id_list.is_some() { + flags |= HAS_ID_LIST; + } + if self.info.is_some() { + flags |= HAS_LINK_INFO; + } + for (bit, _) in &self.strings { + flags |= bit; + } + b.extend_from_slice(&flags.to_le_bytes()); + b.resize(56, 0); + b.extend_from_slice(&self.index.to_le_bytes()); + b.resize(HEADER_SIZE, 0); + if let Some(ids) = &self.id_list { + b.extend_from_slice(&(ids.len() as u16).to_le_bytes()); + b.extend_from_slice(ids); + } + if let Some(info) = &self.info { + b.extend_from_slice(info); + } + let mut strings = self.strings.clone(); + strings.sort_by_key(|(bit, _)| *bit); + for (_, s) in &strings { + b.extend_from_slice(s); + } + for block in &self.extra { + b.extend_from_slice(block); + } + if self.terminal { + b.extend_from_slice(&0u32.to_le_bytes()); + } + b + } + } + + fn utf16(s: &str) -> Vec { + s.encode_utf16().collect() + } + + fn wide_bytes(s: &str) -> Vec { + utf16(s).iter().flat_map(|u| u.to_le_bytes()).collect() + } + + /// A StringData string: its count, then its characters. + pub(crate) fn string(s: &str, unicode: bool) -> Vec { + let (count, body) = if unicode { (utf16(s).len(), wide_bytes(s)) } else { (s.len(), s.as_bytes().to_vec()) }; + let mut b = (count as u16).to_le_bytes().to_vec(); + b.extend(body); + b + } + + /// A LinkInfo with a local base path and suffix (ANSI), and their UTF-16 copies when `wide`. + pub(crate) fn info(base: &str, suffix: &str, wide: bool) -> Vec { + let header: u32 = if wide { 0x24 } else { 0x1C }; + // A VolumeID of a fixed drive with an empty label, never read by the parser. + let mut tail = [17u32.to_le_bytes(), 3u32.to_le_bytes(), 0u32.to_le_bytes(), 16u32.to_le_bytes()].concat(); + tail.push(0); + let base_at = header as usize + tail.len(); + tail.extend_from_slice(base.as_bytes()); + tail.push(0); + let suffix_at = header as usize + tail.len(); + tail.extend_from_slice(suffix.as_bytes()); + tail.push(0); + let (mut wbase_at, mut wsuffix_at) = (0, 0); + if wide { + wbase_at = header as usize + tail.len(); + tail.extend(wide_bytes(base)); + tail.extend([0, 0]); + wsuffix_at = header as usize + tail.len(); + tail.extend(wide_bytes(suffix)); + tail.extend([0, 0]); + } + let size = header as usize + tail.len(); + let mut b = Vec::new(); + for v in [size, header as usize, 1, header as usize, base_at, 0, suffix_at] { + b.extend_from_slice(&(v as u32).to_le_bytes()); + } + if wide { + b.extend_from_slice(&(wbase_at as u32).to_le_bytes()); + b.extend_from_slice(&(wsuffix_at as u32).to_le_bytes()); + } + b.extend(tail); + b + } + + /// An environment block with `signature`: `ansi` and `wide` in their fields. + pub(crate) fn env_block(signature: u32, ansi: &str, wide: &str) -> Vec { + let mut b = (ENV_BLOCK_SIZE as u32).to_le_bytes().to_vec(); + b.extend_from_slice(&signature.to_le_bytes()); + let mut a = ansi.as_bytes().to_vec(); + a.resize(260, 0); + b.extend(a); + let mut w = wide_bytes(wide); + w.resize(520, 0); + b.extend(w); + b + } + + fn wide(s: &str) -> Option { + Some(LinkText::Wide(utf16(s))) + } + + fn ansi(s: &str) -> Option { + Some(LinkText::Ansi(s.as_bytes().to_vec())) + } + + #[test] + fn a_link_with_a_local_path_and_an_icon_location() { + let mut l = Link::new(); + l.flags = IS_UNICODE; + l.index = -12; + l.id_list = Some(vec![0x14, 0, 0x1F, 0x50, 1, 2, 3, 4]); + l.info = Some(info(r"C:\made-up\", "app.exe", false)); + let icons = string(r"C:\made-up\icons.dll", true); + l.strings = vec![(HAS_NAME, string("A name", true)), (HAS_ICON_LOCATION, icons)]; + let got = parse_link(&l.bytes()).expect("parsed"); + let want = LinkParts { icon: wide(r"C:\made-up\icons.dll"), index: -12, target: ansi(r"C:\made-up\app.exe") }; + assert_eq!(got, want); + l.info = Some(info(r"C:\made-up\", "app.exe", true)); + assert_eq!(parse_link(&l.bytes()).and_then(|p| p.target), wide(r"C:\made-up\app.exe"), "the Unicode copy"); + l.flags = 0; + l.strings = vec![(HAS_ARGUMENTS, string("-x", false)), (HAS_ICON_LOCATION, string(r"C:\a.ico", false))]; + assert_eq!(parse_link(&l.bytes()).and_then(|p| p.icon), ansi(r"C:\a.ico"), "ANSI strings"); + } + + /// A link that knows its target only through its item-ID list has none here: the list is never read. + #[test] + fn an_id_list_alone_names_no_target() { + let mut l = Link::new(); + l.id_list = Some(vec![0x14, 0, 0x1F, 0x50, 0xE0, 0x4F, 0xD0, 0x20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + assert_eq!(parse_link(&l.bytes()), Some(LinkParts::default())); + // The list's bytes are skipped whatever they hold, a path among them too. + l.id_list = Some(r"C:\made-up\app.exe".bytes().chain([0]).collect()); + assert_eq!(parse_link(&l.bytes()), Some(LinkParts::default())); + // A LinkInfo that names only a share gives no target either, nor one that the header says to ignore. + let mut share = info(r"C:\made-up\", "app.exe", false); + share[8] = 2; + l.info = Some(share); + assert_eq!(parse_link(&l.bytes()).and_then(|p| p.target), None); + l.info = Some(info(r"C:\made-up\", "app.exe", false)); + l.flags = FORCE_NO_LINK_INFO; + assert_eq!(parse_link(&l.bytes()).and_then(|p| p.target), None); + } + + #[test] + fn the_environment_blocks_come_first() { + let mut l = Link::new(); + l.flags = HAS_EXP_STRING | HAS_EXP_ICON; + l.info = Some(info(r"C:\made-up\", "app.exe", false)); + l.strings = vec![(HAS_ICON_LOCATION, string(r"C:\made-up\plain.ico", false))]; + l.extra = vec![ + env_block(0xA000_0003, "", ""), + env_block(ENV_BLOCK, r"%ProgramFiles%\made-up\app.exe", r"%ProgramFiles%\made-up\app.exe"), + env_block(ICON_ENV_BLOCK, r"%SystemRoot%\made-up.dll", ""), + ]; + let got = parse_link(&l.bytes()).expect("parsed"); + assert_eq!(got.target, wide(r"%ProgramFiles%\made-up\app.exe")); + assert_eq!(got.icon, ansi(r"%SystemRoot%\made-up.dll"), "the ANSI field when the UTF-16 one is empty"); + // Without their flags the blocks are not used. + l.flags = 0; + let got = parse_link(&l.bytes()).expect("parsed"); + assert_eq!((got.icon, got.target), (ansi(r"C:\made-up\plain.ico"), ansi(r"C:\made-up\app.exe"))); + // A missing terminal block ends the data too. + l.terminal = false; + assert!(parse_link(&l.bytes()).is_some()); + } + + #[test] + fn installer_links_and_foreign_files_give_nothing() { + let mut l = Link::new(); + l.flags = HAS_DARWIN_ID; + assert_eq!(parse_link(&l.bytes()), None, "the Darwin flag"); + l.flags = 0; + l.extra = vec![env_block(DARWIN_BLOCK, "x", "x")]; + assert_eq!(parse_link(&l.bytes()), None, "a Darwin block"); + let good = Link::new().bytes(); + assert!(parse_link(&good).is_some()); + let mut other_class = good.clone(); + other_class[4] ^= 1; + assert_eq!(parse_link(&other_class), None); + let mut other_size = good.clone(); + other_size[0] = 0x4D; + assert_eq!(parse_link(&other_size), None); + assert_eq!(parse_link(&good[..HEADER_SIZE - 1]), None); + assert_eq!(parse_link(b"[InternetShortcut]\r\nURL=file:///C:/made-up\r\n"), None); + assert_eq!(parse_link(&[]), None); + } + + /// Every size and offset is checked: a field that points past its structure, a string without its NUL, a count past + /// the end and an environment block of another size each make the whole link unreadable. + #[test] + fn broken_bounds_give_nothing() { + let mut l = Link::new(); + l.info = Some(info(r"C:\made-up\", "app.exe", true)); + l.strings = vec![(HAS_ICON_LOCATION, string(r"C:\made-up\icons.dll", true))]; + l.flags = IS_UNICODE | HAS_EXP_STRING; + l.extra = vec![env_block(ENV_BLOCK, "a", "a")]; + let good = l.bytes(); + assert!(parse_link(&good).is_some()); + let info_at = HEADER_SIZE; + let field = |b: &mut Vec, at: usize, v: u32| b[at..at + 4].copy_from_slice(&v.to_le_bytes()); + let cases: Vec<(&str, usize, u32)> = vec![ + ("LinkInfo size past the end", info_at, 0x7FFF_FFFF), + ("LinkInfo size under its header", info_at, 0x10), + ("header size past the LinkInfo", info_at + 4, 0x1000), + ("header size too small", info_at + 4, 0x10), + ("base path past the LinkInfo", info_at + 16, 0x1000), + ("base path inside the header", info_at + 16, 4), + ("suffix past the LinkInfo", info_at + 24, u32::MAX), + ("Unicode base past the LinkInfo", info_at + 28, 0x1000), + ("Unicode suffix past the LinkInfo", info_at + 32, 0x1000), + ]; + for (what, at, v) in cases { + let mut b = good.clone(); + field(&mut b, at, v); + assert_eq!(parse_link(&b), None, "{what}"); + } + // A string with no NUL before the end of the LinkInfo. + let mut no_nul = info(r"C:\made-up\", "app.exe", false); + let last = no_nul.len() - 1; + no_nul[last] = b'x'; + let mut m = Link::new(); + m.info = Some(no_nul); + assert_eq!(parse_link(&m.bytes()), None, "no NUL"); + // A StringData count past the end. + let mut m = Link::new(); + m.strings = vec![(HAS_ICON_LOCATION, vec![0xFF, 0x7F, b'C'])]; + m.terminal = false; + assert_eq!(parse_link(&m.bytes()), None, "a count past the end"); + // An environment block of another size, and one past the end. + let mut m = Link::new(); + let mut short = env_block(ENV_BLOCK, "a", "a"); + short.truncate(0x100); + short[..4].copy_from_slice(&0x100u32.to_le_bytes()); + m.extra = vec![short]; + assert_eq!(parse_link(&m.bytes()), None, "an environment block of another size"); + let mut m = Link::new(); + m.extra = vec![[0x00, 0x10, 0, 0].to_vec(), ENV_BLOCK.to_le_bytes().to_vec()]; + m.terminal = false; + assert_eq!(parse_link(&m.bytes()), None, "a block past the end"); + let mut m = Link::new(); + m.extra = vec![6u32.to_le_bytes().to_vec(), vec![0, 0]]; + assert_eq!(parse_link(&m.bytes()), None, "a block too small for its signature"); + // An environment field with no NUL. + let mut full = env_block(ENV_BLOCK, "", ""); + full[268..788].copy_from_slice(&[b'a', 0].repeat(260)); + let mut m = Link::new(); + m.flags = HAS_EXP_STRING; + m.extra = vec![full]; + assert_eq!(parse_link(&m.bytes()), None, "a UTF-16 field with no NUL"); + // An ID list that runs past the end. + let mut b = Link::new().bytes(); + b[20] |= HAS_ID_LIST as u8; + b.truncate(HEADER_SIZE); + b.extend_from_slice(&[0x40, 0, 1, 2]); + assert_eq!(parse_link(&b), None, "an ID list past the end"); + } + + /// xorshift64*: a fixed sequence, so a failure repeats. + fn rng(seed: &mut u64) -> u64 { + *seed ^= *seed >> 12; + *seed ^= *seed << 25; + *seed ^= *seed >> 27; + seed.wrapping_mul(0x2545_F491_4F6C_DD1D) + } + + /// Malformed links: every cut of a full link, and many with random bytes overwritten by random or extreme values. + /// None of them panics, and whatever is read stays inside the file. + #[test] + fn malformed_links_never_panic() { + let mut l = Link::new(); + l.flags = IS_UNICODE | HAS_EXP_STRING | HAS_EXP_ICON; + l.id_list = Some(vec![4, 0, 1, 2]); + l.info = Some(info(r"C:\made-up\", "app.exe", true)); + l.strings = vec![ + (HAS_NAME, string("n", true)), + (HAS_RELATIVE_PATH, string(r"..\app.exe", true)), + (HAS_WORKING_DIR, string(r"C:\made-up", true)), + (HAS_ARGUMENTS, string("-a", true)), + (HAS_ICON_LOCATION, string(r"C:\made-up\icons.dll", true)), + ]; + l.extra = vec![env_block(ENV_BLOCK, "a", "a"), env_block(ICON_ENV_BLOCK, "b", "b")]; + let full = l.bytes(); + assert!(parse_link(&full).is_some()); + let within = |t: &Option| match t { + Some(LinkText::Wide(w)) => w.len() * 2 <= full.len(), + Some(LinkText::Ansi(a)) => a.len() <= full.len(), + None => true, + }; + for n in 0..full.len() { + let got = parse_link(&full[..n]); + assert!(got.as_ref().is_none_or(|p| within(&p.icon) && within(&p.target)), "cut at {n}"); + } + let extremes = [0u8, 0xFF, 0x7F, 0x80, 0x01, 0x4C]; + let mut seed = 0x9E37_79B9_7F4A_7C15u64; + for _ in 0..20_000 { + let mut b = full.clone(); + for _ in 0..1 + rng(&mut seed) % 6 { + let at = (rng(&mut seed) % b.len() as u64) as usize; + let r = rng(&mut seed); + b[at] = + if r.is_multiple_of(2) { extremes[(r >> 8) as usize % extremes.len()] } else { (r >> 16) as u8 }; + } + if rng(&mut seed).is_multiple_of(4) { + b.truncate((rng(&mut seed) % b.len() as u64) as usize); + } + let got = parse_link(&b); + assert!(got.as_ref().is_none_or(|p| within(&p.icon) && within(&p.target))); + } + } +} diff --git a/apps/files/src/shell/images/pinned.rs b/apps/files/src/shell/images/pinned.rs new file mode 100644 index 00000000..a6f30538 --- /dev/null +++ b/apps/files/src/shell/images/pinned.rs @@ -0,0 +1,266 @@ +//! A local file opened once and then read through that handle only, for the shell host's icons. A shortcut and the +//! file its icon comes from are opened here and never reopened by name, so neither can be swapped between the check +//! and the read for a link, a remote file or another file. The open does not follow a reparse point in the last +//! component, asks for no recall of a dehydrated file, and shares reading only: while it is held no writer or deleter +//! can open the file and it cannot be renamed. The handle is then judged by itself: a disk file whose attributes pass +//! attrs_allow_icon and that is no folder, at a final path (GetFinalPathNameByHandleW) that passes may_load_icon_from +//! and is of one of the kinds asked. The caller's check by name runs before the open, so a path on a share or a +//! removable drive is never opened at all. + +use std::os::windows::io::{AsRawHandle, FromRawHandle, OwnedHandle}; + +use oled_trust::frame::files::WidePath; +use windows::core::PCWSTR; +use windows::Win32::Foundation::HANDLE; +use windows::Win32::Storage::FileSystem::{ + CreateFileW, FileAttributeTagInfo, GetFileInformationByHandleEx, GetFileSizeEx, GetFileType, + GetFinalPathNameByHandleW, ReadFile, FILE_ATTRIBUTE_TAG_INFO, FILE_FLAG_OPEN_NO_RECALL, + FILE_FLAG_OPEN_REPARSE_POINT, FILE_GENERIC_READ, FILE_NAME_NORMALIZED, FILE_SHARE_READ, FILE_TYPE_DISK, + GETFINALPATHNAMEBYHANDLE_FLAGS, OPEN_EXISTING, VOLUME_NAME_DOS, +}; +use windows::Win32::System::IO::{OVERLAPPED, OVERLAPPED_0, OVERLAPPED_0_0}; + +use super::iconres::ReadAt; +use super::{attrs_allow_icon, ext_whole, may_load_icon_from}; +use crate::drives::DriveKind; + +/// An open, judged file (see the module text) and its final path. +pub struct Pinned { + handle: OwnedHandle, + size: u64, + path: WidePath, +} + +impl Pinned { + /// Opens `p` once and judges the handle: None when the open or any check fails. `drive_kind` judges the final + /// path's drive. + pub fn open(p: &WidePath, kinds: &[&str], drive_kind: impl Fn(u16) -> DriveKind) -> Option { + let raw = p.raw(); + // FILE_FLAG_OPEN_NO_RECALL has the bit of SECURITY_SQOS_PRESENT: a pipe would get an anonymous client (the + // check by name before the open refuses every pipe and device path anyway). + let flags = FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_OPEN_NO_RECALL; + // SAFETY: a NUL-terminated path alive for the call; no security attributes, no template. + let h = unsafe { + CreateFileW(PCWSTR(raw.as_ptr()), FILE_GENERIC_READ.0, FILE_SHARE_READ, None, OPEN_EXISTING, flags, None) + } + .ok()?; + // SAFETY: a fresh handle, owned by nothing else. + let handle = unsafe { OwnedHandle::from_raw_handle(h.0) }; + let h = HANDLE(handle.as_raw_handle()); + // SAFETY: an open handle. + if unsafe { GetFileType(h) } != FILE_TYPE_DISK { + return None; + } + let mut tag = FILE_ATTRIBUTE_TAG_INFO::default(); + let tag_size = size_of::() as u32; + // SAFETY: an open handle; a writable struct of the size given. + unsafe { GetFileInformationByHandleEx(h, FileAttributeTagInfo, std::ptr::from_mut(&mut tag).cast(), tag_size) } + .ok()?; + if !handle_attrs_ok(tag.FileAttributes) { + return None; + } + let mut size = 0i64; + // SAFETY: an open handle and a writable size. + unsafe { GetFileSizeEx(h, &mut size) }.ok()?; + let path = final_path_ok(&final_path(h)?, kinds, drive_kind)?; + Some(Pinned { handle, size: u64::try_from(size).ok()?, path }) + } + + /// The final path of the open file, without its `\\?\` prefix. + pub fn path(&self) -> &WidePath { + &self.path + } + + /// The whole file; None when it is larger than `max` or a read fails. + pub fn read_all(&self, max: u64) -> Option> { + if self.size > max { + return None; + } + let mut v = vec![0; usize::try_from(self.size).ok()?]; + self.read_at(0, &mut v).then_some(v) + } +} + +impl ReadAt for Pinned { + fn size(&self) -> u64 { + self.size + } + + fn read_at(&self, off: u64, buf: &mut [u8]) -> bool { + let h = HANDLE(self.handle.as_raw_handle()); + let mut done = 0usize; + while let Some(rest) = buf.get_mut(done..).filter(|r| !r.is_empty()) { + let Some(at) = off.checked_add(done as u64) else { return false }; + let offset = OVERLAPPED_0_0 { Offset: at as u32, OffsetHigh: (at >> 32) as u32 }; + let mut ov = OVERLAPPED { Anonymous: OVERLAPPED_0 { Anonymous: offset }, ..Default::default() }; + let mut n = 0u32; + // SAFETY: an open synchronous handle; a writable buffer whose length is passed, a writable count, and an + // OVERLAPPED that only gives the offset (the read ends before the call returns). + let ok = unsafe { ReadFile(h, Some(rest), Some(&raw mut n), Some(&raw mut ov)) }.is_ok(); + if !ok || n == 0 { + return false; + } + done += n as usize; + } + true + } +} + +/// The attribute rule of a pinned file: attrs_allow_icon's (no reparse point, nothing offline or dehydrated), and no +/// folder. +pub fn handle_attrs_ok(attrs: u32) -> bool { + const DIRECTORY: u32 = 0x10; + attrs_allow_icon(attrs) && attrs & DIRECTORY == 0 +} + +/// The final-path rule of a pinned file, on GetFinalPathNameByHandleW's text: may_load_icon_from (a fixed drive +/// through `drive_kind`, no share, device or volume name) and a kind of `kinds`. The path without its prefix, or None. +pub fn final_path_ok(final_units: &[u16], kinds: &[&str], drive_kind: impl Fn(u16) -> DriveKind) -> Option { + if !may_load_icon_from(final_units, drive_kind) { + return None; + } + let p = WidePath::new(final_units).ok()?; + kinds.contains(&ext_whole(&p).as_str()).then_some(p) +} + +/// GetFinalPathNameByHandleW (normalized, DOS volume names) of an open handle. +fn final_path(h: HANDLE) -> Option> { + let mut buf = vec![0u16; 512]; + for _ in 0..2 { + let flags = GETFINALPATHNAMEBYHANDLE_FLAGS(FILE_NAME_NORMALIZED.0 | VOLUME_NAME_DOS.0); + // SAFETY: an open handle; `buf` is writable for its whole length. + let n = unsafe { GetFinalPathNameByHandleW(h, &mut buf, flags) } as usize; + if n == 0 { + return None; + } + if n < buf.len() { + buf.truncate(n); + return Some(buf); + } + buf = vec![0u16; n + 1]; + } + None +} + +#[cfg(test)] +pub(crate) mod tests { + use std::os::windows::ffi::OsStrExt; + + use windows::Win32::Storage::FileSystem::{FILE_FLAGS_AND_ATTRIBUTES, FILE_GENERIC_WRITE, FILE_SHARE_WRITE}; + + use super::*; + use crate::testkit::TempRoot; + + /// A handle on `p` with write access, as a program writing the file holds one (nothing is written); None when + /// the file cannot be opened that way. + pub(crate) fn try_writer(p: &std::path::Path) -> Option { + let w: Vec = p.as_os_str().encode_wide().chain([0]).collect(); + let share = FILE_SHARE_READ | FILE_SHARE_WRITE; + let (access, none) = (FILE_GENERIC_WRITE.0, FILE_FLAGS_AND_ATTRIBUTES(0)); + // SAFETY: a NUL-terminated path alive for the call; no security attributes, no template. + let h = unsafe { CreateFileW(PCWSTR(w.as_ptr()), access, share, None, OPEN_EXISTING, none, None) }; + // SAFETY: a fresh handle, owned by nothing else. + h.ok().map(|h| unsafe { OwnedHandle::from_raw_handle(h.0) }) + } + + fn fixed(_: u16) -> DriveKind { + DriveKind::Fixed + } + + fn wide(p: &std::path::Path) -> WidePath { + WidePath::parse(&p.to_string_lossy()).expect("a temp path") + } + + fn units(s: &str) -> Vec { + s.encode_utf16().collect() + } + + #[test] + fn a_pinned_file_is_read_through_its_handle() { + let root = TempRoot::new("pinned-read"); + let bytes: Vec = (0..=255u8).cycle().take(70_000).collect(); + let p = wide(&root.file("art.ico", &bytes)); + let f = Pinned::open(&p, &["ico"], fixed).expect("pinned"); + assert_eq!(f.size(), 70_000); + assert_eq!(f.read_all(1 << 20).as_deref(), Some(bytes.as_slice())); + assert_eq!(f.read_all(69_999), None, "larger than asked"); + let mut part = [0u8; 4]; + assert!(f.read_at(69_996, &mut part)); + assert_eq!(part, [bytes[69_996], bytes[69_997], bytes[69_998], bytes[69_999]]); + assert!(!f.read_at(69_997, &mut part), "past the end"); + assert!(!f.read_at(u64::MAX - 1, &mut part)); + assert_eq!(f.path().file_name(), p.file_name(), "the final path names the file"); + assert!(Pinned::open(&p, &["exe", "dll"], fixed).is_none(), "the kind is judged on the final path"); + assert!(Pinned::open(&p, &["ico"], |_| DriveKind::Removable).is_none(), "and its drive"); + } + + /// While the file is pinned it cannot be renamed, replaced or opened for writing (nor deleted), so what was judged + /// is what is read; a file another process holds open for writing is not pinned at all. + #[test] + fn a_pinned_file_cannot_be_swapped() { + let root = TempRoot::new("pinned-swap"); + let p = wide(&root.file("art.ico", b"icon")); + root.file("other.ico", b"other"); + let f = Pinned::open(&p, &["ico"], fixed).expect("pinned"); + assert!(root.try_rename("art.ico", "moved.ico").is_err(), "renamed away"); + assert!(root.try_rename("other.ico", "art.ico").is_err(), "replaced"); + assert!(try_writer(&root.at("art.ico")).is_none(), "opened for writing"); + assert_eq!(f.read_all(64).as_deref(), Some(b"icon".as_slice())); + drop(f); + let writer = try_writer(&root.at("art.ico")).expect("a writer"); + assert!(Pinned::open(&p, &["ico"], fixed).is_none(), "a file open for writing"); + drop(writer); + assert!(Pinned::open(&p, &["ico"], fixed).is_some()); + } + + /// A folder, a junction and a symbolic link are never pinned: the open does not follow the last component. + #[test] + fn folders_and_links_are_not_pinned() { + let root = TempRoot::new("pinned-links"); + let target = root.dir("target"); + root.dir("folder.ico"); + root.junction("joined.ico", &target); + let art = root.file("art.ico", b"icon"); + for name in ["folder.ico", "joined.ico", "missing.ico"] { + assert!(Pinned::open(&wide(&root.at(name)), &["ico"], fixed).is_none(), "{name}"); + } + if root.file_symlink("linked.ico", &art) { + assert!(Pinned::open(&wide(&root.at("linked.ico")), &["ico"], fixed).is_none(), "a symbolic link"); + } else { + eprintln!("folders_and_links_are_not_pinned: no right to make a symbolic link here, that case is skipped"); + } + } + + /// C: is fixed, every other drive removable. + fn c_fixed(letter: u16) -> DriveKind { + if letter == u16::from(b'C') { + DriveKind::Fixed + } else { + DriveKind::Removable + } + } + + #[test] + fn final_path_rules() { + let ok = |s: &str| final_path_ok(&units(s), &["ico", "exe"], c_fixed); + assert_eq!(ok(r"\\?\C:\made-up\a.ico").map(|p| p.to_string_lossy()), Some(r"C:\made-up\a.ico".to_string())); + assert!(ok(r"\\?\C:\made-up\A.EXE").is_some()); + for bad in [ + r"\\?\E:\made-up\a.ico", + r"\\?\UNC\server-made-up\share\a.ico", + r"\\?\Volume{00000000-0000-0000-0000-000000000000}\a.ico", + r"\\?\GLOBALROOT\Device\made-up\a.ico", + r"\\?\C:\made-up\a.lnk", + r"\\?\C:\made-up\a.ico.", + r"\\?\C:\made-up\a.ico:stream", + r"\\?\C:\made-up\photos.{0AFACED1-E828-11D1-9187-B532F1E9575D}\a.ico", + "", + ] { + assert!(ok(bad).is_none(), "{bad}"); + } + assert!(handle_attrs_ok(0x20) && handle_attrs_ok(0x1) && handle_attrs_ok(0x80)); + for bad in [0x10, 0x420, 0x1020, 0x4_0020, 0x40_0020] { + assert!(!handle_attrs_ok(bad), "{bad:#x}"); + } + } +} diff --git a/apps/files/src/sidebar.rs b/apps/files/src/sidebar.rs index ba6f8401..764e4047 100644 --- a/apps/files/src/sidebar.rs +++ b/apps/files/src/sidebar.rs @@ -10,7 +10,9 @@ use std::os::windows::fs::MetadataExt; use crate::drives::{DriveInfo, DriveKind}; use crate::format::Fmt; use crate::handoff::{self, Target}; +use crate::icons::{self, ArtBook}; use crate::keys::Cmd; +use crate::knownfolders::{KnownFolders, KnownName}; use crate::listing::natural::natural_cmp; use crate::listing::{CancelToken, WidePath}; use crate::msg::JobDone; @@ -19,9 +21,12 @@ use crate::status::{self, Notice}; use crate::tr::{k, t, tf}; use crate::window::{self, FilesScreen, Shared}; use oled_trust::frame::files::Location; -use oled_ui::model::FgRole; +use oled_ui::art::Art; use oled_ui::node::Text; -use oled_ui::widgets::{SidebarItem, SidebarList, SidebarOut, SidebarStyle, SplitOut, SplitView}; +use oled_ui::widgets::sidebar::{ + DriveLine, NavAction, NavEntry, NavLook, NavOut, DRIVE_H, ENTRIES_STYLE, ENTRY_H, SECTION_H, +}; +use oled_ui::widgets::{SidebarItem, SidebarList, SidebarOut, SplitOut, SplitView}; use oled_ui::{ Anchor, CommandId, Event, EventCx, Glyph, Key, LayoutCx, MenuItem, MouseButton, PaintCx, PointP, RectP, Reply, WheelDelta, Widget, WidgetId, @@ -31,7 +36,7 @@ use windows::Win32::System::Diagnostics::Debug::{SetThreadErrorMode, SEM_FAILCRI /// The SplitView's range and default, logical px. pub const WIDTH_MIN: i32 = 160; pub const WIDTH_MAX: i32 = 400; -pub const WIDTH_DEFAULT: i32 = 200; +pub const WIDTH_DEFAULT: i32 = 224; /// Below this window width (logical px) the sidebar folds away. pub const FOLD_BELOW: i32 = 760; /// A tree level lists at most this many folders. @@ -45,8 +50,10 @@ const WHEEL_ROWS: f32 = 3.0; const ID_LIST: WidgetId = WidgetId(60); const ID_SPLIT: WidgetId = WidgetId(61); -const ROW_H: i32 = 28; -const INSET: i32 = 8; +/// An entry's height (the kit's), logical px. +const ROW_H: i32 = ENTRY_H; +/// The list's padding above and below the entries. +const PAD_Y: i32 = 6; /// The ids of the sidebar's own menu (picked through menu::on_pick, which hands them to on_pick below). const CMD_OPEN: u32 = 0x5001; @@ -59,6 +66,10 @@ const CMD_REIMPORT: u32 = 0x5005; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum RowKind { Section, + /// "Home". + Home, + /// A known folder of the current user (a fixed entry of Quick access). + Known, Pin, Drive(u8), /// A UNC root of the recent places. @@ -79,6 +90,23 @@ pub struct Row { pub depth: u16, pub path: Option, pub disabled: bool, + /// The entry's height, logical px (a section label, a drive with its capacity bar, an entry). + pub h: i32, +} + +/// What the list shows of an entry: its key, whether it is a section label, and whether it draws art or a glyph. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct Shown { + pub key: u64, + pub section: bool, + pub art: bool, + pub glyph: bool, +} + +impl Shown { + fn of(it: &SidebarItem) -> Shown { + Shown { key: it.key, section: it.section, art: it.icon.is_some(), glyph: it.glyph.is_some() } + } } /// Everything build() reads. @@ -95,11 +123,16 @@ pub struct Inputs<'a> { pub children: &'a HashMap>>, /// The row whose folders are being listed. pub busy: Option, + /// The window's art, and the known folders whose art a folder draws (by path). + pub art: &'a ArtBook, + pub known: &'a KnownFolders, } pub struct Built { pub items: Vec, pub rows: Vec, + /// What the kit's entries have beyond an item: the pin, the drive's capacity line, the hand-off arrow. + pub entries: Vec<(u64, NavEntry)>, } /// A stable key: FNV-1a of the parent, the kind and the lower-cased text. @@ -136,6 +169,12 @@ pub fn low_space(d: &DriveInfo) -> bool { matches!((d.free, d.total), (Some(f), Some(t)) if t > 0 && f.saturating_mul(10) < t) } +/// How full a drive is, 0.0 to 1.0; None when its size is not known. +pub fn used_fraction(d: &DriveInfo) -> Option { + let (free, total) = (d.free?, d.total.filter(|t| *t > 0)?); + Some((total.saturating_sub(free) as f64 / total as f64) as f32) +} + fn item(key: u64, label: String, glyph: Option, depth: u16) -> SidebarItem { SidebarItem { key, @@ -152,52 +191,124 @@ fn item(key: u64, label: String, glyph: Option, depth: u16) -> SidebarIte } } +/// The item drawing `art` (from the window's book, at the entries' size) instead of a glyph. +fn with_art(mut it: SidebarItem, inp: &Inputs, art: Art) -> SidebarItem { + it.glyph = None; + it.icon = Some(inp.art.shared(art, inp.art.key().small)); + it +} + +/// The art of a folder entry at `p`: a drive root by its kind, a known folder by its path, else the folder. +fn folder_art(inp: &Inputs, p: &WidePath) -> Art { + icons::place_art(p, inp.known, inp.drives) +} + fn section(tag: &str, label: Text) -> (SidebarItem, Row) { let key = key_of(0, "sec", tag); let mut it = item(key, label.into_owned(), None, 0); it.section = true; - (it, Row { key, kind: RowKind::Section, depth: 0, path: None, disabled: false }) + (it, Row { key, kind: RowKind::Section, depth: 0, path: None, disabled: false, h: SECTION_H }) } -/// The rows of the sidebar: sections, pins, drives, network places, the two hand-offs and the open tree levels. Pure. +/// The fixed entries of Quick access, in their order. +const KNOWN_FIXED: [KnownName; 6] = [ + KnownName::Desktop, + KnownName::Downloads, + KnownName::Documents, + KnownName::Pictures, + KnownName::Music, + KnownName::Videos, +]; + +/// The label of a known folder's entry. +fn known_label(n: KnownName) -> oled_sys::i18n::S { + match n { + KnownName::Desktop => k::FILES_SIDE_KNOWN_DESKTOP, + KnownName::Downloads => k::FILES_SIDE_KNOWN_DOWNLOADS, + KnownName::Documents => k::FILES_SIDE_KNOWN_DOCUMENTS, + KnownName::Pictures => k::FILES_SIDE_KNOWN_PICTURES, + KnownName::Music => k::FILES_SIDE_KNOWN_MUSIC, + KnownName::Videos | KnownName::Profile => k::FILES_SIDE_KNOWN_VIDEOS, + } +} + +/// The known folders of Quick access that are there: found by path, never by name, and left out when a check found +/// the folder missing. +pub fn known_shown<'a>(known: &'a KnownFolders, missing: &HashSet) -> Vec<(KnownName, &'a WidePath)> { + KNOWN_FIXED + .iter() + .filter_map(|n| known.list().iter().find(|(k, _)| k == n).map(|(k, p)| (*k, p))) + .filter(|(_, p)| !missing.contains(&pins::same_key(&p.to_string_lossy()))) + .collect() +} + +/// A row of an entry's own height. +fn plain_row(key: u64, kind: RowKind, depth: u16, path: Option, disabled: bool) -> Row { + Row { key, kind, depth, path, disabled, h: ROW_H } +} + +/// The rows of the sidebar: Home, Quick access (the known folders, then the pinned ones), This PC with its drives, the +/// network places and the two hand-offs, then the open tree levels. Pure. pub fn build(inp: &Inputs) -> Built { - let mut out = Built { items: Vec::new(), rows: Vec::new() }; + let mut out = Built { items: Vec::new(), rows: Vec::new(), entries: Vec::new() }; let push = |o: &mut Built, (i, r): (SidebarItem, Row)| { o.items.push(i); o.rows.push(r); }; - if !inp.pins.is_empty() { + let home = key_of(0, "home", ""); + let it = with_art(item(home, t(k::FILES_SIDE_HOME, inp.lang).into_owned(), None, 0), inp, Art::Home); + push(&mut out, (it, plain_row(home, RowKind::Home, 0, None, false))); + let known = known_shown(inp.known, inp.missing); + // A pin that is one of the fixed folders is not listed twice. + let pinned: Vec<&WidePath> = + inp.pins.iter().filter(|p| !matches!(inp.known.name_of(p), Some(n) if KNOWN_FIXED.contains(&n))).collect(); + if !known.is_empty() || !pinned.is_empty() { push(&mut out, section("pinned", t(k::FILES_SIDE_PINNED, inp.lang))); - for p in inp.pins { - let key = key_of(0, "pin", &p.to_string_lossy()); - let gone = inp.missing.contains(&pins::same_key(&p.to_string_lossy())); - let mut it = item(key, place_name(p), Some(Glyph::Folder), 0); - (it.disabled, it.expandable) = (gone, !gone); - tree_state(&mut it, inp, key); - push(&mut out, (it, Row { key, kind: RowKind::Pin, depth: 0, path: Some(p.clone()), disabled: gone })); - if !gone { - children(&mut out, inp, key, p, 1); - } + } + for (n, p) in known { + let key = key_of(0, "known", n.key()); + let mut it = with_art(item(key, t(known_label(n), inp.lang).into_owned(), None, 0), inp, folder_art(inp, p)); + it.expandable = true; + tree_state(&mut it, inp, key); + push(&mut out, (it, plain_row(key, RowKind::Known, 0, Some(p.clone()), false))); + children(&mut out, inp, key, p, 1); + } + for p in pinned { + let key = key_of(0, "pin", &p.to_string_lossy()); + let gone = inp.missing.contains(&pins::same_key(&p.to_string_lossy())); + let mut it = with_art(item(key, place_name(p), None, 0), inp, folder_art(inp, p)); + (it.disabled, it.expandable) = (gone, !gone); + tree_state(&mut it, inp, key); + push(&mut out, (it, plain_row(key, RowKind::Pin, 0, Some(p.clone()), gone))); + if !gone { + let tip = t(k::FILES_SIDE_UNPIN_TIP, inp.lang); + out.entries.push((key, NavEntry { action: Some((NavAction::Pin, tip)), ..NavEntry::default() })); + children(&mut out, inp, key, p, 1); } } push(&mut out, section("this_pc", t(k::FILES_SIDE_THIS_PC, inp.lang))); let drive_rows = |o: &mut Built, d: &DriveInfo| { let key = key_of(0, "drive", &(d.letter as char).to_string()); - let mut it = item( - key, - drive_title(d, inp.lang), - Some(if d.kind == DriveKind::Network { Glyph::Network } else { Glyph::Disk }), - 0, - ); + let art = icons::drive_art(d.kind, d.letter, inp.known.system_drive()); + let mut it = with_art(item(key, drive_title(d, inp.lang), None, 0), inp, art); it.disabled = !d.ready; it.expandable = d.ready; - if let (Some(free), true) = (d.free, d.kind != DriveKind::Network && d.ready) { - let role = if low_space(d) { FgRole::Attention } else { FgRole::Tertiary }; - it.trailing = Some((Text::Owned(inp.fmt.size(free, inp.like_explorer)), role)); + let local = d.kind != DriveKind::Network; + let mut h = ROW_H; + if !d.ready { + let note = t(k::FILES_SIDE_NOT_READY, inp.lang); + let drive = local.then_some(DriveLine { free: Text::Borrowed(""), used: 0.0 }); + h = if local { DRIVE_H } else { ROW_H }; + o.entries.push((key, NavEntry { drive, not_ready: Some(note), ..NavEntry::default() })); + } else if let (true, Some(used), Some(free)) = (local, used_fraction(d), d.free) { + let text = tf(k::FILES_STATUS_FREE, inp.lang, &[("size", &inp.fmt.size(free, inp.like_explorer))]); + let drive = Some(DriveLine { free: Text::Owned(text.into_owned()), used }); + h = DRIVE_H; + o.entries.push((key, NavEntry { drive, ..NavEntry::default() })); } tree_state(&mut it, inp, key); let path = drive_root(d.letter); - let row = Row { key, kind: RowKind::Drive(d.letter), depth: 0, path: path.clone(), disabled: !d.ready }; + let row = Row { key, kind: RowKind::Drive(d.letter), depth: 0, path: path.clone(), disabled: !d.ready, h }; o.items.push(it); o.rows.push(row); if let (true, Some(p)) = (d.ready, path) { @@ -213,18 +324,27 @@ pub fn build(inp: &Inputs) -> Built { } for p in inp.network { let key = key_of(0, "net", &p.to_string_lossy()); - let mut it = item(key, p.to_string_lossy(), Some(Glyph::Network), 0); + let mut it = with_art(item(key, p.to_string_lossy(), None, 0), inp, Art::DriveNetwork); it.expandable = true; tree_state(&mut it, inp, key); - push(&mut out, (it, Row { key, kind: RowKind::Net, depth: 0, path: Some(p.clone()), disabled: false })); + push(&mut out, (it, plain_row(key, RowKind::Net, 0, Some(p.clone()), false))); children(&mut out, inp, key, p, 1); } - let hand = |tag: &str, label: Text, glyph: Glyph, kind: RowKind| { + let hand = |o: &mut Built, tag: &str, label: Text, kind: RowKind| { let key = key_of(0, tag, ""); - (item(key, label.into_owned(), Some(glyph), 0), Row { key, kind, depth: 0, path: None, disabled: false }) + let it = item(key, label.into_owned(), None, 0); + // "Network" hands off to File Explorer: a line glyph; the Recycle Bin draws its art. Both end in the arrow. + let it = match kind { + RowKind::Recycle => with_art(it, inp, Art::RecycleBin), + _ => SidebarItem { glyph: Some(Glyph::LineGlobe), ..it }, + }; + let tip = t(k::FILES_SIDE_HANDOFF_TIP, inp.lang); + o.entries.push((key, NavEntry { action: Some((NavAction::External, tip)), ..NavEntry::default() })); + o.items.push(it); + o.rows.push(plain_row(key, kind, 0, None, false)); }; - push(&mut out, hand("nethand", t(k::FILES_SIDE_NETWORK_ARROW, inp.lang), Glyph::Globe, RowKind::NetHand)); - push(&mut out, hand("recycle", t(k::FILES_SIDE_RECYCLE_BIN, inp.lang), Glyph::Delete, RowKind::Recycle)); + hand(&mut out, "nethand", t(k::FILES_SIDE_NETWORK_HAND, inp.lang), RowKind::NetHand); + hand(&mut out, "recycle", t(k::FILES_SIDE_RECYCLE_HAND, inp.lang), RowKind::Recycle); out } @@ -242,11 +362,11 @@ fn children(out: &mut Built, inp: &Inputs, parent: u64, path: &WidePath, depth: for n in names { let Ok(p) = path.join(&n.encode_utf16().collect::>()) else { continue }; let key = key_of(parent, "dir", n); - let mut it = item(key, n.to_string(), Some(Glyph::Folder), depth); + let mut it = with_art(item(key, n.to_string(), None, depth), inp, folder_art(inp, &p)); it.expandable = true; tree_state(&mut it, inp, key); out.items.push(it); - out.rows.push(Row { key, kind: RowKind::Dir, depth, path: Some(p.clone()), disabled: false }); + out.rows.push(plain_row(key, RowKind::Dir, depth, Some(p.clone()), false)); children(out, inp, key, &p, depth + 1); } } @@ -264,20 +384,39 @@ pub fn focus(s: &mut FilesScreen, cx: &mut EventCx) { } } -/// The key of the deepest row whose folder holds the location. +/// The key of the entry whose folder is the open one (the same path, compared without case), or Home's on the Home +/// page. A folder with no entry of its own has no current entry. pub fn current_key(rows: &[Row], at: &Location) -> Option { - let Location::Fs(p) = at else { return None }; - let loc = pins::same_key(&p.to_string_lossy()); - let mut best: Option<(usize, u64)> = None; - for r in rows { - let Some(rp) = &r.path else { continue }; - let key = pins::same_key(&rp.to_string_lossy()); - let prefix = if key.ends_with('\\') { key.clone() } else { format!("{key}\\") }; - if (loc == key || loc.starts_with(&prefix)) && best.is_none_or(|(n, _)| key.len() > n) { - best = Some((key.len(), r.key)); + match at { + Location::Home => rows.iter().find(|r| r.kind == RowKind::Home).map(|r| r.key), + Location::Fs(p) => { + let loc = pins::same_key(&p.to_string_lossy()); + rows.iter() + .find(|r| r.path.as_ref().is_some_and(|rp| pins::same_key(&rp.to_string_lossy()) == loc)) + .map(|r| r.key) } + _ => None, + } +} + +/// How many entries from `first` fit in `avail` physical px, at least one. +fn fit_from(heights: &[i32], first: usize, avail: i32) -> usize { + let mut used = 0; + let n = heights.iter().skip(first).take_while(|h| { + used += **h; + used <= avail + }); + n.count().max(1) +} + +/// The first entry from which everything after it fits in `avail` physical px. +fn last_first(heights: &[i32], avail: i32) -> usize { + let (mut first, mut used) = (heights.len(), 0); + while first > 0 && used + heights[first - 1] <= avail { + first -= 1; + used += heights[first]; } - best.map(|(_, k)| k) + first.min(heights.len().saturating_sub(1)) } /// The tree level's request in flight. @@ -316,6 +455,8 @@ pub struct Sidebar { /// The drive letters present and the pins (same keys) at the last bump: a missing pin is asked again only when /// either changed. seen: Option<(u32, Vec)>, + /// The entries the list shows, as the last layout gave them (tests read their icons). + shown_items: Vec, } impl std::fmt::Debug for Sidebar { @@ -331,7 +472,7 @@ impl Default for Sidebar { } fn new_list() -> SidebarList { - SidebarList::new(ID_LIST, SidebarStyle { row_h: ROW_H, inset: INSET }) + SidebarList::new(ID_LIST, ENTRIES_STYLE).with_look(NavLook::Entries) } impl Sidebar { @@ -355,6 +496,7 @@ impl Sidebar { walk: None, scrolled_to: None, seen: None, + shown_items: Vec::new(), } } @@ -369,6 +511,11 @@ impl Sidebar { self.children.insert(key, names.iter().map(|n| Box::from(*n)).collect()); } + /// The entries shown, as the last layout gave them to the list. + pub fn shown_items(&self) -> &[Shown] { + &self.shown_items + } + /// The rows as the last layout built them. pub fn rows(&self) -> &[Row] { &self.rows @@ -379,6 +526,16 @@ impl Sidebar { self.shown } + /// An entry's plate as the last layout placed it (physical px); None when it is scrolled out. + pub fn entry_rect(&self, key: u64) -> Option { + self.list.entry_rect(key) + } + + /// The hit target of an entry's trailing pin (physical px), when it has one. + pub fn pin_rect(&self, key: u64) -> Option { + self.list.action_rect(key) + } + /// The sidebar's rect, physical px (empty when folded). pub fn pane(&self) -> RectP { self.pane @@ -439,6 +596,7 @@ fn inputs_run(s: &FilesScreen, f: impl FnOnce(&Inputs) -> R) -> R { let (pins, network) = (pins::paths(shared), network_places(shared)); let drives = shared.drives.borrow(); let missing: HashSet = s.side.checked.iter().filter(|(_, ok)| !**ok).map(|(k, _)| k.clone()).collect(); + let known = shared.known.borrow(); let inp = Inputs { lang: shared.lang.get(), fmt: &fmt, @@ -450,6 +608,8 @@ fn inputs_run(s: &FilesScreen, f: impl FnOnce(&Inputs) -> R) -> R { expanded: &s.side.expanded, children: &s.side.children, busy: s.side.job.as_ref().map(|j| j.key), + art: &s.art, + known: &known, }; f(&inp) } @@ -460,10 +620,12 @@ fn next_req(shared: &Shared) -> u64 { r } -/// Asks whether each pinned folder exists (a Bg job on its lane; the answer is a Children with one name when it does). +/// Asks whether each pinned folder and each known folder exists (a Bg job on its lane; the answer is a Children with one name when it does). fn check_pins(s: &mut FilesScreen) { let shared = std::rc::Rc::clone(&s.shared); - for p in pins::paths(&shared) { + let mut want = pins::paths(&shared); + want.extend(shared.known.borrow().list().iter().filter(|(n, _)| KNOWN_FIXED.contains(n)).map(|(_, p)| p.clone())); + for p in want { let key = pins::same_key(&p.to_string_lossy()); if s.side.checked.contains_key(&key) || s.side.checks.values().any(|v| *v == key) { continue; @@ -674,26 +836,36 @@ pub fn layout(s: &mut FilesScreen, cx: &mut LayoutCx, r: RectP) -> RectP { let built = inputs_run(s, build); let loc = s.tabs.active().nav.location().clone(); let current = current_key(&built.rows, &loc); - let rh = cx.px(ROW_H).max(1); - let fit = ((pane.h() / rh).max(1)) as usize; + let pad = cx.px(PAD_Y); + let avail = (pane.h() - 2 * pad).max(0); + let heights: Vec = built.rows.iter().map(|r| cx.px(r.h)).collect(); let sb = &mut s.side; - sb.fit = fit; - sb.first = sb.first.min(built.rows.len().saturating_sub(fit)); + let max_first = last_first(&heights, avail); + sb.first = sb.first.min(max_first); if sb.scrolled_to != current { sb.scrolled_to = current; if let Some(i) = built.rows.iter().position(|r| Some(r.key) == current) { + let fit = fit_from(&heights, sb.first, avail); if i < sb.first || i >= sb.first + fit { - sb.first = i.saturating_sub(fit / 2).min(built.rows.len().saturating_sub(fit)); + sb.first = i.saturating_sub(fit / 2).min(max_first); } } } + let fit = fit_from(&heights, sb.first, avail); + sb.fit = fit; let end = (sb.first + fit).min(built.rows.len()); let shown: Vec = built.items.into_iter().skip(sb.first).take(end - sb.first).collect(); sb.rows = built.rows; + sb.shown_items = shown.iter().map(Shown::of).collect(); sb.list = new_list().with_items(shown); + for (key, entry) in built.entries { + if sb.shown_items.iter().any(|x| x.key == key) { + sb.list.set_entry(key, entry); + } + } sb.list.set_current(current); sb.pane = pane; - sb.list.layout(cx, pane); + sb.list.layout(cx, RectP { t: pane.t + pad, b: pane.b - pad, ..pane }); sb.split.layout(cx, r); body } @@ -729,18 +901,25 @@ pub fn event(s: &mut FilesScreen, cx: &mut EventCx, ev: &Event) -> Option if let Some(r) = scroll_keys(s, cx, ev) { return Some(r); } - if let Some(out) = s.side.list.event(cx, ev) { + if let Some(out) = s.side.list.event_nav(cx, ev) { let key_at = |s: &FilesScreen, k: u64| s.side.row(k).map(|(_, r)| r.clone()); return Some(match out { - SidebarOut::Activated(k) => match key_at(s, k) { + NavOut::Entry(SidebarOut::Activated(k)) => match key_at(s, k) { Some(r) => activate(s, cx, &r), None => Reply::None, }, - SidebarOut::Expand(k, on) => { + NavOut::Entry(SidebarOut::Expand(k, on)) => { expand(s, cx, k, on); Reply::Relayout } - SidebarOut::ContextMenu(k, at) => open_menu(s, cx, Some(k), at), + NavOut::Entry(SidebarOut::ContextMenu(k, at)) => open_menu(s, cx, Some(k), at), + NavOut::Action(k) => match key_at(s, k) { + Some(Row { kind: RowKind::Pin, path: Some(p), .. }) => { + pins::remove(&s.shared, &p); + Reply::Relayout + } + _ => Reply::None, + }, }); } match ev { @@ -753,9 +932,12 @@ pub fn event(s: &mut FilesScreen, cx: &mut EventCx, ev: &Event) -> Option } Event::Click { pos, button: MouseButton::Right, .. } if s.side.pane.contains(*pos) => { // The click landed where the list takes none: a missing folder's row, a section header or the empty rest. - let rh = cx.px(ROW_H).max(1); - let i = s.side.first + ((pos.y - s.side.pane.t) / rh).max(0) as usize; - let key = s.side.rows.get(i).filter(|r| r.kind == RowKind::Pin).map(|r| r.key); + let at = s + .side + .shown_items + .iter() + .find(|x| s.side.list.entry_rect(x.key).is_some_and(|r| (r.t..r.b).contains(&pos.y))); + let key = at.and_then(|x| s.side.row(x.key)).filter(|(_, r)| r.kind == RowKind::Pin).map(|(_, r)| r.key); Some(open_menu(s, cx, key, *pos)) } _ => None, @@ -804,6 +986,10 @@ fn activate(s: &mut FilesScreen, cx: &mut EventCx, r: &Row) -> Reply { match r.kind { RowKind::Recycle => handoff::hand_off(s, cx, Target::RecycleBin, false), RowKind::NetHand => handoff::hand_off(s, cx, Target::Network, false), + RowKind::Home => { + window::navigate(s, cx, Location::Home, None); + Reply::Redraw + } RowKind::Section => Reply::None, _ => match &r.path { Some(p) if !r.disabled => { @@ -848,6 +1034,9 @@ fn open_menu(s: &mut FilesScreen, cx: &mut EventCx, key: Option, at: PointP let note = (!on).then(|| t(k::FILES_MENU_NOT_IN_BETA, lang)); items.push(custom(CMD_REIMPORT, t(k::FILES_SIDE_REIMPORT, lang), on, note)); } + if items.is_empty() { + return Reply::None; + } cx.open_menu(items, Anchor::Point(at)); Reply::Redraw } diff --git a/apps/files/src/status.rs b/apps/files/src/status.rs index 40571742..f3ebd72a 100644 --- a/apps/files/src/status.rs +++ b/apps/files/src/status.rs @@ -2,20 +2,27 @@ //! group shows through notice(). use oled_trust::frame::files::{Location, OpId}; +use std::cell::Cell; +use std::rc::Rc; + +use oled_ui::gfx::image::IconBitmap; use oled_ui::model::{FgRole, ListModel}; use oled_ui::node::Text; use oled_ui::theme::TypeRole; +use oled_ui::widgets::progress::paint_capacity; use oled_ui::widgets::{Button, ButtonKind, ButtonOut, TextLabel}; -use oled_ui::{Event, EventCx, LayoutCx, PaintCx, RectP, Reply, UiLang, Widget, WidgetId}; +use oled_ui::{Event, EventCx, Ink, LayoutCx, PaintCx, PointP, RectP, Reply, UiLang, Widget, WidgetId}; +use crate::drives::DriveInfo; +use crate::icons; use crate::keys::Cmd; -use crate::listing::{TabId, WidePath}; +use crate::listing::{FamilySet, TabId, WidePath}; use crate::model::id_of; use crate::names; use crate::nav::Page; use crate::tr::{k, t, tf}; use crate::window::{self, FilesScreen}; -use crate::{handoff, notices, open, ops_ui}; +use crate::{handoff, notices, open, ops_ui, toolmenus}; const ID_ITEMS: WidgetId = WidgetId(30); const ID_SELECTED: WidgetId = WidgetId(31); @@ -23,11 +30,24 @@ const ID_FREE: WidgetId = WidgetId(32); const ID_NOTICE: WidgetId = WidgetId(33); /// The notice's action button. pub const ID_ACTION: WidgetId = WidgetId(34); +const ID_DRIVE: WidgetId = WidgetId(35); /// Logical px. -const INSET: i32 = 12; +const INSET: i32 = 16; const GAP: i32 = 8; const ACTION_H: i32 = 24; +/// The separator between the count and the selection: 1 x 14, 12 on each side, white at alpha 38. +const SEP_W: i32 = 1; +const SEP_H: i32 = 14; +const SEP_GAP: i32 = 12; +const SEP_ALPHA: u32 = 38; +/// The open folder's drive at the right: its art, its name, a bar of this width and the free space. +const DRIVE_ART: i32 = 16; +const DRIVE_BAR_W: i32 = 48; +/// Above this share used the bar and the free space ask for attention. +const FULL: f32 = 0.9; +/// The most of a notice the left side keeps when the right block is made to fit. +const NOTICE_MIN: i32 = 160; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum NoticeAct { @@ -64,12 +84,19 @@ impl Notice { #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub struct Stats { pub items: u32, + /// With a search or families on: the items of the folder before they narrow it. + pub total: u32, + pub filtered: bool, + pub families: FamilySet, pub selected: usize, pub bytes: u64, /// At least one selected row is not a folder: only then is a size shown. pub files: bool, } +/// What a count of the folder's items is made for: the tab, the listing's size and the search's serial. +type TotalKey = (TabId, u32, u64); + /// The counts, the free space, the notice slot and the labels the last layout built from them. pub struct Status { stats: Stats, @@ -86,6 +113,66 @@ pub struct Status { free_label: TextLabel, text: TextLabel, action: Option<(Button, NoticeAct)>, + /// The separator between the count and the selection, as the last layout placed it. + sep: RectP, + /// The drive block of the last layout: art, name, bar and its share used. + drive: Option, + placed: Placed, + /// Whether the last layout had room for the separator and the selection text. + sel_shown: bool, + /// The folder's items before the search narrows them, by what they were counted for: the tab, the listing's + /// size and the search's serial. + total_for: Cell>, +} + +/// Where the last layout put the parts of the line (tests read it); an empty rect is a part that is not shown. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct Placed { + pub items: RectP, + pub selection: RectP, + /// The drive's art, name and bar together. + pub drive: RectP, + pub free: RectP, +} + +/// The open folder's drive at the right end of the line. +struct DriveBlock { + art: Rc, + art_r: RectP, + name: TextLabel, + bar: RectP, + used: f32, +} + +/// What the drive block shows of a drive and its free bytes (tests read it). +#[derive(Clone, Debug, PartialEq)] +pub struct DriveShown { + pub name: String, + pub free_text: String, + pub used: f32, + /// Over 90 % used: the bar and the free text are in the attention colour. + pub attention: bool, +} + +/// The share of a drive used above which the line asks for attention. +pub fn attention(used: f32) -> bool { + used > FULL +} + +/// The drive block's words and share for `d` with `free` bytes free (the volume's own answer when it is newer than +/// the drive cache's). None when the drive's size is not known. +pub fn drive_shown(d: &DriveInfo, free: Option, fmt: &crate::format::Fmt, lang: UiLang) -> Option { + let total = d.total.filter(|t| *t > 0)?; + let free = free.or(d.free)?; + let used = (total.saturating_sub(free) as f64 / total as f64) as f32; + let free_text = + tf(k::FILES_STATUS_FREE_OF, lang, &[("free", &fmt.size(free, false)), ("total", &fmt.size(total, false))]); + Some(DriveShown { + name: crate::sidebar::drive_title(d, lang), + free_text: free_text.into_owned(), + used, + attention: attention(used), + }) } impl std::fmt::Debug for Status { @@ -109,14 +196,24 @@ impl Status { notice: None, serial: 0, laid_free: false, - items: TextLabel::new(ID_ITEMS, e(), TypeRole::Caption, FgRole::Tertiary), - selected: TextLabel::new(ID_SELECTED, e(), TypeRole::Caption, FgRole::Secondary), - free_label: TextLabel::new(ID_FREE, e(), TypeRole::Caption, FgRole::Tertiary), + items: TextLabel::new(ID_ITEMS, e(), TypeRole::Caption, FgRole::Secondary), + selected: TextLabel::new(ID_SELECTED, e(), TypeRole::Caption, FgRole::Primary), + free_label: TextLabel::new(ID_FREE, e(), TypeRole::Caption, FgRole::Secondary), text: TextLabel::new(ID_NOTICE, e(), TypeRole::Caption, FgRole::Primary), action: None, + sep: RectP::EMPTY, + drive: None, + placed: Placed::default(), + sel_shown: false, + total_for: Cell::new(None), } } + /// Where the last layout put the parts of the line. + pub fn placed(&self) -> Placed { + self.placed + } + /// The counts as of the last refresh. pub fn stats(&self) -> Stats { self.stats @@ -139,6 +236,21 @@ fn count(s: &FilesScreen, with_selection: bool, before: Stats) -> Stats { let m = t.table.model(); let rows = ListModel::len(m); let mut st = Stats { items: rows as u32, ..before }; + st.filtered = t.search.is_on(); + st.families = t.search.applied.families; + st.total = if st.filtered { + let key = (t.id, m.listing().len(), t.search.serial); + match s.status.total_for.get() { + Some((k, n)) if k == key => n, + _ => { + let n = m.listing().unfiltered_len(); + s.status.total_for.set(Some((key, n))); + n + } + } + } else { + rows as u32 + }; if with_selection { let sel = t.table.selection(); st.selected = sel.count(rows); @@ -176,28 +288,40 @@ pub fn on_free_space(s: &mut FilesScreen, cx: &mut EventCx, root: WidePath, free } /// "1 item" / "1,204 items". -fn items_text(s: &FilesScreen, n: u32, lang: UiLang) -> Text { - if n == 1 { +fn items_text(s: &FilesScreen, st: Stats, lang: UiLang) -> Text { + let fmt = s.shared.fmt.borrow().clone(); + if st.filtered { + let (n, total) = (fmt.count(u64::from(st.items)), fmt.count(u64::from(st.total))); + let one = st.total == 1; + if st.families.is_empty() { + let key = if one { k::FILES_STATUS_OF_ONE } else { k::FILES_STATUS_OF }; + return tf(key, lang, &[("n", &n), ("total", &total)]); + } + let names: Vec = + st.families.members().into_iter().map(|f| toolmenus::family_name(f, lang).to_string()).collect(); + let key = if one { k::FILES_STATUS_FILTERED_ONE } else { k::FILES_STATUS_FILTERED }; + return tf(key, lang, &[("families", &names.join(", ")), ("n", &n), ("total", &total)]); + } + if st.items == 1 { return t(k::FILES_STATUS_ITEMS_ONE, lang); } - let fmt = s.shared.fmt.borrow().clone(); - tf(k::FILES_STATUS_ITEMS_OTHER, lang, &[("n", &fmt.count(u64::from(n)))]) + tf(k::FILES_STATUS_ITEMS_OTHER, lang, &[("n", &fmt.count(u64::from(st.items)))]) } -/// " . 3 selected . 4.2 MB", or nothing when nothing is selected. +/// "3 selected, 4.2 MB", or nothing when nothing is selected. fn selected_text(s: &FilesScreen, st: Stats, lang: UiLang) -> String { if st.selected == 0 { return String::new(); } let fmt = s.shared.fmt.borrow().clone(); - let mut out = String::from(" \u{b7} "); + let mut out = String::new(); if st.selected == 1 { out.push_str(&t(k::FILES_STATUS_SELECTED_ONE, lang)); } else { out.push_str(&tf(k::FILES_STATUS_SELECTED_OTHER, lang, &[("n", &fmt.count(st.selected as u64))])); } if st.files { - out.push_str(" \u{b7} "); + out.push_str(", "); out.push_str(&fmt.size(st.bytes, false)); } out @@ -209,71 +333,157 @@ pub fn layout(s: &mut FilesScreen, cx: &mut LayoutCx, r: RectP) { let lang = s.shared.lang.get(); let st = s.status.stats; let home = matches!(s.tabs.active().nav.page(), Page::Home); - let items = items_text(s, st.items, lang); + let items = items_text(s, st, lang); let selected = selected_text(s, st, lang); - // Only the free space of the folder the tab shows: the old volume's number goes at once on a navigation. + // Only the drive of the folder the tab shows: the old volume's numbers go at once on a navigation. let at = match s.tabs.active().nav.location() { - Location::Fs(p) => Some(p), + Location::Fs(p) => Some(p.clone()), _ => None, }; - let free = match (&s.status.free, home) { - (Some((root, f)), false) if at == Some(root) => { - let fmt = s.shared.fmt.borrow().clone(); - Some(tf(k::FILES_STATUS_FREE, lang, &[("size", &fmt.size(*f, false))])) + let fmt = s.shared.fmt.borrow().clone(); + let fresh = match (&s.status.free, home) { + (Some((root, f)), false) if at.as_ref() == Some(root) => Some(*f), + _ => None, + }; + let drive = if home { None } else { at.as_ref().and_then(|p| open_drive(s, p)) }; + let shown = drive.as_ref().and_then(|d| drive_shown(d, fresh, &fmt, lang).map(|sh| (d, sh))); + let free: Option<(Text, FgRole)> = match (&shown, fresh) { + (Some((_, sh)), _) => { + let role = if sh.attention { FgRole::Attention } else { FgRole::Secondary }; + Some((Text::Owned(sh.free_text.clone()), role)) } + (None, Some(f)) => Some((tf(k::FILES_STATUS_FREE, lang, &[("size", &fmt.size(f, false))]), FgRole::Secondary)), _ => None, }; + let block = shown.map(|(d, sh)| { + let art = icons::drive_art(d.kind, d.letter, s.shared.known.borrow().system_drive()); + (s.art.shared(art, s.art.key().small), sh) + }); let sc = cx.scale(); let line = sc.px(TypeRole::Caption.spec().line); let y = r.t + (r.h() - line) / 2; let (x0, right) = (r.l + sc.px(INSET), r.r - sc.px(INSET)); + let gap = sc.px(GAP); + let sep_gap = sc.px(SEP_GAP); + let chip = s.flyout.chip_back(); let me = &mut s.status; - me.laid_free = free.is_some(); + me.drive = None; + me.placed = Placed::default(); + me.sel_shown = false; + me.items = TextLabel::new(ID_ITEMS, items, TypeRole::Caption, FgRole::Secondary); + let notice = me.notice.clone(); + if let Some(n) = ¬ice { + me.text = TextLabel::new(ID_NOTICE, n.text.clone(), TypeRole::Caption, FgRole::Primary); + } + // The least the left side keeps: the count, or a stretch of the notice. + let left_min = match ¬ice { + Some(_) => me.text.preferred(cx).w.min(sc.px(NOTICE_MIN)), + None => me.items.preferred(cx).w, + }; + // The right side starts after the chip's backdrop, or after what the left side keeps. + let from = match chip { + Some(c) => (c.r + gap).max(x0), + None => x0 + left_min + sep_gap, + }; + let room = (right - from).max(0); + let mut free_label = free.map(|(text, role)| TextLabel::new(ID_FREE, text, TypeRole::Caption, role)); + let free_w = free_label.as_mut().map_or(0, |l| l.preferred(cx).w); + let mut name = block + .as_ref() + .map(|(_, sh)| TextLabel::new(ID_DRIVE, Text::Owned(sh.name.clone()), TypeRole::Caption, FgRole::Secondary)); + let (side, bar_w) = (sc.px(DRIVE_ART), sc.px(DRIVE_BAR_W)); + let name_w = name.as_mut().map_or(0, |l| l.preferred(cx).w); + let block_w = side + gap + name_w + gap + bar_w + gap; + // What does not fit goes whole, before anything collides: the art, the name and the bar first, then the free text. + let show_block = free_label.is_some() && name.is_some() && free_w + block_w <= room; + let show_free = free_label.is_some() && (show_block || free_w <= room); + me.laid_free = show_free; let mut edge = right; - if let Some(text) = free { - me.free_label = TextLabel::new(ID_FREE, text, TypeRole::Caption, FgRole::Tertiary); - let w = me.free_label.preferred(cx).w.min((right - x0).max(0)); - me.free_label.layout(cx, RectP { l: right - w, t: y, r: right, b: y + line }); - edge = right - w - sc.px(GAP); + if let (true, Some(label)) = (show_free, free_label.as_mut()) { + label.layout(cx, RectP { l: right - free_w, t: y, r: right, b: y + line }); + me.placed.free = RectP { l: right - free_w, t: y, r: right, b: y + line }; + edge = right - free_w; + if let (true, Some((art, sh)), Some(mut name)) = (show_block, block, name.take()) { + let bar = RectP::wh(edge - gap - bar_w, r.t + (r.h() - sc.px(4)) / 2, bar_w, sc.px(4)); + name.layout(cx, RectP { l: bar.l - gap - name_w, t: y, r: bar.l - gap, b: y + line }); + let art_r = RectP::wh(bar.l - gap - name_w - gap - side, r.t + (r.h() - side) / 2, side, side); + edge = art_r.l; + me.placed.drive = art_r.union(bar); + me.drive = Some(DriveBlock { art, art_r, name, bar, used: sh.used }); + } + edge -= sep_gap; } - let avail = (edge - x0).max(0); - match me.notice.clone() { + if let Some(l) = free_label { + me.free_label = l; + } + // The left side ends before the right block and before the chip's backdrop. + let limit = chip.map_or(edge, |c| edge.min(c.l - gap)); + let avail = (limit - x0).max(0); + match notice { Some(n) => { - me.text = TextLabel::new(ID_NOTICE, n.text.clone(), TypeRole::Caption, FgRole::Primary); let mut text_w = me.text.preferred(cx).w.min(avail); me.action = n.action.map(|(label, act)| (Button::new(ID_ACTION, label, ButtonKind::Secondary), act)); let mut btn_w = 0; if let Some((b, _)) = me.action.as_mut() { btn_w = b.preferred(cx).w.min(avail / 2); - text_w = text_w.min((avail - btn_w - sc.px(GAP)).max(0)); + text_w = text_w.min((avail - btn_w - gap).max(0)); } me.text.layout(cx, RectP { l: x0, t: y, r: x0 + text_w, b: y + line }); if let Some((b, _)) = me.action.as_mut() { - let (bh, bx) = (sc.px(ACTION_H), x0 + text_w + sc.px(GAP)); + let (bh, bx) = (sc.px(ACTION_H), x0 + text_w + gap); let by = r.t + (r.h() - bh) / 2; b.layout(cx, RectP { l: bx, t: by, r: bx + btn_w, b: by + bh }); } } None => { me.action = None; - me.items = TextLabel::new(ID_ITEMS, items, TypeRole::Caption, FgRole::Tertiary); me.selected = - TextLabel::new(ID_SELECTED, Text::Owned(selected.clone()), TypeRole::Caption, FgRole::Secondary); + TextLabel::new(ID_SELECTED, Text::Owned(selected.clone()), TypeRole::Caption, FgRole::Primary); let iw = me.items.preferred(cx).w.min(avail); - me.items.layout(cx, RectP { l: x0, t: y, r: x0 + iw, b: y + line }); + let items_r = RectP { l: x0, t: y, r: x0 + iw, b: y + line }; + me.items.layout(cx, items_r); + me.placed.items = items_r; + me.sep = RectP::EMPTY; if !selected.is_empty() { - let sw = me.selected.preferred(cx).w.min((avail - iw).max(0)); - me.selected.layout(cx, RectP { l: x0 + iw, t: y, r: x0 + iw + sw, b: y + line }); + let sx = x0 + iw + sep_gap; + let (sw, sh) = (sc.px(SEP_W).max(1), sc.px(SEP_H)); + let sep = RectP::wh(sx, r.t + (r.h() - sh) / 2, sw, sh); + let lx = sep.r + sep_gap; + let w = me.selected.preferred(cx).w; + // The selection yields to the right block and to the chip: whole or not at all. + if lx + w <= limit { + me.sep = sep; + me.sel_shown = true; + me.selected.layout(cx, RectP { l: lx, t: y, r: lx + w, b: y + line }); + me.placed.selection = RectP { l: lx, t: y, r: lx + w, b: y + line }; + } } } } } +/// The drive of a folder on a lettered drive, as the cache knows it. +fn open_drive(s: &FilesScreen, p: &WidePath) -> Option { + let text = p.to_string_lossy(); + let b = text.as_bytes(); + if b.get(1) != Some(&b':') || !b.first()?.is_ascii_alphabetic() { + return None; + } + let letter = b[0].to_ascii_uppercase(); + s.shared.drives.borrow().all().iter().find(|d| d.letter == letter).cloned() +} + pub fn paint(s: &FilesScreen, cx: &mut PaintCx) { let me = &s.status; if me.laid_free { me.free_label.paint(cx); } + if let Some(d) = &me.drive { + cx.image(&d.art, PointP { x: d.art_r.l, y: d.art_r.t }, d.art_r.w(), 255); + d.name.paint(cx); + let c = cx.tokens().color.clone(); + paint_capacity(cx, d.bar, d.used, if attention(d.used) { c.accent_attention } else { c.res_disk }); + } if me.notice.is_some() { me.text.paint(cx); if let Some((b, _)) = &me.action { @@ -282,7 +492,9 @@ pub fn paint(s: &FilesScreen, cx: &mut PaintCx) { return; } me.items.paint(cx); - if me.stats.selected > 0 { + if me.stats.selected > 0 && me.sel_shown { + let c = cx.tokens().color.clone(); + cx.fill(me.sep, 0, Ink { a: SEP_ALPHA, ..c.fg_primary }); me.selected.paint(cx); } } diff --git a/apps/files/src/tab.rs b/apps/files/src/tab.rs index 7a1fa042..bf9ed6f8 100644 --- a/apps/files/src/tab.rs +++ b/apps/files/src/tab.rs @@ -2,20 +2,21 @@ //! watch, sort and kept state. TabIds come only from Shared::new_tab, so they are unique in the process. use oled_trust::frame::files::Location; -use oled_ui::model::{SelectionMode, SortDir, TableStyle}; +use oled_ui::model::{KeySet, ListModel, ScrollTo, Selection, SelectionMode, SortDir, TableStyle}; use oled_ui::node::Text; use oled_ui::widgets::{TabOut, TabSpec, VirtualTable}; use oled_ui::{Anchor, CommandId, EventCx, MenuItem, Reply, Screen, UiLang, WidgetId}; +use crate::icons; use crate::keys::Cmd; -use crate::listing::{Gen, TabId, WidePath}; +use crate::listing::{FamilySet, Gen, NameFamily, TabId, ViewFilter, WidePath}; use crate::model::{ColKind, FilesTable}; use crate::nav::{NavEffect, NavState, Page}; use crate::tr::{k, t, t_any}; use crate::view::columns::default_columns; use crate::watch::WatchId; use crate::window::{self, FilesScreen, Shared}; -use crate::{chrome, live, names}; +use crate::{chrome, live, names, status}; /// The widget id of every tab's table: one table is shown at a time. pub const TABLE_ID: WidgetId = WidgetId(100); @@ -27,6 +28,8 @@ pub struct Tab { pub watch: Option, pub sort: (ColKind, SortDir), pub kept: Option, + /// The search in the open folder and the families of the Filter menu. + pub search: Search, /// F2.2's icon-request counter. pub icon_gen: Gen, /// The Tabs clock when the tab was last the shown one: the least recently active listing is dropped first. @@ -194,6 +197,19 @@ impl Tabs { } } +/// The strip's tabs: Tabs::specs with each tab's art, its folder's (a drive root by its kind, a known folder by its +/// path), from the window's book, on every tab from its creation. +pub fn specs_of(s: &FilesScreen, lang: UiLang) -> Vec { + let known = s.shared.known.borrow(); + let drives = s.shared.drives.borrow(); + let px = s.art.key().small; + let mut specs = s.tabs.specs(lang); + for (spec, t) in specs.iter_mut().zip(s.tabs.iter()) { + spec.icon = Some(s.art.shared(icons::location_art(t.nav.location(), &known, drives.all()), px)); + } + specs +} + /// A new tab of window `win` at `at`: a fresh TabId, routed to `win` before its first enumeration. pub fn new_tab(shared: &Shared, win: u32, at: Location) -> Tab { let id = shared.new_tab(); @@ -211,9 +227,150 @@ pub fn tab_with_id(shared: &Shared, win: u32, at: Location, id: TabId) -> Tab { let columns = crate::view::details::columns_with_sort(&default_columns(lang), sort.0, sort.1); let mut table = FilesTable::new(listing, fmt, shared.types.clone(), opts, shared.services.clock.local_now()); table.set_lang(lang); - let table = VirtualTable::new(TABLE_ID, table, columns, SelectionMode::Multi, TableStyle::FILES); + table.set_known(std::rc::Rc::clone(&shared.known.borrow())); + let mut table = VirtualTable::new(TABLE_ID, table, columns, SelectionMode::Multi, TableStyle::FILES_LIST); + table.set_names_lead(true); shared.hub.route(id, win); - Tab { id, nav: NavState::new(id, at), table, watch: None, sort, kept: None, icon_gen: Gen(0), used: 0 } + Tab { + id, + nav: NavState::new(id, at), + table, + watch: None, + sort, + kept: None, + search: Search::default(), + icon_gen: Gen(0), + used: 0, + } +} + +/// How long after the last key the search narrows the list. +pub const SEARCH_DEBOUNCE_MS: u32 = 120; + +/// What narrows a tab's open folder: the text the field holds, the families checked in the Filter menu, and what the +/// listing was given last. It belongs to one folder and is cleared when the tab goes elsewhere. +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct Search { + pub text: String, + pub families: FamilySet, + /// What the listing narrows to now (the text follows it after the debounce). + pub applied: ViewFilter, + /// The folder the state above belongs to. + pub at: Option, + /// Bumped by every change of what the listing is narrowed to, so the counts that depend on it are asked again. + pub serial: u64, +} + +impl Search { + /// What the state asks the listing for. + pub fn wanted(&self) -> ViewFilter { + ViewFilter { query: self.text.as_str().into(), families: self.families } + } + + /// Whether the listing is narrowed now. + pub fn is_on(&self) -> bool { + self.applied.is_active() + } + + /// The tab is at `at`: when that is not the folder the state belongs to, the state is cleared (true). + pub fn follow(&mut self, at: &Location) -> bool { + let moved = self.at.as_ref().is_some_and(|a| a != at); + if moved { + *self = Search { serial: self.serial + 1, ..Search::default() }; + } + self.at = Some(at.clone()); + moved + } +} + +/// The debounce timer of a tab's search. +fn search_timer(id: TabId) -> oled_ui::TimerId { + window::timer(names::TIMER_SEARCH, id) +} + +/// The field's text changed: the list follows 120 ms after the last key. +pub fn search_typed(s: &mut FilesScreen, cx: &mut EventCx, text: &str) { + let id = s.tabs.active().id; + s.tabs.active_mut().search.text = text.to_string(); + cx.set_timer(search_timer(id), SEARCH_DEBOUNCE_MS); +} + +/// The debounce of tab `id` ran out. +pub fn on_search_timer(s: &mut FilesScreen, cx: &mut EventCx, id: TabId) { + apply_search(s, cx, id); +} + +/// Gives the tab's listing what the search and the families ask for now, at once. +pub fn apply_search(s: &mut FilesScreen, cx: &mut EventCx, id: TabId) { + cx.cancel_timer(search_timer(id)); + let active = s.tabs.active().id == id; + let Some(t) = s.tabs.by_id_mut(id) else { return }; + let want = t.search.wanted(); + t.search.applied = want.clone(); + t.search.serial += 1; + t.table.model_mut().listing_mut().set_view_filter(want); + t.table.model_changed(cx, true); + if active { + status::selection_changed(s, cx); + } + cx.relayout(); +} + +/// Clears the search text and the families of the active tab. +pub fn clear_search(s: &mut FilesScreen, cx: &mut EventCx) { + let id = s.tabs.active().id; + let t = s.tabs.active_mut(); + t.search.text.clear(); + t.search.families = FamilySet::default(); + crate::toolbar::set_search_text(s, cx, ""); + apply_search(s, cx, id); +} + +/// Clears the search text only (Esc in the field). +pub fn clear_search_text(s: &mut FilesScreen, cx: &mut EventCx) { + let id = s.tabs.active().id; + s.tabs.active_mut().search.text.clear(); + crate::toolbar::set_search_text(s, cx, ""); + apply_search(s, cx, id); +} + +/// Flips a family of the Filter menu on the active tab. +pub fn toggle_family(s: &mut FilesScreen, cx: &mut EventCx, f: NameFamily) { + let id = s.tabs.active().id; + let t = s.tabs.active_mut(); + t.search.families = t.search.families.toggled(f); + apply_search(s, cx, id); +} + +/// Every family back (the menu's Show all). +pub fn show_all_families(s: &mut FilesScreen, cx: &mut EventCx) { + let id = s.tabs.active().id; + s.tabs.active_mut().search.families = FamilySet::default(); + apply_search(s, cx, id); +} + +/// Enter in the search field: the list narrows now and its keyboard focus goes to the first match. +pub fn search_commit(s: &mut FilesScreen, cx: &mut EventCx, text: &str) { + let id = s.tabs.active().id; + s.tabs.active_mut().search.text = text.to_string(); + apply_search(s, cx, id); + let t = s.tabs.active_mut(); + if ListModel::len(t.table.model()) > 0 { + let first = ListModel::key(t.table.model(), 0); + let mut one = KeySet::new(); + one.insert(first); + t.table.set_selection(cx, Selection::Keys(one)); + t.table.set_focused(cx, first, ScrollTo::Top); + cx.set_focus(oled_ui::NodeId::new(TABLE_ID, 0)); + } +} + +/// Every tab follows its own folder: a tab that went elsewhere loses its search and families. +pub fn follow_folders(s: &mut FilesScreen) { + for t in s.tabs.iter_mut() { + let at = t.nav.location().clone(); + t.search.follow(&at); + } } /// The folder a location lists; Home and the Options page list none and get a placeholder root that is never diff --git a/apps/files/src/toolbar.rs b/apps/files/src/toolbar.rs index 48600ea6..898c5598 100644 --- a/apps/files/src/toolbar.rs +++ b/apps/files/src/toolbar.rs @@ -1,55 +1,123 @@ -//! The toolbar (P3-files-app 2.2; FA-WIN, F1a.8): Back, Forward, Up, the location area and the right cluster (New, Sort, -//! View, More). +//! The address row (Back, Forward, Up and the path field) and the command bar under it (New, the clipboard and +//! rename commands, Delete, Sort, View, More), with the tooltips that say what each does or why it cannot. +use std::cell::{Cell, RefCell}; + +use oled_sys::i18n::S; use oled_trust::frame::files::Location; -use oled_ui::model::FgRole; -use oled_ui::node::Text; -use oled_ui::text::Trim; -use oled_ui::theme::TypeRole; -use oled_ui::widgets::{ButtonOut, IconButton, TextLabel}; +use oled_ui::node::{NodeId, Text}; +use oled_ui::widgets::icon_button::{IconInk, IconSize}; +use oled_ui::widgets::{ + BarEntry, BarStyle, ButtonKind, ButtonOut, CommandBar, CommandBarOut, CommandItem, FieldKind, FieldOut, IconButton, + TextField, +}; use oled_ui::{ - Anchor, Event, EventCx, Glyph, Key, LayoutCx, MouseButton, NodeId, PaintCx, RectP, Reply, UiLang, Widget, WidgetId, + Anchor, CommandId, Event, EventCx, Glyph, Key, LayoutCx, MenuId, MouseButton, PaintCx, RectP, Reply, UiLang, + Widget, WidgetId, }; -use oled_sys::i18n::S; - use crate::keys::{self, Cmd}; +use crate::listing::{TabId, WidePath}; +use crate::nav::Page; +use crate::toolmenus::{self, btn, Avail}; use crate::tr::{k, t, tf}; use crate::window::FilesScreen; -use crate::{chrome, nav, pathline, tab, toolmenus}; +use crate::{menu, nav, pathline, tab}; /// Logical px. -const BTN: i32 = 28; -const LEFT_X: [i32; 3] = [8, 40, 72]; -const LOC_X: i32 = 112; -const GAP: i32 = 4; -const INSET: i32 = 8; -const TOP: i32 = 8; +const PAD: i32 = 10; +const GAP: i32 = 2; +/// The room between Up and the path field, and after the path field. +const FIELD_GAP: i32 = 8; const ID_BACK: WidgetId = WidgetId(10); const ID_FORWARD: WidgetId = WidgetId(11); const ID_UP: WidgetId = WidgetId(12); -const ID_LOC: WidgetId = WidgetId(13); -const ID_NEW: WidgetId = WidgetId(14); -const ID_SORT: WidgetId = WidgetId(15); -const ID_VIEW: WidgetId = WidgetId(16); -const ID_MORE: WidgetId = WidgetId(17); +const ID_BAR: WidgetId = WidgetId(14); +const ID_SEARCH: WidgetId = WidgetId(15); +const ID_SEARCH_BUTTON: WidgetId = WidgetId(16); + +/// The search field's width (logical px), and the window widths below which it is 200 wide, then an icon. +const SEARCH_W: i32 = 300; +const SEARCH_W_SMALL: i32 = 200; +const SEARCH_SMALL_BELOW: i32 = 900; +const SEARCH_ICON_BELOW: i32 = 700; + +/// The search field of the address row, or the icon-only button that opens it over the path in a narrow window. +pub struct SearchBox { + field: TextField, + button: IconButton, + /// The window is narrow: the field is an icon until it is opened. + narrow: bool, + /// A narrow window's field is open over the path (until Esc or until the focus leaves). + open: bool, + /// The field's place in the last layout (empty while it is only an icon). + rect: RectP, + button_rect: RectP, + /// The tab whose text the field shows. + owner: Option, +} -/// Back, Forward, Up IconButtons, the location area (F1a: a TextLabel; F1b: pathline), the right cluster. +impl SearchBox { + fn new() -> SearchBox { + let mut field = TextField::new(ID_SEARCH, FieldKind::Search); + field.set_click_style(true); + field.set_clear_button(true); + SearchBox { + field, + button: IconButton::new(ID_SEARCH_BUTTON, Glyph::Search, Text::Borrowed("")), + narrow: false, + open: false, + rect: RectP::EMPTY, + button_rect: RectP::EMPTY, + owner: None, + } + } + + /// For the scenes and the tests: the field's text. + pub fn text(&self) -> &str { + self.field.text() + } + + /// Whether the window is narrow enough for the icon, and whether the field is open over the path. + pub fn narrow(&self) -> (bool, bool) { + (self.narrow, self.open) + } + + /// Where the field and the icon button were laid out (an empty rect: not shown). + pub fn rects(&self) -> (RectP, RectP) { + (self.rect, self.button_rect) + } + + /// The field's node: where the keyboard is when it holds the focus. + pub fn field_node(&self) -> NodeId { + self.field.node_id() + } +} + +/// A command's id, label, what it does, its shortcut and why it cannot run now. +type Row = (u32, Text, Text, Option, Option); + +/// Back, Forward, Up, and the command bar. pub struct Toolbar { back: IconButton, forward: IconButton, up: IconButton, - loc: TextLabel, - new: IconButton, - sort: IconButton, - view: IconButton, - more: IconButton, - /// The cells of Back and Forward and of the right cluster (New, Sort, View, More) from the last layout: a menu - /// opens under its own button. + bar: CommandBar, + /// The cells of Back and Forward from the last layout: their history menus open under them. back_r: RectP, forward_r: RectP, - right_r: [RectP; 4], + /// The menu the bar opened and the button it belongs to (None: More). + open: Option<(MenuId, Option)>, + /// The commands' states the bar shows now. + seen: Cell, + /// Whether the folder may be changed, for the folder it was asked about last. + changes: RefCell>, + /// For scenes and tests: the answer in place of the folder's own. + forced: Cell>, + /// For scenes: a command whose tooltip is drawn under it. + tip_of: Option, + search: SearchBox, } impl std::fmt::Debug for Toolbar { @@ -64,23 +132,100 @@ impl Default for Toolbar { } } +fn command(id: u32, glyph: Glyph, kind: ButtonKind, rank: u8) -> BarEntry { + BarEntry::Item(CommandItem::new(CommandId(id), glyph, Text::Borrowed(""), kind).fold(rank)) +} + +fn entries() -> Vec { + let new = CommandItem::new(CommandId(btn::NEW), Glyph::LinePlus, Text::Borrowed(""), ButtonKind::Plate) + .with_menu(Vec::new()); + let menu = |id: u32, glyph: Glyph, rank: u8| { + BarEntry::Item(CommandItem::new(CommandId(id), glyph, Text::Borrowed(""), ButtonKind::Menu).fold(rank)) + }; + vec![ + BarEntry::Item(new), + BarEntry::Separator, + command(Cmd::Cut as u32, Glyph::CmdCut, ButtonKind::Command, 1), + command(Cmd::Copy as u32, Glyph::CmdCopy, ButtonKind::Command, 2), + command(Cmd::Paste as u32, Glyph::CmdPaste, ButtonKind::Command, 3), + command(Cmd::Rename as u32, Glyph::CmdRename, ButtonKind::Command, 4), + command(Cmd::Recycle as u32, Glyph::CmdDelete, ButtonKind::Destructive, 5), + BarEntry::Separator, + menu(btn::SORT, Glyph::CmdSort, 6), + menu(btn::VIEW, Glyph::CmdView, 7), + BarEntry::Item( + CommandItem::new(CommandId(btn::FILTER), Glyph::CmdFilter, Text::Borrowed(""), ButtonKind::Toggle) + .with_menu(Vec::new()) + .fold(8), + ), + BarEntry::Separator, + BarEntry::More, + BarEntry::Spacer, + BarEntry::Item(CommandItem::new( + CommandId(Cmd::DetailsPane as u32), + Glyph::CmdDetailsPane, + Text::Borrowed(""), + ButtonKind::Toggle, + )), + ] +} + impl Toolbar { pub fn new() -> Toolbar { let e = || Text::Borrowed(""); + let mut bar = CommandBar::new(ID_BAR, BarStyle::Bar, entries()); + bar.set_name(e()); Toolbar { back: IconButton::new(ID_BACK, Glyph::ChevronLeft, e()), forward: IconButton::new(ID_FORWARD, Glyph::ChevronRight, e()), up: IconButton::new(ID_UP, Glyph::ChevronUp, e()), - loc: TextLabel::new(ID_LOC, e(), TypeRole::Body, FgRole::Secondary), - new: IconButton::new(ID_NEW, Glyph::Plus, e()), - sort: IconButton::new(ID_SORT, Glyph::SortUp, e()), - view: IconButton::new(ID_VIEW, Glyph::List, e()), - more: IconButton::new(ID_MORE, Glyph::More, e()), + bar, back_r: RectP::EMPTY, forward_r: RectP::EMPTY, - right_r: [RectP::EMPTY; 4], + open: None, + seen: Cell::new(Avail::default()), + changes: RefCell::new(None), + forced: Cell::new(None), + tip_of: None, + search: SearchBox::new(), } } + + /// The search field and its icon, for the tests and the scenes. + pub fn search(&self) -> &SearchBox { + &self.search + } + + /// Whether files may change in `dir`: asked of the gate once per folder. + pub(crate) fn may_change(&self, dir: &WidePath) -> bool { + if let Some(on) = self.forced.get() { + return on; + } + let mut cache = self.changes.borrow_mut(); + match cache.as_ref() { + Some((d, on)) if d == dir => *on, + _ => { + let on = toolmenus::may_change_dir(dir); + *cache = Some((dir.clone(), on)); + on + } + } + } + + /// For scenes and tests: answers the gate's question for every folder (None: the gate answers again). + pub fn force_changes(&self, on: Option) { + self.forced.set(on); + } + + /// For scenes: draws the tooltip of this command under its button (None: no tooltip). + pub fn preview_tip(&mut self, id: Option) { + self.tip_of = id; + } + + /// The command bar, for the tests and the scenes. + pub fn bar(&self) -> &CommandBar { + &self.bar + } } /// The last path component, the drive for a root, the app's Home word for Home. @@ -99,14 +244,6 @@ pub fn place_name(l: &Location, lang: UiLang) -> String { } } -/// The full path as the location area shows it. -fn location_text(l: &Location, lang: UiLang) -> String { - match l { - Location::Fs(p) => p.to_string_lossy(), - other => place_name(other, lang), - } -} - fn with_chord(base: Text, cmd: Cmd, lang: UiLang) -> Text { let label = keys::TABLE .iter() @@ -120,17 +257,26 @@ fn with_chord(base: Text, cmd: Cmd, lang: UiLang) -> Text { } } -/// The location area goes to pathline::layout; the plain label draws only while no tab strip exists. +fn nav_button(id: WidgetId, glyph: Glyph, tip: Text, off: Text, enabled: bool) -> IconButton { + let mut b = IconButton::new(id, glyph, tip); + b.set_size(IconSize::Large); + b.set_ink(IconInk::Primary); + b.set_off_tip(Some(off)); + b.set_enabled(enabled); + b +} + +/// The address row: Back, Forward and Up, then the path field filling the rest. The search field of a later change +/// takes its room off the field's right end (`field_right`). pub fn layout(s: &mut FilesScreen, cx: &mut LayoutCx, r: RectP) { let lang = s.shared.lang.get(); - let (back_to, fwd_to, up_to, loc, can) = { + let (back_to, fwd_to, up_to, can) = { let nav = &s.tabs.active().nav; let back = nav.history(true, 1).into_iter().next().map(|(_, l)| place_name(&l, lang)); let fwd = nav.history(false, 1).into_iter().next().map(|(_, l)| place_name(&l, lang)); let up = nav::parent_of(nav.location()).map(|l| place_name(&l, lang)); - (back, fwd, up, location_text(nav.location(), lang), (nav.can_back(), nav.can_forward(), nav.can_up())) + (back, fwd, up, (nav.can_back(), nav.can_forward(), nav.can_up())) }; - let tb = &mut s.toolbar; let tip = |plain: S, named: S, who: Option, c: Cmd| { let base = match who { Some(n) => tf(named, lang, &[("name", &n)]), @@ -138,118 +284,371 @@ pub fn layout(s: &mut FilesScreen, cx: &mut LayoutCx, r: RectP) { }; with_chord(base, c, lang) }; - *tb = Toolbar { - back: rebuild( - &tb.back, - ID_BACK, - Glyph::ChevronLeft, - tip(k::FILES_NAV_BACK, k::FILES_NAV_BACK_TO, back_to, Cmd::Back), - can.0, + let tb = &mut s.toolbar; + tb.back = nav_button( + ID_BACK, + Glyph::ChevronLeft, + tip(k::FILES_NAV_BACK, k::FILES_NAV_BACK_TO, back_to, Cmd::Back), + t(k::FILES_NAV_NO_BACK, lang), + can.0, + ); + tb.forward = nav_button( + ID_FORWARD, + Glyph::ChevronRight, + tip(k::FILES_NAV_FORWARD, k::FILES_NAV_FORWARD_TO, fwd_to, Cmd::Forward), + t(k::FILES_NAV_NO_FORWARD, lang), + can.1, + ); + tb.up = nav_button( + ID_UP, + Glyph::ChevronUp, + tip(k::FILES_NAV_UP, k::FILES_NAV_UP_TO, up_to, Cmd::Up), + t(k::FILES_NAV_NO_UP, lang), + can.2, + ); + let side = cx.px(cx.tokens().size.click_h); + let y = r.t + (r.h() - side) / 2; + let mut x = r.l + cx.px(PAD); + let mut cells = [RectP::EMPTY; 3]; + for cell in &mut cells { + *cell = RectP::wh(x, y, side, side); + x += side + cx.px(GAP); + } + tb.back.layout(cx, cells[0]); + tb.forward.layout(cx, cells[1]); + tb.up.layout(cx, cells[2]); + (tb.back_r, tb.forward_r) = (cells[0], cells[1]); + let left = cells[2].r + cx.px(FIELD_GAP); + let right = layout_search(s, cx, r, left); + pathline::layout(s, cx, RectP { l: left.min(right), r: right, ..r }); +} + +/// The search field (or its icon) at the right end of the row; where the path field ends. +fn layout_search(s: &mut FilesScreen, cx: &mut LayoutCx, r: RectP, left: i32) -> i32 { + let lang = s.shared.lang.get(); + let (id, text, name, home) = { + let t = s.tabs.active(); + (t.id, t.search.text.clone(), place_name(t.nav.location(), lang), matches!(t.nav.page(), Page::Home)) + }; + let keycap = menu::chord_of(s, Cmd::FocusSearch); + let sb = &mut s.toolbar.search; + let placeholder = tf(k::FILES_SEARCH_PLACEHOLDER, lang, &[("name", &name)]); + sb.field.set_placeholder(placeholder.clone()); + sb.field.set_label(t(k::FILES_SEARCH_LABEL, lang)); + sb.field.set_keycap(keycap); + sb.field.set_enabled(!home); + if sb.owner != Some(id) || sb.field.text() != text { + sb.field.preview(&text, false, None, None, None); + sb.owner = Some(id); + } + let right = r.r - cx.px(PAD); + sb.narrow = r.w() < cx.px(SEARCH_ICON_BELOW); + if !sb.narrow { + sb.open = false; + } + sb.button = IconButton::new(ID_SEARCH_BUTTON, Glyph::Search, placeholder); + sb.button.set_size(IconSize::Large); + sb.button.set_ink(IconInk::Primary); + sb.button.set_enabled(!home); + let side = cx.px(cx.tokens().size.click_h); + sb.button_rect = RectP::EMPTY; + sb.rect = RectP::EMPTY; + let path_right; + if sb.narrow { + let at = RectP::wh(right - side, r.t + (r.h() - side) / 2, side, side); + path_right = at.l - cx.px(FIELD_GAP); + if sb.open { + sb.rect = RectP { l: left.min(right), r: right, ..r }; + } else { + sb.button_rect = at; + sb.button.layout(cx, at); + } + } else { + let w = cx.px(if r.w() < cx.px(SEARCH_SMALL_BELOW) { SEARCH_W_SMALL } else { SEARCH_W }); + sb.rect = RectP { l: right - w, r: right, ..r }; + path_right = sb.rect.l - cx.px(FIELD_GAP); + } + // A field that is only an icon has no place: its node waits for the focus that opens it. + sb.field.layout(cx, sb.rect); + path_right +} + +/// Ctrl+F, Ctrl+E and F3: the keyboard goes to the search field (opened first when it is an icon). +pub fn focus_search(s: &mut FilesScreen, cx: &mut EventCx) -> Reply { + if matches!(s.tabs.active().nav.page(), Page::Home) { + return Reply::None; + } + let sb = &mut s.toolbar.search; + if sb.narrow { + sb.open = true; + } + let node = sb.field_node(); + cx.set_focus(node); + let all = sb.field.text().len(); + sb.field.select(cx, 0..all); + Reply::Relayout +} + +/// Whether the search field holds the keyboard focus. +pub fn search_has_focus(s: &FilesScreen, cx: &EventCx) -> bool { + cx.focused() == Some(s.toolbar.search.field_node()) +} + +/// Esc with the keyboard in the search field and nothing left to clear: the list takes the focus back and a narrow +/// window's field closes. True when the keyboard was in the field. +pub fn leave_search(s: &mut FilesScreen, cx: &mut EventCx) -> bool { + if !search_has_focus(s, cx) { + return false; + } + s.toolbar.search.open = false; + cx.set_focus(NodeId::new(tab::TABLE_ID, 0)); + true +} + +/// Sets the field's text from the program (a cleared search). +pub fn set_search_text(s: &mut FilesScreen, cx: &mut EventCx, text: &str) { + s.toolbar.search.field.set_text(cx, text, false); +} + +/// The field's answers: the text asks for the narrowed list after the debounce, Enter at once with the focus on the +/// first match, Esc clears the text. +fn search_out(s: &mut FilesScreen, cx: &mut EventCx, out: FieldOut) -> Reply { + match out { + FieldOut::Changed => { + let text = s.toolbar.search.field.text().to_string(); + tab::search_typed(s, cx, &text); + Reply::Relayout + } + FieldOut::Committed(text) => { + tab::search_commit(s, cx, &text); + s.toolbar.search.open = false; + Reply::Relayout + } + FieldOut::Cancelled => { + tab::clear_search_text(s, cx); + Reply::Relayout + } + _ => Reply::None, + } +} + +/// The field's events (and the icon's): None when they are not its own. +fn search_event(s: &mut FilesScreen, cx: &mut EventCx, ev: &Event) -> Option { + let node = s.toolbar.search.field_node(); + let sb = &mut s.toolbar.search; + if !sb.rect.is_empty() { + if let Some(out) = sb.field.event(cx, ev) { + return Some(search_out(s, cx, out)); + } + } + let sb = &mut s.toolbar.search; + match ev { + Event::FocusIn(_) if cx.target() == Some(node) && sb.narrow && !sb.open => { + sb.open = true; + return Some(Reply::Relayout); + } + Event::FocusOut if cx.target() == Some(node) && sb.narrow && sb.open => { + sb.open = false; + return Some(Reply::Relayout); + } + _ => {} + } + if sb.narrow && !sb.open && !sb.button_rect.is_empty() { + if let Some(ButtonOut::Clicked) = sb.button.event(cx, ev) { + return Some(focus_search(s, cx)); + } + } + None +} + +/// What each command of the bar says and may do now, from the folder, the selection and the build switches. +fn refresh(s: &mut FilesScreen) { + let lang = s.shared.lang.get(); + let a = toolmenus::avail(s); + let chord = |c: Cmd| menu::chord_of(s, c); + let kit = |key| lang.kit(key); + // Id, label, what it does, its shortcut, why it cannot. + let rows: [Row; 10] = [ + (btn::NEW, t(k::FILES_MENU_NEW, lang), t(k::FILES_CMD_NEW_TIP, lang), None, None), + (Cmd::Cut as u32, t(k::FILES_CMD_CUT, lang), t(k::FILES_CMD_CUT_TIP, lang), chord(Cmd::Cut), a.cut), + (Cmd::Copy as u32, t(k::FILES_CMD_COPY, lang), t(k::FILES_CMD_COPY_TIP, lang), chord(Cmd::Copy), a.copy), + (Cmd::Paste as u32, t(k::FILES_CMD_PASTE, lang), t(k::FILES_CMD_PASTE_TIP, lang), chord(Cmd::Paste), a.paste), + ( + Cmd::Rename as u32, + t(k::FILES_MENU_RENAME, lang), + t(k::FILES_CMD_RENAME_TIP, lang), + Some(Text::from("F2")), // lint: not UI + a.rename, ), - forward: rebuild( - &tb.forward, - ID_FORWARD, - Glyph::ChevronRight, - tip(k::FILES_NAV_FORWARD, k::FILES_NAV_FORWARD_TO, fwd_to, Cmd::Forward), - can.1, + ( + Cmd::Recycle as u32, + kit(oled_ui::strings::k::KIT_VERB_DELETE), + t(k::FILES_CMD_DELETE_TIP, lang), + chord(Cmd::Recycle), + a.delete, ), - up: rebuild(&tb.up, ID_UP, Glyph::ChevronUp, tip(k::FILES_NAV_UP, k::FILES_NAV_UP_TO, up_to, Cmd::Up), can.2), - loc: { - let mut l = TextLabel::new(ID_LOC, Text::Owned(loc), TypeRole::Body, FgRole::Secondary); - l.set_trim(Trim::Start); - l - }, - new: rebuild(&tb.new, ID_NEW, Glyph::Plus, t(k::FILES_MENU_NEW, lang), true), - sort: rebuild(&tb.sort, ID_SORT, Glyph::SortUp, t(k::FILES_MENU_SORT, lang), true), - view: rebuild(&tb.view, ID_VIEW, Glyph::List, t(k::FILES_MENU_VIEW, lang), true), - more: rebuild(&tb.more, ID_MORE, Glyph::More, t(k::FILES_MENU_MORE_ACTIONS, lang), true), - back_r: RectP::EMPTY, - forward_r: RectP::EMPTY, - right_r: [RectP::EMPTY; 4], - }; - let sc = cx.scale(); - let px = move |v: i32| sc.px(v); - let (side, y) = (px(BTN), r.t + px(TOP)); - let left = LEFT_X.map(|x| RectP::wh(r.l + px(x), y, side, side)); - tb.back.layout(cx, left[0]); - tb.forward.layout(cx, left[1]); - tb.up.layout(cx, left[2]); - (tb.back_r, tb.forward_r) = (left[0], left[1]); - let mut right = r.r - px(INSET); - let mut rects = [RectP::EMPTY; 4]; - for slot in rects.iter_mut().rev() { - *slot = RectP::wh(right - side, y, side, side); - right -= side + px(GAP); - } - tb.new.layout(cx, rects[0]); - tb.sort.layout(cx, rects[1]); - tb.view.layout(cx, rects[2]); - tb.more.layout(cx, rects[3]); - tb.right_r = rects; - let loc_l = r.l + px(LOC_X); - let text_h = px(20); - let loc_r = - RectP { l: loc_l, t: y + (side - text_h) / 2, r: (right - px(GAP)).max(loc_l), b: y + (side + text_h) / 2 }; - if !chrome::has_strip(s) { - s.toolbar.loc.layout(cx, loc_r); - } - pathline::layout(s, cx, loc_r); + (btn::SORT, t(k::FILES_MENU_SORT, lang), t(k::FILES_CMD_SORT_TIP, lang), None, None), + (btn::VIEW, t(k::FILES_MENU_VIEW, lang), t(k::FILES_CMD_VIEW_TIP, lang), None, None), + (btn::FILTER, t(k::FILES_MENU_FILTER, lang), t(k::FILES_CMD_FILTER_TIP, lang), None, None), + ( + Cmd::DetailsPane as u32, + t(k::FILES_CMD_DETAILS, lang), + t(k::FILES_CMD_DETAILS_TIP, lang), + chord(Cmd::DetailsPane), + None, + ), + ]; + let families_on = !s.tabs.active().search.families.is_empty(); + let tb = &mut s.toolbar; + tb.seen.set(a); + for (id, label, tip, shortcut, why) in rows { + if let Some(it) = tb.bar.item_mut(CommandId(id)) { + it.label = label; + it.enabled = why.is_none(); + it.tip = why.map_or(tip, |w| w.text(lang)); + it.shortcut = shortcut; + } + } + tb.bar.set_on(CommandId(btn::FILTER), families_on); + tb.bar.set_name(t(k::FILES_MENU_NEW, lang)); } -fn rebuild(old: &IconButton, id: WidgetId, g: Glyph, tip: Text, enabled: bool) -> IconButton { - let _ = old; - let mut b = IconButton::new(id, g, tip); - b.set_enabled(enabled); - b +/// The command bar under the address row. +pub fn layout_commands(s: &mut FilesScreen, cx: &mut LayoutCx, r: RectP) { + refresh(s); + let pane_on = crate::details_pane::is_on(s, cx.scale().logical(r.w())); + s.toolbar.bar.set_on(CommandId(Cmd::DetailsPane as u32), pane_on); + s.toolbar.bar.layout(cx, r); +} + +/// The commands' states changed since the bar was laid out: it needs a new layout. +pub fn stale(s: &FilesScreen) -> bool { + toolmenus::avail(s) != s.toolbar.seen.get() } pub fn paint(s: &FilesScreen, cx: &mut PaintCx) { let tb = &s.toolbar; - for w in [&tb.back, &tb.forward, &tb.up, &tb.new, &tb.sort, &tb.view, &tb.more] { + for w in [&tb.back, &tb.forward, &tb.up] { w.paint(cx); } - if !chrome::has_strip(s) { - tb.loc.paint(cx); + let sb = &tb.search; + if sb.narrow && sb.open { + sb.field.paint(cx); + } else { + pathline::paint(s, cx); + if sb.narrow { + sb.button.paint(cx); + } else { + sb.field.paint(cx); + } } - pathline::paint(s, cx); + tb.bar.paint(cx); } -/// The rects of New, Sort, View and More (physical pixels, as of the last layout). -pub fn right_rects(s: &FilesScreen) -> [RectP; 4] { - s.toolbar.right_r +/// A command's tooltip drawn under its button, for the scenes (the offscreen window has no pointer to rest on it). +pub fn paint_tip(s: &FilesScreen, cx: &mut PaintCx) { + let tb = &s.toolbar; + let Some(id) = tb.tip_of else { return }; + let (Some(r), Some(text)) = (tb.bar.rect_of(id), tb.bar.description_of(id)) else { return }; + let (plain, chord) = match text.split_once(" \u{b7} ") { + Some((a, b)) => (a, Some(b)), + None => (&*text, None), + }; + let at = oled_ui::PointP { x: r.l, y: r.b + cx.px(6) }; + oled_ui::widgets::paint_chip(cx, at, plain, chord); +} + +/// The node of a command's button (None while it is folded away). +pub fn command_node(s: &FilesScreen, id: u32) -> Option { + let id = CommandId(id); + s.toolbar.bar.rect_of(id).and(s.toolbar.bar.node_of(id)) } -/// Back, Forward, Up -> keys::run; the right cluster -> toolmenus::open_*; a right click or the Menu key over Back or -/// Forward -> tab::history_menu (F4.3). +/// The node of the More button. +pub fn more_node(s: &FilesScreen) -> Option { + s.toolbar.bar.more_node() +} + +/// Back, Forward, Up -> keys::run; the bar's commands -> keys::run, its menu buttons -> the menus; a right click or the +/// Menu key over Back or Forward -> tab::history_menu. pub fn event(s: &mut FilesScreen, cx: &mut EventCx, ev: &Event) -> Option { + // Esc takes a scene's tooltip away, as it does a real one. + if s.toolbar.tip_of.is_some() && matches!(ev, Event::Key { key: Key::ESC, down: true, .. }) { + s.toolbar.tip_of = None; + return Some(Reply::Redraw); + } + if let Event::MenuClosed(id) = ev { + if s.toolbar.open.is_some_and(|(m, _)| m == *id) { + s.toolbar.open = None; + s.toolbar.bar.set_open(None); + s.toolbar.bar.set_more_open(false); + return Some(Reply::Relayout); + } + } + if let Some(r) = search_event(s, cx, ev) { + return Some(r); + } if let Some(r) = history_menu_event(s, cx, ev) { return Some(r); } let tb = &mut s.toolbar; - let hit = [ - (tb.back.event(cx, ev), 0u8), - (tb.forward.event(cx, ev), 1), - (tb.up.event(cx, ev), 2), - (tb.new.event(cx, ev), 3), - (tb.sort.event(cx, ev), 4), - (tb.view.event(cx, ev), 5), - (tb.more.event(cx, ev), 6), - ] - .into_iter() - .find_map(|(o, i)| matches!(o, Some(ButtonOut::Clicked)).then_some(i))?; - let at = |i: usize| Anchor::Below(s.toolbar.right_r[i]); - Some(match hit { - 0 => keys::run(s, cx, Cmd::Back), - 1 => keys::run(s, cx, Cmd::Forward), - 2 => keys::run(s, cx, Cmd::Up), - 3 => toolmenus::open_new(s, cx, at(0)), - 4 => toolmenus::open_sort(s, cx, at(1)), - 5 => toolmenus::open_view(s, cx, at(2)), - _ => toolmenus::open_more(s, cx, at(3)), - }) + let nav = + [(tb.back.event(cx, ev), Cmd::Back), (tb.forward.event(cx, ev), Cmd::Forward), (tb.up.event(cx, ev), Cmd::Up)] + .into_iter() + .find_map(|(o, c)| matches!(o, Some(ButtonOut::Clicked)).then_some(c)); + if let Some(c) = nav { + return Some(keys::run(s, cx, c)); + } + match s.toolbar.bar.event(cx, ev)? { + CommandBarOut::Command(id) => Some(keys::cmd_of(id).map_or(Reply::None, |c| keys::run(s, cx, c))), + CommandBarOut::OpenMenu(id, rect) => { + crate::clip_files::look(s, cx); + let at = Anchor::Below(rect); + let menu = match id.0 { + btn::NEW => toolmenus::show_new(s, cx, at), + btn::SORT => toolmenus::show_sort(s, cx, at), + btn::VIEW => toolmenus::show_view(s, cx, at), + btn::FILTER => toolmenus::show_filter(s, cx, at), + _ => return None, + }; + s.toolbar.open = Some((menu, Some(id))); + s.toolbar.bar.set_open(Some(id)); + Some(Reply::Relayout) + } + CommandBarOut::OpenMore(rect) => { + // Paste's state as the clipboard is now: the folded buttons come into the menu with it. + if crate::clip_files::look(s, cx) { + refresh(s); + } + let items = more_menu(s); + let menu = cx.open_menu(items, Anchor::Below(rect)); + s.toolbar.open = Some((menu, None)); + s.toolbar.bar.set_more_open(true); + Some(Reply::Relayout) + } + } +} + +/// The More menu: the buttons the bar had no room for, in bar order, then its own items. A folded menu button takes +/// its menu along as a submenu. +pub fn more_menu(s: &mut FilesScreen) -> Vec { + for id in s.toolbar.bar.folded_ids() { + let items = match id.0 { + btn::NEW => toolmenus::new_items(s), + btn::SORT => toolmenus::sort_items(s), + btn::VIEW => toolmenus::toolbar_view_items(s), + btn::FILTER => toolmenus::filter_items(s), + _ => continue, + }; + if let Some(it) = s.toolbar.bar.item_mut(id) { + it.submenu = items; + } + } + let own = toolmenus::more_items(s); + s.toolbar.bar.more_menu(own) } -/// A right click, or the Menu key, on Back or Forward opens that button's history (F4.3). +/// A right click, or the Menu key, on Back or Forward opens that button's history. fn history_menu_event(s: &mut FilesScreen, cx: &mut EventCx, ev: &Event) -> Option { let asked = matches!(ev, Event::Click { button: MouseButton::Right, .. } | Event::Key { key: Key::APPS, down: true, .. }); diff --git a/apps/files/src/toolmenus.rs b/apps/files/src/toolmenus.rs index 9cc1cb33..b586cb58 100644 --- a/apps/files/src/toolmenus.rs +++ b/apps/files/src/toolmenus.rs @@ -1,21 +1,39 @@ -//! The toolbar's menus (P3-files-app 2.2, F2.6): New, Sort, View and More, and the three view switches they share -//! with the background menu (Hidden items, File name extensions, Compact spacing). +//! The command bar's menus (New, Sort, View and More), what each command of the bar may do now, and the three view +//! switches the menus share with the background menu (Hidden items, File name extensions, Compact view). -use oled_ui::model::{ColId, SortDir}; +use oled_ui::model::{ColId, ListModel, SortDir}; use oled_ui::node::Text; -use oled_ui::{Anchor, CommandId, EventCx, Glyph, MenuItem, Reply}; +use oled_ui::{Anchor, CommandId, EventCx, Glyph, MenuId, MenuItem, Reply, UiLang}; +use crate::gate; use crate::keys::Cmd; -use crate::listing::{Gen, Visibility, WidePath}; +use crate::listing::{Gen, NameFamily, Visibility, WidePath}; use crate::menu::{self, pick}; use crate::model::{ColKind, Listing}; use crate::tr::{k, t}; use crate::view::columns::sort_key; use crate::window::{FilesScreen, Shared}; use crate::{status, view}; +use oled_trust::frame::files::Location; -/// Folder is enabled when FC-RENAME lands (F3); until then the menu shows it disabled with the note. -pub const NEW_FOLDER_LIVE: bool = false; +/// New folder in a real folder needs this on top of REAL_DATA_MUTATIONS; the test and live roots do not wait for it. +/// On once the disposable job's mutations record shows a new folder made and its undo; it is flipped, and reverted, +/// in a commit of its own. +pub const NEW_FOLDER_LIVE: bool = true; + +/// The ids of the three menu buttons of the command bar (the key table's ids are 1..=0x1030, the picks start at 0x2001). +pub mod btn { + pub const NEW: u32 = 0x2210; + pub const SORT: u32 = 0x2211; + pub const VIEW: u32 = 0x2212; + pub const FILTER: u32 = 0x2213; +} + +/// The picks of the Filter menu: BASE + the family's place in NameFamily::ALL, then Show all. +pub mod filter_pick { + pub const BASE: u32 = 0x2150; + pub const SHOW_ALL: u32 = 0x215F; +} const KINDS: [ColKind; 7] = [ ColKind::Name, @@ -27,18 +45,175 @@ const KINDS: [ColKind; 7] = [ ColKind::Status, ]; +/// The dock as the accent item sees it: whether it runs, and a request that it open its Settings on Appearance. +pub trait DockLink { + fn running(&self) -> bool; + fn open_appearance(&self) -> bool; +} + +/// The dock of this suite, through the shared link the apps use. +pub struct RealDock; + +impl DockLink for RealDock { + fn running(&self) -> bool { + oled_sys::docklink::dock_running() + } + + fn open_appearance(&self) -> bool { + oled_sys::docklink::open_dock_settings(oled_sys::docklink::SettingsPage::Appearance) + } +} + +/// Why a command cannot run now. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Why { + /// Its build switch is off (or the folder is outside the roots where files may change). + NotInAlpha, + NothingSelected, + SelectOne, + NoFolder, + NothingToUndo, + NothingToRedo, + /// The accent item needs the dock. + NoDock, + /// Paste: the clipboard holds no files. + ClipboardEmpty, +} + +impl Why { + /// The reason as the tooltip and the menu note say it. + pub fn text(self, lang: UiLang) -> Text { + t( + match self { + Why::NotInAlpha => k::FILES_MENU_NOT_IN_BETA, + Why::NothingSelected => k::FILES_CMD_NOTHING_SELECTED, + Why::SelectOne => k::FILES_CMD_SELECT_ONE, + Why::NoFolder => k::FILES_CMD_NO_FOLDER, + Why::NothingToUndo => k::FILES_CMD_NOTHING_TO_UNDO, + Why::NothingToRedo => k::FILES_CMD_NOTHING_TO_REDO, + Why::NoDock => k::FILES_MORE_ACCENT_NO_DOCK, + Why::ClipboardEmpty => k::FILES_CMD_CLIPBOARD_EMPTY, + }, + lang, + ) + } +} + +/// What each command that changes files may do now: None is enabled, Some is the reason it is not. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct Avail { + pub cut: Option, + pub copy: Option, + pub paste: Option, + pub rename: Option, + pub delete: Option, + pub new_folder: Option, + pub undo: Option, + pub redo: Option, +} + +/// The commands' states for the folder and the selection of the active tab, under the build switches. Cheap: the +/// folder's answer is kept until the folder changes. +pub fn avail(s: &FilesScreen) -> Avail { + let tab = s.tabs.active(); + let dir = match tab.nav.location() { + Location::Fs(p) => Some(p), + _ => None, + }; + let n = tab.table.selection().count(ListModel::len(tab.table.model())); + let changes = dir.is_some_and(|d| s.toolbar.may_change(d)); + // The clipboard commands follow their own switch, then the folder's answer like every change. + let live = s.shared.paste_live.get(); + let clip = |need_selection: bool| { + if !live { + Some(Why::NotInAlpha) + } else if dir.is_none() { + Some(Why::NoFolder) + } else if !changes { + Some(Why::NotInAlpha) + } else if need_selection && n == 0 { + Some(Why::NothingSelected) + } else { + None + } + }; + let change = |need_selection: bool| { + if dir.is_none() { + Some(Why::NoFolder) + } else if !changes { + Some(Why::NotInAlpha) + } else if need_selection && n == 0 { + Some(Why::NothingSelected) + } else { + None + } + }; + let lang = s.shared.lang.get(); + let (undo, redo) = { + let u = s.shared.undo.borrow(); + (u.label(lang).is_some(), u.redo_label(lang).is_some()) + }; + Avail { + cut: clip(true), + copy: clip(true), + paste: clip(false).or_else(|| crate::clip_files::paste_why(s)), + rename: change(true).or((n > 1).then_some(Why::SelectOne)), + delete: change(true), + new_folder: new_folder_why(change(false), gate::REAL_DATA_MUTATIONS, NEW_FOLDER_LIVE), + undo: change(false).or((!undo).then_some(Why::NothingToUndo)), + redo: change(false).or((!redo).then_some(Why::NothingToRedo)), + } +} + +/// New folder's reason, from what any change in the folder would say (`change`) and the two build switches: with real +/// data on, New folder also waits for its own switch; the test and live roots do not (real data off). Pure. +pub fn new_folder_why(change: Option, real_data: bool, new_folder_live: bool) -> Option { + match change { + None if real_data && !new_folder_live => Some(Why::NotInAlpha), + other => other, + } +} + +/// Whether the folder may be changed: inside a test or live root, or with the real-data switch on. +pub fn may_change_dir(dir: &WidePath) -> bool { + gate::may_mutate_quick(&[dir]) +} + +/// A Custom row; `why` is the reason it is disabled (None: enabled). +#[allow(clippy::too_many_arguments)] +fn item( + s: &FilesScreen, + id: u32, + label: Text, + glyph: Option, + chord: Option, + checked: Option, + why: Option, +) -> MenuItem { + let lang = s.shared.lang.get(); + MenuItem::Custom { + id: CommandId(id), + label, + glyph, + chord: chord.and_then(|c| menu::chord_of(s, c)), + enabled: why.is_none(), + checked, + note: why.map(|w| w.text(lang)), + danger: false, + } +} + /// New: Folder (the system's ShellNew types are not in the first version). pub fn new_items(s: &FilesScreen) -> Vec { let lang = s.shared.lang.get(); - vec![menu::row( + vec![item( s, Cmd::NewFolder as u32, - t(k::FILES_MENU_NEW_FOLDER, lang), - Some(Glyph::Folder), + t(k::FILES_NEW_FOLDER, lang), + Some(Glyph::CmdNewFolder), Some(Cmd::NewFolder), None, - NEW_FOLDER_LIVE, - true, + avail(s).new_folder, )] } @@ -88,14 +263,45 @@ pub fn sort_items(s: &FilesScreen) -> Vec { items } -/// The toolbar's View: Details (checked; list and icon views are F7) and the three switches. +/// The View menu of the bar: Details (checked, the only view), Compact view, then the two switches of the names. pub fn toolbar_view_items(s: &FilesScreen) -> Vec { let lang = s.shared.lang.get(); - let mut items = - vec![menu::row(s, pick::VIEW_DETAILS, t(k::FILES_VIEW_DETAILS, lang), None, None, Some(true), true, false)]; - items.push(MenuItem::Separator); - items.extend(view_items(s)); - items + let o = s.shared.opts.borrow(); + vec![ + menu::row(s, pick::VIEW_DETAILS, t(k::FILES_VIEW_DETAILS, lang), None, None, Some(true), true, false), + menu::row(s, pick::VIEW_COMPACT, t(k::FILES_VIEW_COMPACT, lang), None, None, Some(o.compact), true, false), + MenuItem::Separator, + menu::row( + s, + Cmd::DetailsPane as u32, + t(k::FILES_CMD_DETAILS_PANE, lang), + None, + Some(Cmd::DetailsPane), + Some(o.details_pane), + true, + false, + ), + menu::row( + s, + Cmd::HiddenItems as u32, + t(k::FILES_VIEW_HIDDEN, lang), + None, + Some(Cmd::HiddenItems), + Some(o.hidden_items), + true, + false, + ), + menu::row( + s, + pick::VIEW_EXTENSIONS, + t(k::FILES_VIEW_EXTENSIONS, lang), + None, + None, + Some(o.show_extensions), + true, + false, + ), + ] } /// The three switches, as the background menu's View submenu shows them. @@ -127,50 +333,126 @@ pub fn view_items(s: &FilesScreen) -> Vec { ] } -/// More: Undo and Redo (F3 fills the labels), the selection commands, Open in File Explorer and About. +/// More: Undo and Redo, the selection commands, the path, Properties and File Explorer, the accent colour and About. pub fn more_items(s: &FilesScreen) -> Vec { let lang = s.shared.lang.get(); let (undo, redo) = { let u = s.shared.undo.borrow(); (u.label(lang), u.redo_label(lang)) }; - let undo_on = undo.is_some(); - let redo_on = redo.is_some(); + let state = avail(s); let undo_label: Text = undo.unwrap_or_else(|| t(k::FILES_MORE_UNDO_PLAIN, lang)); let redo_label: Text = redo.unwrap_or_else(|| t(k::FILES_MORE_REDO, lang)); + let accent_why = (!s.shared.dock.borrow().running()).then_some(Why::NoDock); vec![ - menu::row(s, Cmd::Undo as u32, undo_label, None, Some(Cmd::Undo), None, undo_on, false), - menu::row(s, Cmd::Redo as u32, redo_label, None, Some(Cmd::Redo), None, redo_on, false), + item(s, Cmd::Undo as u32, undo_label, Some(Glyph::CmdUndo), Some(Cmd::Undo), None, state.undo), + item(s, Cmd::Redo as u32, redo_label, Some(Glyph::CmdRedo), Some(Cmd::Redo), None, state.redo), MenuItem::Separator, MenuItem::Command(CommandId(Cmd::SelectAll as u32)), MenuItem::Command(CommandId(Cmd::SelectNone as u32)), MenuItem::Command(CommandId(Cmd::Invert as u32)), MenuItem::Separator, + MenuItem::Command(CommandId(Cmd::CopyPath as u32)), + MenuItem::Command(CommandId(Cmd::Properties as u32)), MenuItem::Command(CommandId(Cmd::OpenInExplorer as u32)), + MenuItem::Separator, + item(s, pick::ACCENT, t(k::FILES_MORE_ACCENT, lang), Some(Glyph::CmdAccent), None, None, accent_why), + MenuItem::Separator, MenuItem::Command(CommandId(Cmd::About as u32)), ] } -pub fn open_new(s: &mut FilesScreen, cx: &mut EventCx, at: Anchor) -> Reply { +/// The menu of the New button, open; its id says when it closes. +pub fn show_new(s: &mut FilesScreen, cx: &mut EventCx, at: Anchor) -> MenuId { let items = new_items(s); - cx.open_menu(items, at); + cx.open_menu(items, at) +} + +pub fn show_sort(s: &mut FilesScreen, cx: &mut EventCx, at: Anchor) -> MenuId { + let items = sort_items(s); + cx.open_menu(items, at) +} + +pub fn show_view(s: &mut FilesScreen, cx: &mut EventCx, at: Anchor) -> MenuId { + let items = toolbar_view_items(s); + cx.open_menu(items, at) +} + +/// The Filter menu: the families, each checkable, then Show all. +pub fn filter_items(s: &FilesScreen) -> Vec { + let lang = s.shared.lang.get(); + let on = s.tabs.active().search.families; + let mut items: Vec = NameFamily::ALL + .into_iter() + .enumerate() + .map(|(i, f)| { + menu::row( + s, + filter_pick::BASE + i as u32, + family_name(f, lang), + None, + None, + Some(on.contains(f)), + true, + false, + ) + }) + .collect(); + items.push(MenuItem::Separator); + items.push(menu::row( + s, + filter_pick::SHOW_ALL, + t(k::FILES_FILTER_SHOW_ALL, lang), + None, + None, + None, + !on.is_empty(), + false, + )); + items +} + +/// A family as the menu and the status line name it. +pub fn family_name(f: NameFamily, lang: UiLang) -> Text { + t( + match f { + NameFamily::Folders => k::FILES_FILTER_FOLDERS, + NameFamily::Documents => k::FILES_FILTER_DOCUMENTS, + NameFamily::Sheets => k::FILES_FILTER_SHEETS, + NameFamily::Images => k::FILES_FILTER_IMAGES, + NameFamily::Audio => k::FILES_FILTER_AUDIO, + NameFamily::Video => k::FILES_FILTER_VIDEO, + NameFamily::Archives => k::FILES_FILTER_ARCHIVES, + NameFamily::Programs => k::FILES_FILTER_PROGRAMS, + NameFamily::Other => k::FILES_FILTER_OTHER, + }, + lang, + ) +} + +pub fn show_filter(s: &mut FilesScreen, cx: &mut EventCx, at: Anchor) -> MenuId { + let items = filter_items(s); + cx.open_menu(items, at) +} + +pub fn open_new(s: &mut FilesScreen, cx: &mut EventCx, at: Anchor) -> Reply { + show_new(s, cx, at); Reply::Redraw } pub fn open_sort(s: &mut FilesScreen, cx: &mut EventCx, at: Anchor) -> Reply { - let items = sort_items(s); - cx.open_menu(items, at); + show_sort(s, cx, at); Reply::Redraw } pub fn open_view(s: &mut FilesScreen, cx: &mut EventCx, at: Anchor) -> Reply { - let items = toolbar_view_items(s); - cx.open_menu(items, at); + show_view(s, cx, at); Reply::Redraw } +/// More, with the buttons the bar folded at its top. pub fn open_more(s: &mut FilesScreen, cx: &mut EventCx, at: Anchor) -> Reply { - let items = more_items(s); + let items = crate::toolbar::more_menu(s); cx.open_menu(items, at); Reply::Redraw } @@ -179,8 +461,22 @@ pub fn open_more(s: &mut FilesScreen, cx: &mut EventCx, at: Anchor) -> Reply { pub fn on_pick(s: &mut FilesScreen, cx: &mut EventCx, id: CommandId) -> Reply { let now = s.tabs.active().sort; match id.0 { + pick::ACCENT => { + if !s.shared.dock.borrow().open_appearance() { + oled_sys::log!("files: the dock did not take the Appearance request"); + } + Reply::None + } pick::SORT_ASC => view::details::sort(s, cx, ColId(now.0 as u16), SortDir::Asc), pick::SORT_DESC => view::details::sort(s, cx, ColId(now.0 as u16), SortDir::Desc), + filter_pick::SHOW_ALL => { + crate::tab::show_all_families(s, cx); + Reply::Relayout + } + n if (filter_pick::BASE..filter_pick::BASE + NameFamily::ALL.len() as u32).contains(&n) => { + crate::tab::toggle_family(s, cx, NameFamily::ALL[(n - filter_pick::BASE) as usize]); + Reply::Relayout + } n => match menu::col_of(n) { Some(col) => view::details::sort(s, cx, col, now.1), None => match n { @@ -235,6 +531,7 @@ pub fn apply_view(s: &mut FilesScreen, cx: &mut EventCx) { m.listing_mut().set_visibility(vis); tab.table.set_row_height(cx, o.compact.then_some(dense)); tab.table.model_changed(cx, true); + tab.search.serial += 1; } status::selection_changed(s, cx); } diff --git a/apps/files/src/undo.rs b/apps/files/src/undo.rs index 7201d2aa..d50a988b 100644 --- a/apps/files/src/undo.rs +++ b/apps/files/src/undo.rs @@ -1,4 +1,4 @@ -//! Undo and redo (P3-files-app 2.2, F3.3): one stack per process in Shared, shared by every window. An entry is pushed +//! Undo and redo: one stack per process in Shared, shared by every window. An entry is pushed //! when the helper sends the undo record of an operation this process asked for; Ctrl+Z sends it back through the //! gate (or hands the Recycle Bin to File Explorer); a successful undo goes on the redo stack, and a new operation //! clears it. @@ -45,9 +45,10 @@ impl UndoStack { Some(tf(k::FILES_MORE_UNDO, lang, &[("op", &verb(e.kind, lang))])) } - /// "Redo" while something can be done again. + /// "Redo Rename", "Redo New folder", "Redo Delete" for the newest entry that can be done again. pub fn redo_label(&self, lang: UiLang) -> Option { - (!self.redo.is_empty()).then(|| t(k::FILES_MORE_REDO, lang)) + let e = self.redo.last()?; + Some(tf(k::FILES_MORE_REDO_OP, lang, &[("op", &verb(e.kind, lang))])) } /// A new entry; past the cap the oldest goes. @@ -101,6 +102,8 @@ pub fn verb(kind: OpKind, lang: UiLang) -> Text { match kind { OpKind::Rename => t(k::FILES_MENU_RENAME, lang), OpKind::NewFolder => t(k::FILES_MENU_NEW_FOLDER, lang), + OpKind::Copy => t(k::FILES_CMD_COPY, lang), + OpKind::Move => t(k::FILES_CMD_MOVE, lang), _ => lang.kit(oled_ui::strings::k::KIT_VERB_DELETE), } } diff --git a/apps/files/src/view/states.rs b/apps/files/src/view/states.rs index ed220c46..3b094309 100644 --- a/apps/files/src/view/states.rs +++ b/apps/files/src/view/states.rs @@ -1,57 +1,78 @@ -//! The page states over the list (P3-files-app 2.2; FA-WIN, F1a.9): empty, denied, offline, connecting and the rest, -//! with their banner buttons. +//! The page states over the list (P3-files-app 2.2; FA-WIN, F1a.9; 6.5.10): empty, denied, offline, loading, nothing +//! found and the rest, each a centred block at a third of the list's height: a glyph, a title, a hint and the buttons +//! of the state. use oled_trust::frame::files::Location; -use oled_ui::model::FgRole; +use oled_ui::model::{FgRole, ListModel}; use oled_ui::node::Text; use oled_ui::theme::TypeRole; -use oled_ui::widgets::{Button, ButtonKind, ButtonOut, TextLabel}; +use oled_ui::widgets::{Button, ButtonKind, ButtonOut, Progress, TextLabel}; use oled_ui::{Event, EventCx, Glyph, LayoutCx, PaintCx, RectP, Reply, Widget, WidgetId}; use crate::keys::Cmd; use crate::nav::Page; -use crate::open; use crate::tr::{k, t, tf}; use crate::window::{self, FilesScreen}; +use crate::{open, tab}; const ID_TEXT: WidgetId = WidgetId(40); const ID_HINT: WidgetId = WidgetId(41); -const ID_BANNER_TEXT: WidgetId = WidgetId(42); -/// The banner's two buttons, left to right (tests walk the focus to them). +const ID_LOADING: WidgetId = WidgetId(45); +const ID_SWEEP: WidgetId = WidgetId(46); +/// The state's two buttons, left to right (tests walk the focus to them). pub const ID_FIRST: WidgetId = WidgetId(43); pub const ID_SECOND: WidgetId = WidgetId(44); /// Logical px. -const BANNER_H: i32 = 36; -const BANNER_MARGIN: i32 = 12; -const BTN_H: i32 = 28; +const GLYPH: i32 = 32; +const BTN_H: i32 = 32; const GAP: i32 = 8; -const LOCK: i32 = 16; -/// Where the message sits, as a share of the list's height (percent). -const TEXT_AT: i32 = 40; +const AFTER_GLYPH: i32 = 12; +const AFTER_TITLE: i32 = 4; +const BEFORE_BUTTONS: i32 = 16; +/// The block's centre, as a share of the list's height (percent). +const BLOCK_AT: i32 = 33; +/// The sweep under the header. +const SWEEP_H: i32 = 2; -/// What a banner button does. +/// What a button of a state does. #[derive(Clone, Copy, Debug, PartialEq, Eq)] enum Act { OpenInExplorer, Back, Retry, + /// The search (or, with no text, the families) is cleared. + ClearSearch, } /// Which state the last layout built: a change of it needs a new layout. #[derive(Clone, Copy, Debug, PartialEq, Eq)] enum Shown { Nothing, - Message, - Denied, - Offline, + Block, + Loading, +} + +/// A state's glyph, title, hint and buttons. +type Block = (Option, Text, Option, Vec<(Text, Act, ButtonKind)>); + +/// A narrowed list with no row left: the text searched for, and whether families are on. +#[derive(Clone, Debug, PartialEq, Eq)] +struct NoMatch { + query: String, + families: bool, } fn shown_of(p: &Page) -> Shown { match p { - Page::Empty | Page::StillLoading | Page::TooLong | Page::Unsupported | Page::Connecting => Shown::Message, - Page::Denied => Shown::Denied, - Page::Offline => Shown::Offline, + Page::Empty + | Page::StillLoading + | Page::TooLong + | Page::Unsupported + | Page::Connecting + | Page::Denied + | Page::Offline => Shown::Block, + Page::Busy => Shown::Loading, _ => Shown::Nothing, } } @@ -60,11 +81,16 @@ fn shown_of(p: &Page) -> Shown { pub struct States { shown: Shown, page: Page, + no_match: Option, + glyph: Option, + glyph_r: RectP, text: TextLabel, hint: Option, - banner: RectP, - lock: RectP, buttons: Vec<(Button, Act)>, + sweep: Progress, + /// The sweep was started (it needs an EventCx to run). + sweeping: bool, + sweep_r: RectP, } impl std::fmt::Debug for States { @@ -84,18 +110,44 @@ impl States { States { shown: Shown::Nothing, page: Page::Home, - text: TextLabel::new(ID_TEXT, Text::Borrowed(""), TypeRole::Body, FgRole::Tertiary), + no_match: None, + glyph: None, + glyph_r: RectP::EMPTY, + text: TextLabel::new(ID_TEXT, Text::Borrowed(""), TypeRole::BodyStrong, FgRole::Primary), hint: None, - banner: RectP::EMPTY, - lock: RectP::EMPTY, buttons: Vec::new(), + sweep: Progress::new(ID_SWEEP).with_value(None, true), + sweeping: false, + sweep_r: RectP::EMPTY, } } + + /// For the tests: the glyph of the state shown, and the label of each of its buttons. + pub fn glyph(&self) -> Option { + self.glyph + } + + /// For the tests: whether a narrowed list with no row shows its state. + pub fn shows_no_match(&self) -> bool { + self.no_match.is_some() + } } -/// True when the page changed since the last layout, so the state must be laid out again. +/// A narrowed list with no row left shows its state once the folder has been read to its end. +fn no_match_of(s: &FilesScreen) -> Option { + let t = s.tabs.active(); + if *t.nav.page() != Page::Listing || !t.search.is_on() { + return None; + } + let m = t.table.model(); + (ListModel::len(m) == 0 && m.listing().done()) + .then(|| NoMatch { query: t.search.applied.query.to_string(), families: !t.search.applied.families.is_empty() }) +} + +/// True when the page or the nothing-found state changed since the last layout, so the state must be laid out +/// again. pub fn refresh(s: &FilesScreen) -> bool { - s.states.page != *s.tabs.active().nav.page() + s.states.page != *s.tabs.active().nav.page() || s.states.no_match != no_match_of(s) } /// The Home page shows no page state: what a folder left behind goes, and the page it records is Home. @@ -103,14 +155,18 @@ pub fn on_home(s: &mut FilesScreen) { let me = &mut s.states; me.page = Page::Home; me.shown = Shown::Nothing; + me.no_match = None; + me.glyph = None; me.hint = None; me.buttons.clear(); } -fn path_of(l: &Location) -> String { - match l { - Location::Fs(p) => p.to_string_lossy(), - _ => String::new(), +/// Starts the loading sweep once (it needs an EventCx), stops it when the state goes. +pub fn drive_sweep(s: &mut FilesScreen, cx: &mut EventCx) { + let want = s.states.shown == Shown::Loading; + if want != s.states.sweeping { + s.states.sweeping = want; + s.states.sweep.set(cx, None, want); } } @@ -118,96 +174,133 @@ fn path_of(l: &Location) -> String { pub fn layout(s: &mut FilesScreen, cx: &mut LayoutCx, body: RectP) { let lang = s.shared.lang.get(); let page = s.tabs.active().nav.page().clone(); - let path = path_of(s.tabs.active().nav.location()); + let no_match = no_match_of(s); let top = s.tabs.active().table.viewport().t.max(body.t); + let path = match s.tabs.active().nav.location() { + Location::Fs(p) => p.to_string_lossy(), + _ => String::new(), + }; let sc = cx.scale(); let me = &mut s.states; me.page = page.clone(); - me.shown = shown_of(&page); + me.shown = if no_match.is_some() { Shown::Block } else { shown_of(&page) }; me.hint = None; me.buttons.clear(); + me.glyph = None; + me.glyph_r = RectP::EMPTY; + me.sweep_r = RectP::EMPTY; + // The block's centre is a third of the way down the list. + let centre = top + (body.b - top) * BLOCK_AT / 100; let shown = me.shown; match shown { Shown::Nothing => {} - Shown::Message => { - let text = match page { - Page::Empty => t(k::FILES_STATE_EMPTY, lang), - Page::StillLoading => t(k::FILES_STATE_STILL_LOADING, lang), - Page::TooLong => t(k::FILES_STATE_TOO_LONG, lang), - Page::Unsupported => t(k::FILES_STATE_UNSUPPORTED, lang), - _ => tf(k::FILES_STATE_CONNECTING, lang, &[("path", &path)]), - }; - let y = top + (body.b - top) * TEXT_AT / 100; - me.text = TextLabel::new(ID_TEXT, text, TypeRole::Body, FgRole::Tertiary); + Shown::Loading => { let line = sc.px(TypeRole::Body.spec().line); + me.text = TextLabel::new(ID_LOADING, t(k::FILES_STATE_LOADING, lang), TypeRole::Body, FgRole::Tertiary); let w = me.text.preferred(cx).w.min(body.w()); let x = body.l + (body.w() - w) / 2; - me.text.layout(cx, RectP { l: x, t: y, r: x + w, b: y + line }); - if page == Page::Empty { - let mut hint = - TextLabel::new(ID_HINT, t(k::FILES_STATE_EMPTY_HINT, lang), TypeRole::Caption, FgRole::Tertiary); - let hw = hint.preferred(cx).w.min(body.w()); - let hx = body.l + (body.w() - hw) / 2; - let hy = y + line + sc.px(4); - hint.layout(cx, RectP { l: hx, t: hy, r: hx + hw, b: hy + sc.px(TypeRole::Caption.spec().line) }); - me.hint = Some(hint); - } + me.text.layout(cx, RectP { l: x, t: centre - line / 2, r: x + w, b: centre - line / 2 + line }); + me.sweep_r = RectP { l: body.l, t: top, r: body.r, b: top + sc.px(SWEEP_H) }; + me.sweep.layout(cx, me.sweep_r); } - Shown::Denied | Shown::Offline => { - let (text, acts): (Text, [(Text, Act); 2]) = if shown == Shown::Denied { - ( + Shown::Block => { + let (glyph, title, hint, acts): Block = match (&no_match, &page) { + (Some(m), _) if !m.query.is_empty() => ( + Some(Glyph::NavSearch), + tf(k::FILES_SEARCH_NO_MATCH, lang, &[("query", &m.query)]), + None, + vec![(t(k::FILES_SEARCH_CLEAR, lang), Act::ClearSearch, ButtonKind::Dialog)], + ), + (Some(_), _) => ( + Some(Glyph::NavSearch), + t(k::FILES_FILTER_NO_MATCH, lang), + None, + vec![(t(k::FILES_FILTER_SHOW_ALL, lang), Act::ClearSearch, ButtonKind::Dialog)], + ), + (None, Page::Empty) => ( + Some(Glyph::LineFolder), + t(k::FILES_STATE_EMPTY, lang), + Some(t(k::FILES_STATE_EMPTY_HINT, lang)), + Vec::new(), + ), + (None, Page::Denied) => ( + Some(Glyph::LineLock), t(k::FILES_STATE_DENIED, lang), - [ - (t(k::FILES_ACTION_OPEN_EXPLORER, lang), Act::OpenInExplorer), - (t(k::FILES_ACTION_BACK, lang), Act::Back), - ], - ) - } else { - ( - tf(k::FILES_STATE_OFFLINE, lang, &[("path", &path)]), - [ - (t(k::FILES_ACTION_RETRY, lang), Act::Retry), - (t(k::FILES_ACTION_OPEN_EXPLORER, lang), Act::OpenInExplorer), + None, + vec![ + (t(k::FILES_ACTION_OPEN_EXPLORER, lang), Act::OpenInExplorer, ButtonKind::Dialog), + (t(k::FILES_ACTION_BACK, lang), Act::Back, ButtonKind::Dialog), ], - ) + ), + (None, Page::Offline) => ( + Some(Glyph::Disk), + t(k::FILES_STATE_OFFLINE, lang), + None, + vec![(t(k::FILES_STATE_RETRY, lang), Act::Retry, ButtonKind::Primary)], + ), + (None, Page::StillLoading) => { + (Some(Glyph::Clock), t(k::FILES_STATE_STILL_LOADING, lang), None, Vec::new()) + } + (None, Page::TooLong) => (Some(Glyph::LineInfo), t(k::FILES_STATE_TOO_LONG, lang), None, Vec::new()), + (None, Page::Unsupported) => { + (Some(Glyph::LineInfo), t(k::FILES_STATE_UNSUPPORTED, lang), None, Vec::new()) + } + (None, _) => { + (Some(Glyph::Globe), tf(k::FILES_STATE_CONNECTING, lang, &[("path", &path)]), None, Vec::new()) + } }; - let m = sc.px(BANNER_MARGIN); - let h = sc.px(BANNER_H); - let banner = - RectP { l: body.l + m, t: top + sc.px(8), r: (body.r - m).max(body.l + m), b: top + sc.px(8) + h }; - me.banner = banner; - let pad = sc.px(8); - let mut right = banner.r - pad; - let bh = sc.px(BTN_H).min(h); - let by = banner.t + (h - bh) / 2; - let mut buttons = Vec::new(); - for (i, (label, act)) in acts.into_iter().enumerate().rev() { - let id = if i == 0 { ID_FIRST } else { ID_SECOND }; - let mut b = Button::new(id, label, ButtonKind::Secondary); - let w = b.preferred(cx).w; - b.layout(cx, RectP { l: right - w, t: by, r: right, b: by + bh }); - right -= w + sc.px(GAP); - buttons.push((b, act)); + let (g, line, cap) = + (sc.px(GLYPH), sc.px(TypeRole::BodyStrong.spec().line), sc.px(TypeRole::Caption.spec().line)); + let bh = sc.px(BTN_H); + let mut height = line; + if glyph.is_some() { + height += g + sc.px(AFTER_GLYPH); } - buttons.reverse(); - me.buttons = buttons; - let mut left = banner.l + pad; - if shown == Shown::Denied { - let g = sc.px(LOCK); - me.lock = RectP { l: left, t: banner.t + (h - g) / 2, r: left + g, b: banner.t + (h - g) / 2 + g }; - left += g + sc.px(GAP); - } else { - me.lock = RectP::EMPTY; + if hint.is_some() { + height += sc.px(AFTER_TITLE) + cap; + } + if !acts.is_empty() { + height += sc.px(BEFORE_BUTTONS) + bh; + } + let mut y = (centre - height / 2).max(body.t + sc.px(8)); + let mid = body.l + body.w() / 2; + if let Some(gl) = glyph { + me.glyph = Some(gl); + me.glyph_r = RectP::wh(mid - g / 2, y, g, g); + y += g + sc.px(AFTER_GLYPH); + } + me.text = TextLabel::new(ID_TEXT, title, TypeRole::BodyStrong, FgRole::Primary); + let w = me.text.preferred(cx).w.min(body.w()); + me.text.layout(cx, RectP { l: mid - w / 2, t: y, r: mid - w / 2 + w, b: y + line }); + y += line; + if let Some(h) = hint { + y += sc.px(AFTER_TITLE); + let mut label = TextLabel::new(ID_HINT, h, TypeRole::Caption, FgRole::Secondary); + let hw = label.preferred(cx).w.min(body.w()); + label.layout(cx, RectP { l: mid - hw / 2, t: y, r: mid - hw / 2 + hw, b: y + cap }); + me.hint = Some(label); + y += cap; + } + if !acts.is_empty() { + y += sc.px(BEFORE_BUTTONS); + let mut built: Vec<(Button, Act, i32)> = Vec::new(); + for (i, (label, act, kind)) in acts.into_iter().enumerate() { + let id = if i == 0 { ID_FIRST } else { ID_SECOND }; + let mut b = Button::new(id, label, kind); + let w = b.preferred(cx).w; + built.push((b, act, w)); + } + let total: i32 = built.iter().map(|b| b.2).sum::() + sc.px(GAP) * (built.len() as i32 - 1); + let mut x = mid - total / 2; + for (mut b, act, w) in built { + b.layout(cx, RectP { l: x, t: y, r: x + w, b: y + bh }); + x += w + sc.px(GAP); + me.buttons.push((b, act)); + } } - let line = sc.px(TypeRole::Body.spec().line); - me.text = TextLabel::new(ID_BANNER_TEXT, text, TypeRole::Body, FgRole::Primary); - let w = me.text.preferred(cx).w.min((right - left).max(0)); - me.text.layout( - cx, - RectP { l: left, t: banner.t + (h - line) / 2, r: left + w, b: banner.t + (h - line) / 2 + line }, - ); } } + me.no_match = no_match; } /// The state over the (empty) list. @@ -216,20 +309,19 @@ pub fn paint_state(s: &FilesScreen, page: &Page, r: RectP, cx: &mut PaintCx) { let me = &s.states; match me.shown { Shown::Nothing => {} - Shown::Message => { + Shown::Loading => { + me.sweep.paint(cx); me.text.paint(cx); - if let Some(h) = &me.hint { - h.paint(cx); - } } - Shown::Denied | Shown::Offline => { - let (radius, fill) = (cx.px(cx.tokens().radius.s), cx.tokens().color.fill_control); - cx.fill(me.banner, radius, fill); - if me.shown == Shown::Denied { - let ink = cx.tokens().color.fg_secondary; - cx.glyph(me.lock, Glyph::Lock, ink); + Shown::Block => { + if let Some(g) = me.glyph { + let ink = cx.tokens().color.fg_tertiary; + cx.glyph(me.glyph_r, g, ink); } me.text.paint(cx); + if let Some(h) = &me.hint { + h.paint(cx); + } for (b, _) in &me.buttons { b.paint(cx); } @@ -237,7 +329,8 @@ pub fn paint_state(s: &FilesScreen, page: &Page, r: RectP, cx: &mut PaintCx) { } } -/// The banners' buttons: Retry navigates again, Back goes back, Open in File Explorer hands the folder off. +/// The state's buttons: Retry navigates again, Back goes back, Open in File Explorer hands the folder off, Clear +/// takes the search (or the families) away. pub fn state_event(s: &mut FilesScreen, cx: &mut EventCx, ev: &Event) -> Option { let mut hit = None; for (b, act) in s.states.buttons.iter_mut() { @@ -250,5 +343,13 @@ pub fn state_event(s: &mut FilesScreen, cx: &mut EventCx, ev: &Event) -> Option< Act::Retry => window::cmd(s, cx, Cmd::Refresh), Act::Back => window::cmd(s, cx, Cmd::Back), Act::OpenInExplorer => open::hand_off_current(s, cx), + Act::ClearSearch => { + if s.tabs.active().search.text.is_empty() { + tab::show_all_families(s, cx); + } else { + tab::clear_search(s, cx); + } + Reply::Relayout + } }) } diff --git a/apps/files/src/window.rs b/apps/files/src/window.rs index 1c4534df..de6563c5 100644 --- a/apps/files/src/window.rs +++ b/apps/files/src/window.rs @@ -22,9 +22,11 @@ use windows::Win32::System::Threading::{CreateEventW, SetEvent}; use crate::drives::DriveCache; use crate::format::Fmt; use crate::hub::Hub; +use crate::icons::ArtBook; use crate::keys::{self, Cmd}; -use crate::listing::{CancelToken, EnumJob, Gen, TabId, WidePath}; -use crate::model::{key_of, ColKind, IconKey, Listing}; +use crate::knownfolders::KnownFolders; +use crate::listing::{CancelToken, EnumJob, Gen, TabId, ViewFilter, WidePath}; +use crate::model::{key_of, ColKind, Listing}; use crate::msg::{Fwd, JobDone, Msg}; use crate::nav::{BatchVerdict, NavEffect, NavTimer, Page}; use crate::navcache::NavCache; @@ -38,8 +40,8 @@ use crate::types::TypeNames; use crate::undo::UndoStack; use crate::watch::WatchId; use crate::{ - bar, chrome, complete, drives, home, icons, instance, linger, live, menu, names, notices, open, ops_ui, opswin, - pathline, pins, rename, sidebar, status, tab, toolbar, toolmenus, types, view, + bar, chrome, clip_files, complete, details_pane, drives, home, icons, instance, linger, live, menu, names, notices, + open, ops_ui, opswin, pathline, pins, rename, sidebar, status, tab, toolbar, toolmenus, types, view, }; /// The start-up window's first tab: app.rs enumerates for it before Shared exists (F1a.10 step 5). @@ -79,17 +81,27 @@ pub struct Shared { /// The shell host's warm-up has begun (the prespawn timer or a right button down): per-item icons wait for it, so /// the host never starts before 500 ms after the first frame. pub host_warm: Cell, + /// The known folders and the system drive, for the art of folders and drive roots: session.json's copy until the + /// start's read arrives (JobDone::KnownFolders), so the first frame already knows them. + pub known: RefCell>, /// A screen cannot open, show or move a window itself (no LoopCx in EventCx): it pushes a request here. pub loop_requests: RefCell>, pub loop_event: OwnedEvent, /// The process's private bytes now (memory check, 4.1). Reads 0 until app.rs installs private_bytes; a test /// installs a script. pub memory: RefCell u64>>, + /// The dock, as the command bar's accent item sees it (a test or a scene installs its own). + pub dock: RefCell>, + /// The clipboard commands' switch, gate::PASTE_LIVE; only a test or a scene of the commands themselves changes it. + pub paste_live: Cell, + /// What this process cut, for every window's rows. + pub clip: RefCell, } impl Shared { pub fn new(hub: Arc, services: Services, lang: UiLang, session: Session, types: TypeNames) -> Rc { let opts = services.options.get(); + let known = KnownFolders::from_session(&session.known, crate::knownfolders::system_drive()); Rc::new(Shared { hub, fmt: RefCell::new(Rc::new(Fmt::system(lang))), @@ -111,9 +123,13 @@ impl Shared { next_req: Cell::new(1), first_frame_done: Cell::new(false), host_warm: Cell::new(false), + known: RefCell::new(Rc::new(known)), loop_requests: RefCell::new(Vec::new()), loop_event: OwnedEvent::new(), memory: RefCell::new(Box::new(|| 0)), + dock: RefCell::new(Rc::new(toolmenus::RealDock)), + paste_live: Cell::new(crate::gate::PASTE_LIVE), + clip: RefCell::new(clip_files::ClipState::default()), services, }) } @@ -374,6 +390,7 @@ pub enum Region { Path, Sidebar, List, + Pane, Status, } @@ -418,6 +435,8 @@ pub struct FilesScreen { pub(crate) side: sidebar::Sidebar, pub(crate) home: home::Home, pub(crate) status: status::Status, + /// The details pane at the right of the list. + pub(crate) pane: details_pane::Pane, pub(crate) states: view::states::States, pub(crate) bar: bar::RecycleBar, pub(crate) flyout: ops_ui::Flyout, @@ -457,6 +476,10 @@ pub struct FilesScreen { pub(crate) held: crate::handoff::Held, /// The About dialog over the window (F4.15). pub(crate) about: crate::about::About, + /// This window's art, for its scale and high-contrast state (icons::sync_art replaces it when either changes). + pub(crate) art: Rc, + /// What this window last saw of the clipboard (Paste's state) and of the process's cut. + pub(crate) clip: clip_files::Seen, } impl FilesScreen { @@ -546,6 +569,7 @@ impl FilesScreen { side: sidebar::Sidebar::new(), home: home::Home::new(), status: status::Status::new(), + pane: details_pane::Pane::new(), states: view::states::States::new(), bar: bar::RecycleBar::new(), flyout: ops_ui::Flyout::new(), @@ -575,6 +599,8 @@ impl FilesScreen { linger: linger::Linger::default(), held: crate::handoff::Held::default(), about: crate::about::About::default(), + art: Rc::new(ArtBook::empty()), + clip: clip_files::Seen::default(), } } @@ -582,10 +608,28 @@ impl FilesScreen { &self.shared } + /// The window's art (icons::sync_art keeps it in step with the scale and high contrast). + pub fn art(&self) -> &Rc { + &self.art + } + pub fn win(&self) -> u32 { self.win } + /// The status line (tests read where it put its parts). + pub fn status(&self) -> &status::Status { + &self.status + } + + pub fn pane(&self) -> &details_pane::Pane { + &self.pane + } + + pub fn pane_mut(&mut self) -> &mut details_pane::Pane { + &mut self.pane + } + pub fn tabs(&self) -> &Tabs { &self.tabs } @@ -601,6 +645,18 @@ impl FilesScreen { &mut self.tabs } + pub fn states(&self) -> &view::states::States { + &self.states + } + + pub fn toolbar(&self) -> &toolbar::Toolbar { + &self.toolbar + } + + pub fn toolbar_mut(&mut self) -> &mut toolbar::Toolbar { + &mut self.toolbar + } + pub fn rects(&self) -> &Layout { &self.rects } @@ -657,12 +713,13 @@ impl FilesScreen { } } TableOut::ContextMenu(row, at) => menu::open_context(self, cx, row, at), - TableOut::RenameRequested(key) => rename::begin(self, cx, key), + TableOut::RenameRequested(key) => rename::ask(self, cx, key), TableOut::RenameCommitted(key, text) => rename::commit(self, cx, key, text), TableOut::RenameCancelled(key) => rename::cancel(self, cx, key), TableOut::SortRequested(col, dir) => view::details::sort(self, cx, col, dir), TableOut::SelectionChanged | TableOut::FocusChanged(_) => { status::selection_changed(self, cx); + cx.relayout(); Reply::Redraw } TableOut::ColumnsChanged => { @@ -691,6 +748,10 @@ impl FilesScreen { status::on_notice_timer(self, cx); Reply::None } + names::TIMER_SEARCH => { + tab::on_search_timer(self, cx, TabId(id.0 & 0x00FF_FFFF)); + Reply::Relayout + } _ => Reply::None, } } @@ -740,19 +801,25 @@ impl FilesScreen { Reply::None } JobDone::KnownFolders(list) => { - let mut s = self.shared.session.borrow_mut(); - for (name, path) in list { - s.known.insert(format!("{name:?}").to_ascii_lowercase(), path.to_string_lossy()); + { + let mut s = self.shared.session.borrow_mut(); + for (name, path) in &list { + s.known.insert(name.key().to_string(), path.to_string_lossy()); + } } - Reply::None - } - JobDone::StockFolderIcon(Some((px, bgra))) => { - for t in self.tabs.iter_mut() { - t.table.model_mut().set_icon(IconKey::Folder, px, Arc::clone(&bgra)); + let system = self.shared.known.borrow().system_drive(); + let fresh = KnownFolders::new(list, system); + if **self.shared.known.borrow() == fresh { + return Reply::None; } - Reply::Redraw + *self.shared.known.borrow_mut() = Rc::new(fresh); + // Every window's folders, tabs, sidebar and Home draw the art of the read: this one at its next layout, + // the others at their Bump. + for w in self.shared.main_windows().into_iter().filter(|w| *w != self.win) { + self.shared.hub.post_to(w, Msg::Fwd(Fwd::Bump)); + } + Reply::Relayout } - JobDone::StockFolderIcon(None) => Reply::None, } } @@ -814,6 +881,7 @@ impl FilesScreen { toolmenus::apply_view(self, cx); cx.relayout(); } + view::states::drive_sweep(self, cx); if self.first.lost.replace(false) { self.on_first_frame(cx); } @@ -843,14 +911,18 @@ pub(crate) fn bump_all(shared: &Shared) { impl Screen for FilesScreen { fn layout(&mut self, cx: &mut LayoutCx, avail: SizeP) -> SizeP { + icons::sync_art(self, cx.scale(), cx.tokens()); let client = RectP::wh(0, 0, avail.w, avail.h); let below = chrome::layout(self, cx, client); let (tb_h, st_h) = (cx.px(cx.tokens().size.toolbar_h), cx.px(cx.tokens().size.status_h)); let toolbar = RectP { b: (below.t + tb_h).min(below.b), ..below }; - let status_r = RectP { t: (below.b - st_h).max(toolbar.b), ..below }; - let middle = RectP { t: toolbar.b, b: status_r.t, ..below }; + let cmdbar = RectP { t: toolbar.b, b: (toolbar.b + tb_h).min(below.b), ..below }; + let status_r = RectP { t: (below.b - st_h).max(cmdbar.b), ..below }; + let middle = RectP { t: cmdbar.b, b: status_r.t, ..below }; toolbar::layout(self, cx, toolbar); + toolbar::layout_commands(self, cx, cmdbar); let body = sidebar::layout(self, cx, middle); + let body = details_pane::layout(self, cx, body, avail.w); let side = RectP { r: body.l, ..middle }; if self.page_is_home() { view::states::on_home(self); @@ -864,7 +936,8 @@ impl Screen for FilesScreen { bar::bar_layout(self, cx, rest); ops_ui::flyout_layout(self, cx, client); crate::about::layout(self, cx, client); - self.rects = Layout { client, chrome: RectP { b: below.t, ..client }, toolbar, side, body, status: status_r }; + self.rects = + Layout { client, chrome: RectP { b: below.t, ..client }, toolbar, cmdbar, side, body, status: status_r }; self.visible_due = true; avail } @@ -876,17 +949,22 @@ impl Screen for FilesScreen { let page = self.tabs.active().nav.page(); match page { Page::Home => home::home_paint(self, cx), - Page::Listing => view::details::paint(self, cx), + Page::Listing => { + view::details::paint(self, cx); + view::states::paint_state(self, page, self.rects.body, cx); + } other => { view::details::paint(self, cx); view::states::paint_state(self, other, self.rects.body, cx); } } + details_pane::paint(self, cx); status::paint(self, cx); bar::bar_paint(self, cx); ops_ui::chip_paint(self, cx); ops_ui::flyout_paint(self, cx); crate::about::paint(self, cx); + toolbar::paint_tip(self, cx); self.first_frame_check(cx); } @@ -914,8 +992,11 @@ impl FilesScreen { /// reply would not lay out again, it does. fn settle(&mut self, r: Reply, with_selection: bool) -> Reply { self.record_location(); + tab::follow_folders(self); let counted = status::refresh(self, with_selection); let paged = view::states::refresh(self); + let cut = clip_files::sync(self); + let counted = counted || toolbar::stale(self) || cut; if (counted || paged) && matches!(r, Reply::None | Reply::Redraw | Reply::Damage(_)) { return Reply::Relayout; } @@ -934,6 +1015,10 @@ impl FilesScreen { fn event_inner(&mut self, cx: &mut EventCx, ev: &Event) -> Reply { self.after_layout(cx); + // The clipboard is looked at when the window activates and on an input, before the bar lays out again. + if matches!(ev, Event::WindowActive(true) | Event::Key { down: true, .. } | Event::PointerDown { .. }) { + clip_files::look(self, cx); + } // First: the About dialog, the open flyout and bar take everything, then the rename field, then the banners' // buttons. if let Some(r) = crate::about::event(self, cx, ev) { @@ -966,7 +1051,11 @@ impl FilesScreen { None => menu::on_pick(self, cx, *id), }; } - Event::Text(c) if self.region == Region::List && pathline::type_into(self, cx, *c) => { + Event::Text(c) + if self.region == Region::List + && !toolbar::search_has_focus(self, cx) + && pathline::type_into(self, cx, *c) => + { return Reply::Redraw; } Event::WindowActive(true) => { @@ -1002,6 +1091,9 @@ impl FilesScreen { if let Some(r) = sidebar::event(self, cx, ev) { return r; } + if let Some(r) = details_pane::event(self, cx, ev) { + return r; + } if let Some(r) = status::event(self, cx, ev) { return r; } @@ -1088,7 +1180,10 @@ pub struct Layout { /// The whole client area. pub client: RectP, pub chrome: RectP, + /// The address row. pub toolbar: RectP, + /// The command bar under it. + pub cmdbar: RectP, pub side: RectP, pub body: RectP, pub status: RectP, @@ -1169,6 +1264,9 @@ fn install(t: &mut tab::Tab, cx: &mut EventCx, c: crate::navcache::Cached) -> Bo t.kept = None; let (kind, dir) = c.sort; t.sort = (kind, dir); + let mut c = c; + c.listing.set_view_filter(ViewFilter::default()); + t.search.serial += 1; let old = t.table.model_mut().replace(c.listing); let cols = crate::view::details::columns_with_sort(t.table.columns(), kind, dir); t.table.set_columns(cx, cols); @@ -1368,11 +1466,19 @@ fn show_new(s: &mut FilesScreen, cx: Option<&mut EventCx>, tab: TabId) { if let Some(key) = crate::view::columns::sort_key(kind) { fresh.sort(key, crate::view::details::dir_of(dir)); } - let kept = (fresh.dir() == t.table.model().listing().dir()).then(|| kept_names(t)); + let same = fresh.dir() == t.table.model().listing().dir(); + let kept = same.then(|| kept_names(t)); if kept.is_none() { t.kept = None; } - let old = t.table.model_mut().replace(fresh); + // A refresh of the folder keeps the tab's search and families on the new listing; another folder starts whole. + if same && t.search.applied.is_active() { + fresh.set_view_filter(t.search.wanted()); + } + t.search.serial += 1; + let mut old = t.table.model_mut().replace(fresh); + // The cache holds whole listings: what the tab narrowed this one to is not part of the folder. + old.set_view_filter(ViewFilter::default()); if let Some((at, anchor, sort)) = left { crate::navcache::put(&s.shared, &at, crate::navcache::Cached { listing: old, anchor, sort }); } @@ -1691,6 +1797,10 @@ pub(crate) fn drop_listing(s: &mut FilesScreen, id: TabId) { let empty = toolmenus::listing(&s.shared, dir, Gen(0)); if let Some(t) = s.tabs.by_id_mut(id) { t.kept = Some(kept); + let mut empty = empty; + if t.search.applied.is_active() { + empty.set_view_filter(t.search.wanted()); + } t.table.model_mut().replace(empty); } } @@ -1790,9 +1900,15 @@ pub fn cmd(s: &mut FilesScreen, cx: &mut EventCx, c: Cmd) -> Reply { Reply::Redraw } Cmd::Escape => { + if toolbar::leave_search(s, cx) { + return Reply::Relayout; + } if status::on_escape(s, cx) { return Reply::Redraw; } + if clip_files::escape(s, cx) { + return Reply::Relayout; + } let t = s.tabs.active_mut(); if t.table.selection().is_empty() { return Reply::None; @@ -1804,16 +1920,24 @@ pub fn cmd(s: &mut FilesScreen, cx: &mut EventCx, c: Cmd) -> Reply { } } -/// Path -> Sidebar -> List, skipping the regions that are empty (F1a has the list only). +/// Address row -> Command bar -> Sidebar -> List -> Details pane, skipping the regions that are empty. fn cycle_region(s: &mut FilesScreen, cx: &mut EventCx, forward: bool) -> Reply { let mut order = Vec::new(); - // The path bar (a Path region) arrives with F1b. + if !s.rects.toolbar.is_empty() { + order.push(Region::Path); + } + if toolbar::command_node(s, toolmenus::btn::NEW).is_some() { + order.push(Region::Toolbar); + } if s.rects.side.w() > 0 { order.push(Region::Sidebar); } if !s.page_is_home() { order.push(Region::List); } + if s.pane.focus_node().is_some() { + order.push(Region::Pane); + } if order.is_empty() { return Reply::None; } @@ -1828,8 +1952,18 @@ fn cycle_region(s: &mut FilesScreen, cx: &mut EventCx, forward: bool) -> Reply { s.region = order[next]; if s.region == Region::List { cx.set_focus(oled_ui::NodeId::new(tab::TABLE_ID, 0)); + } else if s.region == Region::Toolbar { + if let Some(n) = toolbar::command_node(s, toolmenus::btn::NEW) { + cx.set_focus(n); + } } else if s.region == Region::Sidebar { sidebar::focus(s, cx); + } else if s.region == Region::Pane { + if let Some(n) = s.pane.focus_node() { + cx.set_focus(n); + } + } else if s.region == Region::Path { + pathline::cmd(s, cx, Cmd::EditPath); } Reply::Redraw } diff --git a/apps/files/strings/en.toml b/apps/files/strings/en.toml index e756a270..b2175e70 100644 --- a/apps/files/strings/en.toml +++ b/apps/files/strings/en.toml @@ -13,7 +13,7 @@ "files.col.modified" = "Date modified" "files.col.type" = "Type" "files.col.size" = "Size" -"files.col.created" = "Date created" +"files.col.created" = "Created" "files.col.attributes" = "Attributes" "files.col.status" = "Status" "files.col_status.online" = "Online-only" @@ -32,12 +32,13 @@ "files.status.selected_one" = "1 selected" "files.status.selected_other" = "{n} selected" "files.status.free" = "{size} free" +"files.status.free_of" = "{free} free of {total}" "files.status.live_limited" = "Live updates limited · F5 refreshes" "files.state.empty" = "This folder is empty" "files.state.empty_hint" = "Ctrl+Shift+N new folder" -"files.state.denied" = "You don't have permission to open this folder." +"files.state.denied" = "You don't have access to this folder" "files.state.connecting" = "Connecting to {path}…" -"files.state.offline" = "{path} isn't reachable" +"files.state.offline" = "The drive isn't reachable" "files.state.still_loading" = "Still loading…" "files.state.not_found" = "Can't find {path}" "files.state.gone" = "{name} was moved or deleted." @@ -60,12 +61,13 @@ "files.menu.open_with" = "Open with…" "files.menu.pin" = "Pin to Quick access" "files.menu.unpin" = "Unpin from Quick access" -"files.menu.copy_path" = "Copy as path" +"files.menu.copy_path" = "Copy path" "files.menu.properties" = "Properties" "files.menu.more" = "Show more options" "files.menu.rename" = "Rename" "files.menu.cant_undo" = "Can't be undone" "files.menu.new_folder" = "New folder" +"files.new.folder" = "Folder" "files.menu.host_down" = "Windows menu didn't respond" "files.menu.not_in_beta" = "Not available in this alpha: use File Explorer" "files.menu.new" = "New" @@ -75,12 +77,13 @@ "files.menu.refresh" = "Refresh" "files.view.hidden" = "Hidden items" "files.view.extensions" = "File name extensions" -"files.view.compact" = "Compact spacing" +"files.view.compact" = "Compact view" "files.sort.asc" = "Ascending" "files.sort.desc" = "Descending" "files.more.undo" = "Undo {op}" "files.more.undo_plain" = "Undo" "files.more.redo" = "Redo" +"files.more.redo_op" = "Redo {op}" "files.more.select_all" = "Select all" "files.more.select_none" = "Select none" "files.more.invert" = "Invert selection" @@ -119,6 +122,8 @@ "files.ops.details" = "Details ›" "files.ops.nonrecyclable_one" = "This item can't go to the Recycle Bin and will be deleted permanently" "files.ops.nonrecyclable_other" = "These {n} items can't go to the Recycle Bin and will be deleted permanently" +"files.ops.confirm_delete_one" = "Delete this item permanently? This can't be undone" +"files.ops.confirm_delete_other" = "Delete these {n} items permanently? This can't be undone" "files.ops.bar_delete" = "Delete (Enter)" "files.ops.bar_cancel" = "Cancel (Esc)" "files.ops.undo_replaced" = "Can't undo: {n} items replaced older files" @@ -133,17 +138,32 @@ "files.ops.rest_delete" = "Delete the rest" "files.ops.host_lost" = "The operations helper stopped." "files.ops.preview_gate" = "Changes are off in this preview build" +"files.ops.refused_place" = "{name} is protected: use File Explorer" +"files.ops.refused_place_plain" = "System folders and drive roots are protected: use File Explorer" +"files.ops.refused_rights" = "No rights to change {name}: use File Explorer" +"files.ops.refused_rights_plain" = "No rights for this change: use File Explorer" "files.ops.block_copy" = "Copying {n} items" "files.ops.block_move" = "Moving {n} items" "files.ops.block_delete" = "Deleting {n} items" -"files.side.pinned" = "Pinned" +"files.side.pinned" = "Quick access" "files.side.this_pc" = "This PC" "files.side.network" = "Network" -"files.side.network_arrow" = "Network ↗" "files.side.recycle_bin" = "Recycle Bin ↗" "files.side.reimport" = "Re-import from File Explorer" "files.side.drive" = "{label} ({letter}:)" "files.side.free_of" = "{free} free of {total}" +"files.side.home" = "Home" +"files.side.known_desktop" = "Desktop" +"files.side.known_downloads" = "Downloads" +"files.side.known_documents" = "Documents" +"files.side.known_pictures" = "Pictures" +"files.side.known_music" = "Music" +"files.side.known_videos" = "Videos" +"files.side.not_ready" = "Not ready" +"files.side.unpin_tip" = "Remove from Quick access" +"files.side.handoff_tip" = "Opens in File Explorer" +"files.side.network_hand" = "Network" +"files.side.recycle_hand" = "Recycle Bin" "files.home.drives" = "Drives" "files.home.network" = "Network locations" "files.home.phones" = "Phones and other devices ↗" @@ -166,3 +186,92 @@ "files.cmd.context_menu" = "Context menu" "files.cmd.escape" = "Cancel" "files.view.details" = "Details" + +"files.cmd.cut" = "Cut" +"files.cmd.copy" = "Copy" +"files.cmd.paste" = "Paste" +"files.cmd.cut_tip" = "Cut the selection" +"files.cmd.copy_tip" = "Copy the selection" +"files.cmd.paste_tip" = "Paste into the open folder" +"files.cmd.rename_tip" = "Rename the selected file" +"files.cmd.delete_tip" = "Move to the Recycle Bin, Ctrl+Z undoes" +"files.cmd.new_tip" = "Create a new item" +"files.cmd.sort_tip" = "Sort the list" +"files.cmd.view_tip" = "Change how the list looks" +"files.cmd.nothing_selected" = "Nothing selected" +"files.cmd.select_one" = "Select one item" +"files.cmd.nothing_to_undo" = "Nothing to undo" +"files.cmd.nothing_to_redo" = "Nothing to redo" +"files.cmd.no_folder" = "Open a folder first" +"files.more.accent" = "Accent colour…" +"files.more.accent_no_dock" = "The dock is not running" +"files.hint.open" = "Double-click to open" +"files.nav.no_back" = "No earlier folder" +"files.nav.no_forward" = "No later folder" +"files.nav.no_up" = "No folder above this one" + +# Search in the open folder, the Filter menu and the state pages (1.9). +"files.search.placeholder" = "Search in {name}" +"files.search.label" = "Search this folder" +"files.search.no_match" = "No item matches “{query}” in this folder" +"files.search.clear" = "Clear search" +"files.filter.no_match" = "No item matches the filter in this folder" +"files.state.loading" = "Loading…" +"files.state.retry" = "Retry" +"files.status.of" = "{n} of {total} items" +"files.status.of_one" = "{n} of {total} item" +"files.status.filtered" = "Filter: {families} · {n} of {total} items" +"files.status.filtered_one" = "Filter: {families} · {n} of {total} item" +"files.menu.filter" = "Filter" +"files.cmd.filter_tip" = "Show only some kinds of item" +"files.cmd.search" = "Search" +"files.filter.folders" = "Folders" +"files.filter.documents" = "Documents" +"files.filter.sheets" = "Sheets and presentations" +"files.filter.images" = "Images" +"files.filter.audio" = "Audio" +"files.filter.video" = "Video" +"files.filter.archives" = "Archives" +"files.filter.programs" = "Programs" +"files.filter.other" = "Other" +"files.filter.show_all" = "Show all" +"files.pane.name" = "Details pane" +"files.cmd.details" = "Details" +"files.cmd.details_tip" = "Show or hide the details pane" +"files.cmd.details_pane" = "Details pane" +"files.pane.type_folder" = "Folder" +"files.pane.size" = "Size" +"files.pane.modified" = "Last modified" +"files.pane.created" = "Created" +"files.pane.folder" = "Folder" +"files.pane.attributes" = "Attributes" +"files.pane.attr_none" = "None" +"files.pane.attr_hidden" = "Hidden" +"files.pane.attr_readonly" = "Read-only" +"files.pane.attr_system" = "System" +"files.pane.items" = "Items" +"files.pane.drive" = "Drive" +"files.pane.drive_free" = "{name}, {free} free" +"files.pane.selected" = "{n} items selected" +"files.pane.total_size" = "Total size" +"files.pane.plus_folder" = "{size}, plus 1 folder" +"files.pane.plus_folders" = "{size}, plus {n} folders" +"files.pane.types" = "Types" +"files.pane.types_more" = "{list} and {n} more" +"files.pane.open_with" = "Open with" +# Cut, Copy and Paste of files (1.9). +"files.cmd.clipboard_empty" = "The clipboard is empty" +"files.cmd.move" = "Move" +"files.ops.copying_one" = "Copying to {name}: 1 item" +"files.ops.copying_other" = "Copying to {name}: {n} items" +"files.ops.moving_one" = "Moving to {name}: 1 item" +"files.ops.moving_other" = "Moving to {name}: {n} items" +"files.ops.chip_paste" = "{what}, {p} %" +"files.ops.done_copied_one" = "Copied 1 item to {name}" +"files.ops.done_copied_other" = "Copied {n} items to {name}" +"files.ops.done_moved_one" = "Moved 1 item to {name}" +"files.ops.done_moved_other" = "Moved {n} items to {name}" +"files.clip.into_itself" = "Can't paste {name}: the destination is inside it" +"files.clip.twice" = "Can't paste: {name} is on the clipboard twice" +"files.clip.bad" = "These items can't be pasted here: use File Explorer" +"files.clip.busy" = "Another program is using the clipboard: try again" diff --git a/apps/files/strings/it.toml b/apps/files/strings/it.toml index 2ea8935d..0d15a6f7 100644 --- a/apps/files/strings/it.toml +++ b/apps/files/strings/it.toml @@ -13,7 +13,7 @@ "files.col.modified" = "Ultima modifica" "files.col.type" = "Tipo" "files.col.size" = "Dimensione" -"files.col.created" = "Data creazione" +"files.col.created" = "Creato" "files.col.attributes" = "Attributi" "files.col.status" = "Stato" "files.col_status.online" = "Solo online" @@ -32,12 +32,13 @@ "files.status.selected_one" = "1 selezionato" "files.status.selected_other" = "{n} selezionati" "files.status.free" = "{size} liberi" +"files.status.free_of" = "{free} liberi di {total}" "files.status.live_limited" = "Aggiornamenti in tempo reale limitati · F5 aggiorna" "files.state.empty" = "Questa cartella è vuota" "files.state.empty_hint" = "Ctrl+Maiusc+N nuova cartella" -"files.state.denied" = "Non hai l'autorizzazione per aprire questa cartella." +"files.state.denied" = "Non hai accesso a questa cartella" "files.state.connecting" = "Connessione a {path}…" -"files.state.offline" = "{path} non è raggiungibile" +"files.state.offline" = "L'unità non è raggiungibile" "files.state.still_loading" = "Caricamento ancora in corso…" "files.state.not_found" = "Impossibile trovare {path}" "files.state.gone" = "{name} è stato spostato o eliminato." @@ -60,12 +61,13 @@ "files.menu.open_with" = "Apri con…" "files.menu.pin" = "Aggiungi ad Accesso rapido" "files.menu.unpin" = "Rimuovi da Accesso rapido" -"files.menu.copy_path" = "Copia come percorso" +"files.menu.copy_path" = "Copia percorso" "files.menu.properties" = "Proprietà" "files.menu.more" = "Mostra altre opzioni" "files.menu.rename" = "Rinomina" "files.menu.cant_undo" = "Non si può annullare" "files.menu.new_folder" = "Nuova cartella" +"files.new.folder" = "Cartella" "files.menu.host_down" = "Il menu di Windows non ha risposto" "files.menu.not_in_beta" = "Non disponibile in questa alpha: usa Esplora file" "files.menu.new" = "Nuovo" @@ -74,13 +76,14 @@ "files.menu.more_actions" = "Altro" "files.menu.refresh" = "Aggiorna" "files.view.hidden" = "Elementi nascosti" -"files.view.extensions" = "Estensioni nomi file" -"files.view.compact" = "Spaziatura compatta" +"files.view.extensions" = "Estensioni dei nomi dei file" +"files.view.compact" = "Vista compatta" "files.sort.asc" = "Crescente" "files.sort.desc" = "Decrescente" "files.more.undo" = "Annulla {op}" "files.more.undo_plain" = "Annulla" "files.more.redo" = "Ripeti" +"files.more.redo_op" = "Ripeti {op}" "files.more.select_all" = "Seleziona tutto" "files.more.select_none" = "Deseleziona tutto" "files.more.invert" = "Inverti selezione" @@ -119,6 +122,8 @@ "files.ops.details" = "Dettagli ›" "files.ops.nonrecyclable_one" = "Questo elemento non può andare nel Cestino e verrà eliminato definitivamente" "files.ops.nonrecyclable_other" = "Questi {n} elementi non possono andare nel Cestino e verranno eliminati definitivamente" +"files.ops.confirm_delete_one" = "Eliminare definitivamente questo elemento? Non si potrà annullare" +"files.ops.confirm_delete_other" = "Eliminare definitivamente questi {n} elementi? Non si potrà annullare" "files.ops.bar_delete" = "Elimina (Invio)" "files.ops.bar_cancel" = "Annulla (Esc)" "files.ops.undo_replaced" = "Impossibile annullare: {n} elementi hanno sostituito file meno recenti" @@ -133,17 +138,32 @@ "files.ops.rest_delete" = "Elimina il resto" "files.ops.host_lost" = "L'assistente per le operazioni si è interrotto." "files.ops.preview_gate" = "Le modifiche sono disattivate in questa build di anteprima" +"files.ops.refused_place" = "{name} è protetto: usa Esplora file" +"files.ops.refused_place_plain" = "Le cartelle di sistema e le radici delle unità sono protette: usa Esplora file" +"files.ops.refused_rights" = "Nessun permesso per modificare {name}: usa Esplora file" +"files.ops.refused_rights_plain" = "Nessun permesso per questa modifica: usa Esplora file" "files.ops.block_copy" = "Copia di {n} elementi in corso" "files.ops.block_move" = "Spostamento di {n} elementi in corso" "files.ops.block_delete" = "Eliminazione di {n} elementi in corso" -"files.side.pinned" = "Aggiunti" +"files.side.pinned" = "Accesso rapido" "files.side.this_pc" = "Questo PC" "files.side.network" = "Rete" -"files.side.network_arrow" = "Rete ↗" "files.side.recycle_bin" = "Cestino ↗" "files.side.reimport" = "Importa di nuovo da Esplora file" "files.side.drive" = "{label} ({letter}:)" "files.side.free_of" = "{free} liberi su {total}" +"files.side.home" = "Home" +"files.side.known_desktop" = "Desktop" +"files.side.known_downloads" = "Download" +"files.side.known_documents" = "Documenti" +"files.side.known_pictures" = "Immagini" +"files.side.known_music" = "Musica" +"files.side.known_videos" = "Video" +"files.side.not_ready" = "Non pronta" +"files.side.unpin_tip" = "Togli da Accesso rapido" +"files.side.handoff_tip" = "Si apre in Esplora file" +"files.side.network_hand" = "Rete" +"files.side.recycle_hand" = "Cestino" "files.home.drives" = "Unità" "files.home.network" = "Percorsi di rete" "files.home.phones" = "Telefoni e altri dispositivi ↗" @@ -166,3 +186,92 @@ "files.cmd.context_menu" = "Menu di scelta rapida" "files.cmd.escape" = "Annulla" "files.view.details" = "Dettagli" + +"files.cmd.cut" = "Taglia" +"files.cmd.copy" = "Copia" +"files.cmd.paste" = "Incolla" +"files.cmd.cut_tip" = "Taglia la selezione" +"files.cmd.copy_tip" = "Copia la selezione" +"files.cmd.paste_tip" = "Incolla nella cartella aperta" +"files.cmd.rename_tip" = "Rinomina il file selezionato" +"files.cmd.delete_tip" = "Sposta nel Cestino, Ctrl+Z annulla" +"files.cmd.new_tip" = "Crea un nuovo elemento" +"files.cmd.sort_tip" = "Ordina l'elenco" +"files.cmd.view_tip" = "Cambia l'aspetto dell'elenco" +"files.cmd.nothing_selected" = "Niente di selezionato" +"files.cmd.select_one" = "Seleziona un solo elemento" +"files.cmd.nothing_to_undo" = "Niente da annullare" +"files.cmd.nothing_to_redo" = "Niente da ripetere" +"files.cmd.no_folder" = "Apri prima una cartella" +"files.more.accent" = "Colore d'accento…" +"files.more.accent_no_dock" = "La dock non è in esecuzione" +"files.hint.open" = "Doppio clic per aprire" +"files.nav.no_back" = "Nessuna cartella prima di questa" +"files.nav.no_forward" = "Nessuna cartella dopo questa" +"files.nav.no_up" = "Nessuna cartella sopra questa" + +# Ricerca nella cartella aperta, menu Filtra e pagine di stato (1.9). +"files.search.placeholder" = "Cerca in {name}" +"files.search.label" = "Cerca in questa cartella" +"files.search.no_match" = "Nessun elemento corrisponde a «{query}» in questa cartella" +"files.search.clear" = "Cancella la ricerca" +"files.filter.no_match" = "Nessun elemento corrisponde al filtro in questa cartella" +"files.state.loading" = "Caricamento…" +"files.state.retry" = "Riprova" +"files.status.of" = "{n} di {total} elementi" +"files.status.of_one" = "{n} di {total} elemento" +"files.status.filtered" = "Filtro: {families} · {n} di {total} elementi" +"files.status.filtered_one" = "Filtro: {families} · {n} di {total} elemento" +"files.menu.filter" = "Filtra" +"files.cmd.filter_tip" = "Mostra solo alcuni tipi di elemento" +"files.cmd.search" = "Cerca" +"files.filter.folders" = "Cartelle" +"files.filter.documents" = "Documenti" +"files.filter.sheets" = "Fogli e presentazioni" +"files.filter.images" = "Immagini" +"files.filter.audio" = "Audio" +"files.filter.video" = "Video" +"files.filter.archives" = "Archivi" +"files.filter.programs" = "Programmi" +"files.filter.other" = "Altro" +"files.filter.show_all" = "Mostra tutto" +"files.pane.name" = "Riquadro dei dettagli" +"files.cmd.details" = "Dettagli" +"files.cmd.details_tip" = "Mostra o nasconde il riquadro dei dettagli" +"files.cmd.details_pane" = "Riquadro dei dettagli" +"files.pane.type_folder" = "Cartella" +"files.pane.size" = "Dimensione" +"files.pane.modified" = "Ultima modifica" +"files.pane.created" = "Creato" +"files.pane.folder" = "Cartella" +"files.pane.attributes" = "Attributi" +"files.pane.attr_none" = "Nessuno" +"files.pane.attr_hidden" = "Nascosto" +"files.pane.attr_readonly" = "Sola lettura" +"files.pane.attr_system" = "Sistema" +"files.pane.items" = "Elementi" +"files.pane.drive" = "Unità" +"files.pane.drive_free" = "{name}, {free} liberi" +"files.pane.selected" = "{n} elementi selezionati" +"files.pane.total_size" = "Dimensione totale" +"files.pane.plus_folder" = "{size}, più 1 cartella" +"files.pane.plus_folders" = "{size}, più {n} cartelle" +"files.pane.types" = "Tipi" +"files.pane.types_more" = "{list} e altri {n}" +"files.pane.open_with" = "Apri con" +# Taglia, Copia e Incolla di file (1.9). +"files.cmd.clipboard_empty" = "Gli appunti sono vuoti" +"files.cmd.move" = "Sposta" +"files.ops.copying_one" = "Copia in {name}: 1 elemento" +"files.ops.copying_other" = "Copia in {name}: {n} elementi" +"files.ops.moving_one" = "Spostamento in {name}: 1 elemento" +"files.ops.moving_other" = "Spostamento in {name}: {n} elementi" +"files.ops.chip_paste" = "{what}, {p} %" +"files.ops.done_copied_one" = "Copiato 1 elemento in {name}" +"files.ops.done_copied_other" = "Copiati {n} elementi in {name}" +"files.ops.done_moved_one" = "Spostato 1 elemento in {name}" +"files.ops.done_moved_other" = "Spostati {n} elementi in {name}" +"files.clip.into_itself" = "Impossibile incollare {name}: la destinazione è al suo interno" +"files.clip.twice" = "Impossibile incollare: {name} è negli appunti due volte" +"files.clip.bad" = "Questi elementi non si possono incollare qui: usa Esplora file" +"files.clip.busy" = "Un altro programma sta usando gli appunti: riprova" diff --git a/apps/files/tests/a11y_sweep.rs b/apps/files/tests/a11y_sweep.rs index 02992dd3..af9957ac 100644 --- a/apps/files/tests/a11y_sweep.rs +++ b/apps/files/tests/a11y_sweep.rs @@ -6,7 +6,10 @@ use std::path::{Path, PathBuf}; use files_engine::fakes::Fakes; +use files_engine::nav::Page; use files_engine::preview::{self, Cells}; +use files_engine::window::FilesScreen; +use oled_ui::harness::Harness; use oled_ui::RectP; /// Rect heights are line boxes: the glyphs sit inside them with leading above and below, so two lines that touch @@ -19,6 +22,33 @@ fn overlaps(a: &RectP, b: &RectP) -> bool { w > 0 && h > shorter / 4 } +/// The list scrolls under its header and above the status line: a row the list's edge cuts is drawn clipped there, but +/// the harness logs its whole line box. Such a box is cut to the list's viewport before the sweep. +fn clipped_to_list(rects: &[RectP], list: RectP) -> Vec { + rects + .iter() + .map(|r| { + // A text wider than a narrow window spills past the list's right edge (the window clips it): it is still a + // list text. + let in_columns = r.l >= list.l && r.l < list.r; + let crosses = (r.t < list.t && r.b > list.t) || (r.t < list.b && r.b > list.b); + if list.is_empty() || !in_columns || !crosses { + return *r; + } + RectP { t: r.t.max(list.t), b: r.b.min(list.b), ..*r } + }) + .collect() +} + +/// The active list's viewport, when the window shows a listing. +fn list_of(h: &Harness) -> RectP { + let s = h.screen(); + if *s.tabs().active().nav.page() == Page::Home { + return RectP::EMPTY; + } + s.tabs().active().table.viewport() +} + /// The pairs of text rects that overlap. The harness logs one rect per drawn text run, deduplicated: two runs of one /// node never share pixels, so every overlapping pair is two texts drawn over each other. fn overlapping(rects: &[RectP]) -> Vec<(RectP, RectP)> { @@ -49,14 +79,16 @@ fn every_scene_is_named_and_its_texts_do_not_overlap() { let mut h = preview::harness(s, c, &fakes); let img = h.render(); h.assert_named(); - let mut sets = vec![img.text_rects.clone()]; - if !overlapping(&img.text_rects).is_empty() { + let texts = clipped_to_list(&img.text_rects, list_of(&h)); + let mut sets = vec![texts.clone()]; + if !overlapping(&texts).is_empty() { // An opaque overlay (the operations flyout, the confirm bar) paints over the window and the harness // still logs the covered texts: dismiss it, then sweep the overlay's own texts and the window's // texts apart. A scene whose overlap survives that is a real one. h.key("Esc"); let without = h.render().text_rects; - let own: Vec = img.text_rects.iter().filter(|r| !without.contains(r)).copied().collect(); + let without = clipped_to_list(&without, list_of(&h)); + let own: Vec = texts.iter().filter(|r| !without.contains(r)).copied().collect(); assert!(!own.is_empty(), "scene {} cell {}: texts overlap and no overlay explains it", s.name, c.tag); sets = vec![own, without]; } diff --git a/apps/files/tests/cmdbar.rs b/apps/files/tests/cmdbar.rs new file mode 100644 index 00000000..7f1f281f --- /dev/null +++ b/apps/files/tests/cmdbar.rs @@ -0,0 +1,400 @@ +//! The command bar: what folds into More and when it returns, which commands are off under which build switch +//! and selection, the tooltips that say what each does or why it cannot, the accent item with and without a dock, and +//! the hover hint of a row. Plain tests over the fakes through the kit's Harness: no window, no host. + +use std::cell::Cell; +use std::rc::Rc; + +use files_engine::fakes::{self, Fakes}; +use files_engine::gate; +use files_engine::keys::Cmd; +use files_engine::listing::WidePath; +use files_engine::menu::pick; +use files_engine::toolmenus::{self, btn, DockLink, Why}; +use files_engine::window::FilesScreen; +use oled_trust::frame::files::Location; +use oled_ui::harness::Harness; +use oled_ui::model::TableModel; +use oled_ui::{CommandId, MenuItem, SizeL, Tokens, UiLang}; + +const DIR: &str = r"C:\made-up\bar-folder"; + +fn wp(s: &str) -> WidePath { + WidePath::parse(s).unwrap() +} + +fn listing() -> files_engine::listing::Batch { + fakes::listing(&[ + ("invoices", true, 0, fakes::FT_2026_11_21), + ("notes.txt", false, 1_200, fakes::FT_2026_11_21), + ("plan.pdf", false, 3_400_000, fakes::FT_2026_11_21), + ]) +} + +struct Win { + _f: Fakes, + h: Harness, +} + +impl Win { + fn fs(&self) -> &FilesScreen { + self.h.screen() + } + + fn bar(&self) -> &oled_ui::widgets::CommandBar { + self.fs().toolbar().bar() + } + + /// Files may (or may not) change in this folder, whatever the gate says of the made-up path. + fn changes(&mut self, on: bool) { + self.fs().toolbar().force_changes(Some(on)); + // The next event finds the bar's states stale and lays it out again. + self.h.key("Home"); + self.h.render(); + } + + fn select_rows(&mut self, down: usize) { + self.h.key("Home"); + for _ in 0..down { + self.h.key("Down"); + } + self.h.render(); + } + + fn reason(&self, cmd: u32) -> Option { + let it = self.bar().item(CommandId(cmd)).expect("the command is on the bar"); + (!it.enabled).then(|| it.tip.to_string()) + } + + fn enabled(&self, cmd: u32) -> bool { + self.bar().item(CommandId(cmd)).expect("the command is on the bar").enabled + } +} + +fn window_at(width: i32) -> Win { + let f = Fakes::new(); + f.enumr.queue(&wp(DIR), listing()); + let shared = f.shared(UiLang::EN); + let tab = shared.new_tab(); + let screen = FilesScreen::new(Rc::clone(&shared), 1, Location::Fs(wp(DIR)), None, tab); + let mut h = Harness::new(screen, SizeL { w: width, h: 600 }, 96, Tokens::oled()); + h.render(); + f.pump(&mut h, 1); + h.render(); + Win { _f: f, h } +} + +fn window() -> Win { + window_at(1280) +} + +/// The bar's commands in the order they leave it: the rightmost first. +const FOLD_ORDER: [u32; 8] = [ + btn::FILTER, + btn::VIEW, + btn::SORT, + Cmd::Recycle as u32, + Cmd::Rename as u32, + Cmd::Paste as u32, + Cmd::Copy as u32, + Cmd::Cut as u32, +]; + +#[test] +fn the_build_switches() { + assert!(std::hint::black_box(gate::PASTE_LIVE), "the clipboard commands copy and move real files"); + assert!(std::hint::black_box(gate::REAL_DATA_MUTATIONS), "real files change"); + assert!(std::hint::black_box(toolmenus::NEW_FOLDER_LIVE), "New folder makes real folders"); +} + +#[test] +fn the_rows_have_the_spec_heights() { + let w = window(); + let r = w.fs().rects(); + assert_eq!((r.toolbar.h(), r.cmdbar.h()), (44, 44), "address row and command bar"); + assert_eq!(r.cmdbar.t, r.toolbar.b); + assert_eq!(files_engine::chrome::TAB_ROW_H, 38); + assert_eq!(r.body.t, r.cmdbar.b); +} + +#[test] +fn nothing_folds_when_it_fits_and_the_fold_order_holds_when_it_does_not() { + let wide = window_at(1280); + assert!(wide.bar().folded_ids().is_empty(), "{:?}", wide.bar().folded_ids()); + let mut last = usize::MAX; + for width in (560..=1280).step_by(40) { + let w = window_at(width); + let folded = w.bar().folded_ids(); + let want: Vec = { + let mut v: Vec = FOLD_ORDER.iter().take(folded.len()).map(|c| CommandId(*c)).collect(); + v.sort_by_key(|c| FOLD_ORDER.iter().position(|o| *o == c.0).map(|p| usize::MAX - p)); + v + }; + let mut got = folded.clone(); + got.sort_by_key(|c| FOLD_ORDER.iter().position(|o| *o == c.0).map(|p| usize::MAX - p)); + assert_eq!(got, want, "{width}: what folds is the rightmost buttons, in their order"); + assert!(folded.len() <= last, "{width}: a wider bar never folds more ({} after {last})", folded.len()); + last = folded.len(); + let visible = w.bar().visible(); + assert!(visible.contains(&CommandId(btn::NEW)), "{width}: New never folds"); + assert!(w.bar().more_node().is_some(), "{width}: More stays"); + assert!(!folded.contains(&CommandId(btn::NEW))); + } + let narrow = window_at(560); + assert!(!narrow.bar().folded_ids().is_empty(), "the narrowest window folds"); +} + +#[test] +fn a_folded_button_comes_back_in_the_more_menu_in_bar_order() { + let mut w = window_at(560); + let folded = w.bar().folded_ids(); + assert!(!folded.is_empty()); + let items = files_engine::toolbar::more_menu(w.h.screen_mut()); + let ids: Vec = items + .iter() + .filter_map(|i| match i { + MenuItem::Custom { id, .. } => Some(id.0), + _ => None, + }) + .collect(); + let first_own = ids.iter().position(|i| *i == Cmd::Undo as u32).expect("Undo is the first own item"); + let from_bar: Vec = ids[..first_own].to_vec(); + // The folded commands of the bar come first, in the bar's order (Cut before Delete), menus as submenus. + let mut expect: Vec = + folded.iter().map(|c| c.0).filter(|c| *c != btn::SORT && *c != btn::VIEW && *c != btn::FILTER).collect(); + expect.sort_by_key(|c| FOLD_ORDER.iter().position(|o| o == c).map(|p| usize::MAX - p)); + assert_eq!(from_bar, expect); +} + +#[test] +fn commands_follow_the_switches_and_the_selection() { + let mut w = window(); + // The clipboard commands' switch off, whatever the build says. + w.fs().shared().paste_live.set(false); + w.select_rows(2); + w.changes(false); + let why = Why::NotInAlpha.text(UiLang::EN).to_string(); + for cmd in [Cmd::Cut, Cmd::Copy, Cmd::Paste, Cmd::Rename, Cmd::Recycle] { + assert_eq!(w.reason(cmd as u32).as_deref(), Some(why.as_str()), "{cmd:?} while its switch is off"); + } + assert!(w.enabled(btn::NEW) && w.enabled(btn::SORT) && w.enabled(btn::VIEW), "the menus open"); + + w.changes(true); + // Rename and Delete are on in a folder where files may change; the clipboard commands wait for PASTE_LIVE. + assert!(w.enabled(Cmd::Rename as u32) && w.enabled(Cmd::Recycle as u32)); + for cmd in [Cmd::Cut, Cmd::Copy, Cmd::Paste] { + assert_eq!(w.reason(cmd as u32).as_deref(), Some(why.as_str()), "{cmd:?}"); + } + // With it on: Cut and Copy take the selection, Paste waits for files on the clipboard; outside a folder where + // files may change, all three say so. + w.fs().shared().paste_live.set(true); + w.changes(true); + assert!(w.enabled(Cmd::Cut as u32) && w.enabled(Cmd::Copy as u32)); + assert_eq!(w.reason(Cmd::Paste as u32).as_deref(), Some("The clipboard is empty")); + w.changes(false); + for cmd in [Cmd::Cut, Cmd::Copy, Cmd::Paste] { + assert_eq!(w.reason(cmd as u32).as_deref(), Some(why.as_str()), "{cmd:?} where files may not change"); + } + w.fs().shared().paste_live.set(false); + w.changes(true); + + // Nothing selected: Rename and Delete say so. + w.h.key("Esc"); + w.h.render(); + w.h.click(oled_ui::PointL { x: 600, y: 560 }); + w.h.render(); + assert_eq!(w.reason(Cmd::Rename as u32).as_deref(), Some("Nothing selected")); + assert_eq!(w.reason(Cmd::Recycle as u32).as_deref(), Some("Nothing selected")); + + // Two selected: Rename wants one. + w.h.key("Ctrl+A"); + w.h.render(); + assert_eq!(w.reason(Cmd::Rename as u32).as_deref(), Some("Select one item")); + assert!(w.enabled(Cmd::Recycle as u32)); +} + +#[test] +fn enabled_tooltips_name_the_action_and_the_chord() { + let mut w = window(); + w.fs().shared().paste_live.set(false); + w.changes(true); + w.select_rows(2); + let say = |w: &Win, cmd: u32| w.bar().description_of(CommandId(cmd)).map(|t| t.to_string()); + assert_eq!(say(&w, Cmd::Rename as u32).as_deref(), Some("Rename the selected file \u{b7} F2")); + assert_eq!(say(&w, Cmd::Recycle as u32).as_deref(), Some("Move to the Recycle Bin, Ctrl+Z undoes \u{b7} Del")); + // A disabled one says why and shows no chord. + assert_eq!(say(&w, Cmd::Paste as u32).as_deref(), Some("Not available in this alpha: use File Explorer"),); + w.fs().shared().paste_live.set(true); + w.changes(true); + assert_eq!(say(&w, Cmd::Copy as u32).as_deref(), Some("Copy the selection \u{b7} Ctrl+C")); + assert_eq!(say(&w, Cmd::Paste as u32).as_deref(), Some("The clipboard is empty")); +} + +#[test] +fn the_menus_follow_the_switches() { + let mut w = window(); + w.changes(false); + let new = toolmenus::new_items(w.fs()); + assert!(matches!(&new[..], [MenuItem::Custom { enabled: false, note: Some(_), .. }]), "{new:?}"); + let MenuItem::Custom { label, .. } = &new[0] else { panic!("{new:?}") }; + assert_eq!(&**label, "Folder", "the menu's own word, not the undo label"); + // The accent item and About are apart. + let more = toolmenus::more_items(w.fs()); + let at = + more.iter().position(|i| matches!(i, MenuItem::Custom { id, .. } if id.0 == pick::ACCENT)).expect("accent"); + assert!(matches!(more[at + 1], MenuItem::Separator), "a separator before About"); + assert!(matches!(more[at + 2], MenuItem::Command(id) if id.0 == Cmd::About as u32)); + w.changes(true); + let new = toolmenus::new_items(w.fs()); + // With real data on, New folder also waits for its own switch. + let waits = toolmenus::new_folder_why(None, gate::REAL_DATA_MUTATIONS, toolmenus::NEW_FOLDER_LIVE).is_some(); + assert!(matches!(&new[..], [MenuItem::Custom { enabled, .. }] if *enabled != waits), "{new:?}"); + // Undo and Redo have nothing to take back. + let more = toolmenus::more_items(w.fs()); + let off = |id: u32| { + more.iter().find_map(|i| match i { + MenuItem::Custom { id: x, enabled: false, note, .. } if x.0 == id => Some(note.clone()), + _ => None, + }) + }; + assert_eq!(off(Cmd::Undo as u32).flatten().as_deref(), Some("Nothing to undo")); + assert_eq!(off(Cmd::Redo as u32).flatten().as_deref(), Some("Nothing to redo")); +} + +#[test] +fn a_folder_outside_temp_is_judged_without_touching_the_disk() { + let temps = [wp(r"C:\Users\tester\AppData\Local\Temp"), wp(r"C:\Users\TESTER~1\AppData\Local\Temp")]; + let no = |s: &str| !gate::may_have_root_shape(&[&wp(s)], &temps); + assert!(no(r"\\host\share\x")); + assert!(no(r"Z:\data")); + assert!(no(r"C:\Users\tester\Documents")); + assert!(no(r"C:\Users\tester\AppData\Local\Temp")); + assert!(no(r"C:\Users\tester\AppData\Local\Temp\other")); + assert!(no(r"C:\Users\tester\AppData\Local\Temp\mod-files-live-")); + assert!(!no(r"C:\Users\tester\AppData\Local\Temp\mod-files-live-1\sub")); + assert!(!no(r"c:\users\tester~1\appdata\local\temp\MOD-FILES-TEST-9")); + assert!(!gate::may_have_root_shape(&[], &temps)); + // Nothing is read for a folder outside TEMP: the seams would panic. + let attrs = |_: &WidePath| -> Option { panic!("disk read") }; + let long = |_: &WidePath| -> Option { panic!("disk read") }; + let temp = &temps[0]; + for p in [r"\\host\share\x", r"Z:\data", r"C:\Users\tester\Documents"] { + assert!(!gate::may_mutate_quick_with(&[&wp(p)], &temps, temp, &attrs, &long), "{p}"); + } + // A folder shaped like a root does go on to the gate's reads. + let reads = Cell::new(0); + let long = |p: &WidePath| { + reads.set(reads.get() + 1); + Some(p.clone()) + }; + let root = wp(r"C:\Users\tester\AppData\Local\Temp\mod-files-test-1"); + assert!(gate::may_mutate_quick_with(&[&root], &temps, temp, &|_| None, &long)); + assert!(reads.get() > 0); +} + +/// A dock that runs or not; it counts the requests it takes. +struct Dock { + up: bool, + asked: Rc>, +} + +impl DockLink for Dock { + fn running(&self) -> bool { + self.up + } + + fn open_appearance(&self) -> bool { + self.asked.set(self.asked.get() + 1); + self.up + } +} + +fn accent(w: &Win) -> (bool, Option) { + toolmenus::more_items(w.fs()) + .into_iter() + .find_map(|i| match i { + MenuItem::Custom { id, enabled, note, .. } if id.0 == pick::ACCENT => { + Some((enabled, note.map(|n| n.to_string()))) + } + _ => None, + }) + .expect("the accent item is in More") +} + +#[test] +fn the_accent_item_needs_the_dock() { + let w = window(); + let asked = Rc::new(Cell::new(0)); + *w.fs().shared().dock.borrow_mut() = Rc::new(Dock { up: false, asked: Rc::clone(&asked) }); + assert_eq!(accent(&w), (false, Some("The dock is not running".to_string()))); + *w.fs().shared().dock.borrow_mut() = Rc::new(Dock { up: true, asked: Rc::clone(&asked) }); + assert_eq!(accent(&w), (true, None)); + assert_eq!(asked.get(), 0, "looking at the menu asks nothing of the dock"); +} + +#[test] +fn f6_visits_the_command_bar() { + let mut w = window(); + w.h.key("Down"); + w.h.render(); + let bar = files_engine::toolbar::command_node(w.fs(), btn::NEW).expect("New is on the bar"); + let mut seen = Vec::new(); + for _ in 0..4 { + w.h.key("F6"); + w.h.render(); + seen.push(w.h.focused()); + } + assert!(seen.contains(&Some(bar)), "the bar is one stop of the cycle: {seen:?}"); +} + +#[test] +fn a_row_hint_says_double_click() { + let w = window(); + let m = w.fs().tabs().active().table.model(); + assert_eq!(m.hover_hint(1).as_deref(), Some("Double-click to open")); + assert_eq!(m.hover_hint(99), None, "no row, no hint"); +} + +#[test] +fn new_folder_waits_for_its_own_switch_on_top_of_real_data() { + use toolmenus::new_folder_why as why; + // Real data off: the test and live roots answer for themselves. + assert_eq!(why(None, false, false), None); + assert_eq!(why(Some(Why::NotInAlpha), false, true), Some(Why::NotInAlpha)); + // Real data on: New folder still waits for its own switch. + assert_eq!(why(None, true, false), Some(Why::NotInAlpha)); + assert_eq!(why(None, true, true), None); + assert_eq!(why(Some(Why::NoFolder), true, true), Some(Why::NoFolder), "no folder shown says so"); + let built = toolmenus::new_folder_why(None, gate::REAL_DATA_MUTATIONS, toolmenus::NEW_FOLDER_LIVE); + assert_eq!(built.is_none(), !gate::REAL_DATA_MUTATIONS || toolmenus::NEW_FOLDER_LIVE, "this build"); +} + +#[test] +fn delete_says_where_it_goes_and_its_keys() { + let mut w = window(); + w.select_rows(2); + w.changes(true); + let it = w.bar().item(CommandId(Cmd::Recycle as u32)).expect("Delete is on the bar"); + assert!(it.enabled); + assert_eq!(&*it.tip, "Move to the Recycle Bin, Ctrl+Z undoes"); + assert_eq!(it.shortcut.as_deref(), Some("Del")); + let it = w.bar().item(CommandId(Cmd::Rename as u32)).expect("Rename is on the bar"); + assert_eq!((&*it.tip, it.shortcut.as_deref()), ("Rename the selected file", Some("F2"))); +} + +#[test] +fn undo_and_redo_name_the_operation() { + use files_engine::ops_client::UndoRecord; + use files_engine::undo::{UndoEntry, UndoStack}; + use oled_trust::frame::files::{OpId, OpKind, UndoKind}; + let rec = |kind| UndoRecord { of: OpId(1), kind, replaced: 0, entries: Vec::new() }; + let mut u = UndoStack::new(); + assert_eq!((u.label(UiLang::EN), u.redo_label(UiLang::EN)), (None, None)); + u.push(UndoEntry { op: OpId(1), kind: OpKind::Rename, record: rec(UndoKind::RenameBack) }); + assert_eq!(u.label(UiLang::EN).as_deref(), Some("Undo Rename")); + u.push_redo(UndoEntry { op: OpId(2), kind: OpKind::NewFolder, record: rec(UndoKind::RecycleNewFolder) }); + assert_eq!(u.redo_label(UiLang::EN).as_deref(), Some("Redo New folder")); + assert_eq!(u.redo_label(UiLang::IT).as_deref(), Some("Ripeti Nuova cartella")); + u.push_redo(UndoEntry { op: OpId(3), kind: OpKind::Recycle, record: rec(UndoKind::RestoreRecycled) }); + assert_eq!(u.redo_label(UiLang::IT).as_deref(), Some("Ripeti Elimina"), "the newest one"); +} diff --git a/apps/files/tests/disposable_hotplug.rs b/apps/files/tests/disposable_hotplug.rs index fac228b0..ebe33f7f 100644 --- a/apps/files/tests/disposable_hotplug.rs +++ b/apps/files/tests/disposable_hotplug.rs @@ -70,6 +70,8 @@ fn shows(shared: &Shared, letter: char) -> bool { expanded: &expanded, children: &children, busy: None, + art: &files_engine::icons::ArtBook::empty(), + known: &shared.known.borrow(), }); let want = format!("{letter}:"); built.items.iter().any(|i| i.label.ends_with(&want) || i.label.ends_with(&format!("({want})"))) diff --git a/apps/files/tests/disposable_mutations.rs b/apps/files/tests/disposable_mutations.rs new file mode 100644 index 00000000..975abc48 --- /dev/null +++ b/apps/files/tests/disposable_mutations.rs @@ -0,0 +1,206 @@ +//! Rename, new folder, delete and their undo and redo through the window's own seam and the real operations host +//! with the production flags, on the throwaway volumes and share of CI's files-disposable job: the two NTFS volumes +//! with their Recycle Bin values (QUOTA, NUKE), the FAT32 volume and the SMB share. A delete to the bin on NTFS is +//! undone from the bin; on FAT32 and on the share Del opens the bar and nothing goes before its Enter. A name clash +//! stays in the field. The facts of every volume are written to disposable/mutations.json, whatever the outcome. +//! Never on a developer's PC: every test starts with common::disposable(). + +mod common; +mod real_window; + +use std::path::Path; +use std::sync::Arc; +use std::time::{Duration, Instant}; + +use common::temp::TempRoot; +use files_engine::bar; +use files_engine::gate; +use files_engine::listing::WidePath; +use files_engine::ops::classify::Recyclability; +use files_engine::ops_client::{OpsClient, OpsConfig, OpsEvent}; +use files_engine::ops_ui::FactsFn; +use files_engine::toolmenus; +use oled_trust::frame::files::{Conflicts, ItemRef, OpEvt, OpId}; +use real_window::{child, window, Run}; +use serde_json::{json, Value}; + +const VARS: [&str; 4] = ["FILES_DISP_QUOTA", "FILES_DISP_NUKE", "FILES_DISP_FAT", "FILES_DISP_UNC"]; + +fn exists(p: &WidePath) -> bool { + Path::new(&p.to_string_lossy()).exists() +} + +/// Waits for `op` of the setup client. +fn finish(c: &OpsClient, op: OpId) { + let start = Instant::now(); + loop { + let done = c.drain().into_iter().any( + |e| matches!(e, OpsEvent::Evt(OpEvt::Finished { op: o, .. } | OpEvt::Refused { op: o, .. }) if o == op), + ); + if done { + return; + } + assert!(start.elapsed() < Duration::from_secs(60), "the setup operation did not end"); + std::thread::sleep(Duration::from_millis(20)); + } +} + +/// A fresh folder on the volume with two files in it, made through a host of its own (the tests never write outside +/// a TempRoot themselves): the folder and its two files. +fn setup(data: &TempRoot, volume: &str) -> (WidePath, WidePath, WidePath) { + let src = TempRoot::new("disp_mut_src"); + let notes = WidePath::parse(&src.file("notes.txt", b"made-up notes").to_string_lossy()).unwrap(); + let plan = WidePath::parse(&src.file("plan.txt", b"made-up plan").to_string_lossy()).unwrap(); + let mut env = common::hooks(data).env; + env.retain(|(k, _)| &**k != "FILES_TEST_ROOT" && &**k != "FILES_DATA_DIR"); + env.push(("FILES_TEST_ROOT".into(), format!("{};{volume}", src.path().display()).into())); + let hooks = files_engine::host::TestHooks { pipe_tag: Some(common::test_tag()), build_tag: None, env }; + let cfg = OpsConfig { exe: common::files_exe(), data_dir: data.at("setup-data"), owner: 0, test: Some(hooks) }; + let c = OpsClient::new(cfg, Arc::new(|| {})); + let base = WidePath::parse(volume).unwrap(); + let name = format!("mod-files-mut-{}", common::test_tag()); + finish(&c, c.new_folder(&base, &name).unwrap()); + let dir = child(&base, &name); + finish(&c, c.copy(&[ItemRef::Path(notes), ItemRef::Path(plan)], &dir, Conflicts::AskSystem).unwrap()); + c.shutdown(); + let (n, p) = (child(&dir, "notes.txt"), child(&dir, "plan.txt")); + assert!(exists(&n) && exists(&p), "the setup files are on {volume}"); + (dir, n, p) +} + +fn open(data: &TempRoot, dir: &WidePath, names: &[&str], volume: &str) -> Run { + let entries: Vec<(&str, bool)> = names.iter().map(|n| (*n, false)).collect(); + window(data, dir, &entries, volume, false) +} + +/// Rename, a clash, undo and redo of the rename, then a new folder: the row of facts. +fn renames(data: &TempRoot, dir: &WidePath, notes: &WidePath, volume: &str) -> Value { + let mut r = open(data, dir, &["notes.txt", "plan.txt"], volume); + r.select("notes.txt"); + r.h.key("F2").type_text("plan").key("Enter"); + let clash = + r.h.screen_mut() + .tabs_mut() + .active_mut() + .table + .rename_field_mut() + .and_then(|f| f.error().map(|e| e.to_string())); + let clash_inline = clash.as_deref() == Some("There's already an item named plan.txt"); + r.h.key("Esc"); + r.select("notes.txt"); + r.h.key("F2").type_text("notes-renamed").key("Enter"); + let renamed = child(dir, "notes-renamed.txt"); + r.until("the rename", |r| r.idle() && exists(&renamed) && !exists(notes)); + r.until("the rename's undo record", |r| r.shared.undo.borrow().len() == 1); + r.h.key("Ctrl+Z"); + r.until("the rename's undo", |r| r.idle() && exists(notes) && !exists(&renamed)); + r.until("the redo entry", |r| r.shared.undo.borrow().redo_len() == 1); + r.h.key("Ctrl+Y"); + r.until("the rename's redo", |r| r.idle() && exists(&renamed) && !exists(notes)); + let waits = toolmenus::new_folder_why(None, gate::REAL_DATA_MUTATIONS, toolmenus::NEW_FOLDER_LIVE).is_some(); + let made = child(dir, "New folder"); + let new_folder = if waits { + r.h.key("Ctrl+Shift+N"); + r.h.render(); + assert!(!exists(&made), "New folder waits for its switch"); + "switch off" + } else { + r.h.key("Ctrl+Shift+N"); + r.until("the new folder", |r| r.idle() && exists(&made)); + "made" + }; + r.shared.services.ops.shutdown(); + assert!(clash_inline, "the clash stays in the field: {clash:?}"); + json!({"clash_inline": clash_inline, "renamed": true, "rename_undone": true, "rename_redone": true, "new_folder": new_folder}) +} + +/// Del on `plan`: the classifier of the system, or Yes when `recycle` (the bin itself is under test, not the policy). +fn deletes(data: &TempRoot, dir: &WidePath, plan: &WidePath, volume: &str, recycle: bool) -> Value { + let mut r = open(data, dir, &["plan.txt"], volume); + if recycle { + let yes: FactsFn = + Arc::new(|items: &[(WidePath, u64)]| items.iter().map(|(p, _)| (p.clone(), Recyclability::Yes)).collect()); + r.shared.ops.borrow_mut().set_facts(yes); + } + r.h.key("Ctrl+A").key("Del"); + r.until("the classification", |r| !bar::bar_of(r.h.screen()).is_pending()); + if bar::bar_of(r.h.screen()).is_open() { + assert_eq!(bar::bar_of(r.h.screen()).permanent(), std::slice::from_ref(plan)); + r.h.key("Del"); + r.f.pump(&mut r.h, 1); + std::thread::sleep(Duration::from_millis(500)); + r.f.pump(&mut r.h, 1); + let kept = exists(plan); + r.h.key("Enter"); + r.until("the permanent delete", |r| r.idle() && !exists(plan)); + r.shared.services.ops.shutdown(); + assert!(kept, "nothing goes before the bar's Enter"); + return json!({"del": "bar", "kept_until_enter": kept, "deleted_after_enter": true}); + } + r.until("the recycle", |r| r.idle() && !exists(plan)); + r.until("the recycle's undo record", |r| r.shared.undo.borrow().len() == 1); + r.h.key("Ctrl+Z"); + r.until("the restore", |r| r.idle() && exists(plan)); + r.until("the redo entry", |r| r.shared.undo.borrow().redo_len() == 1); + r.h.key("Ctrl+Y"); + r.until("the redo's classification", |r| !bar::bar_of(r.h.screen()).is_pending()); + let redo = if bar::bar_of(r.h.screen()).is_open() { + r.h.key("Esc"); + "bar" + } else { + r.until("the redo's recycle", |r| r.idle() && !exists(plan)); + "recycled" + }; + r.shared.services.ops.shutdown(); + json!({"del": "recycled", "restored": true, "redo": redo}) +} + +#[test] +#[ignore = "disposable: CI files-disposable job only"] +fn disposable_mutations_on_the_volumes() { + common::disposable(); + let data = TempRoot::new("disp_mutations"); + let mut record = serde_json::Map::new(); + let mut failed = Vec::new(); + for var in VARS { + let volume = std::env::var(var).unwrap_or_else(|_| panic!("{var} is set by files-disposable.ps1 -Setup")); + let (dir, notes, plan) = setup(&data, &volume); + if !gate::REAL_DATA_MUTATIONS { + // The real-data switch is off in this build: the window refuses with the not-available notice and the + // files stay as they are. + let mut r = open(&data, &dir, &["notes.txt", "plan.txt"], &volume); + r.h.key("Ctrl+A").key("Shift+Del").key("Enter"); + r.h.render(); + let notice = r.h.a11y_dump().contains("Not available in this alpha"); + r.shared.services.ops.shutdown(); + record + .insert(var.into(), json!({"gate": "off", "notice": notice, "kept": exists(¬es) && exists(&plan)})); + continue; + } + let row = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { + let mut row = renames(&data, &dir, ¬es, &volume); + let recycle = var == "FILES_DISP_QUOTA"; + let del = deletes(&data, &dir, &plan, &volume, recycle); + if let (Some(a), Value::Object(b)) = (row.as_object_mut(), del) { + a.extend(b); + } + row + })); + match row { + Ok(row) => { + println!("mutations {var}: {row}"); + record.insert(var.into(), row); + } + Err(e) => { + let why = + e.downcast_ref::().cloned().or_else(|| e.downcast_ref::<&str>().map(|s| s.to_string())); + record.insert(var.into(), json!({"failed": why})); + failed.push(var); + } + } + } + // The record is written whatever the outcome, so a failing volume still leaves the facts of every other one. + let path = common::temp::artifact("disposable/mutations.json", Value::Object(record).to_string().as_bytes()); + println!("mutations record: {}", path.display()); + assert!(failed.is_empty(), "failed on {failed:?}: see {}", path.display()); +} diff --git a/apps/files/tests/disposable_paste.rs b/apps/files/tests/disposable_paste.rs new file mode 100644 index 00000000..eb0c253b --- /dev/null +++ b/apps/files/tests/disposable_paste.rs @@ -0,0 +1,558 @@ +//! Copy, Cut and Paste through the window's own seam, the system clipboard and the real operations host with the +//! production flags, on the throwaway volumes and share of CI's files-disposable job. From the first NTFS volume to +//! the second, to the FAT32 volume and to the SMB share: a copy and its undo, a cut and its undo. Windows' own conflict +//! dialog: cancelled (the destination is unchanged), then answered with Replace (the source's bytes). And a paste of +//! files placed on the clipboard the way File Explorer places them: the shell's data object of the items, with the +//! drop effect beside it. The facts go to disposable/paste.json, whatever the outcome. Never on a developer's PC: +//! every test starts with common::disposable(). + +mod common; +mod real_window; + +use std::path::{Path, PathBuf}; +use std::sync::{Arc, Mutex}; +use std::time::{Duration, Instant}; + +use common::temp::TempRoot; +use files_engine::gate; +use files_engine::listing::WidePath; +use files_engine::ops_client::{OpsClient, OpsConfig, OpsEvent}; +use oled_trust::frame::files::{Conflicts, ItemRef, OpEvt, OpId}; +use oled_ui::harness::system_clipboard; +use real_window::{child, window, Run}; +use serde_json::{json, Value}; +use windows::core::{w, PCWSTR}; +use windows::Win32::Foundation::{HWND, LPARAM, WPARAM}; +use windows::Win32::System::Com::{ + CoCreateInstance, CoInitializeEx, CoUninitialize, IBindCtx, IDataObject, CLSCTX_INPROC_SERVER, + COINIT_MULTITHREADED, DVASPECT_CONTENT, FORMATETC, STGMEDIUM, STGMEDIUM_0, TYMED_HGLOBAL, +}; +use windows::Win32::System::DataExchange::{IsClipboardFormatAvailable, RegisterClipboardFormatW}; +use windows::Win32::System::Memory::{GlobalAlloc, GlobalLock, GlobalUnlock, GMEM_MOVEABLE}; +use windows::Win32::System::Ole::{OleInitialize, OleSetClipboard, CF_HDROP}; +use windows::Win32::UI::Accessibility::{ + CUIAutomation, IUIAutomation, IUIAutomationInvokePattern, IUIAutomationLegacyIAccessiblePattern, TreeScope_Subtree, + UIA_ButtonControlTypeId, UIA_HyperlinkControlTypeId, UIA_InvokePatternId, UIA_LegacyIAccessiblePatternId, + UIA_ListItemControlTypeId, +}; +use windows::Win32::UI::Shell::BHID_DataObject; +use windows::Win32::UI::Shell::Common::ITEMIDLIST; +use windows::Win32::UI::Shell::{ILFree, IShellItemArray, SHCreateShellItemArrayFromIDLists, SHParseDisplayName}; +use windows::Win32::UI::WindowsAndMessaging::{ + CreateWindowExW, EnumWindows, GetClassNameW, GetWindowThreadProcessId, IsWindowVisible, PostMessageW, HWND_MESSAGE, + WINDOW_EX_STYLE, WINDOW_STYLE, WM_CLOSE, +}; + +/// The legs of the copies and moves: (source volume, destination volume), both NTFS volumes either way. +const LEGS: [(&str, &str); 4] = [ + ("FILES_DISP_QUOTA", "FILES_DISP_NUKE"), + ("FILES_DISP_NUKE", "FILES_DISP_QUOTA"), + ("FILES_DISP_QUOTA", "FILES_DISP_FAT"), + ("FILES_DISP_QUOTA", "FILES_DISP_UNC"), +]; +const VARS: [&str; 4] = ["FILES_DISP_QUOTA", "FILES_DISP_NUKE", "FILES_DISP_FAT", "FILES_DISP_UNC"]; + +/// The system clipboard is one for the whole session: the tests of this file take turns. +static CLIPBOARD: Mutex<()> = Mutex::new(()); + +/// One row of disposable/paste.json (the file gathers the rows of every test of this file). +fn record(key: &str, row: Value) -> PathBuf { + let at = common::temp::target_dir().join("disposable").join("paste.json"); + let mut all: serde_json::Map = + std::fs::read(&at).ok().and_then(|b| serde_json::from_slice(&b).ok()).unwrap_or_default(); + all.insert(key.into(), row); + common::temp::artifact("disposable/paste.json", Value::Object(all).to_string().as_bytes()) +} + +fn var(k: &str) -> String { + std::env::var(k).unwrap_or_else(|_| panic!("{k} is set by files-disposable.ps1 -Setup")) +} + +fn exists(p: &WidePath) -> bool { + Path::new(&p.to_string_lossy()).exists() +} + +fn read(p: &WidePath) -> Vec { + std::fs::read(p.to_string_lossy()).unwrap_or_default() +} + +fn wp(p: &Path) -> WidePath { + WidePath::parse(&p.to_string_lossy()).unwrap() +} + +/// Waits for `op` of a setup client. +fn finish(c: &OpsClient, op: OpId) { + let start = Instant::now(); + loop { + let done = c.drain().into_iter().any( + |e| matches!(e, OpsEvent::Evt(OpEvt::Finished { op: o, .. } | OpEvt::Refused { op: o, .. }) if o == op), + ); + if done { + return; + } + assert!(start.elapsed() < Duration::from_secs(60), "the setup operation did not end"); + std::thread::sleep(Duration::from_millis(20)); + } +} + +/// A fresh folder on the volume holding `files`, made through a host of its own (the tests never write outside a +/// TempRoot themselves). +fn seed(data: &TempRoot, volume: &str, files: &[(&str, &[u8])]) -> WidePath { + let src = TempRoot::new("disp_paste_seed"); + let items: Vec = files.iter().map(|(n, b)| ItemRef::Path(wp(&src.file(n, b)))).collect(); + let mut env = common::hooks(data).env; + env.retain(|(k, _)| &**k != "FILES_TEST_ROOT" && &**k != "FILES_DATA_DIR"); + env.push(("FILES_TEST_ROOT".into(), format!("{};{volume}", src.path().display()).into())); + let hooks = files_engine::host::TestHooks { pipe_tag: Some(common::test_tag()), build_tag: None, env }; + let cfg = OpsConfig { exe: common::files_exe(), data_dir: data.at("seed-data"), owner: 0, test: Some(hooks) }; + let c = OpsClient::new(cfg, Arc::new(|| {})); + let base = WidePath::parse(volume).unwrap(); + let name = format!("mod-files-paste-{}", common::test_tag()); + finish(&c, c.new_folder(&base, &name).unwrap()); + let dir = child(&base, &name); + if !items.is_empty() { + finish(&c, c.copy(&items, &dir, Conflicts::ReplaceAll).unwrap()); + } + c.shutdown(); + assert!(exists(&dir), "the folder is on {volume}"); + dir +} + +/// A message-only window of this thread: the clipboard's owner while a window of the test writes it (never a null +/// owner). +fn owner() -> isize { + // SAFETY: a message-only STATIC window of this thread, never shown. + let h = unsafe { + CreateWindowExW( + WINDOW_EX_STYLE(0), + w!("STATIC"), + w!(""), + WINDOW_STYLE(0), + 0, + 0, + 0, + 0, + Some(HWND_MESSAGE), + None, + None, + None, + ) + }; + h.expect("a message-only window").0 as isize +} + +/// The window over `dir` with the production flags and the system clipboard; it looks at the clipboard once. +fn open(data: &TempRoot, dir: &WidePath, names: &[&str], fence: &str, owner: isize) -> Run { + let entries: Vec<(&str, bool)> = names.iter().map(|n| (*n, false)).collect(); + let mut r = window(data, dir, &entries, fence, false); + r.h.use_clipboard(Some(system_clipboard(owner))); + r.h.set_active(false).set_active(true); + r.h.render(); + r +} + +/// CF_HDROP is on the system clipboard. +fn clipboard_has_files() -> bool { + // SAFETY: no precondition. + unsafe { IsClipboardFormatAvailable(CF_HDROP.0.into()) }.is_ok() +} + +/// The visible dialogs of process `pid`: classes #32770 and OperationStatusWindow. +fn dialogs_of(pid: u32) -> Vec { + windows_of(pid, true) +} + +/// The visible top-level windows of process `pid`; only the dialog classes when `dialogs`. The host shows no window of +/// its own, so each is one of the shell's (its operation window, a question about a collision). +fn windows_of(pid: u32, dialogs: bool) -> Vec { + struct Find { + pid: u32, + dialogs: bool, + found: Vec, + } + unsafe extern "system" fn each(hwnd: HWND, lparam: LPARAM) -> windows::core::BOOL { + // SAFETY: `lparam` is the address of the Find below, alive for the enumeration. + let f = unsafe { &mut *(lparam.0 as *mut Find) }; + let mut pid = 0u32; + // SAFETY: a window handle the enumeration passes; `pid` is writable. + unsafe { GetWindowThreadProcessId(hwnd, Some(&mut pid)) }; + let mut class = [0u16; 64]; + // SAFETY: as above; the buffer is writable. + let n = unsafe { GetClassNameW(hwnd, &mut class) } as usize; + // SAFETY: as above. + let visible = unsafe { IsWindowVisible(hwnd) }.as_bool(); + let class = String::from_utf16_lossy(&class[..n]); + if pid == f.pid && visible && (!f.dialogs || class == "#32770" || class == "OperationStatusWindow") { + f.found.push(hwnd); + } + true.into() + } + let mut f = Find { pid, dialogs, found: Vec::new() }; + // SAFETY: the callback only writes into `f`, which outlives the call. + let _ = unsafe { EnumWindows(Some(each), LPARAM(std::ptr::from_mut(&mut f) as isize)) }; + f.found +} + +/// Cancels every dialog of the host (WM_CLOSE). True when there was one. +fn cancel(pid: u32) -> bool { + let found = dialogs_of(pid); + for h in &found { + // SAFETY: a dialog of our own child host, on the throwaway runner only. + let _ = unsafe { PostMessageW(Some(*h), WM_CLOSE, WPARAM(0), LPARAM(0)) }; + } + !found.is_empty() +} + +/// The names of the elements in the host's windows the last time replace looked and found nothing to press (the +/// failure message shows them). +static SEEN: Mutex> = Mutex::new(Vec::new()); + +fn seen() -> Vec { + SEEN.lock().unwrap_or_else(|e| e.into_inner()).clone() +} + +/// Presses "Replace the file in the destination" in Windows' conflict dialog of the host, through UI Automation, on a +/// thread of its own in the multithreaded apartment (where UI Automation's clients belong: the test's thread is an +/// STA for the clipboard). True when it was found and pressed. +fn replace(pid: u32) -> bool { + std::thread::spawn(move || { + // SAFETY: this new thread's COM, in the multithreaded apartment, ended once before the thread ends. + let _ = unsafe { CoInitializeEx(None, COINIT_MULTITHREADED) }; + let pressed = replace_in(pid); + // SAFETY: as above. + unsafe { CoUninitialize() }; + pressed + }) + .join() + .unwrap_or(false) +} + +/// How the control that replaces is named in the conflict dialogs of the Windows versions the runners have. +const REPLACE_NAMES: [&str; 6] = + ["replace", "sostituisci", "copy and replace", "move and replace", "copia e sostituisci", "sposta e sostituisci"]; + +/// Every visible window of the host, each element of it: the first whose name starts with Replace (Sostituisci), the +/// dialog's own title aside, is invoked, or given its default action when it is a button, a link or a list item. +fn replace_in(pid: u32) -> bool { + let pressable = [UIA_ButtonControlTypeId, UIA_HyperlinkControlTypeId, UIA_ListItemControlTypeId]; + let mut names = Vec::new(); + // SAFETY: COM is initialised on this thread (replace); every call reads the host's windows, and the one action is + // a press in a dialog of our own child host, on the throwaway runner only. + unsafe { + let Ok(uia) = CoCreateInstance::<_, IUIAutomation>(&CUIAutomation, None, CLSCTX_INPROC_SERVER) else { + return false; + }; + let Ok(all) = uia.CreateTrueCondition() else { return false }; + for h in windows_of(pid, false) { + let Ok(el) = uia.ElementFromHandle(h) else { continue }; + let Ok(found) = el.FindAll(TreeScope_Subtree, &all) else { continue }; + for i in 0..found.Length().unwrap_or(0) { + let Ok(e) = found.GetElement(i) else { continue }; + let name = e.CurrentName().map(|b| b.to_string()).unwrap_or_default(); + let name = name.trim(); + if !name.is_empty() && names.len() < 80 { + names.push(name.to_string()); + } + let lower = name.to_lowercase(); + let title = lower.starts_with("replace or skip") || lower.starts_with("sostituisci o ignora"); + if title || !REPLACE_NAMES.iter().any(|p| lower.starts_with(*p)) { + continue; + } + if let Ok(p) = e.GetCurrentPatternAs::(UIA_InvokePatternId) { + if p.Invoke().is_ok() { + return true; + } + } + let kind = e.CurrentControlType().ok(); + if !kind.is_some_and(|k| pressable.contains(&k)) { + continue; + } + let legacy = + e.GetCurrentPatternAs::(UIA_LegacyIAccessiblePatternId); + if legacy.is_ok_and(|p| p.DoDefaultAction().is_ok()) { + return true; + } + } + } + } + *SEEN.lock().unwrap_or_else(|e| e.into_inner()) = names; + false +} + +/// Pumps until `ok`, answering every Windows question of the host with `answer`; whether one came. +fn until_answering(r: &mut Run, what: &str, answer: fn(u32) -> bool, mut ok: impl FnMut(&Run) -> bool) -> bool { + let start = Instant::now(); + let mut asked = false; + loop { + r.f.pump(&mut r.h, 1); + r.h.render(); + let waiting = r.shared.ops.borrow().rows().iter().any(|row| row.needs_input); + if waiting { + if let Some(pid) = r.shared.services.ops.host_pid() { + asked |= answer(pid); + } + } + if ok(r) { + return asked; + } + assert!( + start.elapsed() < Duration::from_secs(120), + "{what}: not within 120 s\n{}\nthe host's windows held: {:?}", + r.h.a11y_dump(), + seen() + ); + std::thread::sleep(Duration::from_millis(50)); + } +} + +/// An undo's row whose failures name each of `names` (the window says which items stayed, and why). +fn undo_failed_on(r: &Run, names: &[&str]) -> bool { + let m = r.shared.ops.borrow(); + let named = |row: &files_engine::ops_ui::OpRow, n: &str| { + row.failures + .iter() + .any(|(p, _)| p.file_name().is_some_and(|f| String::from_utf16_lossy(f).eq_ignore_ascii_case(n))) + }; + m.rows().iter().filter(|row| row.undo_of.is_some()).any(|row| names.iter().all(|n| named(row, n))) +} + +/// The files of the shell's data object for `paths` on the clipboard with their drop effect, as File Explorer's Copy +/// (`cut` false) and Cut put them. +fn place_as_file_explorer(paths: &[PathBuf], cut: bool) { + // SAFETY: COM and OLE are initialised on this thread; every PIDL is freed after the array holds its own copies; + // the effect's memory goes to the data object (release true). + unsafe { + let mut pidls: Vec<*mut ITEMIDLIST> = Vec::new(); + for p in paths { + let wide: Vec = p.as_os_str().to_string_lossy().encode_utf16().chain(std::iter::once(0)).collect(); + let mut pidl = std::ptr::null_mut(); + SHParseDisplayName(PCWSTR(wide.as_ptr()), None::<&IBindCtx>, &mut pidl, 0, None).expect("a PIDL"); + pidls.push(pidl); + } + let consts: Vec<*const ITEMIDLIST> = pidls.iter().map(|p| p.cast_const()).collect(); + let items: IShellItemArray = SHCreateShellItemArrayFromIDLists(&consts).expect("the items"); + for p in pidls { + ILFree(Some(p.cast_const())); + } + let data: IDataObject = items.BindToHandler(None::<&IBindCtx>, &BHID_DataObject).expect("the data object"); + let format = RegisterClipboardFormatW(w!("Preferred DropEffect")); + let mem = GlobalAlloc(GMEM_MOVEABLE, 4).expect("memory"); + let effect: u32 = if cut { 2 } else { 5 }; + let dst = GlobalLock(mem) as *mut u8; + std::ptr::copy_nonoverlapping(effect.to_le_bytes().as_ptr(), dst, 4); + let _ = GlobalUnlock(mem); + let fe = FORMATETC { + cfFormat: format as u16, + ptd: std::ptr::null_mut(), + dwAspect: DVASPECT_CONTENT.0, + lindex: -1, + tymed: TYMED_HGLOBAL.0 as u32, + }; + let medium = STGMEDIUM { + tymed: TYMED_HGLOBAL.0 as u32, + u: STGMEDIUM_0 { hGlobal: mem }, + pUnkForRelease: std::mem::ManuallyDrop::new(None), + }; + data.SetData(&fe, &medium, true).expect("the drop effect"); + OleSetClipboard(&data).expect("the clipboard"); + } +} + +fn ole() { + // SAFETY: this test thread's OLE (an STA); called once per test, before any clipboard or COM call. + let _ = unsafe { OleInitialize(None) }; +} + +fn fence(data: &TempRoot, volumes: &[String]) -> String { + std::iter::once(data.path().display().to_string()).chain(volumes.iter().cloned()).collect::>().join(";") +} + +/// The record of the switch being off: the window refuses with the not-available notice and the clipboard stays. +fn switch_off(data: &TempRoot, dir: &WidePath, fence: &str, owner: isize) -> Value { + let mut a = open(data, dir, &["notes.txt"], fence, owner); + a.h.key("Ctrl+A").key("Ctrl+C"); + a.h.render(); + let notice = a.h.a11y_dump().contains("Not available in this alpha"); + json!({"gate": "off", "notice": notice, "clipboard_written": clipboard_has_files()}) +} + +/// A copy, then a cut, from `src` (notes.txt, plan.txt) to two fresh folders of `volume`, each undone. +fn to_volume(data: &TempRoot, src: &WidePath, volume: &str, fence: &str, owner: isize) -> Value { + let (copy_dir, cut_dir) = (seed(data, volume, &[]), seed(data, volume, &[])); + let (notes, plan) = (child(src, "notes.txt"), child(src, "plan.txt")); + let (before_notes, before_plan) = (read(¬es), read(&plan)); + // Copy in one window, Paste in another, through the system clipboard. + let mut a = open(data, src, &["notes.txt", "plan.txt"], fence, owner); + a.h.key("Ctrl+A").key("Ctrl+C"); + assert!(clipboard_has_files(), "Copy put files on the clipboard"); + let mut b = open(data, ©_dir, &[], fence, owner); + b.h.key("Ctrl+V"); + let (c_notes, c_plan) = (child(©_dir, "notes.txt"), child(©_dir, "plan.txt")); + let asked_copy = until_answering(&mut b, "the copy", cancel, |r| r.idle() && exists(&c_notes) && exists(&c_plan)); + let copied = read(&c_notes) == before_notes && read(&c_plan) == before_plan; + b.until("the copy's undo record", |r| r.shared.undo.borrow().len() == 1); + b.h.key("Ctrl+Z"); + let undo_asked = until_answering(&mut b, "the copy's undo", cancel, |r| r.idle()); + let copies_gone = !exists(&c_notes) && !exists(&c_plan); + // A destination whose Recycle Bin this user turned off (NukeOnDelete): there the shell deletes a Recycle for good + // without a question, so the host leaves each copy where it is and fails it, as disposable_recycle_classes records + // for a Del. Recycling the copies does not apply; nothing may go without a question: both stay, byte for byte, and + // the undo names both. + let bin_off = files_engine::ops::classify::bin_turned_off(©_dir); + let copies_kept = read(&c_notes) == before_notes && read(&c_plan) == before_plan; + let undo_named = undo_failed_on(&b, &["notes.txt", "plan.txt"]); + b.shared.services.ops.shutdown(); + // Cut and Paste: moved, the clipboard emptied, then moved back. + a.h.key("Ctrl+A").key("Ctrl+X"); + let mut m = open(data, &cut_dir, &[], fence, owner); + m.h.key("Ctrl+V"); + let (m_notes, m_plan) = (child(&cut_dir, "notes.txt"), child(&cut_dir, "plan.txt")); + let asked_move = until_answering(&mut m, "the move", cancel, |r| r.idle() && exists(&m_notes) && !exists(¬es)); + let moved = read(&m_notes) == before_notes && read(&m_plan) == before_plan && !exists(&plan); + m.until("the clipboard emptied", |_| !clipboard_has_files()); + m.until("the move's undo record", |r| r.shared.undo.borrow().len() == 1); + m.h.key("Ctrl+Z"); + let back_asked = until_answering(&mut m, "the move back", cancel, |r| r.idle() && exists(¬es)); + let back = read(¬es) == before_notes && read(&plan) == before_plan && !exists(&m_notes); + m.shared.services.ops.shutdown(); + a.shared.services.ops.shutdown(); + let row = json!({ + "copied": copied, "copy_asked": asked_copy, "undo_copy_gone": copies_gone, "undo_copy_asked": undo_asked, + "moved": moved, "move_asked": asked_move, "clipboard_emptied": true, "moved_back": back, + "move_back_asked": back_asked, "bin_off": bin_off, "undo_copy_kept": copies_kept, "undo_named": undo_named, + }); + assert!(copied && moved && back, "{volume}: {row}"); + if bin_off { + eprintln!( + "{volume}: the copies' recycle is not applicable: this user turned this volume's Recycle Bin off, so the \ + host keeps the copies and the undo says so" + ); + assert!( + !copies_gone && copies_kept && undo_named, + "{volume}: with its Recycle Bin off the copies' undo keeps both copies and names them: {row}" + ); + } else { + assert!(copies_gone || undo_asked, "{volume}: the copies' undo neither recycled them nor asked: {row}"); + } + row +} + +#[test] +#[ignore = "disposable: CI files-disposable job only"] +fn disposable_paste_between_the_volumes() { + common::disposable(); + let _turn = CLIPBOARD.lock().unwrap_or_else(|e| e.into_inner()); + ole(); + let data = TempRoot::new("disp_paste"); + let vols: Vec = VARS.into_iter().map(var).collect(); + let fence = fence(&data, &vols); + let owner = owner(); + let mut failed = Vec::new(); + if !gate::PASTE_LIVE { + let src = seed(&data, &vols[0], &[("notes.txt", b"made-up notes")]); + let path = record("switch", switch_off(&data, &src, &fence, owner)); + println!("paste record: {}", path.display()); + return; + } + for (from, to) in LEGS { + let key = format!("{from}->{to}"); + let row = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { + let src = seed(&data, &var(from), &[("notes.txt", b"made-up notes"), ("plan.txt", b"made-up plan")]); + to_volume(&data, &src, &var(to), &fence, owner) + })); + let row = match row { + Ok(row) => row, + Err(e) => { + let why = + e.downcast_ref::().cloned().or_else(|| e.downcast_ref::<&str>().map(|s| s.to_string())); + failed.push(key.clone()); + json!({"failed": why}) + } + }; + println!("paste {key}: {row}"); + let path = record(&key, row); + println!("paste record: {}", path.display()); + } + assert!(failed.is_empty(), "failed on {failed:?}: see disposable/paste.json"); +} + +#[test] +#[ignore = "disposable: CI files-disposable job only"] +fn disposable_paste_conflict_dialog() { + common::disposable(); + let _turn = CLIPBOARD.lock().unwrap_or_else(|e| e.into_inner()); + ole(); + let data = TempRoot::new("disp_paste_conflict"); + let vols: Vec = VARS.into_iter().map(var).collect(); + let fence = fence(&data, &vols); + let owner = owner(); + let src = seed(&data, &vols[0], &[("notes.txt", b"newer notes")]); + let dst = seed(&data, &vols[1], &[("notes.txt", b"older notes")]); + let target = child(&dst, "notes.txt"); + if !gate::PASTE_LIVE { + record("conflict", switch_off(&data, &src, &fence, owner)); + return; + } + let mut a = open(&data, &src, &["notes.txt"], &fence, owner); + a.h.key("Ctrl+A").key("Ctrl+C"); + let mut b = open(&data, &dst, &["notes.txt"], &fence, owner); + // Cancelled: the destination is unchanged. + b.h.key("Ctrl+V"); + let ran = |r: &Run| r.idle() && !r.shared.ops.borrow().rows().is_empty(); + let asked = until_answering(&mut b, "the cancelled paste", cancel, ran); + let kept = read(&target) == b"older notes"; + // Replace: the source's bytes. + b.h.key("Ctrl+V"); + let newer = |r: &Run| r.idle() && read(&target) == b"newer notes"; + let replace_asked = until_answering(&mut b, "the replacing paste", replace, newer); + let replaced = read(&target) == b"newer notes"; + let dump = b.h.a11y_dump(); + b.shared.services.ops.shutdown(); + a.shared.services.ops.shutdown(); + let row = json!({"cancel_asked": asked, "cancel_kept": kept, "replace_asked": replace_asked, "replaced": replaced}); + let path = record("conflict", row.clone()); + println!("paste conflict: {row} in {}", path.display()); + assert!(asked && kept, "Windows' dialog was cancelled and nothing changed: {row}\n{dump}"); + assert!(replace_asked && replaced, "Replace took the source's bytes: {row}\n{dump}"); +} + +#[test] +#[ignore = "disposable: CI files-disposable job only"] +fn disposable_paste_of_files_placed_as_file_explorer_does() { + common::disposable(); + let _turn = CLIPBOARD.lock().unwrap_or_else(|e| e.into_inner()); + ole(); + let data = TempRoot::new("disp_paste_explorer"); + let vols: Vec = VARS.into_iter().map(var).collect(); + let fence = fence(&data, &vols); + let owner = owner(); + let src = seed(&data, &vols[0], &[("notes.txt", b"made-up notes"), ("plan.txt", b"made-up plan")]); + let (copy_dir, cut_dir) = (seed(&data, &vols[1], &[]), seed(&data, &vols[1], &[])); + let path = |d: &WidePath, n: &str| PathBuf::from(child(d, n).to_string_lossy()); + if !gate::PASTE_LIVE { + record("file_explorer", switch_off(&data, &src, &fence, owner)); + return; + } + place_as_file_explorer(&[path(&src, "notes.txt"), path(&src, "plan.txt")], false); + let mut b = open(&data, ©_dir, &[], &fence, owner); + let paste = oled_ui::CommandId(files_engine::keys::Cmd::Paste as u32); + let paste_on = b.h.screen().toolbar().bar().item(paste).is_some_and(|i| i.enabled); + b.h.key("Ctrl+V"); + let (c_notes, c_plan) = (child(©_dir, "notes.txt"), child(©_dir, "plan.txt")); + until_answering(&mut b, "the copy", cancel, |r| r.idle() && exists(&c_notes) && exists(&c_plan)); + let copied = read(&c_notes) == b"made-up notes" && read(&c_plan) == b"made-up plan"; + let kept = exists(&child(&src, "notes.txt")); + b.shared.services.ops.shutdown(); + place_as_file_explorer(&[path(&src, "plan.txt")], true); + let mut m = open(&data, &cut_dir, &[], &fence, owner); + m.h.key("Ctrl+V"); + let moved_to = child(&cut_dir, "plan.txt"); + until_answering(&mut m, "the move", cancel, |r| r.idle() && exists(&moved_to)); + let moved = read(&moved_to) == b"made-up plan" && !exists(&child(&src, "plan.txt")); + m.until("the clipboard emptied", |_| !clipboard_has_files()); + m.shared.services.ops.shutdown(); + let row = json!({"paste_enabled": paste_on, "copied": copied, "sources_kept": kept, "moved": moved}); + let at = record("file_explorer", row.clone()); + println!("paste as File Explorer: {row} in {}", at.display()); + assert!(paste_on && copied && kept && moved, "{row}"); +} diff --git a/apps/files/tests/disposable_ui.rs b/apps/files/tests/disposable_ui.rs index aecb8dc4..69c20280 100644 --- a/apps/files/tests/disposable_ui.rs +++ b/apps/files/tests/disposable_ui.rs @@ -14,6 +14,7 @@ use files_engine::fakes::{self, Fakes, FT_2026_11_21}; use files_engine::format::Fmt; use files_engine::host::TestHooks; use files_engine::listing::WidePath; +use files_engine::ops::classify::Recyclability; use files_engine::ops::consts::RESTORE_FROM_BIN; use files_engine::ops_client::{OpsClient, OpsConfig, OpsError, OpsEvent, UndoRecord}; use files_engine::services::OpsService; @@ -21,7 +22,7 @@ use files_engine::session::Session; use files_engine::tr::{k, t}; use files_engine::types::TypeNames; use files_engine::window::{FilesScreen, Shared, WinKind, WinRec}; -use oled_trust::frame::files::{ItemRef, Location, OpId}; +use oled_trust::frame::files::{Conflicts, ItemRef, Location, OpId}; use oled_ui::harness::Harness; use oled_ui::{SizeL, Tokens, UiLang}; @@ -29,6 +30,12 @@ use oled_ui::{SizeL, Tokens, UiLang}; struct RealOps(OpsClient); impl OpsService for RealOps { + fn copy(&self, items: &[ItemRef], dest: &WidePath) -> Result { + self.0.copy(items, dest, Conflicts::AskSystem) + } + fn move_to(&self, items: &[ItemRef], dest: &WidePath) -> Result { + self.0.move_to(items, dest, Conflicts::AskSystem) + } fn recycle(&self, items: &[ItemRef]) -> Result { self.0.recycle(items) } @@ -109,6 +116,11 @@ fn window(data: &TempRoot, dir: &WidePath, name: &str, fence: &str) -> Run { Run { f, shared, h } } +/// The system's classifier, the one the window runs on a Del, answers Yes for `item`. +fn vouched(item: &WidePath) -> bool { + files_engine::ops_ui::system_facts(&[(item.clone(), 0)]).first().is_some_and(|(_, r)| *r == Recyclability::Yes) +} + impl Run { /// Pumps until the condition holds (the real helper answers on its own thread). fn until(&mut self, what: &str, mut ok: impl FnMut(&Run) -> bool) { @@ -130,12 +142,23 @@ impl Run { fn disposable_del_flow_on_the_runner() { common::disposable(); let data = TempRoot::new("disp_del_flow"); - // A FAT32 volume and a share: no Recycle Bin the classifier can vouch for, so Del asks first. The item need not + // A FAT32 volume and a share: while the classifier cannot vouch for their bin, Del asks first. The item need not // exist: the classification reads the volume, never the file's content, and nothing is sent before the bar. for var in ["FILES_DISP_FAT", "FILES_DISP_UNC"] { let base = std::env::var(var).unwrap_or_else(|_| panic!("{var} is set by files-disposable.ps1 -Setup")); let dir = WidePath::parse(&base).unwrap(); let item = dir.join(&"report-final-v2.pdf".encode_utf16().collect::>()).unwrap(); + if var == "FILES_DISP_FAT" && vouched(&item) { + // A fixed FAT32 volume has a Recycle Bin of its own. Once this user's values for it are readable, the + // classifier the window uses vouches for it and Del recycles, as on NTFS: disposable_mutations proves that + // recycle and its restore on this volume. Nothing is sent here. + eprintln!( + "disposable_del_flow_on_the_runner: {var}: not applicable: the system's classifier vouches for this \ + volume's Recycle Bin (a fixed drive, this user's NukeOnDelete=0 and MaxCapacity readable, the bin \ + queryable), so Del recycles instead of opening the bar" + ); + continue; + } let mut r = window(&data, &dir, "report-final-v2.pdf", &base); r.h.key("Del"); r.until(&format!("{var}: the bar"), |r| bar::bar_of(r.h.screen()).is_open()); diff --git a/apps/files/tests/freeze_app.rs b/apps/files/tests/freeze_app.rs index c99fdeb8..066f0f16 100644 --- a/apps/files/tests/freeze_app.rs +++ b/apps/files/tests/freeze_app.rs @@ -8,10 +8,14 @@ use oled_ui::UiLang; /// The keys whose English and Italian texts are the same on purpose (true cognates and pure placeholders). A key added /// later with identical texts joins this list in the same commit. -const SAME_IN_BOTH: [&str; 13] = [ +const SAME_IN_BOTH: [&str; 18] = [ + "files.filter.audio", + "files.filter.video", "files.app.title_beta", "files.app.beta", "files.app.home", + "files.side.home", + "files.side.known_desktop", "files.type.file", "files.size.b", "files.size.kb", @@ -19,6 +23,7 @@ const SAME_IN_BOTH: [&str; 13] = [ "files.size.gb", "files.size.tb", "files.ops.chip", + "files.ops.chip_paste", "files.ops.eta_min", "files.ops.eta_s", "files.side.drive", @@ -364,7 +369,7 @@ fn freeze_items_compile() { // Plain values of the frozen types. let o = options::FilesOptions::default(); assert!( - o.show_extensions && o.sidebar_visible && o.downloads_by_date && o.new_tab == "home" && o.sidebar_width == 200 + o.show_extensions && o.sidebar_visible && o.downloads_by_date && o.new_tab == "home" && o.sidebar_width == 224 ); assert_eq!(session::Session::default(), session::Session::default()); assert_eq!(window::timer(names::TIMER_NOTICE, TabId(0x0123_4567)), oled_ui::TimerId(0x0923_4567)); @@ -485,6 +490,11 @@ fn spec_rows() -> Vec<(Cmd, Vec, Parity, Slice)> { (Cmd::OpenInExplorer, vec![c("Ctrl+Shift+O")], Ours, F2), (Cmd::Escape, vec![c("Esc")], Same, F1a), (Cmd::About, vec![], Ours, F4), + (Cmd::Cut, vec![c("Ctrl+X")], Same, F3), + (Cmd::Copy, vec![c("Ctrl+C")], Same, F3), + (Cmd::Paste, vec![c("Ctrl+V")], Same, F3), + (Cmd::FocusSearch, vec![c("Ctrl+F"), c("Ctrl+E"), c("F3")], Same, F4), + (Cmd::DetailsPane, vec![c("Alt+Shift+P")], Same, F4), ]); rows } @@ -510,11 +520,6 @@ fn key_table_matches_spec() { // Not bound in F1-F4: Windows' or the kit's default applies. let t = keys::command_table(oled_ui::UiLang::EN); for free in [ - "Ctrl+C", - "Ctrl+X", - "Ctrl+V", - "Ctrl+F", - "Ctrl+E", "Ctrl+P", "Ctrl+Shift+P", "F7", @@ -1014,8 +1019,12 @@ fn gate_table() { } } assert!(WidePath::parse(&format!(r"{live}\..\..\x")).is_err(), "a path with .. never reaches the gate"); + // The pure core above is the gate of a build with the switch off; this build has it on, so the system adapter + // lets a real path through to the operations host (which checks it there). let real = std::hint::black_box(gate::REAL_DATA_MUTATIONS); - assert!(!real, "real data stays off until FS-3 rows a to c are recorded"); + assert!(real, "real data is on"); + assert!(gate::may_mutate(&[&wp(r"C:\Users\tester\Documents\notes.txt")])); + assert!(!gate::may_mutate(&[]), "an empty request is never let through"); } /// FilesScreen inside a screen that runs ops_ui::request for every MutReq it receives (request needs an EventCx). @@ -1055,20 +1064,23 @@ fn request_is_gated() { let out = Rc::new(RefCell::new(Vec::new())); let r = Requester { s: screen(&f, 1, STARTUP_TAB), out: Rc::clone(&out) }; let mut h = Harness::new(r, SizeL { w: 800, h: 500 }, 96, Tokens::oled()); + // Real data on: a request for a real path reaches the operations seam (here the recorder), which checks it; an + // empty one and the rest of an earlier process's operation (no items known) never do. let outside = wp(r"C:\mod-files-made-up\projects\report-final-v2.pdf"); h.send(Box::new(MutReq::Recycle(vec![outside.clone()]))); - h.send(Box::new(MutReq::Rename { item: outside, to: "x.pdf".into() })); + h.send(Box::new(MutReq::Rename { item: outside.clone(), to: "x.pdf".into() })); h.send(Box::new(MutReq::Recycle(Vec::new()))); h.send(Box::new(MutReq::ResumeRest(OpId(9)))); - assert_eq!(*out.borrow(), [None, None, None, None]); - assert!(f.ops.calls().is_empty(), "nothing reached the operations helper"); + assert_eq!(*out.borrow(), [Some(OpId(1)), Some(OpId(2)), None, None]); + let item = oled_trust::frame::files::ItemRef::Path(outside.clone()); + assert_eq!(f.ops.calls(), [OpsCall::Recycle(vec![item]), OpsCall::Rename(outside, "x.pdf".into())]); let root = TempRoot::new("request_is_gated"); let file = wp(&root.file("report-final-v3.pdf", b"x").to_string_lossy()); let dir = wp(&root.path().to_string_lossy()); h.send(Box::new(MutReq::Recycle(vec![file.clone()]))); h.send(Box::new(MutReq::NewFolder { parent: dir.clone(), name: "projects".into() })); h.send(Box::new(MutReq::Rename { item: file.clone(), to: "report-final-v4.pdf".into() })); - assert_eq!(out.borrow()[4..], [Some(OpId(1)), Some(OpId(2)), Some(OpId(3))]); + assert_eq!(out.borrow()[4..], [Some(OpId(3)), Some(OpId(4)), Some(OpId(5))]); // A destination that is not one valid name is refused before the gate and the helper, even inside a root. for to in ["..", r"a\b", "a/b", ""] { h.send(Box::new(MutReq::Rename { item: file.clone(), to: to.into() })); @@ -1076,9 +1088,9 @@ fn request_is_gated() { h.send(Box::new(MutReq::NewFolder { parent: dir.clone(), name: r"a\b".into() })); h.send(Box::new(MutReq::Rename { item: wp(r"C:\"), to: "x".into() })); assert_eq!(out.borrow()[7..], [None, None, None, None, None, None]); - assert_eq!(f.ops.calls().len(), 3, "no further call reached the operations helper"); - assert_eq!(f.ops.calls()[0], OpsCall::Recycle(vec![oled_trust::frame::files::ItemRef::Path(file)])); - assert_eq!(f.ops.calls()[1], OpsCall::NewFolder(dir, "projects".into())); + assert_eq!(f.ops.calls().len(), 5, "no further call reached the operations helper"); + assert_eq!(f.ops.calls()[2], OpsCall::Recycle(vec![oled_trust::frame::files::ItemRef::Path(file)])); + assert_eq!(f.ops.calls()[3], OpsCall::NewFolder(dir, "projects".into())); f.ops.set_fail(Some(files_engine::ops_client::OpsError::Unavailable("gone"))); h.send(Box::new(MutReq::Recycle(vec![wp(&root.path().join("report-final-v3.pdf").to_string_lossy())]))); assert_eq!(out.borrow().last(), Some(&None), "an unavailable helper is a notice, not an op"); diff --git a/apps/files/tests/golden/base/about/a11y-en.txt b/apps/files/tests/golden/base/about/a11y-en.txt index 2ea8da5e..0ddbb628 100644 --- a/apps/files/tests/golden/base/about/a11y-en.txt +++ b/apps/files/tests/golden/base/about/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,26 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -40,6 +48,8 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" Group Dialog "Folio Alpha" diff --git a/apps/files/tests/golden/base/about/a11y-it.txt b/apps/files/tests/golden/base/about/a11y-it.txt index 7035a76f..abe85f1c 100644 --- a/apps/files/tests/golden/base/about/a11y-it.txt +++ b/apps/files/tests/golden/base/about/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,25 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -40,6 +47,8 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" Group Dialog "Folio Alpha" diff --git a/apps/files/tests/golden/base/about/en-96.png b/apps/files/tests/golden/base/about/en-96.png index 6c9600e9..d2e389ce 100644 Binary files a/apps/files/tests/golden/base/about/en-96.png and b/apps/files/tests/golden/base/about/en-96.png differ diff --git a/apps/files/tests/golden/base/about/hc-144.png b/apps/files/tests/golden/base/about/hc-144.png index 0c515f8d..5fa574c0 100644 Binary files a/apps/files/tests/golden/base/about/hc-144.png and b/apps/files/tests/golden/base/about/hc-144.png differ diff --git a/apps/files/tests/golden/base/about/it-144.png b/apps/files/tests/golden/base/about/it-144.png index a531de59..7abb4808 100644 Binary files a/apps/files/tests/golden/base/about/it-144.png and b/apps/files/tests/golden/base/about/it-144.png differ diff --git a/apps/files/tests/golden/base/about/pseudo-144.png b/apps/files/tests/golden/base/about/pseudo-144.png index d012f093..6e194906 100644 Binary files a/apps/files/tests/golden/base/about/pseudo-144.png and b/apps/files/tests/golden/base/about/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/breadcrumb_fold/a11y-en.txt b/apps/files/tests/golden/base/breadcrumb_fold/a11y-en.txt index 798ac0a7..e40ed85e 100644 --- a/apps/files/tests/golden/base/breadcrumb_fold/a11y-en.txt +++ b/apps/files/tests/golden/base/breadcrumb_fold/a11y-en.txt @@ -5,19 +5,26 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to invoices · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +Button "Search in scans" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" Link "More" [focusable] + Link "autumn" [focusable] + Button "Subfolders" Link "invoices" [focusable] Button "Subfolders" Link "scans" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "More" [focusable, expandable] + Button "Details" [focusable] ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -32,4 +39,6 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/breadcrumb_fold/a11y-it.txt b/apps/files/tests/golden/base/breadcrumb_fold/a11y-it.txt index c18a54e1..cefa7c85 100644 --- a/apps/files/tests/golden/base/breadcrumb_fold/a11y-it.txt +++ b/apps/files/tests/golden/base/breadcrumb_fold/a11y-it.txt @@ -5,19 +5,26 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a invoices · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +Button "Cerca in scans" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" Link "Altro" [focusable] + Link "autumn" [focusable] + Button "Sottocartelle" Link "invoices" [focusable] Button "Sottocartelle" Link "scans" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -32,4 +39,6 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/breadcrumb_fold/en-96.png b/apps/files/tests/golden/base/breadcrumb_fold/en-96.png index 4278df13..5613551a 100644 Binary files a/apps/files/tests/golden/base/breadcrumb_fold/en-96.png and b/apps/files/tests/golden/base/breadcrumb_fold/en-96.png differ diff --git a/apps/files/tests/golden/base/breadcrumb_fold/hc-144.png b/apps/files/tests/golden/base/breadcrumb_fold/hc-144.png index ebfadcb2..085a9f93 100644 Binary files a/apps/files/tests/golden/base/breadcrumb_fold/hc-144.png and b/apps/files/tests/golden/base/breadcrumb_fold/hc-144.png differ diff --git a/apps/files/tests/golden/base/breadcrumb_fold/it-144.png b/apps/files/tests/golden/base/breadcrumb_fold/it-144.png index 98de9e3f..047e22fe 100644 Binary files a/apps/files/tests/golden/base/breadcrumb_fold/it-144.png and b/apps/files/tests/golden/base/breadcrumb_fold/it-144.png differ diff --git a/apps/files/tests/golden/base/breadcrumb_fold/pseudo-144.png b/apps/files/tests/golden/base/breadcrumb_fold/pseudo-144.png index 9b77239b..38b71aa2 100644 Binary files a/apps/files/tests/golden/base/breadcrumb_fold/pseudo-144.png and b/apps/files/tests/golden/base/breadcrumb_fold/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/chrome_custom/a11y-en.txt b/apps/files/tests/golden/base/chrome_custom/a11y-en.txt index bb753003..d181cdce 100644 --- a/apps/files/tests/golden/base/chrome_custom/a11y-en.txt +++ b/apps/files/tests/golden/base/chrome_custom/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,23 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" - TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -40,4 +45,6 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/chrome_custom/a11y-it.txt b/apps/files/tests/golden/base/chrome_custom/a11y-it.txt index 1cb5dbdc..1fe82831 100644 --- a/apps/files/tests/golden/base/chrome_custom/a11y-it.txt +++ b/apps/files/tests/golden/base/chrome_custom/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,22 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" - TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -40,4 +44,6 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/chrome_custom/en-96.png b/apps/files/tests/golden/base/chrome_custom/en-96.png index 79274caa..ac5f2bf0 100644 Binary files a/apps/files/tests/golden/base/chrome_custom/en-96.png and b/apps/files/tests/golden/base/chrome_custom/en-96.png differ diff --git a/apps/files/tests/golden/base/chrome_custom/hc-144.png b/apps/files/tests/golden/base/chrome_custom/hc-144.png index 672be3b5..5a56d986 100644 Binary files a/apps/files/tests/golden/base/chrome_custom/hc-144.png and b/apps/files/tests/golden/base/chrome_custom/hc-144.png differ diff --git a/apps/files/tests/golden/base/chrome_custom/it-144.png b/apps/files/tests/golden/base/chrome_custom/it-144.png index eec9049d..e0229aa7 100644 Binary files a/apps/files/tests/golden/base/chrome_custom/it-144.png and b/apps/files/tests/golden/base/chrome_custom/it-144.png differ diff --git a/apps/files/tests/golden/base/chrome_custom/pseudo-144.png b/apps/files/tests/golden/base/chrome_custom/pseudo-144.png index acbd7c27..0dc42905 100644 Binary files a/apps/files/tests/golden/base/chrome_custom/pseudo-144.png and b/apps/files/tests/golden/base/chrome_custom/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/chrome_row/a11y-en.txt b/apps/files/tests/golden/base/chrome_row/a11y-en.txt index 7b0bf679..bbc9b1c7 100644 --- a/apps/files/tests/golden/base/chrome_row/a11y-en.txt +++ b/apps/files/tests/golden/base/chrome_row/a11y-en.txt @@ -9,10 +9,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -21,15 +18,23 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" - TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -44,4 +49,6 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/chrome_row/a11y-it.txt b/apps/files/tests/golden/base/chrome_row/a11y-it.txt index dd8dc282..910069b0 100644 --- a/apps/files/tests/golden/base/chrome_row/a11y-it.txt +++ b/apps/files/tests/golden/base/chrome_row/a11y-it.txt @@ -9,10 +9,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -21,15 +18,22 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" - TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -44,4 +48,6 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/chrome_row/contrast-144.png b/apps/files/tests/golden/base/chrome_row/contrast-144.png index 06a3d496..3a0e5969 100644 Binary files a/apps/files/tests/golden/base/chrome_row/contrast-144.png and b/apps/files/tests/golden/base/chrome_row/contrast-144.png differ diff --git a/apps/files/tests/golden/base/chrome_row/en-120.png b/apps/files/tests/golden/base/chrome_row/en-120.png index d045f30d..a65b54ed 100644 Binary files a/apps/files/tests/golden/base/chrome_row/en-120.png and b/apps/files/tests/golden/base/chrome_row/en-120.png differ diff --git a/apps/files/tests/golden/base/chrome_row/en-144.png b/apps/files/tests/golden/base/chrome_row/en-144.png index 06a3d496..3a0e5969 100644 Binary files a/apps/files/tests/golden/base/chrome_row/en-144.png and b/apps/files/tests/golden/base/chrome_row/en-144.png differ diff --git a/apps/files/tests/golden/base/chrome_row/en-192.png b/apps/files/tests/golden/base/chrome_row/en-192.png index 95d9b7ad..22b8257b 100644 Binary files a/apps/files/tests/golden/base/chrome_row/en-192.png and b/apps/files/tests/golden/base/chrome_row/en-192.png differ diff --git a/apps/files/tests/golden/base/chrome_row/en-96.png b/apps/files/tests/golden/base/chrome_row/en-96.png index 97b87fab..7df79e0a 100644 Binary files a/apps/files/tests/golden/base/chrome_row/en-96.png and b/apps/files/tests/golden/base/chrome_row/en-96.png differ diff --git a/apps/files/tests/golden/base/chrome_row/hc-144.png b/apps/files/tests/golden/base/chrome_row/hc-144.png index c93a3771..3fa81ea2 100644 Binary files a/apps/files/tests/golden/base/chrome_row/hc-144.png and b/apps/files/tests/golden/base/chrome_row/hc-144.png differ diff --git a/apps/files/tests/golden/base/chrome_row/hc-96.png b/apps/files/tests/golden/base/chrome_row/hc-96.png index 19e840c2..58d6ad44 100644 Binary files a/apps/files/tests/golden/base/chrome_row/hc-96.png and b/apps/files/tests/golden/base/chrome_row/hc-96.png differ diff --git a/apps/files/tests/golden/base/chrome_row/it-120.png b/apps/files/tests/golden/base/chrome_row/it-120.png index d86b7798..8a9be263 100644 Binary files a/apps/files/tests/golden/base/chrome_row/it-120.png and b/apps/files/tests/golden/base/chrome_row/it-120.png differ diff --git a/apps/files/tests/golden/base/chrome_row/it-144.png b/apps/files/tests/golden/base/chrome_row/it-144.png index b2704f95..e918349c 100644 Binary files a/apps/files/tests/golden/base/chrome_row/it-144.png and b/apps/files/tests/golden/base/chrome_row/it-144.png differ diff --git a/apps/files/tests/golden/base/chrome_row/it-192.png b/apps/files/tests/golden/base/chrome_row/it-192.png index 857c5dc1..a13741c4 100644 Binary files a/apps/files/tests/golden/base/chrome_row/it-192.png and b/apps/files/tests/golden/base/chrome_row/it-192.png differ diff --git a/apps/files/tests/golden/base/chrome_row/it-96.png b/apps/files/tests/golden/base/chrome_row/it-96.png index 5b826fb0..8cf2b97d 100644 Binary files a/apps/files/tests/golden/base/chrome_row/it-96.png and b/apps/files/tests/golden/base/chrome_row/it-96.png differ diff --git a/apps/files/tests/golden/base/chrome_row/pseudo-144.png b/apps/files/tests/golden/base/chrome_row/pseudo-144.png index 06a3d496..c17d6b83 100644 Binary files a/apps/files/tests/golden/base/chrome_row/pseudo-144.png and b/apps/files/tests/golden/base/chrome_row/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_alpha/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_alpha/a11y-en.txt new file mode 100644 index 00000000..e0a6f09f --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_alpha/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/cmdbar_alpha/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_alpha/a11y-it.txt new file mode 100644 index 00000000..d774946d --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_alpha/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/cmdbar_alpha/en-96.png b/apps/files/tests/golden/base/cmdbar_alpha/en-96.png new file mode 100644 index 00000000..b6655aa3 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_alpha/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_alpha/hc-144.png b/apps/files/tests/golden/base/cmdbar_alpha/hc-144.png new file mode 100644 index 00000000..7b0d6aad Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_alpha/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_alpha/it-144.png b/apps/files/tests/golden/base/cmdbar_alpha/it-144.png new file mode 100644 index 00000000..72893bf7 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_alpha/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_alpha/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_alpha/pseudo-144.png new file mode 100644 index 00000000..53d6c465 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_alpha/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_focus_rename/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_focus_rename/a11y-en.txt new file mode 100644 index 00000000..c7d5e4a0 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_focus_rename/a11y-en.txt @@ -0,0 +1,55 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 3 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable, selected] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected" diff --git a/apps/files/tests/golden/base/cmdbar_focus_rename/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_focus_rename/a11y-it.txt new file mode 100644 index 00000000..dab59989 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_focus_rename/a11y-it.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 3 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable, selected] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato" diff --git a/apps/files/tests/golden/base/cmdbar_focus_rename/en-96.png b/apps/files/tests/golden/base/cmdbar_focus_rename/en-96.png new file mode 100644 index 00000000..dbb96f7d Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_focus_rename/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_focus_rename/hc-144.png b/apps/files/tests/golden/base/cmdbar_focus_rename/hc-144.png new file mode 100644 index 00000000..4434ed86 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_focus_rename/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_focus_rename/it-144.png b/apps/files/tests/golden/base/cmdbar_focus_rename/it-144.png new file mode 100644 index 00000000..7b9beb97 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_focus_rename/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_focus_rename/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_focus_rename/pseudo-144.png new file mode 100644 index 00000000..6b1b16e7 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_focus_rename/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_hover_hint/a11y-en.txt new file mode 100644 index 00000000..e0a6f09f --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_hover_hint/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_hover_hint/a11y-it.txt new file mode 100644 index 00000000..d774946d --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_hover_hint/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/contrast-144.png b/apps/files/tests/golden/base/cmdbar_hover_hint/contrast-144.png new file mode 100644 index 00000000..2fde87a6 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_hover_hint/contrast-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/en-120.png b/apps/files/tests/golden/base/cmdbar_hover_hint/en-120.png new file mode 100644 index 00000000..99a0ba00 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_hover_hint/en-120.png differ diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/en-144.png b/apps/files/tests/golden/base/cmdbar_hover_hint/en-144.png new file mode 100644 index 00000000..2fde87a6 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_hover_hint/en-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/en-192.png b/apps/files/tests/golden/base/cmdbar_hover_hint/en-192.png new file mode 100644 index 00000000..507d3867 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_hover_hint/en-192.png differ diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/en-96.png b/apps/files/tests/golden/base/cmdbar_hover_hint/en-96.png new file mode 100644 index 00000000..3b504cf5 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_hover_hint/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/hc-144.png b/apps/files/tests/golden/base/cmdbar_hover_hint/hc-144.png new file mode 100644 index 00000000..8dbfb622 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_hover_hint/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/hc-96.png b/apps/files/tests/golden/base/cmdbar_hover_hint/hc-96.png new file mode 100644 index 00000000..d101293f Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_hover_hint/hc-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/it-120.png b/apps/files/tests/golden/base/cmdbar_hover_hint/it-120.png new file mode 100644 index 00000000..f19dd105 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_hover_hint/it-120.png differ diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/it-144.png b/apps/files/tests/golden/base/cmdbar_hover_hint/it-144.png new file mode 100644 index 00000000..333a219d Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_hover_hint/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/it-192.png b/apps/files/tests/golden/base/cmdbar_hover_hint/it-192.png new file mode 100644 index 00000000..b259b352 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_hover_hint/it-192.png differ diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/it-96.png b/apps/files/tests/golden/base/cmdbar_hover_hint/it-96.png new file mode 100644 index 00000000..ce917c7c Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_hover_hint/it-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_hover_hint/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_hover_hint/pseudo-144.png new file mode 100644 index 00000000..8c3f559c Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_hover_hint/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_menu_more/a11y-en.txt new file mode 100644 index 00000000..77c9e623 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_menu_more/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable, expanded] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/cmdbar_menu_more/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_menu_more/a11y-it.txt new file mode 100644 index 00000000..a49930fd --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_menu_more/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable, expanded] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/cmdbar_menu_more/en-96-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_more/en-96-menu0.png new file mode 100644 index 00000000..96e222f2 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more/en-96-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more/en-96.png b/apps/files/tests/golden/base/cmdbar_menu_more/en-96.png new file mode 100644 index 00000000..773fb1ae Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more/hc-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_more/hc-144-menu0.png new file mode 100644 index 00000000..effdeaef Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more/hc-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more/hc-144.png b/apps/files/tests/golden/base/cmdbar_menu_more/hc-144.png new file mode 100644 index 00000000..cf4868e7 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more/it-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_more/it-144-menu0.png new file mode 100644 index 00000000..7b1ae1df Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more/it-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more/it-144.png b/apps/files/tests/golden/base/cmdbar_menu_more/it-144.png new file mode 100644 index 00000000..2c18ec38 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more/pseudo-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_more/pseudo-144-menu0.png new file mode 100644 index 00000000..af71d7b1 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more/pseudo-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_menu_more/pseudo-144.png new file mode 100644 index 00000000..8696ddf9 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_narrow/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/a11y-en.txt new file mode 100644 index 00000000..f5611902 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/a11y-en.txt @@ -0,0 +1,42 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +Button "Search in documents" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "More" [focusable, expandable, expanded] + Button "Details" [focusable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_narrow/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/a11y-it.txt new file mode 100644 index 00000000..b000e873 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/a11y-it.txt @@ -0,0 +1,41 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +Button "Cerca in documents" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Altro" [focusable, expandable, expanded] + Button "Dettagli" [focusable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_narrow/en-96-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/en-96-menu0.png new file mode 100644 index 00000000..edb1a8f0 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/en-96-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_narrow/en-96.png b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/en-96.png new file mode 100644 index 00000000..f807d6b0 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_narrow/hc-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/hc-144-menu0.png new file mode 100644 index 00000000..3add2340 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/hc-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_narrow/hc-144.png b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/hc-144.png new file mode 100644 index 00000000..5cd8139f Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_narrow/it-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/it-144-menu0.png new file mode 100644 index 00000000..2bad145c Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/it-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_narrow/it-144.png b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/it-144.png new file mode 100644 index 00000000..b4abfe06 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_narrow/pseudo-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/pseudo-144-menu0.png new file mode 100644 index 00000000..dc38c46e Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/pseudo-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_narrow/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/pseudo-144.png new file mode 100644 index 00000000..a79361e8 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_narrow/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_nodock/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/a11y-en.txt new file mode 100644 index 00000000..77c9e623 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable, expanded] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_nodock/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/a11y-it.txt new file mode 100644 index 00000000..a49930fd --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable, expanded] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_nodock/en-96-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/en-96-menu0.png new file mode 100644 index 00000000..95dd5e5e Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/en-96-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_nodock/en-96.png b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/en-96.png new file mode 100644 index 00000000..773fb1ae Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_nodock/hc-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/hc-144-menu0.png new file mode 100644 index 00000000..2dffdbdd Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/hc-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_nodock/hc-144.png b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/hc-144.png new file mode 100644 index 00000000..cf4868e7 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_nodock/it-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/it-144-menu0.png new file mode 100644 index 00000000..ed88b862 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/it-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_nodock/it-144.png b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/it-144.png new file mode 100644 index 00000000..2c18ec38 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_nodock/pseudo-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/pseudo-144-menu0.png new file mode 100644 index 00000000..dc9b9cad Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/pseudo-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_more_nodock/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/pseudo-144.png new file mode 100644 index 00000000..8696ddf9 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_more_nodock/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_new/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_menu_new/a11y-en.txt new file mode 100644 index 00000000..46133888 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_menu_new/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable, expanded] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/cmdbar_menu_new/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_menu_new/a11y-it.txt new file mode 100644 index 00000000..a6dc772d --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_menu_new/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable, expanded] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/cmdbar_menu_new/en-96-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_new/en-96-menu0.png new file mode 100644 index 00000000..8609011e Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_new/en-96-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_new/en-96.png b/apps/files/tests/golden/base/cmdbar_menu_new/en-96.png new file mode 100644 index 00000000..14476327 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_new/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_new/hc-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_new/hc-144-menu0.png new file mode 100644 index 00000000..81c73db0 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_new/hc-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_new/hc-144.png b/apps/files/tests/golden/base/cmdbar_menu_new/hc-144.png new file mode 100644 index 00000000..3eca402c Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_new/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_new/it-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_new/it-144-menu0.png new file mode 100644 index 00000000..3dbde5d0 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_new/it-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_new/it-144.png b/apps/files/tests/golden/base/cmdbar_menu_new/it-144.png new file mode 100644 index 00000000..7389ab2d Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_new/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_new/pseudo-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_new/pseudo-144-menu0.png new file mode 100644 index 00000000..9fe0242e Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_new/pseudo-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_new/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_menu_new/pseudo-144.png new file mode 100644 index 00000000..38be7b0f Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_new/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_sort/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_menu_sort/a11y-en.txt new file mode 100644 index 00000000..5ab4829d --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_menu_sort/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable, expanded] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/cmdbar_menu_sort/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_menu_sort/a11y-it.txt new file mode 100644 index 00000000..d8f51967 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_menu_sort/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable, expanded] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/cmdbar_menu_sort/en-96-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_sort/en-96-menu0.png new file mode 100644 index 00000000..4255c464 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_sort/en-96-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_sort/en-96.png b/apps/files/tests/golden/base/cmdbar_menu_sort/en-96.png new file mode 100644 index 00000000..4a86373a Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_sort/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_sort/hc-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_sort/hc-144-menu0.png new file mode 100644 index 00000000..3928c94b Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_sort/hc-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_sort/hc-144.png b/apps/files/tests/golden/base/cmdbar_menu_sort/hc-144.png new file mode 100644 index 00000000..e3c1f719 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_sort/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_sort/it-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_sort/it-144-menu0.png new file mode 100644 index 00000000..79f793f2 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_sort/it-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_sort/it-144.png b/apps/files/tests/golden/base/cmdbar_menu_sort/it-144.png new file mode 100644 index 00000000..ba66cdb7 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_sort/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_sort/pseudo-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_sort/pseudo-144-menu0.png new file mode 100644 index 00000000..ef5c1f05 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_sort/pseudo-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_sort/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_menu_sort/pseudo-144.png new file mode 100644 index 00000000..f5fbb560 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_sort/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_view/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_menu_view/a11y-en.txt new file mode 100644 index 00000000..1a9d8a77 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_menu_view/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable, expanded] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/cmdbar_menu_view/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_menu_view/a11y-it.txt new file mode 100644 index 00000000..d774946d --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_menu_view/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/cmdbar_menu_view/en-96-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_view/en-96-menu0.png new file mode 100644 index 00000000..f0e5091d Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_view/en-96-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_view/en-96.png b/apps/files/tests/golden/base/cmdbar_menu_view/en-96.png new file mode 100644 index 00000000..ecafcc85 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_view/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_view/hc-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_view/hc-144-menu0.png new file mode 100644 index 00000000..c4337b2f Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_view/hc-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_view/hc-144.png b/apps/files/tests/golden/base/cmdbar_menu_view/hc-144.png new file mode 100644 index 00000000..eccca7ff Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_view/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_view/it-144.png b/apps/files/tests/golden/base/cmdbar_menu_view/it-144.png new file mode 100644 index 00000000..72893bf7 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_view/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_view/pseudo-144-menu0.png b/apps/files/tests/golden/base/cmdbar_menu_view/pseudo-144-menu0.png new file mode 100644 index 00000000..4db9038f Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_view/pseudo-144-menu0.png differ diff --git a/apps/files/tests/golden/base/cmdbar_menu_view/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_menu_view/pseudo-144.png new file mode 100644 index 00000000..2d8b5d07 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_menu_view/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_middle/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_middle/a11y-en.txt new file mode 100644 index 00000000..c7d5e4a0 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_middle/a11y-en.txt @@ -0,0 +1,55 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 3 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable, selected] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected" diff --git a/apps/files/tests/golden/base/cmdbar_middle/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_middle/a11y-it.txt new file mode 100644 index 00000000..dab59989 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_middle/a11y-it.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 3 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable, selected] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato" diff --git a/apps/files/tests/golden/base/cmdbar_middle/en-96.png b/apps/files/tests/golden/base/cmdbar_middle/en-96.png new file mode 100644 index 00000000..c360e651 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_middle/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_middle/hc-144.png b/apps/files/tests/golden/base/cmdbar_middle/hc-144.png new file mode 100644 index 00000000..d12a583f Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_middle/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_middle/it-144.png b/apps/files/tests/golden/base/cmdbar_middle/it-144.png new file mode 100644 index 00000000..463be83e Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_middle/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_middle/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_middle/pseudo-144.png new file mode 100644 index 00000000..c47c4e54 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_middle/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_narrow/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_narrow/a11y-en.txt new file mode 100644 index 00000000..ce8c57bb --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_narrow/a11y-en.txt @@ -0,0 +1,43 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +Button "Search in documents" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 3 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable, selected] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected" diff --git a/apps/files/tests/golden/base/cmdbar_narrow/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_narrow/a11y-it.txt new file mode 100644 index 00000000..ce45e862 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_narrow/a11y-it.txt @@ -0,0 +1,42 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +Button "Cerca in documents" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 3 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable, selected] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato" diff --git a/apps/files/tests/golden/base/cmdbar_narrow/en-96.png b/apps/files/tests/golden/base/cmdbar_narrow/en-96.png new file mode 100644 index 00000000..21e58b6c Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_narrow/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_narrow/hc-144.png b/apps/files/tests/golden/base/cmdbar_narrow/hc-144.png new file mode 100644 index 00000000..e3119f71 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_narrow/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_narrow/it-144.png b/apps/files/tests/golden/base/cmdbar_narrow/it-144.png new file mode 100644 index 00000000..24bd66c6 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_narrow/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_narrow/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_narrow/pseudo-144.png new file mode 100644 index 00000000..b02e383f Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_narrow/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_tip_disabled/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_tip_disabled/a11y-en.txt new file mode 100644 index 00000000..e0a6f09f --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_tip_disabled/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/cmdbar_tip_disabled/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_tip_disabled/a11y-it.txt new file mode 100644 index 00000000..d774946d --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_tip_disabled/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/cmdbar_tip_disabled/en-96.png b/apps/files/tests/golden/base/cmdbar_tip_disabled/en-96.png new file mode 100644 index 00000000..de16090d Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_tip_disabled/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_tip_disabled/hc-144.png b/apps/files/tests/golden/base/cmdbar_tip_disabled/hc-144.png new file mode 100644 index 00000000..d0346e3c Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_tip_disabled/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_tip_disabled/it-144.png b/apps/files/tests/golden/base/cmdbar_tip_disabled/it-144.png new file mode 100644 index 00000000..732e969e Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_tip_disabled/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_tip_disabled/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_tip_disabled/pseudo-144.png new file mode 100644 index 00000000..4ee06185 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_tip_disabled/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_wide/a11y-en.txt b/apps/files/tests/golden/base/cmdbar_wide/a11y-en.txt new file mode 100644 index 00000000..8e5e0f13 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_wide/a11y-en.txt @@ -0,0 +1,59 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 17.5% +Pane "Details pane" +Button "Open" [focusable] +Button "Open in new tab" [focusable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 3 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable, selected] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected" diff --git a/apps/files/tests/golden/base/cmdbar_wide/a11y-it.txt b/apps/files/tests/golden/base/cmdbar_wide/a11y-it.txt new file mode 100644 index 00000000..9af134b2 --- /dev/null +++ b/apps/files/tests/golden/base/cmdbar_wide/a11y-it.txt @@ -0,0 +1,59 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Filtra" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 17.5% +Pane "Riquadro dei dettagli" +Button "Apri" [focusable] +Button "Apri in una nuova scheda" [focusable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 3 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable, selected] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato" diff --git a/apps/files/tests/golden/base/cmdbar_wide/contrast-144.png b/apps/files/tests/golden/base/cmdbar_wide/contrast-144.png new file mode 100644 index 00000000..2828c0ff Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_wide/contrast-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_wide/en-120.png b/apps/files/tests/golden/base/cmdbar_wide/en-120.png new file mode 100644 index 00000000..c459fdfa Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_wide/en-120.png differ diff --git a/apps/files/tests/golden/base/cmdbar_wide/en-144.png b/apps/files/tests/golden/base/cmdbar_wide/en-144.png new file mode 100644 index 00000000..2828c0ff Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_wide/en-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_wide/en-192.png b/apps/files/tests/golden/base/cmdbar_wide/en-192.png new file mode 100644 index 00000000..86be6cec Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_wide/en-192.png differ diff --git a/apps/files/tests/golden/base/cmdbar_wide/en-96.png b/apps/files/tests/golden/base/cmdbar_wide/en-96.png new file mode 100644 index 00000000..a516f02f Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_wide/en-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_wide/hc-144.png b/apps/files/tests/golden/base/cmdbar_wide/hc-144.png new file mode 100644 index 00000000..733cc642 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_wide/hc-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_wide/hc-96.png b/apps/files/tests/golden/base/cmdbar_wide/hc-96.png new file mode 100644 index 00000000..b65467e8 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_wide/hc-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_wide/it-120.png b/apps/files/tests/golden/base/cmdbar_wide/it-120.png new file mode 100644 index 00000000..1a6dfa3f Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_wide/it-120.png differ diff --git a/apps/files/tests/golden/base/cmdbar_wide/it-144.png b/apps/files/tests/golden/base/cmdbar_wide/it-144.png new file mode 100644 index 00000000..b7229ed7 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_wide/it-144.png differ diff --git a/apps/files/tests/golden/base/cmdbar_wide/it-192.png b/apps/files/tests/golden/base/cmdbar_wide/it-192.png new file mode 100644 index 00000000..87ec4048 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_wide/it-192.png differ diff --git a/apps/files/tests/golden/base/cmdbar_wide/it-96.png b/apps/files/tests/golden/base/cmdbar_wide/it-96.png new file mode 100644 index 00000000..07859efe Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_wide/it-96.png differ diff --git a/apps/files/tests/golden/base/cmdbar_wide/pseudo-144.png b/apps/files/tests/golden/base/cmdbar_wide/pseudo-144.png new file mode 100644 index 00000000..f99d72a4 Binary files /dev/null and b/apps/files/tests/golden/base/cmdbar_wide/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/context_menu_background/a11y-en.txt b/apps/files/tests/golden/base/context_menu_background/a11y-en.txt index bb753003..8becfb43 100644 --- a/apps/files/tests/golden/base/context_menu_background/a11y-en.txt +++ b/apps/files/tests/golden/base/context_menu_background/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,26 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -40,4 +48,6 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/context_menu_background/a11y-it.txt b/apps/files/tests/golden/base/context_menu_background/a11y-it.txt index 1cb5dbdc..cd04332e 100644 --- a/apps/files/tests/golden/base/context_menu_background/a11y-it.txt +++ b/apps/files/tests/golden/base/context_menu_background/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,25 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -40,4 +47,6 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/context_menu_background/en-96-menu0.png b/apps/files/tests/golden/base/context_menu_background/en-96-menu0.png index e97de234..5ec1bede 100644 Binary files a/apps/files/tests/golden/base/context_menu_background/en-96-menu0.png and b/apps/files/tests/golden/base/context_menu_background/en-96-menu0.png differ diff --git a/apps/files/tests/golden/base/context_menu_background/en-96.png b/apps/files/tests/golden/base/context_menu_background/en-96.png index 6f2c8755..7245ff8d 100644 Binary files a/apps/files/tests/golden/base/context_menu_background/en-96.png and b/apps/files/tests/golden/base/context_menu_background/en-96.png differ diff --git a/apps/files/tests/golden/base/context_menu_background/hc-144-menu0.png b/apps/files/tests/golden/base/context_menu_background/hc-144-menu0.png index 1afa2db1..01b805a3 100644 Binary files a/apps/files/tests/golden/base/context_menu_background/hc-144-menu0.png and b/apps/files/tests/golden/base/context_menu_background/hc-144-menu0.png differ diff --git a/apps/files/tests/golden/base/context_menu_background/hc-144.png b/apps/files/tests/golden/base/context_menu_background/hc-144.png index 06de3ad5..79190f5b 100644 Binary files a/apps/files/tests/golden/base/context_menu_background/hc-144.png and b/apps/files/tests/golden/base/context_menu_background/hc-144.png differ diff --git a/apps/files/tests/golden/base/context_menu_background/it-144-menu0.png b/apps/files/tests/golden/base/context_menu_background/it-144-menu0.png index 7a149982..37fec2bf 100644 Binary files a/apps/files/tests/golden/base/context_menu_background/it-144-menu0.png and b/apps/files/tests/golden/base/context_menu_background/it-144-menu0.png differ diff --git a/apps/files/tests/golden/base/context_menu_background/it-144.png b/apps/files/tests/golden/base/context_menu_background/it-144.png index bbcd375a..ebbdd431 100644 Binary files a/apps/files/tests/golden/base/context_menu_background/it-144.png and b/apps/files/tests/golden/base/context_menu_background/it-144.png differ diff --git a/apps/files/tests/golden/base/context_menu_background/pseudo-144-menu0.png b/apps/files/tests/golden/base/context_menu_background/pseudo-144-menu0.png index 3e6382c2..df423590 100644 Binary files a/apps/files/tests/golden/base/context_menu_background/pseudo-144-menu0.png and b/apps/files/tests/golden/base/context_menu_background/pseudo-144-menu0.png differ diff --git a/apps/files/tests/golden/base/context_menu_background/pseudo-144.png b/apps/files/tests/golden/base/context_menu_background/pseudo-144.png index 243f5f11..041ecf43 100644 Binary files a/apps/files/tests/golden/base/context_menu_background/pseudo-144.png and b/apps/files/tests/golden/base/context_menu_background/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/context_menu_file/a11y-en.txt b/apps/files/tests/golden/base/context_menu_file/a11y-en.txt index 9993ef04..b21ed309 100644 --- a/apps/files/tests/golden/base/context_menu_file/a11y-en.txt +++ b/apps/files/tests/golden/base/context_menu_file/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,26 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -40,5 +48,7 @@ Table "Name" 4 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" -Label " · 1 selected · 47.4 KB" +Label "1 selected, 47.4 KB" diff --git a/apps/files/tests/golden/base/context_menu_file/a11y-it.txt b/apps/files/tests/golden/base/context_menu_file/a11y-it.txt index 1bcef07f..f97ed051 100644 --- a/apps/files/tests/golden/base/context_menu_file/a11y-it.txt +++ b/apps/files/tests/golden/base/context_menu_file/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,25 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -40,5 +47,7 @@ Table "Nome" 4 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" -Label " · 1 selezionato · 47,4 KB" +Label "1 selezionato, 47,4 KB" diff --git a/apps/files/tests/golden/base/context_menu_file/en-96-menu0.png b/apps/files/tests/golden/base/context_menu_file/en-96-menu0.png index 45382a61..6f608dec 100644 Binary files a/apps/files/tests/golden/base/context_menu_file/en-96-menu0.png and b/apps/files/tests/golden/base/context_menu_file/en-96-menu0.png differ diff --git a/apps/files/tests/golden/base/context_menu_file/en-96.png b/apps/files/tests/golden/base/context_menu_file/en-96.png index 3c8983cb..6e8f7a81 100644 Binary files a/apps/files/tests/golden/base/context_menu_file/en-96.png and b/apps/files/tests/golden/base/context_menu_file/en-96.png differ diff --git a/apps/files/tests/golden/base/context_menu_file/hc-144-menu0.png b/apps/files/tests/golden/base/context_menu_file/hc-144-menu0.png index 2cf59b71..9e9622f3 100644 Binary files a/apps/files/tests/golden/base/context_menu_file/hc-144-menu0.png and b/apps/files/tests/golden/base/context_menu_file/hc-144-menu0.png differ diff --git a/apps/files/tests/golden/base/context_menu_file/hc-144.png b/apps/files/tests/golden/base/context_menu_file/hc-144.png index 294efec7..0dad9621 100644 Binary files a/apps/files/tests/golden/base/context_menu_file/hc-144.png and b/apps/files/tests/golden/base/context_menu_file/hc-144.png differ diff --git a/apps/files/tests/golden/base/context_menu_file/it-144-menu0.png b/apps/files/tests/golden/base/context_menu_file/it-144-menu0.png index a07f8546..ae8e1739 100644 Binary files a/apps/files/tests/golden/base/context_menu_file/it-144-menu0.png and b/apps/files/tests/golden/base/context_menu_file/it-144-menu0.png differ diff --git a/apps/files/tests/golden/base/context_menu_file/it-144.png b/apps/files/tests/golden/base/context_menu_file/it-144.png index 7b7351c1..28a49098 100644 Binary files a/apps/files/tests/golden/base/context_menu_file/it-144.png and b/apps/files/tests/golden/base/context_menu_file/it-144.png differ diff --git a/apps/files/tests/golden/base/context_menu_file/pseudo-144-menu0.png b/apps/files/tests/golden/base/context_menu_file/pseudo-144-menu0.png index 97be2b21..f4087783 100644 Binary files a/apps/files/tests/golden/base/context_menu_file/pseudo-144-menu0.png and b/apps/files/tests/golden/base/context_menu_file/pseudo-144-menu0.png differ diff --git a/apps/files/tests/golden/base/context_menu_file/pseudo-144.png b/apps/files/tests/golden/base/context_menu_file/pseudo-144.png index 0513f456..b1f30ff0 100644 Binary files a/apps/files/tests/golden/base/context_menu_file/pseudo-144.png and b/apps/files/tests/golden/base/context_menu_file/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_100k/a11y-en.txt b/apps/files/tests/golden/base/details_100k/a11y-en.txt index 5e095c85..56dac78e 100644 --- a/apps/files/tests/golden/base/details_100k/a11y-en.txt +++ b/apps/files/tests/golden/base/details_100k/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,23 +14,31 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] ColumnHeader "Size" [focusable] -Table "Name" 50005 of 100000 - Row "letter-draft-091165.docx" [focusable] 49980 of 100000 - Row "letter-draft-091414.xlsx" [focusable] 49981 of 100000 - Row "letter-draft-091461.md" [focusable] 49982 of 100000 +Table "Name" 50001 of 100000 Row "letter-draft-091514.txt" [focusable] 49983 of 100000 Row "letter-draft-091635.pdf" [focusable] 49984 of 100000 Row "letter-draft-091685.jpg" [focusable] 49985 of 100000 @@ -52,23 +57,17 @@ Table "Name" 50005 of 100000 Row "letter-draft-094299.pdf" [focusable] 49998 of 100000 Row "letter-draft-094315.xlsx" [focusable] 49999 of 100000 Row "letter-draft-094399.txt" [focusable] 50000 of 100000 - Row "letter-draft-094683.txt" [focusable] 50001 of 100000 + Row "letter-draft-094683.txt" [focusable, selected] 50001 of 100000 Row "letter-draft-094773.jpg" [focusable] 50002 of 100000 Row "letter-draft-094804.pdf" [focusable] 50003 of 100000 Row "letter-draft-095310.xlsx" [focusable] 50004 of 100000 - Row "letter-draft-095386.xlsx" [focusable, selected] 50005 of 100000 + Row "letter-draft-095386.xlsx" [focusable] 50005 of 100000 Row "letter-draft-095567.xlsx" [focusable] 50006 of 100000 Row "letter-draft-095615.jpg" [focusable] 50007 of 100000 Row "letter-draft-095616.jpg" [focusable] 50008 of 100000 Row "letter-draft-095663.md" [focusable] 50009 of 100000 Row "letter-draft-095837.png" [focusable] 50010 of 100000 - Row "letter-draft-095909.pdf" [focusable] 50011 of 100000 - Row "letter-draft-095999.jpg" [focusable] 50012 of 100000 - Row "letter-draft-096284.zip" [focusable] 50013 of 100000 - Row "letter-draft-096353.txt" [focusable] 50014 of 100000 - Row "letter-draft-096515.pdf" [focusable] 50015 of 100000 - Row "letter-draft-096640.txt" [focusable] 50016 of 100000 - Row "letter-draft-096647.zip" [focusable] 50017 of 100000 - Row "letter-draft-096690.png" [focusable] 50018 of 100000 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "100,000 items" -Label " · 1 selected · 62.5 MB" +Label "1 selected, 51.5 MB" diff --git a/apps/files/tests/golden/base/details_100k/a11y-it.txt b/apps/files/tests/golden/base/details_100k/a11y-it.txt index 976850a7..1074b7ff 100644 --- a/apps/files/tests/golden/base/details_100k/a11y-it.txt +++ b/apps/files/tests/golden/base/details_100k/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,23 +14,30 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] ColumnHeader "Dimensione" [focusable] -Table "Nome" 50005 of 100000 - Row "letter-draft-091165.docx" [focusable] 49980 of 100000 - Row "letter-draft-091414.xlsx" [focusable] 49981 of 100000 - Row "letter-draft-091461.md" [focusable] 49982 of 100000 +Table "Nome" 50001 of 100000 Row "letter-draft-091514.txt" [focusable] 49983 of 100000 Row "letter-draft-091635.pdf" [focusable] 49984 of 100000 Row "letter-draft-091685.jpg" [focusable] 49985 of 100000 @@ -52,23 +56,17 @@ Table "Nome" 50005 of 100000 Row "letter-draft-094299.pdf" [focusable] 49998 of 100000 Row "letter-draft-094315.xlsx" [focusable] 49999 of 100000 Row "letter-draft-094399.txt" [focusable] 50000 of 100000 - Row "letter-draft-094683.txt" [focusable] 50001 of 100000 + Row "letter-draft-094683.txt" [focusable, selected] 50001 of 100000 Row "letter-draft-094773.jpg" [focusable] 50002 of 100000 Row "letter-draft-094804.pdf" [focusable] 50003 of 100000 Row "letter-draft-095310.xlsx" [focusable] 50004 of 100000 - Row "letter-draft-095386.xlsx" [focusable, selected] 50005 of 100000 + Row "letter-draft-095386.xlsx" [focusable] 50005 of 100000 Row "letter-draft-095567.xlsx" [focusable] 50006 of 100000 Row "letter-draft-095615.jpg" [focusable] 50007 of 100000 Row "letter-draft-095616.jpg" [focusable] 50008 of 100000 Row "letter-draft-095663.md" [focusable] 50009 of 100000 Row "letter-draft-095837.png" [focusable] 50010 of 100000 - Row "letter-draft-095909.pdf" [focusable] 50011 of 100000 - Row "letter-draft-095999.jpg" [focusable] 50012 of 100000 - Row "letter-draft-096284.zip" [focusable] 50013 of 100000 - Row "letter-draft-096353.txt" [focusable] 50014 of 100000 - Row "letter-draft-096515.pdf" [focusable] 50015 of 100000 - Row "letter-draft-096640.txt" [focusable] 50016 of 100000 - Row "letter-draft-096647.zip" [focusable] 50017 of 100000 - Row "letter-draft-096690.png" [focusable] 50018 of 100000 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "100.000 elementi" -Label " · 1 selezionato · 62,5 MB" +Label "1 selezionato, 51,5 MB" diff --git a/apps/files/tests/golden/base/details_100k/en-96.png b/apps/files/tests/golden/base/details_100k/en-96.png index d912549c..bb8ade72 100644 Binary files a/apps/files/tests/golden/base/details_100k/en-96.png and b/apps/files/tests/golden/base/details_100k/en-96.png differ diff --git a/apps/files/tests/golden/base/details_100k/hc-144.png b/apps/files/tests/golden/base/details_100k/hc-144.png index 8dd38c65..3e0190ba 100644 Binary files a/apps/files/tests/golden/base/details_100k/hc-144.png and b/apps/files/tests/golden/base/details_100k/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_100k/it-144.png b/apps/files/tests/golden/base/details_100k/it-144.png index c562f0e4..5df4c0c8 100644 Binary files a/apps/files/tests/golden/base/details_100k/it-144.png and b/apps/files/tests/golden/base/details_100k/it-144.png differ diff --git a/apps/files/tests/golden/base/details_100k/pseudo-144.png b/apps/files/tests/golden/base/details_100k/pseudo-144.png index 5759560b..21d8c7f4 100644 Binary files a/apps/files/tests/golden/base/details_100k/pseudo-144.png and b/apps/files/tests/golden/base/details_100k/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_basic/a11y-en.txt b/apps/files/tests/golden/base/details_basic/a11y-en.txt index bb753003..8becfb43 100644 --- a/apps/files/tests/golden/base/details_basic/a11y-en.txt +++ b/apps/files/tests/golden/base/details_basic/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,26 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -40,4 +48,6 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/details_basic/a11y-it.txt b/apps/files/tests/golden/base/details_basic/a11y-it.txt index 1cb5dbdc..cd04332e 100644 --- a/apps/files/tests/golden/base/details_basic/a11y-it.txt +++ b/apps/files/tests/golden/base/details_basic/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,25 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -40,4 +47,6 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/details_basic/contrast-144.png b/apps/files/tests/golden/base/details_basic/contrast-144.png index 243f5f11..f01499c9 100644 Binary files a/apps/files/tests/golden/base/details_basic/contrast-144.png and b/apps/files/tests/golden/base/details_basic/contrast-144.png differ diff --git a/apps/files/tests/golden/base/details_basic/en-120.png b/apps/files/tests/golden/base/details_basic/en-120.png index 191c199c..98e71295 100644 Binary files a/apps/files/tests/golden/base/details_basic/en-120.png and b/apps/files/tests/golden/base/details_basic/en-120.png differ diff --git a/apps/files/tests/golden/base/details_basic/en-144.png b/apps/files/tests/golden/base/details_basic/en-144.png index 243f5f11..f01499c9 100644 Binary files a/apps/files/tests/golden/base/details_basic/en-144.png and b/apps/files/tests/golden/base/details_basic/en-144.png differ diff --git a/apps/files/tests/golden/base/details_basic/en-192.png b/apps/files/tests/golden/base/details_basic/en-192.png index 0a9cc3c2..a03882e2 100644 Binary files a/apps/files/tests/golden/base/details_basic/en-192.png and b/apps/files/tests/golden/base/details_basic/en-192.png differ diff --git a/apps/files/tests/golden/base/details_basic/en-96.png b/apps/files/tests/golden/base/details_basic/en-96.png index 6f2c8755..7245ff8d 100644 Binary files a/apps/files/tests/golden/base/details_basic/en-96.png and b/apps/files/tests/golden/base/details_basic/en-96.png differ diff --git a/apps/files/tests/golden/base/details_basic/hc-144.png b/apps/files/tests/golden/base/details_basic/hc-144.png index 06de3ad5..79190f5b 100644 Binary files a/apps/files/tests/golden/base/details_basic/hc-144.png and b/apps/files/tests/golden/base/details_basic/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_basic/hc-96.png b/apps/files/tests/golden/base/details_basic/hc-96.png index 1714c80b..6e4e958b 100644 Binary files a/apps/files/tests/golden/base/details_basic/hc-96.png and b/apps/files/tests/golden/base/details_basic/hc-96.png differ diff --git a/apps/files/tests/golden/base/details_basic/it-120.png b/apps/files/tests/golden/base/details_basic/it-120.png index d1e59249..487d657e 100644 Binary files a/apps/files/tests/golden/base/details_basic/it-120.png and b/apps/files/tests/golden/base/details_basic/it-120.png differ diff --git a/apps/files/tests/golden/base/details_basic/it-144.png b/apps/files/tests/golden/base/details_basic/it-144.png index bbcd375a..ebbdd431 100644 Binary files a/apps/files/tests/golden/base/details_basic/it-144.png and b/apps/files/tests/golden/base/details_basic/it-144.png differ diff --git a/apps/files/tests/golden/base/details_basic/it-192.png b/apps/files/tests/golden/base/details_basic/it-192.png index 60b81622..41eab610 100644 Binary files a/apps/files/tests/golden/base/details_basic/it-192.png and b/apps/files/tests/golden/base/details_basic/it-192.png differ diff --git a/apps/files/tests/golden/base/details_basic/it-96.png b/apps/files/tests/golden/base/details_basic/it-96.png index 4367d522..cd872f88 100644 Binary files a/apps/files/tests/golden/base/details_basic/it-96.png and b/apps/files/tests/golden/base/details_basic/it-96.png differ diff --git a/apps/files/tests/golden/base/details_basic/pseudo-144.png b/apps/files/tests/golden/base/details_basic/pseudo-144.png index 243f5f11..041ecf43 100644 Binary files a/apps/files/tests/golden/base/details_basic/pseudo-144.png and b/apps/files/tests/golden/base/details_basic/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_file/a11y-en.txt b/apps/files/tests/golden/base/details_file/a11y-en.txt new file mode 100644 index 00000000..1a1d33f7 --- /dev/null +++ b/apps/files/tests/golden/base/details_file/a11y-en.txt @@ -0,0 +1,59 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 17.5% +Pane "Details pane" +Button "Open" [focusable] +Button "Open with" [focusable, expandable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 8 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable, selected] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected, 3.48 MB" diff --git a/apps/files/tests/golden/base/details_file/a11y-it.txt b/apps/files/tests/golden/base/details_file/a11y-it.txt new file mode 100644 index 00000000..250ad350 --- /dev/null +++ b/apps/files/tests/golden/base/details_file/a11y-it.txt @@ -0,0 +1,59 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Filtra" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 17.5% +Pane "Riquadro dei dettagli" +Button "Apri" [focusable] +Button "Apri con" [focusable, expandable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 8 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable, selected] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato, 3,48 MB" diff --git a/apps/files/tests/golden/base/details_file/contrast-144.png b/apps/files/tests/golden/base/details_file/contrast-144.png new file mode 100644 index 00000000..9e5ed14c Binary files /dev/null and b/apps/files/tests/golden/base/details_file/contrast-144.png differ diff --git a/apps/files/tests/golden/base/details_file/en-120.png b/apps/files/tests/golden/base/details_file/en-120.png new file mode 100644 index 00000000..f0a173f4 Binary files /dev/null and b/apps/files/tests/golden/base/details_file/en-120.png differ diff --git a/apps/files/tests/golden/base/details_file/en-144.png b/apps/files/tests/golden/base/details_file/en-144.png new file mode 100644 index 00000000..9e5ed14c Binary files /dev/null and b/apps/files/tests/golden/base/details_file/en-144.png differ diff --git a/apps/files/tests/golden/base/details_file/en-192.png b/apps/files/tests/golden/base/details_file/en-192.png new file mode 100644 index 00000000..cb75a3a5 Binary files /dev/null and b/apps/files/tests/golden/base/details_file/en-192.png differ diff --git a/apps/files/tests/golden/base/details_file/en-96.png b/apps/files/tests/golden/base/details_file/en-96.png new file mode 100644 index 00000000..1c2ce11a Binary files /dev/null and b/apps/files/tests/golden/base/details_file/en-96.png differ diff --git a/apps/files/tests/golden/base/details_file/hc-144.png b/apps/files/tests/golden/base/details_file/hc-144.png new file mode 100644 index 00000000..bebfd6e1 Binary files /dev/null and b/apps/files/tests/golden/base/details_file/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_file/hc-96.png b/apps/files/tests/golden/base/details_file/hc-96.png new file mode 100644 index 00000000..fe6d3103 Binary files /dev/null and b/apps/files/tests/golden/base/details_file/hc-96.png differ diff --git a/apps/files/tests/golden/base/details_file/it-120.png b/apps/files/tests/golden/base/details_file/it-120.png new file mode 100644 index 00000000..c92ce717 Binary files /dev/null and b/apps/files/tests/golden/base/details_file/it-120.png differ diff --git a/apps/files/tests/golden/base/details_file/it-144.png b/apps/files/tests/golden/base/details_file/it-144.png new file mode 100644 index 00000000..208ea28b Binary files /dev/null and b/apps/files/tests/golden/base/details_file/it-144.png differ diff --git a/apps/files/tests/golden/base/details_file/it-192.png b/apps/files/tests/golden/base/details_file/it-192.png new file mode 100644 index 00000000..8e717a32 Binary files /dev/null and b/apps/files/tests/golden/base/details_file/it-192.png differ diff --git a/apps/files/tests/golden/base/details_file/it-96.png b/apps/files/tests/golden/base/details_file/it-96.png new file mode 100644 index 00000000..163468d8 Binary files /dev/null and b/apps/files/tests/golden/base/details_file/it-96.png differ diff --git a/apps/files/tests/golden/base/details_file/pseudo-144.png b/apps/files/tests/golden/base/details_file/pseudo-144.png new file mode 100644 index 00000000..b28764e0 Binary files /dev/null and b/apps/files/tests/golden/base/details_file/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_focus/a11y-en.txt b/apps/files/tests/golden/base/details_focus/a11y-en.txt new file mode 100644 index 00000000..1a1d33f7 --- /dev/null +++ b/apps/files/tests/golden/base/details_focus/a11y-en.txt @@ -0,0 +1,59 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 17.5% +Pane "Details pane" +Button "Open" [focusable] +Button "Open with" [focusable, expandable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 8 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable, selected] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected, 3.48 MB" diff --git a/apps/files/tests/golden/base/details_focus/a11y-it.txt b/apps/files/tests/golden/base/details_focus/a11y-it.txt new file mode 100644 index 00000000..250ad350 --- /dev/null +++ b/apps/files/tests/golden/base/details_focus/a11y-it.txt @@ -0,0 +1,59 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Filtra" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 17.5% +Pane "Riquadro dei dettagli" +Button "Apri" [focusable] +Button "Apri con" [focusable, expandable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 8 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable, selected] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato, 3,48 MB" diff --git a/apps/files/tests/golden/base/details_focus/en-96.png b/apps/files/tests/golden/base/details_focus/en-96.png new file mode 100644 index 00000000..34ff9cec Binary files /dev/null and b/apps/files/tests/golden/base/details_focus/en-96.png differ diff --git a/apps/files/tests/golden/base/details_focus/hc-144.png b/apps/files/tests/golden/base/details_focus/hc-144.png new file mode 100644 index 00000000..5e71b754 Binary files /dev/null and b/apps/files/tests/golden/base/details_focus/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_focus/it-144.png b/apps/files/tests/golden/base/details_focus/it-144.png new file mode 100644 index 00000000..08a765b6 Binary files /dev/null and b/apps/files/tests/golden/base/details_focus/it-144.png differ diff --git a/apps/files/tests/golden/base/details_focus/pseudo-144.png b/apps/files/tests/golden/base/details_focus/pseudo-144.png new file mode 100644 index 00000000..ecdc6db5 Binary files /dev/null and b/apps/files/tests/golden/base/details_focus/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_folder/a11y-en.txt b/apps/files/tests/golden/base/details_folder/a11y-en.txt new file mode 100644 index 00000000..8e5e0f13 --- /dev/null +++ b/apps/files/tests/golden/base/details_folder/a11y-en.txt @@ -0,0 +1,59 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 17.5% +Pane "Details pane" +Button "Open" [focusable] +Button "Open in new tab" [focusable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 3 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable, selected] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected" diff --git a/apps/files/tests/golden/base/details_folder/a11y-it.txt b/apps/files/tests/golden/base/details_folder/a11y-it.txt new file mode 100644 index 00000000..9af134b2 --- /dev/null +++ b/apps/files/tests/golden/base/details_folder/a11y-it.txt @@ -0,0 +1,59 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Filtra" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 17.5% +Pane "Riquadro dei dettagli" +Button "Apri" [focusable] +Button "Apri in una nuova scheda" [focusable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 3 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable, selected] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato" diff --git a/apps/files/tests/golden/base/details_folder/en-96.png b/apps/files/tests/golden/base/details_folder/en-96.png new file mode 100644 index 00000000..a516f02f Binary files /dev/null and b/apps/files/tests/golden/base/details_folder/en-96.png differ diff --git a/apps/files/tests/golden/base/details_folder/hc-144.png b/apps/files/tests/golden/base/details_folder/hc-144.png new file mode 100644 index 00000000..733cc642 Binary files /dev/null and b/apps/files/tests/golden/base/details_folder/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_folder/it-144.png b/apps/files/tests/golden/base/details_folder/it-144.png new file mode 100644 index 00000000..b7229ed7 Binary files /dev/null and b/apps/files/tests/golden/base/details_folder/it-144.png differ diff --git a/apps/files/tests/golden/base/details_folder/pseudo-144.png b/apps/files/tests/golden/base/details_folder/pseudo-144.png new file mode 100644 index 00000000..f99d72a4 Binary files /dev/null and b/apps/files/tests/golden/base/details_folder/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_long_name/a11y-en.txt b/apps/files/tests/golden/base/details_long_name/a11y-en.txt new file mode 100644 index 00000000..e1dd84c1 --- /dev/null +++ b/apps/files/tests/golden/base/details_long_name/a11y-en.txt @@ -0,0 +1,51 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 17.5% +Pane "Details pane" +Button "Open" [focusable] +Button "Open with" [focusable, expandable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 1 + Row "contract draft for the apartment on the long street 07 with every annex, the signatures of everyone and the notes of the notary, final version after the last review of the board.docx" [focusable, selected] 1 of 1 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "1 item" +Label "1 selected, 47.4 KB" diff --git a/apps/files/tests/golden/base/details_long_name/a11y-it.txt b/apps/files/tests/golden/base/details_long_name/a11y-it.txt new file mode 100644 index 00000000..9ec2ec06 --- /dev/null +++ b/apps/files/tests/golden/base/details_long_name/a11y-it.txt @@ -0,0 +1,51 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Filtra" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 17.5% +Pane "Riquadro dei dettagli" +Button "Apri" [focusable] +Button "Apri con" [focusable, expandable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 1 + Row "contract draft for the apartment on the long street 07 with every annex, the signatures of everyone and the notes of the notary, final version after the last review of the board.docx" [focusable, selected] 1 of 1 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "1 elemento" +Label "1 selezionato, 47,4 KB" diff --git a/apps/files/tests/golden/base/details_long_name/en-96.png b/apps/files/tests/golden/base/details_long_name/en-96.png new file mode 100644 index 00000000..22954928 Binary files /dev/null and b/apps/files/tests/golden/base/details_long_name/en-96.png differ diff --git a/apps/files/tests/golden/base/details_long_name/hc-144.png b/apps/files/tests/golden/base/details_long_name/hc-144.png new file mode 100644 index 00000000..bfd80171 Binary files /dev/null and b/apps/files/tests/golden/base/details_long_name/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_long_name/it-144.png b/apps/files/tests/golden/base/details_long_name/it-144.png new file mode 100644 index 00000000..0e691943 Binary files /dev/null and b/apps/files/tests/golden/base/details_long_name/it-144.png differ diff --git a/apps/files/tests/golden/base/details_long_name/pseudo-144.png b/apps/files/tests/golden/base/details_long_name/pseudo-144.png new file mode 100644 index 00000000..5bd3327f Binary files /dev/null and b/apps/files/tests/golden/base/details_long_name/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_narrow/a11y-en.txt b/apps/files/tests/golden/base/details_narrow/a11y-en.txt new file mode 100644 index 00000000..57981a3d --- /dev/null +++ b/apps/files/tests/golden/base/details_narrow/a11y-en.txt @@ -0,0 +1,55 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 8 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable, selected] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected, 3.48 MB" diff --git a/apps/files/tests/golden/base/details_narrow/a11y-it.txt b/apps/files/tests/golden/base/details_narrow/a11y-it.txt new file mode 100644 index 00000000..b8effac1 --- /dev/null +++ b/apps/files/tests/golden/base/details_narrow/a11y-it.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 8 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable, selected] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato, 3,48 MB" diff --git a/apps/files/tests/golden/base/details_narrow/en-96.png b/apps/files/tests/golden/base/details_narrow/en-96.png new file mode 100644 index 00000000..718bc606 Binary files /dev/null and b/apps/files/tests/golden/base/details_narrow/en-96.png differ diff --git a/apps/files/tests/golden/base/details_narrow/hc-144.png b/apps/files/tests/golden/base/details_narrow/hc-144.png new file mode 100644 index 00000000..f2108ef4 Binary files /dev/null and b/apps/files/tests/golden/base/details_narrow/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_narrow/it-144.png b/apps/files/tests/golden/base/details_narrow/it-144.png new file mode 100644 index 00000000..c94a7d70 Binary files /dev/null and b/apps/files/tests/golden/base/details_narrow/it-144.png differ diff --git a/apps/files/tests/golden/base/details_narrow/pseudo-144.png b/apps/files/tests/golden/base/details_narrow/pseudo-144.png new file mode 100644 index 00000000..dc659c73 Binary files /dev/null and b/apps/files/tests/golden/base/details_narrow/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_none/a11y-en.txt b/apps/files/tests/golden/base/details_none/a11y-en.txt new file mode 100644 index 00000000..63a81107 --- /dev/null +++ b/apps/files/tests/golden/base/details_none/a11y-en.txt @@ -0,0 +1,56 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 17.5% +Pane "Details pane" +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/details_none/a11y-it.txt b/apps/files/tests/golden/base/details_none/a11y-it.txt new file mode 100644 index 00000000..1d037aa8 --- /dev/null +++ b/apps/files/tests/golden/base/details_none/a11y-it.txt @@ -0,0 +1,56 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Filtra" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 17.5% +Pane "Riquadro dei dettagli" +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/details_none/en-96.png b/apps/files/tests/golden/base/details_none/en-96.png new file mode 100644 index 00000000..90b520a1 Binary files /dev/null and b/apps/files/tests/golden/base/details_none/en-96.png differ diff --git a/apps/files/tests/golden/base/details_none/hc-144.png b/apps/files/tests/golden/base/details_none/hc-144.png new file mode 100644 index 00000000..cc1eca95 Binary files /dev/null and b/apps/files/tests/golden/base/details_none/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_none/it-144.png b/apps/files/tests/golden/base/details_none/it-144.png new file mode 100644 index 00000000..b5ba5bd3 Binary files /dev/null and b/apps/files/tests/golden/base/details_none/it-144.png differ diff --git a/apps/files/tests/golden/base/details_none/pseudo-144.png b/apps/files/tests/golden/base/details_none/pseudo-144.png new file mode 100644 index 00000000..debc0c8f Binary files /dev/null and b/apps/files/tests/golden/base/details_none/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_off/a11y-en.txt b/apps/files/tests/golden/base/details_off/a11y-en.txt new file mode 100644 index 00000000..960e1892 --- /dev/null +++ b/apps/files/tests/golden/base/details_off/a11y-en.txt @@ -0,0 +1,56 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 17.5% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 8 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable, selected] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected, 3.48 MB" diff --git a/apps/files/tests/golden/base/details_off/a11y-it.txt b/apps/files/tests/golden/base/details_off/a11y-it.txt new file mode 100644 index 00000000..97b3e00f --- /dev/null +++ b/apps/files/tests/golden/base/details_off/a11y-it.txt @@ -0,0 +1,56 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Filtra" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 17.5% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 8 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable, selected] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato, 3,48 MB" diff --git a/apps/files/tests/golden/base/details_off/en-96.png b/apps/files/tests/golden/base/details_off/en-96.png new file mode 100644 index 00000000..4414bbff Binary files /dev/null and b/apps/files/tests/golden/base/details_off/en-96.png differ diff --git a/apps/files/tests/golden/base/details_off/hc-144.png b/apps/files/tests/golden/base/details_off/hc-144.png new file mode 100644 index 00000000..b2e54960 Binary files /dev/null and b/apps/files/tests/golden/base/details_off/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_off/it-144.png b/apps/files/tests/golden/base/details_off/it-144.png new file mode 100644 index 00000000..ad4e8a8b Binary files /dev/null and b/apps/files/tests/golden/base/details_off/it-144.png differ diff --git a/apps/files/tests/golden/base/details_off/pseudo-144.png b/apps/files/tests/golden/base/details_off/pseudo-144.png new file mode 100644 index 00000000..8ea3ac25 Binary files /dev/null and b/apps/files/tests/golden/base/details_off/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_program/a11y-en.txt b/apps/files/tests/golden/base/details_program/a11y-en.txt new file mode 100644 index 00000000..152f6a24 --- /dev/null +++ b/apps/files/tests/golden/base/details_program/a11y-en.txt @@ -0,0 +1,59 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 17.5% +Pane "Details pane" +Button "Open" [focusable] +Button "Open with" [focusable, expandable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 9 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable, selected] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected, 70.8 MB" diff --git a/apps/files/tests/golden/base/details_program/a11y-it.txt b/apps/files/tests/golden/base/details_program/a11y-it.txt new file mode 100644 index 00000000..9f63ec0b --- /dev/null +++ b/apps/files/tests/golden/base/details_program/a11y-it.txt @@ -0,0 +1,59 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Filtra" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 17.5% +Pane "Riquadro dei dettagli" +Button "Apri" [focusable] +Button "Apri con" [focusable, expandable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 9 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable, selected] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato, 70,8 MB" diff --git a/apps/files/tests/golden/base/details_program/en-96.png b/apps/files/tests/golden/base/details_program/en-96.png new file mode 100644 index 00000000..2888710a Binary files /dev/null and b/apps/files/tests/golden/base/details_program/en-96.png differ diff --git a/apps/files/tests/golden/base/details_program/hc-144.png b/apps/files/tests/golden/base/details_program/hc-144.png new file mode 100644 index 00000000..6e7b78aa Binary files /dev/null and b/apps/files/tests/golden/base/details_program/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_program/it-144.png b/apps/files/tests/golden/base/details_program/it-144.png new file mode 100644 index 00000000..f5485936 Binary files /dev/null and b/apps/files/tests/golden/base/details_program/it-144.png differ diff --git a/apps/files/tests/golden/base/details_program/pseudo-144.png b/apps/files/tests/golden/base/details_program/pseudo-144.png new file mode 100644 index 00000000..2989984a Binary files /dev/null and b/apps/files/tests/golden/base/details_program/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_selection/a11y-en.txt b/apps/files/tests/golden/base/details_selection/a11y-en.txt index 26e8a223..4d0aa5bd 100644 --- a/apps/files/tests/golden/base/details_selection/a11y-en.txt +++ b/apps/files/tests/golden/base/details_selection/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,26 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -40,5 +48,7 @@ Table "Name" 4 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" -Label " · 2 selected · 47.4 KB" +Label "2 selected, 47.4 KB" diff --git a/apps/files/tests/golden/base/details_selection/a11y-it.txt b/apps/files/tests/golden/base/details_selection/a11y-it.txt index 1a4b2d51..1fd9ff68 100644 --- a/apps/files/tests/golden/base/details_selection/a11y-it.txt +++ b/apps/files/tests/golden/base/details_selection/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,25 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [focusable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -40,5 +47,7 @@ Table "Nome" 4 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" -Label " · 2 selezionati · 47,4 KB" +Label "2 selezionati, 47,4 KB" diff --git a/apps/files/tests/golden/base/details_selection/contrast-144.png b/apps/files/tests/golden/base/details_selection/contrast-144.png index c7b61e1f..32f8d160 100644 Binary files a/apps/files/tests/golden/base/details_selection/contrast-144.png and b/apps/files/tests/golden/base/details_selection/contrast-144.png differ diff --git a/apps/files/tests/golden/base/details_selection/en-120.png b/apps/files/tests/golden/base/details_selection/en-120.png index 891b73f4..8755070b 100644 Binary files a/apps/files/tests/golden/base/details_selection/en-120.png and b/apps/files/tests/golden/base/details_selection/en-120.png differ diff --git a/apps/files/tests/golden/base/details_selection/en-144.png b/apps/files/tests/golden/base/details_selection/en-144.png index c7b61e1f..32f8d160 100644 Binary files a/apps/files/tests/golden/base/details_selection/en-144.png and b/apps/files/tests/golden/base/details_selection/en-144.png differ diff --git a/apps/files/tests/golden/base/details_selection/en-192.png b/apps/files/tests/golden/base/details_selection/en-192.png index 135cd4dd..a7826219 100644 Binary files a/apps/files/tests/golden/base/details_selection/en-192.png and b/apps/files/tests/golden/base/details_selection/en-192.png differ diff --git a/apps/files/tests/golden/base/details_selection/en-96.png b/apps/files/tests/golden/base/details_selection/en-96.png index c91a777b..32d84f5d 100644 Binary files a/apps/files/tests/golden/base/details_selection/en-96.png and b/apps/files/tests/golden/base/details_selection/en-96.png differ diff --git a/apps/files/tests/golden/base/details_selection/hc-144.png b/apps/files/tests/golden/base/details_selection/hc-144.png index 6eb4b8c3..21d4353e 100644 Binary files a/apps/files/tests/golden/base/details_selection/hc-144.png and b/apps/files/tests/golden/base/details_selection/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_selection/hc-96.png b/apps/files/tests/golden/base/details_selection/hc-96.png index a2e66100..58b2a93e 100644 Binary files a/apps/files/tests/golden/base/details_selection/hc-96.png and b/apps/files/tests/golden/base/details_selection/hc-96.png differ diff --git a/apps/files/tests/golden/base/details_selection/it-120.png b/apps/files/tests/golden/base/details_selection/it-120.png index ab99be2b..e596d981 100644 Binary files a/apps/files/tests/golden/base/details_selection/it-120.png and b/apps/files/tests/golden/base/details_selection/it-120.png differ diff --git a/apps/files/tests/golden/base/details_selection/it-144.png b/apps/files/tests/golden/base/details_selection/it-144.png index 2aac6217..acf8f96c 100644 Binary files a/apps/files/tests/golden/base/details_selection/it-144.png and b/apps/files/tests/golden/base/details_selection/it-144.png differ diff --git a/apps/files/tests/golden/base/details_selection/it-192.png b/apps/files/tests/golden/base/details_selection/it-192.png index 0457a6ca..991708ab 100644 Binary files a/apps/files/tests/golden/base/details_selection/it-192.png and b/apps/files/tests/golden/base/details_selection/it-192.png differ diff --git a/apps/files/tests/golden/base/details_selection/it-96.png b/apps/files/tests/golden/base/details_selection/it-96.png index 3245e92a..b4e51a17 100644 Binary files a/apps/files/tests/golden/base/details_selection/it-96.png and b/apps/files/tests/golden/base/details_selection/it-96.png differ diff --git a/apps/files/tests/golden/base/details_selection/pseudo-144.png b/apps/files/tests/golden/base/details_selection/pseudo-144.png index c7b61e1f..f80e0e1f 100644 Binary files a/apps/files/tests/golden/base/details_selection/pseudo-144.png and b/apps/files/tests/golden/base/details_selection/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_several/a11y-en.txt b/apps/files/tests/golden/base/details_several/a11y-en.txt new file mode 100644 index 00000000..af2b074c --- /dev/null +++ b/apps/files/tests/golden/base/details_several/a11y-en.txt @@ -0,0 +1,57 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 17.5% +Pane "Details pane" +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 5 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable, selected] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable, selected] 4 of 9 + Row "notes.txt" [focusable, selected] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "3 selected, 48.5 KB" diff --git a/apps/files/tests/golden/base/details_several/a11y-it.txt b/apps/files/tests/golden/base/details_several/a11y-it.txt new file mode 100644 index 00000000..217d2de2 --- /dev/null +++ b/apps/files/tests/golden/base/details_several/a11y-it.txt @@ -0,0 +1,57 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Filtra" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 17.5% +Pane "Riquadro dei dettagli" +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 5 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable, selected] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable, selected] 4 of 9 + Row "notes.txt" [focusable, selected] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "3 selezionati, 48,5 KB" diff --git a/apps/files/tests/golden/base/details_several/en-96.png b/apps/files/tests/golden/base/details_several/en-96.png new file mode 100644 index 00000000..2c2a604c Binary files /dev/null and b/apps/files/tests/golden/base/details_several/en-96.png differ diff --git a/apps/files/tests/golden/base/details_several/hc-144.png b/apps/files/tests/golden/base/details_several/hc-144.png new file mode 100644 index 00000000..f8e62f9d Binary files /dev/null and b/apps/files/tests/golden/base/details_several/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_several/it-144.png b/apps/files/tests/golden/base/details_several/it-144.png new file mode 100644 index 00000000..ee01cdaa Binary files /dev/null and b/apps/files/tests/golden/base/details_several/it-144.png differ diff --git a/apps/files/tests/golden/base/details_several/pseudo-144.png b/apps/files/tests/golden/base/details_several/pseudo-144.png new file mode 100644 index 00000000..6733ea68 Binary files /dev/null and b/apps/files/tests/golden/base/details_several/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/details_view_menu/a11y-en.txt b/apps/files/tests/golden/base/details_view_menu/a11y-en.txt new file mode 100644 index 00000000..a4e433d7 --- /dev/null +++ b/apps/files/tests/golden/base/details_view_menu/a11y-en.txt @@ -0,0 +1,59 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable, expanded] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 17.5% +Pane "Details pane" +Button "Open" [focusable] +Button "Open with" [focusable, expandable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 8 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable, selected] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected, 3.48 MB" diff --git a/apps/files/tests/golden/base/details_view_menu/a11y-it.txt b/apps/files/tests/golden/base/details_view_menu/a11y-it.txt new file mode 100644 index 00000000..7c2a014e --- /dev/null +++ b/apps/files/tests/golden/base/details_view_menu/a11y-it.txt @@ -0,0 +1,59 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable, expanded] + Button "Filtra" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 17.5% +Pane "Riquadro dei dettagli" +Button "Apri" [focusable] +Button "Apri con" [focusable, expandable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 8 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable, selected] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato, 3,48 MB" diff --git a/apps/files/tests/golden/base/details_view_menu/en-96-menu0.png b/apps/files/tests/golden/base/details_view_menu/en-96-menu0.png new file mode 100644 index 00000000..f0e5091d Binary files /dev/null and b/apps/files/tests/golden/base/details_view_menu/en-96-menu0.png differ diff --git a/apps/files/tests/golden/base/details_view_menu/en-96.png b/apps/files/tests/golden/base/details_view_menu/en-96.png new file mode 100644 index 00000000..0e105082 Binary files /dev/null and b/apps/files/tests/golden/base/details_view_menu/en-96.png differ diff --git a/apps/files/tests/golden/base/details_view_menu/hc-144-menu0.png b/apps/files/tests/golden/base/details_view_menu/hc-144-menu0.png new file mode 100644 index 00000000..c4337b2f Binary files /dev/null and b/apps/files/tests/golden/base/details_view_menu/hc-144-menu0.png differ diff --git a/apps/files/tests/golden/base/details_view_menu/hc-144.png b/apps/files/tests/golden/base/details_view_menu/hc-144.png new file mode 100644 index 00000000..d7b2442a Binary files /dev/null and b/apps/files/tests/golden/base/details_view_menu/hc-144.png differ diff --git a/apps/files/tests/golden/base/details_view_menu/it-144-menu0.png b/apps/files/tests/golden/base/details_view_menu/it-144-menu0.png new file mode 100644 index 00000000..18c2047f Binary files /dev/null and b/apps/files/tests/golden/base/details_view_menu/it-144-menu0.png differ diff --git a/apps/files/tests/golden/base/details_view_menu/it-144.png b/apps/files/tests/golden/base/details_view_menu/it-144.png new file mode 100644 index 00000000..d2324707 Binary files /dev/null and b/apps/files/tests/golden/base/details_view_menu/it-144.png differ diff --git a/apps/files/tests/golden/base/details_view_menu/pseudo-144-menu0.png b/apps/files/tests/golden/base/details_view_menu/pseudo-144-menu0.png new file mode 100644 index 00000000..4db9038f Binary files /dev/null and b/apps/files/tests/golden/base/details_view_menu/pseudo-144-menu0.png differ diff --git a/apps/files/tests/golden/base/details_view_menu/pseudo-144.png b/apps/files/tests/golden/base/details_view_menu/pseudo-144.png new file mode 100644 index 00000000..7966f464 Binary files /dev/null and b/apps/files/tests/golden/base/details_view_menu/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/filter_menu/a11y-en.txt b/apps/files/tests/golden/base/filter_menu/a11y-en.txt new file mode 100644 index 00000000..ee9ab37b --- /dev/null +++ b/apps/files/tests/golden/base/filter_menu/a11y-en.txt @@ -0,0 +1,56 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable, expanded] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 17.5% +Pane "Details pane" +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/filter_menu/a11y-it.txt b/apps/files/tests/golden/base/filter_menu/a11y-it.txt new file mode 100644 index 00000000..26eca53f --- /dev/null +++ b/apps/files/tests/golden/base/filter_menu/a11y-it.txt @@ -0,0 +1,56 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Filtra" [focusable, expandable, expanded] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 17.5% +Pane "Riquadro dei dettagli" +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/filter_menu/en-96-menu0.png b/apps/files/tests/golden/base/filter_menu/en-96-menu0.png new file mode 100644 index 00000000..4334e68c Binary files /dev/null and b/apps/files/tests/golden/base/filter_menu/en-96-menu0.png differ diff --git a/apps/files/tests/golden/base/filter_menu/en-96.png b/apps/files/tests/golden/base/filter_menu/en-96.png new file mode 100644 index 00000000..90e54bce Binary files /dev/null and b/apps/files/tests/golden/base/filter_menu/en-96.png differ diff --git a/apps/files/tests/golden/base/filter_menu/hc-144-menu0.png b/apps/files/tests/golden/base/filter_menu/hc-144-menu0.png new file mode 100644 index 00000000..25575c11 Binary files /dev/null and b/apps/files/tests/golden/base/filter_menu/hc-144-menu0.png differ diff --git a/apps/files/tests/golden/base/filter_menu/hc-144.png b/apps/files/tests/golden/base/filter_menu/hc-144.png new file mode 100644 index 00000000..b8ff0eaf Binary files /dev/null and b/apps/files/tests/golden/base/filter_menu/hc-144.png differ diff --git a/apps/files/tests/golden/base/filter_menu/it-144-menu0.png b/apps/files/tests/golden/base/filter_menu/it-144-menu0.png new file mode 100644 index 00000000..2ab85553 Binary files /dev/null and b/apps/files/tests/golden/base/filter_menu/it-144-menu0.png differ diff --git a/apps/files/tests/golden/base/filter_menu/it-144.png b/apps/files/tests/golden/base/filter_menu/it-144.png new file mode 100644 index 00000000..6dafc9a8 Binary files /dev/null and b/apps/files/tests/golden/base/filter_menu/it-144.png differ diff --git a/apps/files/tests/golden/base/filter_menu/pseudo-144-menu0.png b/apps/files/tests/golden/base/filter_menu/pseudo-144-menu0.png new file mode 100644 index 00000000..764a515b Binary files /dev/null and b/apps/files/tests/golden/base/filter_menu/pseudo-144-menu0.png differ diff --git a/apps/files/tests/golden/base/filter_menu/pseudo-144.png b/apps/files/tests/golden/base/filter_menu/pseudo-144.png new file mode 100644 index 00000000..cc5f9993 Binary files /dev/null and b/apps/files/tests/golden/base/filter_menu/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/filter_on/a11y-en.txt b/apps/files/tests/golden/base/filter_on/a11y-en.txt new file mode 100644 index 00000000..7553087c --- /dev/null +++ b/apps/files/tests/golden/base/filter_on/a11y-en.txt @@ -0,0 +1,51 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, checked, expandable, expanded] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 17.5% +Pane "Details pane" +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 4 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 1 of 4 + Row "notes.txt" [focusable] 2 of 4 + Row "report-final-v2.pdf" [focusable] 3 of 4 + Row "report-final-v3.pdf" [focusable] 4 of 4 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "Filter: Documents · 4 of 9 items" diff --git a/apps/files/tests/golden/base/filter_on/a11y-it.txt b/apps/files/tests/golden/base/filter_on/a11y-it.txt new file mode 100644 index 00000000..786f41f9 --- /dev/null +++ b/apps/files/tests/golden/base/filter_on/a11y-it.txt @@ -0,0 +1,51 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Filtra" [focusable, checked, expandable, expanded] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 17.5% +Pane "Riquadro dei dettagli" +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 4 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 1 of 4 + Row "notes.txt" [focusable] 2 of 4 + Row "report-final-v2.pdf" [focusable] 3 of 4 + Row "report-final-v3.pdf" [focusable] 4 of 4 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "Filtro: Documenti · 4 di 9 elementi" diff --git a/apps/files/tests/golden/base/filter_on/en-96.png b/apps/files/tests/golden/base/filter_on/en-96.png new file mode 100644 index 00000000..a8faf7cd Binary files /dev/null and b/apps/files/tests/golden/base/filter_on/en-96.png differ diff --git a/apps/files/tests/golden/base/filter_on/hc-144.png b/apps/files/tests/golden/base/filter_on/hc-144.png new file mode 100644 index 00000000..ddf85200 Binary files /dev/null and b/apps/files/tests/golden/base/filter_on/hc-144.png differ diff --git a/apps/files/tests/golden/base/filter_on/it-144.png b/apps/files/tests/golden/base/filter_on/it-144.png new file mode 100644 index 00000000..68319c7a Binary files /dev/null and b/apps/files/tests/golden/base/filter_on/it-144.png differ diff --git a/apps/files/tests/golden/base/filter_on/pseudo-144.png b/apps/files/tests/golden/base/filter_on/pseudo-144.png new file mode 100644 index 00000000..1976e79f Binary files /dev/null and b/apps/files/tests/golden/base/filter_on/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/home/a11y-en.txt b/apps/files/tests/golden/base/home/a11y-en.txt index fbe79c14..ac2576e7 100644 --- a/apps/files/tests/golden/base/home/a11y-en.txt +++ b/apps/files/tests/golden/base/home/a11y-en.txt @@ -5,29 +5,39 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up · Alt+↑" [disabled] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [disabled] "" Toolbar "Path" Link "Home" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree - Label "Pinned" + TreeItem "Home" [focusable, selected] level 1 + Label "Quick access" TreeItem "documents" [focusable, expandable] level 1 + Button "Remove from Quick access" TreeItem "projects" [focusable, expandable] level 1 + Button "Remove from Quick access" TreeItem "media" [focusable, expandable] level 1 + Button "Remove from Quick access" TreeItem "a-folder-with-a-rather-long-name" [focusable, expandable] level 1 + Button "Remove from Quick access" Label "This PC" TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 22.222221% +Splitter "Resize panes" [focusable] 24.88889% ListItem "documents" [focusable] ListItem "projects" [focusable] ListItem "media" [focusable] @@ -37,6 +47,5 @@ ListItem "Data (D:)" [focusable] ListItem "Share (Z:)" [focusable] ListItem "\\\\made-up-server\\projects" [focusable] ListItem "Recycle Bin ↗" [focusable] -ListItem "Phones and other devices ↗" [focusable] ScrollBar 0% Label "0 items" diff --git a/apps/files/tests/golden/base/home/a11y-it.txt b/apps/files/tests/golden/base/home/a11y-it.txt index 9df28e36..06f90d4d 100644 --- a/apps/files/tests/golden/base/home/a11y-it.txt +++ b/apps/files/tests/golden/base/home/a11y-it.txt @@ -5,29 +5,38 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su · Alt+↑" [disabled] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [disabled] "" Toolbar "Percorso" Link "Home" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree - Label "Aggiunti" + TreeItem "Home" [focusable, selected] level 1 + Label "Accesso rapido" TreeItem "documents" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" TreeItem "projects" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" TreeItem "media" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" TreeItem "a-folder-with-a-rather-long-name" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" Label "Questo PC" TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 22.222221% +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% ListItem "documents" [focusable] ListItem "projects" [focusable] ListItem "media" [focusable] @@ -37,6 +46,5 @@ ListItem "Data (D:)" [focusable] ListItem "Share (Z:)" [focusable] ListItem "\\\\made-up-server\\projects" [focusable] ListItem "Cestino ↗" [focusable] -ListItem "Telefoni e altri dispositivi ↗" [focusable] ScrollBar 0% Label "0 elementi" diff --git a/apps/files/tests/golden/base/home/contrast-144.png b/apps/files/tests/golden/base/home/contrast-144.png index d6088952..5780f70b 100644 Binary files a/apps/files/tests/golden/base/home/contrast-144.png and b/apps/files/tests/golden/base/home/contrast-144.png differ diff --git a/apps/files/tests/golden/base/home/en-120.png b/apps/files/tests/golden/base/home/en-120.png index 62307c76..c2ad3cbb 100644 Binary files a/apps/files/tests/golden/base/home/en-120.png and b/apps/files/tests/golden/base/home/en-120.png differ diff --git a/apps/files/tests/golden/base/home/en-144.png b/apps/files/tests/golden/base/home/en-144.png index d6088952..5780f70b 100644 Binary files a/apps/files/tests/golden/base/home/en-144.png and b/apps/files/tests/golden/base/home/en-144.png differ diff --git a/apps/files/tests/golden/base/home/en-192.png b/apps/files/tests/golden/base/home/en-192.png index 1fa5f55e..505d9caf 100644 Binary files a/apps/files/tests/golden/base/home/en-192.png and b/apps/files/tests/golden/base/home/en-192.png differ diff --git a/apps/files/tests/golden/base/home/en-96.png b/apps/files/tests/golden/base/home/en-96.png index 1fe901b7..d8ab1106 100644 Binary files a/apps/files/tests/golden/base/home/en-96.png and b/apps/files/tests/golden/base/home/en-96.png differ diff --git a/apps/files/tests/golden/base/home/hc-144.png b/apps/files/tests/golden/base/home/hc-144.png index d1eaf486..808fd813 100644 Binary files a/apps/files/tests/golden/base/home/hc-144.png and b/apps/files/tests/golden/base/home/hc-144.png differ diff --git a/apps/files/tests/golden/base/home/hc-96.png b/apps/files/tests/golden/base/home/hc-96.png index dcfbff02..fc36d31b 100644 Binary files a/apps/files/tests/golden/base/home/hc-96.png and b/apps/files/tests/golden/base/home/hc-96.png differ diff --git a/apps/files/tests/golden/base/home/it-120.png b/apps/files/tests/golden/base/home/it-120.png index 6b7b3133..4dafe482 100644 Binary files a/apps/files/tests/golden/base/home/it-120.png and b/apps/files/tests/golden/base/home/it-120.png differ diff --git a/apps/files/tests/golden/base/home/it-144.png b/apps/files/tests/golden/base/home/it-144.png index be5c0e8f..c588229e 100644 Binary files a/apps/files/tests/golden/base/home/it-144.png and b/apps/files/tests/golden/base/home/it-144.png differ diff --git a/apps/files/tests/golden/base/home/it-192.png b/apps/files/tests/golden/base/home/it-192.png index a6e5569b..9fb7c8f0 100644 Binary files a/apps/files/tests/golden/base/home/it-192.png and b/apps/files/tests/golden/base/home/it-192.png differ diff --git a/apps/files/tests/golden/base/home/it-96.png b/apps/files/tests/golden/base/home/it-96.png index 56dff485..add72479 100644 Binary files a/apps/files/tests/golden/base/home/it-96.png and b/apps/files/tests/golden/base/home/it-96.png differ diff --git a/apps/files/tests/golden/base/home/pseudo-144.png b/apps/files/tests/golden/base/home/pseudo-144.png index 65602a6d..3e3ead87 100644 Binary files a/apps/files/tests/golden/base/home/pseudo-144.png and b/apps/files/tests/golden/base/home/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/icons_art/a11y-en.txt b/apps/files/tests/golden/base/icons_art/a11y-en.txt new file mode 100644 index 00000000..fed28dd3 --- /dev/null +++ b/apps/files/tests/golden/base/icons_art/a11y-en.txt @@ -0,0 +1,81 @@ +TabList + Tab "made-up" [focusable, selected] + Button "Close tab" + Tab "Home" [focusable] + Button "Close tab" + Tab "projects" [focusable] + Button "Close tab" + Tab "Z:" [focusable] + Button "Close tab" + Tab "E:" [focusable] + Button "Close tab" + Tab "C:" [focusable] + Button "Close tab" + Tab "Downloads" [focusable] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to Users · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "Users" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Quick access" + TreeItem "Desktop" [focusable, expandable] level 1 + TreeItem "Downloads" [focusable, expandable] level 1 + TreeItem "Documents" [focusable, expandable] level 1 + TreeItem "Pictures" [focusable, expandable] level 1 + TreeItem "Music" [focusable, expandable] level 1 + TreeItem "Videos" [focusable, expandable] level 1 + TreeItem "projects" [focusable, expandable] level 1 + Button "Remove from Quick access" + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + TreeItem "USB (E:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 +Splitter "Resize panes" [focusable] 26.04651% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 17 + Row "Desktop" [focusable] 1 of 17 + Row "Documents" [focusable] 2 of 17 + Row "Downloads" [focusable] 3 of 17 + Row "Music" [focusable] 4 of 17 + Row "Pictures" [focusable] 5 of 17 + Row "projects" [focusable] 6 of 17 + Row "Videos" [focusable] 7 of 17 + Row "backup-2026.zip" [focusable] 8 of 17 + Row "budget-2026.xlsx" [focusable] 9 of 17 + Row "concert.mp3" [focusable] 10 of 17 + Row "contract-draft.docx" [focusable] 11 of 17 + Row "holiday.jpg" [focusable] 12 of 17 + Row "invoice-114.pdf" [focusable] 13 of 17 + Row "notes.txt" [focusable] 14 of 17 + Row "pitch.pptx" [focusable] 15 of 17 + Row "setup-tool-1.4.2.exe" [focusable] 16 of 17 + Row "walkthrough.mp4" [focusable] 17 of 17 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "17 items" diff --git a/apps/files/tests/golden/base/icons_art/a11y-it.txt b/apps/files/tests/golden/base/icons_art/a11y-it.txt new file mode 100644 index 00000000..d5c085b9 --- /dev/null +++ b/apps/files/tests/golden/base/icons_art/a11y-it.txt @@ -0,0 +1,81 @@ +TabList + Tab "made-up" [focusable, selected] + Button "Chiudi scheda" + Tab "Home" [focusable] + Button "Chiudi scheda" + Tab "projects" [focusable] + Button "Chiudi scheda" + Tab "Z:" [focusable] + Button "Chiudi scheda" + Tab "E:" [focusable] + Button "Chiudi scheda" + Tab "C:" [focusable] + Button "Chiudi scheda" + Tab "Downloads" [focusable] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a Users · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "Users" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Accesso rapido" + TreeItem "Desktop" [focusable, expandable] level 1 + TreeItem "Download" [focusable, expandable] level 1 + TreeItem "Documenti" [focusable, expandable] level 1 + TreeItem "Immagini" [focusable, expandable] level 1 + TreeItem "Musica" [focusable, expandable] level 1 + TreeItem "Video" [focusable, expandable] level 1 + TreeItem "projects" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + TreeItem "USB (E:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 26.04651% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 17 + Row "Desktop" [focusable] 1 of 17 + Row "Documents" [focusable] 2 of 17 + Row "Downloads" [focusable] 3 of 17 + Row "Music" [focusable] 4 of 17 + Row "Pictures" [focusable] 5 of 17 + Row "projects" [focusable] 6 of 17 + Row "Videos" [focusable] 7 of 17 + Row "backup-2026.zip" [focusable] 8 of 17 + Row "budget-2026.xlsx" [focusable] 9 of 17 + Row "concert.mp3" [focusable] 10 of 17 + Row "contract-draft.docx" [focusable] 11 of 17 + Row "holiday.jpg" [focusable] 12 of 17 + Row "invoice-114.pdf" [focusable] 13 of 17 + Row "notes.txt" [focusable] 14 of 17 + Row "pitch.pptx" [focusable] 15 of 17 + Row "setup-tool-1.4.2.exe" [focusable] 16 of 17 + Row "walkthrough.mp4" [focusable] 17 of 17 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "17 elementi" diff --git a/apps/files/tests/golden/base/icons_art/contrast-144.png b/apps/files/tests/golden/base/icons_art/contrast-144.png new file mode 100644 index 00000000..82bcf552 Binary files /dev/null and b/apps/files/tests/golden/base/icons_art/contrast-144.png differ diff --git a/apps/files/tests/golden/base/icons_art/en-120.png b/apps/files/tests/golden/base/icons_art/en-120.png new file mode 100644 index 00000000..8ecb3cc7 Binary files /dev/null and b/apps/files/tests/golden/base/icons_art/en-120.png differ diff --git a/apps/files/tests/golden/base/icons_art/en-144.png b/apps/files/tests/golden/base/icons_art/en-144.png new file mode 100644 index 00000000..82bcf552 Binary files /dev/null and b/apps/files/tests/golden/base/icons_art/en-144.png differ diff --git a/apps/files/tests/golden/base/icons_art/en-192.png b/apps/files/tests/golden/base/icons_art/en-192.png new file mode 100644 index 00000000..a35dd62f Binary files /dev/null and b/apps/files/tests/golden/base/icons_art/en-192.png differ diff --git a/apps/files/tests/golden/base/icons_art/en-96.png b/apps/files/tests/golden/base/icons_art/en-96.png new file mode 100644 index 00000000..5d53f44e Binary files /dev/null and b/apps/files/tests/golden/base/icons_art/en-96.png differ diff --git a/apps/files/tests/golden/base/icons_art/hc-144.png b/apps/files/tests/golden/base/icons_art/hc-144.png new file mode 100644 index 00000000..bdcdd92a Binary files /dev/null and b/apps/files/tests/golden/base/icons_art/hc-144.png differ diff --git a/apps/files/tests/golden/base/icons_art/hc-96.png b/apps/files/tests/golden/base/icons_art/hc-96.png new file mode 100644 index 00000000..ef453e6e Binary files /dev/null and b/apps/files/tests/golden/base/icons_art/hc-96.png differ diff --git a/apps/files/tests/golden/base/icons_art/it-120.png b/apps/files/tests/golden/base/icons_art/it-120.png new file mode 100644 index 00000000..ef9a2844 Binary files /dev/null and b/apps/files/tests/golden/base/icons_art/it-120.png differ diff --git a/apps/files/tests/golden/base/icons_art/it-144.png b/apps/files/tests/golden/base/icons_art/it-144.png new file mode 100644 index 00000000..da9df18a Binary files /dev/null and b/apps/files/tests/golden/base/icons_art/it-144.png differ diff --git a/apps/files/tests/golden/base/icons_art/it-192.png b/apps/files/tests/golden/base/icons_art/it-192.png new file mode 100644 index 00000000..fd37d579 Binary files /dev/null and b/apps/files/tests/golden/base/icons_art/it-192.png differ diff --git a/apps/files/tests/golden/base/icons_art/it-96.png b/apps/files/tests/golden/base/icons_art/it-96.png new file mode 100644 index 00000000..2f0f0789 Binary files /dev/null and b/apps/files/tests/golden/base/icons_art/it-96.png differ diff --git a/apps/files/tests/golden/base/icons_art/pseudo-144.png b/apps/files/tests/golden/base/icons_art/pseudo-144.png new file mode 100644 index 00000000..5c5d2db3 Binary files /dev/null and b/apps/files/tests/golden/base/icons_art/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/icons_windows/a11y-en.txt b/apps/files/tests/golden/base/icons_windows/a11y-en.txt new file mode 100644 index 00000000..7aec6cc1 --- /dev/null +++ b/apps/files/tests/golden/base/icons_windows/a11y-en.txt @@ -0,0 +1,57 @@ +TabList + Tab "tools" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "tools" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 11 + Row "hidden-folder" [focusable, selected] 1 of 11 + Row "app-ready.exe" [focusable] 2 of 11 + Row "app-waiting.exe" [focusable] 3 of 11 + Row "cursor.cur" [focusable] 4 of 11 + Row "hidden-notes.txt" [focusable] 5 of 11 + Row "installer.msi" [focusable] 6 of 11 + Row "moved-report.pdf" [focusable] 7 of 11 + Row "readme" [focusable] 8 of 11 + Row "shortcut-ready.lnk" [focusable] 9 of 11 + Row "shortcut-waiting.lnk" [focusable] 10 of 11 + Row "site.url" [focusable] 11 of 11 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "11 items" +Label "1 selected" diff --git a/apps/files/tests/golden/base/icons_windows/a11y-it.txt b/apps/files/tests/golden/base/icons_windows/a11y-it.txt new file mode 100644 index 00000000..534381cc --- /dev/null +++ b/apps/files/tests/golden/base/icons_windows/a11y-it.txt @@ -0,0 +1,56 @@ +TabList + Tab "tools" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "tools" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 11 + Row "hidden-folder" [focusable, selected] 1 of 11 + Row "app-ready.exe" [focusable] 2 of 11 + Row "app-waiting.exe" [focusable] 3 of 11 + Row "cursor.cur" [focusable] 4 of 11 + Row "hidden-notes.txt" [focusable] 5 of 11 + Row "installer.msi" [focusable] 6 of 11 + Row "moved-report.pdf" [focusable] 7 of 11 + Row "readme" [focusable] 8 of 11 + Row "shortcut-ready.lnk" [focusable] 9 of 11 + Row "shortcut-waiting.lnk" [focusable] 10 of 11 + Row "site.url" [focusable] 11 of 11 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "11 elementi" +Label "1 selezionato" diff --git a/apps/files/tests/golden/base/icons_windows/en-96.png b/apps/files/tests/golden/base/icons_windows/en-96.png new file mode 100644 index 00000000..11dbf2f2 Binary files /dev/null and b/apps/files/tests/golden/base/icons_windows/en-96.png differ diff --git a/apps/files/tests/golden/base/icons_windows/hc-144.png b/apps/files/tests/golden/base/icons_windows/hc-144.png new file mode 100644 index 00000000..d270d5bf Binary files /dev/null and b/apps/files/tests/golden/base/icons_windows/hc-144.png differ diff --git a/apps/files/tests/golden/base/icons_windows/it-144.png b/apps/files/tests/golden/base/icons_windows/it-144.png new file mode 100644 index 00000000..1663dbf0 Binary files /dev/null and b/apps/files/tests/golden/base/icons_windows/it-144.png differ diff --git a/apps/files/tests/golden/base/icons_windows/pseudo-144.png b/apps/files/tests/golden/base/icons_windows/pseudo-144.png new file mode 100644 index 00000000..61f43f26 Binary files /dev/null and b/apps/files/tests/golden/base/icons_windows/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/more_menu/a11y-en.txt b/apps/files/tests/golden/base/more_menu/a11y-en.txt index bb753003..91c8dd4e 100644 --- a/apps/files/tests/golden/base/more_menu/a11y-en.txt +++ b/apps/files/tests/golden/base/more_menu/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,26 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable, expanded] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -40,4 +48,6 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/more_menu/a11y-it.txt b/apps/files/tests/golden/base/more_menu/a11y-it.txt index 1cb5dbdc..dbdbf752 100644 --- a/apps/files/tests/golden/base/more_menu/a11y-it.txt +++ b/apps/files/tests/golden/base/more_menu/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,25 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Altro" [focusable, expandable, expanded] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -40,4 +47,6 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/more_menu/en-96-menu0.png b/apps/files/tests/golden/base/more_menu/en-96-menu0.png index 906e4713..f8b04b8f 100644 Binary files a/apps/files/tests/golden/base/more_menu/en-96-menu0.png and b/apps/files/tests/golden/base/more_menu/en-96-menu0.png differ diff --git a/apps/files/tests/golden/base/more_menu/en-96.png b/apps/files/tests/golden/base/more_menu/en-96.png index 6f2c8755..17b5857c 100644 Binary files a/apps/files/tests/golden/base/more_menu/en-96.png and b/apps/files/tests/golden/base/more_menu/en-96.png differ diff --git a/apps/files/tests/golden/base/more_menu/hc-144-menu0.png b/apps/files/tests/golden/base/more_menu/hc-144-menu0.png index 9edb9836..4b8770eb 100644 Binary files a/apps/files/tests/golden/base/more_menu/hc-144-menu0.png and b/apps/files/tests/golden/base/more_menu/hc-144-menu0.png differ diff --git a/apps/files/tests/golden/base/more_menu/hc-144.png b/apps/files/tests/golden/base/more_menu/hc-144.png index 06de3ad5..7837728d 100644 Binary files a/apps/files/tests/golden/base/more_menu/hc-144.png and b/apps/files/tests/golden/base/more_menu/hc-144.png differ diff --git a/apps/files/tests/golden/base/more_menu/it-144-menu0.png b/apps/files/tests/golden/base/more_menu/it-144-menu0.png index c6ca141f..189b9e30 100644 Binary files a/apps/files/tests/golden/base/more_menu/it-144-menu0.png and b/apps/files/tests/golden/base/more_menu/it-144-menu0.png differ diff --git a/apps/files/tests/golden/base/more_menu/it-144.png b/apps/files/tests/golden/base/more_menu/it-144.png index bbcd375a..dcc36267 100644 Binary files a/apps/files/tests/golden/base/more_menu/it-144.png and b/apps/files/tests/golden/base/more_menu/it-144.png differ diff --git a/apps/files/tests/golden/base/more_menu/pseudo-144-menu0.png b/apps/files/tests/golden/base/more_menu/pseudo-144-menu0.png index e5ad3ff8..35c8fbb5 100644 Binary files a/apps/files/tests/golden/base/more_menu/pseudo-144-menu0.png and b/apps/files/tests/golden/base/more_menu/pseudo-144-menu0.png differ diff --git a/apps/files/tests/golden/base/more_menu/pseudo-144.png b/apps/files/tests/golden/base/more_menu/pseudo-144.png index 243f5f11..b2974e9d 100644 Binary files a/apps/files/tests/golden/base/more_menu/pseudo-144.png and b/apps/files/tests/golden/base/more_menu/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/ops_bar/a11y-en.txt b/apps/files/tests/golden/base/ops_bar/a11y-en.txt index 026f2e0a..55e47364 100644 --- a/apps/files/tests/golden/base/ops_bar/a11y-en.txt +++ b/apps/files/tests/golden/base/ops_bar/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,26 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -40,8 +48,10 @@ Table "Name" 7 of 9 Row "report-final-v2.pdf" [focusable, selected] 7 of 9 Row "report-final-v3.pdf" [focusable, selected] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable, selected] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" -Label " · 3 selected · 77.5 MB" +Label "3 selected, 77.5 MB" Label "These 2 items can't go to the Recycle Bin and will be deleted permanently" Button "Delete (Enter)" [focusable] Button "Cancel (Esc)" [focusable] diff --git a/apps/files/tests/golden/base/ops_bar/a11y-it.txt b/apps/files/tests/golden/base/ops_bar/a11y-it.txt index ac99694c..3eaa0ce9 100644 --- a/apps/files/tests/golden/base/ops_bar/a11y-it.txt +++ b/apps/files/tests/golden/base/ops_bar/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,25 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [focusable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -40,8 +47,10 @@ Table "Nome" 7 of 9 Row "report-final-v2.pdf" [focusable, selected] 7 of 9 Row "report-final-v3.pdf" [focusable, selected] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable, selected] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" -Label " · 3 selezionati · 77,5 MB" +Label "3 selezionati, 77,5 MB" Label "Questi 2 elementi non possono andare nel Cestino e verranno eliminati definitivamente" Button "Elimina (Invio)" [focusable] Button "Annulla (Esc)" [focusable] diff --git a/apps/files/tests/golden/base/ops_bar/en-96.png b/apps/files/tests/golden/base/ops_bar/en-96.png index e7d3bd54..29179fd9 100644 Binary files a/apps/files/tests/golden/base/ops_bar/en-96.png and b/apps/files/tests/golden/base/ops_bar/en-96.png differ diff --git a/apps/files/tests/golden/base/ops_bar/hc-144.png b/apps/files/tests/golden/base/ops_bar/hc-144.png index 743726ec..f39e6688 100644 Binary files a/apps/files/tests/golden/base/ops_bar/hc-144.png and b/apps/files/tests/golden/base/ops_bar/hc-144.png differ diff --git a/apps/files/tests/golden/base/ops_bar/it-144.png b/apps/files/tests/golden/base/ops_bar/it-144.png index 3e451ce3..90cce4ff 100644 Binary files a/apps/files/tests/golden/base/ops_bar/it-144.png and b/apps/files/tests/golden/base/ops_bar/it-144.png differ diff --git a/apps/files/tests/golden/base/ops_bar/pseudo-144.png b/apps/files/tests/golden/base/ops_bar/pseudo-144.png index e40251be..928e2f1f 100644 Binary files a/apps/files/tests/golden/base/ops_bar/pseudo-144.png and b/apps/files/tests/golden/base/ops_bar/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/ops_bar_permanent/a11y-en.txt b/apps/files/tests/golden/base/ops_bar_permanent/a11y-en.txt new file mode 100644 index 00000000..5893cc29 --- /dev/null +++ b/apps/files/tests/golden/base/ops_bar_permanent/a11y-en.txt @@ -0,0 +1,57 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 9 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable, selected] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected, 70.8 MB" +Label "Delete this item permanently? This can't be undone" +Button "Delete (Enter)" [focusable] +Button "Cancel (Esc)" [focusable] diff --git a/apps/files/tests/golden/base/ops_bar_permanent/a11y-it.txt b/apps/files/tests/golden/base/ops_bar_permanent/a11y-it.txt new file mode 100644 index 00000000..bebfc899 --- /dev/null +++ b/apps/files/tests/golden/base/ops_bar_permanent/a11y-it.txt @@ -0,0 +1,56 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 9 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable, selected] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato, 70,8 MB" +Label "Eliminare definitivamente questo elemento? Non si potrà annullare" +Button "Elimina (Invio)" [focusable] +Button "Annulla (Esc)" [focusable] diff --git a/apps/files/tests/golden/base/ops_bar_permanent/en-96.png b/apps/files/tests/golden/base/ops_bar_permanent/en-96.png new file mode 100644 index 00000000..0ba3ad99 Binary files /dev/null and b/apps/files/tests/golden/base/ops_bar_permanent/en-96.png differ diff --git a/apps/files/tests/golden/base/ops_bar_permanent/hc-144.png b/apps/files/tests/golden/base/ops_bar_permanent/hc-144.png new file mode 100644 index 00000000..3422aea4 Binary files /dev/null and b/apps/files/tests/golden/base/ops_bar_permanent/hc-144.png differ diff --git a/apps/files/tests/golden/base/ops_bar_permanent/it-144.png b/apps/files/tests/golden/base/ops_bar_permanent/it-144.png new file mode 100644 index 00000000..ff89a8da Binary files /dev/null and b/apps/files/tests/golden/base/ops_bar_permanent/it-144.png differ diff --git a/apps/files/tests/golden/base/ops_bar_permanent/pseudo-144.png b/apps/files/tests/golden/base/ops_bar_permanent/pseudo-144.png new file mode 100644 index 00000000..5cb3d7ef Binary files /dev/null and b/apps/files/tests/golden/base/ops_bar_permanent/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/a11y-en.txt b/apps/files/tests/golden/base/ops_chip_needs_input/a11y-en.txt index bc23e67d..ee65f47d 100644 --- a/apps/files/tests/golden/base/ops_chip_needs_input/a11y-en.txt +++ b/apps/files/tests/golden/base/ops_chip_needs_input/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,26 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -42,4 +50,6 @@ Table "Name" 1 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 ProgressIndicator 62% Button "Needs your input" [focusable] +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/a11y-it.txt b/apps/files/tests/golden/base/ops_chip_needs_input/a11y-it.txt index 6d54aa63..756b754d 100644 --- a/apps/files/tests/golden/base/ops_chip_needs_input/a11y-it.txt +++ b/apps/files/tests/golden/base/ops_chip_needs_input/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,25 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -42,4 +49,6 @@ Table "Nome" 1 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 ProgressIndicator 62% Button "Serve una tua risposta" [focusable] +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/contrast-144.png b/apps/files/tests/golden/base/ops_chip_needs_input/contrast-144.png index b7294c83..6308bbef 100644 Binary files a/apps/files/tests/golden/base/ops_chip_needs_input/contrast-144.png and b/apps/files/tests/golden/base/ops_chip_needs_input/contrast-144.png differ diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/en-120.png b/apps/files/tests/golden/base/ops_chip_needs_input/en-120.png index 68ab8543..f2e9d01a 100644 Binary files a/apps/files/tests/golden/base/ops_chip_needs_input/en-120.png and b/apps/files/tests/golden/base/ops_chip_needs_input/en-120.png differ diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/en-144.png b/apps/files/tests/golden/base/ops_chip_needs_input/en-144.png index b7294c83..6308bbef 100644 Binary files a/apps/files/tests/golden/base/ops_chip_needs_input/en-144.png and b/apps/files/tests/golden/base/ops_chip_needs_input/en-144.png differ diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/en-192.png b/apps/files/tests/golden/base/ops_chip_needs_input/en-192.png index b33b4f51..b0aeb34b 100644 Binary files a/apps/files/tests/golden/base/ops_chip_needs_input/en-192.png and b/apps/files/tests/golden/base/ops_chip_needs_input/en-192.png differ diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/en-96.png b/apps/files/tests/golden/base/ops_chip_needs_input/en-96.png index 3314c95e..b5d89aa9 100644 Binary files a/apps/files/tests/golden/base/ops_chip_needs_input/en-96.png and b/apps/files/tests/golden/base/ops_chip_needs_input/en-96.png differ diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/hc-144.png b/apps/files/tests/golden/base/ops_chip_needs_input/hc-144.png index f1dbd4e9..62deea46 100644 Binary files a/apps/files/tests/golden/base/ops_chip_needs_input/hc-144.png and b/apps/files/tests/golden/base/ops_chip_needs_input/hc-144.png differ diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/hc-96.png b/apps/files/tests/golden/base/ops_chip_needs_input/hc-96.png index ac353610..5ae440d1 100644 Binary files a/apps/files/tests/golden/base/ops_chip_needs_input/hc-96.png and b/apps/files/tests/golden/base/ops_chip_needs_input/hc-96.png differ diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/it-120.png b/apps/files/tests/golden/base/ops_chip_needs_input/it-120.png index dee5426b..4af67ceb 100644 Binary files a/apps/files/tests/golden/base/ops_chip_needs_input/it-120.png and b/apps/files/tests/golden/base/ops_chip_needs_input/it-120.png differ diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/it-144.png b/apps/files/tests/golden/base/ops_chip_needs_input/it-144.png index 7c325daa..11d07efd 100644 Binary files a/apps/files/tests/golden/base/ops_chip_needs_input/it-144.png and b/apps/files/tests/golden/base/ops_chip_needs_input/it-144.png differ diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/it-192.png b/apps/files/tests/golden/base/ops_chip_needs_input/it-192.png index 94aa6f20..4aa34220 100644 Binary files a/apps/files/tests/golden/base/ops_chip_needs_input/it-192.png and b/apps/files/tests/golden/base/ops_chip_needs_input/it-192.png differ diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/it-96.png b/apps/files/tests/golden/base/ops_chip_needs_input/it-96.png index cd6d33f1..000a59d4 100644 Binary files a/apps/files/tests/golden/base/ops_chip_needs_input/it-96.png and b/apps/files/tests/golden/base/ops_chip_needs_input/it-96.png differ diff --git a/apps/files/tests/golden/base/ops_chip_needs_input/pseudo-144.png b/apps/files/tests/golden/base/ops_chip_needs_input/pseudo-144.png index 547389a5..c0d0bd4f 100644 Binary files a/apps/files/tests/golden/base/ops_chip_needs_input/pseudo-144.png and b/apps/files/tests/golden/base/ops_chip_needs_input/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/ops_chip_running/a11y-en.txt b/apps/files/tests/golden/base/ops_chip_running/a11y-en.txt index 34f28d16..9ebc2491 100644 --- a/apps/files/tests/golden/base/ops_chip_running/a11y-en.txt +++ b/apps/files/tests/golden/base/ops_chip_running/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,26 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -42,4 +50,6 @@ Table "Name" 1 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 ProgressIndicator 62% Button "Deleting 2,000 items · 62 %" [focusable] +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/ops_chip_running/a11y-it.txt b/apps/files/tests/golden/base/ops_chip_running/a11y-it.txt index 7f65303e..01613869 100644 --- a/apps/files/tests/golden/base/ops_chip_running/a11y-it.txt +++ b/apps/files/tests/golden/base/ops_chip_running/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,25 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -42,4 +49,6 @@ Table "Nome" 1 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 ProgressIndicator 62% Button "Eliminazione di 2.000 elementi · 62 %" [focusable] +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/ops_chip_running/contrast-144.png b/apps/files/tests/golden/base/ops_chip_running/contrast-144.png index 58b87262..1bfb3a2a 100644 Binary files a/apps/files/tests/golden/base/ops_chip_running/contrast-144.png and b/apps/files/tests/golden/base/ops_chip_running/contrast-144.png differ diff --git a/apps/files/tests/golden/base/ops_chip_running/en-120.png b/apps/files/tests/golden/base/ops_chip_running/en-120.png index ee0c8824..15aed32a 100644 Binary files a/apps/files/tests/golden/base/ops_chip_running/en-120.png and b/apps/files/tests/golden/base/ops_chip_running/en-120.png differ diff --git a/apps/files/tests/golden/base/ops_chip_running/en-144.png b/apps/files/tests/golden/base/ops_chip_running/en-144.png index 58b87262..1bfb3a2a 100644 Binary files a/apps/files/tests/golden/base/ops_chip_running/en-144.png and b/apps/files/tests/golden/base/ops_chip_running/en-144.png differ diff --git a/apps/files/tests/golden/base/ops_chip_running/en-192.png b/apps/files/tests/golden/base/ops_chip_running/en-192.png index 7022c623..e687c538 100644 Binary files a/apps/files/tests/golden/base/ops_chip_running/en-192.png and b/apps/files/tests/golden/base/ops_chip_running/en-192.png differ diff --git a/apps/files/tests/golden/base/ops_chip_running/en-96.png b/apps/files/tests/golden/base/ops_chip_running/en-96.png index af446726..0e0a7f0f 100644 Binary files a/apps/files/tests/golden/base/ops_chip_running/en-96.png and b/apps/files/tests/golden/base/ops_chip_running/en-96.png differ diff --git a/apps/files/tests/golden/base/ops_chip_running/hc-144.png b/apps/files/tests/golden/base/ops_chip_running/hc-144.png index 6ef96882..5976ddad 100644 Binary files a/apps/files/tests/golden/base/ops_chip_running/hc-144.png and b/apps/files/tests/golden/base/ops_chip_running/hc-144.png differ diff --git a/apps/files/tests/golden/base/ops_chip_running/hc-96.png b/apps/files/tests/golden/base/ops_chip_running/hc-96.png index f9263dd7..e6f613e2 100644 Binary files a/apps/files/tests/golden/base/ops_chip_running/hc-96.png and b/apps/files/tests/golden/base/ops_chip_running/hc-96.png differ diff --git a/apps/files/tests/golden/base/ops_chip_running/it-120.png b/apps/files/tests/golden/base/ops_chip_running/it-120.png index 975f03d3..4739de61 100644 Binary files a/apps/files/tests/golden/base/ops_chip_running/it-120.png and b/apps/files/tests/golden/base/ops_chip_running/it-120.png differ diff --git a/apps/files/tests/golden/base/ops_chip_running/it-144.png b/apps/files/tests/golden/base/ops_chip_running/it-144.png index d8676db3..61219e78 100644 Binary files a/apps/files/tests/golden/base/ops_chip_running/it-144.png and b/apps/files/tests/golden/base/ops_chip_running/it-144.png differ diff --git a/apps/files/tests/golden/base/ops_chip_running/it-192.png b/apps/files/tests/golden/base/ops_chip_running/it-192.png index 0efaecc2..2ac75f6f 100644 Binary files a/apps/files/tests/golden/base/ops_chip_running/it-192.png and b/apps/files/tests/golden/base/ops_chip_running/it-192.png differ diff --git a/apps/files/tests/golden/base/ops_chip_running/it-96.png b/apps/files/tests/golden/base/ops_chip_running/it-96.png index f632064f..6ba4e453 100644 Binary files a/apps/files/tests/golden/base/ops_chip_running/it-96.png and b/apps/files/tests/golden/base/ops_chip_running/it-96.png differ diff --git a/apps/files/tests/golden/base/ops_chip_running/pseudo-144.png b/apps/files/tests/golden/base/ops_chip_running/pseudo-144.png index 9668108f..287ac7ca 100644 Binary files a/apps/files/tests/golden/base/ops_chip_running/pseudo-144.png and b/apps/files/tests/golden/base/ops_chip_running/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/ops_flyout/a11y-en.txt b/apps/files/tests/golden/base/ops_flyout/a11y-en.txt index 4efcf85b..0b02bc34 100644 --- a/apps/files/tests/golden/base/ops_flyout/a11y-en.txt +++ b/apps/files/tests/golden/base/ops_flyout/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,26 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -42,6 +50,8 @@ Table "Name" 1 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 ProgressIndicator 62% Button "Deleting 2,000 items · 62 %" [focusable] +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" Group "Operations" ListItem "Deleting 2,000 items" diff --git a/apps/files/tests/golden/base/ops_flyout/a11y-it.txt b/apps/files/tests/golden/base/ops_flyout/a11y-it.txt index f2e9f3a3..14e88de8 100644 --- a/apps/files/tests/golden/base/ops_flyout/a11y-it.txt +++ b/apps/files/tests/golden/base/ops_flyout/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,25 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -42,6 +49,8 @@ Table "Nome" 1 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 ProgressIndicator 62% Button "Eliminazione di 2.000 elementi · 62 %" [focusable] +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" Group "Operazioni" ListItem "Eliminazione di 2.000 elementi" diff --git a/apps/files/tests/golden/base/ops_flyout/contrast-144.png b/apps/files/tests/golden/base/ops_flyout/contrast-144.png index 897c0dac..9687b265 100644 Binary files a/apps/files/tests/golden/base/ops_flyout/contrast-144.png and b/apps/files/tests/golden/base/ops_flyout/contrast-144.png differ diff --git a/apps/files/tests/golden/base/ops_flyout/en-120.png b/apps/files/tests/golden/base/ops_flyout/en-120.png index 57a35e5a..842e0982 100644 Binary files a/apps/files/tests/golden/base/ops_flyout/en-120.png and b/apps/files/tests/golden/base/ops_flyout/en-120.png differ diff --git a/apps/files/tests/golden/base/ops_flyout/en-144.png b/apps/files/tests/golden/base/ops_flyout/en-144.png index 897c0dac..9687b265 100644 Binary files a/apps/files/tests/golden/base/ops_flyout/en-144.png and b/apps/files/tests/golden/base/ops_flyout/en-144.png differ diff --git a/apps/files/tests/golden/base/ops_flyout/en-192.png b/apps/files/tests/golden/base/ops_flyout/en-192.png index 735be5ee..8d4f683b 100644 Binary files a/apps/files/tests/golden/base/ops_flyout/en-192.png and b/apps/files/tests/golden/base/ops_flyout/en-192.png differ diff --git a/apps/files/tests/golden/base/ops_flyout/en-96.png b/apps/files/tests/golden/base/ops_flyout/en-96.png index ac58fd71..edd4d10f 100644 Binary files a/apps/files/tests/golden/base/ops_flyout/en-96.png and b/apps/files/tests/golden/base/ops_flyout/en-96.png differ diff --git a/apps/files/tests/golden/base/ops_flyout/hc-144.png b/apps/files/tests/golden/base/ops_flyout/hc-144.png index f1321fa4..da6a6565 100644 Binary files a/apps/files/tests/golden/base/ops_flyout/hc-144.png and b/apps/files/tests/golden/base/ops_flyout/hc-144.png differ diff --git a/apps/files/tests/golden/base/ops_flyout/hc-96.png b/apps/files/tests/golden/base/ops_flyout/hc-96.png index 3fda8bf2..6e90aae8 100644 Binary files a/apps/files/tests/golden/base/ops_flyout/hc-96.png and b/apps/files/tests/golden/base/ops_flyout/hc-96.png differ diff --git a/apps/files/tests/golden/base/ops_flyout/it-120.png b/apps/files/tests/golden/base/ops_flyout/it-120.png index 5e5600ce..8e5bd1b3 100644 Binary files a/apps/files/tests/golden/base/ops_flyout/it-120.png and b/apps/files/tests/golden/base/ops_flyout/it-120.png differ diff --git a/apps/files/tests/golden/base/ops_flyout/it-144.png b/apps/files/tests/golden/base/ops_flyout/it-144.png index baf1978f..4ad9da9f 100644 Binary files a/apps/files/tests/golden/base/ops_flyout/it-144.png and b/apps/files/tests/golden/base/ops_flyout/it-144.png differ diff --git a/apps/files/tests/golden/base/ops_flyout/it-192.png b/apps/files/tests/golden/base/ops_flyout/it-192.png index 2f88b34c..b84d007a 100644 Binary files a/apps/files/tests/golden/base/ops_flyout/it-192.png and b/apps/files/tests/golden/base/ops_flyout/it-192.png differ diff --git a/apps/files/tests/golden/base/ops_flyout/it-96.png b/apps/files/tests/golden/base/ops_flyout/it-96.png index 4a74661b..dd3370ef 100644 Binary files a/apps/files/tests/golden/base/ops_flyout/it-96.png and b/apps/files/tests/golden/base/ops_flyout/it-96.png differ diff --git a/apps/files/tests/golden/base/ops_flyout/pseudo-144.png b/apps/files/tests/golden/base/ops_flyout/pseudo-144.png index ea388299..87b0e768 100644 Binary files a/apps/files/tests/golden/base/ops_flyout/pseudo-144.png and b/apps/files/tests/golden/base/ops_flyout/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/ops_notice_rights/a11y-en.txt b/apps/files/tests/golden/base/ops_notice_rights/a11y-en.txt new file mode 100644 index 00000000..692d739a --- /dev/null +++ b/apps/files/tests/golden/base/ops_notice_rights/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "No rights to change report-final-v2.pdf: use File Explorer" +Button "Open ↗" [focusable] diff --git a/apps/files/tests/golden/base/ops_notice_rights/a11y-it.txt b/apps/files/tests/golden/base/ops_notice_rights/a11y-it.txt new file mode 100644 index 00000000..46ceaf73 --- /dev/null +++ b/apps/files/tests/golden/base/ops_notice_rights/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "Nessun permesso per modificare report-final-v2.pdf: usa Esplora file" +Button "Apri ↗" [focusable] diff --git a/apps/files/tests/golden/base/ops_notice_rights/en-96.png b/apps/files/tests/golden/base/ops_notice_rights/en-96.png new file mode 100644 index 00000000..cf82f692 Binary files /dev/null and b/apps/files/tests/golden/base/ops_notice_rights/en-96.png differ diff --git a/apps/files/tests/golden/base/ops_notice_rights/hc-144.png b/apps/files/tests/golden/base/ops_notice_rights/hc-144.png new file mode 100644 index 00000000..e0a61a4a Binary files /dev/null and b/apps/files/tests/golden/base/ops_notice_rights/hc-144.png differ diff --git a/apps/files/tests/golden/base/ops_notice_rights/it-144.png b/apps/files/tests/golden/base/ops_notice_rights/it-144.png new file mode 100644 index 00000000..f5b1a3e6 Binary files /dev/null and b/apps/files/tests/golden/base/ops_notice_rights/it-144.png differ diff --git a/apps/files/tests/golden/base/ops_notice_rights/pseudo-144.png b/apps/files/tests/golden/base/ops_notice_rights/pseudo-144.png new file mode 100644 index 00000000..85a80696 Binary files /dev/null and b/apps/files/tests/golden/base/ops_notice_rights/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/page_denied/a11y-en.txt b/apps/files/tests/golden/base/page_denied/a11y-en.txt new file mode 100644 index 00000000..238ef823 --- /dev/null +++ b/apps/files/tests/golden/base/page_denied/a11y-en.txt @@ -0,0 +1,50 @@ +TabList + Tab "locked" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to documents · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Link "locked" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" [focusable] 0 of 0 +Label "You don't have access to this folder" +Button "Open in File Explorer" [focusable] +Button "Back" [focusable] +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "0 items" diff --git a/apps/files/tests/golden/base/page_denied/a11y-it.txt b/apps/files/tests/golden/base/page_denied/a11y-it.txt new file mode 100644 index 00000000..856d995e --- /dev/null +++ b/apps/files/tests/golden/base/page_denied/a11y-it.txt @@ -0,0 +1,49 @@ +TabList + Tab "locked" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a documents · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Link "locked" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" [focusable] 0 of 0 +Label "Non hai accesso a questa cartella" +Button "Apri in Esplora file" [focusable] +Button "Indietro" [focusable] +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "0 elementi" diff --git a/apps/files/tests/golden/base/page_denied/contrast-144.png b/apps/files/tests/golden/base/page_denied/contrast-144.png new file mode 100644 index 00000000..9438cd6e Binary files /dev/null and b/apps/files/tests/golden/base/page_denied/contrast-144.png differ diff --git a/apps/files/tests/golden/base/page_denied/en-120.png b/apps/files/tests/golden/base/page_denied/en-120.png new file mode 100644 index 00000000..aa9ca846 Binary files /dev/null and b/apps/files/tests/golden/base/page_denied/en-120.png differ diff --git a/apps/files/tests/golden/base/page_denied/en-144.png b/apps/files/tests/golden/base/page_denied/en-144.png new file mode 100644 index 00000000..9438cd6e Binary files /dev/null and b/apps/files/tests/golden/base/page_denied/en-144.png differ diff --git a/apps/files/tests/golden/base/page_denied/en-192.png b/apps/files/tests/golden/base/page_denied/en-192.png new file mode 100644 index 00000000..ff6b6566 Binary files /dev/null and b/apps/files/tests/golden/base/page_denied/en-192.png differ diff --git a/apps/files/tests/golden/base/page_denied/en-96.png b/apps/files/tests/golden/base/page_denied/en-96.png new file mode 100644 index 00000000..e2049a91 Binary files /dev/null and b/apps/files/tests/golden/base/page_denied/en-96.png differ diff --git a/apps/files/tests/golden/base/page_denied/hc-144.png b/apps/files/tests/golden/base/page_denied/hc-144.png new file mode 100644 index 00000000..3452ae6d Binary files /dev/null and b/apps/files/tests/golden/base/page_denied/hc-144.png differ diff --git a/apps/files/tests/golden/base/page_denied/hc-96.png b/apps/files/tests/golden/base/page_denied/hc-96.png new file mode 100644 index 00000000..6ced14ba Binary files /dev/null and b/apps/files/tests/golden/base/page_denied/hc-96.png differ diff --git a/apps/files/tests/golden/base/page_denied/it-120.png b/apps/files/tests/golden/base/page_denied/it-120.png new file mode 100644 index 00000000..aa408413 Binary files /dev/null and b/apps/files/tests/golden/base/page_denied/it-120.png differ diff --git a/apps/files/tests/golden/base/page_denied/it-144.png b/apps/files/tests/golden/base/page_denied/it-144.png new file mode 100644 index 00000000..c46f2a5b Binary files /dev/null and b/apps/files/tests/golden/base/page_denied/it-144.png differ diff --git a/apps/files/tests/golden/base/page_denied/it-192.png b/apps/files/tests/golden/base/page_denied/it-192.png new file mode 100644 index 00000000..e6ded8a3 Binary files /dev/null and b/apps/files/tests/golden/base/page_denied/it-192.png differ diff --git a/apps/files/tests/golden/base/page_denied/it-96.png b/apps/files/tests/golden/base/page_denied/it-96.png new file mode 100644 index 00000000..1a7fd612 Binary files /dev/null and b/apps/files/tests/golden/base/page_denied/it-96.png differ diff --git a/apps/files/tests/golden/base/page_denied/pseudo-144.png b/apps/files/tests/golden/base/page_denied/pseudo-144.png new file mode 100644 index 00000000..8bcbee13 Binary files /dev/null and b/apps/files/tests/golden/base/page_denied/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/page_empty/a11y-en.txt b/apps/files/tests/golden/base/page_empty/a11y-en.txt new file mode 100644 index 00000000..7c502ec5 --- /dev/null +++ b/apps/files/tests/golden/base/page_empty/a11y-en.txt @@ -0,0 +1,49 @@ +TabList + Tab "none" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to documents · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Link "none" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" [focusable] 0 of 0 +Label "This folder is empty" +Label "Ctrl+Shift+N new folder" +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "0 items" diff --git a/apps/files/tests/golden/base/page_empty/a11y-it.txt b/apps/files/tests/golden/base/page_empty/a11y-it.txt new file mode 100644 index 00000000..e2dbff2f --- /dev/null +++ b/apps/files/tests/golden/base/page_empty/a11y-it.txt @@ -0,0 +1,48 @@ +TabList + Tab "none" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a documents · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Link "none" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" [focusable] 0 of 0 +Label "Questa cartella è vuota" +Label "Ctrl+Maiusc+N nuova cartella" +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "0 elementi" diff --git a/apps/files/tests/golden/base/page_empty/en-96.png b/apps/files/tests/golden/base/page_empty/en-96.png new file mode 100644 index 00000000..41fe3bbc Binary files /dev/null and b/apps/files/tests/golden/base/page_empty/en-96.png differ diff --git a/apps/files/tests/golden/base/page_empty/hc-144.png b/apps/files/tests/golden/base/page_empty/hc-144.png new file mode 100644 index 00000000..be62dade Binary files /dev/null and b/apps/files/tests/golden/base/page_empty/hc-144.png differ diff --git a/apps/files/tests/golden/base/page_empty/it-144.png b/apps/files/tests/golden/base/page_empty/it-144.png new file mode 100644 index 00000000..b4457898 Binary files /dev/null and b/apps/files/tests/golden/base/page_empty/it-144.png differ diff --git a/apps/files/tests/golden/base/page_empty/pseudo-144.png b/apps/files/tests/golden/base/page_empty/pseudo-144.png new file mode 100644 index 00000000..8e0c3f48 Binary files /dev/null and b/apps/files/tests/golden/base/page_empty/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/page_loading/a11y-en.txt b/apps/files/tests/golden/base/page_loading/a11y-en.txt new file mode 100644 index 00000000..94e804bb --- /dev/null +++ b/apps/files/tests/golden/base/page_loading/a11y-en.txt @@ -0,0 +1,47 @@ +TabList + Tab "slow" [focusable, selected, busy] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "slow" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" [focusable] 0 of 0 +Label "Loading…" +ProgressIndicator +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "0 items" diff --git a/apps/files/tests/golden/base/page_loading/a11y-it.txt b/apps/files/tests/golden/base/page_loading/a11y-it.txt new file mode 100644 index 00000000..06181f79 --- /dev/null +++ b/apps/files/tests/golden/base/page_loading/a11y-it.txt @@ -0,0 +1,46 @@ +TabList + Tab "slow" [focusable, selected, busy] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "slow" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" [focusable] 0 of 0 +Label "Caricamento…" +ProgressIndicator +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "0 elementi" diff --git a/apps/files/tests/golden/base/page_loading/en-96.png b/apps/files/tests/golden/base/page_loading/en-96.png new file mode 100644 index 00000000..e1a7f41c Binary files /dev/null and b/apps/files/tests/golden/base/page_loading/en-96.png differ diff --git a/apps/files/tests/golden/base/page_loading/hc-144.png b/apps/files/tests/golden/base/page_loading/hc-144.png new file mode 100644 index 00000000..230604de Binary files /dev/null and b/apps/files/tests/golden/base/page_loading/hc-144.png differ diff --git a/apps/files/tests/golden/base/page_loading/it-144.png b/apps/files/tests/golden/base/page_loading/it-144.png new file mode 100644 index 00000000..3dda3ce6 Binary files /dev/null and b/apps/files/tests/golden/base/page_loading/it-144.png differ diff --git a/apps/files/tests/golden/base/page_loading/pseudo-144.png b/apps/files/tests/golden/base/page_loading/pseudo-144.png new file mode 100644 index 00000000..aadf49a6 Binary files /dev/null and b/apps/files/tests/golden/base/page_loading/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/page_offline/a11y-en.txt b/apps/files/tests/golden/base/page_offline/a11y-en.txt new file mode 100644 index 00000000..152fece3 --- /dev/null +++ b/apps/files/tests/golden/base/page_offline/a11y-en.txt @@ -0,0 +1,49 @@ +TabList + Tab "locked" [focusable, selected, invalid] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to documents · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Link "locked" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" [focusable] 0 of 0 +Label "The drive isn't reachable" +Button "Retry" [focusable] +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "0 items" diff --git a/apps/files/tests/golden/base/page_offline/a11y-it.txt b/apps/files/tests/golden/base/page_offline/a11y-it.txt new file mode 100644 index 00000000..eb05dab3 --- /dev/null +++ b/apps/files/tests/golden/base/page_offline/a11y-it.txt @@ -0,0 +1,48 @@ +TabList + Tab "locked" [focusable, selected, invalid] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a documents · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Link "locked" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" [focusable] 0 of 0 +Label "L'unità non è raggiungibile" +Button "Riprova" [focusable] +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "0 elementi" diff --git a/apps/files/tests/golden/base/page_offline/en-96.png b/apps/files/tests/golden/base/page_offline/en-96.png new file mode 100644 index 00000000..3b841e78 Binary files /dev/null and b/apps/files/tests/golden/base/page_offline/en-96.png differ diff --git a/apps/files/tests/golden/base/page_offline/hc-144.png b/apps/files/tests/golden/base/page_offline/hc-144.png new file mode 100644 index 00000000..72b96594 Binary files /dev/null and b/apps/files/tests/golden/base/page_offline/hc-144.png differ diff --git a/apps/files/tests/golden/base/page_offline/it-144.png b/apps/files/tests/golden/base/page_offline/it-144.png new file mode 100644 index 00000000..6f5bb33f Binary files /dev/null and b/apps/files/tests/golden/base/page_offline/it-144.png differ diff --git a/apps/files/tests/golden/base/page_offline/pseudo-144.png b/apps/files/tests/golden/base/page_offline/pseudo-144.png new file mode 100644 index 00000000..e6ef0d2b Binary files /dev/null and b/apps/files/tests/golden/base/page_offline/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/paste_chip_copying/a11y-en.txt b/apps/files/tests/golden/base/paste_chip_copying/a11y-en.txt new file mode 100644 index 00000000..9b277677 --- /dev/null +++ b/apps/files/tests/golden/base/paste_chip_copying/a11y-en.txt @@ -0,0 +1,55 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +ProgressIndicator 62% +Button "Copying to Download: 3 items, 62 %" [focusable] +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/paste_chip_copying/a11y-it.txt b/apps/files/tests/golden/base/paste_chip_copying/a11y-it.txt new file mode 100644 index 00000000..ae1dc19b --- /dev/null +++ b/apps/files/tests/golden/base/paste_chip_copying/a11y-it.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +ProgressIndicator 62% +Button "Copia in Download: 3 elementi, 62 %" [focusable] +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/paste_chip_copying/contrast-144.png b/apps/files/tests/golden/base/paste_chip_copying/contrast-144.png new file mode 100644 index 00000000..63e7e33c Binary files /dev/null and b/apps/files/tests/golden/base/paste_chip_copying/contrast-144.png differ diff --git a/apps/files/tests/golden/base/paste_chip_copying/en-120.png b/apps/files/tests/golden/base/paste_chip_copying/en-120.png new file mode 100644 index 00000000..a4832c47 Binary files /dev/null and b/apps/files/tests/golden/base/paste_chip_copying/en-120.png differ diff --git a/apps/files/tests/golden/base/paste_chip_copying/en-144.png b/apps/files/tests/golden/base/paste_chip_copying/en-144.png new file mode 100644 index 00000000..63e7e33c Binary files /dev/null and b/apps/files/tests/golden/base/paste_chip_copying/en-144.png differ diff --git a/apps/files/tests/golden/base/paste_chip_copying/en-192.png b/apps/files/tests/golden/base/paste_chip_copying/en-192.png new file mode 100644 index 00000000..06d0789c Binary files /dev/null and b/apps/files/tests/golden/base/paste_chip_copying/en-192.png differ diff --git a/apps/files/tests/golden/base/paste_chip_copying/en-96.png b/apps/files/tests/golden/base/paste_chip_copying/en-96.png new file mode 100644 index 00000000..40f3691a Binary files /dev/null and b/apps/files/tests/golden/base/paste_chip_copying/en-96.png differ diff --git a/apps/files/tests/golden/base/paste_chip_copying/hc-144.png b/apps/files/tests/golden/base/paste_chip_copying/hc-144.png new file mode 100644 index 00000000..ebd92e62 Binary files /dev/null and b/apps/files/tests/golden/base/paste_chip_copying/hc-144.png differ diff --git a/apps/files/tests/golden/base/paste_chip_copying/hc-96.png b/apps/files/tests/golden/base/paste_chip_copying/hc-96.png new file mode 100644 index 00000000..c30425fd Binary files /dev/null and b/apps/files/tests/golden/base/paste_chip_copying/hc-96.png differ diff --git a/apps/files/tests/golden/base/paste_chip_copying/it-120.png b/apps/files/tests/golden/base/paste_chip_copying/it-120.png new file mode 100644 index 00000000..b0445808 Binary files /dev/null and b/apps/files/tests/golden/base/paste_chip_copying/it-120.png differ diff --git a/apps/files/tests/golden/base/paste_chip_copying/it-144.png b/apps/files/tests/golden/base/paste_chip_copying/it-144.png new file mode 100644 index 00000000..cbe66de6 Binary files /dev/null and b/apps/files/tests/golden/base/paste_chip_copying/it-144.png differ diff --git a/apps/files/tests/golden/base/paste_chip_copying/it-192.png b/apps/files/tests/golden/base/paste_chip_copying/it-192.png new file mode 100644 index 00000000..c2829cc6 Binary files /dev/null and b/apps/files/tests/golden/base/paste_chip_copying/it-192.png differ diff --git a/apps/files/tests/golden/base/paste_chip_copying/it-96.png b/apps/files/tests/golden/base/paste_chip_copying/it-96.png new file mode 100644 index 00000000..30f4a402 Binary files /dev/null and b/apps/files/tests/golden/base/paste_chip_copying/it-96.png differ diff --git a/apps/files/tests/golden/base/paste_chip_copying/pseudo-144.png b/apps/files/tests/golden/base/paste_chip_copying/pseudo-144.png new file mode 100644 index 00000000..c4aa7a6b Binary files /dev/null and b/apps/files/tests/golden/base/paste_chip_copying/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/paste_cut_rows/a11y-en.txt b/apps/files/tests/golden/base/paste_cut_rows/a11y-en.txt new file mode 100644 index 00000000..7368486a --- /dev/null +++ b/apps/files/tests/golden/base/paste_cut_rows/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [focusable] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable, selected] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected" diff --git a/apps/files/tests/golden/base/paste_cut_rows/a11y-it.txt b/apps/files/tests/golden/base/paste_cut_rows/a11y-it.txt new file mode 100644 index 00000000..24ab6a0d --- /dev/null +++ b/apps/files/tests/golden/base/paste_cut_rows/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [focusable] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable, selected] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato" diff --git a/apps/files/tests/golden/base/paste_cut_rows/en-96.png b/apps/files/tests/golden/base/paste_cut_rows/en-96.png new file mode 100644 index 00000000..97b54e87 Binary files /dev/null and b/apps/files/tests/golden/base/paste_cut_rows/en-96.png differ diff --git a/apps/files/tests/golden/base/paste_cut_rows/hc-144.png b/apps/files/tests/golden/base/paste_cut_rows/hc-144.png new file mode 100644 index 00000000..fa58939e Binary files /dev/null and b/apps/files/tests/golden/base/paste_cut_rows/hc-144.png differ diff --git a/apps/files/tests/golden/base/paste_cut_rows/it-144.png b/apps/files/tests/golden/base/paste_cut_rows/it-144.png new file mode 100644 index 00000000..24a7b1d9 Binary files /dev/null and b/apps/files/tests/golden/base/paste_cut_rows/it-144.png differ diff --git a/apps/files/tests/golden/base/paste_cut_rows/pseudo-144.png b/apps/files/tests/golden/base/paste_cut_rows/pseudo-144.png new file mode 100644 index 00000000..74b6f985 Binary files /dev/null and b/apps/files/tests/golden/base/paste_cut_rows/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/paste_flyout_done/a11y-en.txt b/apps/files/tests/golden/base/paste_flyout_done/a11y-en.txt new file mode 100644 index 00000000..eccb69a9 --- /dev/null +++ b/apps/files/tests/golden/base/paste_flyout_done/a11y-en.txt @@ -0,0 +1,58 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Button "Copied 3 items to Download" [focusable] + Button "Undo" [focusable] +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Group "Operations" +ListItem "Copied 3 items to Download" +Button "Undo" [focusable] diff --git a/apps/files/tests/golden/base/paste_flyout_done/a11y-it.txt b/apps/files/tests/golden/base/paste_flyout_done/a11y-it.txt new file mode 100644 index 00000000..7ec97fc4 --- /dev/null +++ b/apps/files/tests/golden/base/paste_flyout_done/a11y-it.txt @@ -0,0 +1,56 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Button "Copiati 3 elementi in Download" [focusable] + Button "Annulla" [focusable] +Label "384 GB liberi di 1,81 TB" +Label "9 elementi" +Group "Operazioni" +ListItem "Copiati 3 elementi in Download" +Button "Annulla" [focusable] diff --git a/apps/files/tests/golden/base/paste_flyout_done/en-96.png b/apps/files/tests/golden/base/paste_flyout_done/en-96.png new file mode 100644 index 00000000..a438b64d Binary files /dev/null and b/apps/files/tests/golden/base/paste_flyout_done/en-96.png differ diff --git a/apps/files/tests/golden/base/paste_flyout_done/hc-144.png b/apps/files/tests/golden/base/paste_flyout_done/hc-144.png new file mode 100644 index 00000000..5545022e Binary files /dev/null and b/apps/files/tests/golden/base/paste_flyout_done/hc-144.png differ diff --git a/apps/files/tests/golden/base/paste_flyout_done/it-144.png b/apps/files/tests/golden/base/paste_flyout_done/it-144.png new file mode 100644 index 00000000..f0ad695a Binary files /dev/null and b/apps/files/tests/golden/base/paste_flyout_done/it-144.png differ diff --git a/apps/files/tests/golden/base/paste_flyout_done/pseudo-144.png b/apps/files/tests/golden/base/paste_flyout_done/pseudo-144.png new file mode 100644 index 00000000..3ec34943 Binary files /dev/null and b/apps/files/tests/golden/base/paste_flyout_done/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/paste_off_tooltip/a11y-en.txt b/apps/files/tests/golden/base/paste_off_tooltip/a11y-en.txt new file mode 100644 index 00000000..66715fd5 --- /dev/null +++ b/apps/files/tests/golden/base/paste_off_tooltip/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 28% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable, selected] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected" diff --git a/apps/files/tests/golden/base/paste_off_tooltip/a11y-it.txt b/apps/files/tests/golden/base/paste_off_tooltip/a11y-it.txt new file mode 100644 index 00000000..0b3091b1 --- /dev/null +++ b/apps/files/tests/golden/base/paste_off_tooltip/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 28% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable, selected] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato" diff --git a/apps/files/tests/golden/base/paste_off_tooltip/en-96.png b/apps/files/tests/golden/base/paste_off_tooltip/en-96.png new file mode 100644 index 00000000..c333b5a6 Binary files /dev/null and b/apps/files/tests/golden/base/paste_off_tooltip/en-96.png differ diff --git a/apps/files/tests/golden/base/paste_off_tooltip/hc-144.png b/apps/files/tests/golden/base/paste_off_tooltip/hc-144.png new file mode 100644 index 00000000..002e9628 Binary files /dev/null and b/apps/files/tests/golden/base/paste_off_tooltip/hc-144.png differ diff --git a/apps/files/tests/golden/base/paste_off_tooltip/it-144.png b/apps/files/tests/golden/base/paste_off_tooltip/it-144.png new file mode 100644 index 00000000..26ab9321 Binary files /dev/null and b/apps/files/tests/golden/base/paste_off_tooltip/it-144.png differ diff --git a/apps/files/tests/golden/base/paste_off_tooltip/pseudo-144.png b/apps/files/tests/golden/base/paste_off_tooltip/pseudo-144.png new file mode 100644 index 00000000..70f04c92 Binary files /dev/null and b/apps/files/tests/golden/base/paste_off_tooltip/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/path_edit_completion/a11y-en.txt b/apps/files/tests/golden/base/path_edit_completion/a11y-en.txt index 7a4d1cb2..f7a2a2a5 100644 --- a/apps/files/tests/golden/base/path_edit_completion/a11y-en.txt +++ b/apps/files/tests/golden/base/path_edit_completion/a11y-en.txt @@ -5,25 +5,33 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" TextInput "Path" [focusable] "C:\\made-up\\pro" +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree - Label "Pinned" + TreeItem "Home" [focusable] level 1 + Label "Quick access" TreeItem "projects" [disabled] level 1 TreeItem "projects-archive" [disabled] level 1 TreeItem "photos" [disabled] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 22.222221% + TreeItem "Network" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -38,4 +46,6 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/path_edit_completion/a11y-it.txt b/apps/files/tests/golden/base/path_edit_completion/a11y-it.txt index 743fbc85..2d59d985 100644 --- a/apps/files/tests/golden/base/path_edit_completion/a11y-it.txt +++ b/apps/files/tests/golden/base/path_edit_completion/a11y-it.txt @@ -5,25 +5,32 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" TextInput "Percorso" [focusable] "C:\\made-up\\pro" +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree - Label "Aggiunti" + TreeItem "Home" [focusable] level 1 + Label "Accesso rapido" TreeItem "projects" [disabled] level 1 TreeItem "projects-archive" [disabled] level 1 TreeItem "photos" [disabled] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 22.222221% + TreeItem "Rete" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -38,4 +45,6 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/path_edit_completion/en-96-menu0.png b/apps/files/tests/golden/base/path_edit_completion/en-96-menu0.png index 86e28145..7ea6709a 100644 Binary files a/apps/files/tests/golden/base/path_edit_completion/en-96-menu0.png and b/apps/files/tests/golden/base/path_edit_completion/en-96-menu0.png differ diff --git a/apps/files/tests/golden/base/path_edit_completion/en-96.png b/apps/files/tests/golden/base/path_edit_completion/en-96.png index 7d97de42..0832c95c 100644 Binary files a/apps/files/tests/golden/base/path_edit_completion/en-96.png and b/apps/files/tests/golden/base/path_edit_completion/en-96.png differ diff --git a/apps/files/tests/golden/base/path_edit_completion/hc-144-menu0.png b/apps/files/tests/golden/base/path_edit_completion/hc-144-menu0.png index 8e506633..d27b4f62 100644 Binary files a/apps/files/tests/golden/base/path_edit_completion/hc-144-menu0.png and b/apps/files/tests/golden/base/path_edit_completion/hc-144-menu0.png differ diff --git a/apps/files/tests/golden/base/path_edit_completion/hc-144.png b/apps/files/tests/golden/base/path_edit_completion/hc-144.png index ef7baa5c..34575a89 100644 Binary files a/apps/files/tests/golden/base/path_edit_completion/hc-144.png and b/apps/files/tests/golden/base/path_edit_completion/hc-144.png differ diff --git a/apps/files/tests/golden/base/path_edit_completion/it-144-menu0.png b/apps/files/tests/golden/base/path_edit_completion/it-144-menu0.png index 04461a2e..f1ee5f37 100644 Binary files a/apps/files/tests/golden/base/path_edit_completion/it-144-menu0.png and b/apps/files/tests/golden/base/path_edit_completion/it-144-menu0.png differ diff --git a/apps/files/tests/golden/base/path_edit_completion/it-144.png b/apps/files/tests/golden/base/path_edit_completion/it-144.png index 6d9bdb49..cb22ee05 100644 Binary files a/apps/files/tests/golden/base/path_edit_completion/it-144.png and b/apps/files/tests/golden/base/path_edit_completion/it-144.png differ diff --git a/apps/files/tests/golden/base/path_edit_completion/pseudo-144-menu0.png b/apps/files/tests/golden/base/path_edit_completion/pseudo-144-menu0.png index 04461a2e..f1ee5f37 100644 Binary files a/apps/files/tests/golden/base/path_edit_completion/pseudo-144-menu0.png and b/apps/files/tests/golden/base/path_edit_completion/pseudo-144-menu0.png differ diff --git a/apps/files/tests/golden/base/path_edit_completion/pseudo-144.png b/apps/files/tests/golden/base/path_edit_completion/pseudo-144.png index 9098a5ff..fc85ea56 100644 Binary files a/apps/files/tests/golden/base/path_edit_completion/pseudo-144.png and b/apps/files/tests/golden/base/path_edit_completion/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/path_error/a11y-en.txt b/apps/files/tests/golden/base/path_error/a11y-en.txt index 76e0476c..8c1fb91b 100644 --- a/apps/files/tests/golden/base/path_error/a11y-en.txt +++ b/apps/files/tests/golden/base/path_error/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,19 +14,30 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree - Label "Pinned" + TreeItem "Home" [focusable] level 1 + Label "Quick access" TreeItem "projects" [disabled] level 1 TreeItem "projects-archive" [disabled] level 1 TreeItem "photos" [disabled] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 22.222221% + TreeItem "Network" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -44,4 +52,6 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/path_error/a11y-it.txt b/apps/files/tests/golden/base/path_error/a11y-it.txt index 06c88c53..dee22cf6 100644 --- a/apps/files/tests/golden/base/path_error/a11y-it.txt +++ b/apps/files/tests/golden/base/path_error/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,19 +14,29 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree - Label "Aggiunti" + TreeItem "Home" [focusable] level 1 + Label "Accesso rapido" TreeItem "projects" [disabled] level 1 TreeItem "projects-archive" [disabled] level 1 TreeItem "photos" [disabled] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 22.222221% + TreeItem "Rete" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -44,4 +51,6 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/path_error/en-96.png b/apps/files/tests/golden/base/path_error/en-96.png index ec5f2aa1..b82b4e7b 100644 Binary files a/apps/files/tests/golden/base/path_error/en-96.png and b/apps/files/tests/golden/base/path_error/en-96.png differ diff --git a/apps/files/tests/golden/base/path_error/hc-144.png b/apps/files/tests/golden/base/path_error/hc-144.png index ed8b538e..4c53a83d 100644 Binary files a/apps/files/tests/golden/base/path_error/hc-144.png and b/apps/files/tests/golden/base/path_error/hc-144.png differ diff --git a/apps/files/tests/golden/base/path_error/it-144.png b/apps/files/tests/golden/base/path_error/it-144.png index b19fd701..27e4a465 100644 Binary files a/apps/files/tests/golden/base/path_error/it-144.png and b/apps/files/tests/golden/base/path_error/it-144.png differ diff --git a/apps/files/tests/golden/base/path_error/pseudo-144.png b/apps/files/tests/golden/base/path_error/pseudo-144.png index 405c9286..d57b249f 100644 Binary files a/apps/files/tests/golden/base/path_error/pseudo-144.png and b/apps/files/tests/golden/base/path_error/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/places/a11y-en.txt b/apps/files/tests/golden/base/places/a11y-en.txt new file mode 100644 index 00000000..ceba2795 --- /dev/null +++ b/apps/files/tests/golden/base/places/a11y-en.txt @@ -0,0 +1,74 @@ +TabList + Tab "Documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to user · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "user" [focusable] + Button "Subfolders" + Link "Documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Quick access" + TreeItem "Desktop" [focusable, expandable] level 1 + TreeItem "Downloads" [focusable, expandable] level 1 + TreeItem "Documents" [focusable, selected, expandable] level 1 + TreeItem "Pictures" [focusable, expandable] level 1 + TreeItem "Music" [focusable, expandable] level 1 + TreeItem "Videos" [focusable, expandable] level 1 + TreeItem "projects" [focusable, expandable] level 1 + Button "Remove from Quick access" + TreeItem "media" [focusable, expandable] level 1 + Button "Remove from Quick access" + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + TreeItem "E:" [disabled] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 22.4% +Pane "Details pane" +Button "Open" [focusable] +Button "Open with" [focusable, expandable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 5 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable, selected] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "596 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected, 1.17 KB" diff --git a/apps/files/tests/golden/base/places/a11y-it.txt b/apps/files/tests/golden/base/places/a11y-it.txt new file mode 100644 index 00000000..dda511aa --- /dev/null +++ b/apps/files/tests/golden/base/places/a11y-it.txt @@ -0,0 +1,73 @@ +TabList + Tab "Documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a user · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "user" [focusable] + Button "Sottocartelle" + Link "Documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Accesso rapido" + TreeItem "Desktop" [focusable, expandable] level 1 + TreeItem "Download" [focusable, expandable] level 1 + TreeItem "Documenti" [focusable, selected, expandable] level 1 + TreeItem "Immagini" [focusable, expandable] level 1 + TreeItem "Musica" [focusable, expandable] level 1 + TreeItem "Video" [focusable, expandable] level 1 + TreeItem "projects" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" + TreeItem "media" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + TreeItem "E:" [disabled] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 22.4% +Pane "Riquadro dei dettagli" +Button "Apri" [focusable] +Button "Apri con" [focusable, expandable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 5 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable, selected] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "596 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato, 1,17 KB" diff --git a/apps/files/tests/golden/base/places/contrast-144.png b/apps/files/tests/golden/base/places/contrast-144.png new file mode 100644 index 00000000..236f195a Binary files /dev/null and b/apps/files/tests/golden/base/places/contrast-144.png differ diff --git a/apps/files/tests/golden/base/places/en-120.png b/apps/files/tests/golden/base/places/en-120.png new file mode 100644 index 00000000..cb50b5e5 Binary files /dev/null and b/apps/files/tests/golden/base/places/en-120.png differ diff --git a/apps/files/tests/golden/base/places/en-144.png b/apps/files/tests/golden/base/places/en-144.png new file mode 100644 index 00000000..236f195a Binary files /dev/null and b/apps/files/tests/golden/base/places/en-144.png differ diff --git a/apps/files/tests/golden/base/places/en-192.png b/apps/files/tests/golden/base/places/en-192.png new file mode 100644 index 00000000..15b55c2f Binary files /dev/null and b/apps/files/tests/golden/base/places/en-192.png differ diff --git a/apps/files/tests/golden/base/places/en-96.png b/apps/files/tests/golden/base/places/en-96.png new file mode 100644 index 00000000..bb1396bd Binary files /dev/null and b/apps/files/tests/golden/base/places/en-96.png differ diff --git a/apps/files/tests/golden/base/places/hc-144.png b/apps/files/tests/golden/base/places/hc-144.png new file mode 100644 index 00000000..e1d5ab21 Binary files /dev/null and b/apps/files/tests/golden/base/places/hc-144.png differ diff --git a/apps/files/tests/golden/base/places/hc-96.png b/apps/files/tests/golden/base/places/hc-96.png new file mode 100644 index 00000000..e1ac4045 Binary files /dev/null and b/apps/files/tests/golden/base/places/hc-96.png differ diff --git a/apps/files/tests/golden/base/places/it-120.png b/apps/files/tests/golden/base/places/it-120.png new file mode 100644 index 00000000..3c45960a Binary files /dev/null and b/apps/files/tests/golden/base/places/it-120.png differ diff --git a/apps/files/tests/golden/base/places/it-144.png b/apps/files/tests/golden/base/places/it-144.png new file mode 100644 index 00000000..6a321ada Binary files /dev/null and b/apps/files/tests/golden/base/places/it-144.png differ diff --git a/apps/files/tests/golden/base/places/it-192.png b/apps/files/tests/golden/base/places/it-192.png new file mode 100644 index 00000000..a4b2778b Binary files /dev/null and b/apps/files/tests/golden/base/places/it-192.png differ diff --git a/apps/files/tests/golden/base/places/it-96.png b/apps/files/tests/golden/base/places/it-96.png new file mode 100644 index 00000000..b9e9f829 Binary files /dev/null and b/apps/files/tests/golden/base/places/it-96.png differ diff --git a/apps/files/tests/golden/base/places/pseudo-144.png b/apps/files/tests/golden/base/places/pseudo-144.png new file mode 100644 index 00000000..57b64f2b Binary files /dev/null and b/apps/files/tests/golden/base/places/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/places_full_drive/a11y-en.txt b/apps/files/tests/golden/base/places_full_drive/a11y-en.txt new file mode 100644 index 00000000..3b848c64 --- /dev/null +++ b/apps/files/tests/golden/base/places_full_drive/a11y-en.txt @@ -0,0 +1,69 @@ +TabList + Tab "media" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "D:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "media" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Quick access" + TreeItem "Desktop" [focusable, expandable] level 1 + TreeItem "Downloads" [focusable, expandable] level 1 + TreeItem "Documents" [focusable, expandable] level 1 + TreeItem "Pictures" [focusable, expandable] level 1 + TreeItem "Music" [focusable, expandable] level 1 + TreeItem "Videos" [focusable, expandable] level 1 + TreeItem "projects" [focusable, expandable] level 1 + Button "Remove from Quick access" + TreeItem "media" [focusable, selected, expandable] level 1 + Button "Remove from Quick access" + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + TreeItem "E:" [disabled] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 22.4% +Pane "Details pane" +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "46.6 GB free of 931 GB" +Label "Data (D:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/places_full_drive/a11y-it.txt b/apps/files/tests/golden/base/places_full_drive/a11y-it.txt new file mode 100644 index 00000000..8b0db215 --- /dev/null +++ b/apps/files/tests/golden/base/places_full_drive/a11y-it.txt @@ -0,0 +1,68 @@ +TabList + Tab "media" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "D:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "media" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Accesso rapido" + TreeItem "Desktop" [focusable, expandable] level 1 + TreeItem "Download" [focusable, expandable] level 1 + TreeItem "Documenti" [focusable, expandable] level 1 + TreeItem "Immagini" [focusable, expandable] level 1 + TreeItem "Musica" [focusable, expandable] level 1 + TreeItem "Video" [focusable, expandable] level 1 + TreeItem "projects" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" + TreeItem "media" [focusable, selected, expandable] level 1 + Button "Togli da Accesso rapido" + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + TreeItem "E:" [disabled] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 22.4% +Pane "Riquadro dei dettagli" +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "46,6 GB liberi di 931 GB" +Label "Data (D:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/places_full_drive/en-96.png b/apps/files/tests/golden/base/places_full_drive/en-96.png new file mode 100644 index 00000000..3edc8f7b Binary files /dev/null and b/apps/files/tests/golden/base/places_full_drive/en-96.png differ diff --git a/apps/files/tests/golden/base/places_full_drive/hc-144.png b/apps/files/tests/golden/base/places_full_drive/hc-144.png new file mode 100644 index 00000000..de6b2297 Binary files /dev/null and b/apps/files/tests/golden/base/places_full_drive/hc-144.png differ diff --git a/apps/files/tests/golden/base/places_full_drive/it-144.png b/apps/files/tests/golden/base/places_full_drive/it-144.png new file mode 100644 index 00000000..1fd3cbdb Binary files /dev/null and b/apps/files/tests/golden/base/places_full_drive/it-144.png differ diff --git a/apps/files/tests/golden/base/places_full_drive/pseudo-144.png b/apps/files/tests/golden/base/places_full_drive/pseudo-144.png new file mode 100644 index 00000000..54abb60d Binary files /dev/null and b/apps/files/tests/golden/base/places_full_drive/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/places_hover/a11y-en.txt b/apps/files/tests/golden/base/places_hover/a11y-en.txt new file mode 100644 index 00000000..5d19f197 --- /dev/null +++ b/apps/files/tests/golden/base/places_hover/a11y-en.txt @@ -0,0 +1,71 @@ +TabList + Tab "Documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to user · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "user" [focusable] + Button "Subfolders" + Link "Documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Quick access" + TreeItem "Desktop" [focusable, expandable] level 1 + TreeItem "Downloads" [focusable, expandable] level 1 + TreeItem "Documents" [focusable, selected, expandable] level 1 + TreeItem "Pictures" [focusable, expandable] level 1 + TreeItem "Music" [focusable, expandable] level 1 + TreeItem "Videos" [focusable, expandable] level 1 + TreeItem "projects" [focusable, expandable] level 1 + Button "Remove from Quick access" + TreeItem "media" [focusable, expandable] level 1 + Button "Remove from Quick access" + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + TreeItem "E:" [disabled] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 22.4% +Pane "Details pane" +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "596 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/places_hover/a11y-it.txt b/apps/files/tests/golden/base/places_hover/a11y-it.txt new file mode 100644 index 00000000..27480aec --- /dev/null +++ b/apps/files/tests/golden/base/places_hover/a11y-it.txt @@ -0,0 +1,70 @@ +TabList + Tab "Documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a user · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "user" [focusable] + Button "Sottocartelle" + Link "Documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Accesso rapido" + TreeItem "Desktop" [focusable, expandable] level 1 + TreeItem "Download" [focusable, expandable] level 1 + TreeItem "Documenti" [focusable, selected, expandable] level 1 + TreeItem "Immagini" [focusable, expandable] level 1 + TreeItem "Musica" [focusable, expandable] level 1 + TreeItem "Video" [focusable, expandable] level 1 + TreeItem "projects" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" + TreeItem "media" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + TreeItem "E:" [disabled] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 22.4% +Pane "Riquadro dei dettagli" +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "596 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/places_hover/en-96.png b/apps/files/tests/golden/base/places_hover/en-96.png new file mode 100644 index 00000000..237e6874 Binary files /dev/null and b/apps/files/tests/golden/base/places_hover/en-96.png differ diff --git a/apps/files/tests/golden/base/places_hover/hc-144.png b/apps/files/tests/golden/base/places_hover/hc-144.png new file mode 100644 index 00000000..df7fea07 Binary files /dev/null and b/apps/files/tests/golden/base/places_hover/hc-144.png differ diff --git a/apps/files/tests/golden/base/places_hover/it-144.png b/apps/files/tests/golden/base/places_hover/it-144.png new file mode 100644 index 00000000..84b40b8e Binary files /dev/null and b/apps/files/tests/golden/base/places_hover/it-144.png differ diff --git a/apps/files/tests/golden/base/places_hover/pseudo-144.png b/apps/files/tests/golden/base/places_hover/pseudo-144.png new file mode 100644 index 00000000..194c7458 Binary files /dev/null and b/apps/files/tests/golden/base/places_hover/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/places_status_narrow/a11y-en.txt b/apps/files/tests/golden/base/places_status_narrow/a11y-en.txt new file mode 100644 index 00000000..da771dd3 --- /dev/null +++ b/apps/files/tests/golden/base/places_status_narrow/a11y-en.txt @@ -0,0 +1,44 @@ +TabList + Tab "Documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to user · Alt+↑" [focusable] +Button "Search in Documents" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "user" [focusable] + Button "Subfolders" + Link "Documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "More" [focusable, expandable] + Button "Details" [focusable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 5 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable, selected] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +ProgressIndicator 62% +Button "Deleting 2,000 items · 62 %" [focusable] +Label "596 GB free of 1.81 TB" +Label "9 items" diff --git a/apps/files/tests/golden/base/places_status_narrow/a11y-it.txt b/apps/files/tests/golden/base/places_status_narrow/a11y-it.txt new file mode 100644 index 00000000..65e5dd1c --- /dev/null +++ b/apps/files/tests/golden/base/places_status_narrow/a11y-it.txt @@ -0,0 +1,43 @@ +TabList + Tab "Documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a user · Alt+↑" [focusable] +Button "Cerca in Documents" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "user" [focusable] + Button "Sottocartelle" + Link "Documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 5 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable, selected] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +ProgressIndicator 62% +Button "Eliminazione di 2.000 elementi · 62 %" [focusable] +Label "596 GB liberi di 1,81 TB" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/places_status_narrow/en-96.png b/apps/files/tests/golden/base/places_status_narrow/en-96.png new file mode 100644 index 00000000..57b6eaeb Binary files /dev/null and b/apps/files/tests/golden/base/places_status_narrow/en-96.png differ diff --git a/apps/files/tests/golden/base/places_status_narrow/hc-144.png b/apps/files/tests/golden/base/places_status_narrow/hc-144.png new file mode 100644 index 00000000..876145b3 Binary files /dev/null and b/apps/files/tests/golden/base/places_status_narrow/hc-144.png differ diff --git a/apps/files/tests/golden/base/places_status_narrow/it-144.png b/apps/files/tests/golden/base/places_status_narrow/it-144.png new file mode 100644 index 00000000..e6c91b0f Binary files /dev/null and b/apps/files/tests/golden/base/places_status_narrow/it-144.png differ diff --git a/apps/files/tests/golden/base/places_status_narrow/pseudo-144.png b/apps/files/tests/golden/base/places_status_narrow/pseudo-144.png new file mode 100644 index 00000000..d30f9d9b Binary files /dev/null and b/apps/files/tests/golden/base/places_status_narrow/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/places_status_op/a11y-en.txt b/apps/files/tests/golden/base/places_status_op/a11y-en.txt new file mode 100644 index 00000000..f7de266f --- /dev/null +++ b/apps/files/tests/golden/base/places_status_op/a11y-en.txt @@ -0,0 +1,76 @@ +TabList + Tab "Documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to user · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "user" [focusable] + Button "Subfolders" + Link "Documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Quick access" + TreeItem "Desktop" [focusable, expandable] level 1 + TreeItem "Downloads" [focusable, expandable] level 1 + TreeItem "Documents" [focusable, selected, expandable] level 1 + TreeItem "Pictures" [focusable, expandable] level 1 + TreeItem "Music" [focusable, expandable] level 1 + TreeItem "Videos" [focusable, expandable] level 1 + TreeItem "projects" [focusable, expandable] level 1 + Button "Remove from Quick access" + TreeItem "media" [focusable, expandable] level 1 + Button "Remove from Quick access" + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + TreeItem "E:" [disabled] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 22.4% +Pane "Details pane" +Button "Open" [focusable] +Button "Open with" [focusable, expandable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 5 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable, selected] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +ProgressIndicator 62% +Button "Deleting 2,000 items · 62 %" [focusable] +Label "596 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" +Label "1 selected, 1.17 KB" diff --git a/apps/files/tests/golden/base/places_status_op/a11y-it.txt b/apps/files/tests/golden/base/places_status_op/a11y-it.txt new file mode 100644 index 00000000..b916787a --- /dev/null +++ b/apps/files/tests/golden/base/places_status_op/a11y-it.txt @@ -0,0 +1,75 @@ +TabList + Tab "Documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a user · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "user" [focusable] + Button "Sottocartelle" + Link "Documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Ordina" [focusable, expandable] + Button "Visualizza" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable, checked] +Tree + TreeItem "Home" [focusable] level 1 + Label "Accesso rapido" + TreeItem "Desktop" [focusable, expandable] level 1 + TreeItem "Download" [focusable, expandable] level 1 + TreeItem "Documenti" [focusable, selected, expandable] level 1 + TreeItem "Immagini" [focusable, expandable] level 1 + TreeItem "Musica" [focusable, expandable] level 1 + TreeItem "Video" [focusable, expandable] level 1 + TreeItem "projects" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" + TreeItem "media" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + TreeItem "E:" [disabled] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 22.4% +Pane "Riquadro dei dettagli" +Button "Apri" [focusable] +Button "Apri con" [focusable, expandable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 5 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable, selected] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +ProgressIndicator 62% +Button "Eliminazione di 2.000 elementi · 62 %" [focusable] +Label "596 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" +Label "1 selezionato, 1,17 KB" diff --git a/apps/files/tests/golden/base/places_status_op/en-96.png b/apps/files/tests/golden/base/places_status_op/en-96.png new file mode 100644 index 00000000..d5c25e41 Binary files /dev/null and b/apps/files/tests/golden/base/places_status_op/en-96.png differ diff --git a/apps/files/tests/golden/base/places_status_op/hc-144.png b/apps/files/tests/golden/base/places_status_op/hc-144.png new file mode 100644 index 00000000..42ac9054 Binary files /dev/null and b/apps/files/tests/golden/base/places_status_op/hc-144.png differ diff --git a/apps/files/tests/golden/base/places_status_op/it-144.png b/apps/files/tests/golden/base/places_status_op/it-144.png new file mode 100644 index 00000000..fa143987 Binary files /dev/null and b/apps/files/tests/golden/base/places_status_op/it-144.png differ diff --git a/apps/files/tests/golden/base/places_status_op/pseudo-144.png b/apps/files/tests/golden/base/places_status_op/pseudo-144.png new file mode 100644 index 00000000..6207731c Binary files /dev/null and b/apps/files/tests/golden/base/places_status_op/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/rename_clash/a11y-en.txt b/apps/files/tests/golden/base/rename_clash/a11y-en.txt index 09b6ec81..15c7ad44 100644 --- a/apps/files/tests/golden/base/rename_clash/a11y-en.txt +++ b/apps/files/tests/golden/base/rename_clash/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,23 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" - TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -41,5 +46,7 @@ Table "Name" 4 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 TextInput "Rename" [focusable, invalid] "notes.txt" +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" -Label " · 1 selected · 47.4 KB" +Label "1 selected, 47.4 KB" diff --git a/apps/files/tests/golden/base/rename_clash/a11y-it.txt b/apps/files/tests/golden/base/rename_clash/a11y-it.txt index d5770424..cc6deaa1 100644 --- a/apps/files/tests/golden/base/rename_clash/a11y-it.txt +++ b/apps/files/tests/golden/base/rename_clash/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,22 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" - TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -41,5 +45,7 @@ Table "Nome" 4 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 TextInput "Rinomina" [focusable, invalid] "notes.txt" +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" -Label " · 1 selezionato · 47,4 KB" +Label "1 selezionato, 47,4 KB" diff --git a/apps/files/tests/golden/base/rename_clash/en-96.png b/apps/files/tests/golden/base/rename_clash/en-96.png index d819fdfc..343d3460 100644 Binary files a/apps/files/tests/golden/base/rename_clash/en-96.png and b/apps/files/tests/golden/base/rename_clash/en-96.png differ diff --git a/apps/files/tests/golden/base/rename_clash/hc-144.png b/apps/files/tests/golden/base/rename_clash/hc-144.png index f02abc22..573abccb 100644 Binary files a/apps/files/tests/golden/base/rename_clash/hc-144.png and b/apps/files/tests/golden/base/rename_clash/hc-144.png differ diff --git a/apps/files/tests/golden/base/rename_clash/it-144.png b/apps/files/tests/golden/base/rename_clash/it-144.png index 5a17d155..6adccc68 100644 Binary files a/apps/files/tests/golden/base/rename_clash/it-144.png and b/apps/files/tests/golden/base/rename_clash/it-144.png differ diff --git a/apps/files/tests/golden/base/rename_clash/pseudo-144.png b/apps/files/tests/golden/base/rename_clash/pseudo-144.png index 4a924d73..4199ab6f 100644 Binary files a/apps/files/tests/golden/base/rename_clash/pseudo-144.png and b/apps/files/tests/golden/base/rename_clash/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/rename_field/a11y-en.txt b/apps/files/tests/golden/base/rename_field/a11y-en.txt index cf23a974..3a36fa14 100644 --- a/apps/files/tests/golden/base/rename_field/a11y-en.txt +++ b/apps/files/tests/golden/base/rename_field/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,15 +14,23 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" - TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 25% +Splitter "Resize panes" [focusable] 28% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -41,5 +46,7 @@ Table "Name" 4 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 TextInput "Rename" [focusable] "contract-draft-for-the-apartment-on-the-long-street-07.docx" +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" -Label " · 1 selected · 47.4 KB" +Label "1 selected, 47.4 KB" diff --git a/apps/files/tests/golden/base/rename_field/a11y-it.txt b/apps/files/tests/golden/base/rename_field/a11y-it.txt index 54d79caf..9771e6e6 100644 --- a/apps/files/tests/golden/base/rename_field/a11y-it.txt +++ b/apps/files/tests/golden/base/rename_field/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,15 +14,22 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [focusable] + Button "Copia" [focusable] + Button "Incolla" [disabled] + Button "Rinomina" [focusable] + Button "Elimina" [focusable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" - TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 25% +Splitter "Ridimensiona i riquadri" [focusable] 28% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -41,5 +45,7 @@ Table "Nome" 4 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 TextInput "Rinomina" [focusable] "contract-draft-for-the-apartment-on-the-long-street-07.docx" +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" -Label " · 1 selezionato · 47,4 KB" +Label "1 selezionato, 47,4 KB" diff --git a/apps/files/tests/golden/base/rename_field/en-96.png b/apps/files/tests/golden/base/rename_field/en-96.png index b811ad7c..93a19b59 100644 Binary files a/apps/files/tests/golden/base/rename_field/en-96.png and b/apps/files/tests/golden/base/rename_field/en-96.png differ diff --git a/apps/files/tests/golden/base/rename_field/hc-144.png b/apps/files/tests/golden/base/rename_field/hc-144.png index 37e78d71..3166a0d7 100644 Binary files a/apps/files/tests/golden/base/rename_field/hc-144.png and b/apps/files/tests/golden/base/rename_field/hc-144.png differ diff --git a/apps/files/tests/golden/base/rename_field/it-144.png b/apps/files/tests/golden/base/rename_field/it-144.png index 8e48cc2b..fd0da3eb 100644 Binary files a/apps/files/tests/golden/base/rename_field/it-144.png and b/apps/files/tests/golden/base/rename_field/it-144.png differ diff --git a/apps/files/tests/golden/base/rename_field/pseudo-144.png b/apps/files/tests/golden/base/rename_field/pseudo-144.png index aaec3211..6cfaa2ad 100644 Binary files a/apps/files/tests/golden/base/rename_field/pseudo-144.png and b/apps/files/tests/golden/base/rename_field/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/search_empty/a11y-en.txt b/apps/files/tests/golden/base/search_empty/a11y-en.txt new file mode 100644 index 00000000..e0a6f09f --- /dev/null +++ b/apps/files/tests/golden/base/search_empty/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/search_empty/a11y-it.txt b/apps/files/tests/golden/base/search_empty/a11y-it.txt new file mode 100644 index 00000000..d774946d --- /dev/null +++ b/apps/files/tests/golden/base/search_empty/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/search_empty/en-96.png b/apps/files/tests/golden/base/search_empty/en-96.png new file mode 100644 index 00000000..b6655aa3 Binary files /dev/null and b/apps/files/tests/golden/base/search_empty/en-96.png differ diff --git a/apps/files/tests/golden/base/search_empty/hc-144.png b/apps/files/tests/golden/base/search_empty/hc-144.png new file mode 100644 index 00000000..7b0d6aad Binary files /dev/null and b/apps/files/tests/golden/base/search_empty/hc-144.png differ diff --git a/apps/files/tests/golden/base/search_empty/it-144.png b/apps/files/tests/golden/base/search_empty/it-144.png new file mode 100644 index 00000000..72893bf7 Binary files /dev/null and b/apps/files/tests/golden/base/search_empty/it-144.png differ diff --git a/apps/files/tests/golden/base/search_empty/pseudo-144.png b/apps/files/tests/golden/base/search_empty/pseudo-144.png new file mode 100644 index 00000000..53d6c465 Binary files /dev/null and b/apps/files/tests/golden/base/search_empty/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/search_focused/a11y-en.txt b/apps/files/tests/golden/base/search_focused/a11y-en.txt new file mode 100644 index 00000000..e0a6f09f --- /dev/null +++ b/apps/files/tests/golden/base/search_focused/a11y-en.txt @@ -0,0 +1,54 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/search_focused/a11y-it.txt b/apps/files/tests/golden/base/search_focused/a11y-it.txt new file mode 100644 index 00000000..d774946d --- /dev/null +++ b/apps/files/tests/golden/base/search_focused/a11y-it.txt @@ -0,0 +1,53 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/search_focused/en-96.png b/apps/files/tests/golden/base/search_focused/en-96.png new file mode 100644 index 00000000..8228d2ff Binary files /dev/null and b/apps/files/tests/golden/base/search_focused/en-96.png differ diff --git a/apps/files/tests/golden/base/search_focused/hc-144.png b/apps/files/tests/golden/base/search_focused/hc-144.png new file mode 100644 index 00000000..38553bc7 Binary files /dev/null and b/apps/files/tests/golden/base/search_focused/hc-144.png differ diff --git a/apps/files/tests/golden/base/search_focused/it-144.png b/apps/files/tests/golden/base/search_focused/it-144.png new file mode 100644 index 00000000..3e01af7a Binary files /dev/null and b/apps/files/tests/golden/base/search_focused/it-144.png differ diff --git a/apps/files/tests/golden/base/search_focused/pseudo-144.png b/apps/files/tests/golden/base/search_focused/pseudo-144.png new file mode 100644 index 00000000..f5f280ed Binary files /dev/null and b/apps/files/tests/golden/base/search_focused/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/search_matches/a11y-en.txt b/apps/files/tests/golden/base/search_matches/a11y-en.txt new file mode 100644 index 00000000..4a6ac53a --- /dev/null +++ b/apps/files/tests/golden/base/search_matches/a11y-en.txt @@ -0,0 +1,48 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "REPORT" + Button "Clear" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 2 + Row "report-final-v2.pdf" [focusable] 1 of 2 + Row "report-final-v3.pdf" [focusable] 2 of 2 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "2 of 9 items" diff --git a/apps/files/tests/golden/base/search_matches/a11y-it.txt b/apps/files/tests/golden/base/search_matches/a11y-it.txt new file mode 100644 index 00000000..e82d655d --- /dev/null +++ b/apps/files/tests/golden/base/search_matches/a11y-it.txt @@ -0,0 +1,47 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "REPORT" + Button "Cancella" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 2 + Row "report-final-v2.pdf" [focusable] 1 of 2 + Row "report-final-v3.pdf" [focusable] 2 of 2 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "2 di 9 elementi" diff --git a/apps/files/tests/golden/base/search_matches/contrast-144.png b/apps/files/tests/golden/base/search_matches/contrast-144.png new file mode 100644 index 00000000..6d0e8dfd Binary files /dev/null and b/apps/files/tests/golden/base/search_matches/contrast-144.png differ diff --git a/apps/files/tests/golden/base/search_matches/en-120.png b/apps/files/tests/golden/base/search_matches/en-120.png new file mode 100644 index 00000000..60e7f632 Binary files /dev/null and b/apps/files/tests/golden/base/search_matches/en-120.png differ diff --git a/apps/files/tests/golden/base/search_matches/en-144.png b/apps/files/tests/golden/base/search_matches/en-144.png new file mode 100644 index 00000000..6d0e8dfd Binary files /dev/null and b/apps/files/tests/golden/base/search_matches/en-144.png differ diff --git a/apps/files/tests/golden/base/search_matches/en-192.png b/apps/files/tests/golden/base/search_matches/en-192.png new file mode 100644 index 00000000..394f7fde Binary files /dev/null and b/apps/files/tests/golden/base/search_matches/en-192.png differ diff --git a/apps/files/tests/golden/base/search_matches/en-96.png b/apps/files/tests/golden/base/search_matches/en-96.png new file mode 100644 index 00000000..e416ade1 Binary files /dev/null and b/apps/files/tests/golden/base/search_matches/en-96.png differ diff --git a/apps/files/tests/golden/base/search_matches/hc-144.png b/apps/files/tests/golden/base/search_matches/hc-144.png new file mode 100644 index 00000000..b8b71320 Binary files /dev/null and b/apps/files/tests/golden/base/search_matches/hc-144.png differ diff --git a/apps/files/tests/golden/base/search_matches/hc-96.png b/apps/files/tests/golden/base/search_matches/hc-96.png new file mode 100644 index 00000000..29494848 Binary files /dev/null and b/apps/files/tests/golden/base/search_matches/hc-96.png differ diff --git a/apps/files/tests/golden/base/search_matches/it-120.png b/apps/files/tests/golden/base/search_matches/it-120.png new file mode 100644 index 00000000..e3800572 Binary files /dev/null and b/apps/files/tests/golden/base/search_matches/it-120.png differ diff --git a/apps/files/tests/golden/base/search_matches/it-144.png b/apps/files/tests/golden/base/search_matches/it-144.png new file mode 100644 index 00000000..e171500d Binary files /dev/null and b/apps/files/tests/golden/base/search_matches/it-144.png differ diff --git a/apps/files/tests/golden/base/search_matches/it-192.png b/apps/files/tests/golden/base/search_matches/it-192.png new file mode 100644 index 00000000..65bcec49 Binary files /dev/null and b/apps/files/tests/golden/base/search_matches/it-192.png differ diff --git a/apps/files/tests/golden/base/search_matches/it-96.png b/apps/files/tests/golden/base/search_matches/it-96.png new file mode 100644 index 00000000..ae083946 Binary files /dev/null and b/apps/files/tests/golden/base/search_matches/it-96.png differ diff --git a/apps/files/tests/golden/base/search_matches/pseudo-144.png b/apps/files/tests/golden/base/search_matches/pseudo-144.png new file mode 100644 index 00000000..42b4801e Binary files /dev/null and b/apps/files/tests/golden/base/search_matches/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/search_narrow_icon/a11y-en.txt b/apps/files/tests/golden/base/search_narrow_icon/a11y-en.txt new file mode 100644 index 00000000..d07d8876 --- /dev/null +++ b/apps/files/tests/golden/base/search_narrow_icon/a11y-en.txt @@ -0,0 +1,42 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +Button "Search in documents" [focusable] +SearchInput "Search this folder" [focusable] "" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "More" [focusable, expandable] + Button "Details" [focusable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "9 items" diff --git a/apps/files/tests/golden/base/search_narrow_icon/a11y-it.txt b/apps/files/tests/golden/base/search_narrow_icon/a11y-it.txt new file mode 100644 index 00000000..743f087e --- /dev/null +++ b/apps/files/tests/golden/base/search_narrow_icon/a11y-it.txt @@ -0,0 +1,41 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +Button "Cerca in documents" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 9 + Row "invoices" [focusable] 1 of 9 + Row "link-to-projects" [focusable] 2 of 9 + Row "projects" [focusable] 3 of 9 + Row "contract-draft-for-the-apartment-on-the-long-street-07.docx" [focusable] 4 of 9 + Row "notes.txt" [focusable] 5 of 9 + Row "photos-raw.zip" [focusable] 6 of 9 + Row "report-final-v2.pdf" [focusable] 7 of 9 + Row "report-final-v3.pdf" [focusable] 8 of 9 + Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "9 elementi" diff --git a/apps/files/tests/golden/base/search_narrow_icon/en-96.png b/apps/files/tests/golden/base/search_narrow_icon/en-96.png new file mode 100644 index 00000000..18267394 Binary files /dev/null and b/apps/files/tests/golden/base/search_narrow_icon/en-96.png differ diff --git a/apps/files/tests/golden/base/search_narrow_icon/hc-144.png b/apps/files/tests/golden/base/search_narrow_icon/hc-144.png new file mode 100644 index 00000000..ca24da3c Binary files /dev/null and b/apps/files/tests/golden/base/search_narrow_icon/hc-144.png differ diff --git a/apps/files/tests/golden/base/search_narrow_icon/it-144.png b/apps/files/tests/golden/base/search_narrow_icon/it-144.png new file mode 100644 index 00000000..ab2bec88 Binary files /dev/null and b/apps/files/tests/golden/base/search_narrow_icon/it-144.png differ diff --git a/apps/files/tests/golden/base/search_narrow_icon/pseudo-144.png b/apps/files/tests/golden/base/search_narrow_icon/pseudo-144.png new file mode 100644 index 00000000..eac520a8 Binary files /dev/null and b/apps/files/tests/golden/base/search_narrow_icon/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/search_narrow_open/a11y-en.txt b/apps/files/tests/golden/base/search_narrow_open/a11y-en.txt new file mode 100644 index 00000000..2c113c38 --- /dev/null +++ b/apps/files/tests/golden/base/search_narrow_open/a11y-en.txt @@ -0,0 +1,35 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "rep" + Button "Clear" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "More" [focusable, expandable] + Button "Details" [focusable] +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" 1 of 2 + Row "report-final-v2.pdf" [focusable] 1 of 2 + Row "report-final-v3.pdf" [focusable] 2 of 2 +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "2 of 9 items" diff --git a/apps/files/tests/golden/base/search_narrow_open/a11y-it.txt b/apps/files/tests/golden/base/search_narrow_open/a11y-it.txt new file mode 100644 index 00000000..c1b9e62b --- /dev/null +++ b/apps/files/tests/golden/base/search_narrow_open/a11y-it.txt @@ -0,0 +1,34 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "rep" + Button "Cancella" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" 1 of 2 + Row "report-final-v2.pdf" [focusable] 1 of 2 + Row "report-final-v3.pdf" [focusable] 2 of 2 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "2 di 9 elementi" diff --git a/apps/files/tests/golden/base/search_narrow_open/en-96.png b/apps/files/tests/golden/base/search_narrow_open/en-96.png new file mode 100644 index 00000000..fbb6a877 Binary files /dev/null and b/apps/files/tests/golden/base/search_narrow_open/en-96.png differ diff --git a/apps/files/tests/golden/base/search_narrow_open/hc-144.png b/apps/files/tests/golden/base/search_narrow_open/hc-144.png new file mode 100644 index 00000000..ed281020 Binary files /dev/null and b/apps/files/tests/golden/base/search_narrow_open/hc-144.png differ diff --git a/apps/files/tests/golden/base/search_narrow_open/it-144.png b/apps/files/tests/golden/base/search_narrow_open/it-144.png new file mode 100644 index 00000000..7989fc4e Binary files /dev/null and b/apps/files/tests/golden/base/search_narrow_open/it-144.png differ diff --git a/apps/files/tests/golden/base/search_narrow_open/pseudo-144.png b/apps/files/tests/golden/base/search_narrow_open/pseudo-144.png new file mode 100644 index 00000000..425d67e5 Binary files /dev/null and b/apps/files/tests/golden/base/search_narrow_open/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/search_no_match/a11y-en.txt b/apps/files/tests/golden/base/search_no_match/a11y-en.txt new file mode 100644 index 00000000..ce4bd52a --- /dev/null +++ b/apps/files/tests/golden/base/search_no_match/a11y-en.txt @@ -0,0 +1,48 @@ +TabList + Tab "documents" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Button "Back · Alt+←" [disabled] +Button "Forward · Alt+→" [disabled] +Button "Up to made-up · Alt+↑" [focusable] +SearchInput "Search this folder" [focusable] "preventivo" + Button "Clear" +Toolbar "Path" + Link "C:" [focusable] + Button "Subfolders" + Link "made-up" [focusable] + Button "Subfolders" + Link "documents" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "This PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Network" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% +ColumnHeader "Name" [focusable] +ColumnHeader "Date modified" [focusable] +ColumnHeader "Type" [focusable] +ColumnHeader "Size" [focusable] +Table "Name" [focusable] 0 of 0 +Label "No item matches “preventivo” in this folder" +Button "Clear search" [focusable] +Label "384 GB free of 1.81 TB" +Label "System (C:)" +Label "0 of 9 items" diff --git a/apps/files/tests/golden/base/search_no_match/a11y-it.txt b/apps/files/tests/golden/base/search_no_match/a11y-it.txt new file mode 100644 index 00000000..831b4ca0 --- /dev/null +++ b/apps/files/tests/golden/base/search_no_match/a11y-it.txt @@ -0,0 +1,47 @@ +TabList + Tab "documents" [focusable, selected] + Button "Chiudi scheda" + Button "Nuova scheda" [focusable] +Button "Indietro · Alt+←" [disabled] +Button "Avanti · Alt+→" [disabled] +Button "Su a made-up · Alt+↑" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "preventivo" + Button "Cancella" +Toolbar "Percorso" + Link "C:" [focusable] + Button "Sottocartelle" + Link "made-up" [focusable] + Button "Sottocartelle" + Link "documents" [focusable] + Button "Sottocartelle" + Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] +Tree + TreeItem "Home" [focusable] level 1 + Label "Questo PC" + TreeItem "System (C:)" [focusable, expandable] level 1 + TreeItem "Data (D:)" [focusable, expandable] level 1 + Label "Rete" + TreeItem "Share (Z:)" [focusable, expandable] level 1 + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% +ColumnHeader "Nome" [focusable] +ColumnHeader "Ultima modifica" [focusable] +ColumnHeader "Tipo" [focusable] +ColumnHeader "Dimensione" [focusable] +Table "Nome" [focusable] 0 of 0 +Label "Nessun elemento corrisponde a «preventivo» in questa cartella" +Button "Cancella la ricerca" [focusable] +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" +Label "0 di 9 elementi" diff --git a/apps/files/tests/golden/base/search_no_match/en-96.png b/apps/files/tests/golden/base/search_no_match/en-96.png new file mode 100644 index 00000000..e1cbdce9 Binary files /dev/null and b/apps/files/tests/golden/base/search_no_match/en-96.png differ diff --git a/apps/files/tests/golden/base/search_no_match/hc-144.png b/apps/files/tests/golden/base/search_no_match/hc-144.png new file mode 100644 index 00000000..dff0ad92 Binary files /dev/null and b/apps/files/tests/golden/base/search_no_match/hc-144.png differ diff --git a/apps/files/tests/golden/base/search_no_match/it-144.png b/apps/files/tests/golden/base/search_no_match/it-144.png new file mode 100644 index 00000000..f25d43c3 Binary files /dev/null and b/apps/files/tests/golden/base/search_no_match/it-144.png differ diff --git a/apps/files/tests/golden/base/search_no_match/pseudo-144.png b/apps/files/tests/golden/base/search_no_match/pseudo-144.png new file mode 100644 index 00000000..7e472f5d Binary files /dev/null and b/apps/files/tests/golden/base/search_no_match/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/sidebar/a11y-en.txt b/apps/files/tests/golden/base/sidebar/a11y-en.txt index 2547d889..3df6a0cc 100644 --- a/apps/files/tests/golden/base/sidebar/a11y-en.txt +++ b/apps/files/tests/golden/base/sidebar/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -17,21 +14,34 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree - Label "Pinned" + TreeItem "Home" [focusable] level 1 + Label "Quick access" TreeItem "documents" [focusable, selected, expandable] level 1 + Button "Remove from Quick access" TreeItem "projects" [focusable, expandable] level 1 + Button "Remove from Quick access" TreeItem "media" [focusable, expandable] level 1 + Button "Remove from Quick access" TreeItem "a-folder-with-a-rather-long-name" [focusable, expandable] level 1 + Button "Remove from Quick access" Label "This PC" TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 22.222221% +Splitter "Resize panes" [focusable] 24.88889% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -46,4 +56,6 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/sidebar/a11y-it.txt b/apps/files/tests/golden/base/sidebar/a11y-it.txt index 0a5d47d9..be04167b 100644 --- a/apps/files/tests/golden/base/sidebar/a11y-it.txt +++ b/apps/files/tests/golden/base/sidebar/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -17,21 +14,33 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree - Label "Aggiunti" + TreeItem "Home" [focusable] level 1 + Label "Accesso rapido" TreeItem "documents" [focusable, selected, expandable] level 1 + Button "Togli da Accesso rapido" TreeItem "projects" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" TreeItem "media" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" TreeItem "a-folder-with-a-rather-long-name" [focusable, expandable] level 1 + Button "Togli da Accesso rapido" Label "Questo PC" TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "\\\\made-up-server\\projects" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 22.222221% +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -46,4 +55,6 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/sidebar/contrast-144.png b/apps/files/tests/golden/base/sidebar/contrast-144.png index 120cb2b7..f54a8d22 100644 Binary files a/apps/files/tests/golden/base/sidebar/contrast-144.png and b/apps/files/tests/golden/base/sidebar/contrast-144.png differ diff --git a/apps/files/tests/golden/base/sidebar/en-120.png b/apps/files/tests/golden/base/sidebar/en-120.png index a8619ed6..a073092d 100644 Binary files a/apps/files/tests/golden/base/sidebar/en-120.png and b/apps/files/tests/golden/base/sidebar/en-120.png differ diff --git a/apps/files/tests/golden/base/sidebar/en-144.png b/apps/files/tests/golden/base/sidebar/en-144.png index 120cb2b7..f54a8d22 100644 Binary files a/apps/files/tests/golden/base/sidebar/en-144.png and b/apps/files/tests/golden/base/sidebar/en-144.png differ diff --git a/apps/files/tests/golden/base/sidebar/en-192.png b/apps/files/tests/golden/base/sidebar/en-192.png index fa8e6377..4b54eb3a 100644 Binary files a/apps/files/tests/golden/base/sidebar/en-192.png and b/apps/files/tests/golden/base/sidebar/en-192.png differ diff --git a/apps/files/tests/golden/base/sidebar/en-96.png b/apps/files/tests/golden/base/sidebar/en-96.png index 1c5eadcb..9ec5c9cb 100644 Binary files a/apps/files/tests/golden/base/sidebar/en-96.png and b/apps/files/tests/golden/base/sidebar/en-96.png differ diff --git a/apps/files/tests/golden/base/sidebar/hc-144.png b/apps/files/tests/golden/base/sidebar/hc-144.png index e656d6d5..9ccb38b6 100644 Binary files a/apps/files/tests/golden/base/sidebar/hc-144.png and b/apps/files/tests/golden/base/sidebar/hc-144.png differ diff --git a/apps/files/tests/golden/base/sidebar/hc-96.png b/apps/files/tests/golden/base/sidebar/hc-96.png index 62f5913a..04e0aa7a 100644 Binary files a/apps/files/tests/golden/base/sidebar/hc-96.png and b/apps/files/tests/golden/base/sidebar/hc-96.png differ diff --git a/apps/files/tests/golden/base/sidebar/it-120.png b/apps/files/tests/golden/base/sidebar/it-120.png index 84be6d54..f0236b87 100644 Binary files a/apps/files/tests/golden/base/sidebar/it-120.png and b/apps/files/tests/golden/base/sidebar/it-120.png differ diff --git a/apps/files/tests/golden/base/sidebar/it-144.png b/apps/files/tests/golden/base/sidebar/it-144.png index 56c1ceb0..2e643b70 100644 Binary files a/apps/files/tests/golden/base/sidebar/it-144.png and b/apps/files/tests/golden/base/sidebar/it-144.png differ diff --git a/apps/files/tests/golden/base/sidebar/it-192.png b/apps/files/tests/golden/base/sidebar/it-192.png index 9484f920..13b68e64 100644 Binary files a/apps/files/tests/golden/base/sidebar/it-192.png and b/apps/files/tests/golden/base/sidebar/it-192.png differ diff --git a/apps/files/tests/golden/base/sidebar/it-96.png b/apps/files/tests/golden/base/sidebar/it-96.png index e550afa4..aa62b0b7 100644 Binary files a/apps/files/tests/golden/base/sidebar/it-96.png and b/apps/files/tests/golden/base/sidebar/it-96.png differ diff --git a/apps/files/tests/golden/base/sidebar/pseudo-144.png b/apps/files/tests/golden/base/sidebar/pseudo-144.png index 120cb2b7..10aef1ec 100644 Binary files a/apps/files/tests/golden/base/sidebar/pseudo-144.png and b/apps/files/tests/golden/base/sidebar/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/sidebar_tree/a11y-en.txt b/apps/files/tests/golden/base/sidebar_tree/a11y-en.txt index 88130a74..c731ad8b 100644 --- a/apps/files/tests/golden/base/sidebar_tree/a11y-en.txt +++ b/apps/files/tests/golden/base/sidebar_tree/a11y-en.txt @@ -5,10 +5,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to projects · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -19,13 +16,18 @@ Toolbar "Path" Link "alpha" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree - Label "Pinned" - TreeItem "documents" [focusable, expandable] level 1 - TreeItem "projects" [focusable, expandable] level 1 - TreeItem "media" [focusable, expandable] level 1 - TreeItem "a-folder-with-a-rather-long-name" [focusable, expandable] level 1 - Label "This PC" TreeItem "System (C:)" [focusable, expandable, expanded] level 1 TreeItem "apps" [focusable, expandable] level 2 TreeItem "made-up" [focusable, expandable, expanded] level 2 @@ -36,7 +38,8 @@ Tree TreeItem "beta" [focusable, expandable] level 4 TreeItem "tools" [focusable, expandable] level 2 TreeItem "Data (D:)" [focusable, expandable] level 1 -Splitter "Resize panes" [focusable] 22.222221% + Label "Network" +Splitter "Resize panes" [focusable] 24.88889% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -51,4 +54,6 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/sidebar_tree/a11y-it.txt b/apps/files/tests/golden/base/sidebar_tree/a11y-it.txt index fc73f7d8..05d952cd 100644 --- a/apps/files/tests/golden/base/sidebar_tree/a11y-it.txt +++ b/apps/files/tests/golden/base/sidebar_tree/a11y-it.txt @@ -5,10 +5,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a projects · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -19,13 +16,17 @@ Toolbar "Percorso" Link "alpha" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree - Label "Aggiunti" - TreeItem "documents" [focusable, expandable] level 1 - TreeItem "projects" [focusable, expandable] level 1 - TreeItem "media" [focusable, expandable] level 1 - TreeItem "a-folder-with-a-rather-long-name" [focusable, expandable] level 1 - Label "Questo PC" TreeItem "System (C:)" [focusable, expandable, expanded] level 1 TreeItem "apps" [focusable, expandable] level 2 TreeItem "made-up" [focusable, expandable, expanded] level 2 @@ -36,7 +37,8 @@ Tree TreeItem "beta" [focusable, expandable] level 4 TreeItem "tools" [focusable, expandable] level 2 TreeItem "Data (D:)" [focusable, expandable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 22.222221% + Label "Rete" +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -51,4 +53,6 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/sidebar_tree/en-96.png b/apps/files/tests/golden/base/sidebar_tree/en-96.png index 6fa096a0..c66e69fb 100644 Binary files a/apps/files/tests/golden/base/sidebar_tree/en-96.png and b/apps/files/tests/golden/base/sidebar_tree/en-96.png differ diff --git a/apps/files/tests/golden/base/sidebar_tree/hc-144.png b/apps/files/tests/golden/base/sidebar_tree/hc-144.png index d32fdfb9..9dae0bdb 100644 Binary files a/apps/files/tests/golden/base/sidebar_tree/hc-144.png and b/apps/files/tests/golden/base/sidebar_tree/hc-144.png differ diff --git a/apps/files/tests/golden/base/sidebar_tree/it-144.png b/apps/files/tests/golden/base/sidebar_tree/it-144.png index 854b7afd..0cbd47f3 100644 Binary files a/apps/files/tests/golden/base/sidebar_tree/it-144.png and b/apps/files/tests/golden/base/sidebar_tree/it-144.png differ diff --git a/apps/files/tests/golden/base/sidebar_tree/pseudo-144.png b/apps/files/tests/golden/base/sidebar_tree/pseudo-144.png index bb6fb7a7..df7eab13 100644 Binary files a/apps/files/tests/golden/base/sidebar_tree/pseudo-144.png and b/apps/files/tests/golden/base/sidebar_tree/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/state_connecting/a11y-en.txt b/apps/files/tests/golden/base/state_connecting/a11y-en.txt index 7988f384..4efc786c 100644 --- a/apps/files/tests/golden/base/state_connecting/a11y-en.txt +++ b/apps/files/tests/golden/base/state_connecting/a11y-en.txt @@ -5,14 +5,20 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up · Alt+↑" [disabled] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +Button "Search in share" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "\\\\made-up-server\\share" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "More" [focusable, expandable] + Button "Details" [focusable] ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] diff --git a/apps/files/tests/golden/base/state_connecting/a11y-it.txt b/apps/files/tests/golden/base/state_connecting/a11y-it.txt index 359248ba..d08d3001 100644 --- a/apps/files/tests/golden/base/state_connecting/a11y-it.txt +++ b/apps/files/tests/golden/base/state_connecting/a11y-it.txt @@ -5,14 +5,19 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su · Alt+↑" [disabled] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +Button "Cerca in share" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "\\\\made-up-server\\share" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] diff --git a/apps/files/tests/golden/base/state_connecting/en-96.png b/apps/files/tests/golden/base/state_connecting/en-96.png index b1dbc219..88a8a8c4 100644 Binary files a/apps/files/tests/golden/base/state_connecting/en-96.png and b/apps/files/tests/golden/base/state_connecting/en-96.png differ diff --git a/apps/files/tests/golden/base/state_connecting/hc-144.png b/apps/files/tests/golden/base/state_connecting/hc-144.png index 3b3e843b..edf604d6 100644 Binary files a/apps/files/tests/golden/base/state_connecting/hc-144.png and b/apps/files/tests/golden/base/state_connecting/hc-144.png differ diff --git a/apps/files/tests/golden/base/state_connecting/it-144.png b/apps/files/tests/golden/base/state_connecting/it-144.png index ebb428d0..8011c2b4 100644 Binary files a/apps/files/tests/golden/base/state_connecting/it-144.png and b/apps/files/tests/golden/base/state_connecting/it-144.png differ diff --git a/apps/files/tests/golden/base/state_connecting/pseudo-144.png b/apps/files/tests/golden/base/state_connecting/pseudo-144.png index d6aad2ad..e23fb18e 100644 Binary files a/apps/files/tests/golden/base/state_connecting/pseudo-144.png and b/apps/files/tests/golden/base/state_connecting/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/state_denied/a11y-en.txt b/apps/files/tests/golden/base/state_denied/a11y-en.txt index 298e2cf8..411654de 100644 --- a/apps/files/tests/golden/base/state_denied/a11y-en.txt +++ b/apps/files/tests/golden/base/state_denied/a11y-en.txt @@ -5,10 +5,8 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to documents · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +Button "Search in locked" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -19,12 +17,22 @@ Toolbar "Path" Link "locked" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "More" [focusable, expandable] + Button "Details" [focusable] ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] ColumnHeader "Size" [focusable] Table "Name" [focusable] 0 of 0 -Button "Back" [focusable] +Label "You don't have access to this folder" Button "Open in File Explorer" [focusable] -Label "You don't have permission to open this folder." +Button "Back" [focusable] +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "0 items" diff --git a/apps/files/tests/golden/base/state_denied/a11y-it.txt b/apps/files/tests/golden/base/state_denied/a11y-it.txt index 8ebee1aa..3d73b2a4 100644 --- a/apps/files/tests/golden/base/state_denied/a11y-it.txt +++ b/apps/files/tests/golden/base/state_denied/a11y-it.txt @@ -5,10 +5,8 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a documents · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +Button "Cerca in locked" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -19,12 +17,21 @@ Toolbar "Percorso" Link "locked" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] ColumnHeader "Dimensione" [focusable] Table "Nome" [focusable] 0 of 0 -Button "Indietro" [focusable] +Label "Non hai accesso a questa cartella" Button "Apri in Esplora file" [focusable] -Label "Non hai l'autorizzazione per aprire questa cartella." +Button "Indietro" [focusable] +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "0 elementi" diff --git a/apps/files/tests/golden/base/state_denied/en-96.png b/apps/files/tests/golden/base/state_denied/en-96.png index 4591cd51..842c94a4 100644 Binary files a/apps/files/tests/golden/base/state_denied/en-96.png and b/apps/files/tests/golden/base/state_denied/en-96.png differ diff --git a/apps/files/tests/golden/base/state_denied/hc-144.png b/apps/files/tests/golden/base/state_denied/hc-144.png index 19b20a43..ead0a96f 100644 Binary files a/apps/files/tests/golden/base/state_denied/hc-144.png and b/apps/files/tests/golden/base/state_denied/hc-144.png differ diff --git a/apps/files/tests/golden/base/state_denied/it-144.png b/apps/files/tests/golden/base/state_denied/it-144.png index 832d05ae..da7299f1 100644 Binary files a/apps/files/tests/golden/base/state_denied/it-144.png and b/apps/files/tests/golden/base/state_denied/it-144.png differ diff --git a/apps/files/tests/golden/base/state_denied/pseudo-144.png b/apps/files/tests/golden/base/state_denied/pseudo-144.png index 904b42f1..0a1fedfd 100644 Binary files a/apps/files/tests/golden/base/state_denied/pseudo-144.png and b/apps/files/tests/golden/base/state_denied/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/state_empty/a11y-en.txt b/apps/files/tests/golden/base/state_empty/a11y-en.txt index 9d437655..baa89421 100644 --- a/apps/files/tests/golden/base/state_empty/a11y-en.txt +++ b/apps/files/tests/golden/base/state_empty/a11y-en.txt @@ -5,10 +5,8 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to documents · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +Button "Search in none" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -19,6 +17,14 @@ Toolbar "Path" Link "none" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "More" [focusable, expandable] + Button "Details" [focusable] ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -26,4 +32,6 @@ ColumnHeader "Size" [focusable] Table "Name" [focusable] 0 of 0 Label "This folder is empty" Label "Ctrl+Shift+N new folder" +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "0 items" diff --git a/apps/files/tests/golden/base/state_empty/a11y-it.txt b/apps/files/tests/golden/base/state_empty/a11y-it.txt index d1e1728b..13d49785 100644 --- a/apps/files/tests/golden/base/state_empty/a11y-it.txt +++ b/apps/files/tests/golden/base/state_empty/a11y-it.txt @@ -5,10 +5,8 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a documents · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +Button "Cerca in none" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -19,6 +17,13 @@ Toolbar "Percorso" Link "none" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -26,4 +31,6 @@ ColumnHeader "Dimensione" [focusable] Table "Nome" [focusable] 0 of 0 Label "Questa cartella è vuota" Label "Ctrl+Maiusc+N nuova cartella" +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "0 elementi" diff --git a/apps/files/tests/golden/base/state_empty/en-96.png b/apps/files/tests/golden/base/state_empty/en-96.png index b8993dc9..f5b894be 100644 Binary files a/apps/files/tests/golden/base/state_empty/en-96.png and b/apps/files/tests/golden/base/state_empty/en-96.png differ diff --git a/apps/files/tests/golden/base/state_empty/hc-144.png b/apps/files/tests/golden/base/state_empty/hc-144.png index 31a62083..4cc1b377 100644 Binary files a/apps/files/tests/golden/base/state_empty/hc-144.png and b/apps/files/tests/golden/base/state_empty/hc-144.png differ diff --git a/apps/files/tests/golden/base/state_empty/it-144.png b/apps/files/tests/golden/base/state_empty/it-144.png index 6f26ffce..7adea179 100644 Binary files a/apps/files/tests/golden/base/state_empty/it-144.png and b/apps/files/tests/golden/base/state_empty/it-144.png differ diff --git a/apps/files/tests/golden/base/state_empty/pseudo-144.png b/apps/files/tests/golden/base/state_empty/pseudo-144.png index cf59304e..8410aa65 100644 Binary files a/apps/files/tests/golden/base/state_empty/pseudo-144.png and b/apps/files/tests/golden/base/state_empty/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/state_offline/a11y-en.txt b/apps/files/tests/golden/base/state_offline/a11y-en.txt index da60e4d2..6d9bcf7b 100644 --- a/apps/files/tests/golden/base/state_offline/a11y-en.txt +++ b/apps/files/tests/golden/base/state_offline/a11y-en.txt @@ -5,10 +5,8 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to documents · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +Button "Search in locked" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -19,12 +17,21 @@ Toolbar "Path" Link "locked" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "More" [focusable, expandable] + Button "Details" [focusable] ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] ColumnHeader "Size" [focusable] Table "Name" [focusable] 0 of 0 -Button "Open in File Explorer" [focusable] -Button "Retry (F5)" [focusable] -Label "C:\\made-up\\documents\\locked isn't reachable" +Label "The drive isn't reachable" +Button "Retry" [focusable] +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "0 items" diff --git a/apps/files/tests/golden/base/state_offline/a11y-it.txt b/apps/files/tests/golden/base/state_offline/a11y-it.txt index 7f79ef0c..2f74fbcb 100644 --- a/apps/files/tests/golden/base/state_offline/a11y-it.txt +++ b/apps/files/tests/golden/base/state_offline/a11y-it.txt @@ -5,10 +5,8 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a documents · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +Button "Cerca in locked" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -19,12 +17,20 @@ Toolbar "Percorso" Link "locked" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] ColumnHeader "Dimensione" [focusable] Table "Nome" [focusable] 0 of 0 -Button "Apri in Esplora file" [focusable] -Button "Riprova (F5)" [focusable] -Label "C:\\made-up\\documents\\locked non è raggiungibile" +Label "L'unità non è raggiungibile" +Button "Riprova" [focusable] +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "0 elementi" diff --git a/apps/files/tests/golden/base/state_offline/en-96.png b/apps/files/tests/golden/base/state_offline/en-96.png index 3a57b4f8..a3bd3355 100644 Binary files a/apps/files/tests/golden/base/state_offline/en-96.png and b/apps/files/tests/golden/base/state_offline/en-96.png differ diff --git a/apps/files/tests/golden/base/state_offline/hc-144.png b/apps/files/tests/golden/base/state_offline/hc-144.png index 8bf25c96..fdc8a474 100644 Binary files a/apps/files/tests/golden/base/state_offline/hc-144.png and b/apps/files/tests/golden/base/state_offline/hc-144.png differ diff --git a/apps/files/tests/golden/base/state_offline/it-144.png b/apps/files/tests/golden/base/state_offline/it-144.png index c51fb68d..4542e220 100644 Binary files a/apps/files/tests/golden/base/state_offline/it-144.png and b/apps/files/tests/golden/base/state_offline/it-144.png differ diff --git a/apps/files/tests/golden/base/state_offline/pseudo-144.png b/apps/files/tests/golden/base/state_offline/pseudo-144.png index 6be3dfee..41979ff5 100644 Binary files a/apps/files/tests/golden/base/state_offline/pseudo-144.png and b/apps/files/tests/golden/base/state_offline/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/tab_menu/a11y-en.txt b/apps/files/tests/golden/base/tab_menu/a11y-en.txt index 01bb34ed..b0ea8a63 100644 --- a/apps/files/tests/golden/base/tab_menu/a11y-en.txt +++ b/apps/files/tests/golden/base/tab_menu/a11y-en.txt @@ -9,10 +9,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -21,15 +18,27 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 22.222221% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -44,4 +53,6 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/tab_menu/a11y-it.txt b/apps/files/tests/golden/base/tab_menu/a11y-it.txt index 81bd5711..405e8692 100644 --- a/apps/files/tests/golden/base/tab_menu/a11y-it.txt +++ b/apps/files/tests/golden/base/tab_menu/a11y-it.txt @@ -9,10 +9,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -21,15 +18,26 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 22.222221% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -44,4 +52,6 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/tab_menu/en-96.png b/apps/files/tests/golden/base/tab_menu/en-96.png index fecf4430..e3a1bac1 100644 Binary files a/apps/files/tests/golden/base/tab_menu/en-96.png and b/apps/files/tests/golden/base/tab_menu/en-96.png differ diff --git a/apps/files/tests/golden/base/tab_menu/hc-144.png b/apps/files/tests/golden/base/tab_menu/hc-144.png index 7f7098fd..be3dc3e9 100644 Binary files a/apps/files/tests/golden/base/tab_menu/hc-144.png and b/apps/files/tests/golden/base/tab_menu/hc-144.png differ diff --git a/apps/files/tests/golden/base/tab_menu/it-144.png b/apps/files/tests/golden/base/tab_menu/it-144.png index e75614cb..8cb8473e 100644 Binary files a/apps/files/tests/golden/base/tab_menu/it-144.png and b/apps/files/tests/golden/base/tab_menu/it-144.png differ diff --git a/apps/files/tests/golden/base/tab_menu/pseudo-144.png b/apps/files/tests/golden/base/tab_menu/pseudo-144.png index 37d5db30..adbe5abc 100644 Binary files a/apps/files/tests/golden/base/tab_menu/pseudo-144.png and b/apps/files/tests/golden/base/tab_menu/pseudo-144.png differ diff --git a/apps/files/tests/golden/base/tabs_many/a11y-en.txt b/apps/files/tests/golden/base/tabs_many/a11y-en.txt index 516dd97b..e8f2c3f3 100644 --- a/apps/files/tests/golden/base/tabs_many/a11y-en.txt +++ b/apps/files/tests/golden/base/tabs_many/a11y-en.txt @@ -21,10 +21,7 @@ TabList Button "Back · Alt+←" [disabled] Button "Forward · Alt+→" [disabled] Button "Up to made-up · Alt+↑" [focusable] -Button "New" [focusable] -Button "Sort" [focusable] -Button "View" [focusable] -Button "More" [focusable] +SearchInput "Search this folder" [focusable] "" Toolbar "Path" Link "C:" [focusable] Button "Subfolders" @@ -33,15 +30,27 @@ Toolbar "Path" Link "documents" [focusable] Button "Subfolders" Button "Refresh" [focusable] +Toolbar "New" + Button "New" [focusable, expandable] + Button "Cut" [disabled] + Button "Copy" [disabled] + Button "Paste" [disabled] + Button "Rename" [disabled] + Button "Delete" [disabled] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "This PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Network" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Network ↗" [focusable] level 1 - TreeItem "Recycle Bin ↗" [focusable] level 1 -Splitter "Resize panes" [focusable] 22.222221% + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Splitter "Resize panes" [focusable] 24.88889% ColumnHeader "Name" [focusable] ColumnHeader "Date modified" [focusable] ColumnHeader "Type" [focusable] @@ -56,4 +65,6 @@ Table "Name" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB free of 1.81 TB" +Label "System (C:)" Label "9 items" diff --git a/apps/files/tests/golden/base/tabs_many/a11y-it.txt b/apps/files/tests/golden/base/tabs_many/a11y-it.txt index 66028d02..8c1e6354 100644 --- a/apps/files/tests/golden/base/tabs_many/a11y-it.txt +++ b/apps/files/tests/golden/base/tabs_many/a11y-it.txt @@ -21,10 +21,7 @@ TabList Button "Indietro · Alt+←" [disabled] Button "Avanti · Alt+→" [disabled] Button "Su a made-up · Alt+↑" [focusable] -Button "Nuovo" [focusable] -Button "Ordina" [focusable] -Button "Visualizza" [focusable] -Button "Altro" [focusable] +SearchInput "Cerca in questa cartella" [focusable] "" Toolbar "Percorso" Link "C:" [focusable] Button "Sottocartelle" @@ -33,15 +30,26 @@ Toolbar "Percorso" Link "documents" [focusable] Button "Sottocartelle" Button "Aggiorna" [focusable] +Toolbar "Nuovo" + Button "Nuovo" [focusable, expandable] + Button "Taglia" [disabled] + Button "Copia" [disabled] + Button "Incolla" [disabled] + Button "Rinomina" [disabled] + Button "Elimina" [disabled] + Button "Ordina" [focusable, expandable] + Button "Altro" [focusable, expandable] + Button "Dettagli" [focusable] Tree + TreeItem "Home" [focusable] level 1 Label "Questo PC" - TreeItem "System (C:)" [focusable, selected, expandable] level 1 + TreeItem "System (C:)" [focusable, expandable] level 1 TreeItem "Data (D:)" [focusable, expandable] level 1 Label "Rete" TreeItem "Share (Z:)" [focusable, expandable] level 1 - TreeItem "Rete ↗" [focusable] level 1 - TreeItem "Cestino ↗" [focusable] level 1 -Splitter "Ridimensiona i riquadri" [focusable] 22.222221% + TreeItem "Rete" [focusable] level 1 + TreeItem "Cestino" [focusable] level 1 +Splitter "Ridimensiona i riquadri" [focusable] 24.88889% ColumnHeader "Nome" [focusable] ColumnHeader "Ultima modifica" [focusable] ColumnHeader "Tipo" [focusable] @@ -56,4 +64,6 @@ Table "Nome" 1 of 9 Row "report-final-v2.pdf" [focusable] 7 of 9 Row "report-final-v3.pdf" [focusable] 8 of 9 Row "setup-tool-1.4.2.exe" [focusable] 9 of 9 +Label "384 GB liberi di 1,81 TB" +Label "System (C:)" Label "9 elementi" diff --git a/apps/files/tests/golden/base/tabs_many/en-96.png b/apps/files/tests/golden/base/tabs_many/en-96.png index af50fe00..6665794e 100644 Binary files a/apps/files/tests/golden/base/tabs_many/en-96.png and b/apps/files/tests/golden/base/tabs_many/en-96.png differ diff --git a/apps/files/tests/golden/base/tabs_many/hc-144.png b/apps/files/tests/golden/base/tabs_many/hc-144.png index 40a15064..5848fc00 100644 Binary files a/apps/files/tests/golden/base/tabs_many/hc-144.png and b/apps/files/tests/golden/base/tabs_many/hc-144.png differ diff --git a/apps/files/tests/golden/base/tabs_many/it-144.png b/apps/files/tests/golden/base/tabs_many/it-144.png index ea1dc955..9cd6c7a0 100644 Binary files a/apps/files/tests/golden/base/tabs_many/it-144.png and b/apps/files/tests/golden/base/tabs_many/it-144.png differ diff --git a/apps/files/tests/golden/base/tabs_many/pseudo-144.png b/apps/files/tests/golden/base/tabs_many/pseudo-144.png index ee9ee839..f3984360 100644 Binary files a/apps/files/tests/golden/base/tabs_many/pseudo-144.png and b/apps/files/tests/golden/base/tabs_many/pseudo-144.png differ diff --git a/apps/files/tests/icons_art.rs b/apps/files/tests/icons_art.rs new file mode 100644 index 00000000..b54685a6 --- /dev/null +++ b/apps/files/tests/icons_art.rs @@ -0,0 +1,148 @@ +//! The art of folders, drives, places and file families (spec 4.3, 4.5): which piece every kind of item draws, from +//! pure functions over made-up paths. No window, no file system. + +use files_engine::drives::{DriveInfo, DriveKind}; +use files_engine::icons::{ + art_at, art_index, drive_art, file_art, location_art, place_art, wants_class_icon, ArtBook, ArtKey, ART_COUNT, +}; +use files_engine::knownfolders::{KnownFolders, KnownName}; +use files_engine::listing::WidePath; +use oled_trust::frame::files::Location; +use oled_ui::art::{Art, Family}; +use oled_ui::theme::HcColors; + +fn wp(s: &str) -> WidePath { + WidePath::parse(s).expect("a made-up path parses") +} + +/// Every extension of the families, as the spec lists them. +const FAMILIES: [(Family, &[&str]); 9] = [ + (Family::Document, &["doc", "docx", "docm", "dotx", "odt", "rtf"]), + (Family::Pdf, &["pdf"]), + (Family::Sheet, &["xls", "xlsx", "xlsm", "xlsb", "ods", "csv", "tsv"]), + (Family::Presentation, &["ppt", "pptx", "pptm", "odp"]), + (Family::Image, &["png", "jpg", "jpeg", "gif", "bmp", "webp", "heic", "heif", "tif", "tiff", "svg", "dng"]), + (Family::Audio, &["mp3", "m4a", "wav", "flac", "aac", "ogg", "opus", "wma", "aiff", "mid"]), + (Family::Video, &["mp4", "mkv", "mov", "avi", "wmv", "webm", "m4v", "mpg", "mpeg", "3gp"]), + (Family::Archive, &["zip", "7z", "rar", "tar", "gz", "tgz", "bz2", "xz", "cab", "iso"]), + (Family::Text, &["txt", "md", "log", "ini", "cfg", "json", "xml", "yaml", "yml", "toml"]), +]; + +#[test] +fn every_family_extension_draws_its_art_and_asks_for_no_class_icon() { + for (family, exts) in FAMILIES { + for ext in exts { + for e in [ext.to_string(), ext.to_uppercase()] { + assert_eq!(file_art(e.as_bytes()), Art::File(family), "{e}"); + assert!(!wants_class_icon(e.as_bytes()), "{e}: the art is its icon"); + } + } + } +} + +#[test] +fn programs_and_other_kinds() { + for ext in ["exe", "scr", "EXE"] { + assert_eq!(file_art(ext.as_bytes()), Art::Program, "{ext}"); + assert!(!wants_class_icon(ext.as_bytes()), "{ext}: its own icon, else the program art"); + } + for ext in ["lnk", "url", "msi", "bat", "cmd", "ps1", "vbs", "ico", "cur", "ani", "bin", "dll", ""] { + assert_eq!(file_art(ext.as_bytes()), Art::FileGeneric, "{ext}: the generic page until Windows' icon"); + assert!(wants_class_icon(ext.as_bytes()), "{ext}"); + } + assert_eq!(file_art(&[0xFF, 0xFE]), Art::FileGeneric, "an extension that is not Unicode"); +} + +#[test] +fn drives_by_kind_and_the_system_drive() { + assert_eq!(drive_art(DriveKind::Fixed, b'C', Some(b'C')), Art::DriveSystem); + assert_eq!(drive_art(DriveKind::Fixed, b'c', Some(b'C')), Art::DriveSystem, "any case"); + assert_eq!(drive_art(DriveKind::Fixed, b'D', Some(b'C')), Art::DriveFixed); + assert_eq!(drive_art(DriveKind::Removable, b'E', Some(b'C')), Art::DriveRemovable); + assert_eq!(drive_art(DriveKind::Network, b'Z', Some(b'C')), Art::DriveNetwork); + for k in [DriveKind::Optical, DriveKind::Ram, DriveKind::Unknown] { + assert_eq!(drive_art(k, b'F', Some(b'C')), Art::DriveFixed, "{k:?}: any other local kind"); + } + assert_eq!(drive_art(DriveKind::Fixed, b'C', None), Art::DriveFixed, "the system drive unknown"); +} + +fn known() -> KnownFolders { + KnownFolders::new( + vec![ + (KnownName::Downloads, wp(r"C:\Users\made-up\Downloads")), + (KnownName::Pictures, wp(r"D:\made-up\Pictures")), + (KnownName::Profile, wp(r"C:\Users\made-up")), + ], + Some(b'C'), + ) +} + +fn drives() -> Vec { + let d = |letter, kind| DriveInfo { letter, label: None, kind, free: None, total: None, ready: true }; + vec![d(b'C', DriveKind::Fixed), d(b'E', DriveKind::Removable), d(b'Z', DriveKind::Network)] +} + +#[test] +fn places_by_path_never_by_name() { + let (k, d) = (known(), drives()); + let art = |p: &str| place_art(&wp(p), &k, &d); + assert_eq!(art(r"C:\Users\made-up\Downloads"), Art::Downloads); + assert_eq!(art(r"c:\users\MADE-UP\downloads"), Art::Downloads, "the same path in another case"); + assert_eq!(art(r"D:\made-up\Pictures"), Art::Pictures, "a known folder moved to another drive"); + assert_eq!(art(r"D:\made-up\Downloads"), Art::Folder, "a folder named Downloads elsewhere is a plain folder"); + assert_eq!(art(r"C:\Users\made-up\Pictures"), Art::Folder, "the default place of a moved known folder"); + assert_eq!(art(r"C:\Users\made-up"), Art::Folder, "the profile draws the folder"); + assert_eq!(art(r"C:\"), Art::DriveSystem); + assert_eq!(art(r"E:\"), Art::DriveRemovable); + assert_eq!(art(r"Z:\"), Art::DriveNetwork); + assert_eq!(art(r"Q:\"), Art::DriveFixed, "a drive the scan has not reported"); + assert_eq!(art(r"\\made-up-server\share"), Art::DriveNetwork, "a share's root"); + assert_eq!(art(r"\\made-up-server\share\Downloads"), Art::Folder); +} + +#[test] +fn locations() { + let (k, d) = (known(), drives()); + assert_eq!(location_art(&Location::Home, &k, &d), Art::Home); + assert_eq!(location_art(&Location::Options, &k, &d), Art::Program); + let search = Location::Search { root: wp(r"C:\Users\made-up\Downloads"), query: "x".into() }; + assert_eq!(location_art(&search, &k, &d), Art::Downloads, "a search draws its root's art"); + assert_eq!(location_art(&Location::Fs(wp(r"E:\")), &k, &d), Art::DriveRemovable); +} + +#[test] +fn art_indices_are_dense() { + for i in 0..ART_COUNT { + let a = art_at(i).expect("every index names an art"); + assert_eq!(art_index(a), i); + } + assert_eq!(art_at(ART_COUNT), None); + assert_eq!(Art::all().len(), ART_COUNT, "every art has an index"); +} + +#[test] +fn the_book_composes_once_per_size_and_follows_high_contrast() { + let book = ArtBook::new(ArtKey { small: 24, large: 48, hc: None }); + assert!(book.is_empty()); + let a = book.shared(Art::Folder, 24); + let b = book.shared(Art::Folder, 24); + assert!(std::rc::Rc::ptr_eq(&a, &b), "composed once, shared after"); + assert_eq!((a.width, a.height), (24, 24)); + assert_eq!(book.image(Art::Folder, 48).map(|b| b.width), Some(48)); + assert!(book.image(Art::Folder, 30).is_none(), "a size the book does not keep"); + assert_eq!(book.shared(Art::Folder, 30).width, 30, "composed for the caller alone"); + assert_eq!(book.len(), 2); + let hc = HcColors { + window: (0, 0, 0), + window_text: (255, 255, 255), + highlight: (26, 235, 255), + highlight_text: (0, 0, 0), + gray_text: (63, 242, 63), + }; + let dark = ArtBook::new(ArtKey { small: 16, large: 32, hc: Some(hc) }); + let px = &dark.small(Art::Downloads).pixels; + // Only the two system colours, and their blends where an edge falls inside a pixel: no hue. + let grey = |p: u32| (p >> 16) & 255 == p & 255 && (p >> 8) & 255 == p & 255; + assert!(px.iter().filter(|p| **p >> 24 == 255).all(|p| grey(*p)), "a hue under high contrast"); + assert!(px.contains(&0xFFFF_FFFF), "the body in the window text colour"); +} diff --git a/apps/files/tests/icons_gate.rs b/apps/files/tests/icons_gate.rs index 0a7ddfb7..51eb7a9a 100644 --- a/apps/files/tests/icons_gate.rs +++ b/apps/files/tests/icons_gate.rs @@ -8,7 +8,9 @@ use files_engine::drives::DriveKind; use files_engine::icons::wants_item_icon; use files_engine::listing::WidePath; use files_engine::shell::images::{ - allowed_with, attrs_allow_icon, folder_is_junction, junction_from, may_load_icon_from, run_with, OWN_ICON_EXTS, + allowed_kind_with, allowed_with, attrs_allow_icon, folder_is_junction, icon_allowed_with, junction_from, + link_icon_source, link_icon_with, may_load_icon_from, run_with, LinkFacts, LINK_EXT, LINK_ICON_SOURCES, + OWN_ICON_EXTS, }; use oled_trust::frame::files::{Gen, ItemRef, ReqId}; @@ -277,21 +279,24 @@ fn no_image_under_a_short_alias_of_a_class_id_folder() { #[test] fn ui_asks_only_for_plain_local_own_icons() { let local = units(r"C:\made-up\x.exe"); - for ext in ["exe", "ico", "scr", "cur", "ani"] { + // A shortcut is asked too: the host reads it without resolving it (link_icon_rules). + for ext in ["exe", "ico", "scr", "cur", "ani", "lnk"] { assert!(wants_item_icon(ext.as_bytes(), 0x20, &local), "{ext}"); } - for ext in ["msc", "lnk", "url", "appref-ms", "txt", "pif", "scf", "searchconnector-ms", "theme", "cpl", ""] { + for ext in ["msc", "url", "appref-ms", "txt", "pif", "scf", "searchconnector-ms", "theme", "cpl", ""] { assert!(!wants_item_icon(ext.as_bytes(), 0x20, &local), "{ext}"); } // The UI asks for a kind exactly when the host would load it. - for ext in ["exe", "ico", "scr", "cur", "ani", "lnk", "pif", "scf", "png", "dll"] { + for ext in ["exe", "ico", "scr", "cur", "ani", "lnk", "pif", "scf", "png", "dll", "url"] { let p = wide(&format!(r"C:\made-up\a.{ext}")); assert_eq!( wants_item_icon(ext.as_bytes(), 0x20, p.units()), - allowed_with(&p, false, kind, a_file, no_junction, as_given), + icon_allowed_with(&p, kind, a_file, no_junction, as_given), "{ext}" ); } + assert!(!wants_item_icon(b"lnk", 0x420, &local), "a shortcut that is a link"); + assert!(!wants_item_icon(b"lnk", 0x20, &units(r"\\server-made-up\share\x.lnk")), "a shared shortcut"); assert!(!wants_item_icon(b"exe", 0x420, &local), "a link"); assert!(!wants_item_icon(b"exe", 0x40_0420, &local), "a dehydrated file"); assert!(!wants_item_icon(b"exe", 0x1020, &local), "offline"); @@ -577,3 +582,137 @@ fn a_linked_folder_on_disk_counts_as_a_junction() { assert!(!folder_is_junction(&at("target")), "a plain folder"); assert!(!folder_is_junction(&at(r"target\inner")), "a plain folder under it"); } + +/// A shortcut's facts: its icon location and index, and its raw target. +fn link(icon: &str, index: i32, target: &str) -> LinkFacts { + LinkFacts { icon: units(icon), index, target: units(target) } +} + +/// No variable is set: the text as written. +fn as_written(s: &[u16]) -> Vec { + s.to_vec() +} + +/// The host's check of a shortcut's icon source, with the made-up drives and plain files. +fn source_ok(p: &WidePath) -> bool { + allowed_kind_with(p, &LINK_ICON_SOURCES, kind, a_file, no_junction, as_given) +} + +/// Runs link_icon_with over made-up facts: the location and index extracted from, if any. +fn extracted(facts: Option, expand: impl Fn(&[u16]) -> Vec) -> Option<(String, i32)> { + let asked = RefCell::new(None); + let lnk = wide(r"C:\made-up\a.lnk"); + let got = link_icon_with( + &lnk, + |_| facts, + expand, + source_ok, + |p, i| { + *asked.borrow_mut() = Some((p.to_string_lossy(), i)); + None + }, + ); + assert!(got.is_none(), "the fake extracts nothing"); + asked.into_inner() +} + +/// A shortcut's icon comes only from a local file of a resource kind that passes the item checks: never from a share, +/// a URL, a removable or network drive, a link kind, or nothing at all. +#[test] +fn link_icon_rules() { + let local = Some((r"C:\made-up\app.exe".to_string(), 3)); + assert_eq!(extracted(Some(link(r"C:\made-up\app.exe", 3, "")), as_written), local, "a local icon location"); + assert_eq!( + extracted(Some(link("", 7, r"C:\made-up\app.exe")), as_written), + Some((r"C:\made-up\app.exe".to_string(), 0)), + "no icon location: the target's own icon" + ); + for icon in [ + r"\\server-made-up\share\app.exe", + r"\\?\UNC\server-made-up\share\app.exe", + "http://host-made-up/app.ico", + "file:///C:/made-up/app.exe", + r"E:\made-up\app.exe", + r"Z:\made-up\app.exe", + r"C:\made-up\other.lnk", + r"C:\made-up\page.url", + r"C:\made-up\%UNSET%\app.exe", + r"\\.\C:\made-up\app.exe", + "app.exe", + ] { + assert_eq!(extracted(Some(link(icon, 0, "")), as_written), None, "{icon}"); + } + assert_eq!(extracted(Some(link("", 0, r"C:\made-up\report.docx")), as_written), None, "a document target"); + assert_eq!(extracted(Some(link("", 0, r"\\server-made-up\share\app.exe")), as_written), None, "a shared target"); + assert_eq!(extracted(Some(link("", 0, "")), as_written), None, "a link that names nothing"); + assert_eq!(extracted(None, as_written), None, "a link that cannot be read"); + // Variables are expanded before the checks: to a local folder it loads, to a share it does not. + let to = |s: &'static str| move |_: &[u16]| units(s); + assert_eq!( + extracted(Some(link(r"%SystemRoot%\made-up.dll", 2, "")), to(r"C:\made-up\made-up.dll")), + Some((r"C:\made-up\made-up.dll".to_string(), 2)) + ); + assert_eq!(extracted(Some(link(r"%HOMESHARE%\a.ico", 0, "")), to(r"\\server-made-up\home\a.ico")), None); + // A folder above the location that is a junction, or a location that is itself a link, is refused. + let lnk = wide(r"C:\made-up\a.lnk"); + let facts = || Some(link(r"C:\made-up\photos\app.exe", 0, "")); + let junction = |p: &WidePath| allowed_kind_with(p, &LINK_ICON_SOURCES, kind, a_file, |_| true, as_given); + let linked = |p: &WidePath| allowed_kind_with(p, &LINK_ICON_SOURCES, kind, |_| Some(0x420), no_junction, as_given); + for check in [junction, linked] { + let asked = Cell::new(false); + let _ = link_icon_with( + &lnk, + |_| facts(), + as_written, + check, + |_, _| { + asked.set(true); + None + }, + ); + assert!(!asked.get()); + } +} + +#[test] +fn link_icon_source_prefers_the_icon_location() { + let src = link_icon_source(&link(r"C:\made-up\icons.dll", -12, r"C:\made-up\app.exe"), as_written); + assert_eq!(src.map(|(p, i)| (p.to_string_lossy(), i)), Some((r"C:\made-up\icons.dll".to_string(), -12))); +} + +/// A shortcut itself passes the item checks of any item before it is read: local, fixed, plain, under plain folders. +#[test] +fn link_files_pass_the_item_checks_first() { + assert_eq!(LINK_EXT, "lnk"); + assert_eq!(LINK_ICON_SOURCES, ["exe", "dll", "ico", "icl"], "a new source kind is a reviewed change"); + assert!(icon_allowed_with(&wide(r"C:\made-up\a.lnk"), kind, a_file, no_junction, as_given)); + assert!(icon_allowed_with(&wide(r"C:\made-up\A.LNK"), kind, a_file, no_junction, as_given)); + for p in [r"E:\made-up\a.lnk", r"Z:\made-up\a.lnk", r"\\server-made-up\share\a.lnk", r"C:\made-up\a.lnk."] { + assert!(!icon_allowed_with(&wide(p), kind, a_file, no_junction, as_given), "{p}"); + } + assert!(!icon_allowed_with(&wide(r"C:\made-up\a.lnk"), kind, |_| Some(0x420), no_junction, as_given), "a link"); + assert!(!icon_allowed_with(&wide(r"C:\made-up\a.lnk"), kind, a_file, |_| true, as_given), "under a junction"); + assert!(!icon_allowed_with(&wide(r"C:\made-up\a.lnk"), kind, a_folder, no_junction, as_given), "a folder"); + assert!(!allowed_with(&wide(r"C:\made-up\a.lnk"), false, kind, a_file, no_junction, as_given), "not an own icon"); +} + +/// A shortcut is read from its bytes alone: the host never creates the shell's link object (whose path query binds an +/// item-ID list to the namespace, which can load the namespace extension a file names) and never extracts an icon by +/// name after a check by name (the file could be swapped in between). +#[test] +fn link_icons_never_bind_the_shell_namespace() { + let code = [ + include_str!("../src/shell/images.rs"), + include_str!("../src/shell/images/lnk.rs"), + include_str!("../src/shell/images/iconres.rs"), + include_str!("../src/shell/images/pinned.rs"), + ] + .join("\n"); + let lines = code.lines().filter(|l| !l.trim_start().starts_with("//")); + let code: String = lines.collect::>().join("\n"); + let banned = + ["ShellLink", "IPersistFile", "GetPath(", "Resolve(", "GetIDList", "SHDefExtractIcon", "ExtractIconEx"]; + for b in banned { + assert!(!code.contains(b), "{b}"); + } +} diff --git a/apps/files/tests/lints.rs b/apps/files/tests/lints.rs index 5be27808..f8c3a1e2 100644 --- a/apps/files/tests/lints.rs +++ b/apps/files/tests/lints.rs @@ -65,10 +65,19 @@ const MUTATION_ALLOWED: [&str; 5] = [ "examples/files_faultext/lib.rs", ]; -/// The files that may also open a file handle with CreateFileW: the change watcher, icons.bin's reader, the pipe and -/// the hand-off's folder pin. -const CREATE_FILE_ALLOWED: [&str; 5] = - ["src/watch/iocp.rs", "src/decor/iconsbin.rs", "src/host/named.rs", "src/ops_client.rs", "src/instance.rs"]; +/// The files that may also open a file handle with CreateFileW: the change watcher, icons.bin's reader, the pipe, the +/// hand-off's folder pin, the shell host's pinned icon sources (read only; its tests hold a writer's handle) and the ops +/// host's look at an item before an operation (its real path and whether the user's rights allow the operation; the +/// handle is closed unused). +const CREATE_FILE_ALLOWED: [&str; 7] = [ + "src/watch/iocp.rs", + "src/decor/iconsbin.rs", + "src/host/named.rs", + "src/ops_client.rs", + "src/instance.rs", + "src/shell/images/pinned.rs", + "src/ops/places.rs", +]; /// Calls that create, change, move or delete a file. The Win32 names are stems, so every variant matches too (A and /// W, Ex, WithProgress, 2, FromApp, Transacted); GetFileAttributesW does not match the SetFileAttributes stem. @@ -709,3 +718,47 @@ fn real_folders_only_on_the_start_path() { let all: Vec = files.iter().flat_map(|(p, t)| real_folder_violations(p, t)).collect(); assert!(all.is_empty(), "{all:#?}"); } + +// ---- The system clipboard: the window reaches it only through the kit, a test only in the disposable job --------- + +/// Calls that open, write or empty the system clipboard (Win32 and OLE). +const CLIPBOARD_CALLS: [&str; 5] = + ["OpenClipboard", "SetClipboardData", "EmptyClipboard", "OleSetClipboard", "OleFlushClipboard"]; + +/// Every source but the disposable tests, which place files on the clipboard the way File Explorer does on the CI's +/// throwaway runner: the window uses the kit's clipboard (EventCx::clipboard), the other tests the Harness's fake. +fn clipboard_violations(path: &str, text: &str) -> Vec { + if path.starts_with("tests/disposable_") { + return Vec::new(); + } + let mut v = Vec::new(); + for (n, line) in text.lines().enumerate() { + if is_comment(line) { + continue; + } + for t in CLIPBOARD_CALLS { + if line.contains(t) { + v.push(format!("{path}:{}: {t} reaches the system clipboard", n + 1)); + } + } + } + v +} + +#[test] +fn no_test_and_no_window_code_touches_the_system_clipboard() { + for s in [ + "unsafe { OpenClipboard(Some(hwnd)) }", + "SetClipboardData(CF_HDROP.0.into(), Some(h))", + "let _ = EmptyClipboard();", + "OleSetClipboard(&data)", + "OleFlushClipboard()", + ] { + assert_eq!(clipboard_violations("tests/paste.rs", s).len(), 1, "not caught: {s}"); + assert!(clipboard_violations("tests/disposable_paste.rs", s).is_empty(), "the disposable job may: {s}"); + } + assert!(clipboard_violations("src/clip_files.rs", "cx.clipboard().set_files(&paths, effect)").is_empty()); + assert!(clipboard_violations("tests/paste.rs", "// OpenClipboard is never called").is_empty()); + let all = scan(clipboard_violations); + assert!(all.is_empty(), "{all:#?}"); +} diff --git a/apps/files/tests/menu_glyphs.rs b/apps/files/tests/menu_glyphs.rs new file mode 100644 index 00000000..7f74fbca --- /dev/null +++ b/apps/files/tests/menu_glyphs.rs @@ -0,0 +1,96 @@ +//! The line glyphs of the menus: Copy path, Properties and Open in File Explorer carry theirs wherever they appear, the +//! New menu's folder uses the folder-with-plus glyph, and a drive's bar on Home is in the disk hue. Plain tests over the +//! fakes: no window, no shell host, no file system. + +use std::rc::Rc; + +use files_engine::fakes::{self, Fakes}; +use files_engine::home; +use files_engine::keys::{self, Cmd}; +use files_engine::listing::WidePath; +use files_engine::menu; +use files_engine::toolmenus; +use files_engine::window::FilesScreen; +use oled_trust::frame::files::Location; +use oled_ui::harness::Harness; +use oled_ui::{CommandId, Glyph, MenuItem, Screen, SizeL, Tokens, UiLang}; + +const DIR: &str = r"C:\made-up\glyph-folder"; + +fn screen() -> Harness { + menu::set_shift_for_tests(Some(false)); + let f = Fakes::new(); + let dir = WidePath::parse(DIR).unwrap(); + f.enumr.queue(&dir, fakes::listing(&[("notes.txt", false, 1_200, fakes::FT_2026_11_21)])); + let shared = f.shared(UiLang::EN); + let tab = shared.new_tab(); + let fs = FilesScreen::new(Rc::clone(&shared), 1, Location::Fs(dir), None, tab); + let mut h = Harness::new(fs, SizeL { w: 900, h: 600 }, 96, Tokens::oled()); + h.render(); + f.pump(&mut h, 1); + h.render(); + h +} + +/// The glyph of a menu entry: a command's from the screen's table, a custom entry's own. +fn glyph_of(s: &FilesScreen, items: &[MenuItem], cmd: Cmd) -> Option { + let id = CommandId(cmd as u32); + items.iter().find_map(|i| match i { + MenuItem::Command(c) if *c == id => s.commands().get(id).and_then(|c| c.glyph), + MenuItem::Custom { id: c, glyph, .. } if *c == id => *glyph, + _ => None, + }) +} + +#[test] +fn more_menu_carries_the_path_properties_and_explorer_glyphs() { + let h = screen(); + let items = toolmenus::more_items(h.screen()); + assert_eq!(glyph_of(h.screen(), &items, Cmd::CopyPath), Some(Glyph::CmdCopy)); + assert_eq!(glyph_of(h.screen(), &items, Cmd::Properties), Some(Glyph::LineInfo)); + assert_eq!(glyph_of(h.screen(), &items, Cmd::OpenInExplorer), Some(Glyph::LineExternal)); +} + +#[test] +fn context_menu_carries_the_path_and_properties_glyphs() { + let mut h = screen(); + let r = h.screen().tabs().active().table.row_rect(0).expect("the row is in view"); + h.right_click(oled_ui::PointL { x: r.l + 120, y: (r.t + r.b) / 2 }); + let items = h.menus()[0].items.clone(); + assert_eq!(glyph_of(h.screen(), &items, Cmd::CopyPath), Some(Glyph::CmdCopy)); + assert_eq!(glyph_of(h.screen(), &items, Cmd::Properties), Some(Glyph::LineInfo)); +} + +#[test] +fn only_those_three_commands_get_a_menu_glyph() { + let with: Vec = [Cmd::CopyPath, Cmd::Properties, Cmd::OpenInExplorer, Cmd::Open, Cmd::Rename, Cmd::SelectAll] + .into_iter() + .filter(|c| keys::menu_glyph(*c).is_some()) + .collect(); + assert_eq!(with, [Cmd::CopyPath, Cmd::Properties, Cmd::OpenInExplorer]); +} + +#[test] +fn new_menu_folder_uses_the_new_folder_glyph() { + let h = screen(); + let items = toolmenus::new_items(h.screen()); + assert_eq!(glyph_of(h.screen(), &items, Cmd::NewFolder), Some(Glyph::CmdNewFolder)); +} + +#[test] +fn home_bar_ink_is_the_disk_hue_then_attention() { + let t = Tokens::oled(); + let c = &t.color; + assert_eq!(home::bar_ink(c, false, 0), c.res_disk); + assert_eq!(home::bar_ink(c, false, 90), c.res_disk); + assert_eq!(home::bar_ink(c, false, 91), c.accent_attention); + assert_ne!(c.res_disk, c.fg_primary, "the bar is no longer white"); +} + +#[test] +fn home_bar_in_high_contrast_is_the_highlight_accent() { + let t = Tokens::oled(); + let c = &t.color; + assert_eq!(home::bar_ink(c, true, 40), c.accent_ui); + assert_eq!(home::bar_ink(c, true, 99), c.accent_attention); +} diff --git a/apps/files/tests/model.rs b/apps/files/tests/model.rs index 8a55602e..ef6e7878 100644 --- a/apps/files/tests/model.rs +++ b/apps/files/tests/model.rs @@ -6,10 +6,13 @@ use std::sync::Arc; use files_engine::fakes::{self, FakeListing}; use files_engine::format::{Fmt, LocalTime}; +use files_engine::icons::{ArtBook, ArtKey}; +use files_engine::knownfolders::{KnownFolders, KnownName}; use files_engine::listing::{Anchor, Batch, Diff, EntryStore, Gen, RawEntry, SortKey, Visibility, WidePath}; use files_engine::model::{id_of, key_of, ColKind, FilesTable, IconKey, Listing, ViewOpts}; use files_engine::types::TypeNames; use files_engine::view::columns::{default_columns, sort_key}; +use oled_ui::art::{Art, Family}; use oled_ui::model::{ Align, Badge, CellKind, CellOut, ColId, FgRole, IconRef, KeySet, ListModel, Selection, SortDir, TableModel, }; @@ -91,7 +94,7 @@ fn cell_name_spans() { assert_eq!(f.text, "report-final-v2.pdf"); assert_eq!(f.n_spans, 2); assert_eq!((f.spans[0].start, f.spans[0].end, f.spans[0].fg), (0, 15, FgRole::Primary)); - assert_eq!((f.spans[1].start, f.spans[1].end, f.spans[1].fg), (15, 19, FgRole::Secondary)); + assert_eq!((f.spans[1].start, f.spans[1].end, f.spans[1].fg), (15, 19, FgRole::Tertiary), "the extension is Ink 3"); let d = cell(&t, "invoices.old", ColKind::Name); assert_eq!(d.text, "invoices.old"); assert_eq!(d.n_spans, 1); @@ -285,9 +288,9 @@ fn generation_changes_on_every_mutation() { moved(&t, &mut last, "set_lang"); t.listing_mut().append(batch(&[])); moved(&t, &mut last, "listing_mut"); - assert!(t.set_icon(IconKey::Folder, 2, Arc::from(vec![1u8; 16]))); + assert!(t.set_icon(IconKey::Class(b"bin".to_vec().into()), 2, Arc::from(vec![1u8; 16]))); moved(&t, &mut last, "a changed icon"); - assert!(!t.set_icon(IconKey::Folder, 2, Arc::from(vec![1u8; 16]))); + assert!(!t.set_icon(IconKey::Class(b"bin".to_vec().into()), 2, Arc::from(vec![1u8; 16]))); assert_eq!(t.generation(), last, "the same icon again changes nothing"); t.replace(Box::new(store(batch(&[("b.txt", ARCHIVE, 0, 1, 0)])))); moved(&t, &mut last, "replace"); @@ -310,25 +313,85 @@ fn key_round_trip() { } #[test] -fn icons_come_from_the_tables_own_icon_table() { - let mut t = simple(&[("sub", DIR, 0, 0, 0), ("a.pdf", ARCHIVE, 0, 1, 0), ("b.txt", ARCHIVE, 0, 1, 0)]); +fn icons_come_from_the_art_and_the_tables_own_icon_table() { + let rows = [ + ("sub", DIR, 0, 0, 0), + ("a.pdf", ARCHIVE, 0, 1, 0), + ("b.txt", ARCHIVE, 0, 1, 0), + ("c.bin", ARCHIVE, 0, 1, 0), + ("readme", ARCHIVE, 0, 1, 0), + ("tool.exe", ARCHIVE, 0, 1, 0), + ]; + let mut t = simple(&rows); + t.set_art(Rc::new(ArtBook::new(ArtKey { small: 16, large: 32, hc: None }))); let icon = |t: &FilesTable, n: &str| cell(t, n, ColKind::Name).icon; - assert_eq!(icon(&t, "sub"), None, "nothing is filled yet"); + let art = |t: &FilesTable, n: &str| t.art_of(row_of_name(t, n)); + // Before any Windows icon every row draws its art at once. + for (name, want) in [ + ("sub", Art::Folder), + ("a.pdf", Art::File(Family::Pdf)), + ("b.txt", Art::File(Family::Text)), + ("c.bin", Art::FileGeneric), + ("readme", Art::FileGeneric), + ("tool.exe", Art::Program), + ] { + assert_eq!(art(&t, name), Some(want), "{name}"); + let bmp = t.icon(icon(&t, name).expect("never bare"), 16).expect("the art is drawn"); + assert_eq!((bmp.width, bmp.height), (16, 16), "{name}: the book's size"); + } let px = |v: u8| Arc::<[u8]>::from(vec![v, 0, 0, 255, v, 0, 0, 255, v, 0, 0, 255, v, 0, 0, 255]); - assert!(t.set_icon(IconKey::Folder, 2, px(1))); assert!(t.set_icon(IconKey::Class(b"".to_vec().into()), 2, px(2))); - assert!(t.set_icon(IconKey::Class(b"PDF".to_vec().into()), 2, px(3))); - let (f, g, p) = (icon(&t, "sub"), icon(&t, "b.txt"), icon(&t, "a.pdf")); - assert_eq!(f, Some(IconRef(0))); - assert_eq!(g, Some(IconRef(1))); - assert!(p.is_some() && p != f && p != g, "a class icon of its own, found by the lower-case extension"); - let bmp = t.icon(p.unwrap(), 16).expect("filled slot"); + assert!(t.set_icon(IconKey::Class(b"BIN".to_vec().into()), 2, px(3))); + assert!(t.set_icon(IconKey::Class(b"pdf".to_vec().into()), 2, px(5))); + assert!(t.set_icon(IconKey::Class(b"exe".to_vec().into()), 2, px(6))); + let (g, b) = (icon(&t, "readme"), icon(&t, "c.bin")); + assert_eq!(g, Some(IconRef(0)), "the class icon of no extension"); + assert!(b.is_some() && b != g, "a class icon of its own, found by the lower-case extension"); + assert_eq!(art(&t, "c.bin"), None); + let bmp = t.icon(b.unwrap(), 16).expect("filled slot"); assert_eq!((bmp.width, bmp.height, bmp.pixels[0]), (2, 2, 0xFF00_0003), "BGRA bytes become 0xAARRGGBB"); - let a = files_engine::listing::EntryId(t.listing().find(b"a.pdf").unwrap().0); + assert_eq!(art(&t, "a.pdf"), Some(Art::File(Family::Pdf)), "a family keeps its art over the class icon"); + assert_eq!(art(&t, "tool.exe"), Some(Art::Program), "a program waits for its own icon, never its class's"); + assert_eq!(art(&t, "sub"), Some(Art::Folder), "a folder never draws a Windows icon"); + let a = files_engine::listing::EntryId(t.listing().find(b"tool.exe").unwrap().0); assert!(t.set_icon(IconKey::Item(a), 2, px(4))); - assert_ne!(icon(&t, "a.pdf"), p, "an item's own icon wins"); - assert!(!t.set_icon(IconKey::Folder, 0, px(1)), "a zero size is refused"); - assert!(!t.set_icon(IconKey::Folder, 4, px(1)), "too few bytes are refused"); + assert_eq!(art(&t, "tool.exe"), None, "an item's own icon wins"); + assert_eq!(t.icon(icon(&t, "tool.exe").unwrap(), 16).unwrap().pixels[0], 0xFF00_0004); + assert!(!t.set_icon(IconKey::Class(b"bin".to_vec().into()), 0, px(1)), "a zero size is refused"); + assert!(!t.set_icon(IconKey::Class(b"bin".to_vec().into()), 4, px(1)), "too few bytes are refused"); +} + +#[test] +fn known_folders_by_path_never_by_name() { + let mut t = simple(&[("Downloads", DIR, 0, 0, 0), ("Music", DIR, 0, 0, 0), ("plain", DIR, 0, 0, 0)]); + let art = |t: &FilesTable, n: &str| t.art_of(row_of_name(t, n)); + assert_eq!(art(&t, "Downloads"), Some(Art::Folder), "a folder named Downloads is a plain folder"); + let here = |n: &str| WidePath::parse(&format!(r"C:\Data\Reports\{n}")).unwrap(); + let elsewhere = WidePath::parse(r"D:\made-up\Downloads").unwrap(); + t.set_known(Rc::new(KnownFolders::new( + vec![(KnownName::Downloads, elsewhere), (KnownName::Music, here("MUSIC"))], + Some(b'C'), + ))); + assert_eq!(art(&t, "Downloads"), Some(Art::Folder), "the user's Downloads is elsewhere: this one is plain"); + assert_eq!(art(&t, "Music"), Some(Art::Music), "the same path, any case"); + assert_eq!(art(&t, "plain"), Some(Art::Folder)); + t.replace(Box::new(store(batch(&[("Music", DIR, 0, 0, 0)])))); + assert_eq!(art(&t, "Music"), Some(Art::Music), "a fresh listing of the same folder"); +} + +#[test] +fn cut_and_hidden_rows_dim_their_name() { + let mut t = + simple(&[("a.txt", ARCHIVE, 0, 1, 0), ("h.txt", ARCHIVE | HIDDEN, 0, 1, 0), ("c.txt", ARCHIVE, 0, 1, 0)]); + t.listing_mut().set_visibility(Visibility { hidden: true, protected_system: false }); + let c = files_engine::listing::EntryId(t.listing().find(b"c.txt").unwrap().0); + t.set_cut([c]); + let name = |t: &FilesTable, n: &str| cell(t, n, ColKind::Name); + assert!(!name(&t, "a.txt").cut && !name(&t, "a.txt").dim_icon); + assert!(name(&t, "h.txt").dim_icon, "hidden"); + assert!(name(&t, "c.txt").cut, "cut"); + t.set_cut([]); + assert!(!name(&t, "c.txt").cut, "the cut is dropped"); } #[test] @@ -371,7 +434,7 @@ fn default_columns_match_the_spec() { (1, "Date modified".to_string(), 150, 110, false, Align::Start, true, true), (2, "Type".to_string(), 140, 90, false, Align::Start, true, true), (3, "Size".to_string(), 90, 70, false, Align::End, true, true), - (4, "Date created".to_string(), 150, 110, false, Align::Start, false, true), + (4, "Created".to_string(), 150, 110, false, Align::Start, false, true), (5, "Attributes".to_string(), 90, 70, false, Align::Start, false, true), (6, "Status".to_string(), 120, 90, false, Align::Start, false, true), ]; diff --git a/apps/files/tests/model_alloc.rs b/apps/files/tests/model_alloc.rs index 0c625406..92dadf0d 100644 --- a/apps/files/tests/model_alloc.rs +++ b/apps/files/tests/model_alloc.rs @@ -7,6 +7,7 @@ use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering::Relaxed}; use std::sync::Arc; use files_engine::format::{Fmt, LocalTime}; +use files_engine::knownfolders::{KnownFolders, KnownName}; use files_engine::listing::{Batch, EntryStore, Gen, RawEntry, WidePath}; use files_engine::model::{FilesTable, IconKey, ViewOpts}; use files_engine::types::TypeNames; @@ -77,8 +78,14 @@ fn cell_allocates_nothing_when_warm() { ViewOpts::default(), now, ); - t.set_icon(IconKey::Folder, 1, Arc::from(vec![1u8; 4])); + t.set_icon(IconKey::Class(b"".to_vec().into()), 1, Arc::from(vec![1u8; 4])); t.set_icon(IconKey::Class(b"pdf".to_vec().into()), 1, Arc::from(vec![2u8; 4])); + // Known folders inside the listed folder: every folder row is matched against them. + let known = |n: &str| WidePath::parse(&format!(r"C:\Data\Reports\{n}")).unwrap(); + t.set_known(Rc::new(KnownFolders::new( + vec![(KnownName::Downloads, known("folder-05")), (KnownName::Music, known("Music"))], + Some(b'C'), + ))); // Name, Type, Attributes, Status. The date and size formatters still allocate inside (scratch Strings), so they join later. let cols = [ColId(0), ColId(2), ColId(5), ColId(6)]; let mut out = CellOut::default(); diff --git a/apps/files/tests/mutations_temp_root.rs b/apps/files/tests/mutations_temp_root.rs new file mode 100644 index 00000000..bcab28a6 --- /dev/null +++ b/apps/files/tests/mutations_temp_root.rs @@ -0,0 +1,108 @@ +//! Rename, new folder and a permanent delete through the window's own seam and the real operations host, inside a +//! TempRoot on this PC (never the Recycle Bin): F2 and its undo, Ctrl+Shift+N, Shift+Del with the bar's fresh Enter. +//! The undo of a new folder recycles it, so it runs only in the disposable job; here its record is checked. + +mod common; +mod real_window; + +use common::temp::TempRoot; +use files_engine::bar; +use files_engine::gate; +use files_engine::listing::WidePath; +use files_engine::ops::undo::plan; +use files_engine::toolmenus; +use oled_trust::frame::files::{OpId, OpKind, UndoKind}; +use real_window::{child, window}; + +fn wp(root: &TempRoot) -> WidePath { + WidePath::parse(&root.path().to_string_lossy()).unwrap() +} + +#[test] +fn rename_through_the_real_host_and_its_undo() { + let root = TempRoot::new("mut_rename"); + let file = root.file("report-final-v2.pdf", b"made-up bytes"); + let dir = wp(&root); + let fence = root.path().display().to_string(); + let mut r = window(&root, &dir, &[("report-final-v2.pdf", false)], &fence, true); + r.h.key("Ctrl+A").key("F2"); + assert!(r.h.screen().tabs().active().table.is_renaming(), "F2 opens the field"); + r.h.type_text("report-final-v3").key("Enter"); + let renamed = root.at("report-final-v3.pdf"); + r.until("the rename", |r| r.idle() && renamed.exists() && !file.exists()); + r.until("the undo record", |r| r.shared.undo.borrow().len() == 1); + assert_eq!(r.shared.undo.borrow().label(oled_ui::UiLang::EN).as_deref(), Some("Undo Rename")); + r.h.key("Ctrl+Z"); + r.until("the undo", |r| r.idle() && file.exists() && !renamed.exists()); + assert_eq!(std::fs::read(&file).unwrap(), b"made-up bytes", "the same file, by its old name"); + r.until("the redo entry", |r| r.shared.undo.borrow().redo_len() == 1); + assert_eq!(r.shared.undo.borrow().redo_label(oled_ui::UiLang::EN).as_deref(), Some("Redo Rename")); + // Redo renames it again. + r.h.key("Ctrl+Y"); + r.until("the redo", |r| r.idle() && renamed.exists() && !file.exists()); + r.shared.services.ops.shutdown(); +} + +#[test] +fn a_name_clash_stays_in_the_field() { + let root = TempRoot::new("mut_clash"); + root.file("notes.txt", b"one"); + root.file("plan.txt", b"two"); + let dir = wp(&root); + let fence = root.path().display().to_string(); + let mut r = window(&root, &dir, &[("notes.txt", false), ("plan.txt", false)], &fence, true); + r.select("notes.txt"); + r.h.key("F2").type_text("plan").key("Enter"); + let t = r.h.screen_mut().tabs_mut().active_mut(); + let f = t.table.rename_field_mut().expect("the field stays open"); + assert_eq!(f.error().map(|e| e.to_string()).as_deref(), Some("There's already an item named plan.txt")); + assert!(r.shared.ops.borrow().rows().is_empty(), "nothing went to the host"); + assert_eq!(std::fs::read(root.at("plan.txt")).unwrap(), b"two"); +} + +#[test] +fn new_folder_through_the_real_host_and_its_undo_record() { + let root = TempRoot::new("mut_new_folder"); + let dir = wp(&root); + let fence = root.path().display().to_string(); + let mut r = window(&root, &dir, &[], &fence, true); + let waits = toolmenus::new_folder_why(None, gate::REAL_DATA_MUTATIONS, toolmenus::NEW_FOLDER_LIVE).is_some(); + r.h.key("Ctrl+Shift+N"); + let made = root.at("New folder"); + if waits { + // Real data on with New folder's own switch off: the notice, nothing made. + r.h.render(); + assert!(r.h.a11y_dump().contains("Not available in this alpha"), "{}", r.h.a11y_dump()); + assert!(!made.exists()); + return; + } + r.until("the new folder", |r| r.idle() && made.is_dir()); + r.until("the undo record", |r| r.shared.undo.borrow().len() == 1); + let e = r.shared.undo.borrow_mut().pop().expect("the entry"); + assert_eq!((e.kind, e.record.kind), (OpKind::NewFolder, UndoKind::RecycleNewFolder)); + assert_eq!(e.record.entries.len(), 1); + assert!(files_engine::ops::checks::same_path(&e.record.entries[0].to, &child(&dir, "New folder"))); + // Its undo would recycle the empty folder: planned here, run only on the disposable volumes. + let p = plan(OpId(99), &e.record); + assert_eq!(p.len(), 1); + assert_eq!((p[0].kind, p[0].items.len()), (OpKind::Recycle, 1)); + r.shared.services.ops.shutdown(); +} + +#[test] +fn a_permanent_delete_through_the_bar_and_a_fresh_enter() { + let root = TempRoot::new("mut_delete"); + let file = root.file("old-draft.txt", b"made-up bytes"); + let dir = wp(&root); + let fence = root.path().display().to_string(); + let mut r = window(&root, &dir, &[("old-draft.txt", false)], &fence, true); + r.h.key("Ctrl+A").key("Shift+Del"); + assert!(bar::bar_of(r.h.screen()).is_asked(), "the bar asks"); + r.h.key("Del").key("Shift+Del"); + r.f.pump(&mut r.h, 1); + assert!(file.exists() && r.shared.ops.borrow().rows().is_empty(), "nothing before the Enter"); + r.h.key("Enter"); + r.until("the delete", |r| r.idle() && !file.exists()); + assert!(r.shared.undo.borrow().is_empty(), "a permanent delete has no undo"); + r.shared.services.ops.shutdown(); +} diff --git a/apps/files/tests/ops_places.rs b/apps/files/tests/ops_places.rs new file mode 100644 index 00000000..80243de3 --- /dev/null +++ b/apps/files/tests/ops_places.rs @@ -0,0 +1,299 @@ +//! The places the operations host never changes and the rights it asks the disk about before IFileOperation exists: +//! through the runner inside a TempRoot with made-up places and a scripted look (plain tests, no dialog: test_no_ui), +//! and through the real host process for this machine's own places. Every request the real host gets here names a +//! place outside the test's fence too, so even a broken check could not let it through. + +mod common; +mod ops_util; + +use std::sync::atomic::Ordering; +use std::sync::Arc; +use std::time::{Duration, Instant}; + +use common::temp::TempRoot; +use files_engine::ops::journal::StagedItems; +use files_engine::ops::places::{self, Look, Need, Places}; +use files_engine::ops::runner::{run, OpJob, Work}; +use files_engine::ops_client::{OpsClient, OpsConfig, OpsEvent}; +use oled_trust::frame::files::{Conflicts, ItemRef, OpEvt, OpId, OpKind, OpResult, Refusal, WidePath}; +use ops_util::{ctx, job, rename_job, wp}; + +fn new_folder_job(parent: WidePath, name: &str) -> Work { + Work::Staged(OpJob { + kind: OpKind::NewFolder, + dest: Some(parent), + name: Some(name.into()), + conflicts: Conflicts::AskSystem, + staged: StagedItems::from_vec(Vec::new()), + }) +} + +/// The refusal a run sent, with its detail. +fn refusal(evs: &[OpEvt]) -> Option<(Refusal, String)> { + evs.iter().find_map(|e| match e { + OpEvt::Refused { why, detail, .. } => Some((*why, detail.to_string())), + _ => None, + }) +} + +#[test] +fn a_sealed_place_is_refused_before_any_ifileoperation() { + let root = TempRoot::new("places_sealed"); + let file = root.file("system-made-up/a.txt", b"made-up bytes"); + let sys = wp(&root.dir("system-made-up")); + let (mut c, rx) = ctx(&[&root]); + c.places = Arc::new(Places { sealed: vec![sys.clone()], ..Places::default() }); + let works = [ + job(OpKind::DeletePermanent, vec![wp(&file)], None, Conflicts::AskSystem), + rename_job(wp(&file), "b.txt"), + new_folder_job(sys.clone(), "New folder"), + job(OpKind::Copy, vec![wp(&root.file("elsewhere.txt", b"x"))], Some(sys.clone()), Conflicts::AskSystem), + ]; + for (i, work) in works.into_iter().enumerate() { + let end = run(OpId(10 + i as u32), work, &c); + let evs: Vec = rx.try_iter().collect(); + assert_eq!(end.result, OpResult::Refused, "{i}: {evs:?}"); + assert_eq!(refusal(&evs).map(|r| r.0), Some(Refusal::Root), "{i}: {evs:?}"); + } + assert_eq!(c.stats.created.load(Ordering::Relaxed), 0, "no IFileOperation was made"); + assert!(file.exists(), "the item is where it was"); + assert!(!root.at("system-made-up/b.txt").exists() && !root.at("system-made-up/New folder").exists()); + assert!(!root.at("system-made-up/elsewhere.txt").exists()); +} + +/// The real path of every item lies in the made-up system folder (an 8.3 alias, a substituted drive or a link). +fn into_system(_: &WidePath, _: Option) -> Look { + Look { real: WidePath::parse(r"C:\made-up-system\x").ok(), ..Look::default() } +} + +#[test] +fn the_real_path_of_an_item_is_checked_too() { + let root = TempRoot::new("places_real"); + let file = root.file("plain/a.txt", b"made-up bytes"); + let (mut c, rx) = ctx(&[&root]); + c.places = Arc::new(Places { sealed: vec![WidePath::parse(r"C:\made-up-system").unwrap()], ..Places::default() }); + c.look = into_system; + for (i, work) in [ + job(OpKind::DeletePermanent, vec![wp(&file)], None, Conflicts::AskSystem), + rename_job(wp(&file), "b.txt"), + new_folder_job(wp(&root.dir("plain")), "New folder"), + ] + .into_iter() + .enumerate() + { + let end = run(OpId(20 + i as u32), work, &c); + let evs: Vec = rx.try_iter().collect(); + assert_eq!((end.result, refusal(&evs).map(|r| r.0)), (OpResult::Refused, Some(Refusal::Root)), "{i}"); + } + assert_eq!(c.stats.created.load(Ordering::Relaxed), 0); + assert!(file.exists() && !root.at("plain/New folder").exists()); +} + +fn a_volume_root(_: &WidePath, _: Option) -> Look { + Look { volume_root: true, ..Look::default() } +} + +#[test] +fn a_volume_root_on_disk_is_never_removed() { + // A folder that is the root of a volume mounted in it reads as a plain folder by its text. + let root = TempRoot::new("places_mount"); + let mounted = root.dir("mounted"); + let (mut c, rx) = ctx(&[&root]); + c.places = Arc::new(Places::default()); + c.look = a_volume_root; + for (i, work) in [ + job(OpKind::DeletePermanent, vec![wp(&mounted)], None, Conflicts::AskSystem), + rename_job(wp(&mounted), "other"), + ] + .into_iter() + .enumerate() + { + let end = run(OpId(30 + i as u32), work, &c); + let evs: Vec = rx.try_iter().collect(); + assert_eq!((end.result, refusal(&evs).map(|r| r.0)), (OpResult::Refused, Some(Refusal::Root)), "{i}"); + } + assert!(mounted.exists() && !root.at("other").exists()); + // Something new may appear in it. + let end = run(OpId(32), new_folder_job(wp(&mounted), "New folder"), &c); + assert_eq!(end.result, OpResult::Done, "{:?}", rx.try_iter().collect::>()); + assert!(mounted.join("New folder").is_dir()); +} + +fn no_right_to_remove(_: &WidePath, need: Option) -> Look { + Look { denied: need == Some(Need::Remove), ..Look::default() } +} + +fn no_right_to_add(_: &WidePath, need: Option) -> Look { + Look { denied: need == Some(Need::Add), ..Look::default() } +} + +#[test] +fn rights_the_user_lacks_refuse_the_operation_before_windows_could_ask_for_them() { + let root = TempRoot::new("places_rights"); + let file = root.file("folder/report-final-v2.pdf", b"made-up bytes"); + let folder = wp(&root.dir("folder")); + let (mut c, rx) = ctx(&[&root]); + c.places = Arc::new(Places::default()); + let mut check = |op: u32, look: places::LookFn, work: Work, name: &str| { + c.look = look; + let end = run(OpId(op), work, &c); + let evs: Vec = rx.try_iter().collect(); + assert_eq!(end.result, OpResult::Refused, "{op}: {evs:?}"); + assert_eq!(refusal(&evs), Some((Refusal::Elevated, name.to_string())), "{op}"); + }; + let item = wp(&file); + check( + 40, + no_right_to_remove, + job(OpKind::DeletePermanent, vec![item.clone()], None, Conflicts::AskSystem), + "report-final-v2.pdf", + ); + check(41, no_right_to_remove, rename_job(item.clone(), "b.pdf"), "report-final-v2.pdf"); + check(42, no_right_to_add, rename_job(item.clone(), "b.pdf"), "report-final-v2.pdf"); + check(43, no_right_to_add, new_folder_job(folder.clone(), "New folder"), "folder"); + let copied = wp(&root.file("elsewhere.txt", b"x")); + check(44, no_right_to_add, job(OpKind::Copy, vec![copied], Some(folder), Conflicts::AskSystem), "folder"); + assert_eq!(c.stats.created.load(Ordering::Relaxed), 0, "no IFileOperation was made"); + assert!(file.exists() && !root.at("folder/b.pdf").exists() && !root.at("folder/New folder").exists()); +} + +#[test] +fn the_system_look_allows_the_users_own_file_and_leaves_it_alone() { + let root = TempRoot::new("places_look"); + let file = root.file("notes.txt", b"made-up bytes"); + let item = wp(&file); + for need in [None, Some(Need::Remove)] { + let l = places::look(&item, need); + assert!(!l.denied && !l.volume_root, "{need:?}: {l:?}"); + let real = l.real.expect("the real path of a file that exists"); + assert!( + files_engine::ops::checks::same_path( + &real, + &files_engine::ops::sink::long_form(&item).unwrap_or(item.clone()) + ), + "{real:?}" + ); + } + let l = places::look(&wp(root.path()), Some(Need::Add)); + assert!(!l.denied, "{l:?}"); + assert_eq!(std::fs::read(&file).unwrap(), b"made-up bytes", "the probe changed nothing"); + // A delete with the system's look and places: the user's own file goes. + let (c, rx) = ctx(&[&root]); + let end = run(OpId(50), job(OpKind::DeletePermanent, vec![item], None, Conflicts::AskSystem), &c); + assert_eq!(end.result, OpResult::Done, "{:?}", rx.try_iter().collect::>()); + assert!(!file.exists()); +} + +/// `real` names `p`, in its long form or as given. +fn names(real: Option<&WidePath>, p: &WidePath) -> bool { + use files_engine::ops::checks::same_path; + let long = files_engine::ops::sink::long_form(p).unwrap_or(p.clone()); + real.is_some_and(|r| same_path(r, &long) || same_path(r, p)) +} + +#[test] +fn the_system_look_follows_a_link_at_the_end_of_the_folder_that_gains_something_only() { + let root = TempRoot::new("places_link_look"); + let target = wp(&root.dir("target")); + root.junction("link", &root.at("target")); + let link = wp(&root.at("link")); + let l = places::look(&link, Some(Need::Add)); + assert!(!l.denied && !l.volume_root, "{l:?}"); + assert!(names(l.real.as_ref(), &target), "the folder a copy writes into: {l:?}"); + for need in [Some(Need::Remove), None] { + let l = places::look(&link, need); + assert!(!l.denied, "{need:?}: {l:?}"); + assert!(names(l.real.as_ref(), &link), "{need:?}: an item is judged as itself: {l:?}"); + } +} + +#[test] +fn a_link_into_a_sealed_place_is_refused_as_a_destination() { + let root = TempRoot::new("places_link_sealed"); + let target = root.dir("system-made-up"); + let before = root.hash_tree("system-made-up"); + root.dir("plain"); + root.junction("plain/link", &target); + let link = wp(&root.at("plain/link")); + let copied = root.file("elsewhere/copied.txt", b"made-up bytes"); + let moved = root.file("elsewhere/moved.txt", b"made-up bytes"); + let (mut c, rx) = ctx(&[&root]); + c.places = Arc::new(Places { sealed: vec![wp(&target)], ..Places::default() }); + let works = [ + job(OpKind::Copy, vec![wp(&copied)], Some(link.clone()), Conflicts::AskSystem), + job(OpKind::Move, vec![wp(&moved)], Some(link.clone()), Conflicts::AskSystem), + new_folder_job(link.clone(), "New folder"), + ]; + for (i, work) in works.into_iter().enumerate() { + let end = run(OpId(60 + i as u32), work, &c); + let evs: Vec = rx.try_iter().collect(); + assert_eq!((end.result, refusal(&evs).map(|r| r.0)), (OpResult::Refused, Some(Refusal::Root)), "{i}: {evs:?}"); + } + assert_eq!(c.stats.created.load(Ordering::Relaxed), 0, "no IFileOperation was made"); + assert_eq!(root.hash_tree("system-made-up"), before, "nothing new in the link's target"); + assert!(moved.exists() && copied.exists(), "the items are where they were"); +} + +#[test] +fn a_copy_through_a_link_to_an_ordinary_folder_still_lands() { + let root = TempRoot::new("places_link_plain"); + let target = root.dir("target"); + root.junction("link", &target); + let copied = root.file("elsewhere/copied.txt", b"made-up bytes"); + let (c, rx) = ctx(&[&root]); + let end = run(OpId(70), job(OpKind::Copy, vec![wp(&copied)], Some(wp(&root.at("link"))), Conflicts::AskSystem), &c); + assert_eq!(end.result, OpResult::Done, "{:?}", rx.try_iter().collect::>()); + assert_eq!(std::fs::read(target.join("copied.txt")).unwrap(), b"made-up bytes", "the copy is in the target"); + assert!(copied.exists()); +} + +/// Drains until `op` is refused or finished; every event of the wait. +fn until_end(c: &OpsClient, op: OpId) -> Vec { + let start = Instant::now(); + let mut all = Vec::new(); + loop { + for e in c.drain() { + match e { + OpsEvent::Evt(e) => all.push(e), + OpsEvent::HostLost => panic!("the host went away after {all:?}"), + _ => {} + } + } + let end = + all.iter().any(|e| matches!(e, OpEvt::Refused { op: o, .. } | OpEvt::Finished { op: o, .. } if *o == op)); + if end { + return all; + } + assert!(start.elapsed() < Duration::from_secs(60), "no end within 60 s: {all:?}"); + std::thread::sleep(Duration::from_millis(10)); + } +} + +#[test] +fn the_real_host_refuses_this_machines_places() { + let root = TempRoot::new("places_host"); + let cfg = + OpsConfig { exe: common::files_exe(), data_dir: root.at("data"), owner: 0, test: Some(common::hooks(&root)) }; + let c = OpsClient::new(cfg, Arc::new(|| {})); + let windows = WidePath::parse(&std::env::var("SystemRoot").expect("SystemRoot")).unwrap(); + let drive = WidePath::new(windows.units().get(..3).unwrap()).unwrap(); + let ini = windows.join(&"win.ini".encode_utf16().collect::>()).unwrap(); + type Ask<'a> = Box OpId + 'a>; + let asks: [(Ask, &str); 4] = [ + (Box::new(|| c.rename(&windows, "made-up").unwrap()), "the Windows folder"), + (Box::new(|| c.new_folder(&windows, "made-up").unwrap()), "a folder in it"), + (Box::new(|| c.delete_permanent(&[ItemRef::Path(ini.clone())]).unwrap()), "a file in it"), + (Box::new(|| c.delete_permanent(&[ItemRef::Path(drive.clone())]).unwrap()), "a drive's root"), + ]; + for (ask, what) in asks { + let op = ask(); + let evs = until_end(&c, op); + let why = evs.iter().find_map(|e| match e { + OpEvt::Refused { op: o, why, .. } if *o == op => Some(*why), + _ => None, + }); + // Root, not OutsideTestRoot: the places come before the test fence, so the same refusal holds in a release. + assert_eq!(why, Some(Refusal::Root), "{what}: {evs:?}"); + } + c.shutdown(); +} diff --git a/apps/files/tests/ops_runner.rs b/apps/files/tests/ops_runner.rs index 776f4821..3cc93af0 100644 --- a/apps/files/tests/ops_runner.rs +++ b/apps/files/tests/ops_runner.rs @@ -14,6 +14,7 @@ use files_engine::ops::checks::check_item; use files_engine::ops::consts::{CANCEL_IN_OP, CHUNK_ITEMS}; use files_engine::ops::flags::op_flags; use files_engine::ops::journal::{Pre, StagedItems}; +use files_engine::ops::places::Places; use files_engine::ops::preflight::{preflight, skip_present}; use files_engine::ops::runner::{run, OpJob, RunCtx, RunEnd, Work}; use files_engine::ops::sink::attrs; @@ -383,7 +384,7 @@ fn refuses_root() { for root in ["C:\\", "\\\\srv\\share"] { let p = WidePath::parse(root).unwrap(); for kind in [OpKind::Recycle, OpKind::DeletePermanent, OpKind::Move, OpKind::Rename] { - assert_eq!(check_item(&p, kind, None), Err(Refusal::Root), "{root} {kind:?}"); + assert_eq!(check_item(&p, kind, None, &Places::default()), Err(Refusal::Root), "{root} {kind:?}"); } } } diff --git a/apps/files/tests/ops_undo.rs b/apps/files/tests/ops_undo.rs index 1672f8cd..3fa705ca 100644 --- a/apps/files/tests/ops_undo.rs +++ b/apps/files/tests/ops_undo.rs @@ -432,7 +432,7 @@ fn disposable_undo_recycle_restores() { let evs: Vec = rx.try_iter().collect(); assert_eq!((end.result, end.failed), (OpResult::Done, 0), "{evs:?}"); assert_eq!(root.hash("a.txt"), common::temp::fnv1a64(b"a")); - assert!(!record.exists(), "the $I record left the bin with its item"); + assert!(!record.exists(), "the $I record left the bin with its item: {evs:?}"); } else { assert_eq!(finished_undo(&evs), Some(UndoKind::OpenRecycleBin)); assert_eq!(check(&rec, &OsFs), Ok(UndoKind::OpenRecycleBin), "FS-3 g not green: the bin opens"); diff --git a/apps/files/tests/options.rs b/apps/files/tests/options.rs index 784df4a1..331c251f 100644 --- a/apps/files/tests/options.rs +++ b/apps/files/tests/options.rs @@ -24,7 +24,7 @@ fn defaults_without_a_file() { assert_eq!(*o, FilesOptions::default()); assert!(o.show_extensions && o.sidebar_visible && o.downloads_by_date); assert!(!o.sizes_like_explorer && !o.full_dates && !o.hidden_items && !o.protected_system && !o.compact); - assert_eq!((o.sidebar_width, o.new_tab.as_str()), (200, "home")); + assert_eq!((o.sidebar_width, o.new_tab.as_str()), (224, "home")); assert!(o.columns.is_empty() && o.pins.is_empty() && !o.pins_imported); let text = std::fs::read_to_string(&path).unwrap(); assert_eq!(text, FilesOptions::default().to_template()); diff --git a/apps/files/tests/parity.rs b/apps/files/tests/parity.rs index 18d1c2f0..9cdd7d3e 100644 --- a/apps/files/tests/parity.rs +++ b/apps/files/tests/parity.rs @@ -491,7 +491,72 @@ row!(rename, Cmd::Rename, Parity::Same, [], |w: &mut Win, _k: &str| { row!(new_folder, Cmd::NewFolder, Parity::Same, ["Ctrl+Shift+N"], |w: &mut Win, k: &str| { w.key(k); - assert_eq!(w.calls(), [OpsCall::NewFolder(w.dir(), "New folder".into())]); + let gate = files_engine::gate::REAL_DATA_MUTATIONS; + if files_engine::toolmenus::new_folder_why(None, gate, files_engine::toolmenus::NEW_FOLDER_LIVE).is_some() { + // New folder waits for its own switch: the notice, nothing asked. + assert!(w.calls().is_empty(), "{k}"); + assert!(w.has_label("Not available in this alpha: use File Explorer"), "{k}: {}", w.h.a11y_dump()); + } else { + assert_eq!(w.calls(), [OpsCall::NewFolder(w.dir(), "New folder".into())]); + } +}); + +/// The clipboard commands as the build ships them: while their switch waits, the chord answers with the notice and its +/// button and asks for nothing; once it is on, Copy and Cut put the selection on the clipboard and Paste asks for a copy +/// into the folder. +fn clipboard_row(w: &mut Win, k: &str) { + if std::hint::black_box(files_engine::gate::PASTE_LIVE) { + clipboard_live(w, k); + } else { + clipboard_waits(w, k); + } +} + +fn clipboard_live(w: &mut Win, k: &str) { + let notes = std::path::PathBuf::from(format!(r"{}\notes.txt", w.dir().to_string_lossy())); + w.on_notes(); + if k == "Ctrl+V" { + let c = w.h.clipboard(); + (c.files, c.paths, c.effect, c.seq) = (true, vec![notes], oled_ui::DropEffect::Copy, c.seq + 1); + w.key(k); + assert_eq!(w.calls(), [OpsCall::Copy(vec![w.item("notes.txt")], w.dir())], "{k}"); + return; + } + w.key(k); + assert!(w.calls().is_empty(), "{k}: the clipboard only"); + assert_eq!(w.h.clipboard().paths, [notes], "{k}"); + let effect = if k == "Ctrl+X" { oled_ui::DropEffect::Move } else { oled_ui::DropEffect::Copy }; + assert_eq!(w.h.clipboard().effect, effect, "{k}"); +} + +/// The clipboard commands wait for their switch: the chord answers with the notice and its button, and asks for nothing. +fn clipboard_waits(w: &mut Win, k: &str) { + w.fs().shared().paste_live.set(false); + w.on_notes(); + w.key(k); + assert!(w.calls().is_empty(), "{k}: an operation was asked"); + assert!(w.execs().is_empty(), "{k}: the shell was asked"); + assert!(w.h.clipboard().text.is_none(), "{k}: the clipboard was written"); + assert!(w.has_label("Not available in this alpha: use File Explorer"), "{k}: {}", w.h.a11y_dump()); + assert!(w.h.a11y_dump().contains("Open \u{2197}"), "{k}: the notice offers File Explorer"); +} + +row!(cut, Cmd::Cut, Parity::Same, ["Ctrl+X"], clipboard_row); + +row!(copy, Cmd::Copy, Parity::Same, ["Ctrl+C"], clipboard_row); + +row!(paste, Cmd::Paste, Parity::Same, ["Ctrl+V"], clipboard_row); + +row!(focus_search, Cmd::FocusSearch, Parity::Same, ["Ctrl+F", "Ctrl+E", "F3"], |w: &mut Win, k: &str| { + assert_ne!(w.focused(), Some(w.fs().toolbar().search().field_node()), "{k}: not there before"); + w.key(k); + assert_eq!(w.focused(), Some(w.fs().toolbar().search().field_node()), "{k}: the keyboard is in the search field"); +}); + +row!(details_pane, Cmd::DetailsPane, Parity::Same, ["Alt+Shift+P"], |w: &mut Win, k: &str| { + let before = w.fs().shared().opts.borrow().details_pane; + w.key(k); + assert_eq!(w.fs().shared().opts.borrow().details_pane, !before, "{k}: the pane switch flips"); }); row!(copy_path, Cmd::CopyPath, Parity::Same, ["Ctrl+Shift+C"], |w: &mut Win, k: &str| { @@ -511,7 +576,9 @@ row!(recycle, Cmd::Recycle, Parity::Same, ["Del", "Ctrl+D"], |w: &mut Win, k: &s row!(delete_permanent, Cmd::DeletePermanent, Parity::Ours, ["Shift+Del"], |w: &mut Win, k: &str| { w.on_notes(); w.key(k); - assert_eq!(w.calls(), [OpsCall::DeletePermanent(vec![w.item("notes.txt")])]); + assert!(w.calls().is_empty(), "{k}: the bar asks first"); + w.key("Enter"); + assert_eq!(w.calls(), [OpsCall::DeletePermanent(vec![w.item("notes.txt")])], "{k}: then its Enter"); }); row!(undo, Cmd::Undo, Parity::Same, ["Ctrl+Z"], |w: &mut Win, k: &str| { @@ -568,6 +635,7 @@ row!(ops_flyout, Cmd::OpsFlyout, Parity::Ours, ["Ctrl+J"], |w: &mut Win, k: &str // The flyout lists operations: one is running. w.on_notes(); w.key("Shift+Del"); + w.key("Enter"); w.f.ops.emit(OpsEvent::Evt(OpEvt::Started { op: OpId(1), kind: OpKind::DeletePermanent, items: 1, bytes: 0 })); w.pump(); w.key(k); @@ -629,15 +697,12 @@ fn verify_rows_are_exactly_the_planned_ones() { #[test] fn unbound_chords_reach_no_command() { let unbound = [ - "Ctrl+C", - "Ctrl+X", - "Ctrl+V", "F7", "F8", "F9", "F11", "F12", - "Ctrl+E", + "Ctrl+Alt+E", "Ctrl+G", "Ctrl+K", "Ctrl+O", @@ -650,7 +715,7 @@ fn unbound_chords_reach_no_command() { "Alt+X", "Ctrl+Alt+Z", ]; - assert_eq!(unbound.len(), 20); + assert_eq!(unbound.len(), 17); let mut w = win(); w.key("Down"); let before = (w.here(), w.tabs(), w.selected(), w.focused()); diff --git a/apps/files/tests/paste.rs b/apps/files/tests/paste.rs new file mode 100644 index 00000000..9b28a451 --- /dev/null +++ b/apps/files/tests/paste.rs @@ -0,0 +1,423 @@ +//! Cut, Copy and Paste of files in the window, over the fakes through the kit's Harness: the clipboard is the +//! Harness's FakeClipboard (no test writes the system clipboard), the operations host is the recorder, and the folder +//! is a test root under the temp folder. What goes on the clipboard and how, what Paste asks for and what it refuses, +//! when Paste is off and why, the cut drawn at half alpha and when it ends, the chip and the flyout of a paste, the +//! system menu's clipboard verbs, and the build switch that keeps all of it off. + +mod common; + +use std::path::PathBuf; +use std::rc::Rc; + +use common::temp::TempRoot; +use files_engine::fakes::{self, Fakes, OpsCall}; +use files_engine::format::Fmt; +use files_engine::keys::Cmd; +use files_engine::listing::WidePath; +use files_engine::menu::{map_verb_with, Mapped}; +use files_engine::msg::{Fwd, Msg}; +use files_engine::ops_client::{OpsEvent, UndoRecord}; +use files_engine::ops_ui; +use files_engine::services::ReqOwner; +use files_engine::shell_client::ShellReply; +use files_engine::window::FilesScreen; +use oled_trust::frame::files::{ + CanonVerb, ItemRef, Location, MenuOutcome, OpEvt, OpId, OpKind, OpResult, ReqId, ShellEvt, UndoEntry, UndoKind, +}; +use oled_ui::harness::Harness; +use oled_ui::model::{CellOut, ColId, ListModel, TableModel}; +use oled_ui::{Clipboard, CommandId, DropEffect, SizeL, Tokens, UiLang}; + +fn wp(s: &str) -> WidePath { + WidePath::parse(s).expect("a test path parses") +} + +struct Win { + f: Fakes, + h: Harness, + root: TempRoot, +} + +/// A window over the test root's Download folder: a folder and two files; the clipboard commands on. +fn win() -> Win { + let root = TempRoot::new("paste_ui"); + root.dir("Download/invoices"); + root.file("Download/notes.txt", b"x"); + root.file("Download/plan.pdf", b"x"); + let dir = wp(&root.at("Download").to_string_lossy()); + let f = Fakes::new(); + f.enumr.queue( + &dir, + fakes::listing(&[ + ("invoices", true, 0, fakes::FT_2026_11_21), + ("notes.txt", false, 1_200, fakes::FT_2026_11_21), + ("plan.pdf", false, 3_400_000, fakes::FT_2026_11_21), + ]), + ); + let shared = f.shared(UiLang::EN); + *shared.fmt.borrow_mut() = Rc::new(Fmt::fixed_en()); + shared.paste_live.set(true); + assert_eq!(shared.new_win(), 1); + let tab = shared.new_tab(); + let screen = FilesScreen::new(Rc::clone(&shared), 1, Location::Fs(dir), None, tab); + let mut h = Harness::new(screen, SizeL { w: 1100, h: 600 }, 96, Tokens::oled()); + h.render(); + f.pump(&mut h, 1); + h.render(); + Win { f, h, root } +} + +impl Win { + fn fs(&self) -> &FilesScreen { + self.h.screen() + } + + fn dir(&self) -> WidePath { + wp(&self.root.at("Download").to_string_lossy()) + } + + fn item(&self, name: &str) -> WidePath { + wp(&self.root.at(&format!("Download/{name}")).to_string_lossy()) + } + + fn path(&self, name: &str) -> PathBuf { + self.root.at(&format!("Download/{name}")) + } + + fn key(&mut self, chord: &str) -> &mut Self { + self.h.key(chord); + self.h.render(); + self + } + + fn pump(&mut self) { + self.f.pump(&mut self.h, 1); + self.h.render(); + } + + /// The rows from `from` to `to` (list order: invoices, notes.txt, plan.pdf) selected. + fn select(&mut self, from: usize, to: usize) { + self.key("Home"); + for _ in 0..from { + self.key("Down"); + } + for _ in from..to { + self.key("Shift+Down"); + } + } + + /// Files placed on the clipboard as another program puts them; an input (F8: bound to nothing) lets the window look. + fn place(&mut self, paths: &[PathBuf], effect: DropEffect) { + let c = self.h.clipboard(); + (c.files, c.paths, c.effect, c.seq) = (true, paths.to_vec(), effect, c.seq + 1); + self.key("F8"); + } + + fn cut_drawn(&self, name: &str) -> bool { + let m = self.fs().tabs().active().table.model(); + let row = (0..ListModel::len(m)).find(|&i| ListModel::label(m, i) == name).expect("the row"); + let mut out = CellOut::default(); + m.cell(row, ColId(0), &mut out); + out.cut + } + + fn paste_state(&self) -> (bool, String) { + let it = self.fs().toolbar().bar().item(CommandId(Cmd::Paste as u32)).expect("Paste is on the bar"); + (it.enabled, it.tip.to_string()) + } + + fn chip(&self) -> Option { + ops_ui::flyout_of(self.fs()).chip().map(|(_, t)| t) + } + + fn says(&self, text: &str) -> bool { + self.h.a11y_dump().contains(text) + } + + /// The system menu's answer, as the shell host sends it. + fn intercepted(&mut self, verb: CanonVerb, items: Vec) { + let e = ShellEvt::MenuDone { + req: ReqId(1), + outcome: MenuOutcome::Intercepted(verb), + items: items.into_iter().map(ItemRef::Path).collect(), + }; + self.h.send(Box::new(Msg::Fwd(Fwd::Shell { owner: ReqOwner::Menu { win: 1 }, reply: ShellReply::Evt(e) }))); + self.h.render(); + } +} + +fn refs(items: &[WidePath]) -> Vec { + items.iter().cloned().map(ItemRef::Path).collect() +} + +#[test] +fn copy_and_cut_put_the_selection_on_the_clipboard_as_files() { + let mut w = win(); + w.select(1, 2); + w.key("Ctrl+C"); + let c = w.h.clipboard().clone(); + assert!(c.files && c.text.is_none()); + assert_eq!(c.paths, [w.path("notes.txt"), w.path("plan.pdf")]); + assert_eq!(c.effect, DropEffect::Copy); + assert!(!w.cut_drawn("notes.txt"), "a copy draws nothing"); + assert!(w.f.ops.calls().is_empty(), "the clipboard only: nothing is asked of the host"); + w.key("Ctrl+X"); + assert_eq!(w.h.clipboard().effect, DropEffect::Move); + assert!(w.cut_drawn("notes.txt") && w.cut_drawn("plan.pdf") && !w.cut_drawn("invoices")); + // A copy after it replaces the cut: nothing is drawn cut any more. + w.key("Ctrl+C"); + assert!(!w.cut_drawn("notes.txt")); + // Nothing selected: Copy writes nothing. + let seq = w.h.clipboard().seq; + w.key("Esc").key("Ctrl+Shift+A").key("Ctrl+C"); + assert_eq!(w.h.clipboard().seq, seq, "nothing selected, nothing written"); +} + +#[test] +fn paste_copies_or_moves_into_the_open_folder() { + let mut w = win(); + let a = w.root.file("src/a.txt", b"x"); + let b = w.root.dir("src/sub"); + let src = |p: &PathBuf| wp(&p.to_string_lossy()); + w.place(&[a.clone(), b.clone()], DropEffect::Copy); + w.key("Ctrl+V"); + assert_eq!(w.f.ops.calls(), [OpsCall::Copy(refs(&[src(&a), src(&b)]), w.dir())]); + w.place(std::slice::from_ref(&a), DropEffect::Move); + w.key("Ctrl+V"); + assert_eq!(w.f.ops.calls()[1], OpsCall::Move(refs(&[src(&a)]), w.dir())); + // The same move asked again while it runs is dropped. + w.key("Ctrl+V"); + assert_eq!(w.f.ops.calls().len(), 2); + // A copy of items from here and from elsewhere: two copies, the shell names the first's. + w.place(&[w.path("notes.txt"), a.clone()], DropEffect::Copy); + w.key("Ctrl+V"); + let calls = w.f.ops.calls(); + assert_eq!(calls[2], OpsCall::Copy(refs(&[src(&a)]), w.dir()), "the clash of elsewhere asks"); + assert_eq!(calls[3], OpsCall::Copy(refs(&[w.item("notes.txt")]), w.dir()), "a copy beside the original"); +} + +#[test] +fn copy_on_home_does_nothing_and_says_nothing() { + let mut w = win(); + w.key("Alt+Home"); + w.pump(); + assert_eq!(*w.fs().tabs().active().nav.location(), Location::Home); + let seq = w.h.clipboard().seq; + w.key("Ctrl+C").key("Ctrl+X").key("Ctrl+V"); + assert_eq!(w.h.clipboard().seq, seq, "nothing written"); + assert!(!w.says("Not available in this alpha"), "{}", w.h.a11y_dump()); + assert!(w.f.ops.calls().is_empty()); +} + +#[test] +fn paste_is_off_until_the_clipboard_holds_files_and_says_why() { + let mut w = win(); + assert_eq!(w.paste_state(), (false, "The clipboard is empty".into())); + w.key("Ctrl+V"); + assert!(w.f.ops.calls().is_empty()); + let a = w.root.file("src/a.txt", b"x"); + w.place(&[a], DropEffect::Copy); + assert_eq!(w.paste_state(), (true, "Paste into the open folder".into())); + // Another program empties the clipboard: the next input finds it so. + w.h.clipboard().set_text("made-up text"); + w.key("F8"); + assert!(!w.paste_state().0); + // The window coming to the front looks too. + let a = w.root.file("src/b.txt", b"x"); + let c = w.h.clipboard(); + (c.files, c.paths, c.seq) = (true, vec![a], c.seq + 1); + w.h.set_active(false).set_active(true); + w.h.render(); + assert!(w.paste_state().0); +} + +#[test] +fn refusals_say_why_and_ask_for_nothing() { + let mut w = win(); + let parent = w.root.path().to_path_buf(); + let other = w.root.file("src/a.txt", b"x"); + let dir = w.path(""); + // An item of the Recycle Bin as the bin puts it on the clipboard: under the bin's own name. + let bin = PathBuf::from(r"C:\$Recycle.Bin\S-1-5-21-1000-2000-3000-1001\$RAB12CD.docx"); + let cases: [(Vec, DropEffect, &str); 7] = [ + (vec![dir], DropEffect::Copy, "Can't paste Download: the destination is inside it"), + (vec![bin.clone()], DropEffect::Move, "These items can't be pasted here"), + (vec![parent], DropEffect::Move, "the destination is inside it"), + (vec![bin], DropEffect::Copy, "These items can't be pasted here"), + (vec![other.clone(), other], DropEffect::Copy, "Can't paste: a.txt is on the clipboard twice"), + (vec![PathBuf::from(r"\\.\PhysicalDrive0")], DropEffect::Copy, "These items can't be pasted here"), + (vec![w.path("notes.txt")], DropEffect::Move, ""), + ]; + for (paths, effect, says) in cases { + w.place(&paths, effect); + w.key("Ctrl+V"); + assert!(says.is_empty() || w.says(says), "{paths:?}: {}", w.h.a11y_dump()); + } + assert!(w.f.ops.calls().is_empty(), "{:?}", w.f.ops.calls()); +} + +#[test] +fn a_cut_ends_on_esc_on_a_new_clipboard_and_once_pasted() { + let mut w = win(); + // Esc: the rows draw as before and the clipboard, which still holds the cut, is emptied. + w.select(1, 1); + w.key("Ctrl+X"); + assert!(w.cut_drawn("notes.txt")); + w.key("Esc"); + assert!(!w.cut_drawn("notes.txt")); + assert!(!w.h.clipboard().files, "a cancelled cut leaves nothing to move"); + // Another program writes the clipboard: the next input ends the cut, and the clipboard keeps what it wrote. + w.select(1, 1); + w.key("Ctrl+X"); + w.h.clipboard().set_text("made-up text"); + w.key("F8"); + assert!(!w.cut_drawn("notes.txt")); + assert_eq!(w.h.clipboard().text.as_deref(), Some("made-up text")); + // Pasted elsewhere (the open folder of another tab, here the same window seen again): once the move is done the + // clipboard is emptied and the cut ends. + w.select(2, 2); + w.key("Ctrl+X"); + let elsewhere = w.root.dir("elsewhere"); + let seq = w.h.clipboard().seq; + w.intercepted(CanonVerb::Paste, vec![w.dir()]); + assert!(w.f.ops.calls().is_empty(), "a cut pasted into its own folder changes nothing"); + let _ = elsewhere; + w.intercepted(CanonVerb::Paste, vec![w.item("invoices")]); + assert_eq!(w.f.ops.calls(), [OpsCall::Move(refs(&[w.item("plan.pdf")]), w.item("invoices"))]); + assert!(w.cut_drawn("plan.pdf"), "still cut while it moves"); + w.f.ops.emit(OpsEvent::Evt(OpEvt::Finished { + op: OpId(1), + result: OpResult::Done, + undo: None, + replaced: 0, + items: 1, + failed: 0, + })); + w.pump(); + assert!(!w.h.clipboard().files && w.h.clipboard().seq != seq, "emptied as File Explorer does"); + assert!(!w.cut_drawn("plan.pdf")); +} + +#[test] +fn a_finished_move_leaves_a_clipboard_that_changed_since() { + let mut w = win(); + let a = w.root.file("src/a.txt", b"x"); + w.place(&[a], DropEffect::Move); + w.key("Ctrl+V"); + assert_eq!(w.f.ops.calls().len(), 1); + // Meanwhile something else is copied: it stays. + w.h.clipboard().set_text("made-up text"); + w.f.ops.emit(OpsEvent::Evt(OpEvt::Finished { + op: OpId(1), + result: OpResult::Done, + undo: None, + replaced: 0, + items: 1, + failed: 0, + })); + w.pump(); + assert_eq!(w.h.clipboard().text.as_deref(), Some("made-up text")); +} + +#[test] +fn the_chip_and_the_flyout_name_a_paste_and_ctrl_z_undoes_it() { + let mut w = win(); + let srcs: Vec = + ["a.txt", "b.txt", "c.txt"].iter().map(|n| w.root.file(&format!("src/{n}"), b"x")).collect(); + w.place(&srcs, DropEffect::Copy); + w.key("Ctrl+V"); + w.f.ops.emit(OpsEvent::Evt(OpEvt::Started { op: OpId(1), kind: OpKind::Copy, items: 3, bytes: 300 })); + w.f.ops.emit(OpsEvent::Evt(OpEvt::Progress { op: OpId(1), done: 62, total: 100, bps: 0, current: "".into() })); + w.pump(); + assert_eq!(w.chip().as_deref(), Some("Copying to Download: 3 items, 62 %")); + let entries = srcs + .iter() + .map(|p| { + let from = wp(&p.to_string_lossy()); + let to = w.item(&from.file_name().map(String::from_utf16_lossy).unwrap_or_default()); + UndoEntry { from, to, size: 1, mtime: 2, dir: false, bin: None } + }) + .collect(); + w.f.ops.emit(OpsEvent::Undo(UndoRecord { of: OpId(1), kind: UndoKind::RecycleCopies, replaced: 0, entries })); + w.f.ops.emit(OpsEvent::Evt(OpEvt::Finished { + op: OpId(1), + result: OpResult::Done, + undo: Some(UndoKind::RecycleCopies), + replaced: 0, + items: 3, + failed: 0, + })); + w.pump(); + assert_eq!(w.chip().as_deref(), Some("Copied 3 items to Download \u{b7} Undo")); + assert_eq!(w.fs().shared().undo.borrow().label(UiLang::EN).as_deref(), Some("Undo Copy")); + w.key("Ctrl+Z"); + assert_eq!(w.f.ops.calls()[1], OpsCall::Undo(OpId(1))); + assert!(w.h.clipboard().files, "a copy's paste keeps the clipboard"); +} + +#[test] +fn a_move_reads_moving_and_undo_move() { + let mut w = win(); + let a = w.root.file("src/a.txt", b"x"); + w.place(std::slice::from_ref(&a), DropEffect::Move); + w.key("Ctrl+V"); + w.f.ops.emit(OpsEvent::Evt(OpEvt::Started { op: OpId(1), kind: OpKind::Move, items: 1, bytes: 1 })); + w.pump(); + assert_eq!(w.chip().as_deref(), Some("Moving to Download: 1 item, 0 %")); + let e = UndoEntry { from: wp(&a.to_string_lossy()), to: w.item("a.txt"), size: 1, mtime: 2, dir: false, bin: None }; + w.f.ops.emit(OpsEvent::Undo(UndoRecord { of: OpId(1), kind: UndoKind::MoveBack, replaced: 0, entries: vec![e] })); + w.pump(); + assert_eq!(w.fs().shared().undo.borrow().label(UiLang::IT).as_deref(), Some("Annulla Sposta")); +} + +#[test] +fn the_system_menus_clipboard_verbs() { + let dir = wp(r"C:\made-up\Download"); + let a = wp(r"C:\made-up\Download\a.txt"); + let sub = wp(r"C:\made-up\Download\invoices"); + for live in [false, true] { + assert_eq!(map_verb_with(CanonVerb::PasteLink, vec![a.clone()], &dir, live), Mapped::NotInBeta); + } + for v in [CanonVerb::Cut, CanonVerb::Copy, CanonVerb::Paste] { + assert_eq!(map_verb_with(v, vec![a.clone()], &dir, false), Mapped::NotInBeta, "{v:?} while off"); + } + assert_eq!(map_verb_with(CanonVerb::Cut, vec![a.clone()], &dir, true), Mapped::Clip(true, vec![a.clone()])); + assert_eq!(map_verb_with(CanonVerb::Copy, vec![a.clone()], &dir, true), Mapped::Clip(false, vec![a.clone()])); + assert_eq!(map_verb_with(CanonVerb::Paste, vec![sub.clone()], &dir, true), Mapped::Paste(sub)); + assert_eq!(map_verb_with(CanonVerb::Paste, vec![], &dir, true), Mapped::Paste(dir.clone())); + assert_eq!(map_verb_with(CanonVerb::Paste, vec![a.clone(), a], &dir, true), Mapped::Nothing); + + // Through the reply route: Copy of the menu's items, Paste into a folder row, never into a file. + let mut w = win(); + w.intercepted(CanonVerb::Copy, vec![w.item("notes.txt")]); + let notes = w.path("notes.txt"); + assert_eq!(w.h.clipboard().paths, [notes]); + let a = w.root.file("src/a.txt", b"x"); + w.place(std::slice::from_ref(&a), DropEffect::Copy); + w.intercepted(CanonVerb::Paste, vec![w.item("notes.txt")]); + assert!(w.f.ops.calls().is_empty(), "a file is no place to paste into"); + w.intercepted(CanonVerb::Paste, vec![w.item("invoices")]); + assert_eq!(w.f.ops.calls(), [OpsCall::Copy(refs(&[wp(&a.to_string_lossy())]), w.item("invoices"))]); +} + +#[test] +fn the_switch_off_keeps_the_clipboard_and_the_files_as_they_are() { + let mut w = win(); + w.fs().shared().paste_live.set(false); + let a = w.root.file("src/a.txt", b"x"); + w.place(&[a], DropEffect::Copy); + let before = w.h.clipboard().clone(); + w.select(1, 2); + for k in ["Ctrl+X", "Ctrl+C", "Ctrl+V"] { + w.key(k); + assert!(w.says("Not available in this alpha: use File Explorer"), "{k}: {}", w.h.a11y_dump()); + } + w.intercepted(CanonVerb::Paste, vec![w.dir()]); + let after = w.h.clipboard().clone(); + assert_eq!((after.paths, after.effect, after.seq), (before.paths, before.effect, before.seq), "nothing written"); + assert!(w.f.ops.calls().is_empty()); + for cmd in [Cmd::Cut, Cmd::Copy, Cmd::Paste] { + let it = w.fs().toolbar().bar().item(CommandId(cmd as u32)).expect("on the bar"); + assert!(!it.enabled && it.tip == "Not available in this alpha: use File Explorer", "{cmd:?}"); + } +} diff --git a/apps/files/tests/paste_temp_root.rs b/apps/files/tests/paste_temp_root.rs new file mode 100644 index 00000000..135c9cb6 --- /dev/null +++ b/apps/files/tests/paste_temp_root.rs @@ -0,0 +1,261 @@ +//! Copy, Cut and Paste through the window's own seam and the real operations host, inside TempRoots on this PC: the +//! clipboard is the Harness's FakeClipboard (no test writes the system clipboard) and nothing goes to the Recycle Bin +//! (the undo of a copy recycles its copies, so here its record and plan are checked; the disposable job runs it). A +//! copy and a move between folders, the move's undo, a copy into the items' own folder named by the shell, the +//! conflict policies of the host, and every refusal of the window, which reaches no host. + +mod common; +mod ops_util; +mod real_window; + +use std::path::{Path, PathBuf}; +use std::sync::Arc; +use std::time::{Duration, Instant}; + +use common::temp::TempRoot; +use files_engine::fakes; +use files_engine::ops::checks::same_path; +use files_engine::ops::undo::plan; +use files_engine::ops_client::{OpsClient, OpsConfig, OpsEvent}; +use oled_trust::frame::files::{Conflicts, ItemRef, Location, OpEvt, OpId, OpKind, OpResult, UndoKind}; +use oled_ui::model::{CellOut, ColId, ListModel, TableModel}; +use oled_ui::{DropEffect, UiLang}; +use ops_util::wp; +use real_window::{window, Run}; + +/// The files of a folder, by name, sorted. +fn names(dir: &Path) -> Vec { + let mut v: Vec = std::fs::read_dir(dir) + .map(|it| it.flatten().map(|e| e.file_name().to_string_lossy().into_owned()).collect()) + .unwrap_or_default(); + v.sort(); + v +} + +/// Waits for `op` of a client; every event of the wait. +fn finish(c: &OpsClient, op: OpId) -> Vec { + let start = Instant::now(); + let mut all = Vec::new(); + loop { + let evs = c.drain(); + let done = evs.iter().any(|e| matches!(e, OpsEvent::Evt(OpEvt::Finished { op: o, .. }) if *o == op)); + all.extend(evs); + if done { + return all; + } + assert!(start.elapsed() < Duration::from_secs(60), "no Finished within 60 s: {all:?}"); + std::thread::sleep(Duration::from_millis(10)); + } +} + +fn client(root: &TempRoot) -> OpsClient { + let hooks = common::hooks(root); + let cfg = OpsConfig { exe: common::files_exe(), data_dir: root.at("data"), owner: 0, test: Some(hooks) }; + OpsClient::new(cfg, Arc::new(|| {})) +} + +/// A window over `dir` with the real host fenced to the root, the clipboard commands on (whatever the build's switch). +fn open(root: &TempRoot, dir: &Path, entries: &[(&str, bool)]) -> Run { + let fence = root.path().display().to_string(); + let mut r = window(root, &wp(dir), entries, &fence, true); + r.shared.paste_live.set(true); + r.h.key("Home"); + r.h.render(); + r +} + +/// Files placed on the (fake) clipboard the way another program puts them: the list, its effect, a new sequence number. +fn place(r: &mut Run, paths: &[PathBuf], effect: DropEffect) { + let c = r.h.clipboard(); + (c.files, c.paths, c.effect, c.seq) = (true, paths.to_vec(), effect, c.seq + 1); +} + +/// The row named `name` draws as cut. +fn cut_drawn(r: &Run, name: &str) -> bool { + let m = r.h.screen().tabs().active().table.model(); + let row = (0..ListModel::len(m)).find(|&i| ListModel::label(m, i) == name).expect("the row"); + let mut out = CellOut::default(); + m.cell(row, ColId(0), &mut out); + out.cut +} + +fn bytes(p: PathBuf) -> Vec { + std::fs::read(&p).unwrap_or_else(|e| panic!("{}: {e}", p.display())) +} + +/// A copy into the items' own folder is never a name clash: the shell names the copy as File Explorer does (the host +/// asks for it with FOF_RENAMEONCOLLISION, so no question can come), the original stays as it was. +#[test] +fn a_copy_into_its_own_folder_is_named_by_the_shell() { + let root = TempRoot::new("paste_own_folder"); + let a = root.file("src/plan.txt", b"made-up plan"); + let c = client(&root); + let op = c.copy(&[ItemRef::Path(wp(&a))], &wp(&root.at("src")), Conflicts::AskSystem).unwrap(); + let evs = finish(&c, op); + c.shutdown(); + let got = names(&root.at("src")); + assert!(evs.iter().any(|e| matches!(e, OpsEvent::Evt(OpEvt::Finished { result: OpResult::Done, .. }))), "{evs:?}"); + assert_eq!(bytes(a), b"made-up plan", "the original is untouched"); + assert_eq!(got.len(), 2, "the original and one copy: {got:?}"); + let copy = got.iter().find(|n| n.as_str() != "plan.txt").expect("the copy"); + assert!(copy.starts_with("plan - ") && copy.ends_with(".txt"), "named as File Explorer names it: {copy}"); + assert_eq!(bytes(root.at(&format!("src/{copy}"))), b"made-up plan"); + // Its undo would recycle the copy, never the original. + let rec = evs.iter().find_map(|e| if let OpsEvent::Undo(r) = e { Some(r.clone()) } else { None }).expect("record"); + let p = plan(OpId(99), &rec); + assert!(p.iter().all(|c| c.kind == OpKind::Recycle), "{p:?}"); + let items: Vec<_> = p.iter().flat_map(|c| c.items.clone()).collect(); + assert_eq!(items.len(), 1); + assert!(same_path(&items[0], &wp(&root.at(&format!("src/{copy}")))), "{items:?}"); +} + +/// Ctrl+C and Ctrl+V in the same folder through the window: the shell's copy beside the original. +#[test] +fn copy_and_paste_in_the_same_folder_through_the_window() { + let root = TempRoot::new("paste_same_window"); + root.file("src/notes.txt", b"made-up notes"); + let src = root.at("src"); + let mut r = open(&root, &src, &[("notes.txt", false)]); + r.select("notes.txt"); + r.h.key("Ctrl+C"); + assert_eq!(r.h.clipboard().paths, [src.join("notes.txt")]); + assert_eq!(r.h.clipboard().effect, DropEffect::Copy); + r.h.key("Ctrl+V"); + r.until("the copy", |r| r.idle() && names(&src).len() == 2); + let got = names(&src); + let copy = got.iter().find(|n| n.as_str() != "notes.txt").expect("the copy"); + assert!(copy.starts_with("notes - ") && copy.ends_with(".txt"), "{got:?}"); + assert_eq!(bytes(src.join(copy)), b"made-up notes"); + assert_eq!(bytes(src.join("notes.txt")), b"made-up notes"); + assert!(r.h.clipboard().files, "a copy leaves the clipboard as it was"); + r.shared.services.ops.shutdown(); +} + +/// Files another program copied, pasted into the open folder: copies with their bytes, the sources kept; the undo +/// entry is the copy's (its undo recycles the copies: planned here, run only in the disposable job). +#[test] +fn paste_copies_between_folders_through_the_real_host() { + let root = TempRoot::new("paste_copy"); + let notes = root.file("src/notes.txt", b"made-up notes"); + let plan_pdf = root.file("src/plan.pdf", b"made-up plan"); + root.file("src/sub/inner.txt", b"made-up inner"); + let dst = root.dir("Download"); + let mut r = open(&root, &dst, &[]); + place(&mut r, &[notes.clone(), plan_pdf.clone(), root.at("src/sub")], DropEffect::Copy); + r.h.key("Ctrl+V"); + let done = + |r: &Run| r.idle() && root.at("Download/sub/inner.txt").exists() && root.at("Download/plan.pdf").exists(); + r.until("the copy", done); + assert_eq!(bytes(root.at("Download/notes.txt")), b"made-up notes"); + assert_eq!(bytes(root.at("Download/plan.pdf")), b"made-up plan"); + assert_eq!(bytes(root.at("Download/sub/inner.txt")), b"made-up inner"); + assert!(notes.exists() && plan_pdf.exists() && root.at("src/sub/inner.txt").exists(), "the sources stay"); + r.until("the undo record", |r| r.shared.undo.borrow().len() == 1); + assert_eq!(r.shared.undo.borrow().label(UiLang::EN).as_deref(), Some("Undo Copy")); + let e = r.shared.undo.borrow_mut().pop().expect("the entry"); + assert_eq!((e.kind, e.record.kind), (OpKind::Copy, UndoKind::RecycleCopies)); + let p = plan(OpId(99), &e.record); + let items: Vec<_> = p.iter().flat_map(|c| c.items.clone()).collect(); + assert!(p.iter().all(|c| c.kind == OpKind::Recycle) && items.len() == 3, "{p:?}"); + let in_download = |i: &files_engine::listing::WidePath| i.parent().is_some_and(|d| same_path(&d, &wp(&dst))); + assert!(items.iter().all(in_download), "only the copies: {items:?}"); + assert!(r.h.clipboard().files, "a copy leaves the clipboard as it was"); + r.shared.services.ops.shutdown(); +} + +/// Ctrl+X draws the items cut; Ctrl+V in another folder moves them, empties the clipboard and ends the cut; Ctrl+Z +/// moves them back with their bytes. +#[test] +fn cut_and_paste_moves_and_its_undo_moves_back() { + let root = TempRoot::new("paste_move"); + root.file("src/notes.txt", b"made-up notes"); + root.file("src/plan.txt", b"made-up plan"); + let archive = root.dir("src/Archive"); + let src = root.at("src"); + let mut r = open(&root, &src, &[("Archive", true), ("notes.txt", false), ("plan.txt", false)]); + r.select("notes.txt"); + r.h.key("Shift+Down").key("Ctrl+X"); + r.h.render(); + assert_eq!(r.h.clipboard().paths, [src.join("notes.txt"), src.join("plan.txt")]); + assert_eq!(r.h.clipboard().effect, DropEffect::Move); + assert!(cut_drawn(&r, "notes.txt") && cut_drawn(&r, "plan.txt") && !cut_drawn(&r, "Archive")); + r.f.enumr.queue(&wp(&archive), fakes::listing(&[])); + r.select("Archive"); + r.h.key("Enter"); + r.until("the folder", |r| *r.h.screen().tabs().active().nav.location() == Location::Fs(wp(&archive))); + r.h.key("Ctrl+V"); + let moved = |r: &Run| r.idle() && names(&archive).len() == 2 && !src.join("notes.txt").exists(); + r.until("the move", moved); + assert_eq!(bytes(archive.join("notes.txt")), b"made-up notes"); + assert_eq!(bytes(archive.join("plan.txt")), b"made-up plan"); + let start = Instant::now(); + while r.h.clipboard().files { + assert!(start.elapsed() < Duration::from_secs(60), "the clipboard was not emptied"); + r.f.pump(&mut r.h, 1); + r.h.render(); + std::thread::sleep(Duration::from_millis(20)); + } + assert!(r.shared.clip.borrow().cut().is_none(), "the cut ended"); + r.until("the undo record", |r| r.shared.undo.borrow().len() == 1); + assert_eq!(r.shared.undo.borrow().label(UiLang::EN).as_deref(), Some("Undo Move")); + r.h.key("Ctrl+Z"); + r.until("the move back", |r| r.idle() && src.join("notes.txt").exists() && names(&archive).is_empty()); + assert_eq!(bytes(src.join("notes.txt")), b"made-up notes"); + assert_eq!(bytes(src.join("plan.txt")), b"made-up plan"); + assert_eq!(r.shared.undo.borrow().redo_len(), 0, "a move is not done again by Redo"); + r.shared.services.ops.shutdown(); +} + +/// What the window refuses never reaches a host: a folder into itself or into a folder inside it, the same item twice, +/// a path that is not a file-system path; a cut pasted into its own folder changes nothing. +#[test] +fn every_refusal_reaches_no_host() { + let root = TempRoot::new("paste_refusals"); + let dst = root.dir("Download"); + let inner = root.dir("Download/inner"); + let notes = root.file("Download/notes.txt", b"made-up notes"); + let other = root.file("src/plan.txt", b"made-up plan"); + let mut r = open(&root, &dst, &[("inner", true), ("notes.txt", false)]); + let cases: [(Vec, DropEffect, &str); 5] = [ + (vec![dst.clone()], DropEffect::Copy, "Can't paste Download: the destination is inside it"), + (vec![root.path().to_path_buf()], DropEffect::Move, "the destination is inside it"), + (vec![other.clone(), other.clone()], DropEffect::Copy, "Can't paste: plan.txt is on the clipboard twice"), + (vec![PathBuf::from("plan.txt")], DropEffect::Copy, "These items can't be pasted here: use File Explorer"), + (vec![notes.clone()], DropEffect::Move, ""), + ]; + for (paths, effect, says) in cases { + place(&mut r, &paths, effect); + r.h.key("Ctrl+V"); + r.h.render(); + let dump = r.h.a11y_dump(); + assert!(says.is_empty() || dump.contains(says), "{paths:?}: {dump}"); + assert!(r.shared.ops.borrow().rows().is_empty(), "{paths:?}: nothing was asked"); + } + assert_eq!(r.shared.services.ops.host_pid(), None, "no host was ever started"); + assert_eq!(names(&dst), ["inner", "notes.txt"]); + assert!(names(&inner).is_empty() && other.exists()); +} + +/// The host's own conflict policies, which no question can come from: Replace all takes the source's bytes, Skip all +/// leaves the destination as it was. (Windows' own dialog, the window's policy, runs only in the disposable job.) +#[test] +fn the_conflict_policies_of_the_host() { + let root = TempRoot::new("paste_policies"); + let a = root.file("src/notes.txt", b"new notes"); + let dst = root.dir("dst"); + root.file("dst/notes.txt", b"old notes"); + let c = client(&root); + let op = c.copy(&[ItemRef::Path(wp(&a))], &wp(&dst), Conflicts::SkipAll).unwrap(); + finish(&c, op); + assert_eq!(bytes(dst.join("notes.txt")), b"old notes", "skipped"); + let op = c.copy(&[ItemRef::Path(wp(&a))], &wp(&dst), Conflicts::ReplaceAll).unwrap(); + let evs = finish(&c, op); + assert_eq!(bytes(dst.join("notes.txt")), b"new notes", "replaced"); + let replaced = evs.iter().find_map(|e| match e { + OpsEvent::Evt(OpEvt::Finished { replaced, .. }) => Some(*replaced), + _ => None, + }); + assert_eq!(replaced, Some(1), "the undo knows it replaced one"); + assert_eq!(names(&dst), ["notes.txt"]); + c.shutdown(); +} diff --git a/apps/files/tests/real_window/mod.rs b/apps/files/tests/real_window/mod.rs new file mode 100644 index 00000000..a42876c7 --- /dev/null +++ b/apps/files/tests/real_window/mod.rs @@ -0,0 +1,159 @@ +//! The window over the real operations client and host, for the tests that prove a change on disk through the +//! window's own seam: the listing comes from the fake enumerator, every change goes through ops_ui::request to a +//! files.exe --role=ops of this build, fenced to the roots the test names (FILES_TEST_ROOT). +#![allow(dead_code)] + +use std::rc::Rc; +use std::time::{Duration, Instant}; + +use files_engine::fakes::{self, Fakes, FT_2026_11_21}; +use files_engine::format::Fmt; +use files_engine::host::TestHooks; +use files_engine::listing::WidePath; +use files_engine::ops_client::{OpsClient, OpsConfig, OpsError, OpsEvent, UndoRecord}; +use files_engine::services::OpsService; +use files_engine::session::Session; +use files_engine::types::TypeNames; +use files_engine::window::{FilesScreen, Shared, WinKind, WinRec}; +use oled_trust::frame::files::{Conflicts, ItemRef, Location, OpId}; +use oled_ui::harness::Harness; +use oled_ui::{SizeL, Tokens, UiLang}; + +use super::common; +use super::common::temp::TempRoot; + +/// The real client behind the window's seam. +pub struct RealOps(pub OpsClient); + +impl OpsService for RealOps { + fn copy(&self, items: &[ItemRef], dest: &WidePath) -> Result { + self.0.copy(items, dest, Conflicts::AskSystem) + } + fn move_to(&self, items: &[ItemRef], dest: &WidePath) -> Result { + self.0.move_to(items, dest, Conflicts::AskSystem) + } + fn recycle(&self, items: &[ItemRef]) -> Result { + self.0.recycle(items) + } + fn delete_permanent(&self, items: &[ItemRef]) -> Result { + self.0.delete_permanent(items) + } + fn rename(&self, item: &WidePath, to: &str) -> Result { + self.0.rename(item, to) + } + fn new_folder(&self, parent: &WidePath, name: &str) -> Result { + self.0.new_folder(parent, name) + } + fn undo(&self, rec: &UndoRecord) -> Result { + self.0.undo(rec) + } + fn resume_rest(&self, of: OpId) -> Result { + self.0.resume_rest(of) + } + fn cancel(&self, op: OpId) { + self.0.cancel(op) + } + fn pause(&self, op: OpId, on: bool) { + self.0.pause(op, on) + } + fn bring_forward(&self, op: OpId) { + self.0.bring_forward(op) + } + fn ack_done(&self, of: OpId) { + self.0.ack_done(of) + } + fn host_pid(&self) -> Option { + self.0.host_pid() + } + fn drain(&self) -> Vec { + self.0.drain() + } + fn shutdown(&self) { + self.0.shutdown() + } +} + +pub struct Run { + pub f: Fakes, + pub shared: Rc, + pub h: Harness, +} + +/// A window over `dir` listing `entries` (name, is a folder), with the real client: its host keeps its data in +/// `data` and is fenced to `fence` (a FILES_TEST_ROOT list); `no_ui` adds FOF_NOERRORUI to every operation (the +/// local tests), else the host runs with the production flags (the disposable job). +pub fn window(data: &TempRoot, dir: &WidePath, entries: &[(&str, bool)], fence: &str, no_ui: bool) -> Run { + let f = Fakes::new(); + let rows: Vec<(&str, bool, u64, i64)> = entries.iter().map(|&(n, d)| (n, d, 100, FT_2026_11_21)).collect(); + f.enumr.queue(dir, fakes::listing(&rows)); + let mut env = common::hooks(data).env; + env.retain(|(k, _)| !matches!(&**k, "FILES_TEST_ROOT" | "FILES_DATA_DIR" | "FILES_TEST_NO_UI")); + if no_ui { + env.push(("FILES_TEST_NO_UI".into(), "1".into())); + } + env.push(("FILES_TEST_ROOT".into(), fence.into())); + let hooks = TestHooks { pipe_tag: Some(common::test_tag()), build_tag: None, env }; + let cfg = OpsConfig { exe: common::files_exe(), data_dir: data.at("data"), owner: 0, test: Some(hooks) }; + let mut services = f.services(); + services.ops = Rc::new(RealOps(OpsClient::new(cfg, f.hub.notifier()))); + let shared = + Shared::new(std::sync::Arc::clone(&f.hub), services, UiLang::EN, Session::default(), TypeNames::empty()); + *shared.fmt.borrow_mut() = Rc::new(Fmt::fixed_en()); + assert_eq!(shared.new_win(), 1); + let at = Location::Fs(dir.clone()); + shared.windows.borrow_mut().push(WinRec { + win: 1, + kind: WinKind::Main, + wref: None, + hwnd: None, + location: Some(at.clone()), + }); + let tab = shared.new_tab(); + let screen = FilesScreen::new(Rc::clone(&shared), 1, at, None, tab); + let mut h = Harness::new(screen, SizeL { w: 800, h: 500 }, 96, Tokens::oled()); + h.render(); + f.pump(&mut h, 1); + h.render(); + Run { f, shared, h } +} + +impl Run { + /// Pumps until the condition holds (the real helper answers on its own thread). + pub fn until(&mut self, what: &str, mut ok: impl FnMut(&Run) -> bool) { + let start = Instant::now(); + loop { + self.f.pump(&mut self.h, 1); + self.h.render(); + if ok(self) { + return; + } + assert!(start.elapsed() < Duration::from_secs(60), "{what}: not within 60 s\n{}", self.h.a11y_dump()); + std::thread::sleep(Duration::from_millis(20)); + } + } + + /// Selects the row named `name` alone (Home, then Down until it is the focused one). + pub fn select(&mut self, name: &str) { + self.h.key("Home"); + for _ in 0..64 { + let t = &self.h.screen().tabs().active().table; + let focused = t.focused().and_then(|k| oled_ui::model::ListModel::row_of(t.model(), k)); + let label = focused.map(|r| oled_ui::model::ListModel::label(t.model(), r).to_string()); + if label.as_deref() == Some(name) { + break; + } + self.h.key("Down"); + } + self.h.render(); + } + + /// No operation runs and none waits. + pub fn idle(&self) -> bool { + self.shared.ops.borrow().running() == 0 + } +} + +/// A path's child. +pub fn child(dir: &WidePath, name: &str) -> WidePath { + dir.join(&name.encode_utf16().collect::>()).unwrap() +} diff --git a/apps/files/tests/store_bench.rs b/apps/files/tests/store_bench.rs index 40671a51..e2a14f59 100644 --- a/apps/files/tests/store_bench.rs +++ b/apps/files/tests/store_bench.rs @@ -117,6 +117,25 @@ fn bench_filter_100k() { let q = FilterQuery { text: "7".into() }; let ms = median((0..5).map(|_| ms_of(&mut || assert!(!s.filter(&q, Gen(1)).0.is_empty()))).collect()); println!("bench: files filter_100k {ms:.1} ms"); + // The window's own use: an accented query (folded to ASCII) and the view filter with a family, on the same store. + let accented = FilterQuery { text: "7\u{e9}".into() }; + let ms_accent = median((0..5).map(|_| ms_of(&mut || drop(s.filter(&accented, Gen(1))))).collect()); + println!("bench: files filter_100k accented {ms_accent:.1} ms"); + assert!(ms_accent <= 16.0 * slack(), "median {ms_accent} ms over the recorded 16 ms"); + let mut view = big_store(); + let ms_view = median( + (0..5) + .map(|i| { + let q = files_engine::listing::ViewFilter { + query: if i % 2 == 0 { "7".into() } else { "8".into() }, + families: Default::default(), + }; + ms_of(&mut || view.set_view_filter(q.clone())) + }) + .collect(), + ); + println!("bench: files filter_100k view {ms_view:.1} ms"); + assert!(ms_view <= 50.0 * slack(), "median {ms_view} ms over the 50 ms of a sort"); // Recorded only: the gate of the filter belongs to the window's frame budget (budget row files.filter_100k). assert!(ms <= 16.0 * slack(), "median {ms} ms over the recorded 16 ms"); } diff --git a/apps/files/tests/ui_details.rs b/apps/files/tests/ui_details.rs new file mode 100644 index 00000000..e58898f6 --- /dev/null +++ b/apps/files/tests/ui_details.rs @@ -0,0 +1,198 @@ +//! The details pane: its facts in both languages, the Windows icon asked at 48 logical px and never enlarged, the +//! switch (saved choice, hidden by itself in a narrow window) and the keyboard. + +mod common; + +use std::rc::Rc; + +use files_engine::details_pane::{Buttons, ICON_PX}; +use files_engine::fakes::Fakes; +use files_engine::format::Fmt; +use files_engine::options::FilesOptions; +use files_engine::preview::fixtures::{self, settle, ROOT}; +use files_engine::shell_client::ShellReply; +use files_engine::window::FilesScreen; +use oled_trust::frame::files::{ItemRef, Pixels, ShellEvt, ShellReq, Verb}; +use oled_ui::harness::Harness; +use oled_ui::{PointL, SizeL, Tokens, UiLang}; + +const WIDE: SizeL = SizeL { w: 1280, h: 720 }; + +/// Rows of fixtures::documents(): 0 invoices, 1 link-to-projects, 2 projects, 3 contract..., 4 notes.txt, 5 photos-raw.zip, +/// 6 report-final-v2.pdf, 7 report-final-v3.pdf, 8 setup-tool-1.4.2.exe. +fn window(lang: UiLang, size: SizeL, dpi: u32, opts: Option) -> (Fakes, Harness) { + let f = Fakes::new(); + if let Some(o) = opts { + f.options.set(o); + } + f.enumr.queue(&fixtures::wp(ROOT), fixtures::documents()); + let fmt = if lang == UiLang::IT { Fmt::fixed_it() } else { Fmt::fixed_en() }; + let s = fixtures::open(&f, fmt, ROOT); + let mut h = Harness::new(s, size, dpi, Tokens::oled()).lang(if lang == UiLang::IT { + oled_ui::Lang::It + } else { + oled_ui::Lang::En + }); + settle(&mut h, &f); + (f, h) +} + +fn pick(h: &mut Harness, n: usize) { + h.key("Home"); + for _ in 0..n { + h.key("Down"); + } + h.render(); +} + +fn facts(h: &Harness) -> Vec<(String, String)> { + h.screen().pane().content().expect("the pane is on").facts.clone() +} + +fn icon_reqs(f: &Fakes) -> Vec<(oled_trust::frame::files::ReqId, oled_trust::frame::files::Gen, Vec, u16)> { + f.shell + .requests() + .into_iter() + .filter_map(|r| match r { + ShellReq::Icons { req, gen, items, px } => Some((req, gen, items, px)), + _ => None, + }) + .collect() +} + +fn square(side: u16) -> Pixels { + let n = usize::from(side) * usize::from(side); + Pixels { w: side, h: side, bgra: vec![200u8; n * 4].into_boxed_slice() } +} + +#[test] +fn a_file_shows_its_facts_in_english_and_italian() { + let (_f, mut h) = window(UiLang::EN, WIDE, 96, None); + pick(&mut h, 7); + let c = h.screen().pane().content().expect("on at 1280").clone(); + assert_eq!((c.title.as_str(), c.buttons), ("report-final-v3.pdf", Buttons::File)); + let keys: Vec<&str> = c.facts.iter().map(|r| r.0.as_str()).collect(); + assert_eq!(keys, ["Size", "Last modified", "Created", "Folder", "Attributes"]); + assert_eq!((c.facts[3].1.as_str(), c.facts[4].1.as_str()), ("documents", "None")); + let (_f, mut h) = window(UiLang::IT, WIDE, 96, None); + pick(&mut h, 7); + let keys: Vec = facts(&h).into_iter().map(|r| r.0).collect(); + assert_eq!(keys, ["Dimensione", "Ultima modifica", "Creato", "Cartella", "Attributi"]); + assert_eq!(facts(&h)[4].1, "Nessuno"); +} + +#[test] +fn a_folder_nothing_and_several_items() { + let (_f, mut h) = window(UiLang::IT, WIDE, 96, None); + pick(&mut h, 2); + let c = h.screen().pane().content().unwrap().clone(); + assert_eq!((c.title.as_str(), c.kind.as_str(), c.buttons), ("projects", "Cartella", Buttons::Folder)); + h.key("Ctrl+Shift+A"); + h.render(); + let c = h.screen().pane().content().unwrap().clone(); + assert_eq!((c.title.as_str(), c.buttons), ("documents", Buttons::None), "the open folder itself"); + assert_eq!(c.facts[0], ("Elementi".to_string(), "9".to_string())); + pick(&mut h, 2); + h.key("Shift+Down").key("Shift+Down"); + h.render(); + let c = h.screen().pane().content().unwrap().clone(); + assert_eq!(c.title, "3 elementi selezionati"); + assert!(c.facts[0].1.ends_with(", più 1 cartella"), "{:?}", c.facts); + assert_eq!(c.facts[1].0, "Tipi"); + assert_eq!(c.buttons, Buttons::None); +} + +#[test] +fn a_program_asks_for_its_icon_at_48_logical_px_and_never_draws_it_larger() { + // (dpi, side the host answers with as a share of the asked size, side drawn as a share). + for (dpi, want) in [(96u32, 48u16), (144, 72), (192, 96)] { + for (got, drawn) in [(want * 2, want), (want, want), (want / 2, want / 2)] { + let (f, mut h) = window(UiLang::EN, WIDE, dpi, None); + let shared = Rc::clone(h.screen().shared()); + shared.first_frame_done.set(true); + shared.host_warm.set(true); + pick(&mut h, 8); + h.key("Up").key("Down"); + let path = ItemRef::Path(fixtures::wp(&format!(r"{ROOT}\setup-tool-1.4.2.exe"))); + let asked: Vec<_> = icon_reqs(&f).into_iter().filter(|r| r.2 == [path.clone()] && r.3 == want).collect(); + assert_eq!(asked.len(), 1, "one request for the pane at {want} px: {:?}", icon_reqs(&f)); + assert_eq!(i32::from(want), (ICON_PX * dpi as i32 + 48) / 96, "48 logical px exactly"); + let (req, gen, ..) = asked[0].clone(); + f.shell.reply(ShellReply::Evt(ShellEvt::Icon { req, gen, index: 0, px: square(got) })); + f.pump(&mut h, 1); + h.render(); + assert_eq!(h.screen().pane().icon_side(), u32::from(drawn), "dpi {dpi}: came {got}, drawn {drawn}"); + h.key("Up").key("Down"); + let again = icon_reqs(&f).into_iter().filter(|r| r.2 == [path.clone()] && r.3 == want).count(); + assert_eq!(again, 1, "asked once per item"); + } + } +} + +#[test] +fn the_pane_is_a_saved_choice_and_hides_by_itself_in_a_narrow_window() { + let (f, mut h) = window(UiLang::EN, WIDE, 96, None); + assert!(h.screen().pane().shown()); + h.key("Alt+Shift+P"); + h.render(); + assert!(!h.screen().pane().shown(), "switched off"); + assert!(!f.options.modifications().last().expect("saved").details_pane); + h.key("Alt+Shift+P"); + h.render(); + assert!(h.screen().pane().shown()); + assert!(f.options.modifications().last().unwrap().details_pane); + // 959 logical px: hidden, the saved choice is untouched. + let (f, mut h) = window(UiLang::EN, SizeL { w: 959, h: 600 }, 96, None); + pick(&mut h, 1); + assert!(!h.screen().pane().shown()); + assert!(h.screen().shared().opts.borrow().details_pane, "the saved choice stays on"); + assert!(f.options.modifications().is_empty()); + let (_f, h) = window(UiLang::EN, SizeL { w: 960, h: 600 }, 96, None); + assert!(h.screen().pane().shown(), "960 is wide enough"); + let (_f, h) = window(UiLang::EN, WIDE, 96, Some(FilesOptions { details_pane: false, ..FilesOptions::default() })); + assert!(!h.screen().pane().shown(), "saved off"); +} + +#[test] +fn f6_reaches_the_pane_and_its_buttons_open() { + let (f, mut h) = window(UiLang::EN, WIDE, 96, None); + pick(&mut h, 4); + h.key("F6"); + h.render(); + assert_eq!(h.focused(), h.screen().pane().focus_node(), "F6 from the list goes to the pane"); + h.key("Enter"); + let execs: Vec<_> = f + .shell + .requests() + .into_iter() + .filter_map(|r| match r { + ShellReq::Exec { verb, items, .. } => Some((verb, items)), + _ => None, + }) + .collect(); + assert_eq!(execs.len(), 1, "{execs:?}"); + assert_eq!(execs[0].0, Verb::Open); + // Open with is the system's own choice. + let (_, second) = h.screen().pane().button_rects(); + h.click(PointL { x: (second.l + second.r) / 2, y: (second.t + second.b) / 2 }); + let verbs: Vec = f + .shell + .requests() + .into_iter() + .filter_map(|r| match r { + ShellReq::Exec { verb, .. } => Some(verb), + _ => None, + }) + .collect(); + assert_eq!(verbs, [Verb::Open, Verb::OpenWith]); +} + +#[test] +fn the_details_button_is_on_while_the_pane_shows() { + let (_f, h) = window(UiLang::EN, WIDE, 96, None); + let dump = h.a11y_dump(); + assert!(dump.contains("Details"), "{dump}"); + let id = oled_ui::CommandId(files_engine::keys::Cmd::DetailsPane as u32); + let r = h.screen().toolbar().bar().rect_of(id).expect("never folded"); + assert!(r.l > WIDE.w / 2, "at the right end of the bar: {r:?}"); +} diff --git a/apps/files/tests/ui_f1a.rs b/apps/files/tests/ui_f1a.rs index 10fc0540..03d13b27 100644 --- a/apps/files/tests/ui_f1a.rs +++ b/apps/files/tests/ui_f1a.rs @@ -31,8 +31,8 @@ use std::cell::Cell; use std::rc::Rc; use std::sync::Arc; -/// The tab row the harness gives a system-caption window (TAB_ROW_H), above the toolbar. -const CHROME_H: i32 = 36; +/// The tab row the harness gives a system-caption window (TAB_ROW_H), above the address row and the command bar. +const CHROME_H: i32 = 38; fn wp(s: &str) -> WidePath { WidePath::parse(s).unwrap() @@ -278,7 +278,7 @@ fn sort_click_sorts_with_folders_first() { let mut w = folder_window(); assert_eq!(w.labels(), ["invoices", "projects", "notes.txt", "photos-raw.zip", "report-final-v2.pdf"]); // The Size header sits near the right end of the header row, under the toolbar. - w.h.click(PointL { x: 770, y: CHROME_H + 44 + 16 }); + w.h.click(PointL { x: 770, y: CHROME_H + 88 + 16 }); w.h.render(); let t = w.fs().tabs().active(); assert_eq!(t.sort.0, files_engine::model::ColKind::Size); @@ -288,7 +288,7 @@ fn sort_click_sorts_with_folders_first() { let l = w.labels(); assert_eq!(l[2..], ["photos-raw.zip", "report-final-v2.pdf", "notes.txt"]); assert!(l[..2].contains(&"invoices".to_string()) && l[..2].contains(&"projects".to_string()), "{l:?}"); - w.h.click(PointL { x: 770, y: CHROME_H + 44 + 16 }); + w.h.click(PointL { x: 770, y: CHROME_H + 88 + 16 }); w.h.render(); assert_eq!(w.labels()[2..], ["notes.txt", "report-final-v2.pdf", "photos-raw.zip"], "the second click reverses it"); } @@ -304,7 +304,7 @@ fn big_sort_runs_off_thread() { (10_000..10_020).map(|r| m.label(r).to_string()).collect() }; let before = sample(&w); - w.h.click(PointL { x: 770, y: CHROME_H + 44 + 16 }); + w.h.click(PointL { x: 770, y: CHROME_H + 88 + 16 }); assert_eq!(w.f.bg.queued(), 1, "the sort is a background job"); assert_eq!(sample(&w), before, "the old order stays until Sorted"); w.pump(); @@ -470,7 +470,7 @@ fn downloads_default_sort_is_not_carried_to_other_folders() { w.pump(); assert_eq!(w.fs().tabs().active().sort, (ColKind::Name, SortDir::Asc), "another folder sorts by name again"); // A sort the user picked stays with the tab. - w.h.click(PointL { x: 770, y: CHROME_H + 44 + 16 }); + w.h.click(PointL { x: 770, y: CHROME_H + 88 + 16 }); w.f.enumr.queue(&wp(r"C:\mod-made-up\dl"), fakes::listing(&reports())); w.do_op(Op::Go(Location::Fs(wp(r"C:\mod-made-up\dl")))); w.pump(); @@ -525,8 +525,8 @@ fn regions_cycle_with_f6() { w.h.key("Tab"); } assert!(!in_table(&w), "the focus left the list"); - // With the sidebar showing, F6 goes to it first, then to the list. - for _ in 0..2 { + // With the sidebar showing, F6 visits the address row, the command bar, the sidebar and the list. + for _ in 0..5 { if !in_table(&w) { w.h.key("F6"); } @@ -612,7 +612,7 @@ fn state_denied_has_its_two_buttons_and_back_goes_back() { let mut w = window_over(f, r"C:\mod-made-up\reports"); w.h.key("Home").key("Enter"); w.pump(); - assert!(has_label(&w, "You don't have permission to open this folder."), "{}", dump(&w)); + assert!(has_label(&w, "You don't have access to this folder"), "{}", dump(&w)); assert!(has_button(&w, "Open in File Explorer") && has_button(&w, "Back"), "{}", dump(&w)); w.h.assert_named(); // Open in File Explorer hands the folder to the shell host (F2.1). @@ -635,14 +635,14 @@ fn state_denied_has_its_two_buttons_and_back_goes_back() { #[test] fn state_offline_retry_navigates_again() { let mut w = window_failing(EnumError::Offline { waited_ms: 4_000 }); - assert!(has_label(&w, r"C:\mod-made-up\locked isn't reachable"), "{}", dump(&w)); - assert!(has_button(&w, "Retry (F5)") && has_button(&w, "Open in File Explorer"), "{}", dump(&w)); + assert!(has_label(&w, "The drive isn't reachable"), "{}", dump(&w)); + assert!(has_button(&w, "Retry") && !has_button(&w, "Open in File Explorer"), "{}", dump(&w)); w.h.assert_named(); w.f.enumr.queue(&wp(r"C:\mod-made-up\locked"), fakes::listing(&reports())); press(&mut w, states::ID_FIRST); w.pump(); assert_eq!(rows(&w), 5, "Retry listed the folder again"); - assert!(!has_button(&w, "Retry (F5)")); + assert!(!has_button(&w, "Retry")); } #[test] @@ -672,11 +672,11 @@ fn status_counts_and_selection_size() { assert!(!has_selection_part(&w), "nothing is selected: no selection part"); // Two folders: counted, no size. w.h.key("Home").key("Shift+Down"); - assert!(has_label(&w, " \u{b7} 2 selected"), "{}", dump(&w)); + assert!(has_label(&w, "2 selected"), "{}", dump(&w)); // Everything: the size sums the files only. w.h.key("Ctrl+A"); let size = w.shared.fmt.borrow().size(1_200 + 3_400_000 + 90_000_000, false); - assert!(has_label(&w, &format!(" \u{b7} 5 selected \u{b7} {size}")), "{}", dump(&w)); + assert!(has_label(&w, &format!("5 selected, {size}")), "{}", dump(&w)); w.h.key("Ctrl+Shift+A"); assert!(!has_selection_part(&w)); // A new arrival changes the count without any key. @@ -700,7 +700,9 @@ fn free_space_requested_once_per_navigation() { let root = wp(r"C:\mod-made-up\reports"); w.h.send(Box::new(Msg::Job { win: 1, done: JobDone::FreeSpace { root, free: Some(5_000_000_000), total: None } })); let free = w.shared.fmt.borrow().size(5_000_000_000, false); - assert!(has_label(&w, &format!("{free} free")), "{}", dump(&w)); + // The drive block reads the volume's own answer and the drive's size from the cache. + let total = w.shared.fmt.borrow().size(1_990_000_000_000, false); + assert!(has_label(&w, &format!("{free} free of {total}")), "{}", dump(&w)); // An answer for a folder the tab left is not shown. w.f.enumr.queue(&wp(r"C:\mod-made-up\reports"), fakes::listing(&reports())); w.h.key("F5"); @@ -711,17 +713,21 @@ fn free_space_requested_once_per_navigation() { done: JobDone::FreeSpace { root: wp(r"D:\elsewhere"), free: Some(1_000_000_000), total: None }, })); let other = w.shared.fmt.borrow().size(1_000_000_000, false); - assert!(!has_label(&w, &format!("{other} free"))); + assert!(!has_label(&w, &format!("{other} free of {total}"))); // Once the disk answered for this folder and the tab moves on, the old number is gone until the new answer. w.h.send(Box::new(Msg::Job { win: 1, done: JobDone::FreeSpace { root: wp(r"C:\mod-made-up\reports"), free: Some(5_000_000_000), total: None }, })); - assert!(has_label(&w, &format!("{free} free")), "{}", dump(&w)); + assert!(has_label(&w, &format!("{free} free of {total}")), "{}", dump(&w)); w.h.key("Home").key("Enter"); w.pump(); assert!(here(&w).ends_with("invoices"), "{}", here(&w)); - assert!(!has_label(&w, &format!("{free} free")), "the old volume's space under the new folder: {}", dump(&w)); + assert!( + !has_label(&w, &format!("{free} free of {total}")), + "the old volume's space under the new folder: {}", + dump(&w) + ); } #[test] @@ -1079,7 +1085,7 @@ fn lang_switch_rebuilds_labels() { assert!(has_label(&w, "5 elementi"), "the status line follows: {d}"); assert_eq!(label(&w).as_deref(), Some("Indietro"), "the command table is rebuilt"); // Widths and the sort the user chose stay. - w.h.click(PointL { x: 770, y: CHROME_H + 44 + 16 }); + w.h.click(PointL { x: 770, y: CHROME_H + 88 + 16 }); let sorted = w.fs().tabs().active().sort; w.shared.lang.set(UiLang::EN); w.h.send(Box::new(Msg::Lang)); diff --git a/apps/files/tests/ui_f1b.rs b/apps/files/tests/ui_f1b.rs index b450dc36..94e49731 100644 --- a/apps/files/tests/ui_f1b.rs +++ b/apps/files/tests/ui_f1b.rs @@ -14,7 +14,7 @@ use oled_ui::model::ListModel; use oled_ui::{CaptionHit, PointP, Scale, SizeL, Tokens, UiLang}; /// The tab row the harness gives a system-caption window (TAB_ROW_H). -const ROW_H: i32 = 36; +const ROW_H: i32 = 38; const DIR: &str = r"C:\mod-made-up\reports"; fn wp(s: &str) -> WidePath { @@ -106,10 +106,10 @@ fn strip_and_row_geometry() { let beta = c.beta.expect("the Beta label while the stage is beta"); assert_eq!(beta.r, b.l - px(12), "{dpi}"); assert!(c.tabs.r <= beta.l && c.tabs.l == 0 && c.tabs.h() == px(40), "{dpi}: {c:?}"); - // System: Windows' caption stays; the row is 36 px, no label, no buttons. + // System: Windows' caption stays; the row is 38 px, no label, no buttons. let s = chrome::rects(Caption::System, w, sc); - assert_eq!(s.strip, oled_ui::RectP::wh(0, 0, w, px(36)), "{dpi}"); - assert_eq!((s.tabs, s.beta, s.buttons, s.below), (s.strip, None, None, px(36)), "{dpi}"); + assert_eq!(s.strip, oled_ui::RectP::wh(0, 0, w, px(38)), "{dpi}"); + assert_eq!((s.tabs, s.beta, s.buttons, s.below), (s.strip, None, None, px(38)), "{dpi}"); } } diff --git a/apps/files/tests/ui_icons.rs b/apps/files/tests/ui_icons.rs new file mode 100644 index 00000000..f774a805 --- /dev/null +++ b/apps/files/tests/ui_icons.rs @@ -0,0 +1,263 @@ +//! Icons in the window (spec 4.5): every row, tab, sidebar entry and Home item draws an icon from its first frame; +//! folders never ask the shell; known folders are matched by path; shortcuts are asked of the host only from a local +//! folder. Plain tests over the fakes through the kit's Harness: no window, no host, no file system. + +use std::rc::Rc; + +use files_engine::fakes::{self, Fakes, FT_2026_11_21}; +use files_engine::home; +use files_engine::icons::location_art; +use files_engine::knownfolders::{KnownFolders, KnownName}; +use files_engine::listing::WidePath; +use files_engine::nav::Page; +use files_engine::preview::{self, Cells}; +use files_engine::sidebar; +use files_engine::tab; +use files_engine::window::FilesScreen; +use oled_trust::frame::files::{CallKind, ItemRef, Location, ShellReq}; +use oled_ui::art::Art; +use oled_ui::harness::Harness; +use oled_ui::model::{CellOut, ColId, ListModel, TableModel}; +use oled_ui::{SizeL, Tokens, UiLang}; + +fn wp(s: &str) -> WidePath { + WidePath::parse(s).expect("a made-up path parses") +} + +fn day(n: i64) -> i64 { + FT_2026_11_21 - n * 864_000_000_000 +} + +/// A window of the fakes at `dir` (its listing queued), with `known`, shown for a second (the host warmed up). +fn window(f: &Fakes, dir: &str, rows: &[(&str, bool, u64, i64)], known: KnownFolders) -> Harness { + f.enumr.queue(&wp(dir), fakes::listing(rows)); + let shared = f.shared(UiLang::EN); + *shared.known.borrow_mut() = Rc::new(known); + let t = shared.new_tab(); + let s = FilesScreen::new(shared, 1, Location::Fs(wp(dir)), None, t); + let mut h = Harness::new(s, SizeL { w: 900, h: 600 }, 96, Tokens::oled()); + h.render(); + f.pump(&mut h, 1); + h.render(); + h.advance(1_000); + f.pump(&mut h, 1); + h.render(); + h +} + +fn no_known() -> KnownFolders { + KnownFolders::new(Vec::new(), Some(b'C')) +} + +fn icon_reqs(f: &Fakes) -> Vec> { + f.shell + .requests() + .into_iter() + .filter_map(|r| match r { + ShellReq::Icons { items, .. } => Some(items), + _ => None, + }) + .collect() +} + +fn art_of(h: &Harness, name: &str) -> Option { + let m = h.screen().tabs().active().table.model(); + let row = (0..ListModel::len(m)).find(|r| m.label(*r) == name).expect("the row is listed"); + m.art_of(row) +} + +/// What every scene and cell must hold: each visible row draws an icon (art or a Windows icon), each tab its art and +/// each sidebar entry art or a glyph. Returns how many of each it checked. +fn scan(h: &Harness, what: &str) -> (usize, usize, usize) { + let s = h.screen(); + let mut rows = 0; + if *s.tabs().active().nav.page() != Page::Home { + let table = &s.tabs().active().table; + let m = table.model(); + let px = i32::try_from(s.art().key().small).unwrap_or(16); + let mut out = CellOut::default(); + for row in table.visible_rows().filter(|r| *r < ListModel::len(m)) { + m.cell(row, ColId(0), &mut out); + let icon = out.icon.unwrap_or_else(|| panic!("{what}: row {row} has no icon")); + let bmp = m.icon(icon, px).unwrap_or_else(|| panic!("{what}: row {row}'s icon draws nothing")); + assert!(bmp.width > 0 && bmp.pixels.iter().any(|p| p >> 24 != 0), "{what}: row {row} is blank"); + rows += 1; + } + } + let specs = tab::specs_of(s, UiLang::EN); + for t in &specs { + let icon = t.icon.as_ref().unwrap_or_else(|| panic!("{what}: tab {} has no icon", t.label)); + assert!(icon.pixels.iter().any(|p| p >> 24 != 0), "{what}: tab {} is blank", t.label); + } + let entries = sidebar::of(s).shown_items(); + for e in entries.iter().filter(|e| !e.section) { + assert!(e.art || e.glyph, "{what}: sidebar entry {} has no icon", e.key); + } + (rows, specs.len(), entries.len()) +} + +#[test] +fn no_row_tab_or_sidebar_entry_without_an_icon_in_any_scene() { + let (mut rows, mut tabs, mut entries) = (0, 0, 0); + for s in preview::scenes() { + for c in preview::cells(s.cells) { + let fakes = Fakes::new(); + let mut h = preview::harness(&s, &c, &fakes); + h.render(); + let (r, t, e) = scan(&h, &format!("{} {}", s.name, c.tag)); + (rows, tabs, entries) = (rows + r, tabs + t, entries + e); + } + } + assert!(rows > 1_000 && tabs > 100 && entries > 100, "the sweep saw {rows} rows, {tabs} tabs, {entries} entries"); +} + +#[test] +fn the_first_frame_already_draws_the_art() { + let f = Fakes::new(); + f.enumr.queue(&wp(r"C:\made-up\docs"), fakes::listing(&[("sub", true, 0, day(1)), ("a.pdf", false, 9, day(1))])); + let shared = f.shared(UiLang::EN); + let t = shared.new_tab(); + let s = FilesScreen::new(shared, 1, Location::Fs(wp(r"C:\made-up\docs")), None, t); + let mut h = Harness::new(s, SizeL { w: 900, h: 600 }, 144, Tokens::oled()); + h.render(); + f.pump(&mut h, 1); + h.render(); + // No host has answered and the class icons are pending: the art is there. + assert!(icon_reqs(&f).is_empty(), "{:?}", f.shell.requests()); + let (rows, tabs, _) = scan(&h, "first frame"); + assert_eq!((rows, tabs), (2, 1)); + assert_eq!(art_of(&h, "sub"), Some(Art::Folder)); + assert_eq!(art_of(&h, "a.pdf"), Some(Art::File(oled_ui::art::Family::Pdf))); + assert_eq!(h.screen().art().key().small, 24, "the book follows the window's DPI"); +} + +#[test] +fn folders_never_ask_the_shell() { + let f = Fakes::new(); + let rows = [("Downloads", true, 0, day(1)), ("photos.2024", true, 0, day(2)), ("tools.exe", true, 0, day(3))]; + let h = window(&f, r"C:\made-up\folders", &rows, no_known()); + assert!(icon_reqs(&f).is_empty(), "a folder's icon is never asked: {:?}", f.shell.requests()); + assert!(f.icons.noted().is_empty(), "nor its class icon: {:?}", f.icons.noted()); + for (name, ..) in rows { + assert_eq!(art_of(&h, name), Some(Art::Folder), "{name}"); + } +} + +#[test] +fn known_folders_by_path_in_the_list_the_tabs_and_home() { + let f = Fakes::new(); + let known = KnownFolders::new( + vec![ + (KnownName::Downloads, wp(r"C:\Users\made-up\Downloads")), + (KnownName::Music, wp(r"C:\Users\made-up\Music")), + ], + Some(b'C'), + ); + let rows = [("Downloads", true, 0, day(1)), ("Music", true, 0, day(1)), ("Videos", true, 0, day(1))]; + let mut h = window(&f, r"C:\Users\made-up", &rows, known.clone()); + assert_eq!(art_of(&h, "Downloads"), Some(Art::Downloads)); + assert_eq!(art_of(&h, "Music"), Some(Art::Music)); + assert_eq!(art_of(&h, "Videos"), Some(Art::Folder), "not a known folder of this user"); + // A folder named Downloads elsewhere is a plain folder, in the list and in its tab. + let f2 = Fakes::new(); + let h2 = window(&f2, r"D:\made-up", &[("Downloads", true, 0, day(1))], known.clone()); + assert_eq!(art_of(&h2, "Downloads"), Some(Art::Folder)); + let drives = h.screen().shared().drives.borrow().all().to_vec(); + let elsewhere = Location::Fs(wp(r"D:\made-up\Downloads")); + assert_eq!(location_art(&elsewhere, &known, &drives), Art::Folder); + // A new tab at the known folder takes its art from creation. + let shared = Rc::clone(h.screen().shared()); + let at = Location::Fs(wp(r"C:\Users\made-up\Downloads")); + h.screen_mut().tabs_mut().open(tab::new_tab(&shared, 1, at.clone()), false); + let specs = tab::specs_of(h.screen(), UiLang::EN); + assert_eq!(specs.len(), 2); + assert!(specs.iter().all(|s| s.icon.is_some()), "every tab has its art, the new one too"); + assert_eq!(location_art(&at, &known, &drives), Art::Downloads); + // Home's pinned known folder draws its art. + let f3 = Fakes::new(); + f3.options.set(files_engine::options::FilesOptions { + pins: vec![r"C:\Users\made-up\Downloads".into()], + ..files_engine::options::FilesOptions::default() + }); + let h3 = window(&f3, r"C:\made-up", &[("a.txt", false, 1, day(1))], known); + let items = home::content(h3.screen()); + assert!(items.iter().any(|i| i.art == Art::Downloads), "{:?}", items.iter().map(|i| i.art).collect::>()); + assert!(items.iter().any(|i| i.art == Art::RecycleBin) && items.iter().any(|i| i.art == Art::DriveSystem)); +} + +#[test] +fn a_fresh_read_of_the_known_folders_reaches_the_rows() { + let f = Fakes::new(); + let mut h = window(&f, r"C:\Users\made-up", &[("Pictures", true, 0, day(1))], no_known()); + assert_eq!(art_of(&h, "Pictures"), Some(Art::Folder)); + let list = vec![(KnownName::Pictures, wp(r"C:\Users\made-up\Pictures"))]; + h.send(Box::new(files_engine::msg::Msg::Job { win: 1, done: files_engine::msg::JobDone::KnownFolders(list) })); + f.pump(&mut h, 1); + h.render(); + assert_eq!(art_of(&h, "Pictures"), Some(Art::Pictures)); + let session = h.screen().shared().session.borrow().known.get("pictures").cloned(); + assert_eq!(session.as_deref(), Some(r"C:\Users\made-up\Pictures"), "kept for the next start's first frame"); +} + +/// Shortcuts: a local one is asked of the host (which reads it without resolving it); one on a share, a URL file and +/// a shortcut that is a link are not. +#[test] +fn shortcuts_are_asked_only_from_a_local_folder() { + let f = Fakes::new(); + let rows = [("a.lnk", false, 10, day(1)), ("b.url", false, 10, day(1)), ("c.txt", false, 10, day(1))]; + f.enumr.queue(&wp(r"C:\made-up\links"), fakes::listing(&rows)); + let h = window_queued(&f, r"C:\made-up\links"); + let asked: Vec = icon_reqs(&f).into_iter().flatten().collect(); + assert_eq!(asked, [ItemRef::Path(wp(r"C:\made-up\links\a.lnk"))], "{asked:?}"); + assert_eq!(art_of(&h, "a.lnk"), Some(Art::FileGeneric), "the generic page until its icon comes"); + assert_eq!(art_of(&h, "b.url"), Some(Art::FileGeneric), "the generic page until its class icon comes"); + let f2 = Fakes::new(); + let _ = window(&f2, r"\\made-up-server\share", &rows, no_known()); + assert!(icon_reqs(&f2).is_empty(), "a shortcut on a share is never asked: {:?}", f2.shell.requests()); +} + +/// A pair the breakers turned off leaves only its own rows out of a request: the other rows of the same listing are +/// still asked, whichever comes first, and the row left out keeps the class icon's wait. +#[test] +fn a_disabled_pair_leaves_only_its_rows_out_of_a_request() { + let rows = [("a.exe", false, 10, day(1)), ("b.lnk", false, 10, day(1))]; + let f = Fakes::new(); + f.shell.disable(CallKind::Icon, "lnk"); + let h = window(&f, r"C:\made-up\mixed", &rows, no_known()); + let asked: Vec = icon_reqs(&f).into_iter().flatten().collect(); + assert_eq!(asked, [ItemRef::Path(wp(r"C:\made-up\mixed\a.exe"))], "{asked:?}"); + assert_eq!(art_of(&h, "b.lnk"), Some(Art::FileGeneric), "the generic page until its class icon comes"); + let f2 = Fakes::new(); + f2.shell.disable(CallKind::Icon, "exe"); + let _ = window(&f2, r"C:\made-up\mixed", &rows, no_known()); + let asked: Vec = icon_reqs(&f2).into_iter().flatten().collect(); + assert_eq!(asked, [ItemRef::Path(wp(r"C:\made-up\mixed\b.lnk"))], "{asked:?}"); +} + +/// A window over a listing already queued on the fakes. +fn window_queued(f: &Fakes, dir: &str) -> Harness { + let shared = f.shared(UiLang::EN); + let t = shared.new_tab(); + let s = FilesScreen::new(shared, 1, Location::Fs(wp(dir)), None, t); + let mut h = Harness::new(s, SizeL { w: 900, h: 600 }, 96, Tokens::oled()); + h.render(); + f.pump(&mut h, 1); + h.render(); + h.advance(1_000); + f.pump(&mut h, 1); + h.render(); + h +} + +#[test] +fn high_contrast_brings_a_new_book_to_every_table() { + let f = Fakes::new(); + let mut h = window(&f, r"C:\made-up\docs", &[("a.pdf", false, 9, day(1))], no_known()); + assert!(h.screen().art().key().hc.is_none()); + let hc = preview::cells(Cells::Four).into_iter().find(|c| c.tag == "hc-144").expect("the HC cell"); + h.set_tokens((hc.tokens)()); + h.render(); + let s = h.screen(); + assert!(s.art().key().hc.is_some(), "the art follows high contrast"); + assert!(s.tabs().iter().all(|t| Rc::ptr_eq(t.table.model().art(), s.art())), "every table holds the window's book"); +} diff --git a/apps/files/tests/ui_inst.rs b/apps/files/tests/ui_inst.rs index 1e09ee34..68bb0b58 100644 --- a/apps/files/tests/ui_inst.rs +++ b/apps/files/tests/ui_inst.rs @@ -273,7 +273,7 @@ fn select_reuses_window_and_selects() { w.h.advance(1_000); w.pump(); assert_eq!(w.location(), Location::Fs(wp(ROOT))); - assert!(w.has_label(" · 1 selected · 1.17 KB"), "{}", w.dump()); + assert!(w.has_label("1 selected, 1.17 KB"), "{}", w.dump()); assert_eq!(w.shared.loop_requests.borrow().last(), Some(&LoopReq::Show { win: 1, how: Show::Front })); } diff --git a/apps/files/tests/ui_menu.rs b/apps/files/tests/ui_menu.rs index cf4dbaa8..364f16ac 100644 --- a/apps/files/tests/ui_menu.rs +++ b/apps/files/tests/ui_menu.rs @@ -230,7 +230,9 @@ fn menu_items_for_file_folder_background() { ); let subs = submenus(&items); assert_eq!(subs.len(), 3, "Sort by, View, New"); - assert!(is_disabled_with_note(subs[2], Cmd::NewFolder as u32), "New folder waits for F3"); + // New folder follows its switches: on, it is offered here; off, it says why. + let waits = toolmenus::new_folder_why(None, files_engine::gate::REAL_DATA_MUTATIONS, toolmenus::NEW_FOLDER_LIVE); + assert_eq!(is_disabled_with_note(subs[2], Cmd::NewFolder as u32), waits.is_some(), "New folder: {waits:?}"); assert_eq!(w.fs().tabs().active().table.selection().count(w.rows()), 0); } @@ -290,12 +292,15 @@ fn intercept_mapping() { assert_eq!(map(CanonVerb::Rename, &[&outside], &dir), Mapped::Nothing, "only an item of the folder shown"); assert_eq!(map(CanonVerb::Rename, &[], &dir), Mapped::Nothing); for v in [CanonVerb::Cut, CanonVerb::Copy, CanonVerb::Paste, CanonVerb::PasteLink] { - assert_eq!(map(v, &[&inside], &dir), Mapped::NotInBeta, "{v:?}"); + let off = menu::map_verb_with(v, vec![inside.clone()], &dir, false); + assert_eq!(off, Mapped::NotInBeta, "{v:?} while the clipboard commands wait"); } + assert_eq!(map(CanonVerb::PasteLink, &[&inside], &dir), Mapped::NotInBeta, "never ours"); - // Through the reply route: a clipboard verb shows the notice with its button; a dismissal says nothing; a - // failed or fallen-back menu shows host_down with Retry. + // Through the reply route: a clipboard verb shows the notice with its button while its switch is off; a dismissal + // says nothing; a failed or fallen-back menu shows host_down with Retry. let mut w = window(); + w.fs().shared().paste_live.set(false); reply(&mut w, ShellEvt::MenuDone { req: ReqId(1), outcome: MenuOutcome::Dismissed, items: vec![] }); reply(&mut w, ShellEvt::MenuDone { req: ReqId(1), outcome: MenuOutcome::Invoked, items: vec![] }); assert!(!w.h.a11y_dump().contains("alpha") && !w.h.a11y_dump().contains("Windows menu"), "no notice yet"); @@ -340,9 +345,17 @@ fn intercepted_delete_and_rename_reach_their_flows() { }, ); w.pump(); - // Outside the test roots the ops gate refuses with its own line: that line is the proof the request was made. + // Outside the test roots the ops gate refuses with the not-available notice: that line is the proof the request + // was made; with real data on, the request itself reaches the helper. let dump = w.h.a11y_dump(); - assert!(dump.contains("Changes are off in this preview build"), "the delete flow ran: {dump}"); + if files_engine::gate::REAL_DATA_MUTATIONS { + assert!( + w.f.ops.calls().iter().any(|c| matches!(c, files_engine::fakes::OpsCall::Recycle(_))), + "the delete flow ran: {dump}" + ); + } else { + assert!(dump.contains("Not available in this alpha"), "the delete flow ran: {dump}"); + } let mut w = window(); reply( &mut w, @@ -352,7 +365,13 @@ fn intercepted_delete_and_rename_reach_their_flows() { items: vec![ItemRef::Path(inside)], }, ); - assert!(w.fs().tabs().active().table.is_renaming(), "the rename field is open"); + if files_engine::gate::REAL_DATA_MUTATIONS { + assert!(w.fs().tabs().active().table.is_renaming(), "the rename field is open"); + } else { + // Files may not change here: the notice, and no field. + assert!(!w.fs().tabs().active().table.is_renaming()); + assert!(w.h.a11y_dump().contains("Not available in this alpha"), "{}", w.h.a11y_dump()); + } } fn map(v: CanonVerb, paths: &[&WidePath], dir: &WidePath) -> Mapped { @@ -438,7 +457,16 @@ fn view_new_and_more_menus() { }; assert_eq!(state(&view), [Some(false), Some(true), Some(false)]); let tv = toolmenus::toolbar_view_items(w.fs()); - assert_eq!(ids(&tv), [pick::VIEW_DETAILS, Cmd::HiddenItems as u32, pick::VIEW_EXTENSIONS, pick::VIEW_COMPACT]); + assert_eq!( + ids(&tv), + [ + pick::VIEW_DETAILS, + pick::VIEW_COMPACT, + Cmd::DetailsPane as u32, + Cmd::HiddenItems as u32, + pick::VIEW_EXTENSIONS + ] + ); assert_eq!(state(&tv)[0], Some(true), "Details is the checked view"); w.pick(pick::VIEW_EXTENSIONS); w.pick(pick::VIEW_COMPACT); @@ -450,7 +478,8 @@ fn view_new_and_more_menus() { let new = toolmenus::new_items(w.fs()); assert_eq!(ids(&new), [Cmd::NewFolder as u32]); - assert!(is_disabled_with_note(&new, Cmd::NewFolder as u32)); + let waits = toolmenus::new_folder_why(None, files_engine::gate::REAL_DATA_MUTATIONS, toolmenus::NEW_FOLDER_LIVE); + assert_eq!(is_disabled_with_note(&new, Cmd::NewFolder as u32), waits.is_some(), "New folder: {waits:?}"); let more = toolmenus::more_items(w.fs()); assert_eq!( @@ -461,7 +490,10 @@ fn view_new_and_more_menus() { Cmd::SelectAll as u32, Cmd::SelectNone as u32, Cmd::Invert as u32, + Cmd::CopyPath as u32, + Cmd::Properties as u32, Cmd::OpenInExplorer as u32, + pick::ACCENT, Cmd::About as u32 ] ); @@ -477,18 +509,17 @@ fn view_new_and_more_menus() { w.pick(Cmd::Invert as u32); assert_eq!(w.fs().tabs().active().table.selection().count(w.rows()), 4); - // The toolbar's four right buttons open these menus under themselves. + // The command bar's New, Sort and View buttons open these menus under themselves. let mut w = window(); - for (i, want) in [ - toolmenus::new_items(w.fs()), - toolmenus::sort_items(w.fs()), - toolmenus::toolbar_view_items(w.fs()), - toolmenus::more_items(w.fs()), + for (i, (id, want)) in [ + (toolmenus::btn::NEW, toolmenus::new_items(w.fs())), + (toolmenus::btn::SORT, toolmenus::sort_items(w.fs())), + (toolmenus::btn::VIEW, toolmenus::toolbar_view_items(w.fs())), ] .into_iter() .enumerate() { - let r = files_engine::toolbar::right_rects(w.fs())[i]; + let r = w.fs().toolbar().bar().rect_of(CommandId(id)).expect("the button is on the bar"); w.h.click(PointL { x: (r.l + r.r) / 2, y: (r.t + r.b) / 2 }); assert_eq!(w.h.menus().len(), 1, "button {i} opens a menu"); assert_eq!(w.h.menus()[0].items, want, "button {i}"); diff --git a/apps/files/tests/ui_open.rs b/apps/files/tests/ui_open.rs index ed0e9f6e..48a14eea 100644 --- a/apps/files/tests/ui_open.rs +++ b/apps/files/tests/ui_open.rs @@ -10,6 +10,7 @@ use files_engine::shell_client::{FallbackWhy, HostState, ShellReply}; use files_engine::status; use files_engine::window::{FilesScreen, Shared}; use oled_trust::frame::files::{CallKind, ItemRef, Location, Pixels, ReqId, ShellEvt, ShellReq, Verb}; +use oled_ui::art::{Art, Family}; use oled_ui::harness::Harness; use oled_ui::host::AppMsg; use oled_ui::model::{CellOut, ColId, ListModel, TableModel}; @@ -85,14 +86,22 @@ impl Win { .collect() } - /// The pixels the row's icon slot holds now; None when the row shows no icon yet. + /// The pixels of the Windows icon the row shows now (its own or its class's); None while it draws our art. fn row_icon(&self, row: usize) -> Option> { let m: &FilesTable = self.fs().tabs().active().table.model(); let mut out = CellOut::default(); m.cell(row, ColId(ColKind::Name as u16), &mut out); - let icon = out.icon?; + let icon = out.icon.expect("a row is never bare"); + if m.art_of(row).is_some() { + return None; + } m.icon(icon, 16).map(|b| b.pixels.clone()) } + + /// The art the row draws now; None once a Windows icon has arrived. + fn row_art(&self, row: usize) -> Option { + self.fs().tabs().active().table.model().art_of(row) + } } fn start_at(f: Fakes, shared: Rc, win: u32, tab: TabId, root: &str) -> Win { @@ -317,18 +326,26 @@ fn open_never_blocks() { #[test] fn class_icon_pending_then_ready_repaints_rows() { - let mut w = folder_window(); - let txt_row = 2; - assert!(w.row_icon(txt_row).is_none(), "the generic slot waits for its icon"); + let f = Fakes::new(); + f.enumr.queue(&wp(ROOT), fakes::listing(&[("readings.bin", false, 10, day(1)), ("notes.txt", false, 10, day(1))])); + let mut w = window_over(f, ROOT); + w.h.advance(1_000); + w.pump(); + let row = |name: &str| (0..w.rows()).find(|r| ListModel::label(w.fs().tabs().active().table.model(), *r) == name); + let (bin_row, txt_row) = (row("readings.bin").unwrap(), row("notes.txt").unwrap()); + assert_eq!(w.row_art(bin_row), Some(Art::FileGeneric), "the generic page while the class icon is pending"); // The real order: the wake runs while the icon is still pending, then the Bump drain_engines posts. w.h.send(Box::new(Msg::EnginesWake)); + w.f.icons.set_icon(b"bin"); w.f.icons.set_icon(b"txt"); w.h.send(Box::new(Msg::Fwd(Fwd::Bump))); w.h.advance(5_000); w.h.render(); - assert!(w.row_icon(txt_row).is_some(), "the rows show the icon once it is Ready"); + assert!(w.row_icon(bin_row).is_some(), "the rows show the icon once it is Ready"); + assert_eq!(w.row_art(txt_row), Some(Art::File(Family::Text)), "a family keeps its art"); let noted = w.f.icons.noted(); - assert!(noted.iter().any(|e| &**e == b"txt".as_slice()), "{noted:?}"); + assert!(noted.iter().any(|e| &**e == b"bin".as_slice()), "{noted:?}"); + assert!(!noted.iter().any(|e| &**e == b"txt".as_slice()), "a family's class icon is never asked: {noted:?}"); } #[test] @@ -394,15 +411,15 @@ fn per_item_requested_for_visible_rows_only() { let items = &reqs[0].2; // The folder sorts first and is customised; the exe, lnk and url rows are visible; the late exe is not. assert!(items.contains(&path("a-tool.exe")), "{items:?}"); + // A local shortcut is asked: the host reads it without resolving it and loads only a local icon location. + assert!(items.contains(&path("b-link.lnk")), "{items:?}"); assert!(!items.contains(&path("c-notes.txt")) && !items.contains(&path("z-late.exe")), "{items:?}"); - // What names an icon location outside itself (shortcuts, desktop.ini folders) is never sent: the shell would - // resolve and load that location, which can be a remote one. - for name in - ["b-link.lnk", "d-site.url", "y-folder", "b2-console.msc", "b3-app.appref-ms", "b4-symlink.exe", "b5-cloud.exe"] - { + // What names an icon location the shell would resolve and load (other link kinds, desktop.ini folders), a link and + // a dehydrated file are never sent: that location can be a remote one. + for name in ["d-site.url", "y-folder", "b2-console.msc", "b3-app.appref-ms", "b4-symlink.exe", "b5-cloud.exe"] { assert!(!items.contains(&path(name)), "{name} must keep its class or folder icon: {items:?}"); } - assert_eq!(items.len(), 1, "{items:?}"); + assert_eq!(items.len(), 2, "{items:?}"); assert_eq!(reqs[0].3, 16, "the kit's icon size at 96 dpi"); // Asking again with nothing new on screen sends nothing. w.h.key("Down"); @@ -442,6 +459,7 @@ fn per_item_reply_sets_the_row_icon() { let mut w = exe_window(60); let (req, gen, items, _) = w.icon_reqs().remove(0); assert!(w.row_icon(0).is_none()); + assert_eq!(w.row_art(0), Some(Art::Program), "a program draws the program art until its icon comes"); w.f.shell.reply(icon_evt(req, gen, 0, 200)); w.f.shell.reply(ShellReply::Evt(ShellEvt::ReqDone { req })); w.pump(); @@ -449,6 +467,7 @@ fn per_item_reply_sets_the_row_icon() { let px = w.row_icon(0).expect("the row shows its own icon"); assert_eq!(px[0], 0xFF00_00C8, "premultiplied 0xAARRGGBB of the reply"); assert!(w.row_icon(1).is_none(), "the other rows keep waiting"); + assert_eq!(w.row_art(1), Some(Art::Program)); // A finished request is not asked for again. w.h.key("Down"); assert_eq!(w.icon_reqs().len(), 1); diff --git a/apps/files/tests/ui_ops.rs b/apps/files/tests/ui_ops.rs index 13256043..9be796ba 100644 --- a/apps/files/tests/ui_ops.rs +++ b/apps/files/tests/ui_ops.rs @@ -173,6 +173,18 @@ impl Win { self.f.pump(&mut self.h, 1); self.h.render(); } + /// Shift+Del, then the bar's fresh Enter: a permanent delete as the user confirms it. + fn delete_for_good(&mut self) { + self.key("Shift+Del"); + assert!(self.bar().is_asked(), "Shift+Del asks first"); + self.key("Enter"); + } + /// A repeated Enter (held past the keyboard's repeat delay). + fn held_enter(&mut self) { + let ev = Event::Key { key: Key::ENTER, down: true, repeat: true, mods: Mods::NONE }; + self.h.send(Box::new(Op::Event(ev))); + self.h.render(); + } /// Del held past the keyboard's repeat delay: a repeated key down. fn held_del(&mut self) { let ev = Event::Key { key: Key::DELETE, down: true, repeat: true, mods: Mods::NONE }; @@ -308,27 +320,38 @@ fn every_mutation_goes_through_request() { #[test] fn refused_shows_notice_and_sends_nothing() { - // Outside the test and live roots the gate refuses: the notice, and nothing reaches the helper. + let not_here = "Not available in this alpha: use File Explorer"; let mut w = window_at(wp(r"C:\made-up\reports"), None); w.script(|_| Recyclability::Yes); w.select(&["a-notes.txt"]); - w.key("Shift+Del"); - assert!(w.has_label("Changes are off in this preview build"), "{}", w.dump()); + w.delete_for_good(); w.key("Del"); w.pump(); - assert!(w.calls().is_empty(), "{:?}", w.calls()); - assert!(w.shared.ops.borrow().rows().is_empty()); - // The helper refuses: its reason, and the model holds nothing. + if files_engine::gate::REAL_DATA_MUTATIONS { + // Real data on: the folder's changes reach the helper (here the recorder), the bar's Enter and Del's Recycle. + let want = [OpsCall::DeletePermanent(w.refs(&["a-notes.txt"])), OpsCall::Recycle(w.refs(&["a-notes.txt"]))]; + assert_eq!(w.calls(), want); + } else { + // Outside the test and live roots the gate refuses: the not-available notice with File Explorer, and + // nothing reaches the helper. + assert!(w.has_label(not_here), "{}", w.dump()); + assert!(w.has_button("Open ↗"), "{}", w.dump()); + assert!(w.calls().is_empty(), "{:?}", w.calls()); + assert!(w.shared.ops.borrow().rows().is_empty()); + } + // The helper refuses a place it never changes: why, with File Explorer, and the model holds nothing. let mut w = in_root("ops_refused_notice"); w.f.ops.set_fail(Some(OpsError::Refused(Refusal::Root))); w.select(&["a-notes.txt"]); - w.key("Shift+Del"); - assert!(w.has_label("Not available in this alpha: use File Explorer"), "{}", w.dump()); + w.delete_for_good(); + let place = ops_ui::refusal_text_with(&Refusal::Root, "", 0, UiLang::EN, &Fmt::fixed_en()).to_string(); + assert!(w.has_label(&place), "{}", w.dump()); + assert!(w.has_button("Open ↗"), "{}", w.dump()); assert_eq!(w.calls().len(), 1, "the one call, refused"); assert!(w.shared.ops.borrow().rows().is_empty()); // The helper is gone: host_lost with Retry. w.f.ops.set_fail(Some(OpsError::Unavailable("gone"))); - w.key("Shift+Del"); + w.delete_for_good(); assert!(w.has_label("The operations helper stopped."), "{}", w.dump()); assert!(w.has_button("Retry (F5)"), "{}", w.dump()); } @@ -337,7 +360,7 @@ fn refused_shows_notice_and_sends_nothing() { fn accepted_op_enters_the_model() { let mut w = in_root("ops_accepted"); w.select(&["a-notes.txt", "b-report-final-v2.pdf"]); - w.key("Shift+Del"); + w.delete_for_good(); assert_eq!(w.calls(), [OpsCall::DeletePermanent(w.refs(&["a-notes.txt", "b-report-final-v2.pdf"]))]); let m = w.shared.ops.borrow(); let r = m.row(OpId(1)).expect("the accepted operation"); @@ -358,13 +381,66 @@ fn refusal_texts_by_reason() { assert_eq!(text(Refusal::NotEmpty), "Can't undo: notes.txt isn't empty any more"); assert_eq!(text(Refusal::OutsideTestRoot), "Changes are off in this preview build"); assert_eq!(text(Refusal::BadName), "A name can't contain \\ / : * ? \" < > |"); - for r in [Refusal::Root, Refusal::MixedParents, Refusal::TooMany, Refusal::Elevated, Refusal::BadPath] { + assert_eq!(text(Refusal::Root), "notes.txt is protected: use File Explorer"); + assert_eq!(text(Refusal::Elevated), "No rights to change notes.txt: use File Explorer"); + for r in [Refusal::MixedParents, Refusal::TooMany, Refusal::BadPath] { assert_eq!(text(r), "Not available in this alpha: use File Explorer", "{r:?}"); } + // Without a name: the plain forms; both offer File Explorer, which can do it or ask an administrator. + let plain = |r: Refusal| ops_ui::refusal_notice(&r, "", 0, en, &fmt); + assert_eq!(plain(Refusal::Root).text, "System folders and drive roots are protected: use File Explorer"); + let n = plain(Refusal::Elevated); + assert_eq!(n.text, "No rights for this change: use File Explorer"); + assert_eq!(n.action.map(|(_, a)| a), Some(NoticeAct::OpenInExplorer)); + assert_eq!(plain(Refusal::Changed).action, None, "an undo's refusal is its text alone"); for r in [Refusal::NoItems, Refusal::UnknownOp, Refusal::OpInUse] { assert_eq!(text(r), "The operations helper stopped.", "{r:?}"); } - assert_eq!(ops_ui::refusal_text(&Refusal::Root, en), "Not available in this alpha: use File Explorer"); + assert_eq!( + ops_ui::refusal_text(&Refusal::Root, en), + "System folders and drive roots are protected: use File Explorer" + ); +} + +#[test] +fn a_refused_place_or_right_says_why_with_file_explorer() { + let mut w = in_root("ops_refused_why"); + w.select(&["a-notes.txt"]); + w.delete_for_good(); + w.emit(OpEvt::Refused { op: OpId(1), why: Refusal::Elevated, detail: "a-notes.txt".into() }); + w.pump(); + assert!(w.has_label("No rights to change a-notes.txt: use File Explorer"), "{}", w.dump()); + assert!(w.has_button("Open ↗"), "{}", w.dump()); + assert!(w.shared.ops.borrow().row(OpId(1)).is_none(), "a refused operation leaves no row"); + w.select(&["b-report-final-v2.pdf"]); + w.delete_for_good(); + w.emit(OpEvt::Refused { op: OpId(2), why: Refusal::Root, detail: "Windows".into() }); + w.pump(); + assert!(w.has_label("Windows is protected: use File Explorer"), "{}", w.dump()); + assert!(w.has_button("Open ↗"), "{}", w.dump()); +} + +#[test] +fn an_item_the_rights_could_not_change_is_told_once() { + let mut w = in_root("ops_rights_failed"); + w.select(&["projects"]); + w.delete_for_good(); + w.emit(started(1, OpKind::DeletePermanent, 1)); + let denied = windows::Win32::Foundation::E_ACCESSDENIED.0; + for name in ["locked.txt", "locked-too.txt"] { + let item = w.path("projects").join(&name.encode_utf16().collect::>()).unwrap(); + w.emit(OpEvt::ItemFailed { op: OpId(1), item, hr: denied }); + } + w.pump(); + assert!(w.has_label("No rights to change locked.txt: use File Explorer"), "{}", w.dump()); + assert!(w.has_button("Open ↗"), "{}", w.dump()); + let r = w.shared.ops.borrow().row(OpId(1)).cloned().expect("the row"); + assert!(r.rights_noted && r.failed == 2 && r.failures.len() == 2, "{r:?}"); + // Any other failure says nothing of rights. + assert!(ops_ui::rights_hr(denied)); + assert!(!ops_ui::rights_hr(windows::Win32::Foundation::E_FAIL.0)); + let in_use = windows::Win32::Foundation::ERROR_SHARING_VIOLATION.to_hresult().0; + assert!(!ops_ui::rights_hr(in_use)); } // ---- F3.2: Del -------------------------------------------------------------------------------------------------- @@ -525,14 +601,40 @@ fn bar_closes_on_navigation() { } #[test] -fn shift_del_sends_permanent_at_once() { +fn shift_del_asks_first_and_only_a_fresh_enter_deletes() { let mut w = in_root("ops_shift_del"); let jobs = w.f.bg.runs().len(); w.select(&["b-report-final-v2.pdf"]); w.key("Shift+Del"); - assert_eq!(w.calls(), [OpsCall::DeletePermanent(w.refs(&["b-report-final-v2.pdf"]))]); + assert!(w.bar().is_open() && w.bar().is_asked(), "the bar asks"); + assert_eq!(w.bar().permanent(), w.paths(&["b-report-final-v2.pdf"]).as_slice()); + assert!(w.bar().recyclable().is_empty()); + assert!(w.has_label("Delete this item permanently? This can't be undone"), "{}", w.dump()); + assert!(w.calls().is_empty(), "nothing before the Enter: {:?}", w.calls()); assert_eq!(w.f.bg.runs().len(), jobs, "no classification for a permanent delete"); + // A held Enter, Shift+Del again and Del never confirm it. + w.held_enter(); + w.key("Shift+Del"); + w.key("Del"); + w.held_del(); + assert!(w.calls().is_empty(), "{:?}", w.calls()); + assert!(w.bar().is_open()); + w.key("Enter"); + assert_eq!(w.calls(), [OpsCall::DeletePermanent(w.refs(&["b-report-final-v2.pdf"]))]); assert!(!w.bar().is_open()); + // Esc sends nothing; two items are counted. + w.select(&["a-notes.txt", "b-report-final-v2.pdf"]); + w.key("Shift+Del"); + assert!(w.has_label("Delete these 2 items permanently? This can't be undone"), "{}", w.dump()); + w.key("Esc"); + assert!(!w.bar().is_open()); + assert_eq!(w.calls().len(), 1); + // The menu's Delete permanently runs the same command: the bar again. + w.select(&["a-notes.txt"]); + w.h.send(Box::new(Op::Event(Event::Command(oled_ui::CommandId(files_engine::keys::Cmd::DeletePermanent as u32))))); + w.h.render(); + assert!(w.bar().is_asked(), "the menu's pick asks too"); + assert_eq!(w.calls().len(), 1); } /// A small deterministic generator for the property test. @@ -647,14 +749,14 @@ fn intercepted_delete_uses_the_del_flow() { fn focus_moves_after_delete() { let mut w = in_root("ops_focus_after"); w.select(&["b-report-final-v2.pdf"]); - w.key("Shift+Del"); + w.delete_for_good(); let removed = |p: WidePath| Change { kind: ChangeKind::Deleted, from: Some(p), to: None }; w.emit(OpEvt::ItemsDone { op: OpId(1), changes: vec![removed(w.path("b-report-final-v2.pdf"))] }); w.pump(); assert_eq!(w.focused_label().as_deref(), Some("c-photos-raw.zip"), "the next row"); // At the end of the list: the row before. w.select(&["d-setup-tool.exe"]); - w.key("Shift+Del"); + w.delete_for_good(); w.emit(OpEvt::ItemsDone { op: OpId(2), changes: vec![removed(w.path("d-setup-tool.exe"))] }); w.pump(); assert_eq!(w.focused_label().as_deref(), Some("c-photos-raw.zip"), "the previous row at the end"); @@ -739,7 +841,7 @@ fn chip_hidden_6s_after_finish_and_no_timer_after() { let mut w = in_root("ops_chip_hold"); w.h.advance(1_000); w.select(&["a-notes.txt", "b-report-final-v2.pdf"]); - w.key("Shift+Del"); + w.delete_for_good(); w.emit(started(1, OpKind::DeletePermanent, 2)); w.emit(progress(1, 1, 2)); w.pump(); @@ -799,7 +901,7 @@ fn progress_aggregates() { fn flyout_rows_and_cancel() { let mut w = in_root("ops_flyout_cancel"); w.select(&["a-notes.txt", "b-report-final-v2.pdf"]); - w.key("Shift+Del"); + w.delete_for_good(); w.emit(started(1, OpKind::DeletePermanent, 2)); w.emit(progress(1, 1, 2)); w.pump(); @@ -827,7 +929,7 @@ fn flyout_rows_and_cancel() { fn failures_stay_until_opened() { let mut w = in_root("ops_failures"); w.select(&["a-notes.txt", "b-report-final-v2.pdf"]); - w.key("Shift+Del"); + w.delete_for_good(); w.emit(started(1, OpKind::DeletePermanent, 2)); let denied = 0x8007_0005_u32 as i32; w.emit(OpEvt::ItemFailed { op: OpId(1), item: w.path("a-notes.txt"), hr: denied }); @@ -896,7 +998,7 @@ fn is_idle_when_nothing_runs() { fn host_lost_stops_running_ops_and_keeps_their_items() { let mut w = in_root("ops_host_lost"); w.select(&["a-notes.txt"]); - w.key("Shift+Del"); + w.delete_for_good(); w.emit(started(1, OpKind::DeletePermanent, 1)); w.pump(); w.f.ops.emit(OpsEvent::HostLost); @@ -1075,11 +1177,11 @@ fn resume_goes_through_the_gate() { w.pump(); w.h.send(Box::new(Op::Act(NoticeAct::Rest(OpId(70))))); w.h.render(); - assert!(w.has_label("Changes are off in this preview build"), "{}", w.dump()); + assert!(w.has_label("Not available in this alpha: use File Explorer"), "{}", w.dump()); assert!(!w.calls().iter().any(|c| matches!(c, OpsCall::ResumeRest(_))), "{:?}", w.calls()); // This process's own operation inside the root: its items pass the gate, and the rest is resumed. w.select(&["a-notes.txt"]); - w.key("Shift+Del"); + w.delete_for_good(); w.emit(OpEvt::Pending { of: OpId(1), kind: OpKind::DeletePermanent, done: 0, total: 1, dest: None }); w.pump(); assert!(w.has_button("Delete the rest"), "{}", w.dump()); diff --git a/apps/files/tests/ui_rename.rs b/apps/files/tests/ui_rename.rs index c3fd3d0f..d5d3a3c4 100644 --- a/apps/files/tests/ui_rename.rs +++ b/apps/files/tests/ui_rename.rs @@ -8,10 +8,11 @@ use files_engine::fakes::{self, Fakes, OpsCall}; use files_engine::keys::Cmd; use files_engine::listing::WidePath; use files_engine::model::ViewOpts; +use files_engine::ops_client::OpsError; use files_engine::rename; use files_engine::tr::{k, t}; use files_engine::window::{FilesScreen, STARTUP_TAB}; -use oled_trust::frame::files::{Location, OpId}; +use oled_trust::frame::files::{Location, OpId, Refusal}; use oled_ui::harness::Harness; use oled_ui::host::AppMsg; use oled_ui::{Event, EventCx, LayoutCx, PaintCx, Reply, Screen, SizeL, SizeP, Tokens, UiLang}; @@ -238,8 +239,8 @@ fn commit_sends_rename_through_gate() { w.h.type_text("report-final-v3").key("Enter"); assert!(!w.renaming()); assert_eq!(w.calls(), [OpsCall::Rename(w.at("report-final-v2.pdf"), "report-final-v3.pdf".into())]); - // A folder outside the test roots: the gate refuses, nothing is sent, the window says so. - // (the neighbour stays closed after a Tab: see tab_after_refused_request_keeps_neighbour_closed) + // A folder outside the test roots: no field and the not-available notice while real data is off. + // (the neighbour stays closed after a refused Tab: see tab_after_refused_request_keeps_neighbour_closed) let f = Fakes::new(); let outside = wp(r"C:\mod-files-made-up\projects"); f.enumr.queue(&outside, fakes::listing(&[("a.txt", false, 1, fakes::FT_2026_11_21)])); @@ -250,9 +251,21 @@ fn commit_sends_rename_through_gate() { h.render(); f.pump(&mut h, 1); h.render(); - h.key("Down").key("F2").type_text("b").key("Enter"); - assert!(f.ops.calls().is_empty()); - assert!(h.a11y_dump().contains(&*t(k::FILES_OPS_PREVIEW_GATE, UiLang::EN)), "the gate's notice"); + h.key("Down").key("F2"); + if files_engine::gate::REAL_DATA_MUTATIONS { + // Real data on: the field opens and the rename reaches the helper (here the recorder). + h.type_text("b").key("Enter"); + assert_eq!(f.ops.calls(), [OpsCall::Rename(wp(r"C:\mod-files-made-up\projects\a.txt"), "b.txt".into())]); + } else { + // Files may not change here: F2 opens no field and says so, with File Explorer; nothing is sent. + assert!(!h.screen().s.tabs().active().table.is_renaming()); + assert!(h.a11y_dump().contains(&*t(k::FILES_MENU_NOT_IN_BETA, UiLang::EN)), "the notice: {}", h.a11y_dump()); + h.type_text("b").key("Enter"); + assert!(f.ops.calls().is_empty()); + // Ctrl+Shift+N says the same, and makes nothing. + h.key("Ctrl+Shift+N"); + assert!(f.ops.calls().is_empty()); + } } #[test] @@ -273,23 +286,14 @@ fn tab_moves_to_next() { #[test] fn tab_after_refused_request_keeps_neighbour_closed() { - let f = Fakes::new(); - let outside = wp(r"C:\mod-files-made-up\projects"); - f.enumr.queue( - &outside, - fakes::listing(&[("a.txt", false, 1, fakes::FT_2026_11_21), ("b.txt", false, 1, fakes::FT_2026_11_21)]), - ); - let shared = f.shared(UiLang::EN); - let tab = shared.new_tab(); - let s = FilesScreen::new(shared, 1, Location::Fs(outside), None, tab); - let mut h = Harness::new(Runner { s }, SizeL { w: 800, h: 500 }, 96, Tokens::oled()); - h.render(); - f.pump(&mut h, 1); - h.render(); - h.key("Down").key("F2").type_text("c").key("Tab"); - assert!(f.ops.calls().is_empty()); - let field = h.screen_mut().s.tabs_mut().active_mut().table.rename_field_mut().expect("the refused field is open"); - assert_eq!(field.text(), "c.txt", "its own row, not the neighbour"); + // The helper refuses the rename (a place it never changes): the field stays on its own row after a Tab. + let mut w = win(); + w.f.ops.set_fail(Some(OpsError::Refused(Refusal::Root))); + w.begin("notes.txt"); + w.h.type_text("c").key("Tab"); + assert_eq!(w.calls(), [OpsCall::Rename(w.at("notes.txt"), "c.txt".into())], "the one call, refused"); + assert!(w.renaming(), "the refused field is open"); + assert_eq!(w.field().0, "c.txt", "its own row, not the neighbour"); } #[test] @@ -371,9 +375,24 @@ fn hidden_extension_comes_back() { // ---- F3.8 +/// New folder waits for its own switch in this build: Ctrl+Shift+N shows the notice and asks for nothing. +fn new_folder_waits(w: &mut Win) -> bool { + let gate = files_engine::gate::REAL_DATA_MUTATIONS; + let waits = files_engine::toolmenus::new_folder_why(None, gate, files_engine::toolmenus::NEW_FOLDER_LIVE).is_some(); + if waits { + w.h.key("Ctrl+Shift+N"); + assert!(w.calls().is_empty()); + assert!(w.dump().contains(&*t(k::FILES_MENU_NOT_IN_BETA, UiLang::EN)), "{}", w.dump()); + } + waits +} + #[test] fn new_folder_picks_free_name() { let mut w = win_over("ui_rename_nf", &[("New folder", true), ("a.txt", false)], false); + if new_folder_waits(&mut w) { + return; + } w.h.key("Ctrl+Shift+N"); assert_eq!(w.calls(), [OpsCall::NewFolder(wp(&w.root.path().to_string_lossy()), "New folder (2)".into())]); let mut w = win_over("ui_rename_nf2", &[("a.txt", false)], false); @@ -384,6 +403,9 @@ fn new_folder_picks_free_name() { #[test] fn created_row_enters_rename() { let mut w = win_over("ui_rename_cr", &[("a.txt", false)], false); + if new_folder_waits(&mut w) { + return; + } w.h.key("Ctrl+Shift+N"); // The host made it and the listing shows it: the change reaches the window as live::own_changes passes it. let dir = wp(&w.root.path().to_string_lossy()); diff --git a/apps/files/tests/ui_search.rs b/apps/files/tests/ui_search.rs new file mode 100644 index 00000000..25264330 --- /dev/null +++ b/apps/files/tests/ui_search.rs @@ -0,0 +1,398 @@ +//! The search in the open folder, the Filter menu and the nothing-found state (P3-files-app 1.9): what typing does +//! after the debounce, the Esc ladder, the chords, the per-tab state and its clearing on navigation. Plain tests over +//! the fakes through the kit's Harness: no window, no file system. + +use files_engine::fakes::{self, Fakes, FT_2026_11_21}; +use files_engine::format::Fmt; +use files_engine::listing::{NameFamily, WidePath}; +use files_engine::tab::TABLE_ID; +use files_engine::toolmenus::filter_pick; +use files_engine::view::states; +use files_engine::window::FilesScreen; +use oled_trust::frame::files::Location; +use oled_ui::harness::Harness; +use oled_ui::host::AppMsg; +use oled_ui::model::ListModel; +use oled_ui::{ + CaptionHit, CommandId, CommandTable, Event, EventCx, LayoutCx, NodeId, PaintCx, PointP, Reply, Screen, SizeL, + SizeP, Tokens, UiLang, +}; + +fn wp(s: &str) -> WidePath { + WidePath::parse(s).unwrap() +} + +fn day(n: i64) -> i64 { + FT_2026_11_21 - n * 864_000_000_000 +} + +/// What a test asks the screen to do from inside its own event, where an EventCx exists. +enum Op { + Pick(u32), +} + +struct Wrap(FilesScreen); + +impl Screen for Wrap { + fn layout(&mut self, cx: &mut LayoutCx, avail: SizeP) -> SizeP { + self.0.layout(cx, avail) + } + fn paint(&self, cx: &mut PaintCx) { + self.0.paint(cx) + } + fn event(&mut self, cx: &mut EventCx, ev: &Event) -> Reply { + self.0.event(cx, ev) + } + fn data(&mut self, cx: &mut EventCx, msg: AppMsg) -> Reply { + match msg.downcast::() { + Ok(op) => { + match *op { + Op::Pick(id) => { + self.0.event(cx, &Event::Command(CommandId(id))); + } + } + Reply::Relayout + } + Err(msg) => self.0.data(cx, msg), + } + } + fn commands(&self) -> &CommandTable { + self.0.commands() + } + fn caption_hit(&self, p: PointP) -> CaptionHit { + self.0.caption_hit(p) + } +} + +struct Win { + f: Fakes, + h: Harness, +} + +const ROOT: &str = r"C:\made-up\reports"; + +fn reports() -> Vec<(&'static str, bool, u64, i64)> { + vec![ + ("invoices", true, 0, day(3)), + ("projects", true, 0, day(9)), + ("notes.txt", false, 1_200, day(1)), + ("report-final-v2.pdf", false, 3_400_000, day(5)), + ("photos-raw.zip", false, 90_000_000, day(40)), + ] +} + +fn window(rows: &[(&str, bool, u64, i64)], width: i32) -> Win { + let f = Fakes::new(); + f.enumr.queue(&wp(ROOT), fakes::listing(rows)); + f.enumr.queue(&wp(&format!(r"{ROOT}\invoices")), fakes::listing(&[("a.txt", false, 1, day(1))])); + let shared = f.shared(UiLang::EN); + *shared.fmt.borrow_mut() = std::rc::Rc::new(Fmt::fixed_en()); + let tab = shared.new_tab(); + let screen = FilesScreen::new(shared, 1, Location::Fs(wp(ROOT)), None, tab); + let mut h = Harness::new(Wrap(screen), SizeL { w: width, h: 500 }, 96, Tokens::oled()); + h.render(); + f.pump(&mut h, 1); + h.render(); + Win { f, h } +} + +impl Win { + fn fs(&self) -> &FilesScreen { + &self.h.screen().0 + } + + fn pump(&mut self) { + self.f.pump(&mut self.h, 1); + self.h.render(); + } + + fn rows(&self) -> usize { + ListModel::len(self.fs().tabs().active().table.model()) + } + + fn labels(&self) -> Vec { + let m = self.fs().tabs().active().table.model(); + (0..ListModel::len(m)).map(|r| m.label(r).to_string()).collect() + } + + fn focused_label(&self) -> Option { + let t = &self.fs().tabs().active().table; + let row = t.model().row_of(t.focused()?)?; + Some(t.model().label(row).to_string()) + } + + fn field(&self) -> NodeId { + self.fs().toolbar().search().field_node() + } + + fn in_field(&self) -> bool { + self.h.focused() == Some(self.field()) + } + + fn in_list(&self) -> bool { + self.h.focused().is_some_and(|n| n.owner() == TABLE_ID) + } + + fn type_in(&mut self, text: &str) { + self.h.key("Ctrl+F"); + self.h.type_text(text); + self.h.render(); + } + + fn settle_search(&mut self) { + self.h.advance(130); + self.h.render(); + } + + fn has_label(&self, text: &str) -> bool { + self.h.a11y_dump().lines().any(|l| l.trim_start() == format!("Label {text:?}")) + } + + fn pick(&mut self, id: u32) { + self.h.send(Box::new(Op::Pick(id))); + self.h.render(); + } +} + +#[test] +fn typing_narrows_the_folder_after_120_ms_and_keeps_the_sort() { + let mut w = window(&reports(), 900); + let all = w.labels(); + assert_eq!(all.len(), 5); + w.type_in("t"); + w.h.advance(100); + w.h.render(); + assert_eq!(w.rows(), 5, "100 ms after the key the list is still whole"); + w.h.advance(30); + w.h.render(); + let want: Vec = all.iter().filter(|n| n.to_lowercase().contains('t')).cloned().collect(); + assert!(!want.is_empty() && want.len() < 5); + assert_eq!(w.labels(), want, "the matches, in the order of the whole list"); + assert!(w.has_label(&format!("{} of 5 items", want.len())), "{}", w.h.a11y_dump()); +} + +#[test] +fn every_key_restarts_the_debounce() { + let mut w = window(&reports(), 900); + w.h.key("Ctrl+F"); + w.h.type_text("r"); + w.h.advance(100); + w.h.type_text("e"); + w.h.advance(100); + w.h.render(); + assert_eq!(w.rows(), 5, "100 ms since the last key: nothing yet"); + w.h.advance(30); + w.h.render(); + assert_eq!(w.labels(), ["report-final-v2.pdf"]); +} + +#[test] +fn the_match_ignores_case_and_accents_and_takes_a_substring() { + let rows = [ + ("École.txt", false, 1, day(1)), + ("cafe au lait.txt", false, 1, day(2)), + ("Naïve.doc", false, 1, day(3)), + ("plain.txt", false, 1, day(4)), + ]; + let mut w = window(&rows, 900); + w.type_in("ecole"); + w.settle_search(); + assert_eq!(w.labels(), ["École.txt"], "plain letters find the accented name"); + w.type_in(""); + w.h.key("Ctrl+A").key("Delete"); + w.h.type_text("CAFÉ AU"); + w.settle_search(); + assert_eq!(w.labels(), ["cafe au lait.txt"], "an accented, upper-case query finds the plain name"); + w.h.key("Ctrl+A").key("Delete"); + w.h.type_text("aïv"); + w.settle_search(); + assert_eq!(w.labels(), ["Naïve.doc"], "a substring from the middle of the name"); +} + +#[test] +fn enter_commits_at_once_and_focuses_the_first_match() { + let mut w = window(&reports(), 900); + w.type_in("pro"); + w.h.key("Enter"); + w.h.render(); + assert_eq!(w.labels(), ["projects"], "Enter does not wait for the debounce"); + assert!(w.in_list(), "the keyboard is in the list: {:?}", w.h.focused()); + assert_eq!(w.focused_label().as_deref(), Some("projects")); +} + +#[test] +fn escape_clears_then_leaves_the_field() { + let mut w = window(&reports(), 900); + w.type_in("rep"); + w.settle_search(); + assert_eq!(w.rows(), 1); + w.h.key("Esc"); + w.h.render(); + assert_eq!(w.rows(), 5, "the first Esc clears the search"); + assert_eq!(w.fs().toolbar().search().text(), ""); + assert!(w.in_field(), "and the keyboard stays in the field"); + w.h.key("Esc"); + w.h.render(); + assert!(w.in_list(), "the second Esc returns to the list"); +} + +#[test] +fn the_three_chords_focus_the_field() { + for chord in ["Ctrl+F", "Ctrl+E", "F3"] { + let mut w = window(&reports(), 900); + assert!(!w.in_field()); + w.h.key(chord); + w.h.render(); + assert!(w.in_field(), "{chord}"); + } +} + +#[test] +fn the_search_clears_when_the_tab_navigates() { + let mut w = window(&reports(), 900); + w.type_in("inv"); + w.h.key("Enter"); + w.h.render(); + assert_eq!(w.labels(), ["invoices"]); + w.h.key("Enter"); + w.pump(); + assert_eq!(w.labels(), ["a.txt"], "the folder opened, whole"); + assert_eq!(w.fs().toolbar().search().text(), "", "the field is empty again"); + assert_eq!(w.fs().tabs().active().search.text, ""); +} + +#[test] +fn each_tab_keeps_its_own_search() { + let mut w = window(&reports(), 900); + w.type_in("rep"); + w.settle_search(); + assert_eq!(w.rows(), 1); + w.h.key("Ctrl+T"); + w.pump(); + assert_eq!(w.fs().tabs().len(), 2); + assert_eq!(w.fs().toolbar().search().text(), "", "the new tab has none"); + w.h.key("Ctrl+1"); + w.pump(); + assert_eq!(w.fs().toolbar().search().text(), "rep", "the first tab's field comes back with its text"); + assert_eq!(w.rows(), 1, "and its list is still narrowed"); +} + +#[test] +fn nothing_found_says_so_and_the_button_clears_the_search() { + let mut w = window(&reports(), 900); + w.type_in("preventivo"); + w.settle_search(); + assert_eq!(w.rows(), 0); + assert!(w.fs().states().shows_no_match()); + assert!(w.has_label("No item matches \u{201c}preventivo\u{201d} in this folder"), "{}", w.h.a11y_dump()); + assert!(w.h.a11y_dump().contains("Clear search")); + // The button is the first of the state: Tab reaches it, Enter takes the search away. + for _ in 0..40 { + if w.h.focused().is_some_and(|n| n.owner() == states::ID_FIRST) { + break; + } + w.h.key("Tab"); + } + w.h.key("Enter"); + w.h.render(); + assert_eq!(w.rows(), 5, "the whole folder is back"); + assert_eq!(w.fs().toolbar().search().text(), ""); + assert!(!w.fs().states().shows_no_match()); +} + +#[test] +fn the_field_is_300_wide_then_200_then_an_icon() { + let wide = window(&reports(), 900); + let (r, button) = wide.fs().toolbar().search().rects(); + assert_eq!(r.w(), 300); + assert!(button.is_empty()); + let small = window(&reports(), 899); + assert_eq!(small.fs().toolbar().search().rects().0.w(), 200); + let icon = window(&reports(), 699); + let (r, button) = icon.fs().toolbar().search().rects(); + assert!(r.is_empty(), "no field"); + assert_eq!(button.w(), button.h(), "an icon-only button"); + assert_eq!(icon.fs().toolbar().search().narrow(), (true, false)); +} + +#[test] +fn the_icon_opens_the_field_over_the_path_until_escape() { + let mut w = window(&reports(), 640); + w.h.key("Ctrl+F"); + w.h.render(); + assert_eq!(w.fs().toolbar().search().narrow(), (true, true)); + assert!(w.in_field()); + assert!(w.fs().toolbar().search().rects().0.w() > 300, "over the path field"); + w.h.key("Esc"); + w.h.render(); + assert_eq!(w.fs().toolbar().search().narrow(), (true, false), "Esc closes it"); + assert!(w.in_list()); +} + +#[test] +fn families_narrow_the_folder_together_with_the_search() { + let rows = [ + ("papers", true, 0, day(1)), + ("a.png", false, 5, day(2)), + ("b.JPG", false, 5, day(3)), + ("c.txt", false, 5, day(4)), + ("d.mp3", false, 5, day(5)), + ("tool.exe", false, 5, day(6)), + ("unknown.xyz", false, 5, day(7)), + ]; + let mut w = window(&rows, 900); + let item = |f: NameFamily| filter_pick::BASE + NameFamily::ALL.iter().position(|x| *x == f).unwrap() as u32; + w.pick(item(NameFamily::Images)); + assert_eq!(w.labels(), ["a.png", "b.JPG"]); + assert!(w.has_label("Filter: Images \u{b7} 2 of 7 items"), "{}", w.h.a11y_dump()); + w.pick(item(NameFamily::Folders)); + assert_eq!(w.labels(), ["papers", "a.png", "b.JPG"], "several at once"); + w.type_in("a"); + w.settle_search(); + assert_eq!(w.labels(), ["papers", "a.png"], "combined with the search"); + w.pick(filter_pick::SHOW_ALL); + assert_eq!(w.rows(), 2, "Show all clears the families, the search stays"); + w.h.key("Esc"); + w.h.render(); + assert_eq!(w.rows(), 7); + w.pick(item(NameFamily::Programs)); + assert_eq!(w.labels(), ["tool.exe"]); + w.pick(filter_pick::SHOW_ALL); + w.pick(item(NameFamily::Other)); + assert_eq!(w.labels(), ["unknown.xyz"]); +} + +#[test] +fn a_refresh_keeps_the_list_narrowed() { + let mut w = window(&reports(), 900); + w.type_in("rep"); + w.settle_search(); + assert_eq!(w.rows(), 1); + w.f.enumr.queue(&wp(ROOT), fakes::listing(&reports())); + w.h.key("F5"); + w.pump(); + w.pump(); + assert_eq!(w.fs().toolbar().search().text(), "rep"); + assert_eq!(w.labels(), ["report-final-v2.pdf"], "the refreshed list is narrowed again"); + assert!(w.has_label("1 of 5 items"), "{}", w.h.a11y_dump()); +} + +#[test] +fn back_to_a_cached_folder_shows_it_whole() { + let mut w = window(&reports(), 900); + w.type_in("inv"); + w.h.key("Enter"); + w.h.render(); + assert_eq!(w.labels(), ["invoices"]); + w.h.key("Enter"); + w.pump(); + assert_eq!(w.labels(), ["a.txt"]); + w.f.enumr.queue(&wp(ROOT), fakes::listing(&reports())); + w.h.key("Alt+Left"); + w.h.render(); + assert_eq!(w.rows(), 5, "the cached list is whole at once: {:?}", w.labels()); + w.pump(); + w.pump(); + assert_eq!(w.rows(), 5, "and after the revalidation"); + assert_eq!(w.fs().toolbar().search().text(), ""); +} diff --git a/apps/files/tests/ui_side.rs b/apps/files/tests/ui_side.rs index 1b270bf2..a8795c1b 100644 --- a/apps/files/tests/ui_side.rs +++ b/apps/files/tests/ui_side.rs @@ -13,6 +13,8 @@ use files_engine::drives::{self, Budget, DriveApi, DriveInfo, DriveKind}; use files_engine::fakes::Fakes; use files_engine::format::Fmt; use files_engine::home; +use files_engine::icons::ArtBook; +use files_engine::knownfolders::{KnownFolders, KnownName}; use files_engine::listing::WidePath; use files_engine::msg::{Fwd, JobDone, Msg}; use files_engine::options::FilesOptions; @@ -20,10 +22,10 @@ use files_engine::services::ReqOwner; use files_engine::shell_client::ShellReply; use files_engine::sidebar::{self, Inputs, RowKind}; use files_engine::window::{FilesScreen, Shared}; -use files_engine::{open, pins}; +use files_engine::{open, pins, status}; use oled_trust::frame::files::{Location, ReqId, ShellEvt, ShellReq}; use oled_ui::harness::Harness; -use oled_ui::model::FgRole; +use oled_ui::widgets::sidebar::{NavAction, NavEntry}; use oled_ui::{PointL, SizeL, Tokens, UiLang, WidgetId}; fn wp(s: &str) -> WidePath { @@ -52,21 +54,43 @@ fn pc_drives() -> Vec { /// build() over made-up state. fn built(pins: &[&str], drives: &[DriveInfo], net: &[&str]) -> sidebar::Built { - let fmt = Fmt::fixed_en(); let (pins, net): (Vec, Vec) = (pins.iter().map(|p| wp(p)).collect(), net.iter().map(|p| wp(p)).collect()); - let (missing, expanded, children) = (HashSet::new(), HashSet::new(), HashMap::new()); + build_over(&pins, drives, &net, &KnownFolders::default(), &HashSet::new()) +} + +/// build() with known folders and the pins known not to exist. +fn build_with( + pins: &[WidePath], + drives: &[DriveInfo], + known: &KnownFolders, + missing: &HashSet, +) -> sidebar::Built { + build_over(pins, drives, &[], known, missing) +} + +fn build_over( + pins: &[WidePath], + drives: &[DriveInfo], + net: &[WidePath], + known: &KnownFolders, + missing: &HashSet, +) -> sidebar::Built { + let fmt = Fmt::fixed_en(); + let (expanded, children) = (HashSet::new(), HashMap::new()); sidebar::build(&Inputs { lang: UiLang::EN, fmt: &fmt, like_explorer: false, - pins: &pins, - missing: &missing, + pins, + missing, drives, - network: &net, + network: net, expanded: &expanded, children: &children, busy: None, + art: &ArtBook::empty(), + known, }) } @@ -108,11 +132,13 @@ fn row_at(h: &Harness, pred: impl Fn(&sidebar::Row) -> bool) -> usi sidebar::of(h.screen()).rows().iter().position(pred).expect("the row is there") } -/// The centre of a row's expander (dx 6) or label (dx 60), at 96 dpi where logical px are physical px. +/// A point in a row: dx from its plate's left edge (6 is the expander, 60 the label), at 96 dpi where logical px are +/// physical px; the vertical middle of the first line. fn row_pt(h: &Harness, idx: usize, dx: i32, depth: i32) -> PointL { let sb = sidebar::of(h.screen()); - let (pane, first) = (sb.pane(), sb.first_row()); - PointL { x: pane.l + 8 + dx + 16 * depth, y: pane.t + 28 * (idx - first) as i32 + 14 } + let rect = sb.entry_rect(sb.rows()[idx].key).expect("the row is shown"); + let dy = if matches!(sb.rows()[idx].kind, RowKind::Drive(_)) && rect.h() > 40 { 18 } else { rect.h() / 2 }; + PointL { x: rect.l + dx + 16 * depth, y: rect.t + dy } } fn location(h: &Harness) -> Location { @@ -129,7 +155,8 @@ fn sections_and_rows() { assert_eq!( labels(&b), [ - "Pinned", + "Home", + "Quick access", "work", "media", "This PC", @@ -138,55 +165,229 @@ fn sections_and_rows() { "Network", "Z:", r"\\made-up-server\share", - "Network \u{2197}", - "Recycle Bin \u{2197}" + "Network", + "Recycle Bin" ] ); let kinds: Vec = b.rows.iter().map(|r| r.kind).collect(); - assert_eq!(kinds[0], RowKind::Section); - assert_eq!(kinds[1], RowKind::Pin); - assert_eq!(kinds[4], RowKind::Drive(b'C')); - assert_eq!(kinds[8], RowKind::Net); - assert_eq!(kinds[9], RowKind::NetHand); - assert_eq!(kinds[10], RowKind::Recycle); + assert_eq!(kinds[0], RowKind::Home); + assert_eq!(kinds[1], RowKind::Section); + assert_eq!(kinds[2], RowKind::Pin); + assert_eq!(kinds[5], RowKind::Drive(b'C')); + assert_eq!(kinds[9], RowKind::Net); + assert_eq!(kinds[10], RowKind::NetHand); + assert_eq!(kinds[11], RowKind::Recycle); let keys: HashSet = b.rows.iter().map(|r| r.key).collect(); assert_eq!(keys.len(), b.rows.len(), "every row has its own key"); - assert!(b.items[0].section && !b.items[1].section); - let sys = &b.items[4]; - assert_eq!(sys.trailing.as_ref().map(|t| t.0.to_string()), Some(Fmt::fixed_en().size(412 * GB, false))); + assert!(b.items[1].section && !b.items[2].section); + let heights: Vec = b.rows.iter().map(|r| r.h).collect(); + assert_eq!(heights, [32, 30, 32, 32, 30, 46, 46, 30, 32, 32, 32, 32], "sections 30, drives 46, entries 32"); + let sys = entry_of(&b, "System (C:)").drive.as_ref().expect("a drive entry"); + assert_eq!(sys.free.to_string(), "384 GB free"); + assert!((sys.used - 0.588).abs() < 0.001); + for hand in ["Network", "Recycle Bin"] { + let it = b.items.iter().rev().find(|i| i.label == hand).expect("the hand-off"); + let action = b.entries.iter().find(|(k, _)| *k == it.key).and_then(|(_, e)| e.action.as_ref()); + assert!(matches!(action, Some((NavAction::External, _))), "{hand} ends in the external arrow"); + } + let pin = b.items.iter().find(|i| i.label == "work").expect("the pin"); + let action = b.entries.iter().find(|(k, _)| *k == pin.key).and_then(|(_, e)| e.action.as_ref()); + assert!(matches!(action, Some((NavAction::Pin, tip)) if *tip == "Remove from Quick access")); } #[test] -fn pinned_section_is_hidden_without_pins() { +fn quick_access_is_hidden_without_pins_or_known_folders() { let b = built(&[], &pc_drives(), &[]); - assert_eq!(labels(&b)[0], "This PC"); + assert_eq!(&labels(&b)[..2], ["Home", "This PC"]); +} + +fn kf(list: &[(KnownName, &str)]) -> KnownFolders { + KnownFolders::new(list.iter().map(|(n, p)| (*n, wp(p))).collect(), Some(b'C')) } #[test] -fn low_space_is_attention() { - let b = built(&[], &pc_drives(), &[]); - let role = |i: usize| b.items[i].trailing.as_ref().map(|t| t.1); - assert!(matches!(role(1), Some(FgRole::Tertiary)), "412 of 1000 GB free"); - assert!(matches!(role(2), Some(FgRole::Attention)), "50 of 1000 GB free: under 10 %"); - let low = [drive(b'E', Some("Tiny"), DriveKind::Fixed, Some(5 * GB), Some(100 * GB), true)]; - let b = built(&[], &low, &[]); - assert!(matches!(b.items[1].trailing.as_ref().map(|t| t.1), Some(FgRole::Attention)), "5 % free"); - let edge = [drive(b'E', None, DriveKind::Fixed, Some(10 * GB), Some(100 * GB), true)]; - assert!( - matches!(built(&[], &edge, &[]).items[1].trailing.as_ref().map(|t| t.1), Some(FgRole::Tertiary)), - "10 % is not under" +fn known_folders_are_fixed_found_by_path_and_only_when_they_exist() { + // The folders' own names mean nothing: the entries are found by path and named by the table. + let known = kf(&[ + (KnownName::Videos, r"D:\made-up\clips"), + (KnownName::Profile, r"C:\made-up\user"), + (KnownName::Desktop, r"C:\made-up\user\Bureau"), + (KnownName::Documents, r"C:\made-up\user\Documents"), + ]); + let (pins, none): (Vec, HashSet) = (vec![wp(r"C:\made-up\Desktop")], HashSet::new()); + let b = build_with(&pins, &pc_drives(), &known, &none); + assert_eq!( + &labels(&b)[..6], + ["Home", "Quick access", "Desktop", "Documents", "Videos", "Desktop"], + "fixed order, then the pin of another folder that is only called Desktop" ); + let kinds: Vec = b.rows.iter().map(|r| r.kind).collect(); + assert_eq!(&kinds[2..6], [RowKind::Known, RowKind::Known, RowKind::Known, RowKind::Pin]); + assert_eq!(b.rows[2].path, Some(wp(r"C:\made-up\user\Bureau"))); + // One whose check found it missing is left out, whatever its name. + let missing: HashSet = [pins::same_key(r"C:\made-up\user\Documents")].into_iter().collect(); + let b = build_with(&[], &pc_drives(), &known, &missing); + assert_eq!(&labels(&b)[..5], ["Home", "Quick access", "Desktop", "Videos", "This PC"]); + // A pin that is one of the folders is not listed twice; the profile is not one of the six. + let twice = [wp(r"c:\MADE-UP\user\documents"), wp(r"C:\made-up\user")]; + let b = build_with(&twice, &pc_drives(), &known, &HashSet::new()); + assert_eq!(&labels(&b)[..6], ["Home", "Quick access", "Desktop", "Documents", "Videos", "user"]); } #[test] -fn network_drive_has_no_size() { +fn capacity_thresholds() { + let d = |free: u64| drive(b'E', None, DriveKind::Fixed, Some(free), Some(1000), true); + let used = |free: u64| sidebar::used_fraction(&d(free)).expect("a size"); + assert!((used(412) - 0.588).abs() < 0.001); + assert!(!status::attention(used(100)), "exactly 90 % used is not over"); + assert!(status::attention(used(99)), "90.1 % used is"); + assert!(sidebar::low_space(&d(99)) && !sidebar::low_space(&d(100))); + assert_eq!(sidebar::used_fraction(&drive(b'E', None, DriveKind::Fixed, None, None, true)), None); + assert_eq!(sidebar::used_fraction(&drive(b'E', None, DriveKind::Fixed, Some(0), Some(0), true)), None); + // The sidebar's entry carries the same share, and the status line the same words and verdict. + let b = built(&[], &[drive(b'E', Some("Tiny"), DriveKind::Fixed, Some(5 * GB), Some(100 * GB), true)], &[]); + let line = entry_of(&b, "Tiny (E:)").drive.as_ref().expect("a drive entry"); + assert!((line.used - 0.95).abs() < 0.001); +} + +#[test] +fn network_and_not_ready_drives() { let net = [drive(b'Z', Some("Share"), DriveKind::Network, Some(5 * GB), Some(100 * GB), true)]; let b = built(&[], &net, &[]); let z = b.items.iter().find(|i| i.label == "Share (Z:)").expect("the mapped drive"); - assert!(z.trailing.is_none(), "no size for a network drive"); + assert!(z.trailing.is_none() && maybe_entry(&b, "Share (Z:)").is_none(), "no capacity line for a network drive"); let off = [drive(b'E', Some("Empty"), DriveKind::Optical, None, None, false)]; let b = built(&[], &off, &[]); - assert!(b.items[1].disabled && b.items[1].trailing.is_none(), "not ready: disabled, no size"); + let i = b.items.iter().position(|i| i.label == "Empty (E:)").expect("the drive"); + assert!(b.items[i].disabled, "not ready: disabled"); + let e = entry_of(&b, "Empty (E:)"); + assert_eq!(e.not_ready.as_ref().map(|t| t.to_string()), Some("Not ready".to_string())); + assert_eq!(b.rows[i].h, 46, "it keeps its drive entry's height"); +} + +#[test] +fn status_texts_in_both_languages() { + let c = drive(b'C', Some("System"), DriveKind::Fixed, Some(412 * GB), Some(1990 * GB), true); + for (fmt, lang, name, free_of) in [ + (Fmt::fixed_en(), UiLang::EN, "System (C:)", "free of"), + (Fmt::fixed_it(), UiLang::IT, "System (C:)", "liberi di"), + ] { + let shown = status::drive_shown(&c, None, &fmt, lang).expect("a size"); + assert_eq!(shown.name, name); + let want = format!("{} {free_of} {}", fmt.size(412 * GB, false), fmt.size(1990 * GB, false)); + assert_eq!(shown.free_text, want); + assert!(!shown.attention); + } + // The volume's own answer wins over the cache's, and near-full asks for attention. + let shown = status::drive_shown(&c, Some(50 * GB), &Fmt::fixed_en(), UiLang::EN).expect("a size"); + assert!(shown.attention && (shown.used - 0.975).abs() < 0.001); + assert!(status::drive_shown( + &drive(b'C', None, DriveKind::Fixed, Some(1), None, true), + None, + &Fmt::fixed_en(), + UiLang::EN + ) + .is_none()); +} + +#[test] +fn selection_text_has_one_comma_and_its_own_separator() { + for (fmt, lang, want) in + [(Fmt::fixed_en(), UiLang::EN, "1 selected, "), (Fmt::fixed_it(), UiLang::IT, "1 selezionato, ")] + { + let f = Fakes::new(); + f.options.set(FilesOptions::default()); + let shared = f.shared(lang); + *shared.fmt.borrow_mut() = Rc::new(fmt); + f.enumr.queue(&wp(r"C:\made-up\work"), files_engine::preview::fixtures::documents()); + let tab = shared.new_tab(); + let s = FilesScreen::new(shared, 1, Location::Fs(wp(r"C:\made-up\work")), None, tab); + let mut h = Harness::new(s, WIDE, 96, Tokens::oled()).lang(if lang == UiLang::IT { + oled_ui::Lang::It + } else { + oled_ui::Lang::En + }); + h.render(); + f.pump(&mut h, 1); + h.render(); + h.key("Home").key("Down").key("Down").key("Down").key("Down"); + h.render(); + let dump = h.a11y_dump(); + assert!(dump.contains(want), "{want:?} is in the line: {dump}"); + } +} + +#[test] +fn status_line_parts_never_collide() { + use files_engine::ops_ui::{self, OpRow, OpState}; + use oled_trust::frame::files::{OpId, OpKind}; + use oled_ui::RectP; + let sizes = |w: i32| SizeL { w, h: 400 }; + let mut seen_full = false; + let mut seen_drop = false; + for op in [false, true] { + for w in (200..=900).step_by(20) { + let f = Fakes::new(); + f.options.set(FilesOptions::default()); + let shared = f.shared(UiLang::EN); + *shared.fmt.borrow_mut() = Rc::new(Fmt::fixed_en()); + for d in pc_drives() { + shared.drives.borrow_mut().set(d); + } + f.enumr.queue(&wp(r"C:\made-up\work"), files_engine::preview::fixtures::documents()); + let tab = shared.new_tab(); + let s = FilesScreen::new(Rc::clone(&shared), 1, Location::Fs(wp(r"C:\made-up\work")), None, tab); + let mut h = Harness::new(s, sizes(w), 96, Tokens::oled()); + h.render(); + f.pump(&mut h, 1); + h.render(); + h.key("Home").key("Down").key("Down").key("Down").key("Down"); + if op { + let mut r = OpRow::new(OpId(1), OpKind::DeletePermanent, 1); + r.count = 2; + r.state = OpState::Running; + shared.ops.borrow_mut().insert(r); + h.send(Box::new(Msg::Fwd(Fwd::Ops))); + } + h.render(); + let fs = h.screen(); + let p = fs.status().placed(); + let chip = ops_ui::flyout_of(fs).chip().map(|(r, _)| r); + assert_eq!(chip.is_some(), op, "{w}"); + let shown: Vec<(&str, RectP)> = + [("items", p.items), ("selection", p.selection), ("drive", p.drive), ("free", p.free)] + .into_iter() + .filter(|(_, r)| !r.is_empty()) + .collect(); + let (x0, x1) = (16, w - 16); + for (n, r) in &shown { + assert!(r.l >= x0 && r.r <= x1 && r.l <= r.r, "{n} inside the line at {w}: {r:?}"); + if let Some(c) = chip { + assert!(r.r <= c.l || r.l >= c.r, "{n} clear of the chip at {w} (op {op}): {r:?} vs {c:?}"); + } + } + for pair in shown.windows(2) { + assert!(pair[0].1.r <= pair[1].1.l, "{} before {} at {w} (op {op}): {pair:?}", pair[0].0, pair[1].0); + } + if !op && w == 900 { + assert_eq!(shown.len(), 4, "all four parts fit: {shown:?}"); + seen_full = true; + } + if p.drive.is_empty() && !p.free.is_empty() { + seen_drop = true; + } + } + } + assert!(seen_full && seen_drop, "the drive block goes before the free text"); +} + +fn entry_of<'a>(b: &'a sidebar::Built, label: &str) -> &'a NavEntry { + maybe_entry(b, label).expect("it has extras") +} + +fn maybe_entry<'a>(b: &'a sidebar::Built, label: &str) -> Option<&'a NavEntry> { + let key = b.items.iter().find(|i| i.label == label).map(|i| i.key).expect("the entry"); + b.entries.iter().find(|(k, _)| *k == key).map(|(_, e)| e) } struct Api { @@ -254,8 +455,8 @@ fn fold_below_760() { let f = Fakes::new(); let h = window_with(&f, FilesOptions::default(), WIDE, Location::Fs(wp(r"C:\made-up\work"))); assert!(sidebar::of(h.screen()).is_shown()); - assert_eq!(h.screen().rects().side.w(), 201, "the default width and the line"); - assert!(h.screen().rects().body.l > 200, "the body sits beside it"); + assert_eq!(h.screen().rects().side.w(), 225, "the default width and the line"); + assert!(h.screen().rects().body.l > 224, "the body sits beside it"); } #[test] @@ -276,14 +477,14 @@ fn ctrl_b_toggles() { fn width_is_saved_after_the_drag() { let f = Fakes::new(); let mut h = window_with(&f, FilesOptions::default(), WIDE, Location::Fs(wp(r"C:\made-up\work"))); - h.drag(PointL { x: 200, y: 300 }, PointL { x: 300, y: 300 }); + h.drag(PointL { x: 224, y: 300 }, PointL { x: 300, y: 300 }); h.render(); let saved: Vec = f.options.modifications().iter().map(|o| o.sidebar_width).collect(); assert_eq!(saved.len(), 1, "one write for the whole drag: {saved:?}"); assert_eq!(saved[0], 300); h.double_click(PointL { x: 300, y: 300 }); h.render(); - assert_eq!(f.options.modifications().last().map(|o| o.sidebar_width), Some(200), "a double click resets"); + assert_eq!(f.options.modifications().last().map(|o| o.sidebar_width), Some(224), "a double click resets"); } #[test] @@ -294,10 +495,16 @@ fn current_row_follows_navigation() { let rows = sidebar::of(h.screen()).rows().to_vec(); let pin = rows.iter().find(|r| r.kind == RowKind::Pin).expect("pin").key; let c = rows.iter().find(|r| r.kind == RowKind::Drive(b'C')).expect("C").key; - assert_eq!(sidebar::current_key(&rows, &location(&h)), Some(pin), "the deepest row holding the folder"); - assert_eq!(sidebar::current_key(&rows, &Location::Fs(wp(r"C:\elsewhere"))), Some(c)); - assert_eq!(sidebar::current_key(&rows, &Location::Fs(wp(r"E:\x"))), None); - assert_eq!(sidebar::current_key(&rows, &Location::Home), None); + let home = rows.iter().find(|r| r.kind == RowKind::Home).expect("Home").key; + assert_eq!(sidebar::current_key(&rows, &location(&h)), None, "a folder inside the pin has no entry of its own"); + assert_eq!( + sidebar::current_key(&rows, &Location::Fs(wp(r"c:\MADE-UP\work"))), + Some(pin), + "the same path, any case" + ); + assert_eq!(sidebar::current_key(&rows, &Location::Fs(wp(r"C:\"))), Some(c), "a drive's root is the drive's entry"); + assert_eq!(sidebar::current_key(&rows, &Location::Fs(wp(r"C:\elsewhere"))), None); + assert_eq!(sidebar::current_key(&rows, &Location::Home), Some(home)); // A click on a row goes there. let i = row_at(&h, |r| r.kind == RowKind::Drive(b'D')); h.click(row_pt(&h, i, 60, 0)); @@ -613,3 +820,54 @@ fn home_steps_stay_inside_their_section() { assert_eq!(home::step(items, 2, oled_ui::Key::UP, 4), None, "the first row of the drives"); assert_eq!(home::step(items, 2, oled_ui::Key::DOWN, 4), Some(3)); } + +#[test] +fn trailing_pin_unpins_and_the_entry_still_opens() { + let f = Fakes::new(); + let mut h = window_with(&f, opts_with_pins(&[r"C:\made-up\work", r"D:\made-up\media"]), WIDE, Location::Home); + let shared = shared_of(&h); + h.render(); + let rows = sidebar::of(h.screen()).rows().to_vec(); + let work = rows.iter().find(|r| r.kind == RowKind::Pin).expect("a pin").clone(); + let pin = sidebar::of(h.screen()).pin_rect(work.key).expect("a pinned folder has its trailing pin"); + let entry = sidebar::of(h.screen()).entry_rect(work.key).expect("shown"); + assert!(pin.r <= entry.r && pin.l > entry.l + entry.w() / 2, "at the right end of the entry"); + h.click(PointL { x: (pin.l + pin.r) / 2, y: (pin.t + pin.b) / 2 }); + h.render(); + assert_eq!(pins::paths(&shared).len(), 1, "one click unpins"); + assert_eq!(pins::paths(&shared)[0], wp(r"D:\made-up\media")); + assert_eq!(location(&h), Location::Home, "the click did not open the folder"); + // The entry's own area opens the folder. + let left = sidebar::of(h.screen()).rows().iter().position(|r| r.kind == RowKind::Pin).expect("the other pin"); + h.click(row_pt(&h, left, 60, 0)); + assert_eq!(location(&h), Location::Fs(wp(r"D:\made-up\media"))); +} + +#[test] +fn keyboard_walks_the_entries_in_order_and_skips_labels() { + let f = Fakes::new(); + let mut h = window_with(&f, opts_with_pins(&[r"C:\made-up\work"]), WIDE, Location::Home); + set_drives(&mut h, &pc_drives()); + let rows = sidebar::of(h.screen()).rows().to_vec(); + let home = rows.iter().position(|r| r.kind == RowKind::Home).expect("Home"); + h.click(row_pt(&h, home, 60, 0)); + h.render(); + let slot_row = |h: &Harness| { + let n = h.focused().expect("the focus is in the sidebar"); + let sb = sidebar::of(h.screen()); + sb.rows().get(sb.first_row() + n.slot() as usize - 1).map(|r| r.kind) + }; + let mut seen = vec![slot_row(&h)]; + for _ in 0..6 { + h.key("Down"); + h.render(); + seen.push(slot_row(&h)); + } + let want: Vec> = + [RowKind::Home, RowKind::Pin, RowKind::Drive(b'C'), RowKind::Drive(b'D'), RowKind::NetHand, RowKind::Recycle] + .into_iter() + .map(Some) + .collect(); + assert_eq!(&seen[..want.len()], &want[..], "Home, the pin, the drives, then the two hand-offs; labels are skipped"); + assert_eq!(seen[want.len()], Some(RowKind::Recycle), "the last entry stays"); +} diff --git a/apps/files/tests/ui_tabs.rs b/apps/files/tests/ui_tabs.rs index 7a79c153..ace87c29 100644 --- a/apps/files/tests/ui_tabs.rs +++ b/apps/files/tests/ui_tabs.rs @@ -582,7 +582,7 @@ fn access_denied_after_a_hit_shows_no_rows_of_the_folder_the_tab_left() { assert!(w.labels().is_empty(), "the failed folder's empty listing is on show: {:?}", w.labels()); assert_eq!(w.fs().hit_state(tab), None); assert!( - dump(&w).contains("denied") || dump(&w).contains("Denied") || dump(&w).contains("permission"), + dump(&w).contains("denied") || dump(&w).contains("Denied") || dump(&w).contains("have access"), "{}", dump(&w) ); diff --git a/apps/files/tests/undo.rs b/apps/files/tests/undo.rs index b06d95f6..147eaefd 100644 --- a/apps/files/tests/undo.rs +++ b/apps/files/tests/undo.rs @@ -13,7 +13,7 @@ use files_engine::fakes::{self, Fakes, OpsCall, FT_2026_11_21}; use files_engine::format::Fmt; use files_engine::listing::WidePath; use files_engine::ops::classify::{NoBin, Recyclability}; -use files_engine::ops_client::{OpsEvent, UndoRecord}; +use files_engine::ops_client::{OpsError, OpsEvent, UndoRecord}; use files_engine::ops_ui::{self, MutReq}; use files_engine::undo::{UndoEntry, UndoStack, UNDO_CAP}; use files_engine::window::{FilesScreen, Shared, WinKind, WinRec}; @@ -327,7 +327,7 @@ fn redo_after_undo() { w.emit(done(2, None)); w.pump(); assert_eq!(w.redo_len(), 1); - assert_eq!(w.shared.undo.borrow().redo_label(UiLang::EN).as_deref(), Some("Redo")); + assert_eq!(w.shared.undo.borrow().redo_label(UiLang::EN).as_deref(), Some("Redo Rename")); w.key("Ctrl+Y"); assert_eq!(w.calls().last(), Some(&OpsCall::Rename(w.path("a-notes.txt"), "b-notes.txt".into()))); assert_eq!(w.redo_len(), 0); @@ -401,8 +401,8 @@ fn redo_of_restore_classifies() { #[test] fn refused_redo_leaves_no_mark() { - // A redo whose bar requests the gate refuses (items outside the test roots): the next, unrelated operation is a - // new one again and clears the redo stack. + // A redo whose bar requests are refused (the helper refuses here; with real data off the gate refuses first, the + // items lying outside the test roots): the next, unrelated operation is a new one again and clears the redo stack. let mut w = in_root("undo_redo_refused"); let (a, bin) = (wp(r"C:\made-up\elsewhere\a-notes.txt"), wp(r"C:\$Recycle.Bin\S-1-5-21-0\$R0002.txt")); let rec = UndoRecord { @@ -419,11 +419,14 @@ fn refused_redo_leaves_no_mark() { w.key("Ctrl+Y"); w.pump(); assert!(bar::bar_of(&w.h.screen().0).is_open()); + w.f.ops.set_fail(Some(OpsError::Refused(Refusal::Root))); w.key("Enter"); - assert!(w.calls().is_empty(), "the gate refused: {:?}", w.calls()); + w.f.ops.set_fail(None); + assert!(w.shared.ops.borrow().rows().is_empty(), "refused: {:?}", w.calls()); assert_eq!(w.redo_len(), 1); w.h.send(Box::new(Op::Select(vec!["b-report-final-v2.pdf"]))); w.key("Shift+Del"); + w.key("Enter"); assert!(matches!(w.calls().last(), Some(OpsCall::DeletePermanent(_)))); assert_eq!(w.redo_len(), 0, "a new operation clears the redo stack"); } @@ -446,6 +449,7 @@ fn new_op_clears_redo() { // A delete is. w.h.send(Box::new(Op::Select(vec!["b-report-final-v2.pdf"]))); w.key("Shift+Del"); + w.key("Enter"); assert!(matches!(w.calls().last(), Some(OpsCall::DeletePermanent(_)))); assert_eq!(w.redo_len(), 0); } diff --git a/apps/gallery/Cargo.toml b/apps/gallery/Cargo.toml index f9fa55eb..dd2a530b 100644 --- a/apps/gallery/Cargo.toml +++ b/apps/gallery/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gallery" -version = "1.8.1" +version = "1.9.0" edition = "2021" rust-version = "1.87" license = "MIT" diff --git a/apps/gallery/src/bench/chart.rs b/apps/gallery/src/bench/chart.rs new file mode 100644 index 00000000..315d723c --- /dev/null +++ b/apps/gallery/src/bench/chart.rs @@ -0,0 +1,126 @@ +//! The chart bench: what one frame of the Performance page's charts costs at 4K: one main chart with its grid, area, +//! threshold and read-out, four sparklines and a grid of 16 cells. A frame is a full 3840 x 2160 render through the Harness, +//! reported less the empty screen's frame (see raster.rs), against the same row as the raster bench (frame.raster_4k): a +//! whole page of charts must cost what a whole settings page costs. + +use super::raster::{empty_frame_ms, RUNS, WARMUP}; +use super::run; +use oled_ui::command::CommandTable; +use oled_ui::cx::{EventCx, LayoutCx, PaintCx}; +use oled_ui::event::{Event, Reply}; +use oled_ui::geom::{RectP, SizeL, SizeP}; +use oled_ui::harness::Harness; +use oled_ui::node::{Text, WidgetId}; +use oled_ui::screen::{Screen, Widget}; +use oled_ui::theme::{Ink, Tokens}; +use oled_ui::widgets::{ChartStyle, LineChart, LineScale, LineSeries, MultiCell, SmallMultiples}; + +/// The window of the bench in logical px: 3840 x 2160 physical at 192 DPI. +const WINDOW: SizeL = SizeL { w: 1920, h: 1080 }; +const CPU: Ink = Ink::solid(0x4E, 0xA4, 0xE8); + +/// A repeatable value in 0..100 (no clock, no entropy). +fn wave(i: usize, seed: usize) -> f32 { + let x = (i + seed * 17) as f32; + (50.0 + 30.0 * (x / 5.0).sin() + 15.0 * (x / 1.7).cos()).clamp(0.0, 100.0) +} + +fn trace(seed: usize) -> Vec { + (0..60).map(|i| wave(i, seed)).collect() +} + +/// The page: the main chart over the sparklines and the grid. +pub(crate) struct Charts { + main: LineChart, + sparks: Vec, + grid: SmallMultiples, + cmds: CommandTable, +} + +impl Charts { + pub(crate) fn new() -> Charts { + let mut main = LineChart::new(WidgetId(1), Text::from("CPU"), ChartStyle::Main, LineScale::Percent); + main.set(&[LineSeries::new(&trace(1), CPU).with_area()]); + main.set_threshold(Some(80.0)); + main.set_labels(|m| format!("{m:.0} %"), Text::from("60 seconds ago"), Text::from("now")); + main.set_readout(|age, v| (format!("{age} seconds ago"), format!("{:.0} %", v[0]))); + main.show_readout(Some(18)); + let sparks = (0..4) + .map(|i| { + let mut s = + LineChart::new(WidgetId(10 + i), Text::from("Spark"), ChartStyle::Spark, LineScale::Percent); + s.set(&[LineSeries::new(&trace(2 + i as usize), CPU).with_area()]); + s + }) + .collect(); + let mut grid = SmallMultiples::new(WidgetId(30), CPU, 8); + grid.set_threshold(Some(90.0)); + grid.set( + (0..16) + .map(|i| MultiCell { + label: Text::from(format!("P{i}")), + value: Text::from(format!("{:.0} %", wave(59, i + 9))), + values: trace(i + 9), + name: Text::from(format!("Logical processor {i}")), + }) + .collect(), + ); + Charts { main, sparks, grid, cmds: CommandTable::new() } + } +} + +impl Screen for Charts { + fn layout(&mut self, cx: &mut LayoutCx, avail: SizeP) -> SizeP { + self.main.layout(cx, RectP::wh(cx.px(24), cx.px(24), cx.px(1400), cx.px(380))); + for (i, s) in self.sparks.iter_mut().enumerate() { + s.layout(cx, RectP::wh(cx.px(24 + 120 * i as i32), cx.px(430), cx.px(92), cx.px(40))); + } + let h = self.grid.height(cx); + self.grid.layout(cx, RectP::wh(cx.px(24), cx.px(500), cx.px(1400), h)); + avail + } + + fn paint(&self, cx: &mut PaintCx) { + self.main.paint(cx); + for s in &self.sparks { + s.paint(cx); + } + self.grid.paint(cx); + } + + fn event(&mut self, _: &mut EventCx, _: &Event) -> Reply { + Reply::None + } + + fn commands(&self) -> &CommandTable { + &self.cmds + } +} + +/// The median ms of one 3840 x 2160 frame of the charts at 192 DPI (20 warm-up renders and 200 measured), less the +/// same frame of an empty screen. +pub fn charts_4k() -> Option { + let base = empty_frame_ms(WINDOW, 192); + let mut h = Harness::new(Charts::new(), WINDOW, 192, Tokens::oled()); + let full = run("charts_4k", WARMUP, RUNS, || { + std::hint::black_box(h.render()); + }); + println!("charts_4k: frame {full:.3} ms, empty frame {base:.3} ms"); + Some((full - base).max(0.0)) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn the_frame_draws_every_chart() { + let mut h = Harness::new(Charts::new(), WINDOW, 192, Tokens::oled()); + let img = h.render(); + assert_eq!((img.w, img.h), (3840, 2160)); + let lit = |r: RectP| img.crop(r).px.iter().any(|p| p & 0xFF != 0); + assert!(lit(RectP::wh(48, 48, 2800, 760)), "the main chart"); + assert!(lit(RectP::wh(48, 860, 184, 80)), "a sparkline"); + assert!(lit(RectP::wh(48, 1000, 2800, 300)), "the grid"); + } +} diff --git a/apps/gallery/src/bench/mod.rs b/apps/gallery/src/bench/mod.rs index e7a87f4c..868bca96 100644 --- a/apps/gallery/src/bench/mod.rs +++ b/apps/gallery/src/bench/mod.rs @@ -2,6 +2,7 @@ //! file and returns None ("not ready") until its task fills it. `gallery --bench` runs them at budget x 1.0 (x 1.5 when //! CI is set); tests/bench.rs and tests/bench_field.rs run the same bodies. +pub mod chart; pub mod field; pub mod raster; pub mod table; @@ -15,13 +16,14 @@ pub struct Bench { pub run: fn() -> Option, } -static BENCHES: [Bench; 6] = [ +static BENCHES: [Bench; 7] = [ Bench { name: "raster_4k_settings_like", budget: "frame.raster_4k", run: raster::raster_4k_settings_like }, Bench { name: "table_hover", budget: "frame.table_hover", run: table::table_hover }, Bench { name: "table_text_40x4", budget: "frame.table_text_40x4", run: table::table_text_40x4 }, Bench { name: "scroll_strip", budget: "frame.scroll_strip", run: table::scroll_strip }, Bench { name: "table_4k_full", budget: "frame.table_4k_full", run: table::table_4k_full }, Bench { name: "field_key", budget: "frame.field_key", run: field::field_key }, + Bench { name: "charts_4k", budget: "frame.raster_4k", run: chart::charts_4k }, ]; /// Every bench. @@ -189,7 +191,15 @@ mod tests { let names: Vec<&str> = all().iter().map(|b| b.name).collect(); assert_eq!( names, - ["raster_4k_settings_like", "table_hover", "table_text_40x4", "scroll_strip", "table_4k_full", "field_key"] + [ + "raster_4k_settings_like", + "table_hover", + "table_text_40x4", + "scroll_strip", + "table_4k_full", + "field_key", + "charts_4k" + ] ); assert!(all().iter().all(|b| b.budget.starts_with("frame."))); assert!(by_name("field_key").is_some() && by_name("nope").is_none()); diff --git a/apps/gallery/src/pages/art.rs b/apps/gallery/src/pages/art.rs new file mode 100644 index 00000000..073c0cd8 --- /dev/null +++ b/apps/gallery/src/pages/art.rs @@ -0,0 +1,119 @@ +//! The colour art page: every art at 16, 32 and 64 logical px, and a row at opacity 128 (hidden and cut items). + +use std::cell::RefCell; + +use super::Page; +use oled_ui::art::{Art, ArtCache}; +use oled_ui::command::CommandTable; +use oled_ui::cx::{EventCx, LayoutCx, PaintCx}; +use oled_ui::event::{Event, Reply}; +use oled_ui::geom::{PointP, SizeL, SizeP}; +use oled_ui::screen::Screen; +use oled_ui::strings::UiLang; +use oled_ui::theme::HcColors; + +/// (logical size, image opacity) of each block. +const BLOCKS: [(i32, u32); 4] = [(16, 255), (32, 255), (64, 255), (16, 128)]; +const COLUMNS: usize = 10; +const MARGIN: i32 = 12; +const COL_W: i32 = 72; +const BLOCK_GAP: i32 = 12; + +fn pitch(size: i32) -> i32 { + size + 12 +} + +fn rows() -> i32 { + Art::all().len().div_ceil(COLUMNS) as i32 +} + +fn page_size() -> SizeL { + let h: i32 = BLOCKS.iter().map(|(s, _)| rows() * pitch(*s)).sum::() + + BLOCK_GAP * (BLOCKS.len() as i32 - 1) + + MARGIN * 2; + SizeL { w: MARGIN * 2 + COLUMNS as i32 * COL_W, h } +} + +struct ArtPage { + commands: CommandTable, + cache: RefCell, +} + +impl Screen for ArtPage { + fn layout(&mut self, _cx: &mut LayoutCx, avail: SizeP) -> SizeP { + avail + } + + fn paint(&self, cx: &mut PaintCx) { + let t = cx.tokens(); + let hc = t.high_contrast.then_some(HcColors { + window: t.color.bg.rgb, + window_text: t.color.fg_primary.rgb, + highlight: t.color.fill_selected.rgb, + highlight_text: t.color.fg_hot.rgb, + gray_text: t.color.fg_disabled.rgb, + }); + let all = Art::all(); + let mut cache = self.cache.borrow_mut(); + let mut y = MARGIN; + for (size, opacity) in BLOCKS { + let dev = cx.px(size); + for (i, art) in all.iter().enumerate() { + let (col, row) = ((i % COLUMNS) as i32, (i / COLUMNS) as i32); + let x = MARGIN + col * COL_W + (COL_W - size) / 2; + let top = y + row * pitch(size) + (pitch(size) - size) / 2; + let img = cache.get(*art, dev as u32, hc.as_ref()); + cx.image(img, PointP { x: cx.px(x), y: cx.px(top) }, dev, opacity); + } + y += rows() * pitch(size) + BLOCK_GAP; + } + } + + fn event(&mut self, _cx: &mut EventCx, _ev: &Event) -> Reply { + Reply::None + } + + fn commands(&self) -> &CommandTable { + &self.commands + } +} + +/// Every art at three sizes and at half opacity; the art carries no text, so the page is the same in every language. +pub fn page(lang: UiLang) -> Option { + let _ = lang; + Some(Page { + name: "art", + size: page_size(), + states: 1, + screen: Box::new(ArtPage { commands: CommandTable::default(), cache: RefCell::new(ArtCache::new()) }), + }) +} + +#[cfg(test)] +mod tests { + use super::*; + use oled_ui::geom::RectP; + use oled_ui::harness::Harness; + use oled_ui::theme::Tokens; + + #[test] + fn every_art_leaves_ink_in_its_cell() { + for dpi in [96u32, 144] { + let p = page(UiLang::EN).unwrap(); + let img = Harness::new(p.screen, p.size, dpi, Tokens::oled()).render(); + let s = oled_ui::geom::Scale { dpi }; + let mut y = MARGIN; + for (size, _) in BLOCKS { + for i in 0..Art::all().len() { + let (col, row) = ((i % COLUMNS) as i32, (i / COLUMNS) as i32); + let x = MARGIN + col * COL_W + (COL_W - size) / 2; + let top = y + row * pitch(size) + (pitch(size) - size) / 2; + let cell = RectP::wh(s.px(x), s.px(top), s.px(size), s.px(size)); + let c = img.crop(cell); + assert!(c.px.iter().any(|p| *p & 0x00FF_FFFF != 0), "art {i} at {size} px, {dpi} dpi is empty"); + } + y += rows() * pitch(size) + BLOCK_GAP; + } + } + } +} diff --git a/apps/gallery/src/pages/buttons.rs b/apps/gallery/src/pages/buttons.rs index de8bd61c..3e873de3 100644 --- a/apps/gallery/src/pages/buttons.rs +++ b/apps/gallery/src/pages/buttons.rs @@ -11,10 +11,10 @@ use oled_ui::node::{Text, WidgetId}; use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; use oled_ui::theme::TypeRole; -use oled_ui::widgets::{Button, ButtonKind, IconButton, TextLabel}; +use oled_ui::widgets::{Button, ButtonKind, ButtonShow, IconButton, TextLabel, TextLink}; use oled_ui::Glyph; -const SIZE: SizeL = SizeL { w: 480, h: 360 }; +const SIZE: SizeL = SizeL { w: 800, h: 760 }; /// A widget and where it goes, logical px. struct Placed { @@ -83,7 +83,88 @@ fn heading(id: u32, text: Text, y: i32) -> (TextLabel, (i32, i32, i32, i32)) { (TextLabel::new(WidgetId(id), text, TypeRole::Section, FgRole::Secondary), (16, y, 300, 18)) } -/// The page: every state of the three widgets that a still frame can show. +/// Where the older sections start, logical px: the kind-by-state grid comes first. +const OLD_Y: i32 = 408; + +/// One row of the grid: a kind, its label and glyph, and whether it carries a chevron. +struct Row { + kind: ButtonKind, + name: (&'static str, &'static str), + label: (&'static str, &'static str), + glyph: Option, + chevron: bool, +} + +const ROWS: [Row; 8] = [ + Row { + kind: ButtonKind::Primary, + name: ("Primary", "Primario"), + label: ("Open", "Apri"), + glyph: None, + chevron: false, + }, + Row { + kind: ButtonKind::Dialog, + name: ("Dialog", "Dialogo"), + label: ("Cancel", "Annulla"), + glyph: None, + chevron: false, + }, + Row { + kind: ButtonKind::Plate, + name: ("Plate", "Piastra"), + label: ("Run", "Esegui"), + glyph: Some(Glyph::LinePlus), + chevron: false, + }, + Row { + kind: ButtonKind::Plate, + name: ("Plate menu", "Piastra menu"), + label: ("New", "Nuovo"), + glyph: Some(Glyph::LinePlus), + chevron: true, + }, + Row { + kind: ButtonKind::Command, + name: ("Command", "Comando"), + label: ("Copy", "Copia"), + glyph: Some(Glyph::CmdCopy), + chevron: false, + }, + Row { + kind: ButtonKind::Menu, + name: ("Menu", "Menu"), + label: ("Sort", "Ordina"), + glyph: Some(Glyph::CmdSort), + chevron: true, + }, + Row { + kind: ButtonKind::Destructive, + name: ("Destructive", "Distruttivo"), + label: ("Delete", "Elimina"), + glyph: Some(Glyph::CmdDelete), + chevron: false, + }, + Row { + kind: ButtonKind::Toggle, + name: ("Toggle", "Interruttore"), + label: ("Details", "Dettagli"), + glyph: Some(Glyph::CmdDetailsPane), + chevron: false, + }, +]; + +/// The columns of the grid: a name and what each kind does in it (None: the kind has no such state). +const STATES: [(&str, &str); 6] = [ + ("Rest", "Normale"), + ("Hover", "Sopra"), + ("Pressed", "Premuto"), + ("On / open", "Acceso / aperto"), + ("Focus", "Fuoco"), + ("Disabled", "Non disponibile"), +]; + +/// The page: every kind of button in every state, then the older sections. pub fn page(lang: UiLang) -> Option { let mut b = Buttons { items: Vec::new(), commands: CommandTable::new() }; let mut id = 0; @@ -91,9 +172,50 @@ pub fn page(lang: UiLang) -> Option { id += 1; WidgetId(id) }; + // The grid: a caption per column, a name per row, a button per state. + for (c, (en, it)) in STATES.into_iter().enumerate() { + let r = (112 + 112 * c as i32, 12, 108, 18); + b.add(TextLabel::new(next(), s(lang, en, it), TypeRole::Caption, FgRole::Tertiary), r); + } + for (row, spec) in ROWS.iter().enumerate() { + let y = 36 + 46 * row as i32; + b.add( + TextLabel::new(next(), s(lang, spec.name.0, spec.name.1), TypeRole::Caption, FgRole::Secondary), + (16, y + 7, 92, 18), + ); + for c in 0..STATES.len() { + let menu_like = spec.chevron; + let shown = match c { + 1 => Some(ButtonShow::Hover), + 2 => Some(ButtonShow::Pressed), + 3 if menu_like => Some(ButtonShow::Open), + 4 => Some(ButtonShow::Focus), + _ => None, + }; + // "On / open" exists for menus (open) and the toggle (on) only. + if c == 3 && !menu_like && spec.kind != ButtonKind::Toggle { + continue; + } + let mut btn = Button::new(next(), s(lang, spec.label.0, spec.label.1), spec.kind); + if let Some(g) = spec.glyph { + btn = btn.with_glyph(g); + } + if spec.chevron && spec.kind != ButtonKind::Menu { + btn = btn.with_chevron(); + } + if let Some(show) = shown { + btn.show(show); + } + if c == 3 && spec.kind == ButtonKind::Toggle { + btn.set_on(true); + } + btn.set_enabled(c != 5); + b.add(btn, (112 + 112 * c as i32, y, 104, 32)); + } + } for (kind, title, y) in [ - (ButtonKind::Secondary, s(lang, "Secondary", "Secondario"), 12), - (ButtonKind::Primary, s(lang, "Primary", "Primario"), 84), + (ButtonKind::Secondary, s(lang, "Secondary", "Secondario"), OLD_Y), + (ButtonKind::Primary, s(lang, "Primary", "Primario"), OLD_Y + 72), ] { let (h, r) = heading(next().0, title, y); b.add(h, r); @@ -109,7 +231,7 @@ pub fn page(lang: UiLang) -> Option { b.add(btn, (16 + 112 * i as i32, y + 24, 104, 28)); } } - let (h, r) = heading(next().0, s(lang, "Icon buttons", "Pulsanti icona"), 156); + let (h, r) = heading(next().0, s(lang, "Icon buttons", "Pulsanti icona"), OLD_Y + 144); b.add(h, r); let icons = [ (Glyph::ChevronLeft, None, true, "Back", "Indietro"), @@ -123,9 +245,18 @@ pub fn page(lang: UiLang) -> Option { let mut ib = IconButton::new(next(), glyph, s(lang, en, it)); ib.set_toggled(toggled); ib.set_enabled(enabled); - b.add(ib, (16 + 40 * i as i32, 180, 28, 28)); + b.add(ib, (16 + 40 * i as i32, OLD_Y + 168, 28, 28)); + } + let (h, r) = heading(next().0, s(lang, "Text link", "Collegamento"), OLD_Y + 216); + b.add(h, r); + for (i, show) in + [ButtonShow::Live, ButtonShow::Hover, ButtonShow::Pressed, ButtonShow::Focus].into_iter().enumerate() + { + let mut l = TextLink::new(next(), s(lang, "Show the row", "Mostra la riga")); + l.show(show); + b.add(l, (16 + 140 * i as i32, OLD_Y + 242, 120, 20)); } - let (h, r) = heading(next().0, s(lang, "Text", "Testo"), 228); + let (h, r) = heading(next().0, s(lang, "Text", "Testo"), OLD_Y + 276); b.add(h, r); let roles = [ (FgRole::Primary, "Primary text", "Testo primario"), @@ -138,7 +269,10 @@ pub fn page(lang: UiLang) -> Option { ]; for (i, (role, en, it)) in roles.into_iter().enumerate() { let (col, row) = (i as i32 / 4, i as i32 % 4); - b.add(TextLabel::new(next(), s(lang, en, it), TypeRole::Body, role), (16 + 232 * col, 252 + 22 * row, 216, 18)); + b.add( + TextLabel::new(next(), s(lang, en, it), TypeRole::Body, role), + (16 + 232 * col, OLD_Y + 300 + 22 * row, 216, 18), + ); } Some(Page { name: "buttons", size: SIZE, states: 1, screen: Box::new(b) }) } @@ -174,8 +308,17 @@ mod tests { let p = page(UiLang::EN).unwrap(); let mut h = Harness::new(p.screen, p.size, 96, Tokens::oled()); let img = h.render(); - for (y0, y1) in [(12, 60), (84, 132), (156, 210), (228, 340)] { - let band = img.crop(RectP::wh(0, y0, 480, y1 - y0)); + for (y0, y1) in [ + (12, 60), + (100, 148), + (240, 290), + (OLD_Y, OLD_Y + 60), + (OLD_Y + 72, OLD_Y + 132), + (OLD_Y + 144, OLD_Y + 200), + (OLD_Y + 216, OLD_Y + 270), + (OLD_Y + 276, OLD_Y + 390), + ] { + let band = img.crop(RectP::wh(0, y0, 800, y1 - y0)); assert!(band.px.iter().any(|px| px & 0xFF != 0), "nothing drawn between {y0} and {y1}"); } } diff --git a/apps/gallery/src/pages/caption.rs b/apps/gallery/src/pages/caption.rs index a878b8e8..567627ef 100644 --- a/apps/gallery/src/pages/caption.rs +++ b/apps/gallery/src/pages/caption.rs @@ -142,7 +142,7 @@ mod tests { let img = h.render(); let px = |x: i32, y: i32| img.px[(y as u32 * img.w + x as u32) as usize] & 0x00FF_FFFF; assert_eq!(px(480 - 92 + 3, 3), 0, "rest: no plate"); - assert_eq!(px(480 - 92 + 3, 48 + 3), 0x0014_1414, "maximise hovered: FILL_HOVER"); + assert_eq!(px(480 - 92 + 3, 48 + 3), 0x001A_1A1A, "maximise hovered: FILL_HOVER"); assert_eq!(px(480 - 46 + 3, 96 + 3), 0x00FF_453A, "close hovered: ACCENT_DANGER"); assert!(h.is_idle()); } diff --git a/apps/gallery/src/pages/charts.rs b/apps/gallery/src/pages/charts.rs index 2c30f2c1..f7f43f26 100644 --- a/apps/gallery/src/pages/charts.rs +++ b/apps/gallery/src/pages/charts.rs @@ -1,6 +1,8 @@ //! The charts page (K4.1): the strips and the area chart of the tasks app's headers, drawn from fixed data so the //! pictures never change: a quiet trace, a lone spike, a noisy load past its threshold, two series and the narrow -//! widths the peak-keeping resampling is for. No hue but the attention colour past a threshold. +//! widths the peak-keeping resampling is for. No hue but the attention colour past a threshold. Under them the line +//! charts of the Performance page: a percent chart with a threshold and its read-out, a two-series rate chart, the +//! sparklines in the four resource hues and a grid of 16 small traces. use super::{s, Page}; use oled_ui::command::CommandTable; @@ -11,11 +13,18 @@ use oled_ui::model::FgRole; use oled_ui::node::{Text, WidgetId}; use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; -use oled_ui::theme::{Tokens, TypeRole}; +use oled_ui::theme::{Ink, Tokens, TypeRole}; use oled_ui::widgets::chart::{AreaChart, Series, Sparkline}; +use oled_ui::widgets::line_chart::{ChartStyle, LineChart, LineScale, LineSeries, MultiCell, SmallMultiples}; use oled_ui::widgets::TextLabel; -const SIZE: SizeL = SizeL { w: 480, h: 330 }; +const SIZE: SizeL = SizeL { w: 480, h: 1040 }; + +/// The resource hues, literal here: the gallery shows the kit, not the app's tokens. +const RES_CPU: Ink = Ink::solid(0x4E, 0xA4, 0xE8); +const RES_MEM: Ink = Ink::solid(0x91, 0x63, 0xD5); +const RES_DISK: Ink = Ink::solid(0x4C, 0xCB, 0x9A); +const RES_NET: Ink = Ink::solid(0xD4, 0x5A, 0x92); /// A widget and where it goes, logical px. struct Placed { @@ -136,9 +145,111 @@ pub fn page(lang: UiLang) -> Option { let mut sp = Sparkline::new(next(), s(lang, "CPU trace, 12 px", "Traccia CPU, 12 px")).trace(true); sp.set(&[Series { values: &trace, ink: ink.fg_primary }], 100.0, None); t.add(sp, (16, 308, 200, 12)); + line_charts(&mut t, lang, &mut id); Some(Page { name: "charts", size: SIZE, states: 1, screen: Box::new(t) }) } +/// A decimal figure with one decimal, comma in Italian. +fn one_decimal(v: f32, lang: UiLang) -> String { + let s = format!("{v:.1}"); + if lang.italian { + s.replace('.', ",") + } else { + s + } +} + +/// The line charts, from y 336 down: percent with a threshold and the read-out on, a rate chart with two series and the +/// read-out at the newest sample (the chip flips left), four sparklines and sixteen small traces. +fn line_charts(t: &mut Charts, lang: UiLang, id: &mut u32) { + let mut next = || { + *id += 1; + WidgetId(*id) + }; + let (h, r) = heading( + next().0, + s(lang, "Line chart, percent with a threshold", "Grafico a linee, percentuale con soglia"), + 336, + ); + t.add(h, r); + let cpu: Vec = (0..60).map(|i| 55.0 + 35.0 * (i as f32 / 8.0).sin() + noise(i) / 25.0).collect(); + let mut ch = LineChart::new(next(), s(lang, "CPU", "CPU"), ChartStyle::Main, LineScale::Percent); + ch.set(&[LineSeries::new(&cpu, RES_CPU).with_area()]); + ch.set_threshold(Some(80.0)); + ch.set_labels(|m| format!("{m:.0} %"), s(lang, "60 seconds ago", "60 secondi fa"), s(lang, "now", "adesso")); + ch.set_value_text(s(lang, "34 %, peak 91 % in the last 60 seconds", "34 %, massimo 91 % negli ultimi 60 secondi")); + let it = lang.italian; + ch.set_readout(move |age, v| { + let when = match (age, it) { + (0, false) => "now".to_string(), + (0, true) => "adesso".to_string(), + (a, false) => format!("{a} seconds ago"), + (a, true) => format!("{a} secondi fa"), + }; + (when, format!("{:.0} %", v[0])) + }); + ch.show_readout(Some(18)); + t.add(ch, (16, 360, 448, 150)); + + let (h, r) = heading(next().0, s(lang, "Rate, received and sent", "Velocità, ricevuti e inviati"), 520); + t.add(h, r); + let down: Vec = (0..60).map(|i| 8.0 + 5.0 * (i as f32 / 6.0).sin() + noise(i + 7) / 40.0).collect(); + let up: Vec = (0..60).map(|i| 1.0 + 0.5 * (i as f32 / 4.0).cos() + noise(i + 3) / 200.0).collect(); + let mut net = LineChart::new(next(), s(lang, "Network", "Rete"), ChartStyle::Main, LineScale::Rate { floor: 1.0 }); + net.set(&[LineSeries::new(&down, RES_NET).with_area(), LineSeries::new(&up, RES_NET).dashed()]); + net.set_labels(|m| format!("{m:.0} Mbit/s"), s(lang, "60 seconds ago", "60 secondi fa"), s(lang, "now", "adesso")); + net.set_readout(move |age, v| { + let when = match (age, it) { + (0, false) => "now".to_string(), + (0, true) => "adesso".to_string(), + (a, false) => format!("{a} seconds ago"), + (a, true) => format!("{a} secondi fa"), + }; + (when, format!("↓ {} Mbit/s ↑ {} Mbit/s", one_decimal(v[0], lang), one_decimal(v[1], lang))) + }); + net.show_readout(Some(0)); + t.add(net, (16, 544, 448, 130)); + + let (h, r) = heading(next().0, s(lang, "Sparklines", "Sparkline"), 684); + t.add(h, r); + for (i, hue) in [RES_CPU, RES_MEM, RES_DISK, RES_NET].into_iter().enumerate() { + let v: Vec = (0..60) + .map(|k| 40.0 + 30.0 * ((k + 9 * i) as f32 / 7.0).sin() + noise(k as u32 + i as u32) / 25.0) + .collect(); + let mut sp = LineChart::new(next(), s(lang, "Sparkline", "Sparkline"), ChartStyle::Spark, LineScale::Percent); + sp.set(&[LineSeries::new(&v, hue).with_area()]); + t.add(sp, (16 + 112 * i as i32, 708, 100, 40)); + } + + let (h, r) = heading(next().0, s(lang, "Small multiples, 16 cells", "Piccoli grafici, 16 celle"), 758); + t.add(h, r); + let mut grid = SmallMultiples::new(next(), RES_CPU, 4); + grid.set_threshold(Some(90.0)); + let cells = (0..16usize) + .map(|i| { + let mut v: Vec = (0..60) + .map(|k| 35.0 + 20.0 * ((k + 5 * i) as f32 / 6.0).sin() + noise((k + i) as u32) / 30.0) + .collect(); + if i == 5 { + v[40..].iter_mut().enumerate().for_each(|(k, x)| *x = 82.0 + k as f32 / 2.0); + } + let now = *v.last().unwrap_or(&0.0); + MultiCell { + label: Text::from(format!("P{i}")), + value: Text::from(format!("{now:.0} %")), + name: Text::from(if it { + format!("Processore logico {i}: {now:.0} %") + } else { + format!("Logical processor {i}: {now:.0} %") + }), + values: v, + } + }) + .collect(); + grid.set(cells); + t.add(grid, (16, 782, 448, 240)); +} + #[cfg(test)] mod tests { use super::*; @@ -152,7 +263,7 @@ mod tests { let h = Harness::new(p.screen, p.size, 96, Tokens::oled()).lang(l); h.assert_named(); let dump = h.a11y_dump(); - assert!(dump.matches("Image").count() >= 7, "{dump}"); + assert!(dump.matches("Image").count() >= 7 + 2 + 16, "{dump}"); } } diff --git a/apps/gallery/src/pages/click_states.rs b/apps/gallery/src/pages/click_states.rs new file mode 100644 index 00000000..b142bac0 --- /dev/null +++ b/apps/gallery/src/pages/click_states.rs @@ -0,0 +1,1217 @@ +//! The click-states board: every element of the click language (spec table 5.2) in every state, left to right rest, +//! hover, pressed, on or open or selected, focus and disabled. Where a kit widget can be forced into a state for a still +//! picture it is the real widget; a state that has no such hook (a table row, a header cell, a strip cell, a +//! resource item, an inline action, a pressed tab or entry) is painted with the same tokens and the same ring geometry by +//! the page's own Tile, so the board reads as one table. The page also carries the board and art helpers the mock +//! pages share. + +use std::rc::Rc; + +use super::{s, Page}; +use oled_ui::art::{compose, Art}; +use oled_ui::command::CommandTable; +use oled_ui::cx::{EventCx, LayoutCx, PaintCx}; +use oled_ui::event::{Event, Reply}; +use oled_ui::geom::{self, RectP, SizeL, SizeP}; +use oled_ui::gfx::image::IconBitmap; +use oled_ui::model::{Align, FgRole}; +use oled_ui::node::{Text, WidgetId}; +use oled_ui::screen::{Screen, Widget}; +use oled_ui::strings::UiLang; +use oled_ui::text::Trim; +use oled_ui::theme::{ColorTokens, Ink, TypeRole}; +use oled_ui::widgets::icon_button::{IconSize, PreviewState}; +use oled_ui::widgets::line_chart::{ChartStyle, LineChart, LineScale, LineSeries}; +use oled_ui::widgets::sidebar::{DriveLine, NavEntry, NavLook, ENTRIES_STYLE, RAIL_STYLE}; +use oled_ui::widgets::{ + Button, ButtonKind, ButtonShow, Checkbox, FieldKind, IconButton, PathBar, PathSegment, Segmented, SidebarItem, + SidebarList, TabSpec, TabStrip, TextField, TextLabel, TextLink, Toggle, +}; +use oled_ui::Glyph; + +/// The columns: rest, hover, pressed, on or open or selected, focus, disabled. +pub const STATES: usize = 6; +const LABEL_X: i32 = 16; +const X0: i32 = 216; +const PITCH: i32 = 152; +const Y0: i32 = 40; +const SIZE_W: i32 = X0 + PITCH * STATES as i32 + 8; + +/// The side an art is composed at for the mock pages: the canvas shrinks it by area average, so one bitmap serves every +/// DPI and every size of the page. +const ART_PX: u32 = 64; + +/// An art as a shared bitmap (the mock pages hold them for tabs, sidebar entries and rows). +pub(super) fn art_rc(art: Art) -> Rc { + Rc::new(compose(art, ART_PX, None)) +} + +/// A widget and where it goes, logical px. +pub(super) struct Placed { + w: Box>, + rect: (i32, i32, i32, i32), +} + +/// Adapts a widget with another output to Out = (): a still page ignores what the widgets say. +pub(super) struct Silent(pub W); + +impl Widget for Silent { + type Out = (); + + fn layout(&mut self, cx: &mut LayoutCx, rect: RectP) { + self.0.layout(cx, rect); + } + + fn paint(&self, cx: &mut PaintCx) { + self.0.paint(cx); + } + + fn event(&mut self, cx: &mut EventCx, ev: &Event) -> Option<()> { + self.0.event(cx, ev).map(|_| ()) + } + + fn preferred(&mut self, cx: &mut LayoutCx) -> SizeP { + self.0.preferred(cx) + } +} + +/// A screen of widgets at fixed logical rects, painted in the order they were added. +pub(super) struct Board { + pub items: Vec, + commands: CommandTable, +} + +impl Board { + pub(super) fn new() -> Board { + Board { items: Vec::new(), commands: CommandTable::new() } + } + + pub(super) fn add(&mut self, w: W, rect: (i32, i32, i32, i32)) { + self.items.push(Placed { w: Box::new(Silent(w)), rect }); + } +} + +impl Screen for Board { + fn layout(&mut self, cx: &mut LayoutCx, avail: SizeP) -> SizeP { + for p in &mut self.items { + let (x, y, w, h) = p.rect; + p.w.layout(cx, RectP::wh(cx.px(x), cx.px(y), cx.px(w), cx.px(h))); + } + avail + } + + fn paint(&self, cx: &mut PaintCx) { + for p in &self.items { + p.w.paint(cx); + } + } + + fn event(&mut self, cx: &mut EventCx, ev: &Event) -> Reply { + for p in &mut self.items { + p.w.event(cx, ev); + } + Reply::None + } + + fn commands(&self) -> &CommandTable { + &self.commands + } +} + +/// The ink of a text role (the kit's own mapping: fg_hot is HighlightText under high contrast, so on the plain window +/// the primary ink stands in for it). +pub(super) fn fg_of(role: FgRole, t: &oled_ui::theme::Tokens) -> Ink { + let c = &t.color; + match role { + FgRole::Primary => c.fg_primary, + FgRole::Hot if t.high_contrast => c.fg_primary, + FgRole::Hot => c.fg_hot, + FgRole::Secondary => c.fg_secondary, + FgRole::Tertiary => c.fg_tertiary, + FgRole::Disabled => c.fg_disabled, + FgRole::Attention => c.accent_attention, + FgRole::Danger => c.accent_danger, + } +} + +/// One run of text with an alignment: the mock pages' labels (the kit's TextLabel is left-aligned only). +pub(super) struct Words { + text: Text, + role: TypeRole, + fg: FgRole, + align: Align, + rect: RectP, +} + +impl Words { + pub(super) fn new(text: Text, role: TypeRole, fg: FgRole) -> Words { + Words { text, role, fg, align: Align::Start, rect: RectP::EMPTY } + } + + pub(super) fn right(mut self) -> Words { + self.align = Align::End; + self + } +} + +impl Widget for Words { + type Out = (); + + fn layout(&mut self, _cx: &mut LayoutCx, rect: RectP) { + self.rect = rect; + } + + fn paint(&self, cx: &mut PaintCx) { + let ink = fg_of(self.fg, cx.tokens()); + cx.text_in(&self.text, self.role, self.rect, self.align, Trim::End, ink); + } + + fn event(&mut self, _cx: &mut EventCx, _ev: &Event) -> Option<()> { + None + } +} + +/// What a still shape of the mock pages is. +#[derive(Clone, Copy)] +pub(super) enum Shape { + /// A 1 px line along the rect's left edge (vertical) or top edge, in the separator ink. + VRule, + HRule, + /// The attention dot. + Dot, + /// A rim only, white alpha 20, radius 7 (the card of the details pane). + Card, + /// A capacity bar: the track and a fill of this share, in the disk hue, attention above 0.9. + Capacity(f32), +} + +pub(super) struct Still { + shape: Shape, + rect: RectP, +} + +impl Still { + pub(super) fn new(shape: Shape) -> Still { + Still { shape, rect: RectP::EMPTY } + } +} + +impl Widget for Still { + type Out = (); + + fn layout(&mut self, _cx: &mut LayoutCx, rect: RectP) { + self.rect = rect; + } + + fn paint(&self, cx: &mut PaintCx) { + let (r, c) = (self.rect, cx.tokens().color.clone()); + match self.shape { + Shape::VRule => cx.vline(r.l, r.t, r.b, c.separator), + Shape::HRule => cx.hline(r.l, r.r, r.t, c.separator), + Shape::Dot => cx.fill(r, r.w() / 2, c.accent_attention), + Shape::Card => cx.stroke(r, cx.px(7), cx.px(1), Ink::white(20)), + Shape::Capacity(used) => { + let rad = r.h() / 2; + cx.fill(r, rad, Ink::white(26)); + let w = ((r.w() as f32) * used.clamp(0.0, 1.0)).round() as i32; + let fill = if used > 0.9 { c.accent_attention } else { c.res_disk }; + cx.fill(RectP { r: r.l + w, ..r }, rad, fill); + } + } + } + + fn event(&mut self, _cx: &mut EventCx, _ev: &Event) -> Option<()> { + None + } +} + +/// A glyph in an ink (a resource hue, or the secondary ink), or an art image at an opacity. +pub(super) enum Picture { + Glyph(Glyph, Option), + Art(Rc, u32), +} + +pub(super) struct Pic { + pic: Picture, + rect: RectP, +} + +impl Pic { + pub(super) fn new(pic: Picture) -> Pic { + Pic { pic, rect: RectP::EMPTY } + } +} + +impl Widget for Pic { + type Out = (); + + fn layout(&mut self, _cx: &mut LayoutCx, rect: RectP) { + self.rect = rect; + } + + fn paint(&self, cx: &mut PaintCx) { + match &self.pic { + Picture::Glyph(g, hue) => { + let ink = hue.unwrap_or(cx.tokens().color.fg_secondary); + cx.glyph(self.rect, *g, ink); + } + Picture::Art(a, opacity) => { + let side = self.rect.w(); + cx.image(a, geom::PointP { x: self.rect.l, y: self.rect.t }, side, *opacity); + } + } + } + + fn event(&mut self, _cx: &mut EventCx, _ev: &Event) -> Option<()> { + None + } +} + +/// A state of the board's columns. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum State { + Rest, + Hover, + Pressed, + On, + Focus, + Disabled, +} + +impl State { + const ALL: [State; STATES] = [State::Rest, State::Hover, State::Pressed, State::On, State::Focus, State::Disabled]; +} + +/// What a tile draws. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum Look { + /// A list row: art 16, name; selected shows the bar. + ListRow, + /// A section row: chevron, name, count. + Section, + /// A column header cell with its hue square; hover shows the ghost chevron, on is the sorted one. + Header, + /// A resource strip cell: glyph in the hue, label, figure. + Strip, + /// A Performance resource item. + Resource, + /// The inline action of a row. + Inline, + /// A Folio tab. + Tab, + /// A sidebar entry. + Entry, + /// A rail entry. + Rail, + /// A field at the pointer. + Field, + /// Only the ring of the focus state, drawn round a widget. + Ring, + /// Nothing at this state. + Dash, +} + +/// A state painted with the tokens where no widget can be forced into it. +pub(super) struct Tile { + look: Look, + state: State, + label: Text, + detail: Text, + art: Option>, + glyph: Option, + hue: Option, + rect: RectP, +} + +impl Tile { + fn new(look: Look, state: State, label: Text) -> Tile { + Tile { look, state, label, detail: Text::from(""), art: None, glyph: None, hue: None, rect: RectP::EMPTY } + } + + fn detail(mut self, t: Text) -> Tile { + self.detail = t; + self + } + + fn art(mut self, a: Art) -> Tile { + self.art = Some(art_rc(a)); + self + } + + fn glyph(mut self, g: Glyph) -> Tile { + self.glyph = Some(g); + self + } + + fn hue(mut self, h: Ink) -> Tile { + self.hue = Some(h); + self + } + + /// The plate's radius, logical px. + fn radius(&self) -> i32 { + match self.look { + Look::Inline => 4, + _ => 7, + } + } + + fn plate(&self, cx: &mut PaintCx, c: &ColorTokens) { + let (r, rad) = (self.rect, cx.px(self.radius())); + let rim = cx.px(1); + let nav = matches!(self.look, Look::Entry | Look::Rail | Look::Resource); + let bar = |cx: &mut PaintCx| { + let (w, h) = (cx.px(3), cx.px(16)); + let y = r.t + (r.h() - h) / 2; + cx.fill(RectP::wh(r.l, y, w, h), cx.px(2), c.nav_bar); + }; + if self.look == Look::Inline { + let (fill, edge) = match self.state { + State::Hover => (c.fill_inline_hot, Some(c.rim_inline_hot)), + State::Pressed => (c.fill_inline_press, None), + _ => (c.fill_inline, Some(c.rim_inline)), + }; + cx.fill(r, rad, fill); + if let Some(e) = edge { + cx.stroke(r, rad, rim, e); + } + } else { + match self.state { + State::Hover => { + cx.fill(r, rad, c.fill_hover); + cx.stroke(r, rad, rim, c.rim_hover); + } + State::Pressed => cx.fill(r, rad, c.fill_press), + State::On if self.look == Look::Tab => { + cx.fill(r, rad, c.fill_tab_active); + cx.stroke(r, rad, rim, c.rim_tab_active); + } + State::On if self.look == Look::Field => {} + State::On if matches!(self.look, Look::ListRow | Look::Entry | Look::Rail | Look::Resource) => { + cx.fill(r, rad, if nav { c.fill_nav_selected } else { c.fill_row_selected }); + bar(cx); + } + _ => {} + } + } + if self.state == State::Focus { + let ring = if self.look == Look::ListRow { + geom::focus_ring_inset(r, rad, cx.scale()) + } else { + geom::focus_ring(r, rad, cx.scale()) + }; + cx.stroke(ring.rect, ring.radius, ring.width, c.rim_focus); + } + } +} + +impl Widget for Tile { + type Out = (); + + fn layout(&mut self, _cx: &mut LayoutCx, rect: RectP) { + self.rect = rect; + } + + fn paint(&self, cx: &mut PaintCx) { + let mut c = cx.tokens().color.clone(); + let r = self.rect; + // Under high contrast a filled plate is the Highlight colour: the text on it is HighlightText (fg_hot), and + // fg_hot is only readable there. + let plated = (matches!(self.state, State::Hover | State::Pressed) && self.look != Look::Field) + || (self.state == State::On + && matches!(self.look, Look::ListRow | Look::Entry | Look::Rail | Look::Resource | Look::Tab)) + || self.look == Look::Inline; + let hot_ink = if cx.tokens().high_contrast && !plated { c.fg_primary } else { c.fg_hot }; + if cx.tokens().high_contrast && plated { + c.fg_primary = c.fg_hot; + c.fg_secondary = c.fg_hot; + c.fg_tertiary = c.fg_hot; + } + if self.look == Look::Dash { + let at = RectP { l: r.l + cx.px(4), ..r }; + cx.text_in("\u{2013}", TypeRole::Body, at, Align::Start, Trim::End, c.fg_disabled); + return; + } + self.plate(cx, &c); + let off = self.state == State::Disabled; + let at = |cx: &PaintCx, x: i32| RectP { l: r.l + cx.px(x), r: r.r - cx.px(8), ..r }; + let icon = cx.px(16); + let art_at = |cx: &mut PaintCx, x: i32| { + if let Some(a) = &self.art { + let y = r.t + (r.h() - icon) / 2; + cx.image(a, geom::PointP { x: r.l + cx.px(x), y }, icon, if off { 128 } else { 255 }); + } + }; + let glyph_at = |cx: &mut PaintCx, x: i32, size: i32, ink: Ink| { + if let Some(g) = self.glyph { + let side = cx.px(size); + cx.glyph(RectP::wh(r.l + cx.px(x), r.t + (r.h() - side) / 2, side, side), g, ink); + } + }; + let on = self.state == State::On; + let hot = matches!(self.state, State::Hover | State::Pressed); + match self.look { + Look::ListRow => { + art_at(cx, 12); + let ink = if off { c.fg_primary.with_a(128) } else { c.fg_primary }; + cx.text_in(&self.label, TypeRole::Body, at(cx, 40), Align::Start, Trim::End, ink); + } + Look::Entry | Look::Rail | Look::Tab => { + let ink = if off { + c.fg_disabled + } else if on || hot { + c.fg_primary + } else { + c.fg_secondary + }; + let gink = if self.look == Look::Rail && on { c.accent_ui } else { ink }; + art_at(cx, 12); + glyph_at(cx, 12, 16, gink); + let role = if on && self.look != Look::Tab { TypeRole::BodyStrong } else { TypeRole::Body }; + let right = if self.look == Look::Tab { 34 } else { 8 }; + let text = RectP { l: r.l + cx.px(40), r: r.r - cx.px(right), ..r }; + cx.text_in(&self.label, role, text, Align::Start, Trim::End, ink); + if self.look == Look::Tab && (on || hot || self.state == State::Focus) { + let side = cx.px(12); + let close = RectP::wh(r.r - cx.px(22), r.t + (r.h() - side) / 2, side, side); + cx.glyph(close, Glyph::LineClose, c.fg_secondary); + } + } + Look::Section => { + glyph_at(cx, 8, 16, c.fg_tertiary); + let w = + cx.text_in(&self.label, TypeRole::BodyStrong, at(cx, 32), Align::Start, Trim::End, c.fg_primary); + let count = RectP { l: r.l + cx.px(32) + w + cx.px(8), r: r.r, ..r }; + cx.text_in(&self.detail, TypeRole::Caption, count, Align::Start, Trim::End, c.fg_tertiary); + } + Look::Header => { + if let Some(h) = self.hue { + let side = cx.px(7); + cx.fill(RectP::wh(r.l + cx.px(12), r.t + (r.h() - side) / 2, side, side), cx.px(2), h); + } + let ink = if on || self.state == State::Pressed { c.fg_primary } else { c.fg_secondary }; + let w = cx.text_in(&self.label, TypeRole::Caption, at(cx, 25), Align::Start, Trim::End, ink); + let chev_x = 25 + (w + cx.px(1) - 1) / cx.px(1) + 4; + if on { + glyph_at_logical(cx, r, chev_x, Glyph::LineChevronDown, c.fg_primary); + } else if self.state == State::Hover { + glyph_at_logical(cx, r, chev_x, Glyph::LineChevronUp, c.fg_tertiary); + } + } + Look::Strip => { + let side = cx.px(12); + if let (Some(g), Some(h)) = (self.glyph, self.hue) { + cx.glyph(RectP::wh(r.l + cx.px(12), r.t + cx.px(8), side, side), g, h); + } + let top = RectP { l: r.l + cx.px(30), t: r.t + cx.px(6), b: r.t + cx.px(22), ..r }; + cx.text_in(&self.label, TypeRole::Caption, top, Align::Start, Trim::End, c.fg_secondary); + let fig = RectP { l: r.l + cx.px(12), t: r.t + cx.px(24), b: r.b - cx.px(4), ..r }; + cx.text_in(&self.detail, TypeRole::Figure, fig, Align::Start, Trim::End, hot_ink); + } + Look::Resource => { + if let (Some(g), Some(h)) = (self.glyph, self.hue) { + let side = cx.px(12); + cx.glyph(RectP::wh(r.l + cx.px(14), r.t + cx.px(12), side, side), g, h); + } + let name = RectP { l: r.l + cx.px(32), t: r.t + cx.px(8), b: r.t + cx.px(26), ..r }; + let ink = if off { c.fg_tertiary } else { c.fg_primary }; + cx.text_in(&self.label, TypeRole::BodyStrong, name, Align::Start, Trim::End, ink); + let det = RectP { l: r.l + cx.px(32), t: r.t + cx.px(28), b: r.t + cx.px(44), ..r }; + cx.text_in(&self.detail, TypeRole::Caption, det, Align::Start, Trim::End, c.fg_secondary); + } + Look::Inline => { + glyph_at(cx, 8, 16, c.fg_primary); + let text = RectP { l: r.l + cx.px(30), r: r.r - cx.px(10), ..r }; + cx.text_in(&self.label, TypeRole::Caption, text, Align::Start, Trim::End, c.fg_primary); + } + Look::Field => { + let rad = cx.px(7); + cx.fill(r, rad, c.fill_control); + cx.stroke(r, rad, cx.px(1), if hot { c.rim_field_hot } else { c.rim_control }); + glyph_at(cx, 10, 16, c.fg_secondary); + cx.text_in(&self.label, TypeRole::Body, at(cx, 34), Align::Start, Trim::End, c.fg_tertiary); + } + Look::Ring | Look::Dash => {} + } + } + + fn event(&mut self, _cx: &mut EventCx, _ev: &Event) -> Option<()> { + None + } +} + +fn glyph_at_logical(cx: &mut PaintCx, r: RectP, x: i32, g: Glyph, ink: Ink) { + let side = cx.px(12); + cx.glyph(RectP::wh(r.l + cx.px(x), r.t + (r.h() - side) / 2, side, side), g, ink); +} + +/// Where a cell's widgets go on the board: a rect in logical px. +type Rect4 = (i32, i32, i32, i32); + +/// What adds a cell's widgets to the board. +type Adder = Box; + +/// A widget of the board with its size in logical px. +enum Cell { + Put(Adder, (i32, i32)), +} + +fn put(w: W, size: (i32, i32)) -> Cell { + Cell::Put(Box::new(move |b, r| b.add(w, r)), size) +} + +/// A button of the grid in a column's state; None where the kind has no such state. +fn button( + lang: UiLang, + kind: ButtonKind, + label: Text, + glyph: Option, + chevron: bool, + id: u32, + c: usize, +) -> Option { + let on_exists = chevron || kind == ButtonKind::Toggle; + if c == 3 && !on_exists { + return None; + } + let _ = lang; + let mut b = Button::new(WidgetId(id), label, kind); + if let Some(g) = glyph { + b = b.with_glyph(g); + } + if chevron && kind != ButtonKind::Menu { + b = b.with_chevron(); + } + match c { + 1 => b.show(ButtonShow::Hover), + 2 => b.show(ButtonShow::Pressed), + 3 if chevron => b.show(ButtonShow::Open), + 4 => b.show(ButtonShow::Focus), + _ => {} + } + if c == 3 && kind == ButtonKind::Toggle { + b.set_on(true); + } + b.set_enabled(c != 5); + let w = match kind { + ButtonKind::Primary | ButtonKind::Dialog => 104, + _ => 112, + }; + Some(put(b, (w, 32))) +} + +fn state_of(c: usize) -> State { + State::ALL[c] +} + +fn tile(t: Tile, size: (i32, i32)) -> Cell { + put(t, size) +} + +fn dash(c: usize) -> Cell { + tile(Tile::new(Look::Dash, state_of(c), Text::from("")), (40, 32)) +} + +fn nav_list( + id: u32, + look: NavLook, + item: SidebarItem, + entry: Option, + hot: bool, + current: bool, +) -> SidebarList { + let key = item.key; + let style = if matches!(look, NavLook::Rail { .. }) { RAIL_STYLE } else { ENTRIES_STYLE }; + let mut l = SidebarList::new(WidgetId(id), style).with_look(look).with_items(vec![item]); + if let Some(e) = entry { + l.set_entry(key, e); + } + if hot { + l.show_hot(Some(key)); + } + if current { + l.set_current(Some(key)); + } + l +} + +fn entry_item(key: u64, label: Text, art: Option, glyph: Option) -> SidebarItem { + SidebarItem { + key, + label, + glyph, + icon: art.map(art_rc), + depth: 0, + expandable: false, + expanded: false, + section: false, + trailing: None, + disabled: false, + busy: false, + } +} + +const RES_CPU: Ink = Ink::solid(0x4E, 0xA4, 0xE8); + +/// One element of table 5.2: its name (en, it), the height of its row and its cell for every state. +struct Element { + name: (&'static str, &'static str), + h: i32, + cell: fn(UiLang, usize, u32) -> Option, +} + +fn pr(show: ButtonShow) -> Option<(usize, PreviewState)> { + match show { + ButtonShow::Hover => Some((0, PreviewState::Hover)), + ButtonShow::Pressed => Some((0, PreviewState::Pressed)), + ButtonShow::Focus => Some((0, PreviewState::Focus)), + _ => None, + } +} + +fn preview_of(c: usize) -> Option { + match c { + 1 => Some(PreviewState::Hover), + 2 => Some(PreviewState::Pressed), + 4 => Some(PreviewState::Focus), + _ => None, + } +} + +fn series() -> Vec { + (0..60).map(|i| 45.0 + 25.0 * (i as f32 / 7.0).sin()).collect() +} + +const ELEMENTS: [Element; 27] = [ + Element { + name: ("Command button", "Pulsante con etichetta"), + h: 48, + cell: |lang, c, id| { + button(lang, ButtonKind::Command, s(lang, "Copy", "Copia"), Some(Glyph::CmdCopy), false, id, c) + }, + }, + Element { + name: ("Menu button", "Comando con menu"), + h: 48, + cell: |lang, c, id| { + button(lang, ButtonKind::Menu, s(lang, "Sort", "Ordina"), Some(Glyph::CmdSort), true, id, c) + }, + }, + Element { + name: ("Plate button", "Pulsante a piastra"), + h: 48, + cell: |lang, c, id| { + button(lang, ButtonKind::Plate, s(lang, "New", "Nuovo"), Some(Glyph::LinePlus), true, id, c) + }, + }, + Element { + name: ("Destructive command", "Comando che cancella"), + h: 48, + cell: |lang, c, id| { + button(lang, ButtonKind::Destructive, s(lang, "Delete", "Elimina"), Some(Glyph::CmdDelete), false, id, c) + }, + }, + Element { + name: ("Toggle command", "Comando a interruttore"), + h: 48, + cell: |lang, c, id| { + button(lang, ButtonKind::Toggle, s(lang, "Details", "Dettagli"), Some(Glyph::CmdDetailsPane), false, id, c) + }, + }, + Element { + name: ("Icon-only button", "Pulsante solo icona"), + h: 48, + cell: |lang, c, id| { + if c == 3 { + return None; + } + let mut b = IconButton::new(WidgetId(id), Glyph::NavBack, s(lang, "Back", "Indietro")); + b.set_size(IconSize::Large); + b.preview(preview_of(c)); + b.set_enabled(c != 5); + Some(put(b, (32, 32))) + }, + }, + Element { + name: ("Primary button", "Pulsante principale"), + h: 48, + cell: |lang, c, id| button(lang, ButtonKind::Primary, s(lang, "Open", "Apri"), None, false, id, c), + }, + Element { + name: ("Dialog button", "Pulsante di dialogo"), + h: 48, + cell: |lang, c, id| button(lang, ButtonKind::Dialog, s(lang, "Cancel", "Annulla"), None, false, id, c), + }, + Element { + name: ("Segmented", "Segmentato"), + h: 48, + cell: |lang, c, id| { + let opts = vec![s(lang, "Tree", "Albero"), s(lang, "List", "Elenco")]; + let mut g = Segmented::new(WidgetId(id), s(lang, "View", "Vista"), opts, (c == 3).then_some(1)); + g.set_click_style(true); + g.set_enabled(c != 5); + g.preview(pr(match c { + 1 => ButtonShow::Hover, + 2 => ButtonShow::Pressed, + 4 => ButtonShow::Focus, + _ => ButtonShow::Live, + })); + Some(put(g, (132, 32))) + }, + }, + Element { + name: ("Tab", "Scheda"), + h: 48, + cell: |lang, c, id| match c { + 2 | 4 => { + let t = Tile::new(Look::Tab, state_of(c), s(lang, "Docs", "Doc")).art(Art::Documents); + Some(tile(t, (140, 32))) + } + 5 => None, + _ => { + let tab = TabSpec { + key: 1, + label: s(lang, "Docs", "Doc"), + tip: None, + icon: Some(art_rc(Art::Documents)), + busy: false, + error: false, + }; + let mut st = + TabStrip::new(WidgetId(id)).with_click_look().with_tabs(vec![tab], if c == 3 { 1 } else { 99 }); + if c == 1 { + st.preview_hot_tab(Some(0)); + } + Some(put(st, (140, 32))) + } + }, + }, + Element { + name: ("Path segment", "Segmento del percorso"), + h: 48, + cell: |lang, c, id| { + let seg = |key, en: &'static str, it: &'static str| PathSegment { key, label: s(lang, en, it), tip: None }; + match c { + 2 | 4 => Some(tile(Tile::new(Look::Entry, state_of(c), s(lang, "Studio", "Studio")), (80, 24))), + 5 => None, + _ => { + let segs = if c == 3 { + vec![seg(2, "Q4", "Q4")] + } else { + vec![seg(1, "Studio", "Studio"), seg(2, "Q4", "Q4")] + }; + let mut p = PathBar::new(WidgetId(id)).with_click_look().with_path(segs, "C:\\Studio".to_string()); + if c == 1 { + p.preview_hot(Some((0, false))); + } + Some(put(p, (144, 32))) + } + } + }, + }, + Element { + name: ("Path field", "Campo del percorso"), + h: 48, + cell: |lang, c, id| match c { + 0 | 3 => { + let segs = vec![PathSegment { key: 1, label: s(lang, "Studio", "Studio"), tip: None }]; + let mut p = PathBar::new(WidgetId(id)).with_click_look().with_path(segs, "C:\\Studio".to_string()); + if c == 3 { + p.preview_edit("C:\\Studio\\Projects", None); + } + Some(put(p, (140, 32))) + } + 1 => Some(tile(Tile::new(Look::Field, State::Hover, s(lang, "Studio", "Studio")), (140, 32))), + _ => None, + }, + }, + Element { + name: ("Text field", "Campo di testo"), + h: 48, + cell: |lang, c, id| { + if c == 2 { + return None; + } + let mut f = TextField::new(WidgetId(id), FieldKind::Search); + f.set_click_style(true); + f.set_clear_button(true); + f.set_label(s(lang, "Search", "Cerca")); + f.set_placeholder(s(lang, "Search", "Cerca")); + f.set_width(140); + match c { + 0 | 1 => f.set_keycap(Some(Text::from("Ctrl+F"))), + _ => {} + } + match c { + 1 => f.preview_hot(true), + 3 => f.preview(&s(lang, "invoice", "fattura"), false, None, None, None), + 4 => f.preview("", true, None, None, None), + 5 => f.set_enabled(false), + _ => {} + } + Some(put(f, (140, 32))) + }, + }, + Element { + name: ("List row", "Riga dell'elenco"), + h: 48, + cell: |lang, c, _| { + let t = Tile::new(Look::ListRow, state_of(c), s(lang, "Contracts", "Contratti")).art(Art::Folder); + Some(tile(t, (140, 32))) + }, + }, + Element { + name: ("Section row", "Riga di sezione"), + h: 48, + cell: |lang, c, _| { + if c == 3 || c == 5 { + return None; + } + let t = Tile::new(Look::Section, state_of(c), s(lang, "Apps", "App")) + .detail(Text::from("7")) + .glyph(Glyph::LineChevronDown); + Some(tile(t, (140, 32))) + }, + }, + Element { + name: ("Column header", "Intestazione di colonna"), + h: 48, + cell: |lang, c, _| { + if c == 5 { + return None; + } + let t = Tile::new(Look::Header, state_of(c), s(lang, "CPU", "CPU")).hue(RES_CPU); + Some(tile(t, (120, 32))) + }, + }, + Element { + name: ("Sidebar entry", "Voce della barra laterale"), + h: 48, + cell: |lang, c, id| match c { + 2 | 4 => Some(tile( + Tile::new(Look::Entry, state_of(c), s(lang, "Download", "Download")).art(Art::Downloads), + (140, 32), + )), + _ => { + let mut item = entry_item(1, s(lang, "Download", "Download"), Some(Art::Downloads), None); + let mut entry = None; + if c == 5 { + item = entry_item(1, s(lang, "Stick (E:)", "Chiavetta (E:)"), Some(Art::DriveRemovable), None); + entry = + Some(NavEntry { not_ready: Some(s(lang, "Not ready", "Non pronta")), ..NavEntry::default() }); + } + Some(put(nav_list(id, NavLook::Entries, item, entry, c == 1, c == 3), (140, 32))) + } + }, + }, + Element { + name: ("Drive entry", "Voce unita"), + h: 56, + cell: |lang, c, id| { + if c == 2 || c == 4 { + return None; + } + let item = entry_item(1, s(lang, "Data", "Dati"), Some(Art::DriveFixed), None); + let entry = if c == 5 { + NavEntry { not_ready: Some(s(lang, "Not ready", "Non pronta")), ..NavEntry::default() } + } else { + NavEntry { + drive: Some(DriveLine { free: s(lang, "37 GB", "37 GB"), used: 0.7 }), + ..NavEntry::default() + } + }; + Some(put(nav_list(id, NavLook::Entries, item, Some(entry), c == 1, c == 3), (140, 46))) + }, + }, + Element { + name: ("Rail entry", "Voce del binario"), + h: 48, + cell: |lang, c, id| match c { + 2 | 4 => Some(tile( + Tile::new(Look::Rail, state_of(c), s(lang, "Details", "Dettagli")).glyph(Glyph::PageDetails), + (140, 36), + )), + 5 => None, + _ => { + let item = entry_item(1, s(lang, "Details", "Dettagli"), None, Some(Glyph::PageDetails)); + Some(put(nav_list(id, NavLook::Rail { collapsed: false }, item, None, c == 1, c == 3), (140, 36))) + } + }, + }, + Element { + name: ("Resource item", "Voce di risorsa"), + h: 64, + cell: |lang, c, _| { + let t = Tile::new(Look::Resource, state_of(c), s(lang, "CPU", "CPU")) + .detail(s(lang, "34 % - 3.42 GHz", "34 % - 3,42 GHz")) + .glyph(Glyph::ResCpu) + .hue(RES_CPU); + Some(tile(t, (140, 56))) + }, + }, + Element { + name: ("Strip cell", "Cella della striscia"), + h: 64, + cell: |lang, c, _| { + if c == 3 || c == 5 { + return None; + } + let t = Tile::new(Look::Strip, state_of(c), s(lang, "CPU", "CPU")) + .detail(Text::from("34 %")) + .glyph(Glyph::ResCpu) + .hue(RES_CPU); + Some(tile(t, (140, 56))) + }, + }, + Element { + name: ("Inline row action", "Azione sulla riga"), + h: 48, + cell: |lang, c, _| { + if c == 3 || c == 4 || c == 5 { + return None; + } + let t = Tile::new(Look::Inline, state_of(c), s(lang, "Close", "Chiudi")).glyph(Glyph::CmdCloseWindow); + Some(tile(t, (84, 24))) + }, + }, + Element { + name: ("Text link", "Collegamento"), + h: 48, + cell: |lang, c, id| { + if c == 3 || c == 5 { + return None; + } + let mut l = TextLink::new(WidgetId(id), s(lang, "Show the row", "Mostra la riga")); + l.show(match c { + 1 => ButtonShow::Hover, + 2 => ButtonShow::Pressed, + 4 => ButtonShow::Focus, + _ => ButtonShow::Live, + }); + Some(put(l, (120, 20))) + }, + }, + Element { + name: ("Chart, focusable", "Grafico con fuoco"), + h: 96, + cell: |lang, c, id| { + if c == 2 || c == 3 || c == 5 { + return None; + } + let values = series(); + let mut ch = LineChart::new(WidgetId(id), s(lang, "CPU", "CPU"), ChartStyle::Main, LineScale::Percent); + ch.set(&[LineSeries::new(&values, RES_CPU).with_area()]); + ch.set_labels(|m| format!("{m:.0} %"), s(lang, "60 s ago", "60 s fa"), s(lang, "now", "adesso")); + let it = lang.italian; + ch.set_readout(move |age, v| { + (if it { format!("{age} s fa") } else { format!("{age} s ago") }, format!("{:.0} %", v[0])) + }); + if c == 1 { + ch.show_readout(Some(18)); + } + if c == 4 { + let ring = Tile::new(Look::Ring, State::Focus, Text::from("")); + return Some(Cell::Put( + Box::new(move |b, r| { + b.add(ch, r); + b.add(ring, r); + }), + (132, 76), + )); + } + Some(put(ch, (132, 76))) + }, + }, + Element { + name: ("Toggle", "Interruttore"), + h: 40, + cell: |lang, c, id| { + if matches!(c, 1 | 2 | 4) { + return None; + } + let mut t = Toggle::new(WidgetId(id), s(lang, "Efficiency", "Efficienza"), c == 3); + t.set_enabled(c != 5); + Some(put(t, (140, 28))) + }, + }, + Element { + name: ("Checkbox", "Casella"), + h: 40, + cell: |lang, c, id| { + if matches!(c, 1 | 2 | 4) { + return None; + } + let mut b = Checkbox::new(WidgetId(id), s(lang, "Hidden", "Nascosti"), c == 3); + b.set_enabled(c != 5); + Some(put(b, (140, 24))) + }, + }, + Element { + name: ("Pinned entry", "Voce fissata"), + h: 48, + cell: |lang, c, id| { + if c == 2 || c == 3 || c == 4 || c == 5 { + return None; + } + let item = entry_item(1, s(lang, "Projects 2026", "Progetti 2026"), Some(Art::Folder), None); + let entry = NavEntry { + action: Some(( + oled_ui::widgets::sidebar::NavAction::Pin, + s(lang, "Remove from Quick access", "Togli da Accesso rapido"), + )), + ..NavEntry::default() + }; + Some(put(nav_list(id, NavLook::Entries, item, Some(entry), c == 1, false), (140, 32))) + }, + }, +]; + +fn caption(lang: UiLang, c: usize) -> Text { + match c { + 0 => s(lang, "Rest", "A riposo"), + 1 => s(lang, "Hover", "Puntatore sopra"), + 2 => s(lang, "Pressed", "Premuto"), + 3 => s(lang, "On / open / selected", "Scelto / aperto"), + 4 => s(lang, "Focus", "Fuoco da tastiera"), + _ => s(lang, "Disabled", "Non disponibile"), + } +} + +fn height() -> i32 { + Y0 + ELEMENTS.iter().map(|e| e.h).sum::() + 12 +} + +/// The names of the elements, for tests: (en, it). +pub fn element_names() -> Vec<(&'static str, &'static str)> { + ELEMENTS.iter().map(|e| e.name).collect() +} + +/// The board: a row per element, a column per state. +pub fn page(lang: UiLang) -> Option { + let mut b = Board::new(); + let mut id = 0u32; + let mut next = || { + id += 1; + id + }; + for c in 0..STATES { + let w = TextLabel::new(WidgetId(next()), caption(lang, c), TypeRole::Caption, FgRole::Tertiary); + b.add(w, (X0 + PITCH * c as i32, 12, PITCH - 8, 18)); + } + let mut y = Y0; + for e in &ELEMENTS { + let name = TextLabel::new(WidgetId(next()), s(lang, e.name.0, e.name.1), TypeRole::Caption, FgRole::Secondary); + b.add(name, (LABEL_X, y + (e.h - 18) / 2, X0 - LABEL_X - 8, 18)); + for c in 0..STATES { + let wid = next(); + let cell = (e.cell)(lang, c, wid).unwrap_or_else(|| dash(c)); + let Cell::Put(add, (w, h)) = cell; + add(&mut b, (X0 + PITCH * c as i32, y + (e.h - h) / 2, w, h)); + } + y += e.h; + } + Some(Page { + name: "click_states", + size: SizeL { w: SIZE_W, h: height() }, + states: STATES as u32, + screen: Box::new(b), + }) +} + +#[cfg(test)] +mod tests { + use super::*; + use oled_ui::harness::Harness; + use oled_ui::strings::Lang; + use oled_ui::theme::Tokens; + + #[test] + fn the_board_has_a_row_for_every_element_of_the_click_language() { + let names = element_names(); + for want in [ + "Command button", + "Menu button", + "Plate button", + "Destructive command", + "Toggle command", + "Icon-only button", + "Primary button", + "Dialog button", + "Segmented", + "Tab", + "Path segment", + "Path field", + "Text field", + "List row", + "Section row", + "Column header", + "Sidebar entry", + "Drive entry", + "Rail entry", + "Resource item", + "Strip cell", + "Inline row action", + "Text link", + "Chart, focusable", + "Toggle", + "Checkbox", + ] { + assert!(names.iter().any(|(en, _)| *en == want), "no row for {want}"); + } + let mut en: Vec<&str> = names.iter().map(|n| n.0).collect(); + en.sort_unstable(); + en.dedup(); + assert_eq!(en.len(), names.len(), "a row is named twice"); + } + + #[test] + fn the_page_names_its_interactive_nodes_in_both_languages() { + for (lang, l) in [(UiLang::EN, Lang::En), (UiLang::IT, Lang::It)] { + let p = page(lang).unwrap(); + assert_eq!(p.states, 6); + let h = Harness::new(p.screen, p.size, 96, Tokens::oled()).lang(l); + h.assert_named(); + let dump = h.a11y_dump(); + assert!(dump.contains(if lang.italian { "Pulsante con etichetta" } else { "Command button" }), "{dump}"); + } + } + + #[test] + fn every_state_column_leaves_ink_in_every_row() { + let p = page(UiLang::EN).unwrap(); + let mut h = Harness::new(p.screen, p.size, 96, Tokens::oled()); + let img = h.render(); + let mut y = Y0; + for e in &ELEMENTS { + for c in 0..STATES { + let r = RectP::wh(X0 + PITCH * c as i32, y, PITCH - 8, e.h); + // A cell that is only a dash still leaves ink; so every cell of the board does. + assert!(img.crop(r).px.iter().any(|p| p & 0x00FF_FFFF != 0), "{} column {c} is empty", e.name.0); + } + y += e.h; + } + } + + #[test] + fn the_hover_column_differs_from_rest_where_a_state_exists() { + let p = page(UiLang::EN).unwrap(); + let mut h = Harness::new(p.screen, p.size, 96, Tokens::oled()); + let img = h.render(); + let mut y = Y0; + let mut checked = 0; + for e in &ELEMENTS { + if !["Command button", "Destructive command", "List row", "Icon-only button", "Inline row action"] + .contains(&e.name.0) + { + y += e.h; + continue; + } + let rest = img.crop(RectP::wh(X0, y, PITCH - 8, e.h)); + let hover = img.crop(RectP::wh(X0 + PITCH, y, PITCH - 8, e.h)); + assert_ne!(rest.px, hover.px, "{}: hover looks like rest", e.name.0); + checked += 1; + y += e.h; + } + assert_eq!(checked, 5); + } +} diff --git a/apps/gallery/src/pages/fields.rs b/apps/gallery/src/pages/fields.rs index b3c95709..7cc8a41c 100644 --- a/apps/gallery/src/pages/fields.rs +++ b/apps/gallery/src/pages/fields.rs @@ -13,7 +13,7 @@ use oled_ui::strings::UiLang; use oled_ui::theme::TypeRole; use oled_ui::widgets::{FieldKind, TextField, TextLabel}; -const SIZE: SizeL = SizeL { w: 500, h: 380 }; +const SIZE: SizeL = SizeL { w: 500, h: 570 }; struct Fields { labels: Vec<(TextLabel, (i32, i32, i32, i32))>, @@ -121,5 +121,48 @@ pub fn page(lang: UiLang) -> Option { f.set_label(s(lang, "Name", "Nome")); f.preview("report.docx", true, Some(0..6), None, None); }); + // The click style: rest with its keycap, hover, focus with a selection, text with the clear cross, off, no glyph. + let click = |f: &mut TextField| { + f.set_click_style(true); + f.set_clear_button(true); + f.set_label(s(lang, "Search", "Cerca")); + }; + let cap = || Some(Text::from("Ctrl+F")); + add(&mut p, s(lang, "Click style, rest", "Stile click, riposo"), 0, 5, FieldKind::Search, &|f| { + click(f); + f.set_placeholder(s(lang, "Search in the folder", "Cerca nella cartella")); + f.set_keycap(cap()); + }); + add(&mut p, s(lang, "Hover", "Sopra"), 1, 5, FieldKind::Search, &|f| { + click(f); + f.set_placeholder(s(lang, "Search in the folder", "Cerca nella cartella")); + f.set_keycap(cap()); + f.preview_hot(true); + }); + add(&mut p, s(lang, "Focus, selection", "Focus, selezione"), 0, 6, FieldKind::Search, &|f| { + click(f); + f.set_keycap(cap()); + f.preview("invoice", true, Some(0..4), None, None); + }); + add(&mut p, s(lang, "With text: clear cross", "Con testo: croce"), 1, 6, FieldKind::Search, &|f| { + click(f); + f.set_keycap(cap()); + f.preview("invoice", false, None, None, None); + }); + add(&mut p, s(lang, "Unavailable", "Non disponibile"), 0, 7, FieldKind::Search, &|f| { + click(f); + f.set_placeholder(s(lang, "Search in the folder", "Cerca nella cartella")); + f.set_keycap(cap()); + f.set_enabled(false); + }); + add(&mut p, s(lang, "Plain, no glyph", "Semplice, senza icona"), 1, 7, FieldKind::Plain, &|f| { + f.set_click_style(true); + f.set_label(s(lang, "Name", "Nome")); + f.preview("Quarterly report", false, None, None, None); + }); + for (field, rect) in p.fields.iter_mut().skip(10) { + let _ = field; + rect.3 = 32; + } Some(Page { name: "fields", size: SIZE, states: 1, screen: Box::new(p) }) } diff --git a/apps/gallery/src/pages/mock_files.rs b/apps/gallery/src/pages/mock_files.rs index 567bc977..dec01841 100644 --- a/apps/gallery/src/pages/mock_files.rs +++ b/apps/gallery/src/pages/mock_files.rs @@ -1,43 +1,52 @@ -//! The mock_files page (K3.3): the files window before the files app exists, made only of kit widgets: a TabStrip in the -//! caption row, a Toolbar with Back, Forward and Up, the PathBar and a filter field, a SplitView with a SidebarList and a -//! VirtualTable (the FILES look) over 100,000 synthetic entries, and a StatusLine. Its keyboard script is K3's acceptance. +//! The mock_files page: the files window as it is meant to look, made only of kit widgets: a tab strip with the art of each +//! folder, the address row (history buttons, the click-look path bar, a search field), the command bar, a sidebar with +//! places and drives, the list over 100,000 synthetic entries with the art of their family, a details pane drawn from the +//! kit's primitives and the status line with the capacity of the open drive. Its keyboard script is the acceptance of the +//! regions, the tabs and the path field. use std::borrow::Cow; -use super::table::{columns, select, Demo}; +use super::click_states::{art_rc, Board, Pic, Picture, Shape, Still, Words}; +use super::table::select; use super::{s, Page}; +use oled_ui::art::{family_of_ext, Art}; use oled_ui::command::{Chord, Command as Cmd, CommandId, CommandTable}; use oled_ui::cx::{EventCx, LayoutCx, PaintCx}; use oled_ui::event::{Event, Reply}; use oled_ui::geom::{RectP, SizeL, SizeP}; use oled_ui::gfx::image::IconBitmap; use oled_ui::model::{ - Badge, CellKind, CellOut, ColId, FgRole, IconRef, ListModel, RowKey, SelectionMode, TableModel, TableOut, - TableStyle, + Align, CellKind, CellOut, ColId, Column, FgRole, IconRef, ListModel, RowKey, SelectionMode, SortDir, TableModel, + TableOut, TableStyle, }; use oled_ui::node::{NodeId, Text, WidgetId}; use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; use oled_ui::text::Trim; +use oled_ui::theme::TypeRole; +use oled_ui::widgets::command_bar::{BarEntry, BarStyle, CommandBar, CommandItem}; +use oled_ui::widgets::icon_button::IconSize; +use oled_ui::widgets::sidebar::{DriveLine, NavAction, NavEntry, NavLook, ENTRIES_STYLE}; use oled_ui::widgets::{ - FieldKind, PathBar, PathOut, PathSegment, SidebarItem, SidebarList, SidebarStyle, SplitView, StatusLine, TabSpec, - TabStrip, TextField, Toolbar, ToolbarButton, VirtualTable, + Button, ButtonKind, ButtonShow, FieldKind, IconButton, PathBar, PathOut, PathSegment, SidebarItem, SidebarList, + SplitView, StatusLine, TabSpec, TabStrip, TextField, VirtualTable, }; use oled_ui::Glyph; -const SIZE: SizeL = SizeL { w: 960, h: 600 }; +const SIZE: SizeL = SizeL { w: 1120, h: 760 }; /// The entries of the listing. pub const ENTRIES: usize = 100_000; /// Widget ids of the page. const STRIP: WidgetId = WidgetId(1); -const TOOLBAR: WidgetId = WidgetId(2); -const FILTER: WidgetId = WidgetId(3); +const BAR: WidgetId = WidgetId(2); const PATH: WidgetId = WidgetId(4); const SPLIT: WidgetId = WidgetId(5); const SIDE: WidgetId = WidgetId(6); const TABLE: WidgetId = WidgetId(7); const STATUS: WidgetId = WidgetId(8); +/// The static widgets take ids from here on. +const STATIC_ID: u32 = 100; /// The page's commands: the Tabs row's chords, the path chords and the regions. const NEXT_TAB: CommandId = CommandId(1); @@ -46,29 +55,87 @@ const EDIT_PATH: CommandId = CommandId(3); const EDIT_PATH_F4: CommandId = CommandId(4); const NEXT_REGION: CommandId = CommandId(5); const PREV_REGION: CommandId = CommandId(6); -const BACK: CommandId = CommandId(7); -const FORWARD: CommandId = CommandId(8); -const UP: CommandId = CommandId(9); /// Ctrl+1..Ctrl+9: CommandId(DIGIT + 1)..CommandId(DIGIT + 9). const DIGIT: u32 = 20; -/// The sidebar's current place: its key, and its node (slot 1 + its index: the "Pinned" header is index 0). -const SIDE_CURRENT: u64 = 2; -const SIDE_CURRENT_SLOT: u32 = 3; - -/// A listing without storage: names with extensions, some long enough to trim in the middle, cloud and link badges and -/// cut rows. +/// The sidebar's current place: its key, and its node (slot 1 + its index in the items). +const SIDE_CURRENT: u64 = 4; +const SIDE_CURRENT_SLOT: u32 = 5; + +/// The layout, logical px: the tab row, the address row, the command bar, the status line, the sidebar and the +/// details pane. +const TABS_H: i32 = 40; +const ADDRESS_H: i32 = 44; +const BAR_H: i32 = 44; +const STATUS_H: i32 = 28; +const DETAILS_W: i32 = 276; + +/// The entry that is selected, and the names of the first entries: (English, Italian, kind). +const SELECTED: usize = 12; +const NAMES: [(&str, &str); 15] = [ + ("Drafts", "Bozze"), + ("Contracts", "Contratti"), + ("Site photos", "Fotografie cantiere"), + ("Estimates", "Preventivi"), + ("Invoices archive 2025.zip", "Archivio fatture 2025.zip"), + ("Budget 2026.xlsx", "Budget 2026.xlsx"), + ("Sensor data.csv", "Dati sensori.csv"), + ("setup-tool-1.4.2.exe", "installa-strumento-1.4.2.exe"), + ("Notes.txt", "Note.txt"), + ("Floor plan.png", "Planimetria piano terra.png"), + ("Client presentation.pptx", "Presentazione cliente.pptx"), + ("Final report v2.pdf", "Relazione finale v2.pdf"), + ("Final report v3.docx", "Relazione finale v3.docx"), + ("Meeting 14 november.m4a", "Riunione 14 novembre.m4a"), + ("Site walkthrough.mp4", "Sopralluogo cantiere.mp4"), +]; +const EXT: [&str; 9] = ["txt", "pdf", "png", "docx", "zip", "xlsx", "mp4", "m4a", "pptx"]; + +/// A listing without storage: the first entries are the sample of the design, the rest are generated. struct Listing { - sizes: Demo, + italian: bool, + arts: Vec<(Art, IconBitmap)>, } -fn name_of(i: usize) -> String { - const EXT: [&str; 5] = ["txt", "rs", "png", "docx", "zip"]; +fn name_of(i: usize, italian: bool) -> String { + if i < NAMES.len() { + return (if italian { NAMES[i].1 } else { NAMES[i].0 }).to_string(); + } let ext = EXT[i % EXT.len()]; if i % 9 == 4 { format!("A long descriptive file name that cannot fit its column {i}.{ext}") } else { - format!("item {i}.{ext}") + format!("{} {i}.{ext}", if italian { "Documento" } else { "Document" }) + } +} + +fn is_folder(i: usize) -> bool { + i < 4 +} + +/// The art of an entry: a folder, the family of its extension, the program placeholder or the generic page. +fn art_of(i: usize, name: &str) -> Art { + if is_folder(i) { + return Art::Folder; + } + let ext = name.rsplit('.').next().unwrap_or(""); + if ext.eq_ignore_ascii_case("exe") { + Art::Program + } else { + family_of_ext(ext).map_or(Art::FileGeneric, Art::File) + } +} + +impl Listing { + fn new(lang: UiLang) -> Listing { + let mut list = vec![Art::Folder, Art::Program, Art::FileGeneric]; + list.extend(oled_ui::art::Family::ALL.iter().map(|f| Art::File(*f))); + let arts = list.into_iter().map(|a| (a, (*art_rc(a)).clone())).collect(); + Listing { italian: lang.italian, arts } + } + + fn art_index(&self, a: Art) -> u32 { + self.arts.iter().position(|(x, _)| *x == a).unwrap_or(2) as u32 } } @@ -86,7 +153,7 @@ impl ListModel for Listing { } fn label(&self, row: usize) -> Cow<'_, str> { - Cow::Owned(name_of(row)) + Cow::Owned(name_of(row, self.italian)) } fn generation(&self) -> u64 { @@ -94,154 +161,339 @@ impl ListModel for Listing { } } +/// The type column: the family of the entry in words. +fn type_of(i: usize, name: &str, it: bool) -> String { + if is_folder(i) { + return (if it { "Cartella" } else { "Folder" }).to_string(); + } + let ext = name.rsplit('.').next().unwrap_or("").to_ascii_uppercase(); + match (it, ext.as_str()) { + (true, "ZIP") => "Cartella compressa".to_string(), + (false, "ZIP") => "Compressed folder".to_string(), + (true, "TXT") => "Documento di testo".to_string(), + (false, "TXT") => "Text document".to_string(), + (true, "EXE") => "Applicazione".to_string(), + (false, "EXE") => "Application".to_string(), + (true, e) => format!("File {e}"), + (false, e) => format!("{e} file"), + } +} + impl TableModel for Listing { fn cell(&self, row: usize, col: ColId, out: &mut CellOut) { - if col.0 != 0 { - return self.sizes.cell(row, col, out); - } - let name = name_of(row); - out.set_text(CellKind::Text, &name); - out.icon = Some(IconRef(0)); - out.trim = Trim::Middle { tail: 10 }; - if let Some(dot) = name.rfind('.') { - out.push_span(dot as u32, name.len() as u32, FgRole::Secondary); + let name = name_of(row, self.italian); + match col.0 { + 0 => { + out.set_text(CellKind::Text, &name); + out.icon = Some(IconRef(self.art_index(art_of(row, &name)))); + out.trim = Trim::Middle { tail: 10 }; + if !is_folder(row) { + if let Some(dot) = name.rfind('.') { + out.push_span(dot as u32, name.len() as u32, FgRole::Tertiary); + } + } + out.badge = match row % 23 { + 17 => Some(oled_ui::model::Badge::CloudOnline), + 19 => Some(oled_ui::model::Badge::Link), + _ => None, + }; + out.cut = row % 41 == 33; + } + 1 => { + out.set_text( + CellKind::Text, + &format!("{:02}/11/2026 {:02}:{:02}", 1 + row % 28, row % 24, (row * 7) % 60), + ); + out.fg = FgRole::Secondary; + } + 2 => { + out.set_text(CellKind::Text, &type_of(row, &name, self.italian)); + out.fg = FgRole::Secondary; + } + _ => { + if is_folder(row) { + out.set_text(CellKind::Text, ""); + } else { + let kb = 12 + (row * 7919) % 90_000; + let t = if kb >= 1000 { format!("{:.2} MB", kb as f32 / 1024.0) } else { format!("{kb} KB") }; + out.set_text(CellKind::Bytes, &if self.italian { t.replace('.', ",") } else { t }); + out.align = Align::Decimal; + } + out.fg = FgRole::Secondary; + } } - out.badge = match row % 23 { - 3 => Some(Badge::CloudOnline), - 7 => Some(Badge::CloudLocal), - 11 => Some(Badge::CloudPinned), - 13 => Some(Badge::Link), - _ => None, - }; - out.cut = row % 41 == 5; } - fn icon(&self, icon: IconRef, px: i32) -> Option<&IconBitmap> { - self.sizes.icon(icon, px) + fn icon(&self, icon: IconRef, _px: i32) -> Option<&IconBitmap> { + self.arts.get(icon.0 as usize).map(|(_, b)| b) } } -fn tab(key: u64, label: Text) -> TabSpec { - TabSpec { key, label, tip: None, icon: None, busy: false, error: false } +fn columns(lang: UiLang) -> Vec { + let col = |id: u16, title: Text, width: i32, flex: bool, align: Align| Column { + id: ColId(id), + title, + width, + min: if flex { 200 } else { 60 }, + flex, + align, + sort: None, + first_sort: SortDir::Asc, + visible: true, + hideable: id != 0, + tip: None, + }; + let mut c = vec![ + col(0, s(lang, "Name", "Nome"), 240, true, Align::Start), + col(1, s(lang, "Modified", "Ultima modifica"), 150, false, Align::Start), + col(2, s(lang, "Type", "Tipo"), 140, false, Align::Start), + col(3, s(lang, "Size", "Dimensione"), 90, false, Align::Decimal), + ]; + c[0].sort = Some(SortDir::Asc); + c } -fn place(key: u64, label: Text, glyph: Glyph, trailing: Option<(Text, FgRole)>) -> SidebarItem { +fn tab(key: u64, label: Text, art: Art) -> TabSpec { + TabSpec { key, label, tip: None, icon: Some(art_rc(art)), busy: false, error: false } +} + +fn place(key: u64, label: Text, art: Art) -> SidebarItem { SidebarItem { key, label, - glyph: Some(glyph), - icon: None, + glyph: None, + icon: Some(art_rc(art)), depth: 0, expandable: false, expanded: false, section: false, - trailing, + trailing: None, disabled: false, busy: false, } } fn section(key: u64, label: Text) -> SidebarItem { - SidebarItem { section: true, glyph: None, ..place(key, label, Glyph::Folder, None) } + SidebarItem { section: true, icon: None, ..place(key, label, Art::Folder) } } /// The page's screen. pub struct MockFiles { strip: TabStrip, - toolbar: Toolbar, + bar: CommandBar, path: PathBar, split: SplitView, side: SidebarList, table: VirtualTable, status: StatusLine, - rects: Rects, + still: Board, commands: CommandTable, /// What the screen did with the widgets' outputs, for the keyboard script. pub log: Vec, } -/// The rects of the last layout. -#[derive(Default)] -struct Rects { - body: RectP, +fn px(cx: &LayoutCx, r: (i32, i32, i32, i32)) -> RectP { + RectP::wh(cx.px(r.0), cx.px(r.1), cx.px(r.2), cx.px(r.3)) } impl MockFiles { pub fn new(lang: UiLang) -> MockFiles { - let strip = TabStrip::new(STRIP).with_tabs( + let strip = TabStrip::new(STRIP).with_click_look().with_tabs( vec![ - tab(1, s(lang, "Downloads", "Scaricati")), - tab(2, s(lang, "Documents", "Documenti")), - tab(3, s(lang, "Pictures", "Immagini")), - tab(4, s(lang, "Projects", "Progetti")), + tab(1, s(lang, "Projects 2026", "Progetti 2026"), Art::Folder), + tab(2, s(lang, "Downloads", "Download"), Art::Downloads), + tab(3, s(lang, "Pictures", "Immagini"), Art::Pictures), ], 1, ); - let button = |cmd: CommandId, glyph, en: &'static str, it: &'static str| ToolbarButton { - command: cmd, - glyph, - tip: s(lang, en, it), - toggled: None, + let mut ids = STATIC_ID; + let mut next = || { + ids += 1; + WidgetId(ids) }; - let mut filter = TextField::new(FILTER, FieldKind::Search); - filter.set_placeholder(s(lang, "Search Downloads", "Cerca in Scaricati")); - filter.set_label(s(lang, "Filter", "Filtro")); - filter.set_width(200); - let toolbar = Toolbar::new( - TOOLBAR, - None, - vec![ - button(BACK, Glyph::ChevronLeft, "Back", "Indietro"), - button(FORWARD, Glyph::ChevronRight, "Forward", "Avanti"), - button(UP, Glyph::ChevronUp, "Up", "Su"), - ], - Some(filter), - ); + let mut still = Board::new(); + // The address row: history buttons, then (typed) the path bar, then the search field. + let nav = [ + (Glyph::NavBack, "Back to Studio Alt+Left", "Indietro a Studio Alt+Sinistra"), + (Glyph::NavForward, "Forward", "Avanti"), + (Glyph::NavUp, "Up", "Su"), + (Glyph::NavRefresh, "Refresh", "Aggiorna"), + ]; + for (i, (g, en, it)) in nav.into_iter().enumerate() { + let mut b = IconButton::new(next(), g, s(lang, en, it)); + b.set_size(IconSize::Large); + b.set_enabled(i != 1); + still.add(b, (8 + 36 * i as i32, TABS_H + 6, 32, 32)); + } + let mut search = TextField::new(next(), FieldKind::Search); + search.set_click_style(true); + search.set_label(s(lang, "Search", "Cerca")); + search.set_placeholder(s(lang, "Search in Projects 2026", "Cerca in Progetti 2026")); + search.set_width(250); + still.add(search, (SIZE.w - 8 - 250, TABS_H + 6, 250, 32)); + let seg = |key, en: &'static str, it: &'static str| PathSegment { key, label: s(lang, en, it), tip: None }; - let path = PathBar::new(PATH).with_path( + let mut path = PathBar::new(PATH).with_click_look().with_path( vec![ - seg(1, "Local Disk (C:)", "Disco locale (C:)"), - seg(2, "Users", "Utenti"), - seg(3, "Downloads", "Scaricati"), + seg(1, "Documents", "Documenti"), + seg(2, "Studio", "Studio"), + seg(3, "Projects 2026", "Progetti 2026"), ], - "C:\\Users\\Downloads".to_string(), + "C:\\Users\\Documents\\Studio\\Projects 2026".to_string(), ); - let split = SplitView::new(SPLIT, 160, 400, 200); - let free = |t: Text, role| Some((t, role)); - let side = SidebarList::new(SIDE, SidebarStyle { row_h: 28, inset: 8 }).with_items(vec![ - section(100, s(lang, "Pinned", "Fissati")), - place(1, s(lang, "Desktop", "Desktop"), Glyph::Monitor, None), - place(SIDE_CURRENT, s(lang, "Downloads", "Scaricati"), Glyph::Download, None), - place(3, s(lang, "Documents", "Documenti"), Glyph::Document, None), - place(4, s(lang, "Pictures", "Immagini"), Glyph::Image, None), - section(101, s(lang, "This PC", "Questo PC")), - place( - 5, - s(lang, "Local Disk (C:)", "Disco locale (C:)"), - Glyph::Disk, - free(s(lang, "212 GB free", "212 GB liberi"), FgRole::Tertiary), + path.set_first_art(Some(art_rc(Art::Documents))); + + // The command bar. + let item = |n: u32, g, l: Text, k| CommandItem::new(CommandId(200 + n), g, l, k); + let entries = vec![ + BarEntry::Item(item(1, Glyph::LinePlus, s(lang, "New", "Nuovo"), ButtonKind::Plate).with_menu(Vec::new())), + BarEntry::Separator, + BarEntry::Item(item(2, Glyph::CmdCut, s(lang, "Cut", "Taglia"), ButtonKind::Command).fold(8)), + BarEntry::Item(item(3, Glyph::CmdCopy, s(lang, "Copy", "Copia"), ButtonKind::Command).fold(7)), + BarEntry::Item( + item(4, Glyph::CmdPaste, s(lang, "Paste", "Incolla"), ButtonKind::Command).fold(6).enabled(false), ), - place( - 6, - s(lang, "Data (D:)", "Dati (D:)"), - Glyph::Disk, - free(s(lang, "9 GB free", "9 GB liberi"), FgRole::Attention), + BarEntry::Item(item(5, Glyph::CmdRename, s(lang, "Rename", "Rinomina"), ButtonKind::Command).fold(5)), + BarEntry::Item(item(6, Glyph::CmdDelete, s(lang, "Delete", "Elimina"), ButtonKind::Destructive).fold(4)), + BarEntry::Separator, + BarEntry::Item(item(7, Glyph::CmdSort, s(lang, "Sort", "Ordina"), ButtonKind::Menu).fold(3)), + BarEntry::Item(item(8, Glyph::CmdView, s(lang, "View", "Visualizza"), ButtonKind::Menu).fold(2)), + BarEntry::Item(item(9, Glyph::CmdFilter, s(lang, "Filter", "Filtra"), ButtonKind::Menu).fold(1)), + BarEntry::More, + BarEntry::Spacer, + BarEntry::Item( + item(10, Glyph::CmdDetailsPane, s(lang, "Details", "Dettagli"), ButtonKind::Toggle).on(true), ), + ]; + let mut bar = CommandBar::new(BAR, BarStyle::Bar, entries); + bar.set_name(s(lang, "Commands", "Comandi")); + bar.show(Some(CommandId(205)), ButtonShow::Focus); + + // The sidebar. + let drive = |free: &'static str, used: f32| NavEntry { + drive: Some(DriveLine { free: Text::from(free), used }), + ..NavEntry::default() + }; + let mut side = SidebarList::new(SIDE, ENTRIES_STYLE).with_look(NavLook::Entries).with_items(vec![ + place(1, s(lang, "Home", "Home"), Art::Home), + section(100, s(lang, "Quick access", "Accesso rapido")), + place(2, s(lang, "Desktop", "Desktop"), Art::Desktop), + place(3, s(lang, "Downloads", "Download"), Art::Downloads), + place(SIDE_CURRENT, s(lang, "Documents", "Documenti"), Art::Documents), + place(5, s(lang, "Pictures", "Immagini"), Art::Pictures), + place(6, s(lang, "Music", "Musica"), Art::Music), + place(7, s(lang, "Videos", "Video"), Art::Videos), + place(8, s(lang, "Projects 2026", "Progetti 2026"), Art::Folder), + section(101, s(lang, "This PC", "Questo PC")), + place(9, s(lang, "System (C:)", "Sistema (C:)"), Art::DriveSystem), + place(10, s(lang, "Data (D:)", "Dati (D:)"), Art::DriveFixed), + place(11, s(lang, "Stick (E:)", "Chiavetta (E:)"), Art::DriveRemovable), + section(102, s(lang, "Network", "Rete")), + place(12, s(lang, "Archive (Z:)", "Archivio (Z:)"), Art::DriveNetwork), + SidebarItem { + glyph: Some(Glyph::LineGlobe), + icon: None, + ..place(13, s(lang, "Network", "Rete"), Art::ThisPc) + }, + place(14, s(lang, "Recycle Bin", "Cestino"), Art::RecycleBin), ]); - let mut side = side; + side.set_entry( + 8, + NavEntry { + action: Some((NavAction::Pin, s(lang, "Remove from Quick access", "Togli da Accesso rapido"))), + ..NavEntry::default() + }, + ); + side.set_entry(9, drive("412 GB", 0.78)); + side.set_entry(10, drive("37 GB", 0.95)); + side.set_entry(11, drive("11.2 GB", 0.3)); + for key in [13, 14] { + side.set_entry( + key, + NavEntry { action: Some((NavAction::External, Text::from(""))), ..NavEntry::default() }, + ); + } side.set_current(Some(SIDE_CURRENT)); - let mut cols = columns(lang); - cols.truncate(2); - let model = Listing { sizes: Demo::synthetic(ENTRIES) }; - let mut table = VirtualTable::new(TABLE, model, cols, SelectionMode::Multi, TableStyle::FILES) - .with_selection(select(&[1, 2, 3])) - .with_focused(RowKey(2)); + + let split = SplitView::new(SPLIT, 160, 400, 224); + + // The list. + let mut table = + VirtualTable::new(TABLE, Listing::new(lang), columns(lang), SelectionMode::Multi, TableStyle::FILES_LIST) + .with_selection(select(&[SELECTED as u64])) + .with_focused(RowKey(SELECTED as u64)); table.set_label(s(lang, "Files", "File")); - let mut status = StatusLine::new(STATUS); + + // The details pane, from kit primitives, at the right of the body. + let dx = SIZE.w - DETAILS_W; + let body_t = TABS_H + ADDRESS_H + BAR_H; + let pane_h = SIZE.h - STATUS_H - body_t; + still.add(Still::new(Shape::VRule), (dx, body_t, 1, pane_h)); + still.add(Still::new(Shape::Card), (dx + 18, body_t + 16, DETAILS_W - 36, 150)); + still.add( + Pic::new(Picture::Art(art_rc(Art::File(oled_ui::art::Family::Document)), 255)), + (dx + 18 + (DETAILS_W - 36 - 64) / 2, body_t + 16 + 43, 64, 64), + ); + let wide = DETAILS_W - 36; + still.add( + Words::new(s(lang, "Final report v3.docx", "Relazione finale v3.docx"), TypeRole::Subtitle, FgRole::Hot), + (dx + 18, body_t + 16 + 150 + 14, wide, 20), + ); + still.add( + Words::new(s(lang, "DOCX document", "Documento DOCX"), TypeRole::Caption, FgRole::Secondary), + (dx + 18, body_t + 16 + 150 + 38, wide, 16), + ); + let facts = [ + (("Size", "Dimensione"), ("1.24 MB", "1,24 MB")), + (("Modified", "Ultima modifica"), ("Today 10:05", "Oggi 10:05")), + (("Created", "Creato"), ("20/11/2026 09:12", "20/11/2026 09:12")), + (("Folder", "Cartella"), ("Projects 2026", "Progetti 2026")), + (("Attributes", "Attributi"), ("None", "Nessuno")), + ]; + let fy = body_t + 16 + 150 + 38 + 16 + 12; + still.add(Still::new(Shape::HRule), (dx + 18, fy, wide, 1)); + for (i, (key, value)) in facts.into_iter().enumerate() { + let y = fy + 10 + 24 * i as i32; + still.add(Words::new(s(lang, key.0, key.1), TypeRole::Caption, FgRole::Tertiary), (dx + 18, y, 110, 24)); + still.add( + Words::new(s(lang, value.0, value.1), TypeRole::Caption, FgRole::Primary).right(), + (dx + 18 + 110, y, wide - 110, 24), + ); + } + let by = fy + 10 + 24 * 5 + 16; + still.add(Button::new(next(), s(lang, "Open", "Apri"), ButtonKind::Primary), (dx + 18, by, 120, 32)); + still.add( + Button::new(next(), s(lang, "Open with", "Apri con"), ButtonKind::Plate).with_chevron(), + (dx + 18 + 128, by, 104, 32), + ); + + // The status line: the count and the selection at the left, the drive and its capacity at the right. + let mut status = StatusLine::new(STATUS).with_click_look(); status.set_items(vec![ - (s(lang, "100,000 items", "100.000 elementi"), FgRole::Tertiary), - (s(lang, "3 selected", "3 selezionati"), FgRole::Secondary), + (s(lang, "100,000 items", "100.000 elementi"), FgRole::Secondary), + (s(lang, "1 selected, 1.24 MB", "1 selezionato, 1,24 MB"), FgRole::Primary), ]); + let sy = SIZE.h - STATUS_H; + still.add(Still::new(Shape::HRule), (0, sy, SIZE.w, 1)); + still.add( + Pic::new(Picture::Art(art_rc(Art::DriveSystem), 255)), + (SIZE.w - 16 - 218 - 8 - 48 - 8 - 96 - 8 - 16, sy + 6, 16, 16), + ); + still.add( + Words::new(s(lang, "System (C:)", "Sistema (C:)"), TypeRole::Caption, FgRole::Secondary), + (SIZE.w - 16 - 218 - 8 - 48 - 8 - 96, sy + 6, 96, 16), + ); + still.add(Still::new(Shape::Capacity(0.78)), (SIZE.w - 16 - 218 - 8 - 48, sy + 12, 48, 4)); + still.add( + Words::new( + s(lang, "412 GB free of 1.81 TB", "412 GB liberi di 1,81 TB"), + TypeRole::Caption, + FgRole::Secondary, + ) + .right(), + (SIZE.w - 16 - 218, sy + 6, 218, 16), + ); + let mut commands = CommandTable::new(); let mut bind = |id: CommandId, label: &'static str, chord: &str, alt: Option<&str>| { let Some(main) = Chord::parse(chord) else { return }; @@ -260,18 +512,7 @@ impl MockFiles { for d in 1..=9u32 { bind(CommandId(DIGIT + d), "Tab by number", &format!("Ctrl+{d}"), None); } - MockFiles { - strip, - toolbar, - path, - split, - side, - table, - status, - rects: Rects::default(), - commands, - log: Vec::new(), - } + MockFiles { strip, bar, path, split, side, table, status, still, commands, log: Vec::new() } } /// F6 and Shift+F6: the focus goes from the sidebar to the table and back. @@ -284,28 +525,25 @@ impl MockFiles { impl Screen for MockFiles { fn layout(&mut self, cx: &mut LayoutCx, avail: SizeP) -> SizeP { - let w = avail.w; - let (strip_h, bar_h, status_h) = (cx.px(40), cx.px(44), cx.px(28)); - self.strip.layout(cx, RectP::wh(0, 0, w, strip_h)); - let bar = RectP::wh(0, strip_h, w, bar_h); - self.toolbar.layout(cx, bar); - // The path line fills what the three buttons and the filter field leave. - let (l, r) = (cx.px(16 + 3 * 28 + 2 * 4 + 12), w - cx.px(16 + 200 + 8)); - self.path.layout(cx, RectP { l, r, ..bar }); - let body = RectP { l: 0, t: bar.b, r: w, b: avail.h - status_h }; - self.rects.body = body; + self.strip.layout(cx, px(cx, (0, 0, SIZE.w, TABS_H))); + self.still.layout(cx, avail); + self.path.layout(cx, px(cx, (8 + 36 * 4 + 4, TABS_H + 6, SIZE.w - 8 - 250 - 8 - (8 + 36 * 4 + 4), 32))); + self.bar.layout(cx, px(cx, (0, TABS_H + ADDRESS_H, SIZE.w, BAR_H))); + let body_t = TABS_H + ADDRESS_H + BAR_H; + let body = px(cx, (0, body_t, SIZE.w, SIZE.h - STATUS_H - body_t)); self.split.layout(cx, body); let (first, second) = self.split.panes(body); self.side.layout(cx, first); - self.table.layout(cx, second); - self.status.layout(cx, RectP { l: 0, t: body.b, r: w, b: avail.h }); + self.table.layout(cx, RectP { r: second.r - cx.px(DETAILS_W), ..second }); + self.status.layout(cx, px(cx, (0, SIZE.h - STATUS_H, SIZE.w, STATUS_H))); avail } fn paint(&self, cx: &mut PaintCx) { self.strip.paint(cx); - self.toolbar.paint(cx); + self.still.paint(cx); self.path.paint(cx); + self.bar.paint(cx); self.side.paint(cx); self.table.paint(cx); self.split.paint(cx); @@ -335,13 +573,14 @@ impl Screen for MockFiles { NEXT_REGION | PREV_REGION => self.switch_region(cx), _ => {} } - self.toolbar.event(cx, ev); + self.bar.event(cx, ev); return Reply::None; } if let Some(o) = self.strip.event(cx, ev) { self.log.push(format!("{o:?}")); } - self.toolbar.event(cx, ev); + self.still.event(cx, ev); + self.bar.event(cx, ev); match self.path.event(cx, ev) { Some(PathOut::CompletionRequested(text)) => { let items = (1..=3).map(|i| Text::from(format!("{text}{i}"))).collect(); @@ -405,9 +644,9 @@ mod tests { h.key("Ctrl+PgUp"); assert_eq!(h.screen().strip.selected(), 1); h.key("Ctrl+9"); - assert_eq!(h.screen().strip.selected(), 4, "the last tab"); + assert_eq!(h.screen().strip.selected(), 3, "the last tab"); h.key("Ctrl+7"); - assert_eq!(h.screen().strip.selected(), 4, "no seventh tab: no effect"); + assert_eq!(h.screen().strip.selected(), 3, "no seventh tab: no effect"); h.key("Ctrl+2"); assert_eq!(h.screen().strip.selected(), 2); @@ -418,22 +657,22 @@ mod tests { assert_eq!(owner(&h), Some(TABLE)); h.key("Shift+F6"); assert_eq!(owner(&h), Some(SIDE)); - // Down in the sidebar: the focus moves among the places (not onto the section header). + // Down in the sidebar: the focus moves among the places (not onto a section header). h.key("Down"); - assert_eq!(h.focused(), Some(NodeId::new(SIDE, 4))); + assert_eq!(h.focused(), Some(NodeId::new(SIDE, SIDE_CURRENT_SLOT + 1))); // Tab reaches the splitter; Alt+Shift+Right widens the sidebar by 16 px. let mut tabs = 0; - while owner(&h) != Some(SPLIT) && tabs < 40 { + while owner(&h) != Some(SPLIT) && tabs < 80 { h.key("Tab"); tabs += 1; } assert_eq!(owner(&h), Some(SPLIT), "the splitter is a Tab stop"); let width = |h: &mut Harness| h.screen().split.first(); - assert_eq!(width(&mut h), 200); + assert_eq!(width(&mut h), 224); h.key("Alt+Shift+Right"); - assert_eq!(width(&mut h), 216); - assert!(h.screen().log.iter().any(|l| l.contains("Moved(216)")), "{:?}", h.screen().log); + assert_eq!(width(&mut h), 240); + assert!(h.screen().log.iter().any(|l| l.contains("Moved(240)")), "{:?}", h.screen().log); // Ctrl+L turns the path into a field with the path selected; typing lists completions; Esc closes the list, then // restores the breadcrumb. @@ -459,4 +698,33 @@ mod tests { h.advance(1000); assert!(h.is_idle(), "the page keeps no clock at rest"); } + + #[test] + fn the_entries_carry_the_art_of_their_family() { + assert_eq!(art_of(0, "Drafts"), Art::Folder); + assert_eq!(art_of(12, "Final report v3.docx"), Art::File(oled_ui::art::Family::Document)); + assert_eq!(art_of(11, "Final report v2.PDF"), Art::File(oled_ui::art::Family::Pdf)); + assert_eq!(art_of(7, "setup.exe"), Art::Program); + assert_eq!(art_of(30, "Notes.unknownext"), Art::FileGeneric); + // Every sample name of the design lands on an art; none is bare. + let l = Listing::new(UiLang::EN); + for i in 0..NAMES.len() { + let mut out = CellOut::default(); + l.cell(i, ColId(0), &mut out); + assert!(out.icon.is_some(), "row {i} has no icon"); + } + } + + #[test] + fn the_page_paints_art_in_the_list_and_the_details_pane() { + let mut h = harness(); + let img = h.render(); + // The details card holds the 64 px document art: coloured pixels (the badge blue) inside it. + let dx = SIZE.w - DETAILS_W; + let card = img.crop(RectP::wh(dx + 18, TABS_H + ADDRESS_H + BAR_H + 16, DETAILS_W - 36, 150)); + assert!(card.px.iter().any(|p| (p & 0xFF) > 0xC0 && ((p >> 16) & 0xFF) < 0x80), "no art in the card"); + // The first folder row shows the folder's amber: a pixel with red above blue by a margin. + let rows = img.crop(RectP::wh(240, TABS_H + ADDRESS_H + BAR_H + 36, 40, 60)); + assert!(rows.px.iter().any(|p| ((p >> 16) & 0xFF) > 0xB0 && (p & 0xFF) < 0x70), "no folder art in the list"); + } } diff --git a/apps/gallery/src/pages/mock_tasks.rs b/apps/gallery/src/pages/mock_tasks.rs index 7e93a83a..173024df 100644 --- a/apps/gallery/src/pages/mock_tasks.rs +++ b/apps/gallery/src/pages/mock_tasks.rs @@ -1,112 +1,669 @@ -//! The mock_tasks page (K2a.6): a tasks-like screen over 300 fake processes, refreshed by one message per simulated -//! second: the first integration consumer of the table and the rehearsal of the tasks app's window. +//! The mock_tasks page: the Processes page of the task manager as it is meant to look, made only of kit widgets: the page +//! rail, the page head with its search, segmented view and run button, the resource strip (a verdict and four cells with +//! their sparklines), the command band, a table with art, heat and legends over invented processes, and the status line. +//! One message per simulated second refreshes the figures, like the app's sampling does. -use super::table::{columns, Demo, Row, Tables}; +use std::borrow::Cow; + +use super::click_states::{art_rc, Board, Pic, Picture, Shape, Still, Words}; +use super::table::select; use super::{s, Page}; -use oled_ui::cx::EventCx; -use oled_ui::event::Reply; -use oled_ui::geom::SizeL; +use oled_ui::art::Art; +use oled_ui::command::{CommandId, CommandTable}; +use oled_ui::cx::{EventCx, LayoutCx, PaintCx}; +use oled_ui::event::{Event, Reply}; +use oled_ui::geom::{RectP, SizeL, SizeP}; +use oled_ui::gfx::image::IconBitmap; use oled_ui::host::AppMsg; -use oled_ui::model::{Badge, RowMotion, SelectionMode, TableStyle}; -use oled_ui::node::WidgetId; -use oled_ui::screen::Screen; +use oled_ui::model::{ + Align, CellKind, CellOut, ColId, Column, FgRole, HeatStep, IconRef, ListModel, RowKey, RowOut, SelectionMode, + SortDir, TableModel, TableStyle, TreeInfo, +}; +use oled_ui::node::{Text, WidgetId}; +use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; -use oled_ui::widgets::VirtualTable; +use oled_ui::text::Trim; +use oled_ui::theme::{Ink, TypeRole}; +use oled_ui::tokens::{RES_CPU, RES_DISK, RES_MEM, RES_NET}; +use oled_ui::widgets::command_bar::{BandSelection, BarEntry, BarStyle, CommandBar, CommandItem}; +use oled_ui::widgets::line_chart::{ChartStyle, LineChart, LineScale, LineSeries}; +use oled_ui::widgets::sidebar::{NavEntry, NavLook, RAIL_STYLE}; +use oled_ui::widgets::{ + Button, ButtonKind, FieldKind, IconButton, Segmented, SidebarItem, SidebarList, StatusLine, TextField, TextLink, + VirtualTable, +}; +use oled_ui::Glyph; /// The refresh message: one per simulated second. pub struct Tick; -/// Processes on the page. -pub const PROCESSES: usize = 300; +const SIZE: SizeL = SizeL { w: 1120, h: 720 }; +/// The rail's width, the table's top (head 52, strip 76, band 52) and the status line's height, logical px. +const RAIL_W: i32 = 184; +const TABLE_TOP: i32 = 180; +const STATUS_H: i32 = 28; + +/// One row of the process list. +#[derive(Clone)] +struct Proc { + key: u64, + name: (&'static str, &'static str), + role: Option<(&'static str, &'static str)>, + art: Art, + depth: u16, + expandable: bool, + expanded: bool, + section: bool, + members: u32, + cpu: f32, + mem: f32, + io: f32, + state: State, +} + +#[derive(Clone, Copy, PartialEq, Eq)] +enum State { + Normal, + NotResponding, + Efficiency, +} + +fn section(key: u64, name: (&'static str, &'static str), count: u32, cpu: f32, mem: f32, io: f32) -> Proc { + Proc { + key, + name, + role: None, + art: Art::Folder, + depth: 0, + expandable: true, + expanded: true, + section: true, + members: count, + cpu, + mem, + io, + state: State::Normal, + } +} + +fn app(key: u64, name: &'static str, art: Art, members: u32, cpu: f32, mem: f32, io: f32) -> Proc { + Proc { + key, + name: (name, name), + role: None, + art, + depth: 0, + expandable: members > 0, + expanded: false, + section: false, + members, + cpu, + mem, + io, + state: State::Normal, + } +} + +fn member(key: u64, name: &'static str, role: (&'static str, &'static str), cpu: f32, mem: f32, io: f32) -> Proc { + Proc { role: Some(role), depth: 1, ..app(key, name, Art::Program, 0, cpu, mem, io) } +} + +/// The invented processes: three sections, groups with members, one not responding and one in efficiency mode. +fn processes() -> Vec { + let mut ember = app(1, "Ember", Art::Program, 3, 12.4, 1884.0, 0.4); + ember.expanded = true; + let mut quill = app(5, "Quill", Art::Program, 0, 0.0, 214.0, 0.0); + quill.state = State::NotResponding; + let mut updater = app(21, "Lantern Updater", Art::Program, 0, 0.1, 22.8, 0.0); + updater.state = State::Efficiency; + vec![ + section(100, ("Apps", "App"), 7, 35.1, 4930.0, 1.2), + ember, + member(2, "Ember", ("main window", "finestra principale"), 4.1, 612.0, 0.1), + member(3, "Ember", ("GPU process", "processo GPU"), 5.2, 344.0, 0.0), + member(4, "Ember", ("web pages", "pagine web"), 3.1, 884.0, 0.3), + app(6, "Prism", Art::Program, 2, 18.2, 2150.0, 0.8), + app(7, "Orbit", Art::Program, 3, 2.9, 486.0, 0.0), + quill, + app(8, "Harbor", Art::Program, 2, 1.1, 168.0, 0.0), + app(9, "Ledger", Art::Program, 0, 0.2, 74.3, 0.0), + app(10, "Notes", Art::Program, 0, 0.3, 38.2, 0.0), + section(101, ("In background", "In background"), 38, 3.7, 1240.0, 5.1), + app(20, "Scanner Service Executable", Art::ProcService, 0, 2.1, 268.0, 0.7), + app(22, "Syncer", Art::Program, 3, 0.6, 212.0, 4.2), + app(23, "Cobalt Agent", Art::Program, 2, 0.4, 96.4, 0.2), + updater, + section(102, ("Part of Windows", "Parte di Windows"), 24, 8.4, 1650.0, 0.6), + app(30, "Window Manager", Art::ProcWindows, 0, 1.8, 120.0, 0.0), + app(31, "Service Host", Art::ProcService, 12, 0.9, 310.0, 0.1), + app(32, "Display Driver", Art::ProcHardware, 0, 2.2, 410.0, 0.0), + app(33, "Search Indexer", Art::ProcWindows, 0, 0.1, 52.0, 0.2), + ] +} + +/// The heat step of a value against four thresholds: S0 below the first, S4 at the last. +fn heat(v: f32, t: [f32; 4]) -> u8 { + t.iter().filter(|x| v >= **x).count() as u8 +} + +const CPU_STEPS: [f32; 4] = [1.0, 5.0, 15.0, 30.0]; +const MEM_STEPS: [f32; 4] = [200.0, 512.0, 1024.0, 2048.0]; +const IO_STEPS: [f32; 4] = [0.5, 1.0, 5.0, 20.0]; + +fn hue(c: (u32, u32, u32)) -> Ink { + Ink::solid(c.0, c.1, c.2) +} + +/// A figure with the given number of decimals, comma in Italian. +fn dec(v: f32, d: usize, italian: bool) -> String { + let t = format!("{v:.d$}"); + if italian { + t.replace('.', ",") + } else { + t + } +} + +/// The list's model: the processes, the art of each and the language of the figures. +struct Procs { + rows: Vec, + arts: Vec<(Art, IconBitmap)>, + italian: bool, + generation: u64, +} + +impl Procs { + fn new(lang: UiLang) -> Procs { + let arts = [Art::Folder, Art::Program, Art::ProcWindows, Art::ProcService, Art::ProcHardware] + .into_iter() + .map(|a| (a, (*art_rc(a)).clone())) + .collect(); + Procs { rows: processes(), arts, italian: lang.italian, generation: 0 } + } + + fn art_index(&self, a: Art) -> u32 { + self.arts.iter().position(|(x, _)| *x == a).unwrap_or(1) as u32 + } +} + +impl ListModel for Procs { + fn len(&self) -> usize { + self.rows.len() + } + + fn key(&self, row: usize) -> RowKey { + RowKey(self.rows[row].key) + } + + fn row_of(&self, key: RowKey) -> Option { + self.rows.iter().position(|r| r.key == key.0) + } + + fn label(&self, row: usize) -> Cow<'_, str> { + let r = &self.rows[row]; + Cow::Borrowed(if self.italian { r.name.1 } else { r.name.0 }) + } + + fn generation(&self) -> u64 { + self.generation + } +} + +impl TableModel for Procs { + fn cell(&self, row: usize, col: ColId, out: &mut CellOut) { + let r = &self.rows[row]; + let it = self.italian; + match col.0 { + 0 => { + let name = if it { r.name.1 } else { r.name.0 }; + let mut text = name.to_string(); + if r.section { + text = format!("{name} {}", r.members); + out.set_text(CellKind::Text, &text); + out.push_span(name.len() as u32 + 2, text.len() as u32, FgRole::Tertiary); + } else if r.members > 0 { + text.push_str(&format!(" ({})", r.members)); + out.set_text(CellKind::Text, &text); + out.push_span(name.len() as u32 + 1, text.len() as u32, FgRole::Tertiary); + } else if let Some(role) = r.role { + text.push_str(&format!(" {}", if it { role.1 } else { role.0 })); + out.set_text(CellKind::Text, &text); + out.push_span(name.len() as u32 + 2, text.len() as u32, FgRole::Tertiary); + } else { + out.set_text(CellKind::Text, &text); + } + out.trim = Trim::End; + if !r.section { + out.icon = Some(IconRef(self.art_index(r.art))); + } + } + 1 => match r.state { + State::NotResponding => { + out.set_text(CellKind::Text, if it { "Non risponde" } else { "Not responding" }); + out.fg = FgRole::Attention; + out.lead_dot = Some(FgRole::Attention); + } + State::Efficiency => { + out.set_text(CellKind::Text, if it { "Efficienza" } else { "Efficiency" }); + out.fg = FgRole::Tertiary; + } + State::Normal => { + out.set_text(CellKind::Text, ""); + } + }, + 2 => { + out.set_text(CellKind::Percent, &format!("{} %", dec(r.cpu, 1, it))); + out.align = Align::Decimal; + out.fg = if r.section { FgRole::Tertiary } else { FgRole::Secondary }; + if !r.section { + out.heat = Some(HeatStep(heat(r.cpu, CPU_STEPS))); + out.heat_hue = Some(hue(RES_CPU)); + } + } + 3 => { + let text = if r.mem >= 1024.0 { + format!("{} GB", dec(r.mem / 1024.0, 2, it)) + } else { + format!("{} MB", dec(r.mem, if r.mem < 100.0 { 1 } else { 0 }, it)) + }; + out.set_text(CellKind::Bytes, &text); + out.align = Align::Decimal; + out.fg = if r.section { FgRole::Tertiary } else { FgRole::Secondary }; + if !r.section { + out.heat = Some(HeatStep(heat(r.mem, MEM_STEPS))); + out.heat_hue = Some(hue(RES_MEM)); + } + } + _ => { + out.set_text(CellKind::Bytes, &format!("{} MB/s", dec(r.io, if r.io == 0.0 { 0 } else { 1 }, it))); + out.align = Align::Decimal; + out.fg = if r.section { FgRole::Tertiary } else { FgRole::Secondary }; + if !r.section { + out.heat = Some(HeatStep(heat(r.io, IO_STEPS))); + out.heat_hue = Some(hue(RES_DISK)); + } + } + } + } + + fn row(&self, row: usize, out: &mut RowOut) { + *out = RowOut { section: self.rows[row].section, ..RowOut::default() }; + } + + fn tree(&self, row: usize) -> Option { + let r = &self.rows[row]; + (r.depth > 0 || r.expandable).then_some(TreeInfo { + depth: r.depth, + expandable: r.expandable, + expanded: r.expanded, + }) + } + + fn icon(&self, icon: IconRef, _px: i32) -> Option<&IconBitmap> { + self.arts.get(icon.0 as usize).map(|(_, b)| b) + } +} + +fn columns(lang: UiLang) -> Vec { + let col = |id: u16, title: Text, width: i32, flex: bool, align: Align| Column { + id: ColId(id), + title, + width, + min: if flex { 240 } else { 60 }, + flex, + align, + sort: None, + first_sort: SortDir::Desc, + visible: true, + hideable: id != 0, + tip: None, + }; + let mut c = vec![ + col(0, s(lang, "Name", "Nome"), 240, true, Align::Start), + col(1, s(lang, "Status", "Stato"), 144, false, Align::Start), + col(2, s(lang, "CPU", "CPU"), 92, false, Align::Decimal), + col(3, s(lang, "Memory", "Memoria"), 116, false, Align::Decimal), + col(4, s(lang, "I/O", "I/O"), 100, false, Align::Decimal), + ]; + c[2].sort = Some(SortDir::Desc); + c +} + +/// A strip cell: its sparkline and the numbers of its history. +struct Spark { + chart: LineChart, + hist: Vec, + hue: Ink, + rect: (i32, i32, i32, i32), + seed: u32, +} + +fn sample(seed: u32, i: u32) -> f32 { + let x = (i.wrapping_add(seed.wrapping_mul(7919))).wrapping_mul(2_654_435_761).rotate_left(13).wrapping_mul(40_503); + ((x >> 8) % 100) as f32 +} + +fn history(seed: u32, base: f32, amp: f32, upto: u32) -> Vec { + (upto.saturating_sub(59)..=upto) + .map(|i| (base + amp * ((i + 9 * seed) as f32 / 7.0).sin() + sample(seed, i) / 25.0).clamp(0.0, 100.0)) + .collect() +} + +/// The page's screen. +struct MockTasks { + board: Board, + rail: SidebarList, + band: CommandBar, + table: VirtualTable, + sparks: Vec, + status: StatusLine, + pause: Button, + tick: u32, + commands: CommandTable, +} + +const RAIL_ID: WidgetId = WidgetId(1); +const BAND_ID: WidgetId = WidgetId(2); +const TABLE_ID: WidgetId = WidgetId(3); +const STATUS_ID: WidgetId = WidgetId(4); +const PAUSE_ID: WidgetId = WidgetId(5); +const SPARK_ID: u32 = 10; +const BOARD_ID: u32 = 100; +/// The pane's width. +const PANE_W: i32 = SIZE.w - RAIL_W; + +fn entry(key: u64, label: Text, glyph: Glyph) -> SidebarItem { + SidebarItem { + key, + label, + glyph: Some(glyph), + icon: None, + depth: 0, + expandable: false, + expanded: false, + section: false, + trailing: None, + disabled: false, + busy: false, + } +} + +impl MockTasks { + fn new(lang: UiLang) -> MockTasks { + let mut ids = BOARD_ID; + let mut next = || { + ids += 1; + WidgetId(ids) + }; + let mut b = Board::new(); + // The rail: collapse button, the pages and the settings entry at the foot. + let mut collapse = IconButton::new( + next(), + Glyph::RailCollapse, + s(lang, "Collapse to icons Ctrl+B", "Riduci a icone Ctrl+B"), + ); + collapse.set_size(oled_ui::widgets::icon_button::IconSize::Large); + b.add(collapse, (8, 8, 32, 32)); + let mut rail = + SidebarList::new(RAIL_ID, RAIL_STYLE).with_look(NavLook::Rail { collapsed: false }).with_items(vec![ + entry(1, s(lang, "Processes", "Processi"), Glyph::PageProcesses), + entry(2, s(lang, "Performance", "Prestazioni"), Glyph::PagePerformance), + entry(3, s(lang, "Details", "Dettagli"), Glyph::PageDetails), + entry(9, s(lang, "Settings", "Impostazioni"), Glyph::PageSettings), + ]); + rail.set_entry( + 2, + NavEntry { tip: Some(s(lang, "Performance Ctrl+2", "Prestazioni Ctrl+2")), ..NavEntry::default() }, + ); + rail.set_entry(9, NavEntry { foot: true, ..NavEntry::default() }); + rail.set_current(Some(1)); + b.add(Still::new(Shape::VRule), (RAIL_W, 0, 1, SIZE.h)); + + // The page head. + let x0 = RAIL_W + 20; + let right = RAIL_W + PANE_W - 16; + b.add(Words::new(s(lang, "Processes", "Processi"), TypeRole::Title, FgRole::Hot), (x0, 12, 130, 28)); + b.add( + Words::new( + s(lang, "7 apps \u{b7} 142 processes", "7 app \u{b7} 142 processi"), + TypeRole::Caption, + FgRole::Tertiary, + ), + (x0 + 126, 18, 170, 16), + ); + let mut search = TextField::new(next(), FieldKind::Search); + search.set_click_style(true); + search.set_label(s(lang, "Search", "Cerca")); + search.set_placeholder(s(lang, "Search by name, publisher or PID", "Cerca per nome, editore o PID")); + search.set_keycap(Some(Text::from("Ctrl+F"))); + search.set_width(260); + b.add(search, (right - 168 - 10 - 196 - 10 - 260, 10, 260, 32)); + let mut view = Segmented::new( + next(), + s(lang, "View", "Vista"), + vec![s(lang, "Groups", "Gruppi"), s(lang, "Tree", "Albero"), s(lang, "List", "Elenco")], + Some(0), + ); + view.set_click_style(true); + b.add(view, (right - 168 - 10 - 196, 10, 196, 32)); + let run = Button::new(next(), s(lang, "Run new task", "Esegui nuova attività"), ButtonKind::Plate) + .with_glyph(Glyph::CmdRun); + b.add(run, (right - 168, 10, 168, 32)); + b.add(Still::new(Shape::HRule), (RAIL_W + 1, 52, PANE_W - 1, 1)); -/// The fake processes: an Apps section, a Background section, children under every tenth app. -fn processes() -> Vec { - let mut rows = Vec::with_capacity(PROCESSES + 2); - rows.push(Row { key: 10_000, name: "Apps".into(), section: true, ..Row::default() }); - for i in 0..PROCESSES as u64 { - if i == 40 { - rows.push(Row { key: 10_001, name: "Background".into(), section: true, ..Row::default() }); + // The resource strip: the verdict and four cells. + let strip_y = 52; + b.add(Still::new(Shape::Dot), (x0, strip_y + 14, 7, 7)); + b.add( + Words::new(s(lang, "Quill is not responding", "Quill non risponde"), TypeRole::BodyStrong, FgRole::Hot), + (x0 + 15, strip_y + 9, 220, 18), + ); + b.add( + Words::new( + s(lang, "For 42 seconds. The rest is normal.", "Da 42 secondi. Il resto è nella norma."), + TypeRole::Caption, + FgRole::Secondary, + ), + (x0 + 15, strip_y + 29, 215, 16), + ); + b.add(TextLink::new(next(), s(lang, "Show the row", "Mostra la riga")), (x0 + 15, strip_y + 47, 120, 18)); + let cell_x = x0 + 236; + let cell_w = (right - cell_x) / 4; + type CellSpec = ( + Glyph, + (u32, u32, u32), + (&'static str, &'static str), + (&'static str, &'static str), + (&'static str, &'static str), + f32, + f32, + ); + let cells: [CellSpec; 4] = [ + (Glyph::ResCpu, RES_CPU, ("CPU", "CPU"), ("3.42 GHz", "3,42 GHz"), ("34", "34"), 34.0, 22.0), + (Glyph::ResMemory, RES_MEM, ("Memory", "Memoria"), ("18.6 GB", "18,6 GB"), ("58", "58"), 58.0, 4.0), + (Glyph::ResDisk, RES_DISK, ("Disk", "Disco"), ("48 MB/s", "48 MB/s"), ("12", "12"), 12.0, 10.0), + ( + Glyph::ResWifi, + RES_NET, + ("Network", "Rete"), + ("\u{2191} 1.1 Mbit/s", "\u{2191} 1,1 Mbit/s"), + ("\u{2193} 12.4", "\u{2193} 12,4"), + 30.0, + 28.0, + ), + ]; + let mut sparks = Vec::new(); + for (i, (glyph, rgb, label, detail, figure, base, amp)) in cells.into_iter().enumerate() { + let x = cell_x + cell_w * i as i32; + let tint = hue(rgb); + b.add(Still::new(Shape::VRule), (x, strip_y + 6, 1, 60)); + b.add(Pic::new(Picture::Glyph(glyph, Some(tint))), (x + 14, strip_y + 8, 12, 12)); + b.add( + Words::new(s(lang, label.0, label.1), TypeRole::Caption, FgRole::Secondary), + (x + 32, strip_y + 6, 60, 16), + ); + b.add( + Words::new(s(lang, detail.0, detail.1), TypeRole::Caption, FgRole::Tertiary).right(), + (x + 70, strip_y + 6, cell_w - 70 - 12, 16), + ); + let figure = s(lang, figure.0, figure.1); + let fig_w = 11 * figure.chars().count() as i32 + 2; + b.add(Words::new(figure, TypeRole::Figure, FgRole::Hot), (x + 14, strip_y + 30, fig_w, 24)); + let unit = if i == 3 { "Mbit/s" } else { "%" }; + b.add( + Words::new(Text::from(unit), TypeRole::Caption, FgRole::Secondary), + (x + 17 + fig_w, strip_y + 36, 50, 16), + ); + let hist = history(i as u32, base, amp, 59); + let mut chart = LineChart::new( + WidgetId(SPARK_ID + i as u32), + s(lang, label.0, label.1), + ChartStyle::Spark, + LineScale::Percent, + ); + chart.set(&[LineSeries::new(&hist, tint).with_area()]); + let w = (cell_w - 14 - 12 - 80).clamp(60, 120); + sparks.push(Spark { + chart, + hist, + hue: tint, + rect: (x + cell_w - 12 - w, strip_y + 38, w, 28), + seed: i as u32, + }); } - let child = i % 10 == 5; - rows.push(Row { - key: i, - name: format!("proc-{i}"), - size: (i * 7919 % 1500 + 4) * 1024 * 1024 / 4, - cpu: (i * 31 % 100) as f32 / 4.0, - depth: u16::from(child), - expandable: i % 10 == 4, - expanded: i % 10 == 4, - heat: ((i * 31 % 100) / 25) as u8, - action: true, - icon: Some((i % 3) as u32), - badge: (i % 37 == 0).then_some(Badge::Shield), - ..Row::default() - }); - } - rows -} - -/// The page's screen: the shared table screen that also takes the one-second refresh. -struct MockTasks(Tables); + b.add(Still::new(Shape::HRule), (RAIL_W + 1, strip_y + 76 - 1, PANE_W - 1, 1)); + + // The command band. + let item = |n, g, l: Text, k| CommandItem::new(CommandId(n), g, l, k); + let entries = vec![ + BarEntry::Item(item(1, Glyph::CmdCloseWindow, s(lang, "Close Ember", "Chiudi Ember"), ButtonKind::Command)), + BarEntry::Item(item(2, Glyph::CmdEndTask, s(lang, "End task", "Termina"), ButtonKind::Destructive)), + BarEntry::Item(item(3, Glyph::CmdEfficiency, s(lang, "Efficiency", "Efficienza"), ButtonKind::Toggle)), + BarEntry::Item( + item(4, Glyph::CmdPriority, s(lang, "Priority: normal", "Priorità: normale"), ButtonKind::Menu).fold(3), + ), + BarEntry::Item( + item(5, Glyph::LineFolder, s(lang, "Open location", "Apri percorso"), ButtonKind::Command).fold(2), + ), + BarEntry::Item(item(6, Glyph::LineInfo, s(lang, "Properties", "Proprietà"), ButtonKind::Command).fold(1)), + BarEntry::More, + ]; + let mut band = CommandBar::new(BAND_ID, BarStyle::Band, entries); + band.set_name(s(lang, "Commands", "Comandi")); + band.set_selection(Some(BandSelection { + glyph: Glyph::Window, + name: Text::from("Ember"), + count: Some(s(lang, "3 processes", "3 processi")), + })); + + // The table. + let mut table = + VirtualTable::new(TABLE_ID, Procs::new(lang), columns(lang), SelectionMode::Multi, TableStyle::TASKS_LIST) + .with_selection(select(&[1])) + .with_focused(RowKey(1)); + table.set_label(s(lang, "Processes", "Processi")); + table.set_legends(vec![(ColId(2), hue(RES_CPU)), (ColId(3), hue(RES_MEM)), (ColId(4), hue(RES_DISK))]); + + // The status line. + b.add(Still::new(Shape::HRule), (RAIL_W + 1, SIZE.h - STATUS_H, PANE_W - 1, 1)); + let mut status = StatusLine::new(STATUS_ID).with_click_look(); + status.set_items(vec![( + s(lang, "142 processes \u{b7} 2,318 threads", "142 processi \u{b7} 2.318 thread"), + FgRole::Secondary, + )]); + b.add( + Words::new(s(lang, "Updating every 1 s", "Aggiornamento ogni 1 s"), TypeRole::Caption, FgRole::Secondary) + .right(), + (right - 90 - 150, SIZE.h - STATUS_H + 6, 140, 16), + ); + let pause = Button::new(PAUSE_ID, s(lang, "Pause", "Pausa"), ButtonKind::Command).with_glyph(Glyph::CmdPause); + MockTasks { board: b, rail, band, table, sparks, status, pause, tick: 0, commands: CommandTable::new() } + } +} impl Screen for MockTasks { - fn layout(&mut self, cx: &mut oled_ui::cx::LayoutCx, avail: oled_ui::geom::SizeP) -> oled_ui::geom::SizeP { - self.0.layout(cx, avail) + fn layout(&mut self, cx: &mut LayoutCx, avail: SizeP) -> SizeP { + self.board.layout(cx, avail); + let px = |cx: &LayoutCx, r: (i32, i32, i32, i32)| RectP::wh(cx.px(r.0), cx.px(r.1), cx.px(r.2), cx.px(r.3)); + let r = px(cx, (0, 48, RAIL_W, SIZE.h - 48 - 8)); + self.rail.layout(cx, r); + for sp in &mut self.sparks { + let r = px(cx, sp.rect); + sp.chart.layout(cx, r); + } + let r = px(cx, (RAIL_W + 20, 52 + 76, PANE_W - 36, 44)); + self.band.layout(cx, r); + let r = px(cx, (RAIL_W + 1, TABLE_TOP, PANE_W - 1, SIZE.h - TABLE_TOP - STATUS_H)); + self.table.layout(cx, r); + let r = px(cx, (RAIL_W + 1, SIZE.h - STATUS_H, PANE_W - 1, STATUS_H)); + self.status.layout(cx, r); + let r = px(cx, (RAIL_W + PANE_W - 16 - 90, SIZE.h - STATUS_H + 2, 90, 24)); + self.pause.layout(cx, r); + avail } - fn paint(&self, cx: &mut oled_ui::cx::PaintCx) { - self.0.paint(cx) + fn paint(&self, cx: &mut PaintCx) { + self.board.paint(cx); + self.rail.paint(cx); + for sp in &self.sparks { + sp.chart.paint(cx); + } + self.band.paint(cx); + self.table.paint(cx); + self.status.paint(cx); + self.pause.paint(cx); } - fn event(&mut self, cx: &mut EventCx, ev: &oled_ui::event::Event) -> Reply { - self.0.event(cx, ev) + fn event(&mut self, cx: &mut EventCx, ev: &Event) -> Reply { + self.board.event(cx, ev); + self.rail.event(cx, ev); + for sp in &mut self.sparks { + sp.chart.event(cx, ev); + } + self.band.event(cx, ev); + self.table.event(cx, ev); + self.status.event(cx, ev); + self.pause.event(cx, ev); + Reply::None } fn data(&mut self, cx: &mut EventCx, msg: AppMsg) -> Reply { if msg.downcast_ref::().is_none() { - return self.0.data(cx, msg); + return Reply::None; } - for (_, t) in &mut self.0.tables { - let tick = t.model().generation + 1; - let m = t.model_mut(); - m.generation = tick; - for r in m.rows.iter_mut().filter(|r| !r.section) { - let step = ((r.key + tick) * 2654435761 % 7) as f32 - 3.0; - r.cpu = (r.cpu + step * 0.25).clamp(0.0, 99.0); - r.heat = (r.cpu / 25.0) as u8; - } - t.model_changed(cx, true); + self.tick += 1; + let tick = self.tick; + let m = self.table.model_mut(); + m.generation += 1; + for r in m.rows.iter_mut().filter(|r| !r.section) { + let step = ((r.key + u64::from(tick)) * 2654435761 % 7) as f32 - 3.0; + r.cpu = (r.cpu + step * 0.25).clamp(0.0, 99.0); + } + self.table.model_changed(cx, true); + for sp in &mut self.sparks { + let next = (sample(sp.seed, 60 + tick) * 0.6).clamp(0.0, 100.0); + sp.hist.remove(0); + sp.hist.push(next); + let hue = sp.hue; + sp.chart.update(cx, &[LineSeries::new(&sp.hist, hue).with_area()]); } Reply::None } - fn commands(&self) -> &oled_ui::command::CommandTable { - self.0.commands() + fn commands(&self) -> &CommandTable { + &self.commands } } -/// The motion the page's frame shows: row 4 slid in by 6 px at half opacity. -const FRAME_MOTION: Option<(usize, RowMotion)> = Some((4, RowMotion { dy: 6, opacity: 128 })); - pub fn page(lang: UiLang) -> Option { - Some(build(lang, FRAME_MOTION)) -} - -fn build(lang: UiLang, motion: Option<(usize, RowMotion)>) -> Page { - let mut cols = columns(lang); - cols.truncate(3); - let mut demo = Demo::new(processes()); - demo.motion = motion; - let mut t = VirtualTable::new(WidgetId(1), demo, cols, SelectionMode::Multi, TableStyle::TASKS); - t.set_label(s(lang, "Processes", "Processi")); - let screen = MockTasks(Tables::new(vec![((8, 8, 624, 464), t)])); - Page { name: "mock_tasks", size: SizeL { w: 640, h: 480 }, states: 2, screen: Box::new(screen) } + Some(Page { name: "mock_tasks", size: SIZE, states: 1, screen: Box::new(MockTasks::new(lang)) }) } #[cfg(test)] mod tests { use super::*; use oled_ui::harness::Harness; + use oled_ui::strings::Lang; use oled_ui::theme::Tokens; #[test] @@ -124,24 +681,41 @@ mod tests { assert_ne!(first.px, moved.px, "a tick refreshes the figures"); h.advance(900); assert!(h.is_idle()); - // 300 processes, two sections. - assert!(h.a11y_dump().contains("of 302")); + assert!(h.a11y_dump().contains("of 21"), "{}", h.a11y_dump()); } #[test] - fn the_frame_shows_one_row_in_motion() { - let render = |motion| { - let p = build(UiLang::EN, motion); - let mut h = Harness::new(p.screen, p.size, 96, Tokens::oled()); - let img = h.render(); - assert!(h.a11y_dump().contains("of 302"), "the rows are the same"); - img - }; - let still = render(None); - let moved = render(Some((4, RowMotion { dy: 6, opacity: 128 }))); - assert_ne!(still.px, moved.px, "the row in motion paints differently"); - assert_eq!(page(UiLang::EN).unwrap().states, 2, "the page's frame is the moved state"); - let shown = render(FRAME_MOTION); - assert_eq!(shown.px, moved.px, "the page's own frame shows the moved row"); + fn the_page_is_the_processes_screen_in_both_languages() { + for (lang, l, title) in [(UiLang::EN, Lang::En, "Processes"), (UiLang::IT, Lang::It, "Processi")] { + let p = page(lang).unwrap(); + let h = Harness::new(p.screen, p.size, 96, Tokens::oled()).lang(l); + h.assert_named(); + let dump = h.a11y_dump(); + assert!(dump.contains(title), "{dump}"); + } + } + + #[test] + fn the_rows_carry_art_and_heat() { + let p = page(UiLang::EN).unwrap(); + let mut h = Harness::new(p.screen, p.size, 96, Tokens::oled()); + let img = h.render(); + // A heat plate in the CPU hue sits in the Ember row: some pixel of the list is distinctly blue. + let list = img.crop(RectP::wh(RAIL_W + 400, TABLE_TOP + 32, 520, 200)); + assert!(list.px.iter().any(|p| (p & 0xFF) > 0x30 && (p & 0xFF) > ((p >> 16) & 0xFF) + 10), "no hot cell"); + // The art tile of the first app row is not blank. + let art = img.crop(RectP::wh(RAIL_W + 40, TABLE_TOP + 32 + 40, 24, 24)); + assert!(art.px.iter().any(|p| p & 0x00FF_FFFF != 0)); + } + + #[test] + fn heat_follows_the_absolute_steps() { + assert_eq!(heat(0.4, CPU_STEPS), 0); + assert_eq!(heat(1.0, CPU_STEPS), 1); + assert_eq!(heat(12.4, CPU_STEPS), 2); + assert_eq!(heat(18.2, CPU_STEPS), 3); + assert_eq!(heat(40.0, CPU_STEPS), 4); + assert_eq!(heat(2048.0, MEM_STEPS), 4); + assert_eq!(heat(0.4, IO_STEPS), 0); } } diff --git a/apps/gallery/src/pages/mod.rs b/apps/gallery/src/pages/mod.rs index baf79d13..daf73321 100644 --- a/apps/gallery/src/pages/mod.rs +++ b/apps/gallery/src/pages/mod.rs @@ -1,9 +1,11 @@ //! The gallery's pages (P2-kit K0.2): the registry, complete in K0.2; one file per page, filled by its owner (adding a //! page edits only its own file). A page that returns None is not ready and is skipped. +pub mod art; pub mod buttons; pub mod caption; pub mod charts; +pub mod click_states; pub mod dialogs; pub mod fields; pub mod glyphs; @@ -49,7 +51,7 @@ pub struct FocusRow(pub usize); pub type PageFn = fn(UiLang) -> Option; /// Every page, in the order of the index. -pub const REGISTRY: [(&str, PageFn); 24] = [ +pub const REGISTRY: [(&str, PageFn); 26] = [ ("buttons", buttons::page), ("glyphs", glyphs::page), ("settings_like", settings_like::page), @@ -74,6 +76,8 @@ pub const REGISTRY: [(&str, PageFn); 24] = [ ("caption", caption::page), ("charts", charts::page), ("properties", properties::page), + ("art", art::page), + ("click_states", click_states::page), ]; /// The ready pages in `lang`. diff --git a/apps/gallery/src/pages/path.rs b/apps/gallery/src/pages/path.rs index 96a8e54e..7c785954 100644 --- a/apps/gallery/src/pages/path.rs +++ b/apps/gallery/src/pages/path.rs @@ -2,6 +2,7 @@ //! edit mode. use super::{s, Page}; +use oled_ui::art::{compose, Art}; use oled_ui::command::CommandTable; use oled_ui::cx::{EventCx, LayoutCx, PaintCx}; use oled_ui::event::{Event, Reply}; @@ -10,8 +11,9 @@ use oled_ui::node::{Text, WidgetId}; use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; use oled_ui::widgets::{PathBar, PathSegment}; +use std::rc::Rc; -const SIZE: SizeL = SizeL { w: 720, h: 336 }; +const SIZE: SizeL = SizeL { w: 720, h: 784 }; const ROW_H: i32 = 64; struct Bars { @@ -76,6 +78,37 @@ pub fn page(lang: UiLang) -> Option { error.preview_error(Some(reason)); let mut edit = bar(5, 4); edit.preview_edit(edit_text, None); - let bars = vec![(bar(1, 5), 688), (bar(2, 7), 300), (offline, 688), (error, 688), (edit, 688)]; + // The click look: at rest with the drive's art, folded, a segment and a chevron under the pointer, offline, with an + // error and in edit mode. + let art = || Some(Rc::new(compose(Art::DriveSystem, 64, None))); + let click = |id: u32, n: usize| { + let mut b = bar(id, n).with_click_look(); + b.set_first_art(art()); + b + }; + let mut seg_hot = click(12, 5); + seg_hot.preview_hot(Some((2, false))); + let mut chev_hot = click(13, 5); + chev_hot.preview_hot(Some((2, true))); + let mut click_offline = click(14, 4); + click_offline.set_offline(true); + let mut click_error = click(15, 4); + click_error.preview_error(Some(s(lang, "This folder is not available.", "Questa cartella non è disponibile."))); + let mut click_edit = click(16, 4); + click_edit.preview_edit(edit_text, None); + let bars = vec![ + (bar(1, 5), 688), + (bar(2, 7), 300), + (offline, 688), + (error, 688), + (edit, 688), + (click(10, 5), 688), + (click(11, 7), 300), + (seg_hot, 688), + (chev_hot, 688), + (click_offline, 688), + (click_error, 688), + (click_edit, 688), + ]; Some(Page { name: "path", size: SIZE, states: 1, screen: Box::new(Bars { bars, commands: CommandTable::new() }) }) } diff --git a/apps/gallery/src/pages/progress.rs b/apps/gallery/src/pages/progress.rs index d8e34089..db12abaf 100644 --- a/apps/gallery/src/pages/progress.rs +++ b/apps/gallery/src/pages/progress.rs @@ -1,5 +1,5 @@ //! The progress page (K3.2): a value at 0, 40 and 100 %, an indeterminate line while running (a still frame shows the -//! segment part-way) and one that is not running. +//! segment part-way) and one that is not running; then the capacity bar of a drive at 40 and 95 % and when full. use super::{s, Page}; use oled_ui::command::CommandTable; @@ -11,22 +11,24 @@ use oled_ui::node::{Text, WidgetId}; use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; use oled_ui::text::Trim; -use oled_ui::theme::TypeRole; +use oled_ui::theme::{Tokens, TypeRole}; +use oled_ui::widgets::progress::ProgressLook; use oled_ui::widgets::Progress; -const SIZE: SizeL = SizeL { w: 480, h: 208 }; +const SIZE: SizeL = SizeL { w: 480, h: 316 }; const ROW_H: i32 = 32; const LABEL_W: i32 = 200; struct Lines { - rows: Vec<(Progress, Text)>, + rows: Vec<(Progress, Text, bool)>, commands: CommandTable, } impl Screen for Lines { fn layout(&mut self, cx: &mut LayoutCx, avail: SizeP) -> SizeP { - for (i, (p, _)) in self.rows.iter_mut().enumerate() { - let y = cx.px(12 + ROW_H * i as i32 + 15); + for (i, (p, _, capacity)) in self.rows.iter_mut().enumerate() { + // A line is 2 px high, a capacity bar 4: both centred in the row. + let y = cx.px(12 + ROW_H * i as i32 + if *capacity { 14 } else { 15 }); p.layout(cx, RectP::wh(cx.px(16 + LABEL_W), y, avail.w - cx.px(32 + LABEL_W), cx.px(2))); } avail @@ -34,7 +36,7 @@ impl Screen for Lines { fn paint(&self, cx: &mut PaintCx) { let c = cx.tokens().color.clone(); - for (i, (p, label)) in self.rows.iter().enumerate() { + for (i, (p, label, _)) in self.rows.iter().enumerate() { let r = RectP::wh(cx.px(16), cx.px(12 + ROW_H * i as i32), cx.px(LABEL_W - 8), cx.px(ROW_H)); cx.text_in(label, TypeRole::Body, r, Align::Start, Trim::End, c.fg_secondary); p.paint(cx); @@ -42,7 +44,7 @@ impl Screen for Lines { } fn event(&mut self, cx: &mut EventCx, ev: &Event) -> Reply { - for (p, _) in &mut self.rows { + for (p, _, _) in &mut self.rows { p.event(cx, ev); } Reply::None @@ -53,10 +55,16 @@ impl Screen for Lines { } } -/// The page: six lines. +/// The page: five lines and three capacity bars. pub fn page(lang: UiLang) -> Option { let row = |id, v: Option, running, en: &'static str, it: &'static str| { - (Progress::new(WidgetId(id)).with_value(v, running), s(lang, en, it)) + (Progress::new(WidgetId(id)).with_value(v, running), s(lang, en, it), false) + }; + let attention = Tokens::oled().color.accent_attention; + let capacity = |id, v: f32, fill, en: &'static str, it: &'static str| { + let p = + Progress::new(WidgetId(id)).with_look(ProgressLook::Capacity).with_fill(fill).with_value(Some(v), false); + (p, s(lang, en, it), true) }; let rows = vec![ row(1, Some(0.0), true, "Empty", "Vuoto"), @@ -64,6 +72,9 @@ pub fn page(lang: UiLang) -> Option { row(3, Some(1.0), false, "Done", "Completato"), row(4, None, true, "Indeterminate, running", "Indeterminato, in corso"), row(5, None, false, "Indeterminate, stopped", "Indeterminato, fermo"), + capacity(6, 0.4, None, "Capacity, 40 % used", "Capacità, 40 % usato"), + capacity(7, 0.95, Some(attention), "Capacity, 95 % used", "Capacità, 95 % usato"), + capacity(8, 1.0, Some(attention), "Capacity, full", "Capacità, piena"), ]; Some(Page { name: "progress", diff --git a/apps/gallery/src/pages/sidebar.rs b/apps/gallery/src/pages/sidebar.rs index 7da8a1b3..02d0b30f 100644 --- a/apps/gallery/src/pages/sidebar.rs +++ b/apps/gallery/src/pages/sidebar.rs @@ -1,7 +1,10 @@ -//! The sidebar page (K1b.2): the Settings-style nav at 36 px rows at the left, the files-style tree at 28 px rows at the -//! right. Hover and focus need the pointer and the keyboard: the widget tests drive them through the Harness. +//! The sidebar page (K1b.2): the Settings-style nav at 36 px rows at the left, the files-style tree at 28 px rows next +//! to it, then the entries of a file manager's sidebar (art, drives with their capacity bar, a pin under the pointer, +//! a drive not ready, hand-off entries) and the rail of a task manager, expanded and collapsed. Hover and focus need the +//! pointer and the keyboard: the widget tests drive them through the Harness. use super::{s, Page}; +use oled_ui::art::{compose, Art}; use oled_ui::command::CommandTable; use oled_ui::cx::{EventCx, LayoutCx, PaintCx}; use oled_ui::event::{Event, Reply}; @@ -10,10 +13,12 @@ use oled_ui::model::FgRole; use oled_ui::node::{Text, WidgetId}; use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; +use oled_ui::widgets::sidebar::{DriveLine, NavAction, NavEntry, NavLook, ENTRIES_STYLE, RAIL_STYLE}; use oled_ui::widgets::{SidebarItem, SidebarList, SidebarStyle}; use oled_ui::Glyph; +use std::rc::Rc; -const SIZE: SizeL = SizeL { w: 480, h: 320 }; +const SIZE: SizeL = SizeL { w: 996, h: 488 }; struct Sidebars { lists: Vec<(SidebarList, (i32, i32, i32, i32))>, @@ -36,7 +41,7 @@ impl Screen for Sidebars { fn event(&mut self, cx: &mut EventCx, ev: &Event) -> Reply { for (l, _) in &mut self.lists { - l.event(cx, ev); + l.event_nav(cx, ev); } Reply::None } @@ -62,6 +67,77 @@ fn item(key: u64, label: Text, glyph: Option, depth: u16) -> SidebarItem } } +/// An entry with colour art at 64 px (drawn down to the entry's size). +fn art_item(key: u64, label: Text, art: Art) -> SidebarItem { + SidebarItem { icon: Some(Rc::new(compose(art, 64, None))), ..item(key, label, None, 0) } +} + +fn section(key: u64, label: Text) -> SidebarItem { + SidebarItem { section: true, ..item(key, label, None, 0) } +} + +fn drive(free: &'static str, used: f32) -> NavEntry { + NavEntry { drive: Some(DriveLine { free: Text::from(free), used }), ..NavEntry::default() } +} + +/// A file manager's sidebar: places with art, one pinned and under the pointer, drives at 40 and 95 %, a drive not +/// ready and two hand-off entries. +fn entries(lang: UiLang) -> SidebarList { + let pin = s(lang, "Remove from Quick access", "Togli da Accesso rapido"); + let mut l = SidebarList::new(WidgetId(3), ENTRIES_STYLE) + .with_look(NavLook::Entries) + .with_items(vec![ + art_item(1, s(lang, "Home", "Home"), Art::Home), + section(2, s(lang, "Quick access", "Accesso rapido")), + art_item(3, s(lang, "Desktop", "Desktop"), Art::Desktop), + art_item(4, s(lang, "Downloads", "Download"), Art::Downloads), + art_item(5, s(lang, "Documents", "Documenti"), Art::Documents), + art_item(6, s(lang, "Projects 2026", "Progetti 2026"), Art::Folder), + section(7, s(lang, "This PC", "Questo PC")), + art_item(8, s(lang, "System (C:)", "Sistema (C:)"), Art::DriveSystem), + art_item(9, s(lang, "Data (D:)", "Dati (D:)"), Art::DriveFixed), + art_item(10, s(lang, "Stick (E:)", "Chiavetta (E:)"), Art::DriveRemovable), + section(11, s(lang, "Network", "Rete")), + art_item(12, s(lang, "Network", "Rete"), Art::DriveNetwork), + art_item(13, s(lang, "Recycle Bin", "Cestino"), Art::RecycleBin), + ]) + .with_entry(6, NavEntry { action: Some((NavAction::Pin, pin)), ..NavEntry::default() }) + .with_entry(8, drive("412 GB", 0.4)) + .with_entry(9, drive("37 GB", 0.95)) + .with_entry(10, NavEntry { not_ready: Some(s(lang, "Not ready", "Non pronta")), ..drive("", 0.0) }); + let out = NavAction::External; + for key in [12, 13] { + l.set_entry(key, NavEntry { action: Some((out, Text::from(""))), ..NavEntry::default() }); + } + l.set_current(Some(5)); + l.show_hot(Some(6)); + l +} + +/// A task manager's rail with the second page current and the settings entry at the foot. +fn rail(lang: UiLang, collapsed: bool) -> SidebarList { + let page = |key, en, it, g| { + let mut i = item(key, s(lang, en, it), Some(g), 0); + i.glyph = Some(g); + i + }; + let mut l = SidebarList::new(WidgetId(if collapsed { 5 } else { 4 }), RAIL_STYLE) + .with_look(NavLook::Rail { collapsed }) + .with_items(vec![ + page(1, "Processes", "Processi", Glyph::PageProcesses), + page(2, "Performance", "Prestazioni", Glyph::PagePerformance), + page(3, "Details", "Dettagli", Glyph::PageDetails), + page(9, "Settings", "Impostazioni", Glyph::PageSettings), + ]) + .with_entry( + 2, + NavEntry { tip: Some(s(lang, "Performance Ctrl+2", "Prestazioni Ctrl+2")), ..NavEntry::default() }, + ) + .with_entry(9, NavEntry { foot: true, ..NavEntry::default() }); + l.set_current(Some(2)); + l +} + /// The page: a nav with a current entry, and a tree with sections, depth, an expanded node, trailing text, a busy row, a /// disabled row and a drop target. pub fn page(lang: UiLang) -> Option { @@ -106,6 +182,10 @@ pub fn page(lang: UiLang) -> Option { tree.set_drop_target(Some(15)); let screen = Sidebars { lists: vec![(nav, (0, 8, 220, 200)), (tree, (240, 8, 240, 280))], commands: CommandTable::new() }; + let mut screen = screen; + screen.lists.push((entries(lang), (500, 8, 224, 472))); + screen.lists.push((rail(lang, false), (740, 8, 184, 472))); + screen.lists.push((rail(lang, true), (940, 8, 48, 472))); Some(Page { name: "sidebar", size: SIZE, states: 1, screen: Box::new(screen) }) } diff --git a/apps/gallery/src/pages/status.rs b/apps/gallery/src/pages/status.rs index 8ab15beb..14cdb5ea 100644 --- a/apps/gallery/src/pages/status.rs +++ b/apps/gallery/src/pages/status.rs @@ -7,12 +7,12 @@ use oled_ui::cx::{EventCx, LayoutCx, PaintCx}; use oled_ui::event::{Event, Reply}; use oled_ui::geom::{RectP, SizeL, SizeP}; use oled_ui::model::FgRole; -use oled_ui::node::WidgetId; +use oled_ui::node::{Text, WidgetId}; use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; use oled_ui::widgets::StatusLine; -const SIZE: SizeL = SizeL { w: 560, h: 160 }; +const SIZE: SizeL = SizeL { w: 560, h: 268 }; struct Lines { lines: Vec, @@ -45,7 +45,7 @@ impl Screen for Lines { } } -/// The page: two status lines and two notices. +/// The page: two status lines and two notices, then two lines in the click look and a notice. pub fn page(lang: UiLang) -> Option { let mut files = StatusLine::new(WidgetId(1)); files.set_items(vec![ @@ -65,7 +65,33 @@ pub fn page(lang: UiLang) -> Option { ); l }; - let lines = vec![files, tasks, notice(3, true), notice(4, false)]; + let click_line = |id: u32, items: Vec<(Text, FgRole)>| { + let mut l = StatusLine::new(WidgetId(id)).with_click_look(); + l.set_items(items); + l + }; + let lines = vec![ + files, + tasks, + notice(3, true), + notice(4, false), + click_line( + 5, + vec![ + (s(lang, "1,204 items", "1.204 elementi"), FgRole::Secondary), + (s(lang, "3 selected", "3 selezionati"), FgRole::Secondary), + (s(lang, "412 MB", "412 MB"), FgRole::Secondary), + ], + ), + click_line( + 6, + vec![ + (s(lang, "142 processes", "142 processi"), FgRole::Secondary), + (s(lang, "Paused", "In pausa"), FgRole::Attention), + ], + ), + notice(7, true).with_click_look(), + ]; Some(Page { name: "status", size: SIZE, diff --git a/apps/gallery/src/pages/table.rs b/apps/gallery/src/pages/table.rs index 44fb13c0..142e109b 100644 --- a/apps/gallery/src/pages/table.rs +++ b/apps/gallery/src/pages/table.rs @@ -10,6 +10,7 @@ use oled_ui::cx::{EventCx, LayoutCx, PaintCx}; use oled_ui::event::{Event, Reply}; use oled_ui::geom::{RectP, SizeL, SizeP}; use oled_ui::gfx::image::IconBitmap; +use oled_ui::glyph::Glyph; use oled_ui::host::AppMsg; use oled_ui::model::{ Align, Badge, CellKind, CellOut, ColId, Column, FgRole, HeatStep, IconRef, ListModel, RowAction, RowKey, RowMotion, @@ -19,6 +20,8 @@ use oled_ui::node::WidgetId; use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; use oled_ui::text::Trim; +use oled_ui::theme::Ink; +use oled_ui::tokens::{RES_CPU, RES_MEM}; use oled_ui::widgets::VirtualTable; /// One row of the demo model: every look a row can have. @@ -41,6 +44,12 @@ pub struct Row { pub note: Option<&'static str>, pub action: bool, pub icon: Option, + /// Hidden item: icon and name at half alpha. + pub hidden: bool, + /// The heat step (0..=4) of the size column, in the hue mode. + pub heat2: u8, + /// A section's totals for the size and CPU columns. + pub total: Option<(&'static str, &'static str)>, } /// The demo model: stored rows, or `synthetic` generated ones (no storage: a hundred thousand rows cost nothing). @@ -53,9 +62,20 @@ pub struct Demo { pub action_label: &'static str, /// One row painted in motion (a slide and a fade), by row index. pub motion: Option<(usize, RowMotion)>, + /// The hover hint of every row. + pub hint: Option<&'static str>, + /// The hues of the size and CPU columns: their heat is drawn in the hue mode (steps 0 to 4). + pub hues: Option<(Ink, Ink)>, + /// The glyph of the inline action. + pub action_glyph: Option, icons: Vec, } +/// The sample hues of the resource columns. +pub fn sample_hues() -> (Ink, Ink) { + (Ink::solid(RES_MEM.0, RES_MEM.1, RES_MEM.2), Ink::solid(RES_CPU.0, RES_CPU.1, RES_CPU.2)) +} + impl Demo { pub fn new(rows: Vec) -> Demo { Demo { @@ -65,6 +85,9 @@ impl Demo { ext_spans: false, action_label: "Close", motion: None, + hint: None, + hues: None, + action_glyph: None, icons: icons(), } } @@ -160,6 +183,10 @@ impl ListModel for Demo { } impl TableModel for Demo { + fn hover_hint(&self, _row: usize) -> Option { + self.hint.map(Cow::Borrowed) + } + fn motion(&self, row: usize) -> RowMotion { self.motion.filter(|(r, _)| *r == row).map_or(RowMotion::NONE, |(_, m)| m) } @@ -167,7 +194,14 @@ impl TableModel for Demo { fn cell(&self, row: usize, col: ColId, out: &mut CellOut) { let r = self.row(row); if r.section && col.0 != 0 { - out.set_text(CellKind::Text, ""); + match (r.total, col.0) { + (Some((size, _)), 1) => out.set_text(CellKind::Bytes, size), + (Some((_, cpu)), 2) => out.set_text(CellKind::Percent, cpu), + _ => out.set_text(CellKind::Text, ""), + }; + if r.total.is_some() { + out.align = Align::Decimal; + } return; } match col.0 { @@ -176,6 +210,7 @@ impl TableModel for Demo { out.icon = r.icon.map(IconRef); out.badge = r.badge; out.cut = r.cut; + out.dim_icon = r.hidden; out.trim = Trim::Middle { tail: 10 }; if self.ext_spans { if let Some(dot) = r.name.rfind('.') { @@ -190,16 +225,27 @@ impl TableModel for Demo { label: Cow::Borrowed(self.action_label), command: CommandId(100 + (r.key % 1000) as u32), }); + out.action_glyph = self.action_glyph; } } 1 => { out.set_text(CellKind::Bytes, &size_text(r.size)); out.align = Align::Decimal; + if let Some((hue, _)) = self.hues { + out.heat = Some(HeatStep(r.heat2)); + out.heat_hue = Some(hue); + } } 2 => { out.set_text(CellKind::Percent, &format!("{:.1}%", r.cpu)); out.align = Align::Decimal; - out.heat = (r.heat > 0).then_some(HeatStep(r.heat)); + match self.hues { + Some((_, hue)) => { + out.heat = Some(HeatStep(r.heat)); + out.heat_hue = Some(hue); + } + None => out.heat = (r.heat > 0).then_some(HeatStep(r.heat)), + } out.fg = FgRole::Secondary; } _ => { @@ -401,22 +447,169 @@ pub fn select(keys: &[u64]) -> Selection { s } +/// The files list in the A look: runs of selection, a cut and a hidden row, a row with no icon among the others (the +/// icon column stays), a folder with children, every badge. +pub fn list_files_rows() -> Vec { + let mut rows = files_rows(); + rows[5].icon = None; + rows[6].cut = false; + rows[7].fresh = false; + rows[3].hidden = true; + rows[6].hidden = false; + rows[6].cut = true; + rows +} + +/// The tasks list in the A look: three sections with counts and totals, tree rows, heat 0 to 4 in two hues. +pub fn list_tasks_rows() -> Vec { + let mut rows: Vec = Vec::new(); + let section = |key: u64, name: &str, count: &'static str, total: (&'static str, &'static str)| Row { + key, + name: name.into(), + section: true, + expandable: true, + expanded: true, + note: Some(count), + total: Some(total), + ..Row::default() + }; + rows.push(section(1000, "Apps", "6", ("2.6 GB", "31%"))); + for (i, n) in ["browser", "editor", "terminal", "mixer", "player", "chat"].iter().enumerate() { + let mut r = named(i as u64, n); + r.heat = i as u8 % 5; + r.heat2 = (4 - i as u8 % 5) % 5; + r.action = true; + rows.push(r); + } + rows[1].expandable = true; + rows[1].expanded = true; + for i in 0..2 { + let mut c = named(20 + i, "renderer"); + c.depth = 1; + c.heat = 2; + c.heat2 = 3; + rows.push(c); + } + rows[4].note = Some("Not responding"); + rows[4].error = true; + rows.push(section(1001, "Background", "4", ("612 MB", "2%"))); + for (i, n) in ["indexer", "updater", "sync", "audio-host"].iter().enumerate() { + let mut r = named(40 + i as u64, n); + r.heat = if i == 0 { 4 } else { i as u8 % 2 }; + r.heat2 = i as u8; + rows.push(r); + } + rows.push(section(1002, "Windows", "2", ("120 MB", "0%"))); + rows.push(named(60, "session-host")); + rows +} + const SIZE: SizeL = SizeL { w: 720, h: 540 }; pub fn page(lang: UiLang) -> Option { - let mut files = Demo::new(files_rows()); + let mut files = Demo::new(list_files_rows()); files.ext_spans = true; - let mut top = VirtualTable::new(WidgetId(1), files, columns(lang), SelectionMode::Multi, TableStyle::FILES) + files.hint = Some("Double-click to open"); + let mut top = VirtualTable::new(WidgetId(1), files, columns(lang), SelectionMode::Multi, TableStyle::FILES_LIST) .with_selection(select(&[1, 2, 3, 6, 7])) .with_focused(RowKey(2)); top.set_label(s(lang, "Files", "File")); let mut cols = columns(lang); cols.truncate(3); - let tasks = Demo::new(tasks_rows()); - let mut bottom = VirtualTable::new(WidgetId(2), tasks, cols, SelectionMode::Multi, TableStyle::TASKS) + cols[1].align = Align::End; + cols[2].align = Align::End; + let mut tasks = Demo::new(list_tasks_rows()); + tasks.hues = Some(sample_hues()); + tasks.action_glyph = Some(Glyph::LineClose); + let mut bottom = VirtualTable::new(WidgetId(2), tasks, cols, SelectionMode::Multi, TableStyle::TASKS_LIST) .with_selection(select(&[2, 20])) .with_focused(RowKey(2)); + let (mem, cpu) = sample_hues(); + bottom.set_legends(vec![(ColId(1), mem), (ColId(2), cpu)]); bottom.set_label(s(lang, "Tasks", "Attivita")); let screen = Tables::new(vec![((16, 16, 688, 292), top), ((16, 324, 688, 200), bottom)]); Some(Page { name: "table", size: SIZE, states: 1, screen: Box::new(screen) }) } + +#[cfg(test)] +mod tests { + use super::*; + use oled_ui::geom::PointL; + use oled_ui::harness::Harness; + use oled_ui::theme::Tokens; + + fn scene(dpi: u32, f: impl FnOnce(&mut Harness>)) -> oled_ui::harness::Image { + let p = page(UiLang::EN).unwrap(); + let mut h = Harness::new(p.screen, p.size, dpi, Tokens::oled()); + f(&mut h); + h.render() + } + + fn lit(img: &oled_ui::harness::Image, x0: u32, x1: u32, y0: u32, y1: u32) -> usize { + (y0..y1) + .flat_map(|y| (x0..x1).map(move |x| (x, y))) + .filter(|&(x, y)| img.px[(y * img.w + x) as usize] & 0xFF > 90) + .count() + } + + /// The states a still page cannot show, one scene each; written as PNG files when TABLE_SCENES_DIR names a folder. + #[test] + fn the_interactive_states_have_scenes() { + let at = |x, y| PointL { x, y }; + // The hover hint of the files list: row 1 is y 80..112. + let rest = scene(96, |h| { + h.hover(at(300, 96)); + h.advance(100); + }); + let hint = scene(96, |h| { + h.hover(at(300, 96)); + h.advance(600); + }); + assert!(lit(&hint, 230, 420, 84, 110) > lit(&rest, 230, 420, 84, 110) + 20, "the hint shows after the delay"); + // The inline action of the tasks list on a hovered row, and on the keyboard-current one. + let hot = scene(96, |h| { + h.hover(at(300, 444)); + h.advance(300); + }); + let kbd = scene(96, |h| { + h.key("Tab").key("Tab").key("Tab").key("Tab"); + h.key("Down"); + h.hover(at(700, 20)); + h.advance(300); + }); + let act = scene(96, |h| { + h.key("Tab").key("Tab").key("Tab").key("Tab"); + h.key("Down").key("Tab"); + h.hover(at(700, 20)); + h.advance(300); + }); + let header = scene(96, |h| { + h.hover(at(450, 340)); + h.advance(200); + }); + let section = scene(96, |h| { + h.hover(at(120, 380)); + h.advance(200); + }); + let hi = scene(192, |h| { + h.hover(at(300, 444)); + h.advance(300); + }); + if let Ok(dir) = std::env::var("TABLE_SCENES_DIR") { + for (name, img) in [ + ("hint", &hint), + ("action-hover", &hot), + ("action-keyboard", &kbd), + ("action-focused", &act), + ("header-hover", &header), + ("section-hover", §ion), + ("action-hover-192", &hi), + ] { + img.write_png(&std::path::Path::new(&dir).join(format!("{name}.png"))).unwrap(); + } + } + assert_ne!(hot.px, kbd.px); + assert_ne!(kbd.px, act.px); + assert_ne!(header.px, section.px); + } +} diff --git a/apps/gallery/src/pages/table100k.rs b/apps/gallery/src/pages/table100k.rs index 6f33110b..ca2fc6c7 100644 --- a/apps/gallery/src/pages/table100k.rs +++ b/apps/gallery/src/pages/table100k.rs @@ -14,7 +14,7 @@ pub const ROWS: usize = 100_000; pub fn page(lang: UiLang) -> Option { let mut demo = Demo::synthetic(ROWS); demo.ext_spans = true; - let mut t = VirtualTable::new(WidgetId(1), demo, columns(lang), SelectionMode::Multi, TableStyle::FILES); + let mut t = VirtualTable::new(WidgetId(1), demo, columns(lang), SelectionMode::Multi, TableStyle::FILES_LIST); t.set_label(s(lang, "A hundred thousand files", "Centomila file")); let screen = Tables::new(vec![((16, 16, 688, 408), t)]); Some(Page { name: "table100k", size: SizeL { w: 720, h: 440 }, states: 1, screen: Box::new(screen) }) diff --git a/apps/gallery/src/pages/tabs.rs b/apps/gallery/src/pages/tabs.rs index 3217d457..a2204ef2 100644 --- a/apps/gallery/src/pages/tabs.rs +++ b/apps/gallery/src/pages/tabs.rs @@ -1,7 +1,9 @@ //! The tabs page (K3.1): the tab strip at rest (one selected, one long label trimmed), with a busy and an error tab, and -//! overflowing into a scroll with the "+" button pinned at the end. +//! overflowing into a scroll with the "+" button pinned at the end; then the same in the click look, with art, a tab under +//! the pointer and a strip of icon-less tabs. use super::{s, Page}; +use oled_ui::art::{compose, Art}; use oled_ui::command::CommandTable; use oled_ui::cx::{EventCx, LayoutCx, PaintCx}; use oled_ui::event::{Event, Reply}; @@ -10,8 +12,9 @@ use oled_ui::node::{Text, WidgetId}; use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; use oled_ui::widgets::{TabSpec, TabStrip}; +use std::rc::Rc; -const SIZE: SizeL = SizeL { w: 960, h: 176 }; +const SIZE: SizeL = SizeL { w: 960, h: 400 }; const STRIP_H: i32 = 40; struct Strips { @@ -49,7 +52,12 @@ fn tab(key: u64, label: Text, busy: bool, error: bool) -> TabSpec { TabSpec { key, label, tip: None, icon: None, busy, error } } -/// The page: three strips. +/// A tab carrying colour art (composed at 64 px, drawn down to 16 logical px). +fn art_tab(key: u64, label: Text, art: Art) -> TabSpec { + TabSpec { icon: Some(Rc::new(compose(art, 64, None))), ..tab(key, label, false, false) } +} + +/// The page: three strips in the default look, four in the click look. pub fn page(lang: UiLang) -> Option { let rest = vec![ tab(1, s(lang, "Documents", "Documenti"), false, false), @@ -69,10 +77,33 @@ pub fn page(lang: UiLang) -> Option { ]; let many: Vec = (1..=14u64).map(|k| tab(k, s(lang, "Project folder", "Cartella progetto"), false, false)).collect(); + let click = |lang: UiLang| { + vec![ + art_tab(1, s(lang, "Documents", "Documenti"), Art::Documents), + art_tab(2, s(lang, "Projects 2026", "Progetti 2026"), Art::Folder), + art_tab( + 3, + s(lang, "A folder with a name too long to fit its tab", "Una cartella con un nome troppo lungo"), + Art::Folder, + ), + art_tab(4, s(lang, "Downloads", "Scaricati"), Art::Downloads), + ] + }; + let mut hot = TabStrip::new(WidgetId(5)).with_click_look().with_tabs(click(lang), 2); + hot.preview_hot_tab(Some(0)); + let mut busy = click(lang); + busy[0].busy = true; + busy[3].error = true; + let plain: Vec = + (1..=14u64).map(|k| art_tab(k, s(lang, "Project folder", "Cartella progetto"), Art::Folder)).collect(); let strips = vec![ TabStrip::new(WidgetId(1)).with_tabs(rest, 1), TabStrip::new(WidgetId(2)).with_tabs(states, 2), TabStrip::new(WidgetId(3)).with_tabs(many, 14), + TabStrip::new(WidgetId(4)).with_click_look().with_tabs(click(lang), 2), + hot, + TabStrip::new(WidgetId(6)).with_click_look().with_tabs(busy, 3), + TabStrip::new(WidgetId(7)).with_click_look().with_tabs(plain, 14), ]; Some(Page { name: "tabs", diff --git a/apps/gallery/src/pages/toggles.rs b/apps/gallery/src/pages/toggles.rs index 77a472cb..540a722a 100644 --- a/apps/gallery/src/pages/toggles.rs +++ b/apps/gallery/src/pages/toggles.rs @@ -11,9 +11,11 @@ use oled_ui::node::{Text, WidgetId}; use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; use oled_ui::theme::TypeRole; +use oled_ui::widgets::icon_button::PreviewState; use oled_ui::widgets::{Checkbox, Segmented, Slider, TextLabel, Toggle}; +use oled_ui::Glyph; -const SIZE: SizeL = SizeL { w: 480, h: 300 }; +const SIZE: SizeL = SizeL { w: 480, h: 450 }; /// A widget and where it goes, logical px. struct Placed { @@ -129,6 +131,32 @@ pub fn page(lang: UiLang) -> Option { let options = vec![s(lang, "Off", "No"), s(lang, "Auto", "Auto"), s(lang, "On", "Sì")]; t.add(Segmented::new(next(), s(lang, "Mode", "Modo"), options.clone(), Some(1)), (248, 92, 216, 24)); t.add(Segmented::new(next(), s(lang, "Mode, none", "Modo, nessuno"), options, None), (248, 266, 216, 24)); + // The click style: chosen, hover, pressed, focus, with glyphs, unavailable. + let (h, r) = heading(next().0, s(lang, "Segmented, click style", "Segmentato, stile click"), 304); + t.add(h, r); + let views = vec![s(lang, "Groups", "Gruppi"), s(lang, "Tree", "Albero"), s(lang, "List", "Elenco")]; + let glyphs = vec![Glyph::Folder, Glyph::Pin, Glyph::Gear]; + type Look = Option<(usize, PreviewState)>; + let cases: [(Look, bool, bool); 6] = [ + (None, false, true), + (Some((0, PreviewState::Hover)), false, true), + (Some((0, PreviewState::Pressed)), false, true), + (Some((0, PreviewState::Focus)), false, true), + (None, true, true), + (None, false, false), + ]; + for (i, (look, with_glyphs, enabled)) in cases.into_iter().enumerate() { + let mut sg = Segmented::new(next(), s(lang, "View", "Vista"), views.clone(), Some(1)); + sg.set_click_style(true); + sg.set_enabled(enabled); + if with_glyphs { + sg.set_glyphs(glyphs.clone()); + } + sg.preview(look); + let (col, row) = (i as i32 % 2, i as i32 / 2); + let width = if with_glyphs { 232 } else { 216 }; + t.add(sg, (16 + 232 * col, 330 + 40 * row, width, 32)); + } Some(Page { name: "toggles", size: SIZE, states: 1, screen: Box::new(t) }) } diff --git a/apps/gallery/src/pages/toolbar.rs b/apps/gallery/src/pages/toolbar.rs index 4b0951a7..d51ee86f 100644 --- a/apps/gallery/src/pages/toolbar.rs +++ b/apps/gallery/src/pages/toolbar.rs @@ -1,8 +1,10 @@ //! The toolbar page (K2b.5): the tasks-like toolbar (page tabs, buttons, status text, search field) with each tab -//! selected, and the files-like one (buttons and a field with a clear button). +//! selected, and the files-like one (buttons and a field with a clear button); then the labelled command bar at three +//! widths, showing how it folds into More, and the command band with and without a selection. use super::{s, Page}; use oled_ui::command::{CommandId, CommandTable}; +use oled_ui::cx::MenuItem; use oled_ui::cx::{EventCx, LayoutCx, PaintCx}; use oled_ui::event::{Event, Reply}; use oled_ui::geom::{RectP, SizeL, SizeP}; @@ -10,14 +12,24 @@ use oled_ui::model::FgRole; use oled_ui::node::WidgetId; use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; -use oled_ui::widgets::{FieldKind, PageTabs, TextField, Toolbar, ToolbarButton}; +use oled_ui::widgets::{ + BandSelection, BarEntry, BarStyle, ButtonKind, ButtonShow, CommandBar, CommandItem, FieldKind, PageTabs, TextField, + Toolbar, ToolbarButton, +}; use oled_ui::Glyph; -const SIZE: SizeL = SizeL { w: 640, h: 200 }; +const SIZE: SizeL = SizeL { w: 1120, h: 500 }; +/// The width of the older toolbars, logical px. +const OLD_W: i32 = 640; +/// Where the command bars start, and the widths of the three Folio-like ones. +const BARS_Y: i32 = 176; +const BAR_WIDTHS: [i32; 3] = [1100, 800, 560]; const TOOLBAR_H: i32 = 44; struct Toolbars { bars: Vec, + /// The command bars and bands, each with its width in logical px. + cmd_bars: Vec<(CommandBar, i32)>, commands: CommandTable, } @@ -25,7 +37,11 @@ impl Screen for Toolbars { fn layout(&mut self, cx: &mut LayoutCx, avail: SizeP) -> SizeP { for (i, b) in self.bars.iter_mut().enumerate() { let y = 8 + i as i32 * (TOOLBAR_H + 8); - b.layout(cx, RectP::wh(0, cx.px(y), avail.w, cx.px(TOOLBAR_H))); + b.layout(cx, RectP::wh(0, cx.px(y), cx.px(OLD_W), cx.px(TOOLBAR_H))); + } + for (i, (bar, w)) in self.cmd_bars.iter_mut().enumerate() { + let y = BARS_Y + i as i32 * (TOOLBAR_H + 16); + bar.layout(cx, RectP::wh(0, cx.px(y), cx.px(*w), cx.px(TOOLBAR_H))); } avail } @@ -34,12 +50,18 @@ impl Screen for Toolbars { for b in &self.bars { b.paint(cx); } + for (b, _) in &self.cmd_bars { + b.paint(cx); + } } fn event(&mut self, cx: &mut EventCx, ev: &Event) -> Reply { for b in &mut self.bars { b.event(cx, ev); } + for (b, _) in &mut self.cmd_bars { + b.event(cx, ev); + } Reply::None } @@ -52,7 +74,121 @@ fn button(cmd: u32, glyph: Glyph, tip: oled_ui::node::Text, toggled: Option Vec { + let item = |id, glyph, en, it, kind| CommandItem::new(id, glyph, s(lang, en, it), kind); + let fold = |it: CommandItem| BarEntry::Item(it.fold(1)); + let sort_menu = vec![ + MenuItem::Header(s(lang, "Sort by", "Ordina per")), + MenuItem::Custom { + id: CommandId(70), + label: s(lang, "Name", "Nome"), + glyph: None, + chord: None, + enabled: true, + checked: Some(true), + note: None, + danger: false, + }, + ]; + vec![ + BarEntry::Item(item(NEW, Glyph::LinePlus, "New", "Nuovo", ButtonKind::Plate).with_menu(Vec::new())), + BarEntry::Separator, + fold(item(CUT, Glyph::CmdCut, "Cut", "Taglia", ButtonKind::Command).shortcut(s(lang, "Ctrl+X", "Ctrl+X"))), + fold(item(COPY, Glyph::CmdCopy, "Copy", "Copia", ButtonKind::Command).shortcut(s(lang, "Ctrl+C", "Ctrl+C"))), + fold(item(PASTE, Glyph::CmdPaste, "Paste", "Incolla", ButtonKind::Command).enabled(false).tip(s( + lang, + "The clipboard is empty", + "Gli appunti sono vuoti", + ))), + fold(item(RENAME, Glyph::CmdRename, "Rename", "Rinomina", ButtonKind::Command).shortcut(s(lang, "F2", "F2"))), + fold( + item(DELETE, Glyph::CmdDelete, "Delete", "Elimina", ButtonKind::Destructive) + .shortcut(s(lang, "Del", "Canc")), + ), + BarEntry::Separator, + fold(item(SORT, Glyph::CmdSort, "Sort", "Ordina", ButtonKind::Menu).with_menu(sort_menu)), + fold(item(VIEW, Glyph::CmdView, "View", "Visualizza", ButtonKind::Menu)), + fold(item(FILTER, Glyph::CmdFilter, "Filter", "Filtra", ButtonKind::Menu)), + BarEntry::Separator, + BarEntry::More, + BarEntry::Spacer, + BarEntry::Item(item(DETAILS, Glyph::CmdDetailsPane, "Details", "Dettagli", ButtonKind::Toggle).on(true)), + ] +} + +/// The Tasks-like command band: the selection's commands, the last four may fold. +fn band_entries(lang: UiLang) -> Vec { + let item = |id, glyph, en, it, kind| CommandItem::new(id, glyph, s(lang, en, it), kind); + vec![ + BarEntry::Item(item(END_APP, Glyph::CmdCloseWindow, "Close Ember", "Chiudi Ember", ButtonKind::Command)), + BarEntry::Item(item(END, Glyph::CmdEndTask, "End", "Termina", ButtonKind::Destructive)), + BarEntry::Item(item(EFFICIENCY, Glyph::CmdEfficiency, "Efficiency", "Efficienza", ButtonKind::Toggle).fold(4)), + BarEntry::Item( + item(PRIORITY, Glyph::CmdPriority, "Priority: normal", "Priorita: normale", ButtonKind::Menu).fold(3), + ), + BarEntry::Item(item(OPEN_PATH, Glyph::LineFolder, "Open path", "Apri percorso", ButtonKind::Command).fold(2)), + BarEntry::Item(item(PROPERTIES, Glyph::LineInfo, "Properties", "Proprieta", ButtonKind::Command).fold(1)), + BarEntry::More, + ] +} + +/// The three Folio-like bars (1100, 800 and 560 px), then the band with and without a selection. +fn command_bars(lang: UiLang) -> Vec<(CommandBar, i32)> { + let mut out = Vec::new(); + for (n, w) in BAR_WIDTHS.into_iter().enumerate() { + let mut bar = CommandBar::new(WidgetId(100 + n as u32), BarStyle::Bar, folio_entries(lang)); + bar.set_name(s(lang, "Folder commands", "Comandi della cartella")); + if n == 0 { + // The states a still frame cannot make: the keyboard ring on Rename, a menu open under Sort. + bar.show(Some(RENAME), ButtonShow::Focus); + bar.show(Some(DELETE), ButtonShow::Hover); + bar.set_open(Some(SORT)); + } + if n == 2 { + bar.set_more_open(true); + } + out.push((bar, w)); + } + for (n, selected) in [true, false].into_iter().enumerate() { + let mut band = CommandBar::new(WidgetId(110 + n as u32), BarStyle::Band, band_entries(lang)); + band.set_name(s(lang, "Process commands", "Comandi del processo")); + band.set_empty_text(Some(s( + lang, + "Select a process to see its commands", + "Seleziona un processo per vederne i comandi", + ))); + if selected { + band.set_selection(Some(BandSelection { + glyph: Glyph::Window, + name: s(lang, "Ember", "Ember"), + count: Some(s(lang, "3 processes", "3 processi")), + })); + band.show(Some(END_APP), ButtonShow::Hover); + } + out.push((band, 900)); + } + out +} + +/// The page: three toolbars, one under each state a still frame can show, then the command bars. pub fn page(lang: UiLang) -> Option { let tabs = |id| { PageTabs::new( @@ -98,6 +234,6 @@ pub fn page(lang: UiLang) -> Option { name: "toolbar", size: SIZE, states: 1, - screen: Box::new(Toolbars { bars, commands: CommandTable::new() }), + screen: Box::new(Toolbars { bars, cmd_bars: command_bars(lang), commands: CommandTable::new() }), }) } diff --git a/apps/gallery/src/pages/tooltip.rs b/apps/gallery/src/pages/tooltip.rs index c4db0ae1..3f3dce5a 100644 --- a/apps/gallery/src/pages/tooltip.rs +++ b/apps/gallery/src/pages/tooltip.rs @@ -11,10 +11,11 @@ use oled_ui::node::{Text, WidgetId}; use oled_ui::screen::{Screen, Widget}; use oled_ui::strings::UiLang; use oled_ui::theme::TypeRole; +use oled_ui::widgets::icon_button::{IconInk, IconSize, PreviewState}; use oled_ui::widgets::{chip_size, paint_chip, IconButton, TextLabel}; use oled_ui::Glyph; -const SIZE: SizeL = SizeL { w: 480, h: 240 }; +const SIZE: SizeL = SizeL { w: 480, h: 420 }; /// A chip's text and chord, and where it goes (logical px); the size is measured at layout. struct Chip { @@ -24,6 +25,13 @@ struct Chip { size: SizeP, } +impl Chip { + fn at_x(mut self, x: i32) -> Chip { + self.at.0 = x; + self + } +} + struct Tooltips { heads: Vec<(TextLabel, (i32, i32, i32, i32))>, chips: Vec, @@ -71,6 +79,36 @@ impl Screen for Tooltips { } } +/// The click-style rows: the 32 px size, the 24 px size and Ink 1, each in its five states. +fn click_rows(lang: UiLang) -> Vec<(IconButton, (i32, i32, i32, i32))> { + let states = [None, Some(PreviewState::Hover), Some(PreviewState::Pressed), Some(PreviewState::Focus)]; + let mut out = Vec::new(); + for (row, (size, ink, y, side)) in [ + (IconSize::Large, IconInk::Secondary, 280, 32), + (IconSize::Small, IconInk::Secondary, 332, 24), + (IconSize::Large, IconInk::Primary, 372, 32), + ] + .into_iter() + .enumerate() + { + for n in 0..5usize { + let id = 100 + (row * 5 + n) as u32; + let mut b = + IconButton::new(WidgetId(id), Glyph::ChevronLeft, s(lang, "Back to Studio", "Indietro a Studio")); + b.set_size(size); + b.set_ink(ink); + if let Some(look) = states.get(n) { + b.preview(*look); + } else { + b.set_enabled(false); + b.set_off_tip(Some(s(lang, "There is no folder before this one", "Nessuna cartella prima di questa"))); + } + out.push((b, (16 + 48 * n as i32, y, side, side))); + } + } + out +} + /// The page. pub fn page(lang: UiLang) -> Option { let head = @@ -98,7 +136,16 @@ pub fn page(lang: UiLang) -> Option { "Icon buttons (hold the pointer for half a second)", "Pulsanti icona (fermo per mezzo secondo)", ), - 160, + 190, + ), + head( + 3, + s( + lang, + "Click style: rest, hover, pressed, focus, unavailable", + "Stile click: riposo, sopra, premuto, focus, non disponibile", + ), + 256, ), ], chips: vec![ @@ -106,13 +153,15 @@ pub fn page(lang: UiLang) -> Option { chip(s(lang, "Back", "Indietro"), Some("Alt+Left"), 68), chip(s(lang, "Search", "Cerca"), Some("Ctrl+F"), 100), chip(long, None, 132), + chip(s(lang, "Rename the selected file", "Rinomina il file selezionato"), Some("F2"), 36).at_x(260), ], icons: icons .into_iter() .enumerate() .map(|(n, (g, en, it))| { - (IconButton::new(WidgetId(10 + n as u32), g, s(lang, en, it)), (16 + 40 * n as i32, 188, 28, 28)) + (IconButton::new(WidgetId(10 + n as u32), g, s(lang, en, it)), (16 + 40 * n as i32, 214, 28, 28)) }) + .chain(click_rows(lang)) .collect(), commands: CommandTable::new(), }; @@ -132,7 +181,7 @@ mod tests { let p = page(lang).unwrap(); let h = Harness::new(p.screen, p.size, 96, Tokens::oled()).lang(l); h.assert_named(); - assert_eq!(h.a11y_dump().lines().filter(|l| l.starts_with("Button")).count(), 5); + assert_eq!(h.a11y_dump().lines().filter(|l| l.starts_with("Button")).count(), 5 + 15); } } diff --git a/apps/gallery/src/preview.rs b/apps/gallery/src/preview.rs index 96a6309b..e6fe09b2 100644 --- a/apps/gallery/src/preview.rs +++ b/apps/gallery/src/preview.rs @@ -8,7 +8,7 @@ use crate::pages; use oled_ui::geom::SizeL; use oled_ui::harness::{Harness, Image}; use oled_ui::strings::{Lang, UiLang}; -use oled_ui::theme::{Corners, HcColors, Preset, SysOverlay, ThemeSpec, Tokens}; +use oled_ui::theme::{Corners, HcColors, Preset, Rgb, SysOverlay, ThemeSpec, Tokens}; /// A cell's language. #[derive(Clone, Copy, Debug, PartialEq, Eq)] @@ -24,6 +24,8 @@ pub enum CellTheme { Oled, Contrast, HighContrast, + /// The accent Ghiaccio (#6CB6FF) on the default look: the click-states board only. + Ghiaccio, } /// One image of a page: language, DPI and theme. @@ -55,6 +57,7 @@ impl Cell { CellTheme::Oled => "", CellTheme::Contrast => "-contrast", CellTheme::HighContrast => "-hc", + CellTheme::Ghiaccio => "-ghiaccio", }; format!("{lang}-{}{theme}", self.dpi) } @@ -74,6 +77,10 @@ impl Cell { spec.look.knobs.corners = Corners::Square; Tokens::resolve(&spec, &SysOverlay::none()) } + CellTheme::Ghiaccio => { + spec.look.seed.accent = Some(Rgb(0x6C, 0xB6, 0xFF)); + Tokens::resolve(&spec, &SysOverlay::none()) + } CellTheme::HighContrast => { Tokens::resolve(&spec, &SysOverlay { high_contrast: Some(HC_BLACK), ..SysOverlay::none() }) } @@ -97,12 +104,20 @@ pub fn matrix() -> Vec { v } -/// The cells of one page: the glyphs page carries no text, so OLED English at the four DPIs is all it needs. +/// The cells of one page: the glyphs page carries no text, so OLED English at the four DPIs is all it needs; the +/// click-states board adds one cell with the accent Ghiaccio, to show what the accent tints and what it never does. pub fn cells_for(page: &str) -> Vec { - if page == "glyphs" { - [96, 120, 144, 192].into_iter().map(|dpi| Cell { lang: CellLang::En, dpi, theme: CellTheme::Oled }).collect() - } else { - matrix() + match page { + "glyphs" => [96, 120, 144, 192] + .into_iter() + .map(|dpi| Cell { lang: CellLang::En, dpi, theme: CellTheme::Oled }) + .collect(), + "click_states" => { + let mut v = matrix(); + v.push(Cell { lang: CellLang::En, dpi: 144, theme: CellTheme::Ghiaccio }); + v + } + _ => matrix(), } } @@ -229,6 +244,20 @@ mod tests { assert_eq!(cells_for("glyphs").len(), 4); } + #[test] + fn the_board_has_an_accent_cell_and_no_other_page_does() { + let board = cells_for("click_states"); + assert_eq!(board.len(), 13); + let accent: Vec = board.iter().filter(|c| c.theme == CellTheme::Ghiaccio).map(Cell::name).collect(); + assert_eq!(accent, ["en-144-ghiaccio"]); + assert!(cells_for("buttons").iter().all(|c| c.theme != CellTheme::Ghiaccio)); + let c = Cell { lang: CellLang::En, dpi: 144, theme: CellTheme::Ghiaccio }.tokens(); + assert_eq!(c.color.accent_ui, oled_ui::theme::Ink::solid(0x6C, 0xB6, 0xFF)); + let plain = Cell { lang: CellLang::En, dpi: 144, theme: CellTheme::Oled }.tokens(); + assert_eq!(plain.color.accent_ui, oled_ui::theme::Ink::white(255)); + assert_eq!(c.color.fg_primary, plain.color.fg_primary, "the accent never moves a text ink"); + } + #[test] fn themes_change_the_tokens() { let c = |theme| Cell { lang: CellLang::En, dpi: 96, theme }.tokens(); diff --git a/apps/gallery/tests/bench.rs b/apps/gallery/tests/bench.rs index 71e0b4bd..29989210 100644 --- a/apps/gallery/tests/bench.rs +++ b/apps/gallery/tests/bench.rs @@ -39,3 +39,9 @@ fn scroll_strip() { fn table_4k_full() { check("table_4k_full"); } + +#[test] +#[ignore = "a release bench: cargo test --release -p gallery --test bench -- --ignored"] +fn charts_4k() { + check("charts_4k"); +} diff --git a/apps/gallery/tests/golden.rs b/apps/gallery/tests/golden.rs index 8ae2defb..74690964 100644 --- a/apps/gallery/tests/golden.rs +++ b/apps/gallery/tests/golden.rs @@ -22,3 +22,19 @@ fn every_page_matches_its_goldens() { } } } + +/// The click-states board is part of the matrix, and its one accent cell shows the accent: the pixels of the focus rings +/// and the selection bars are exactly #6CB6FF there, and nowhere on the default white board. +#[test] +fn the_click_states_board_has_its_accent_cell() { + let cells = preview::cells_for("click_states"); + assert!(pages::REGISTRY.iter().any(|(n, _)| *n == "click_states")); + let accent = cells.iter().find(|c| c.name() == "en-144-ghiaccio").expect("the accent cell"); + let plain = cells.iter().find(|c| c.name() == "en-144").expect("the default cell"); + let count = |cell: &preview::Cell| { + let r = preview::render("click_states", cell).expect("the board renders"); + r.image.px.iter().filter(|p| **p == 0xFF6C_B6FF).count() + }; + assert_eq!(count(plain), 0, "white by default: no accent pixel"); + assert!(count(accent) > 200, "the accent marks the focus rings and the selection bars"); +} diff --git a/apps/gallery/tests/golden/base/art/a11y.txt b/apps/gallery/tests/golden/base/art/a11y.txt new file mode 100644 index 00000000..e69de29b diff --git a/apps/gallery/tests/golden/base/art/en-120.png b/apps/gallery/tests/golden/base/art/en-120.png new file mode 100644 index 00000000..d9da2ad6 Binary files /dev/null and b/apps/gallery/tests/golden/base/art/en-120.png differ diff --git a/apps/gallery/tests/golden/base/art/en-144-contrast.png b/apps/gallery/tests/golden/base/art/en-144-contrast.png new file mode 100644 index 00000000..7e8f95bf Binary files /dev/null and b/apps/gallery/tests/golden/base/art/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/art/en-144-hc.png b/apps/gallery/tests/golden/base/art/en-144-hc.png new file mode 100644 index 00000000..ce4341ae Binary files /dev/null and b/apps/gallery/tests/golden/base/art/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/art/en-144.png b/apps/gallery/tests/golden/base/art/en-144.png new file mode 100644 index 00000000..7e8f95bf Binary files /dev/null and b/apps/gallery/tests/golden/base/art/en-144.png differ diff --git a/apps/gallery/tests/golden/base/art/en-192.png b/apps/gallery/tests/golden/base/art/en-192.png new file mode 100644 index 00000000..ccbcffe2 Binary files /dev/null and b/apps/gallery/tests/golden/base/art/en-192.png differ diff --git a/apps/gallery/tests/golden/base/art/en-96-hc.png b/apps/gallery/tests/golden/base/art/en-96-hc.png new file mode 100644 index 00000000..be81dabc Binary files /dev/null and b/apps/gallery/tests/golden/base/art/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/art/en-96.png b/apps/gallery/tests/golden/base/art/en-96.png new file mode 100644 index 00000000..4434a013 Binary files /dev/null and b/apps/gallery/tests/golden/base/art/en-96.png differ diff --git a/apps/gallery/tests/golden/base/art/it-120.png b/apps/gallery/tests/golden/base/art/it-120.png new file mode 100644 index 00000000..d9da2ad6 Binary files /dev/null and b/apps/gallery/tests/golden/base/art/it-120.png differ diff --git a/apps/gallery/tests/golden/base/art/it-144.png b/apps/gallery/tests/golden/base/art/it-144.png new file mode 100644 index 00000000..7e8f95bf Binary files /dev/null and b/apps/gallery/tests/golden/base/art/it-144.png differ diff --git a/apps/gallery/tests/golden/base/art/it-192.png b/apps/gallery/tests/golden/base/art/it-192.png new file mode 100644 index 00000000..ccbcffe2 Binary files /dev/null and b/apps/gallery/tests/golden/base/art/it-192.png differ diff --git a/apps/gallery/tests/golden/base/art/it-96.png b/apps/gallery/tests/golden/base/art/it-96.png new file mode 100644 index 00000000..4434a013 Binary files /dev/null and b/apps/gallery/tests/golden/base/art/it-96.png differ diff --git a/apps/gallery/tests/golden/base/art/pseudo-144.png b/apps/gallery/tests/golden/base/art/pseudo-144.png new file mode 100644 index 00000000..7e8f95bf Binary files /dev/null and b/apps/gallery/tests/golden/base/art/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/buttons/a11y.txt b/apps/gallery/tests/golden/base/buttons/a11y.txt index 4b431222..b8e7057a 100644 --- a/apps/gallery/tests/golden/base/buttons/a11y.txt +++ b/apps/gallery/tests/golden/base/buttons/a11y.txt @@ -1,3 +1,60 @@ +Label "Rest" +Label "Hover" +Label "Pressed" +Label "On / open" +Label "Focus" +Label "Disabled" +Label "Primary" +Button "Open" [focusable] +Button "Open" [focusable] +Button "Open" [focusable] +Button "Open" [focusable] +Button "Open" [disabled] +Label "Dialog" +Button "Cancel" [focusable] +Button "Cancel" [focusable] +Button "Cancel" [focusable] +Button "Cancel" [focusable] +Button "Cancel" [disabled] +Label "Plate" +Button "Run" [focusable] +Button "Run" [focusable] +Button "Run" [focusable] +Button "Run" [focusable] +Button "Run" [disabled] +Label "Plate menu" +Button "New" [focusable, expandable] +Button "New" [focusable, expandable] +Button "New" [focusable, expandable] +Button "New" [focusable, expandable] +Button "New" [focusable, expandable] +Button "New" [disabled, expandable] +Label "Command" +Button "Copy" [focusable] +Button "Copy" [focusable] +Button "Copy" [focusable] +Button "Copy" [focusable] +Button "Copy" [disabled] +Label "Menu" +Button "Sort" [focusable, expandable] +Button "Sort" [focusable, expandable] +Button "Sort" [focusable, expandable] +Button "Sort" [focusable, expandable] +Button "Sort" [focusable, expandable] +Button "Sort" [disabled, expandable] +Label "Destructive" +Button "Delete" [focusable] +Button "Delete" [focusable] +Button "Delete" [focusable] +Button "Delete" [focusable] +Button "Delete" [disabled] +Label "Toggle" +Button "Details" [focusable] +Button "Details" [focusable] +Button "Details" [focusable] +Button "Details" [focusable, checked] +Button "Details" [focusable] +Button "Details" [disabled] Label "Secondary" Button "Rest" [focusable] Button "Disabled" [disabled] @@ -13,6 +70,11 @@ Button "Pin" [focusable] Button "Search" [focusable] Button "More" [focusable] Button "Settings" [disabled] +Label "Text link" +Link "Show the row" [focusable] +Link "Show the row" [focusable] +Link "Show the row" [focusable] +Link "Show the row" [focusable] Label "Text" Label "Primary text" Label "Hot text" diff --git a/apps/gallery/tests/golden/base/buttons/en-120.png b/apps/gallery/tests/golden/base/buttons/en-120.png index 00a237c9..49948c34 100644 Binary files a/apps/gallery/tests/golden/base/buttons/en-120.png and b/apps/gallery/tests/golden/base/buttons/en-120.png differ diff --git a/apps/gallery/tests/golden/base/buttons/en-144-contrast.png b/apps/gallery/tests/golden/base/buttons/en-144-contrast.png index ddfa4d13..47cada72 100644 Binary files a/apps/gallery/tests/golden/base/buttons/en-144-contrast.png and b/apps/gallery/tests/golden/base/buttons/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/buttons/en-144-hc.png b/apps/gallery/tests/golden/base/buttons/en-144-hc.png index bfc4c09e..3f554335 100644 Binary files a/apps/gallery/tests/golden/base/buttons/en-144-hc.png and b/apps/gallery/tests/golden/base/buttons/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/buttons/en-144.png b/apps/gallery/tests/golden/base/buttons/en-144.png index 53c7d5ce..6e5b3849 100644 Binary files a/apps/gallery/tests/golden/base/buttons/en-144.png and b/apps/gallery/tests/golden/base/buttons/en-144.png differ diff --git a/apps/gallery/tests/golden/base/buttons/en-192.png b/apps/gallery/tests/golden/base/buttons/en-192.png index 8e7c11c2..fe6939e9 100644 Binary files a/apps/gallery/tests/golden/base/buttons/en-192.png and b/apps/gallery/tests/golden/base/buttons/en-192.png differ diff --git a/apps/gallery/tests/golden/base/buttons/en-96-hc.png b/apps/gallery/tests/golden/base/buttons/en-96-hc.png index eed8a78f..71ca85cd 100644 Binary files a/apps/gallery/tests/golden/base/buttons/en-96-hc.png and b/apps/gallery/tests/golden/base/buttons/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/buttons/en-96.png b/apps/gallery/tests/golden/base/buttons/en-96.png index 03173b15..f279b4e2 100644 Binary files a/apps/gallery/tests/golden/base/buttons/en-96.png and b/apps/gallery/tests/golden/base/buttons/en-96.png differ diff --git a/apps/gallery/tests/golden/base/buttons/it-120.png b/apps/gallery/tests/golden/base/buttons/it-120.png index d022cd8d..72a4e94b 100644 Binary files a/apps/gallery/tests/golden/base/buttons/it-120.png and b/apps/gallery/tests/golden/base/buttons/it-120.png differ diff --git a/apps/gallery/tests/golden/base/buttons/it-144.png b/apps/gallery/tests/golden/base/buttons/it-144.png index 7d980543..61dc5b05 100644 Binary files a/apps/gallery/tests/golden/base/buttons/it-144.png and b/apps/gallery/tests/golden/base/buttons/it-144.png differ diff --git a/apps/gallery/tests/golden/base/buttons/it-192.png b/apps/gallery/tests/golden/base/buttons/it-192.png index ef04755b..c56e2223 100644 Binary files a/apps/gallery/tests/golden/base/buttons/it-192.png and b/apps/gallery/tests/golden/base/buttons/it-192.png differ diff --git a/apps/gallery/tests/golden/base/buttons/it-96.png b/apps/gallery/tests/golden/base/buttons/it-96.png index f1e65fc0..d8a0513c 100644 Binary files a/apps/gallery/tests/golden/base/buttons/it-96.png and b/apps/gallery/tests/golden/base/buttons/it-96.png differ diff --git a/apps/gallery/tests/golden/base/buttons/pseudo-144.png b/apps/gallery/tests/golden/base/buttons/pseudo-144.png index df8a95e6..6977d3e7 100644 Binary files a/apps/gallery/tests/golden/base/buttons/pseudo-144.png and b/apps/gallery/tests/golden/base/buttons/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/caption/en-120.png b/apps/gallery/tests/golden/base/caption/en-120.png index 0eb9d64e..061a3f88 100644 Binary files a/apps/gallery/tests/golden/base/caption/en-120.png and b/apps/gallery/tests/golden/base/caption/en-120.png differ diff --git a/apps/gallery/tests/golden/base/caption/en-144-contrast.png b/apps/gallery/tests/golden/base/caption/en-144-contrast.png index 8413e9e1..deb13b1b 100644 Binary files a/apps/gallery/tests/golden/base/caption/en-144-contrast.png and b/apps/gallery/tests/golden/base/caption/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/caption/en-144.png b/apps/gallery/tests/golden/base/caption/en-144.png index 8413e9e1..deb13b1b 100644 Binary files a/apps/gallery/tests/golden/base/caption/en-144.png and b/apps/gallery/tests/golden/base/caption/en-144.png differ diff --git a/apps/gallery/tests/golden/base/caption/en-192.png b/apps/gallery/tests/golden/base/caption/en-192.png index 15dd57f4..dd638487 100644 Binary files a/apps/gallery/tests/golden/base/caption/en-192.png and b/apps/gallery/tests/golden/base/caption/en-192.png differ diff --git a/apps/gallery/tests/golden/base/caption/en-96.png b/apps/gallery/tests/golden/base/caption/en-96.png index 54e7a51a..ab5b45dc 100644 Binary files a/apps/gallery/tests/golden/base/caption/en-96.png and b/apps/gallery/tests/golden/base/caption/en-96.png differ diff --git a/apps/gallery/tests/golden/base/caption/it-120.png b/apps/gallery/tests/golden/base/caption/it-120.png index 1ae0de94..c0a1d559 100644 Binary files a/apps/gallery/tests/golden/base/caption/it-120.png and b/apps/gallery/tests/golden/base/caption/it-120.png differ diff --git a/apps/gallery/tests/golden/base/caption/it-144.png b/apps/gallery/tests/golden/base/caption/it-144.png index 374a2431..b162d9b5 100644 Binary files a/apps/gallery/tests/golden/base/caption/it-144.png and b/apps/gallery/tests/golden/base/caption/it-144.png differ diff --git a/apps/gallery/tests/golden/base/caption/it-192.png b/apps/gallery/tests/golden/base/caption/it-192.png index f8189afa..d5b2960e 100644 Binary files a/apps/gallery/tests/golden/base/caption/it-192.png and b/apps/gallery/tests/golden/base/caption/it-192.png differ diff --git a/apps/gallery/tests/golden/base/caption/it-96.png b/apps/gallery/tests/golden/base/caption/it-96.png index b980d17f..91531869 100644 Binary files a/apps/gallery/tests/golden/base/caption/it-96.png and b/apps/gallery/tests/golden/base/caption/it-96.png differ diff --git a/apps/gallery/tests/golden/base/caption/pseudo-144.png b/apps/gallery/tests/golden/base/caption/pseudo-144.png index 0613a0d7..975e886a 100644 Binary files a/apps/gallery/tests/golden/base/caption/pseudo-144.png and b/apps/gallery/tests/golden/base/caption/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/charts/a11y.txt b/apps/gallery/tests/golden/base/charts/a11y.txt index 262bad5f..3896ce5b 100644 --- a/apps/gallery/tests/golden/base/charts/a11y.txt +++ b/apps/gallery/tests/golden/base/charts/a11y.txt @@ -10,3 +10,25 @@ Image "One spike among 10,000 samples" Image "One spike among 10,000 samples" Label "Trace (12 px)" Image "CPU trace, 12 px" +Label "Line chart, percent with a threshold" +Image "CPU" [focusable] "24 %, 18 seconds ago" +Label "Rate, received and sent" +Image "Network" [focusable] "↓ 8.4 Mbit/s ↑ 1.2 Mbit/s, now" +Label "Sparklines" +Label "Small multiples, 16 cells" +Image "Logical processor 0: 28 %" +Image "Logical processor 1: 16 %" +Image "Logical processor 2: 18 %" +Image "Logical processor 3: 33 %" +Image "Logical processor 4: 48 %" +Image "Logical processor 5: 92 %" +Image "Logical processor 6: 51 %" +Image "Logical processor 7: 39 %" +Image "Logical processor 8: 23 %" +Image "Logical processor 9: 16 %" +Image "Logical processor 10: 23 %" +Image "Logical processor 11: 38 %" +Image "Logical processor 12: 54 %" +Image "Logical processor 13: 56 %" +Image "Logical processor 14: 45 %" +Image "Logical processor 15: 31 %" diff --git a/apps/gallery/tests/golden/base/charts/en-120.png b/apps/gallery/tests/golden/base/charts/en-120.png index 48250ddf..dd9e5b65 100644 Binary files a/apps/gallery/tests/golden/base/charts/en-120.png and b/apps/gallery/tests/golden/base/charts/en-120.png differ diff --git a/apps/gallery/tests/golden/base/charts/en-144-contrast.png b/apps/gallery/tests/golden/base/charts/en-144-contrast.png index 8cd2209a..b74e63fb 100644 Binary files a/apps/gallery/tests/golden/base/charts/en-144-contrast.png and b/apps/gallery/tests/golden/base/charts/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/charts/en-144-hc.png b/apps/gallery/tests/golden/base/charts/en-144-hc.png index e5cdb535..ecc747df 100644 Binary files a/apps/gallery/tests/golden/base/charts/en-144-hc.png and b/apps/gallery/tests/golden/base/charts/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/charts/en-144.png b/apps/gallery/tests/golden/base/charts/en-144.png index 8cd2209a..b74e63fb 100644 Binary files a/apps/gallery/tests/golden/base/charts/en-144.png and b/apps/gallery/tests/golden/base/charts/en-144.png differ diff --git a/apps/gallery/tests/golden/base/charts/en-192.png b/apps/gallery/tests/golden/base/charts/en-192.png index cd5541d4..07020457 100644 Binary files a/apps/gallery/tests/golden/base/charts/en-192.png and b/apps/gallery/tests/golden/base/charts/en-192.png differ diff --git a/apps/gallery/tests/golden/base/charts/en-96-hc.png b/apps/gallery/tests/golden/base/charts/en-96-hc.png index 3782ad29..536f8dea 100644 Binary files a/apps/gallery/tests/golden/base/charts/en-96-hc.png and b/apps/gallery/tests/golden/base/charts/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/charts/en-96.png b/apps/gallery/tests/golden/base/charts/en-96.png index 2cee10e1..c650a3fa 100644 Binary files a/apps/gallery/tests/golden/base/charts/en-96.png and b/apps/gallery/tests/golden/base/charts/en-96.png differ diff --git a/apps/gallery/tests/golden/base/charts/it-120.png b/apps/gallery/tests/golden/base/charts/it-120.png index 61f79f15..1f0ab361 100644 Binary files a/apps/gallery/tests/golden/base/charts/it-120.png and b/apps/gallery/tests/golden/base/charts/it-120.png differ diff --git a/apps/gallery/tests/golden/base/charts/it-144.png b/apps/gallery/tests/golden/base/charts/it-144.png index 1bd67cc8..1b68a84f 100644 Binary files a/apps/gallery/tests/golden/base/charts/it-144.png and b/apps/gallery/tests/golden/base/charts/it-144.png differ diff --git a/apps/gallery/tests/golden/base/charts/it-192.png b/apps/gallery/tests/golden/base/charts/it-192.png index dccc39db..61248316 100644 Binary files a/apps/gallery/tests/golden/base/charts/it-192.png and b/apps/gallery/tests/golden/base/charts/it-192.png differ diff --git a/apps/gallery/tests/golden/base/charts/it-96.png b/apps/gallery/tests/golden/base/charts/it-96.png index d587bd6b..766cceab 100644 Binary files a/apps/gallery/tests/golden/base/charts/it-96.png and b/apps/gallery/tests/golden/base/charts/it-96.png differ diff --git a/apps/gallery/tests/golden/base/charts/pseudo-144.png b/apps/gallery/tests/golden/base/charts/pseudo-144.png index dac3907b..0a32bc36 100644 Binary files a/apps/gallery/tests/golden/base/charts/pseudo-144.png and b/apps/gallery/tests/golden/base/charts/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/click_states/a11y.txt b/apps/gallery/tests/golden/base/click_states/a11y.txt new file mode 100644 index 00000000..ce1b4cab --- /dev/null +++ b/apps/gallery/tests/golden/base/click_states/a11y.txt @@ -0,0 +1,175 @@ +Label "Rest" +Label "Hover" +Label "Pressed" +Label "On / open / selected" +Label "Focus" +Label "Disabled" +Label "Command button" +Button "Copy" [focusable] +Button "Copy" [focusable] +Button "Copy" [focusable] +Button "Copy" [focusable] +Button "Copy" [disabled] +Label "Menu button" +Button "Sort" [focusable, expandable] +Button "Sort" [focusable, expandable] +Button "Sort" [focusable, expandable] +Button "Sort" [focusable, expandable] +Button "Sort" [focusable, expandable] +Button "Sort" [disabled, expandable] +Label "Plate button" +Button "New" [focusable, expandable] +Button "New" [focusable, expandable] +Button "New" [focusable, expandable] +Button "New" [focusable, expandable] +Button "New" [focusable, expandable] +Button "New" [disabled, expandable] +Label "Destructive command" +Button "Delete" [focusable] +Button "Delete" [focusable] +Button "Delete" [focusable] +Button "Delete" [focusable] +Button "Delete" [disabled] +Label "Toggle command" +Button "Details" [focusable] +Button "Details" [focusable] +Button "Details" [focusable] +Button "Details" [focusable, checked] +Button "Details" [focusable] +Button "Details" [disabled] +Label "Icon-only button" +Button "Back" [focusable] +Button "Back" [focusable] +Button "Back" [focusable] +Button "Back" [focusable] +Button "Back" [disabled] +Label "Primary button" +Button "Open" [focusable] +Button "Open" [focusable] +Button "Open" [focusable] +Button "Open" [focusable] +Button "Open" [disabled] +Label "Dialog button" +Button "Cancel" [focusable] +Button "Cancel" [focusable] +Button "Cancel" [focusable] +Button "Cancel" [focusable] +Button "Cancel" [disabled] +Label "Segmented" +RadioGroup "View" + Radio "Tree" [focusable] + Radio "List" [focusable] +RadioGroup "View" + Radio "Tree" [focusable] + Radio "List" [focusable] +RadioGroup "View" + Radio "Tree" [focusable] + Radio "List" [focusable] +RadioGroup "View" + Radio "Tree" [focusable] + Radio "List" [focusable, selected] +RadioGroup "View" + Radio "Tree" [focusable] + Radio "List" [focusable] +RadioGroup "View" [disabled] + Radio "Tree" [disabled] + Radio "List" [disabled] +Label "Tab" +TabList + Tab "Docs" [focusable] + Button "Close tab" + Button "New tab" [focusable] +TabList + Tab "Docs" [focusable] + Button "Close tab" + Button "New tab" [focusable] +TabList + Tab "Docs" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] +Label "Path segment" +Toolbar "Path" + Link "Studio" [focusable] + Button "Subfolders" + Link "Q4" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "Path" + Link "Studio" [focusable] + Button "Subfolders" + Link "Q4" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "Path" + Link "Q4" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Label "Path field" +Toolbar "Path" + Link "Studio" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "Path" +TextInput "Path" [focusable] "C:\\Studio\\Projects" +Label "Text field" +SearchInput "Search" [focusable] "" +SearchInput "Search" [focusable] "" +SearchInput "Search" [focusable] "invoice" + Button "Clear" +SearchInput "Search" [focusable] "" +SearchInput "Search" [disabled] "" +Label "List row" +Label "Section row" +Label "Column header" +Label "Sidebar entry" +Tree + TreeItem "Download" [focusable] level 1 +Tree + TreeItem "Download" [focusable] level 1 +Tree + TreeItem "Download" [focusable, selected] level 1 +Tree + TreeItem "Stick (E:)" [focusable] level 1 +Label "Drive entry" +Tree + TreeItem "Data" [focusable] level 1 +Tree + TreeItem "Data" [focusable] level 1 +Tree + TreeItem "Data" [focusable, selected] level 1 +Tree + TreeItem "Data" [focusable] level 1 +Label "Rail entry" +Tree + TreeItem "Details" [focusable] level 1 +Tree + TreeItem "Details" [focusable] level 1 +Tree + TreeItem "Details" [focusable, selected] level 1 +Label "Resource item" +Label "Strip cell" +Label "Inline row action" +Label "Text link" +Link "Show the row" [focusable] +Link "Show the row" [focusable] +Link "Show the row" [focusable] +Link "Show the row" [focusable] +Label "Chart, focusable" +Image "CPU" [focusable] "" +Image "CPU" [focusable] "35 %, 18 s ago" +Image "CPU" [focusable] "" +Label "Toggle" +Switch "Efficiency" [focusable] off +Switch "Efficiency" [focusable, checked] on +Switch "Efficiency" [disabled] off +Label "Checkbox" +CheckBox "Hidden" [focusable] off +CheckBox "Hidden" [focusable, checked] on +CheckBox "Hidden" [disabled] off +Label "Pinned entry" +Tree + TreeItem "Projects 2026" [focusable] level 1 + Button "Remove from Quick access" +Tree + TreeItem "Projects 2026" [focusable] level 1 + Button "Remove from Quick access" diff --git a/apps/gallery/tests/golden/base/click_states/en-120.png b/apps/gallery/tests/golden/base/click_states/en-120.png new file mode 100644 index 00000000..ec8f78c5 Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/en-120.png differ diff --git a/apps/gallery/tests/golden/base/click_states/en-144-contrast.png b/apps/gallery/tests/golden/base/click_states/en-144-contrast.png new file mode 100644 index 00000000..3976e65e Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/click_states/en-144-ghiaccio.png b/apps/gallery/tests/golden/base/click_states/en-144-ghiaccio.png new file mode 100644 index 00000000..50b82911 Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/en-144-ghiaccio.png differ diff --git a/apps/gallery/tests/golden/base/click_states/en-144-hc.png b/apps/gallery/tests/golden/base/click_states/en-144-hc.png new file mode 100644 index 00000000..aa22e0bd Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/click_states/en-144.png b/apps/gallery/tests/golden/base/click_states/en-144.png new file mode 100644 index 00000000..e4be171a Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/en-144.png differ diff --git a/apps/gallery/tests/golden/base/click_states/en-192.png b/apps/gallery/tests/golden/base/click_states/en-192.png new file mode 100644 index 00000000..d380edc1 Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/en-192.png differ diff --git a/apps/gallery/tests/golden/base/click_states/en-96-hc.png b/apps/gallery/tests/golden/base/click_states/en-96-hc.png new file mode 100644 index 00000000..bd6eb68f Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/click_states/en-96.png b/apps/gallery/tests/golden/base/click_states/en-96.png new file mode 100644 index 00000000..91d3c97b Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/en-96.png differ diff --git a/apps/gallery/tests/golden/base/click_states/it-120.png b/apps/gallery/tests/golden/base/click_states/it-120.png new file mode 100644 index 00000000..eb9e16de Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/it-120.png differ diff --git a/apps/gallery/tests/golden/base/click_states/it-144.png b/apps/gallery/tests/golden/base/click_states/it-144.png new file mode 100644 index 00000000..9abda7ff Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/it-144.png differ diff --git a/apps/gallery/tests/golden/base/click_states/it-192.png b/apps/gallery/tests/golden/base/click_states/it-192.png new file mode 100644 index 00000000..86b4da26 Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/it-192.png differ diff --git a/apps/gallery/tests/golden/base/click_states/it-96.png b/apps/gallery/tests/golden/base/click_states/it-96.png new file mode 100644 index 00000000..9e76d56b Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/it-96.png differ diff --git a/apps/gallery/tests/golden/base/click_states/pseudo-144.png b/apps/gallery/tests/golden/base/click_states/pseudo-144.png new file mode 100644 index 00000000..81c67f5a Binary files /dev/null and b/apps/gallery/tests/golden/base/click_states/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/dialogs/en-120.png b/apps/gallery/tests/golden/base/dialogs/en-120.png index 28a009b7..507aea27 100644 Binary files a/apps/gallery/tests/golden/base/dialogs/en-120.png and b/apps/gallery/tests/golden/base/dialogs/en-120.png differ diff --git a/apps/gallery/tests/golden/base/dialogs/en-144-contrast.png b/apps/gallery/tests/golden/base/dialogs/en-144-contrast.png index 694c5f6d..db6c1b44 100644 Binary files a/apps/gallery/tests/golden/base/dialogs/en-144-contrast.png and b/apps/gallery/tests/golden/base/dialogs/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/dialogs/en-144-hc.png b/apps/gallery/tests/golden/base/dialogs/en-144-hc.png index 1d5c804d..2f77e013 100644 Binary files a/apps/gallery/tests/golden/base/dialogs/en-144-hc.png and b/apps/gallery/tests/golden/base/dialogs/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/dialogs/en-144.png b/apps/gallery/tests/golden/base/dialogs/en-144.png index 0ff4f6db..4f34be39 100644 Binary files a/apps/gallery/tests/golden/base/dialogs/en-144.png and b/apps/gallery/tests/golden/base/dialogs/en-144.png differ diff --git a/apps/gallery/tests/golden/base/dialogs/en-192.png b/apps/gallery/tests/golden/base/dialogs/en-192.png index 79d8f5b7..4e0b0f3f 100644 Binary files a/apps/gallery/tests/golden/base/dialogs/en-192.png and b/apps/gallery/tests/golden/base/dialogs/en-192.png differ diff --git a/apps/gallery/tests/golden/base/dialogs/en-96-hc.png b/apps/gallery/tests/golden/base/dialogs/en-96-hc.png index a8bb85d5..c413a588 100644 Binary files a/apps/gallery/tests/golden/base/dialogs/en-96-hc.png and b/apps/gallery/tests/golden/base/dialogs/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/dialogs/en-96.png b/apps/gallery/tests/golden/base/dialogs/en-96.png index 38becf15..fea85045 100644 Binary files a/apps/gallery/tests/golden/base/dialogs/en-96.png and b/apps/gallery/tests/golden/base/dialogs/en-96.png differ diff --git a/apps/gallery/tests/golden/base/dialogs/it-120.png b/apps/gallery/tests/golden/base/dialogs/it-120.png index c762264c..223d9863 100644 Binary files a/apps/gallery/tests/golden/base/dialogs/it-120.png and b/apps/gallery/tests/golden/base/dialogs/it-120.png differ diff --git a/apps/gallery/tests/golden/base/dialogs/it-144.png b/apps/gallery/tests/golden/base/dialogs/it-144.png index 55eb3c89..19a7509d 100644 Binary files a/apps/gallery/tests/golden/base/dialogs/it-144.png and b/apps/gallery/tests/golden/base/dialogs/it-144.png differ diff --git a/apps/gallery/tests/golden/base/dialogs/it-192.png b/apps/gallery/tests/golden/base/dialogs/it-192.png index c9d82f4b..bf44a3fe 100644 Binary files a/apps/gallery/tests/golden/base/dialogs/it-192.png and b/apps/gallery/tests/golden/base/dialogs/it-192.png differ diff --git a/apps/gallery/tests/golden/base/dialogs/it-96.png b/apps/gallery/tests/golden/base/dialogs/it-96.png index 3b20fc89..776e308f 100644 Binary files a/apps/gallery/tests/golden/base/dialogs/it-96.png and b/apps/gallery/tests/golden/base/dialogs/it-96.png differ diff --git a/apps/gallery/tests/golden/base/dialogs/pseudo-144.png b/apps/gallery/tests/golden/base/dialogs/pseudo-144.png index 5c64c4fa..7535c907 100644 Binary files a/apps/gallery/tests/golden/base/dialogs/pseudo-144.png and b/apps/gallery/tests/golden/base/dialogs/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/fields/a11y.txt b/apps/gallery/tests/golden/base/fields/a11y.txt index 42b59cda..71619d5c 100644 --- a/apps/gallery/tests/golden/base/fields/a11y.txt +++ b/apps/gallery/tests/golden/base/fields/a11y.txt @@ -8,6 +8,12 @@ Label "Search with clear" Label "Search, empty" Label "Composition" Label "Rename" +Label "Click style, rest" +Label "Hover" +Label "Focus, selection" +Label "With text: clear cross" +Label "Unavailable" +Label "Plain, no glyph" TextInput "Name" [focusable] "Quarterly report" TextInput "Name" [focusable] "" TextInput "Name" [focusable] "Quarterly report" @@ -19,3 +25,11 @@ SearchInput "Search" [focusable] "invoice" SearchInput "Search" [focusable] "" TextInput "Name" [focusable] "ab" TextInput "Name" [focusable] "report.docx" +SearchInput "Search" [focusable] "" +SearchInput "Search" [focusable] "" +SearchInput "Search" [focusable] "invoice" + Button "Clear" +SearchInput "Search" [focusable] "invoice" + Button "Clear" +SearchInput "Search" [disabled] "" +TextInput "Name" [focusable] "Quarterly report" diff --git a/apps/gallery/tests/golden/base/fields/en-120.png b/apps/gallery/tests/golden/base/fields/en-120.png index 3cd5575f..e6f8ea49 100644 Binary files a/apps/gallery/tests/golden/base/fields/en-120.png and b/apps/gallery/tests/golden/base/fields/en-120.png differ diff --git a/apps/gallery/tests/golden/base/fields/en-144-contrast.png b/apps/gallery/tests/golden/base/fields/en-144-contrast.png index 9b632ae4..8f1f5f05 100644 Binary files a/apps/gallery/tests/golden/base/fields/en-144-contrast.png and b/apps/gallery/tests/golden/base/fields/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/fields/en-144-hc.png b/apps/gallery/tests/golden/base/fields/en-144-hc.png index bb98f153..5620337d 100644 Binary files a/apps/gallery/tests/golden/base/fields/en-144-hc.png and b/apps/gallery/tests/golden/base/fields/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/fields/en-144.png b/apps/gallery/tests/golden/base/fields/en-144.png index 9312ffc8..07d1b289 100644 Binary files a/apps/gallery/tests/golden/base/fields/en-144.png and b/apps/gallery/tests/golden/base/fields/en-144.png differ diff --git a/apps/gallery/tests/golden/base/fields/en-192.png b/apps/gallery/tests/golden/base/fields/en-192.png index 79d0181c..742627ff 100644 Binary files a/apps/gallery/tests/golden/base/fields/en-192.png and b/apps/gallery/tests/golden/base/fields/en-192.png differ diff --git a/apps/gallery/tests/golden/base/fields/en-96-hc.png b/apps/gallery/tests/golden/base/fields/en-96-hc.png index cdf29274..56c60c3f 100644 Binary files a/apps/gallery/tests/golden/base/fields/en-96-hc.png and b/apps/gallery/tests/golden/base/fields/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/fields/en-96.png b/apps/gallery/tests/golden/base/fields/en-96.png index f4adf1b4..d280ca46 100644 Binary files a/apps/gallery/tests/golden/base/fields/en-96.png and b/apps/gallery/tests/golden/base/fields/en-96.png differ diff --git a/apps/gallery/tests/golden/base/fields/it-120.png b/apps/gallery/tests/golden/base/fields/it-120.png index feaee6fb..b03dbd27 100644 Binary files a/apps/gallery/tests/golden/base/fields/it-120.png and b/apps/gallery/tests/golden/base/fields/it-120.png differ diff --git a/apps/gallery/tests/golden/base/fields/it-144.png b/apps/gallery/tests/golden/base/fields/it-144.png index d05da0ef..cbdfe3f9 100644 Binary files a/apps/gallery/tests/golden/base/fields/it-144.png and b/apps/gallery/tests/golden/base/fields/it-144.png differ diff --git a/apps/gallery/tests/golden/base/fields/it-192.png b/apps/gallery/tests/golden/base/fields/it-192.png index 05eed9cf..6e24e3f5 100644 Binary files a/apps/gallery/tests/golden/base/fields/it-192.png and b/apps/gallery/tests/golden/base/fields/it-192.png differ diff --git a/apps/gallery/tests/golden/base/fields/it-96.png b/apps/gallery/tests/golden/base/fields/it-96.png index 8e3eb013..507ebf35 100644 Binary files a/apps/gallery/tests/golden/base/fields/it-96.png and b/apps/gallery/tests/golden/base/fields/it-96.png differ diff --git a/apps/gallery/tests/golden/base/fields/pseudo-144.png b/apps/gallery/tests/golden/base/fields/pseudo-144.png index 2c11380e..fd9e68ab 100644 Binary files a/apps/gallery/tests/golden/base/fields/pseudo-144.png and b/apps/gallery/tests/golden/base/fields/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/glyphs/en-120.png b/apps/gallery/tests/golden/base/glyphs/en-120.png index 89f766ef..38a19efb 100644 Binary files a/apps/gallery/tests/golden/base/glyphs/en-120.png and b/apps/gallery/tests/golden/base/glyphs/en-120.png differ diff --git a/apps/gallery/tests/golden/base/glyphs/en-144.png b/apps/gallery/tests/golden/base/glyphs/en-144.png index 4dd761e0..b9d57609 100644 Binary files a/apps/gallery/tests/golden/base/glyphs/en-144.png and b/apps/gallery/tests/golden/base/glyphs/en-144.png differ diff --git a/apps/gallery/tests/golden/base/glyphs/en-192.png b/apps/gallery/tests/golden/base/glyphs/en-192.png index 26902e1c..1c2ecbb1 100644 Binary files a/apps/gallery/tests/golden/base/glyphs/en-192.png and b/apps/gallery/tests/golden/base/glyphs/en-192.png differ diff --git a/apps/gallery/tests/golden/base/glyphs/en-96.png b/apps/gallery/tests/golden/base/glyphs/en-96.png index 5fe71a40..11682965 100644 Binary files a/apps/gallery/tests/golden/base/glyphs/en-96.png and b/apps/gallery/tests/golden/base/glyphs/en-96.png differ diff --git a/apps/gallery/tests/golden/base/index/a11y.txt b/apps/gallery/tests/golden/base/index/a11y.txt index dc733fe5..b04912e7 100644 --- a/apps/gallery/tests/golden/base/index/a11y.txt +++ b/apps/gallery/tests/golden/base/index/a11y.txt @@ -23,3 +23,5 @@ Tree TreeItem "caption" [focusable] level 1 TreeItem "charts" [focusable] level 1 TreeItem "properties" [focusable] level 1 + TreeItem "art" [focusable] level 1 + TreeItem "click_states" [focusable] level 1 diff --git a/apps/gallery/tests/golden/base/index/en-120.png b/apps/gallery/tests/golden/base/index/en-120.png index c0359469..8b3dfa19 100644 Binary files a/apps/gallery/tests/golden/base/index/en-120.png and b/apps/gallery/tests/golden/base/index/en-120.png differ diff --git a/apps/gallery/tests/golden/base/index/en-144-contrast.png b/apps/gallery/tests/golden/base/index/en-144-contrast.png index 5a486eea..b4395a27 100644 Binary files a/apps/gallery/tests/golden/base/index/en-144-contrast.png and b/apps/gallery/tests/golden/base/index/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/index/en-144-hc.png b/apps/gallery/tests/golden/base/index/en-144-hc.png index c7db71bc..7692fc36 100644 Binary files a/apps/gallery/tests/golden/base/index/en-144-hc.png and b/apps/gallery/tests/golden/base/index/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/index/en-144.png b/apps/gallery/tests/golden/base/index/en-144.png index 8042342b..a74089d2 100644 Binary files a/apps/gallery/tests/golden/base/index/en-144.png and b/apps/gallery/tests/golden/base/index/en-144.png differ diff --git a/apps/gallery/tests/golden/base/index/en-192.png b/apps/gallery/tests/golden/base/index/en-192.png index d1e72dfd..3b02f9f0 100644 Binary files a/apps/gallery/tests/golden/base/index/en-192.png and b/apps/gallery/tests/golden/base/index/en-192.png differ diff --git a/apps/gallery/tests/golden/base/index/en-96-hc.png b/apps/gallery/tests/golden/base/index/en-96-hc.png index b4529f16..41bd81be 100644 Binary files a/apps/gallery/tests/golden/base/index/en-96-hc.png and b/apps/gallery/tests/golden/base/index/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/index/en-96.png b/apps/gallery/tests/golden/base/index/en-96.png index 60bfd10d..46260bf7 100644 Binary files a/apps/gallery/tests/golden/base/index/en-96.png and b/apps/gallery/tests/golden/base/index/en-96.png differ diff --git a/apps/gallery/tests/golden/base/index/it-120.png b/apps/gallery/tests/golden/base/index/it-120.png index c0359469..8b3dfa19 100644 Binary files a/apps/gallery/tests/golden/base/index/it-120.png and b/apps/gallery/tests/golden/base/index/it-120.png differ diff --git a/apps/gallery/tests/golden/base/index/it-144.png b/apps/gallery/tests/golden/base/index/it-144.png index 8042342b..a74089d2 100644 Binary files a/apps/gallery/tests/golden/base/index/it-144.png and b/apps/gallery/tests/golden/base/index/it-144.png differ diff --git a/apps/gallery/tests/golden/base/index/it-192.png b/apps/gallery/tests/golden/base/index/it-192.png index d1e72dfd..3b02f9f0 100644 Binary files a/apps/gallery/tests/golden/base/index/it-192.png and b/apps/gallery/tests/golden/base/index/it-192.png differ diff --git a/apps/gallery/tests/golden/base/index/it-96.png b/apps/gallery/tests/golden/base/index/it-96.png index 60bfd10d..46260bf7 100644 Binary files a/apps/gallery/tests/golden/base/index/it-96.png and b/apps/gallery/tests/golden/base/index/it-96.png differ diff --git a/apps/gallery/tests/golden/base/index/pseudo-144.png b/apps/gallery/tests/golden/base/index/pseudo-144.png index 8042342b..a74089d2 100644 Binary files a/apps/gallery/tests/golden/base/index/pseudo-144.png and b/apps/gallery/tests/golden/base/index/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/menus/en-120.png b/apps/gallery/tests/golden/base/menus/en-120.png index 9f09a18b..3ee5633a 100644 Binary files a/apps/gallery/tests/golden/base/menus/en-120.png and b/apps/gallery/tests/golden/base/menus/en-120.png differ diff --git a/apps/gallery/tests/golden/base/menus/en-144-contrast.png b/apps/gallery/tests/golden/base/menus/en-144-contrast.png index e05f1379..bf450421 100644 Binary files a/apps/gallery/tests/golden/base/menus/en-144-contrast.png and b/apps/gallery/tests/golden/base/menus/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/menus/en-144.png b/apps/gallery/tests/golden/base/menus/en-144.png index d29d2994..aa2c85f1 100644 Binary files a/apps/gallery/tests/golden/base/menus/en-144.png and b/apps/gallery/tests/golden/base/menus/en-144.png differ diff --git a/apps/gallery/tests/golden/base/menus/en-192.png b/apps/gallery/tests/golden/base/menus/en-192.png index dcf6411a..18b1df7a 100644 Binary files a/apps/gallery/tests/golden/base/menus/en-192.png and b/apps/gallery/tests/golden/base/menus/en-192.png differ diff --git a/apps/gallery/tests/golden/base/menus/en-96.png b/apps/gallery/tests/golden/base/menus/en-96.png index 4d1bf92b..d07cb5bd 100644 Binary files a/apps/gallery/tests/golden/base/menus/en-96.png and b/apps/gallery/tests/golden/base/menus/en-96.png differ diff --git a/apps/gallery/tests/golden/base/menus/it-120.png b/apps/gallery/tests/golden/base/menus/it-120.png index 37e89ce5..75c5ef42 100644 Binary files a/apps/gallery/tests/golden/base/menus/it-120.png and b/apps/gallery/tests/golden/base/menus/it-120.png differ diff --git a/apps/gallery/tests/golden/base/menus/it-144.png b/apps/gallery/tests/golden/base/menus/it-144.png index e160e1fb..4971dc57 100644 Binary files a/apps/gallery/tests/golden/base/menus/it-144.png and b/apps/gallery/tests/golden/base/menus/it-144.png differ diff --git a/apps/gallery/tests/golden/base/menus/it-192.png b/apps/gallery/tests/golden/base/menus/it-192.png index 16c8f64e..ff6a1d71 100644 Binary files a/apps/gallery/tests/golden/base/menus/it-192.png and b/apps/gallery/tests/golden/base/menus/it-192.png differ diff --git a/apps/gallery/tests/golden/base/menus/it-96.png b/apps/gallery/tests/golden/base/menus/it-96.png index 743520bc..b0199d42 100644 Binary files a/apps/gallery/tests/golden/base/menus/it-96.png and b/apps/gallery/tests/golden/base/menus/it-96.png differ diff --git a/apps/gallery/tests/golden/base/menus/pseudo-144.png b/apps/gallery/tests/golden/base/menus/pseudo-144.png index 90d54cc8..63d9f3ab 100644 Binary files a/apps/gallery/tests/golden/base/menus/pseudo-144.png and b/apps/gallery/tests/golden/base/menus/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/mock_files/a11y.txt b/apps/gallery/tests/golden/base/mock_files/a11y.txt index aa51835a..5eedb633 100644 --- a/apps/gallery/tests/golden/base/mock_files/a11y.txt +++ b/apps/gallery/tests/golden/base/mock_files/a11y.txt @@ -1,70 +1,96 @@ TabList - Tab "Downloads" [focusable, selected] + Tab "Projects 2026" [focusable, selected] Button "Close tab" - Tab "Documents" [focusable] + Tab "Downloads" [focusable] Button "Close tab" Tab "Pictures" [focusable] Button "Close tab" - Tab "Projects" [focusable] - Button "Close tab" Button "New tab" [focusable] -Toolbar - Button "Back" [focusable] - Button "Forward" [focusable] - Button "Up" [focusable] -SearchInput "Filter" [focusable] "" +Button "Back to Studio Alt+Left" [focusable] +Button "Forward" [disabled] +Button "Up" [focusable] +Button "Refresh" [focusable] +SearchInput "Search" [focusable] "" +Button "Open" [focusable] +Button "Open with" [focusable, expandable] Toolbar "Path" - Link "Local Disk (C:)" [focusable] + Link "Documents" [focusable] Button "Subfolders" - Link "Users" [focusable] + Link "Studio" [focusable] Button "Subfolders" - Link "Downloads" [focusable] + Link "Projects 2026" [focusable] Button "Subfolders" Button "Refresh" [focusable] -Splitter "Resize panes" [focusable] 20.833334% +Toolbar "Commands" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Splitter "Resize panes" [focusable] 20% Tree - Label "Pinned" + TreeItem "Home" [focusable] level 1 + Label "Quick access" TreeItem "Desktop" [focusable] level 1 - TreeItem "Downloads" [focusable, selected] level 1 - TreeItem "Documents" [focusable] level 1 + TreeItem "Downloads" [focusable] level 1 + TreeItem "Documents" [focusable, selected] level 1 TreeItem "Pictures" [focusable] level 1 + TreeItem "Music" [focusable] level 1 + TreeItem "Videos" [focusable] level 1 + TreeItem "Projects 2026" [focusable] level 1 + Button "Remove from Quick access" Label "This PC" - TreeItem "Local Disk (C:)" [focusable] level 1 + TreeItem "System (C:)" [focusable] level 1 TreeItem "Data (D:)" [focusable] level 1 + TreeItem "Stick (E:)" [focusable] level 1 + Label "Network" + TreeItem "Archive (Z:)" [focusable] level 1 + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 ColumnHeader "Name" [focusable] +ColumnHeader "Modified" [focusable] +ColumnHeader "Type" [focusable] ColumnHeader "Size" [focusable] -Table "Files" 3 of 100000 - Row "item 0.txt" [focusable] 1 of 100000 - Row "item 1.rs" [focusable, selected] 2 of 100000 - Row "item 2.png" [focusable, selected] 3 of 100000 - Row "item 3.docx" [focusable, selected] 4 of 100000 - Row "A long descriptive file name that cannot fit its column 4.zip" [focusable] 5 of 100000 - Row "item 5.txt" [focusable] 6 of 100000 - Row "item 6.rs" [focusable] 7 of 100000 - Row "item 7.png" [focusable] 8 of 100000 - Row "item 8.docx" [focusable] 9 of 100000 - Row "item 9.zip" [focusable] 10 of 100000 - Row "item 10.txt" [focusable] 11 of 100000 - Row "item 11.rs" [focusable] 12 of 100000 - Row "item 12.png" [focusable] 13 of 100000 - Row "A long descriptive file name that cannot fit its column 13.docx" [focusable] 14 of 100000 - Row "item 14.zip" [focusable] 15 of 100000 - Row "item 15.txt" [focusable] 16 of 100000 - Row "item 16.rs" [focusable] 17 of 100000 - Row "item 17.png" [focusable] 18 of 100000 - Row "item 18.docx" [focusable] 19 of 100000 - Row "item 19.zip" [focusable] 20 of 100000 - Row "item 20.txt" [focusable] 21 of 100000 - Row "item 21.rs" [focusable] 22 of 100000 - Row "A long descriptive file name that cannot fit its column 22.png" [focusable] 23 of 100000 - Row "item 23.docx" [focusable] 24 of 100000 - Row "item 24.zip" [focusable] 25 of 100000 - Row "item 25.txt" [focusable] 26 of 100000 - Row "item 26.rs" [focusable] 27 of 100000 - Row "item 27.png" [focusable] 28 of 100000 - Row "item 28.docx" [focusable] 29 of 100000 - Row "item 29.zip" [focusable] 30 of 100000 - Row "item 30.txt" [focusable] 31 of 100000 - Row "A long descriptive file name that cannot fit its column 31.rs" [focusable] 32 of 100000 - Row "item 32.png" [focusable] 33 of 100000 -Status "100,000 items · 3 selected" +Table "Files" 13 of 100000 + Row "Drafts" [focusable] 1 of 100000 + Row "Contracts" [focusable] 2 of 100000 + Row "Site photos" [focusable] 3 of 100000 + Row "Estimates" [focusable] 4 of 100000 + Row "Invoices archive 2025.zip" [focusable] 5 of 100000 + Row "Budget 2026.xlsx" [focusable] 6 of 100000 + Row "Sensor data.csv" [focusable] 7 of 100000 + Row "setup-tool-1.4.2.exe" [focusable] 8 of 100000 + Row "Notes.txt" [focusable] 9 of 100000 + Row "Floor plan.png" [focusable] 10 of 100000 + Row "Client presentation.pptx" [focusable] 11 of 100000 + Row "Final report v2.pdf" [focusable] 12 of 100000 + Row "Final report v3.docx" [focusable, selected] 13 of 100000 + Row "Meeting 14 november.m4a" [focusable] 14 of 100000 + Row "Site walkthrough.mp4" [focusable] 15 of 100000 + Row "Document 15.mp4" [focusable] 16 of 100000 + Row "Document 16.m4a" [focusable] 17 of 100000 + Row "Document 17.pptx" [focusable] 18 of 100000 + Row "Document 18.txt" [focusable] 19 of 100000 + Row "Document 19.pdf" [focusable] 20 of 100000 + Row "Document 20.png" [focusable] 21 of 100000 + Row "Document 21.docx" [focusable] 22 of 100000 + Row "A long descriptive file name that cannot fit its column 22.zip" [focusable] 23 of 100000 + Row "Document 23.xlsx" [focusable] 24 of 100000 + Row "Document 24.mp4" [focusable] 25 of 100000 + Row "Document 25.m4a" [focusable] 26 of 100000 + Row "Document 26.pptx" [focusable] 27 of 100000 + Row "Document 27.txt" [focusable] 28 of 100000 + Row "Document 28.pdf" [focusable] 29 of 100000 + Row "Document 29.png" [focusable] 30 of 100000 + Row "Document 30.docx" [focusable] 31 of 100000 + Row "A long descriptive file name that cannot fit its column 31.zip" [focusable] 32 of 100000 + Row "Document 32.xlsx" [focusable] 33 of 100000 + Row "Document 33.mp4" [focusable] 34 of 100000 + Row "Document 34.m4a" [focusable] 35 of 100000 +Status "100,000 items · 1 selected, 1.24 MB" diff --git a/apps/gallery/tests/golden/base/mock_files/en-120.png b/apps/gallery/tests/golden/base/mock_files/en-120.png index 757406af..9785bee0 100644 Binary files a/apps/gallery/tests/golden/base/mock_files/en-120.png and b/apps/gallery/tests/golden/base/mock_files/en-120.png differ diff --git a/apps/gallery/tests/golden/base/mock_files/en-144-contrast.png b/apps/gallery/tests/golden/base/mock_files/en-144-contrast.png index a97a1266..b49f58c8 100644 Binary files a/apps/gallery/tests/golden/base/mock_files/en-144-contrast.png and b/apps/gallery/tests/golden/base/mock_files/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/mock_files/en-144-hc.png b/apps/gallery/tests/golden/base/mock_files/en-144-hc.png index 10d51495..621f1b08 100644 Binary files a/apps/gallery/tests/golden/base/mock_files/en-144-hc.png and b/apps/gallery/tests/golden/base/mock_files/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/mock_files/en-144.png b/apps/gallery/tests/golden/base/mock_files/en-144.png index 6fd05deb..977487f0 100644 Binary files a/apps/gallery/tests/golden/base/mock_files/en-144.png and b/apps/gallery/tests/golden/base/mock_files/en-144.png differ diff --git a/apps/gallery/tests/golden/base/mock_files/en-192.png b/apps/gallery/tests/golden/base/mock_files/en-192.png index 4db5f317..59bfdf1e 100644 Binary files a/apps/gallery/tests/golden/base/mock_files/en-192.png and b/apps/gallery/tests/golden/base/mock_files/en-192.png differ diff --git a/apps/gallery/tests/golden/base/mock_files/en-96-hc.png b/apps/gallery/tests/golden/base/mock_files/en-96-hc.png index 0163c87a..e59ab23d 100644 Binary files a/apps/gallery/tests/golden/base/mock_files/en-96-hc.png and b/apps/gallery/tests/golden/base/mock_files/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/mock_files/en-96.png b/apps/gallery/tests/golden/base/mock_files/en-96.png index 86425540..a93205ed 100644 Binary files a/apps/gallery/tests/golden/base/mock_files/en-96.png and b/apps/gallery/tests/golden/base/mock_files/en-96.png differ diff --git a/apps/gallery/tests/golden/base/mock_files/it-120.png b/apps/gallery/tests/golden/base/mock_files/it-120.png index c898e026..6042b396 100644 Binary files a/apps/gallery/tests/golden/base/mock_files/it-120.png and b/apps/gallery/tests/golden/base/mock_files/it-120.png differ diff --git a/apps/gallery/tests/golden/base/mock_files/it-144.png b/apps/gallery/tests/golden/base/mock_files/it-144.png index 5eb48159..80acc8bb 100644 Binary files a/apps/gallery/tests/golden/base/mock_files/it-144.png and b/apps/gallery/tests/golden/base/mock_files/it-144.png differ diff --git a/apps/gallery/tests/golden/base/mock_files/it-192.png b/apps/gallery/tests/golden/base/mock_files/it-192.png index 810d7fb9..13ec2103 100644 Binary files a/apps/gallery/tests/golden/base/mock_files/it-192.png and b/apps/gallery/tests/golden/base/mock_files/it-192.png differ diff --git a/apps/gallery/tests/golden/base/mock_files/it-96.png b/apps/gallery/tests/golden/base/mock_files/it-96.png index 36ea8f7f..604345ea 100644 Binary files a/apps/gallery/tests/golden/base/mock_files/it-96.png and b/apps/gallery/tests/golden/base/mock_files/it-96.png differ diff --git a/apps/gallery/tests/golden/base/mock_files/pseudo-144.png b/apps/gallery/tests/golden/base/mock_files/pseudo-144.png index 8fdb82be..57eb1c58 100644 Binary files a/apps/gallery/tests/golden/base/mock_files/pseudo-144.png and b/apps/gallery/tests/golden/base/mock_files/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/mock_tasks/a11y.txt b/apps/gallery/tests/golden/base/mock_tasks/a11y.txt index 081b987c..4ef89be1 100644 --- a/apps/gallery/tests/golden/base/mock_tasks/a11y.txt +++ b/apps/gallery/tests/golden/base/mock_tasks/a11y.txt @@ -1,34 +1,49 @@ -Table "Processes" [focusable] 0 of 302 - Row "Apps" [focusable] 1 of 302 - Row "proc-0" [focusable] 2 of 302 - Row "proc-1" [focusable] 3 of 302 - Row "proc-2" [focusable] 4 of 302 - Row "proc-3" [focusable] 5 of 302 - Row "proc-4" [focusable, expandable, expanded] 6 of 302 - Row "proc-5" [focusable] 7 of 302 - Row "proc-6" [focusable] 8 of 302 - Row "proc-7" [focusable] 9 of 302 - Row "proc-8" [focusable] 10 of 302 - Row "proc-9" [focusable] 11 of 302 - Row "proc-10" [focusable] 12 of 302 - Row "proc-11" [focusable] 13 of 302 - Row "proc-12" [focusable] 14 of 302 - Row "proc-13" [focusable] 15 of 302 - Row "proc-14" [focusable, expandable, expanded] 16 of 302 - Row "proc-15" [focusable] 17 of 302 - Row "proc-16" [focusable] 18 of 302 - Row "proc-17" [focusable] 19 of 302 - Row "proc-18" [focusable] 20 of 302 - Row "proc-19" [focusable] 21 of 302 - Row "proc-20" [focusable] 22 of 302 - Row "proc-21" [focusable] 23 of 302 - Row "proc-22" [focusable] 24 of 302 - Row "proc-23" [focusable] 25 of 302 - Row "proc-24" [focusable, expandable, expanded] 26 of 302 - Row "proc-25" [focusable] 27 of 302 - Row "proc-26" [focusable] 28 of 302 - Row "proc-27" [focusable] 29 of 302 - Row "proc-28" [focusable] 30 of 302 - Row "proc-29" [focusable] 31 of 302 - Row "proc-30" [focusable] 32 of 302 - Row "proc-31" [focusable] 33 of 302 +Button "Collapse to icons Ctrl+B" [focusable] +SearchInput "Search" [focusable] "" +RadioGroup "View" + Radio "Groups" [focusable, selected] + Radio "Tree" [focusable] + Radio "List" [focusable] +Button "Run new task" [focusable] +Link "Show the row" [focusable] +Tree + TreeItem "Processes" [focusable, selected] level 1 + TreeItem "Performance" [focusable] level 1 + TreeItem "Details" [focusable] level 1 + TreeItem "Settings" [focusable] level 1 +Toolbar "Commands" + Button "Close Ember" [focusable] + Button "End task" [focusable] + Button "Efficiency" [focusable] + Button "Open location" [focusable] + Button "Properties" [focusable] + Button "More" [focusable, expandable] +ColumnHeader "Name" [focusable] +ColumnHeader "Status" [focusable] +ColumnHeader "CPU" [focusable] +ColumnHeader "Memory" [focusable] +ColumnHeader "I/O" [focusable] +Table "Processes" 2 of 21 + Row "Apps" [focusable, expandable, expanded] 1 of 21 + Row "Ember" [focusable, selected, expandable, expanded] 2 of 21 + Row "Ember" [focusable] 3 of 21 + Row "Ember" [focusable] 4 of 21 + Row "Ember" [focusable] 5 of 21 + Row "Prism" [focusable, expandable] 6 of 21 + Row "Orbit" [focusable, expandable] 7 of 21 + Row "Quill" [focusable] 8 of 21 + Row "Harbor" [focusable, expandable] 9 of 21 + Row "Ledger" [focusable] 10 of 21 + Row "Notes" [focusable] 11 of 21 + Row "In background" [focusable, expandable, expanded] 12 of 21 + Row "Scanner Service Executable" [focusable] 13 of 21 + Row "Syncer" [focusable, expandable] 14 of 21 + Row "Cobalt Agent" [focusable, expandable] 15 of 21 + Row "Lantern Updater" [focusable] 16 of 21 + Row "Part of Windows" [focusable, expandable, expanded] 17 of 21 + Row "Window Manager" [focusable] 18 of 21 + Row "Service Host" [focusable, expandable] 19 of 21 + Row "Display Driver" [focusable] 20 of 21 + Row "Search Indexer" [focusable] 21 of 21 +Status "142 processes · 2,318 threads" +Button "Pause" [focusable] diff --git a/apps/gallery/tests/golden/base/mock_tasks/en-120.png b/apps/gallery/tests/golden/base/mock_tasks/en-120.png index faaf6764..84cce9a7 100644 Binary files a/apps/gallery/tests/golden/base/mock_tasks/en-120.png and b/apps/gallery/tests/golden/base/mock_tasks/en-120.png differ diff --git a/apps/gallery/tests/golden/base/mock_tasks/en-144-contrast.png b/apps/gallery/tests/golden/base/mock_tasks/en-144-contrast.png index ff959b2f..40559977 100644 Binary files a/apps/gallery/tests/golden/base/mock_tasks/en-144-contrast.png and b/apps/gallery/tests/golden/base/mock_tasks/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/mock_tasks/en-144-hc.png b/apps/gallery/tests/golden/base/mock_tasks/en-144-hc.png index d1a6b294..c804883e 100644 Binary files a/apps/gallery/tests/golden/base/mock_tasks/en-144-hc.png and b/apps/gallery/tests/golden/base/mock_tasks/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/mock_tasks/en-144.png b/apps/gallery/tests/golden/base/mock_tasks/en-144.png index ff959b2f..60fb2ace 100644 Binary files a/apps/gallery/tests/golden/base/mock_tasks/en-144.png and b/apps/gallery/tests/golden/base/mock_tasks/en-144.png differ diff --git a/apps/gallery/tests/golden/base/mock_tasks/en-192.png b/apps/gallery/tests/golden/base/mock_tasks/en-192.png index 6e32bc57..65e023f5 100644 Binary files a/apps/gallery/tests/golden/base/mock_tasks/en-192.png and b/apps/gallery/tests/golden/base/mock_tasks/en-192.png differ diff --git a/apps/gallery/tests/golden/base/mock_tasks/en-96-hc.png b/apps/gallery/tests/golden/base/mock_tasks/en-96-hc.png index b69e516d..194540e0 100644 Binary files a/apps/gallery/tests/golden/base/mock_tasks/en-96-hc.png and b/apps/gallery/tests/golden/base/mock_tasks/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/mock_tasks/en-96.png b/apps/gallery/tests/golden/base/mock_tasks/en-96.png index 4184f351..18919ceb 100644 Binary files a/apps/gallery/tests/golden/base/mock_tasks/en-96.png and b/apps/gallery/tests/golden/base/mock_tasks/en-96.png differ diff --git a/apps/gallery/tests/golden/base/mock_tasks/it-120.png b/apps/gallery/tests/golden/base/mock_tasks/it-120.png index ed0fe2a6..d4f6fb77 100644 Binary files a/apps/gallery/tests/golden/base/mock_tasks/it-120.png and b/apps/gallery/tests/golden/base/mock_tasks/it-120.png differ diff --git a/apps/gallery/tests/golden/base/mock_tasks/it-144.png b/apps/gallery/tests/golden/base/mock_tasks/it-144.png index b4f41e54..43c7b51e 100644 Binary files a/apps/gallery/tests/golden/base/mock_tasks/it-144.png and b/apps/gallery/tests/golden/base/mock_tasks/it-144.png differ diff --git a/apps/gallery/tests/golden/base/mock_tasks/it-192.png b/apps/gallery/tests/golden/base/mock_tasks/it-192.png index 92d964dc..3f8cb35f 100644 Binary files a/apps/gallery/tests/golden/base/mock_tasks/it-192.png and b/apps/gallery/tests/golden/base/mock_tasks/it-192.png differ diff --git a/apps/gallery/tests/golden/base/mock_tasks/it-96.png b/apps/gallery/tests/golden/base/mock_tasks/it-96.png index cc82b210..e16dff88 100644 Binary files a/apps/gallery/tests/golden/base/mock_tasks/it-96.png and b/apps/gallery/tests/golden/base/mock_tasks/it-96.png differ diff --git a/apps/gallery/tests/golden/base/mock_tasks/pseudo-144.png b/apps/gallery/tests/golden/base/mock_tasks/pseudo-144.png index ff959b2f..65e56836 100644 Binary files a/apps/gallery/tests/golden/base/mock_tasks/pseudo-144.png and b/apps/gallery/tests/golden/base/mock_tasks/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/path/a11y.txt b/apps/gallery/tests/golden/base/path/a11y.txt index e3d164d0..d43756c8 100644 --- a/apps/gallery/tests/golden/base/path/a11y.txt +++ b/apps/gallery/tests/golden/base/path/a11y.txt @@ -41,3 +41,70 @@ Toolbar "Path" Button "Refresh" [focusable] Toolbar "Path" TextInput "Path" [focusable] "C:\\Users\\Projects\\Design" +Toolbar "Path" + Link "Local Disk (C:)" [focusable] + Button "Subfolders" + Link "Users" [focusable] + Button "Subfolders" + Link "Projects" [focusable] + Button "Subfolders" + Link "Design" [focusable] + Button "Subfolders" + Link "Reports" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "Path" + Link "Local Disk (C:)" [focusable] + Button "Subfolders" + Link "More" [focusable] + Link "2026" [focusable] + Button "Subfolders" + Link "Final" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "Path" + Link "Local Disk (C:)" [focusable] + Button "Subfolders" + Link "Users" [focusable] + Button "Subfolders" + Link "Projects" [focusable] + Button "Subfolders" + Link "Design" [focusable] + Button "Subfolders" + Link "Reports" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "Path" + Link "Local Disk (C:)" [focusable] + Button "Subfolders" + Link "Users" [focusable] + Button "Subfolders" + Link "Projects" [focusable] + Button "Subfolders" + Link "Design" [focusable] + Button "Subfolders" + Link "Reports" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "Path" + Link "Local Disk (C:)" [focusable] + Button "Subfolders" + Link "Users" [focusable] + Button "Subfolders" + Link "Projects" [focusable] + Button "Subfolders" + Link "Design" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "Path" + Link "Local Disk (C:)" [focusable] + Button "Subfolders" + Link "Users" [focusable] + Button "Subfolders" + Link "Projects" [focusable] + Button "Subfolders" + Link "Design" [focusable] + Button "Subfolders" + Button "Refresh" [focusable] +Toolbar "Path" +TextInput "Path" [focusable] "C:\\Users\\Projects\\Design" diff --git a/apps/gallery/tests/golden/base/path/en-120.png b/apps/gallery/tests/golden/base/path/en-120.png index 969f835c..fbd48e92 100644 Binary files a/apps/gallery/tests/golden/base/path/en-120.png and b/apps/gallery/tests/golden/base/path/en-120.png differ diff --git a/apps/gallery/tests/golden/base/path/en-144-contrast.png b/apps/gallery/tests/golden/base/path/en-144-contrast.png index 45b77346..bc46bb26 100644 Binary files a/apps/gallery/tests/golden/base/path/en-144-contrast.png and b/apps/gallery/tests/golden/base/path/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/path/en-144-hc.png b/apps/gallery/tests/golden/base/path/en-144-hc.png index ed738c64..7cf7da19 100644 Binary files a/apps/gallery/tests/golden/base/path/en-144-hc.png and b/apps/gallery/tests/golden/base/path/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/path/en-144.png b/apps/gallery/tests/golden/base/path/en-144.png index be18dcb6..eb92ba5b 100644 Binary files a/apps/gallery/tests/golden/base/path/en-144.png and b/apps/gallery/tests/golden/base/path/en-144.png differ diff --git a/apps/gallery/tests/golden/base/path/en-192.png b/apps/gallery/tests/golden/base/path/en-192.png index b73b7d1b..4a6705be 100644 Binary files a/apps/gallery/tests/golden/base/path/en-192.png and b/apps/gallery/tests/golden/base/path/en-192.png differ diff --git a/apps/gallery/tests/golden/base/path/en-96-hc.png b/apps/gallery/tests/golden/base/path/en-96-hc.png index 056867cd..347d7e56 100644 Binary files a/apps/gallery/tests/golden/base/path/en-96-hc.png and b/apps/gallery/tests/golden/base/path/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/path/en-96.png b/apps/gallery/tests/golden/base/path/en-96.png index adf66031..5521c661 100644 Binary files a/apps/gallery/tests/golden/base/path/en-96.png and b/apps/gallery/tests/golden/base/path/en-96.png differ diff --git a/apps/gallery/tests/golden/base/path/it-120.png b/apps/gallery/tests/golden/base/path/it-120.png index 3ac9e414..405d4e90 100644 Binary files a/apps/gallery/tests/golden/base/path/it-120.png and b/apps/gallery/tests/golden/base/path/it-120.png differ diff --git a/apps/gallery/tests/golden/base/path/it-144.png b/apps/gallery/tests/golden/base/path/it-144.png index 0a21fc61..4e934d09 100644 Binary files a/apps/gallery/tests/golden/base/path/it-144.png and b/apps/gallery/tests/golden/base/path/it-144.png differ diff --git a/apps/gallery/tests/golden/base/path/it-192.png b/apps/gallery/tests/golden/base/path/it-192.png index e7d61495..9a56c32c 100644 Binary files a/apps/gallery/tests/golden/base/path/it-192.png and b/apps/gallery/tests/golden/base/path/it-192.png differ diff --git a/apps/gallery/tests/golden/base/path/it-96.png b/apps/gallery/tests/golden/base/path/it-96.png index 3ecba3e1..266cc955 100644 Binary files a/apps/gallery/tests/golden/base/path/it-96.png and b/apps/gallery/tests/golden/base/path/it-96.png differ diff --git a/apps/gallery/tests/golden/base/path/pseudo-144.png b/apps/gallery/tests/golden/base/path/pseudo-144.png index e8aa429c..0658cd3f 100644 Binary files a/apps/gallery/tests/golden/base/path/pseudo-144.png and b/apps/gallery/tests/golden/base/path/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/progress/a11y.txt b/apps/gallery/tests/golden/base/progress/a11y.txt index 8b697c3a..89bc3166 100644 --- a/apps/gallery/tests/golden/base/progress/a11y.txt +++ b/apps/gallery/tests/golden/base/progress/a11y.txt @@ -3,3 +3,6 @@ ProgressIndicator 40% ProgressIndicator 100% ProgressIndicator ProgressIndicator +ProgressIndicator 40% +ProgressIndicator 95% +ProgressIndicator 100% diff --git a/apps/gallery/tests/golden/base/progress/en-120.png b/apps/gallery/tests/golden/base/progress/en-120.png index 70ee91ac..4f13fd48 100644 Binary files a/apps/gallery/tests/golden/base/progress/en-120.png and b/apps/gallery/tests/golden/base/progress/en-120.png differ diff --git a/apps/gallery/tests/golden/base/progress/en-144-contrast.png b/apps/gallery/tests/golden/base/progress/en-144-contrast.png index 4d7d5427..8484e53d 100644 Binary files a/apps/gallery/tests/golden/base/progress/en-144-contrast.png and b/apps/gallery/tests/golden/base/progress/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/progress/en-144-hc.png b/apps/gallery/tests/golden/base/progress/en-144-hc.png index 3a38ac8f..f968c8ba 100644 Binary files a/apps/gallery/tests/golden/base/progress/en-144-hc.png and b/apps/gallery/tests/golden/base/progress/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/progress/en-144.png b/apps/gallery/tests/golden/base/progress/en-144.png index 4d7d5427..8484e53d 100644 Binary files a/apps/gallery/tests/golden/base/progress/en-144.png and b/apps/gallery/tests/golden/base/progress/en-144.png differ diff --git a/apps/gallery/tests/golden/base/progress/en-192.png b/apps/gallery/tests/golden/base/progress/en-192.png index d3ccb9df..743462ee 100644 Binary files a/apps/gallery/tests/golden/base/progress/en-192.png and b/apps/gallery/tests/golden/base/progress/en-192.png differ diff --git a/apps/gallery/tests/golden/base/progress/en-96-hc.png b/apps/gallery/tests/golden/base/progress/en-96-hc.png index 04158398..4f891838 100644 Binary files a/apps/gallery/tests/golden/base/progress/en-96-hc.png and b/apps/gallery/tests/golden/base/progress/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/progress/en-96.png b/apps/gallery/tests/golden/base/progress/en-96.png index e2f387a4..7fc04565 100644 Binary files a/apps/gallery/tests/golden/base/progress/en-96.png and b/apps/gallery/tests/golden/base/progress/en-96.png differ diff --git a/apps/gallery/tests/golden/base/progress/it-120.png b/apps/gallery/tests/golden/base/progress/it-120.png index bec675d9..8b46b4f8 100644 Binary files a/apps/gallery/tests/golden/base/progress/it-120.png and b/apps/gallery/tests/golden/base/progress/it-120.png differ diff --git a/apps/gallery/tests/golden/base/progress/it-144.png b/apps/gallery/tests/golden/base/progress/it-144.png index 81bd2e0b..4269ebd8 100644 Binary files a/apps/gallery/tests/golden/base/progress/it-144.png and b/apps/gallery/tests/golden/base/progress/it-144.png differ diff --git a/apps/gallery/tests/golden/base/progress/it-192.png b/apps/gallery/tests/golden/base/progress/it-192.png index bd39d4ba..bb6a18fa 100644 Binary files a/apps/gallery/tests/golden/base/progress/it-192.png and b/apps/gallery/tests/golden/base/progress/it-192.png differ diff --git a/apps/gallery/tests/golden/base/progress/it-96.png b/apps/gallery/tests/golden/base/progress/it-96.png index ee2285dc..5ad8dc57 100644 Binary files a/apps/gallery/tests/golden/base/progress/it-96.png and b/apps/gallery/tests/golden/base/progress/it-96.png differ diff --git a/apps/gallery/tests/golden/base/progress/pseudo-144.png b/apps/gallery/tests/golden/base/progress/pseudo-144.png index 39ae1127..6c8fd29f 100644 Binary files a/apps/gallery/tests/golden/base/progress/pseudo-144.png and b/apps/gallery/tests/golden/base/progress/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/properties/en-120.png b/apps/gallery/tests/golden/base/properties/en-120.png index 53eef862..ebbcca7e 100644 Binary files a/apps/gallery/tests/golden/base/properties/en-120.png and b/apps/gallery/tests/golden/base/properties/en-120.png differ diff --git a/apps/gallery/tests/golden/base/properties/en-144-contrast.png b/apps/gallery/tests/golden/base/properties/en-144-contrast.png index 6c4764c4..544e8aba 100644 Binary files a/apps/gallery/tests/golden/base/properties/en-144-contrast.png and b/apps/gallery/tests/golden/base/properties/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/properties/en-144-hc.png b/apps/gallery/tests/golden/base/properties/en-144-hc.png index 6adfedfa..bb20c16d 100644 Binary files a/apps/gallery/tests/golden/base/properties/en-144-hc.png and b/apps/gallery/tests/golden/base/properties/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/properties/en-144.png b/apps/gallery/tests/golden/base/properties/en-144.png index f4e5290f..9149b1f2 100644 Binary files a/apps/gallery/tests/golden/base/properties/en-144.png and b/apps/gallery/tests/golden/base/properties/en-144.png differ diff --git a/apps/gallery/tests/golden/base/properties/en-192.png b/apps/gallery/tests/golden/base/properties/en-192.png index 80790abf..6328af3d 100644 Binary files a/apps/gallery/tests/golden/base/properties/en-192.png and b/apps/gallery/tests/golden/base/properties/en-192.png differ diff --git a/apps/gallery/tests/golden/base/properties/en-96.png b/apps/gallery/tests/golden/base/properties/en-96.png index bba6fde6..4c67e8a5 100644 Binary files a/apps/gallery/tests/golden/base/properties/en-96.png and b/apps/gallery/tests/golden/base/properties/en-96.png differ diff --git a/apps/gallery/tests/golden/base/properties/it-120.png b/apps/gallery/tests/golden/base/properties/it-120.png index 2d05fb0b..5376c45f 100644 Binary files a/apps/gallery/tests/golden/base/properties/it-120.png and b/apps/gallery/tests/golden/base/properties/it-120.png differ diff --git a/apps/gallery/tests/golden/base/properties/it-144.png b/apps/gallery/tests/golden/base/properties/it-144.png index 5734884e..b4dd3e45 100644 Binary files a/apps/gallery/tests/golden/base/properties/it-144.png and b/apps/gallery/tests/golden/base/properties/it-144.png differ diff --git a/apps/gallery/tests/golden/base/properties/it-192.png b/apps/gallery/tests/golden/base/properties/it-192.png index 8e0578d1..0f44edff 100644 Binary files a/apps/gallery/tests/golden/base/properties/it-192.png and b/apps/gallery/tests/golden/base/properties/it-192.png differ diff --git a/apps/gallery/tests/golden/base/properties/it-96.png b/apps/gallery/tests/golden/base/properties/it-96.png index 5da26bbb..9ece4455 100644 Binary files a/apps/gallery/tests/golden/base/properties/it-96.png and b/apps/gallery/tests/golden/base/properties/it-96.png differ diff --git a/apps/gallery/tests/golden/base/properties/pseudo-144.png b/apps/gallery/tests/golden/base/properties/pseudo-144.png index f4e5290f..9149b1f2 100644 Binary files a/apps/gallery/tests/golden/base/properties/pseudo-144.png and b/apps/gallery/tests/golden/base/properties/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/settings_like/en-120.png b/apps/gallery/tests/golden/base/settings_like/en-120.png index 3bc4a244..01416258 100644 Binary files a/apps/gallery/tests/golden/base/settings_like/en-120.png and b/apps/gallery/tests/golden/base/settings_like/en-120.png differ diff --git a/apps/gallery/tests/golden/base/settings_like/en-144-contrast.png b/apps/gallery/tests/golden/base/settings_like/en-144-contrast.png index 65291e56..3a6faa78 100644 Binary files a/apps/gallery/tests/golden/base/settings_like/en-144-contrast.png and b/apps/gallery/tests/golden/base/settings_like/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/settings_like/en-144-hc.png b/apps/gallery/tests/golden/base/settings_like/en-144-hc.png index efc22251..d2329c9e 100644 Binary files a/apps/gallery/tests/golden/base/settings_like/en-144-hc.png and b/apps/gallery/tests/golden/base/settings_like/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/settings_like/en-144.png b/apps/gallery/tests/golden/base/settings_like/en-144.png index 48709f9d..70c01465 100644 Binary files a/apps/gallery/tests/golden/base/settings_like/en-144.png and b/apps/gallery/tests/golden/base/settings_like/en-144.png differ diff --git a/apps/gallery/tests/golden/base/settings_like/en-192.png b/apps/gallery/tests/golden/base/settings_like/en-192.png index 490cfa42..c294dde8 100644 Binary files a/apps/gallery/tests/golden/base/settings_like/en-192.png and b/apps/gallery/tests/golden/base/settings_like/en-192.png differ diff --git a/apps/gallery/tests/golden/base/settings_like/en-96.png b/apps/gallery/tests/golden/base/settings_like/en-96.png index b783397b..31cf9d10 100644 Binary files a/apps/gallery/tests/golden/base/settings_like/en-96.png and b/apps/gallery/tests/golden/base/settings_like/en-96.png differ diff --git a/apps/gallery/tests/golden/base/settings_like/it-120.png b/apps/gallery/tests/golden/base/settings_like/it-120.png index badbed53..90345d37 100644 Binary files a/apps/gallery/tests/golden/base/settings_like/it-120.png and b/apps/gallery/tests/golden/base/settings_like/it-120.png differ diff --git a/apps/gallery/tests/golden/base/settings_like/it-144.png b/apps/gallery/tests/golden/base/settings_like/it-144.png index c3b6b9a3..8bb7b2a1 100644 Binary files a/apps/gallery/tests/golden/base/settings_like/it-144.png and b/apps/gallery/tests/golden/base/settings_like/it-144.png differ diff --git a/apps/gallery/tests/golden/base/settings_like/it-192.png b/apps/gallery/tests/golden/base/settings_like/it-192.png index 6cbe3b77..903d5e37 100644 Binary files a/apps/gallery/tests/golden/base/settings_like/it-192.png and b/apps/gallery/tests/golden/base/settings_like/it-192.png differ diff --git a/apps/gallery/tests/golden/base/settings_like/it-96.png b/apps/gallery/tests/golden/base/settings_like/it-96.png index 39919590..299d5d8f 100644 Binary files a/apps/gallery/tests/golden/base/settings_like/it-96.png and b/apps/gallery/tests/golden/base/settings_like/it-96.png differ diff --git a/apps/gallery/tests/golden/base/settings_like/pseudo-144.png b/apps/gallery/tests/golden/base/settings_like/pseudo-144.png index d045287d..367332f5 100644 Binary files a/apps/gallery/tests/golden/base/settings_like/pseudo-144.png and b/apps/gallery/tests/golden/base/settings_like/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/sidebar/a11y.txt b/apps/gallery/tests/golden/base/sidebar/a11y.txt index 0d497908..84beb7fa 100644 --- a/apps/gallery/tests/golden/base/sidebar/a11y.txt +++ b/apps/gallery/tests/golden/base/sidebar/a11y.txt @@ -14,3 +14,28 @@ Tree TreeItem "Cloud" [focusable, busy] level 1 TreeItem "Archive" [disabled] level 1 TreeItem "Local disk" [focusable] level 1 +Tree + TreeItem "Home" [focusable] level 1 + Label "Quick access" + TreeItem "Desktop" [focusable] level 1 + TreeItem "Downloads" [focusable] level 1 + TreeItem "Documents" [focusable, selected] level 1 + TreeItem "Projects 2026" [focusable] level 1 + Button "Remove from Quick access" + Label "This PC" + TreeItem "System (C:)" [focusable] level 1 + TreeItem "Data (D:)" [focusable] level 1 + TreeItem "Stick (E:)" [focusable] level 1 + Label "Network" + TreeItem "Network" [focusable] level 1 + TreeItem "Recycle Bin" [focusable] level 1 +Tree + TreeItem "Processes" [focusable] level 1 + TreeItem "Performance" [focusable, selected] level 1 + TreeItem "Details" [focusable] level 1 + TreeItem "Settings" [focusable] level 1 +Tree + TreeItem "Processes" [focusable] level 1 + TreeItem "Performance" [focusable, selected] level 1 + TreeItem "Details" [focusable] level 1 + TreeItem "Settings" [focusable] level 1 diff --git a/apps/gallery/tests/golden/base/sidebar/en-120.png b/apps/gallery/tests/golden/base/sidebar/en-120.png index b52cf517..c668177e 100644 Binary files a/apps/gallery/tests/golden/base/sidebar/en-120.png and b/apps/gallery/tests/golden/base/sidebar/en-120.png differ diff --git a/apps/gallery/tests/golden/base/sidebar/en-144-contrast.png b/apps/gallery/tests/golden/base/sidebar/en-144-contrast.png index 20c3bc51..ab26c631 100644 Binary files a/apps/gallery/tests/golden/base/sidebar/en-144-contrast.png and b/apps/gallery/tests/golden/base/sidebar/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/sidebar/en-144-hc.png b/apps/gallery/tests/golden/base/sidebar/en-144-hc.png index 998ce313..6d07e27d 100644 Binary files a/apps/gallery/tests/golden/base/sidebar/en-144-hc.png and b/apps/gallery/tests/golden/base/sidebar/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/sidebar/en-144.png b/apps/gallery/tests/golden/base/sidebar/en-144.png index fbd0a56a..4469be19 100644 Binary files a/apps/gallery/tests/golden/base/sidebar/en-144.png and b/apps/gallery/tests/golden/base/sidebar/en-144.png differ diff --git a/apps/gallery/tests/golden/base/sidebar/en-192.png b/apps/gallery/tests/golden/base/sidebar/en-192.png index fc0840d3..ac89bd63 100644 Binary files a/apps/gallery/tests/golden/base/sidebar/en-192.png and b/apps/gallery/tests/golden/base/sidebar/en-192.png differ diff --git a/apps/gallery/tests/golden/base/sidebar/en-96-hc.png b/apps/gallery/tests/golden/base/sidebar/en-96-hc.png index 1a7fe421..5dde995d 100644 Binary files a/apps/gallery/tests/golden/base/sidebar/en-96-hc.png and b/apps/gallery/tests/golden/base/sidebar/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/sidebar/en-96.png b/apps/gallery/tests/golden/base/sidebar/en-96.png index d41443be..933b307a 100644 Binary files a/apps/gallery/tests/golden/base/sidebar/en-96.png and b/apps/gallery/tests/golden/base/sidebar/en-96.png differ diff --git a/apps/gallery/tests/golden/base/sidebar/it-120.png b/apps/gallery/tests/golden/base/sidebar/it-120.png index 1936ef63..30a39553 100644 Binary files a/apps/gallery/tests/golden/base/sidebar/it-120.png and b/apps/gallery/tests/golden/base/sidebar/it-120.png differ diff --git a/apps/gallery/tests/golden/base/sidebar/it-144.png b/apps/gallery/tests/golden/base/sidebar/it-144.png index 04c71f63..fec7e89f 100644 Binary files a/apps/gallery/tests/golden/base/sidebar/it-144.png and b/apps/gallery/tests/golden/base/sidebar/it-144.png differ diff --git a/apps/gallery/tests/golden/base/sidebar/it-192.png b/apps/gallery/tests/golden/base/sidebar/it-192.png index da25ea8a..3b19efd2 100644 Binary files a/apps/gallery/tests/golden/base/sidebar/it-192.png and b/apps/gallery/tests/golden/base/sidebar/it-192.png differ diff --git a/apps/gallery/tests/golden/base/sidebar/it-96.png b/apps/gallery/tests/golden/base/sidebar/it-96.png index dd792fe3..2bac3bcf 100644 Binary files a/apps/gallery/tests/golden/base/sidebar/it-96.png and b/apps/gallery/tests/golden/base/sidebar/it-96.png differ diff --git a/apps/gallery/tests/golden/base/sidebar/pseudo-144.png b/apps/gallery/tests/golden/base/sidebar/pseudo-144.png index 020b1a46..f16be2f2 100644 Binary files a/apps/gallery/tests/golden/base/sidebar/pseudo-144.png and b/apps/gallery/tests/golden/base/sidebar/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/status/a11y.txt b/apps/gallery/tests/golden/base/status/a11y.txt index 405db358..d9f64234 100644 --- a/apps/gallery/tests/golden/base/status/a11y.txt +++ b/apps/gallery/tests/golden/base/status/a11y.txt @@ -3,3 +3,7 @@ Status "142 processes · Paused" Alert "Some processes could not be read." Button "Details" [focusable] Alert "Some processes could not be read." +Status "1,204 items · 3 selected · 412 MB" +Status "142 processes · Paused" +Alert "Some processes could not be read." + Button "Details" [focusable] diff --git a/apps/gallery/tests/golden/base/status/en-120.png b/apps/gallery/tests/golden/base/status/en-120.png index 5d3b08ce..2986d8db 100644 Binary files a/apps/gallery/tests/golden/base/status/en-120.png and b/apps/gallery/tests/golden/base/status/en-120.png differ diff --git a/apps/gallery/tests/golden/base/status/en-144-contrast.png b/apps/gallery/tests/golden/base/status/en-144-contrast.png index a797b0f9..b2c3f94d 100644 Binary files a/apps/gallery/tests/golden/base/status/en-144-contrast.png and b/apps/gallery/tests/golden/base/status/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/status/en-144-hc.png b/apps/gallery/tests/golden/base/status/en-144-hc.png index 543e4cdd..aa886dc7 100644 Binary files a/apps/gallery/tests/golden/base/status/en-144-hc.png and b/apps/gallery/tests/golden/base/status/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/status/en-144.png b/apps/gallery/tests/golden/base/status/en-144.png index a797b0f9..b2c3f94d 100644 Binary files a/apps/gallery/tests/golden/base/status/en-144.png and b/apps/gallery/tests/golden/base/status/en-144.png differ diff --git a/apps/gallery/tests/golden/base/status/en-192.png b/apps/gallery/tests/golden/base/status/en-192.png index 64697ced..05d90501 100644 Binary files a/apps/gallery/tests/golden/base/status/en-192.png and b/apps/gallery/tests/golden/base/status/en-192.png differ diff --git a/apps/gallery/tests/golden/base/status/en-96-hc.png b/apps/gallery/tests/golden/base/status/en-96-hc.png index 3b5f0e9d..f9b1cb07 100644 Binary files a/apps/gallery/tests/golden/base/status/en-96-hc.png and b/apps/gallery/tests/golden/base/status/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/status/en-96.png b/apps/gallery/tests/golden/base/status/en-96.png index d9b8685c..3ca8003c 100644 Binary files a/apps/gallery/tests/golden/base/status/en-96.png and b/apps/gallery/tests/golden/base/status/en-96.png differ diff --git a/apps/gallery/tests/golden/base/status/it-120.png b/apps/gallery/tests/golden/base/status/it-120.png index c1b7f9a8..d9bdebec 100644 Binary files a/apps/gallery/tests/golden/base/status/it-120.png and b/apps/gallery/tests/golden/base/status/it-120.png differ diff --git a/apps/gallery/tests/golden/base/status/it-144.png b/apps/gallery/tests/golden/base/status/it-144.png index c107ba42..af800832 100644 Binary files a/apps/gallery/tests/golden/base/status/it-144.png and b/apps/gallery/tests/golden/base/status/it-144.png differ diff --git a/apps/gallery/tests/golden/base/status/it-192.png b/apps/gallery/tests/golden/base/status/it-192.png index 63eb2d32..aa5443ed 100644 Binary files a/apps/gallery/tests/golden/base/status/it-192.png and b/apps/gallery/tests/golden/base/status/it-192.png differ diff --git a/apps/gallery/tests/golden/base/status/it-96.png b/apps/gallery/tests/golden/base/status/it-96.png index 3409a0db..a89a12a7 100644 Binary files a/apps/gallery/tests/golden/base/status/it-96.png and b/apps/gallery/tests/golden/base/status/it-96.png differ diff --git a/apps/gallery/tests/golden/base/status/pseudo-144.png b/apps/gallery/tests/golden/base/status/pseudo-144.png index b5e46e64..91cedf2e 100644 Binary files a/apps/gallery/tests/golden/base/status/pseudo-144.png and b/apps/gallery/tests/golden/base/status/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/table/a11y.txt b/apps/gallery/tests/golden/base/table/a11y.txt index 4dd8521f..a1d4bd3d 100644 --- a/apps/gallery/tests/golden/base/table/a11y.txt +++ b/apps/gallery/tests/golden/base/table/a11y.txt @@ -13,18 +13,18 @@ Table "Files" 3 of 10 Row "Cargo.toml" [focusable, selected] 8 of 10 Row "readme.md" [focusable] 9 of 10 Row "backup.tar.gz" [focusable] 10 of 10 -Table "Tasks" 4 of 14 - Row "Apps" [focusable] 1 of 14 - Row "browser" [focusable, expandable, expanded] 2 of 14 - Row "editor" [focusable] 3 of 14 - Row "terminal" [focusable, selected] 4 of 14 - Row "mixer" [focusable] 5 of 14 - Row "player" [focusable] 6 of 14 - Row "chat" [focusable] 7 of 14 - Row "renderer" [focusable, selected] 8 of 14 - Row "renderer" [focusable] 9 of 14 - Row "Background" [focusable] 10 of 14 - Row "indexer" [focusable] 11 of 14 - Row "updater" [focusable] 12 of 14 - Row "sync" [focusable] 13 of 14 - Row "audio-host" [focusable] 14 of 14 +ColumnHeader "Name" [focusable] +ColumnHeader "Size" [focusable] +ColumnHeader "CPU" [focusable] +Table "Tasks" 4 of 16 + Row "Apps" [focusable, expandable, expanded] 1 of 16 + Row "browser" [focusable, expandable, expanded] 2 of 16 + Row "editor" [focusable] 3 of 16 + Row "terminal" [focusable, selected] 4 of 16 + Row "mixer" [focusable] 5 of 16 + Row "player" [focusable] 6 of 16 + Row "chat" [focusable] 7 of 16 + Row "renderer" [focusable, selected] 8 of 16 + Row "renderer" [focusable] 9 of 16 + Row "Background" [focusable, expandable, expanded] 10 of 16 + Button "Close" [focusable] diff --git a/apps/gallery/tests/golden/base/table/en-120.png b/apps/gallery/tests/golden/base/table/en-120.png index 10827397..c0f283ce 100644 Binary files a/apps/gallery/tests/golden/base/table/en-120.png and b/apps/gallery/tests/golden/base/table/en-120.png differ diff --git a/apps/gallery/tests/golden/base/table/en-144-contrast.png b/apps/gallery/tests/golden/base/table/en-144-contrast.png index d5967df9..db1cc623 100644 Binary files a/apps/gallery/tests/golden/base/table/en-144-contrast.png and b/apps/gallery/tests/golden/base/table/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/table/en-144-hc.png b/apps/gallery/tests/golden/base/table/en-144-hc.png index f0778801..aec55f61 100644 Binary files a/apps/gallery/tests/golden/base/table/en-144-hc.png and b/apps/gallery/tests/golden/base/table/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/table/en-144.png b/apps/gallery/tests/golden/base/table/en-144.png index 9c75288d..8d52d266 100644 Binary files a/apps/gallery/tests/golden/base/table/en-144.png and b/apps/gallery/tests/golden/base/table/en-144.png differ diff --git a/apps/gallery/tests/golden/base/table/en-192.png b/apps/gallery/tests/golden/base/table/en-192.png index 3573795c..2cb79a7a 100644 Binary files a/apps/gallery/tests/golden/base/table/en-192.png and b/apps/gallery/tests/golden/base/table/en-192.png differ diff --git a/apps/gallery/tests/golden/base/table/en-96-hc.png b/apps/gallery/tests/golden/base/table/en-96-hc.png index f7c5a154..4465232b 100644 Binary files a/apps/gallery/tests/golden/base/table/en-96-hc.png and b/apps/gallery/tests/golden/base/table/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/table/en-96.png b/apps/gallery/tests/golden/base/table/en-96.png index f432e3e6..0da6087b 100644 Binary files a/apps/gallery/tests/golden/base/table/en-96.png and b/apps/gallery/tests/golden/base/table/en-96.png differ diff --git a/apps/gallery/tests/golden/base/table/it-120.png b/apps/gallery/tests/golden/base/table/it-120.png index 52dd0de7..1280aafd 100644 Binary files a/apps/gallery/tests/golden/base/table/it-120.png and b/apps/gallery/tests/golden/base/table/it-120.png differ diff --git a/apps/gallery/tests/golden/base/table/it-144.png b/apps/gallery/tests/golden/base/table/it-144.png index f0261ea1..9e7ef10b 100644 Binary files a/apps/gallery/tests/golden/base/table/it-144.png and b/apps/gallery/tests/golden/base/table/it-144.png differ diff --git a/apps/gallery/tests/golden/base/table/it-192.png b/apps/gallery/tests/golden/base/table/it-192.png index 0d6e2be2..66dfe0d6 100644 Binary files a/apps/gallery/tests/golden/base/table/it-192.png and b/apps/gallery/tests/golden/base/table/it-192.png differ diff --git a/apps/gallery/tests/golden/base/table/it-96.png b/apps/gallery/tests/golden/base/table/it-96.png index 3dc450ca..414b9adc 100644 Binary files a/apps/gallery/tests/golden/base/table/it-96.png and b/apps/gallery/tests/golden/base/table/it-96.png differ diff --git a/apps/gallery/tests/golden/base/table/pseudo-144.png b/apps/gallery/tests/golden/base/table/pseudo-144.png index 1f3c23a1..6d122964 100644 Binary files a/apps/gallery/tests/golden/base/table/pseudo-144.png and b/apps/gallery/tests/golden/base/table/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/table100k/a11y.txt b/apps/gallery/tests/golden/base/table100k/a11y.txt index 5ded0f84..987d831b 100644 --- a/apps/gallery/tests/golden/base/table100k/a11y.txt +++ b/apps/gallery/tests/golden/base/table100k/a11y.txt @@ -26,7 +26,3 @@ Table "A hundred thousand files" [focusable] 0 of 100000 Row "item 20.txt" [focusable] 21 of 100000 Row "item 21.txt" [focusable] 22 of 100000 Row "item 22.txt" [focusable] 23 of 100000 - Row "item 23.txt" [focusable] 24 of 100000 - Row "item 24.txt" [focusable] 25 of 100000 - Row "item 25.txt" [focusable] 26 of 100000 - Row "item 26.txt" [focusable] 27 of 100000 diff --git a/apps/gallery/tests/golden/base/table100k/en-120.png b/apps/gallery/tests/golden/base/table100k/en-120.png index 21c5d648..250ccd68 100644 Binary files a/apps/gallery/tests/golden/base/table100k/en-120.png and b/apps/gallery/tests/golden/base/table100k/en-120.png differ diff --git a/apps/gallery/tests/golden/base/table100k/en-144-contrast.png b/apps/gallery/tests/golden/base/table100k/en-144-contrast.png index 51e073c1..ea3fbf61 100644 Binary files a/apps/gallery/tests/golden/base/table100k/en-144-contrast.png and b/apps/gallery/tests/golden/base/table100k/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/table100k/en-144-hc.png b/apps/gallery/tests/golden/base/table100k/en-144-hc.png index 1f9bd1c8..5a28c3cd 100644 Binary files a/apps/gallery/tests/golden/base/table100k/en-144-hc.png and b/apps/gallery/tests/golden/base/table100k/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/table100k/en-144.png b/apps/gallery/tests/golden/base/table100k/en-144.png index 51e073c1..ea3fbf61 100644 Binary files a/apps/gallery/tests/golden/base/table100k/en-144.png and b/apps/gallery/tests/golden/base/table100k/en-144.png differ diff --git a/apps/gallery/tests/golden/base/table100k/en-192.png b/apps/gallery/tests/golden/base/table100k/en-192.png index 09d8faff..7021914c 100644 Binary files a/apps/gallery/tests/golden/base/table100k/en-192.png and b/apps/gallery/tests/golden/base/table100k/en-192.png differ diff --git a/apps/gallery/tests/golden/base/table100k/en-96-hc.png b/apps/gallery/tests/golden/base/table100k/en-96-hc.png index 12bcbec0..414a285f 100644 Binary files a/apps/gallery/tests/golden/base/table100k/en-96-hc.png and b/apps/gallery/tests/golden/base/table100k/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/table100k/en-96.png b/apps/gallery/tests/golden/base/table100k/en-96.png index 9ccf60bd..a88221cb 100644 Binary files a/apps/gallery/tests/golden/base/table100k/en-96.png and b/apps/gallery/tests/golden/base/table100k/en-96.png differ diff --git a/apps/gallery/tests/golden/base/table100k/it-120.png b/apps/gallery/tests/golden/base/table100k/it-120.png index 7ce85b87..55a4bdaa 100644 Binary files a/apps/gallery/tests/golden/base/table100k/it-120.png and b/apps/gallery/tests/golden/base/table100k/it-120.png differ diff --git a/apps/gallery/tests/golden/base/table100k/it-144.png b/apps/gallery/tests/golden/base/table100k/it-144.png index 4f0cb8f9..2356dce4 100644 Binary files a/apps/gallery/tests/golden/base/table100k/it-144.png and b/apps/gallery/tests/golden/base/table100k/it-144.png differ diff --git a/apps/gallery/tests/golden/base/table100k/it-192.png b/apps/gallery/tests/golden/base/table100k/it-192.png index b660bea0..dcc5fd21 100644 Binary files a/apps/gallery/tests/golden/base/table100k/it-192.png and b/apps/gallery/tests/golden/base/table100k/it-192.png differ diff --git a/apps/gallery/tests/golden/base/table100k/it-96.png b/apps/gallery/tests/golden/base/table100k/it-96.png index f4c6db7c..1050907f 100644 Binary files a/apps/gallery/tests/golden/base/table100k/it-96.png and b/apps/gallery/tests/golden/base/table100k/it-96.png differ diff --git a/apps/gallery/tests/golden/base/table100k/pseudo-144.png b/apps/gallery/tests/golden/base/table100k/pseudo-144.png index 42360189..088023a6 100644 Binary files a/apps/gallery/tests/golden/base/table100k/pseudo-144.png and b/apps/gallery/tests/golden/base/table100k/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/tabs/a11y.txt b/apps/gallery/tests/golden/base/tabs/a11y.txt index 49b9d751..a5e70691 100644 --- a/apps/gallery/tests/golden/base/tabs/a11y.txt +++ b/apps/gallery/tests/golden/base/tabs/a11y.txt @@ -38,3 +38,55 @@ TabList Tab "Project folder" [focusable, selected] Button "Close tab" Button "New tab" [focusable] +TabList + Tab "Documents" [focusable] + Button "Close tab" + Tab "Projects 2026" [focusable, selected] + Button "Close tab" + Tab "A folder with a name too long to fit its tab" [focusable] + Button "Close tab" + Tab "Downloads" [focusable] + Button "Close tab" + Button "New tab" [focusable] +TabList + Tab "Documents" [focusable] + Button "Close tab" + Tab "Projects 2026" [focusable, selected] + Button "Close tab" + Tab "A folder with a name too long to fit its tab" [focusable] + Button "Close tab" + Tab "Downloads" [focusable] + Button "Close tab" + Button "New tab" [focusable] +TabList + Tab "Documents" [focusable, busy] + Button "Close tab" + Tab "Projects 2026" [focusable] + Button "Close tab" + Tab "A folder with a name too long to fit its tab" [focusable, selected] + Button "Close tab" + Tab "Downloads" [focusable, invalid] + Button "Close tab" + Button "New tab" [focusable] +TabList + Tab "Project folder" [focusable] + Button "Close tab" + Tab "Project folder" [focusable] + Button "Close tab" + Tab "Project folder" [focusable] + Button "Close tab" + Tab "Project folder" [focusable] + Button "Close tab" + Tab "Project folder" [focusable] + Button "Close tab" + Tab "Project folder" [focusable] + Button "Close tab" + Tab "Project folder" [focusable] + Button "Close tab" + Tab "Project folder" [focusable] + Button "Close tab" + Tab "Project folder" [focusable] + Button "Close tab" + Tab "Project folder" [focusable, selected] + Button "Close tab" + Button "New tab" [focusable] diff --git a/apps/gallery/tests/golden/base/tabs/en-120.png b/apps/gallery/tests/golden/base/tabs/en-120.png index d83d8037..5c204362 100644 Binary files a/apps/gallery/tests/golden/base/tabs/en-120.png and b/apps/gallery/tests/golden/base/tabs/en-120.png differ diff --git a/apps/gallery/tests/golden/base/tabs/en-144-contrast.png b/apps/gallery/tests/golden/base/tabs/en-144-contrast.png index 9f8dda04..d67fc4fa 100644 Binary files a/apps/gallery/tests/golden/base/tabs/en-144-contrast.png and b/apps/gallery/tests/golden/base/tabs/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/tabs/en-144-hc.png b/apps/gallery/tests/golden/base/tabs/en-144-hc.png index 6d0cbee2..71770b12 100644 Binary files a/apps/gallery/tests/golden/base/tabs/en-144-hc.png and b/apps/gallery/tests/golden/base/tabs/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/tabs/en-144.png b/apps/gallery/tests/golden/base/tabs/en-144.png index 46da3a54..6763b88b 100644 Binary files a/apps/gallery/tests/golden/base/tabs/en-144.png and b/apps/gallery/tests/golden/base/tabs/en-144.png differ diff --git a/apps/gallery/tests/golden/base/tabs/en-192.png b/apps/gallery/tests/golden/base/tabs/en-192.png index 81be4edd..55a8fa12 100644 Binary files a/apps/gallery/tests/golden/base/tabs/en-192.png and b/apps/gallery/tests/golden/base/tabs/en-192.png differ diff --git a/apps/gallery/tests/golden/base/tabs/en-96-hc.png b/apps/gallery/tests/golden/base/tabs/en-96-hc.png index 0a541f4a..efc34ccc 100644 Binary files a/apps/gallery/tests/golden/base/tabs/en-96-hc.png and b/apps/gallery/tests/golden/base/tabs/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/tabs/en-96.png b/apps/gallery/tests/golden/base/tabs/en-96.png index dc47883c..139d303f 100644 Binary files a/apps/gallery/tests/golden/base/tabs/en-96.png and b/apps/gallery/tests/golden/base/tabs/en-96.png differ diff --git a/apps/gallery/tests/golden/base/tabs/it-120.png b/apps/gallery/tests/golden/base/tabs/it-120.png index 4903bfdb..d17c63aa 100644 Binary files a/apps/gallery/tests/golden/base/tabs/it-120.png and b/apps/gallery/tests/golden/base/tabs/it-120.png differ diff --git a/apps/gallery/tests/golden/base/tabs/it-144.png b/apps/gallery/tests/golden/base/tabs/it-144.png index 41216739..110a7b07 100644 Binary files a/apps/gallery/tests/golden/base/tabs/it-144.png and b/apps/gallery/tests/golden/base/tabs/it-144.png differ diff --git a/apps/gallery/tests/golden/base/tabs/it-192.png b/apps/gallery/tests/golden/base/tabs/it-192.png index 905d904f..b3fc8ff0 100644 Binary files a/apps/gallery/tests/golden/base/tabs/it-192.png and b/apps/gallery/tests/golden/base/tabs/it-192.png differ diff --git a/apps/gallery/tests/golden/base/tabs/it-96.png b/apps/gallery/tests/golden/base/tabs/it-96.png index 6bd08c3a..72c31992 100644 Binary files a/apps/gallery/tests/golden/base/tabs/it-96.png and b/apps/gallery/tests/golden/base/tabs/it-96.png differ diff --git a/apps/gallery/tests/golden/base/tabs/pseudo-144.png b/apps/gallery/tests/golden/base/tabs/pseudo-144.png index 94620985..9a7c210e 100644 Binary files a/apps/gallery/tests/golden/base/tabs/pseudo-144.png and b/apps/gallery/tests/golden/base/tabs/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/toggles/a11y.txt b/apps/gallery/tests/golden/base/toggles/a11y.txt index 90e01d93..dc8bf208 100644 --- a/apps/gallery/tests/golden/base/toggles/a11y.txt +++ b/apps/gallery/tests/golden/base/toggles/a11y.txt @@ -21,3 +21,28 @@ RadioGroup "Mode, none" Radio "Off" [focusable] Radio "Auto" [focusable] Radio "On" [focusable] +Label "Segmented, click style" +RadioGroup "View" + Radio "Groups" [focusable] + Radio "Tree" [focusable, selected] + Radio "List" [focusable] +RadioGroup "View" + Radio "Groups" [focusable] + Radio "Tree" [focusable, selected] + Radio "List" [focusable] +RadioGroup "View" + Radio "Groups" [focusable] + Radio "Tree" [focusable, selected] + Radio "List" [focusable] +RadioGroup "View" + Radio "Groups" [focusable] + Radio "Tree" [focusable, selected] + Radio "List" [focusable] +RadioGroup "View" + Radio "Groups" [focusable] + Radio "Tree" [focusable, selected] + Radio "List" [focusable] +RadioGroup "View" [disabled] + Radio "Groups" [disabled] + Radio "Tree" [disabled, selected] + Radio "List" [disabled] diff --git a/apps/gallery/tests/golden/base/toggles/en-120.png b/apps/gallery/tests/golden/base/toggles/en-120.png index f9e18ef7..d4cbf6b0 100644 Binary files a/apps/gallery/tests/golden/base/toggles/en-120.png and b/apps/gallery/tests/golden/base/toggles/en-120.png differ diff --git a/apps/gallery/tests/golden/base/toggles/en-144-contrast.png b/apps/gallery/tests/golden/base/toggles/en-144-contrast.png index 606ea038..435fcd0e 100644 Binary files a/apps/gallery/tests/golden/base/toggles/en-144-contrast.png and b/apps/gallery/tests/golden/base/toggles/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/toggles/en-144-hc.png b/apps/gallery/tests/golden/base/toggles/en-144-hc.png index 5b5d2df5..8d57d77c 100644 Binary files a/apps/gallery/tests/golden/base/toggles/en-144-hc.png and b/apps/gallery/tests/golden/base/toggles/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/toggles/en-144.png b/apps/gallery/tests/golden/base/toggles/en-144.png index 3407feef..b6c0c6e1 100644 Binary files a/apps/gallery/tests/golden/base/toggles/en-144.png and b/apps/gallery/tests/golden/base/toggles/en-144.png differ diff --git a/apps/gallery/tests/golden/base/toggles/en-192.png b/apps/gallery/tests/golden/base/toggles/en-192.png index 67ff894f..5a196d34 100644 Binary files a/apps/gallery/tests/golden/base/toggles/en-192.png and b/apps/gallery/tests/golden/base/toggles/en-192.png differ diff --git a/apps/gallery/tests/golden/base/toggles/en-96-hc.png b/apps/gallery/tests/golden/base/toggles/en-96-hc.png index e0beb933..dad086dd 100644 Binary files a/apps/gallery/tests/golden/base/toggles/en-96-hc.png and b/apps/gallery/tests/golden/base/toggles/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/toggles/en-96.png b/apps/gallery/tests/golden/base/toggles/en-96.png index 44ce73ae..d6130742 100644 Binary files a/apps/gallery/tests/golden/base/toggles/en-96.png and b/apps/gallery/tests/golden/base/toggles/en-96.png differ diff --git a/apps/gallery/tests/golden/base/toggles/it-120.png b/apps/gallery/tests/golden/base/toggles/it-120.png index 285d3a2e..0661eeae 100644 Binary files a/apps/gallery/tests/golden/base/toggles/it-120.png and b/apps/gallery/tests/golden/base/toggles/it-120.png differ diff --git a/apps/gallery/tests/golden/base/toggles/it-144.png b/apps/gallery/tests/golden/base/toggles/it-144.png index 7d1bab14..3396f62d 100644 Binary files a/apps/gallery/tests/golden/base/toggles/it-144.png and b/apps/gallery/tests/golden/base/toggles/it-144.png differ diff --git a/apps/gallery/tests/golden/base/toggles/it-192.png b/apps/gallery/tests/golden/base/toggles/it-192.png index 9e1dd781..bdd79484 100644 Binary files a/apps/gallery/tests/golden/base/toggles/it-192.png and b/apps/gallery/tests/golden/base/toggles/it-192.png differ diff --git a/apps/gallery/tests/golden/base/toggles/it-96.png b/apps/gallery/tests/golden/base/toggles/it-96.png index 08faf5fa..780e3d3a 100644 Binary files a/apps/gallery/tests/golden/base/toggles/it-96.png and b/apps/gallery/tests/golden/base/toggles/it-96.png differ diff --git a/apps/gallery/tests/golden/base/toggles/pseudo-144.png b/apps/gallery/tests/golden/base/toggles/pseudo-144.png index bdda1ff3..e42716fc 100644 Binary files a/apps/gallery/tests/golden/base/toggles/pseudo-144.png and b/apps/gallery/tests/golden/base/toggles/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/toolbar/a11y.txt b/apps/gallery/tests/golden/base/toolbar/a11y.txt index 14b42289..6549e165 100644 --- a/apps/gallery/tests/golden/base/toolbar/a11y.txt +++ b/apps/gallery/tests/golden/base/toolbar/a11y.txt @@ -17,3 +17,41 @@ Toolbar Button "More" [focusable] TextInput "Path" [focusable] "C:\\Data\\Reports" Button "Clear" +Toolbar "Folder commands" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable, expanded] + Button "View" [focusable, expandable] + Button "Filter" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Toolbar "Folder commands" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "Rename" [focusable] + Button "Delete" [focusable] + Button "Sort" [focusable, expandable] + Button "More" [focusable, expandable] + Button "Details" [focusable, checked] +Toolbar "Folder commands" + Button "New" [focusable, expandable] + Button "Cut" [focusable] + Button "Copy" [focusable] + Button "Paste" [disabled] + Button "More" [focusable, expandable, expanded] + Button "Details" [focusable, checked] +Toolbar "Process commands" + Button "Close Ember" [focusable] + Button "End" [focusable] + Button "Efficiency" [focusable] + Button "Priority: normal" [focusable, expandable] + Button "Open path" [focusable] + Button "Properties" [focusable] + Button "More" [focusable, expandable] +Toolbar "Process commands" diff --git a/apps/gallery/tests/golden/base/toolbar/en-120.png b/apps/gallery/tests/golden/base/toolbar/en-120.png index f1f631f9..e2c58c87 100644 Binary files a/apps/gallery/tests/golden/base/toolbar/en-120.png and b/apps/gallery/tests/golden/base/toolbar/en-120.png differ diff --git a/apps/gallery/tests/golden/base/toolbar/en-144-contrast.png b/apps/gallery/tests/golden/base/toolbar/en-144-contrast.png index 95bdf916..67e33a8e 100644 Binary files a/apps/gallery/tests/golden/base/toolbar/en-144-contrast.png and b/apps/gallery/tests/golden/base/toolbar/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/toolbar/en-144-hc.png b/apps/gallery/tests/golden/base/toolbar/en-144-hc.png index 454bef45..3fc1d926 100644 Binary files a/apps/gallery/tests/golden/base/toolbar/en-144-hc.png and b/apps/gallery/tests/golden/base/toolbar/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/toolbar/en-144.png b/apps/gallery/tests/golden/base/toolbar/en-144.png index 49b6bad7..1e345f5f 100644 Binary files a/apps/gallery/tests/golden/base/toolbar/en-144.png and b/apps/gallery/tests/golden/base/toolbar/en-144.png differ diff --git a/apps/gallery/tests/golden/base/toolbar/en-192.png b/apps/gallery/tests/golden/base/toolbar/en-192.png index d8a4ab61..dda3960e 100644 Binary files a/apps/gallery/tests/golden/base/toolbar/en-192.png and b/apps/gallery/tests/golden/base/toolbar/en-192.png differ diff --git a/apps/gallery/tests/golden/base/toolbar/en-96-hc.png b/apps/gallery/tests/golden/base/toolbar/en-96-hc.png index de7cca46..ac1388ea 100644 Binary files a/apps/gallery/tests/golden/base/toolbar/en-96-hc.png and b/apps/gallery/tests/golden/base/toolbar/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/toolbar/en-96.png b/apps/gallery/tests/golden/base/toolbar/en-96.png index 2fc36143..6f5bd936 100644 Binary files a/apps/gallery/tests/golden/base/toolbar/en-96.png and b/apps/gallery/tests/golden/base/toolbar/en-96.png differ diff --git a/apps/gallery/tests/golden/base/toolbar/it-120.png b/apps/gallery/tests/golden/base/toolbar/it-120.png index 7f5d2fa3..61f740ed 100644 Binary files a/apps/gallery/tests/golden/base/toolbar/it-120.png and b/apps/gallery/tests/golden/base/toolbar/it-120.png differ diff --git a/apps/gallery/tests/golden/base/toolbar/it-144.png b/apps/gallery/tests/golden/base/toolbar/it-144.png index 4b70f585..f436b26f 100644 Binary files a/apps/gallery/tests/golden/base/toolbar/it-144.png and b/apps/gallery/tests/golden/base/toolbar/it-144.png differ diff --git a/apps/gallery/tests/golden/base/toolbar/it-192.png b/apps/gallery/tests/golden/base/toolbar/it-192.png index e2d2100e..be7a71c3 100644 Binary files a/apps/gallery/tests/golden/base/toolbar/it-192.png and b/apps/gallery/tests/golden/base/toolbar/it-192.png differ diff --git a/apps/gallery/tests/golden/base/toolbar/it-96.png b/apps/gallery/tests/golden/base/toolbar/it-96.png index 753937f1..050aa2fc 100644 Binary files a/apps/gallery/tests/golden/base/toolbar/it-96.png and b/apps/gallery/tests/golden/base/toolbar/it-96.png differ diff --git a/apps/gallery/tests/golden/base/toolbar/pseudo-144.png b/apps/gallery/tests/golden/base/toolbar/pseudo-144.png index 125d7049..6ae20e98 100644 Binary files a/apps/gallery/tests/golden/base/toolbar/pseudo-144.png and b/apps/gallery/tests/golden/base/toolbar/pseudo-144.png differ diff --git a/apps/gallery/tests/golden/base/tooltip/a11y.txt b/apps/gallery/tests/golden/base/tooltip/a11y.txt index cfc355e0..69d21922 100644 --- a/apps/gallery/tests/golden/base/tooltip/a11y.txt +++ b/apps/gallery/tests/golden/base/tooltip/a11y.txt @@ -1,7 +1,23 @@ Label "Chips" Label "Icon buttons (hold the pointer for half a second)" +Label "Click style: rest, hover, pressed, focus, unavailable" Button "Back" [focusable] Button "Refresh" [focusable] Button "Search" [focusable] Button "Pin" [focusable] Button "Settings" [focusable] +Button "Back to Studio" [focusable] +Button "Back to Studio" [focusable] +Button "Back to Studio" [focusable] +Button "Back to Studio" [focusable] +Button "Back to Studio" [disabled] +Button "Back to Studio" [focusable] +Button "Back to Studio" [focusable] +Button "Back to Studio" [focusable] +Button "Back to Studio" [focusable] +Button "Back to Studio" [disabled] +Button "Back to Studio" [focusable] +Button "Back to Studio" [focusable] +Button "Back to Studio" [focusable] +Button "Back to Studio" [focusable] +Button "Back to Studio" [disabled] diff --git a/apps/gallery/tests/golden/base/tooltip/en-120.png b/apps/gallery/tests/golden/base/tooltip/en-120.png index 9af70d8d..dccb2bb0 100644 Binary files a/apps/gallery/tests/golden/base/tooltip/en-120.png and b/apps/gallery/tests/golden/base/tooltip/en-120.png differ diff --git a/apps/gallery/tests/golden/base/tooltip/en-144-contrast.png b/apps/gallery/tests/golden/base/tooltip/en-144-contrast.png index 732dfbb0..c1e43646 100644 Binary files a/apps/gallery/tests/golden/base/tooltip/en-144-contrast.png and b/apps/gallery/tests/golden/base/tooltip/en-144-contrast.png differ diff --git a/apps/gallery/tests/golden/base/tooltip/en-144-hc.png b/apps/gallery/tests/golden/base/tooltip/en-144-hc.png index ab31cb16..2ab569e3 100644 Binary files a/apps/gallery/tests/golden/base/tooltip/en-144-hc.png and b/apps/gallery/tests/golden/base/tooltip/en-144-hc.png differ diff --git a/apps/gallery/tests/golden/base/tooltip/en-144.png b/apps/gallery/tests/golden/base/tooltip/en-144.png index 30469791..30fe7f6c 100644 Binary files a/apps/gallery/tests/golden/base/tooltip/en-144.png and b/apps/gallery/tests/golden/base/tooltip/en-144.png differ diff --git a/apps/gallery/tests/golden/base/tooltip/en-192.png b/apps/gallery/tests/golden/base/tooltip/en-192.png index f11bea51..3b4f8c18 100644 Binary files a/apps/gallery/tests/golden/base/tooltip/en-192.png and b/apps/gallery/tests/golden/base/tooltip/en-192.png differ diff --git a/apps/gallery/tests/golden/base/tooltip/en-96-hc.png b/apps/gallery/tests/golden/base/tooltip/en-96-hc.png index c2dab8bc..9650099f 100644 Binary files a/apps/gallery/tests/golden/base/tooltip/en-96-hc.png and b/apps/gallery/tests/golden/base/tooltip/en-96-hc.png differ diff --git a/apps/gallery/tests/golden/base/tooltip/en-96.png b/apps/gallery/tests/golden/base/tooltip/en-96.png index aee4ebd9..e8b287a4 100644 Binary files a/apps/gallery/tests/golden/base/tooltip/en-96.png and b/apps/gallery/tests/golden/base/tooltip/en-96.png differ diff --git a/apps/gallery/tests/golden/base/tooltip/it-120.png b/apps/gallery/tests/golden/base/tooltip/it-120.png index 9ac5e785..bdd9ab4f 100644 Binary files a/apps/gallery/tests/golden/base/tooltip/it-120.png and b/apps/gallery/tests/golden/base/tooltip/it-120.png differ diff --git a/apps/gallery/tests/golden/base/tooltip/it-144.png b/apps/gallery/tests/golden/base/tooltip/it-144.png index bb3f8bcf..f09c7518 100644 Binary files a/apps/gallery/tests/golden/base/tooltip/it-144.png and b/apps/gallery/tests/golden/base/tooltip/it-144.png differ diff --git a/apps/gallery/tests/golden/base/tooltip/it-192.png b/apps/gallery/tests/golden/base/tooltip/it-192.png index a8735cd7..1883d091 100644 Binary files a/apps/gallery/tests/golden/base/tooltip/it-192.png and b/apps/gallery/tests/golden/base/tooltip/it-192.png differ diff --git a/apps/gallery/tests/golden/base/tooltip/it-96.png b/apps/gallery/tests/golden/base/tooltip/it-96.png index 97df9788..625631de 100644 Binary files a/apps/gallery/tests/golden/base/tooltip/it-96.png and b/apps/gallery/tests/golden/base/tooltip/it-96.png differ diff --git a/apps/gallery/tests/golden/base/tooltip/pseudo-144.png b/apps/gallery/tests/golden/base/tooltip/pseudo-144.png index f013774a..154abde8 100644 Binary files a/apps/gallery/tests/golden/base/tooltip/pseudo-144.png and b/apps/gallery/tests/golden/base/tooltip/pseudo-144.png differ diff --git a/apps/tasks/Cargo.toml b/apps/tasks/Cargo.toml index 3c74b76a..ebb1fec9 100644 --- a/apps/tasks/Cargo.toml +++ b/apps/tasks/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tasks" -version = "1.8.1" +version = "1.9.0" edition = "2021" rust-version = "1.87" description = "The tasks app of the suite: every process grouped as the dock names it, safe to close and end." @@ -36,6 +36,7 @@ serde = { workspace = true } serde_json = { workspace = true } # The features of this package only: the dock's release build selects the root package alone, so none reaches dock.exe. windows = { workspace = true, features = [ + "Wdk_System_Threading", "Win32_Foundation", "Win32_Graphics_Dwm", "Win32_Graphics_Gdi", @@ -45,6 +46,7 @@ windows = { workspace = true, features = [ "Win32_System_Console", "Win32_System_DataExchange", "Win32_System_LibraryLoader", + "Win32_System_Ole", "Win32_System_Performance", "Win32_System_Power", "Win32_System_ProcessStatus", @@ -53,9 +55,11 @@ windows = { workspace = true, features = [ "Win32_System_Services", "Win32_System_SystemInformation", "Win32_System_Threading", + "Win32_System_Variant", "Win32_UI_Accessibility", "Win32_UI_Input_KeyboardAndMouse", "Win32_UI_Shell", + "Win32_UI_Shell_Common", "Win32_UI_WindowsAndMessaging", ] } diff --git a/apps/tasks/examples/sampler_bench.rs b/apps/tasks/examples/sampler_bench.rs index 3b5f4d1e..d2ff68e2 100644 --- a/apps/tasks/examples/sampler_bench.rs +++ b/apps/tasks/examples/sampler_bench.rs @@ -4,9 +4,13 @@ //! //! Prints one JSON line: //! {"bench":"sampler","build":..,"processes":..,"tick_p50_us":..,"tick_p95_us":..,"path_first_us":.., -//! "path_p95_us":..,"cpu_ms":..,"hidden_iterations":..,"hidden_wakes":..} +//! "path_p95_us":..,"cpu_ms":..,"hidden_iterations":..,"hidden_wakes":..,"sys_tick_p95_us":.., +//! "sys_thread_ms":..,"sys_thread_pct":..,"sys_reads":..,"sys_hidden_reads":..} //! cpu_ms is this process's kernel plus user time over the visible phase; hidden_* count the sampler thread's loops -//! and wake-ups over the hidden phase (both must be 0). +//! and wake-ups over the hidden phase (both must be 0). The sys_* fields come from a second run of the same host with +//! the disk, adapter and processor needs on: the tick's p95, the "tasks-sys" thread's own CPU time (sys_thread_pct is +//! its share of one core over the phase, in percent, to three decimals), its reads, and its reads while hidden (must +//! be 0). const MAX_SECS: u64 = 3600; @@ -45,12 +49,17 @@ struct Report { cpu_ms: u64, hidden_iterations: u64, hidden_wakes: u64, + sys_tick_p95_us: u32, + sys_thread_ms: u64, + sys_thread_pct: f64, + sys_reads: u64, + sys_hidden_reads: u64, } impl Report { fn json(&self) -> String { format!( - "{{\"bench\":\"sampler\",\"build\":{},\"processes\":{},\"tick_p50_us\":{},\"tick_p95_us\":{},\"path_first_us\":{},\"path_p95_us\":{},\"cpu_ms\":{},\"hidden_iterations\":{},\"hidden_wakes\":{}}}", + "{{\"bench\":\"sampler\",\"build\":{},\"processes\":{},\"tick_p50_us\":{},\"tick_p95_us\":{},\"path_first_us\":{},\"path_p95_us\":{},\"cpu_ms\":{},\"hidden_iterations\":{},\"hidden_wakes\":{},\"sys_tick_p95_us\":{},\"sys_thread_ms\":{},\"sys_thread_pct\":{:.3},\"sys_reads\":{},\"sys_hidden_reads\":{}}}", self.build, self.processes, self.tick_p50_us, @@ -59,7 +68,12 @@ impl Report { self.path_p95_us, self.cpu_ms, self.hidden_iterations, - self.hidden_wakes + self.hidden_wakes, + self.sys_tick_p95_us, + self.sys_thread_ms, + self.sys_thread_pct, + self.sys_reads, + self.sys_hidden_reads ) } } @@ -74,6 +88,7 @@ mod live { use tasks::engine::frame::Frame; use tasks::engine::host::{default_samplers, FrameSink, SamplerHost}; use tasks::engine::need::{Need, NeedSet}; + use tasks::engine::sysinfo::{sys_reads_total, sys_thread_cpu_100ns}; use windows::Win32::Foundation::FILETIME; use windows::Win32::System::Threading::{GetCurrentProcess, GetProcessTimes}; @@ -134,6 +149,10 @@ mod live { } fn control(visible: bool) -> Control { + control_with(visible, NeedSet::EMPTY) + } + + fn control_with(visible: bool, extra: NeedSet) -> Control { Control { visible, foreground: true, @@ -141,7 +160,9 @@ mod live { display_off: false, refresh: Refresh::One, idle: false, - need: NeedSet::EMPTY.with(Need::Procs).with(Need::Windows).with(Need::Hung).with(Need::PerCore), + need: NeedSet( + NeedSet::EMPTY.with(Need::Procs).with(Need::Windows).with(Need::Hung).with(Need::PerCore).0 | extra.0, + ), } } @@ -172,6 +193,7 @@ mod live { std::thread::sleep(Duration::from_secs(secs)); let after = host.stats(); host.stop(); + let sys = run_sys(secs)?; ticks.sort_unstable(); paths.sort_unstable(); Ok(Report { @@ -184,6 +206,57 @@ mod live { cpu_ms, hidden_iterations: after.iterations.saturating_sub(before.iterations), hidden_wakes: after.wakes.saturating_sub(before.wakes), + sys_tick_p95_us: sys.tick_p95_us, + sys_thread_ms: sys.thread_ms, + sys_thread_pct: sys.thread_pct, + sys_reads: sys.reads, + sys_hidden_reads: sys.hidden_reads, + }) + } + + struct SysRun { + tick_p95_us: u32, + thread_ms: u64, + thread_pct: f64, + reads: u64, + hidden_reads: u64, + } + + /// The same host with the disk, adapter and processor needs on, then hidden. + fn run_sys(secs: u64) -> Result { + let extra = NeedSet::EMPTY.with(Need::Disks).with(Need::Nics).with(Need::CpuFacts); + let (tx, rx) = channel(); + let host = SamplerHost::start(Box::new(Wake(Mutex::new(tx))), default_samplers(), control_with(true, extra)) + .map_err(|e| format!("sampler: {e:?}"))?; + let mut frame = Frame::default(); + let mut ticks: Vec = Vec::new(); + let end = Instant::now() + Duration::from_secs(secs); + let mut started = None; + while Instant::now() < end { + if rx.recv_timeout(Duration::from_millis(250)).is_err() || !host.take(&mut frame) { + continue; + } + // The first frame starts the thread, so its start-up is inside the measured time. + started.get_or_insert((Instant::now(), sys_thread_cpu_100ns(), sys_reads_total())); + ticks.push(frame.tick_us); + } + let (t0, cpu0, reads0) = started.unwrap_or((Instant::now(), 0, 0)); + let wall = t0.elapsed().as_secs_f64().max(0.001); + let thread_100ns = sys_thread_cpu_100ns().saturating_sub(cpu0); + let reads = sys_reads_total().saturating_sub(reads0); + host.set_control(control_with(false, extra)); + std::thread::sleep(Duration::from_millis(500)); + let hidden_from = sys_reads_total(); + std::thread::sleep(Duration::from_secs(secs)); + let hidden_reads = sys_reads_total().saturating_sub(hidden_from); + host.stop(); + ticks.sort_unstable(); + Ok(SysRun { + tick_p95_us: percentile(&ticks, 0.95), + thread_ms: thread_100ns / 10_000, + thread_pct: thread_100ns as f64 / 1e7 / wall * 100.0, + reads, + hidden_reads, }) } } @@ -250,12 +323,17 @@ mod tests { cpu_ms: 5, hidden_iterations: 0, hidden_wakes: 0, + sys_tick_p95_us: 6, + sys_thread_ms: 7, + sys_thread_pct: 0.4567, + sys_reads: 8, + sys_hidden_reads: 0, }; let line = r.json(); assert!(!line.contains('\n')); assert_eq!( line, - "{\"bench\":\"sampler\",\"build\":26300,\"processes\":300,\"tick_p50_us\":1,\"tick_p95_us\":2,\"path_first_us\":3,\"path_p95_us\":4,\"cpu_ms\":5,\"hidden_iterations\":0,\"hidden_wakes\":0}" + "{\"bench\":\"sampler\",\"build\":26300,\"processes\":300,\"tick_p50_us\":1,\"tick_p95_us\":2,\"path_first_us\":3,\"path_p95_us\":4,\"cpu_ms\":5,\"hidden_iterations\":0,\"hidden_wakes\":0,\"sys_tick_p95_us\":6,\"sys_thread_ms\":7,\"sys_thread_pct\":0.457,\"sys_reads\":8,\"sys_hidden_reads\":0}" ); } } diff --git a/apps/tasks/examples/testee.rs b/apps/tasks/examples/testee.rs index d83ea9ac..9eb9af94 100644 --- a/apps/tasks/examples/testee.rs +++ b/apps/tasks/examples/testee.rs @@ -4,6 +4,7 @@ //! testee --alloc [--secs N] commits and touches the pages //! testee --hang-after [--secs N] a plain window that pumps for ms, then stops pumping //! testee --tree [--secs N] one child of itself per level, without a window +//! testee --idle [--secs N] nothing at all, without a window: a child whose priority tests change //! //! Every mode ends after N seconds (default 60, at most 300) and when its parent is gone. use std::time::{Duration, Instant}; @@ -18,6 +19,7 @@ enum Mode { Alloc(u64), HangAfter(u64), Tree(u32), + Idle, } #[derive(Clone, Copy, Debug, PartialEq, Eq)] @@ -48,7 +50,13 @@ fn parse_args(args: &[String]) -> Result { while i < args.len() { let flag = args[i].as_str(); let value = args.get(i + 1); + // Every flag takes a value but --idle. + let mut step = 2; let parsed = match flag { + "--idle" => { + step = 1; + Some(Mode::Idle) + } "--busy" => Some(Mode::Busy(number(flag, value)?.min(256) as u32)), "--alloc" => Some(Mode::Alloc(number(flag, value)?.min(16 * 1024))), "--hang-after" => Some(Mode::HangAfter(number(flag, value)?.min(MAX_SECS * 1000))), @@ -64,7 +72,7 @@ fn parse_args(args: &[String]) -> Result { return Err(ArgError::TwoModes); } } - i += 2; + i += step; } match mode { None => Err(ArgError::NoMode), @@ -233,6 +241,7 @@ fn run(args: Args) -> i32 { child = std::process::Command::new(exe).args(a).creation_flags(CREATE_NO_WINDOW).spawn().ok(); } } + Mode::Idle => {} } while Instant::now() < deadline && !parent.gone() { std::thread::sleep(Duration::from_secs(1).min(deadline.saturating_duration_since(Instant::now()))); @@ -287,6 +296,9 @@ mod tests { assert_eq!(parse_args(&a("--secs 5 --hang-after 5000")), Ok(Args { mode: Mode::HangAfter(5000), secs: 5 })); assert_eq!(parse_args(&a("--tree 3")), Ok(Args { mode: Mode::Tree(3), secs: 60 })); assert_eq!(parse_args(&a("--tree 0")), Ok(Args { mode: Mode::Tree(0), secs: 60 })); + assert_eq!(parse_args(&a("--idle")), Ok(Args { mode: Mode::Idle, secs: 60 })); + assert_eq!(parse_args(&a("--idle --secs 30")), Ok(Args { mode: Mode::Idle, secs: 30 })); + assert_eq!(parse_args(&a("--secs 30 --idle")), Ok(Args { mode: Mode::Idle, secs: 30 })); } #[test] @@ -305,6 +317,8 @@ mod tests { assert_eq!(parse_args(&a("--alloc x")), Err(ArgError::BadValue("--alloc".into()))); assert_eq!(parse_args(&a("--busy 0")), Err(ArgError::BadValue("0".into()))); assert_eq!(parse_args(&a("--busy 1 --tree 1")), Err(ArgError::TwoModes)); + assert_eq!(parse_args(&a("--idle --idle")), Err(ArgError::TwoModes)); + assert_eq!(parse_args(&a("--idle 5")), Err(ArgError::Unknown("5".into()))); assert_eq!(parse_args(&a("--spin 1")), Err(ArgError::Unknown("--spin".into()))); assert_eq!(parse_args(&a("--hang-after -1")), Err(ArgError::BadValue("--hang-after".into()))); } diff --git a/apps/tasks/scenes/band.json b/apps/tasks/scenes/band.json new file mode 100644 index 00000000..78526e2a --- /dev/null +++ b/apps/tasks/scenes/band.json @@ -0,0 +1,375 @@ +{ + "size": [ + 1280, + 672 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 150 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 0 + ], + "threads": 8, + "handles": 150 + }, + { + "pid": 600, + "created": 133500000000600000, + "parent": 0, + "session": 1, + "image": "csrss.exe", + "path": "C:\\Windows\\System32\\csrss.exe", + "cpu": [ + 0.2 + ], + "ws_private": 6291456, + "io": [ + 0 + ], + "threads": 8, + "handles": 150 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.05 + ], + "ws_private": 9437184, + "io": [ + 0 + ], + "threads": 8, + "handles": 150 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.6 + ], + "ws_private": 50331648, + "io": [ + 0 + ], + "threads": 8, + "handles": 150 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 0 + ], + "threads": 8, + "handles": 150 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 0 + ], + "threads": 8, + "handles": 150 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 2.2 + ], + "ws_private": 188743680, + "io": [ + 40000 + ], + "threads": 8, + "handles": 150 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 100663296, + "io": [ + 0 + ], + "threads": 8, + "handles": 150 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2100, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.1 + ], + "ws_private": 54525952, + "io": [ + 0 + ], + "threads": 8, + "handles": 150 + }, + { + "pid": 2200, + "created": 133500000002200000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 1.4 + ], + "ws_private": 73400320, + "io": [ + 0 + ], + "threads": 8, + "handles": 150 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 9 + ], + "ws_private": 2516582400, + "io": [ + 0 + ], + "threads": 8, + "handles": 150, + "base_prio": 10 + }, + { + "pid": 3100, + "created": 133500000003100000, + "parent": 3000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 1 + ], + "ws_private": 325058560, + "io": [ + 0 + ], + "threads": 8, + "handles": 150, + "base_prio": 10 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0.5 + ], + "ws_private": 96468992, + "io": [ + 0 + ], + "threads": 8, + "handles": 150, + "base_prio": 13 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 0 + ], + "threads": 8, + "handles": 150, + "base_prio": 6 + }, + { + "pid": 7001, + "created": 133500000007001000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 39845888, + "io": [ + 0 + ], + "threads": 8, + "handles": 150, + "base_prio": 6 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "notes.exe", + "path": "C:\\Tools\\notes.exe", + "cpu": [ + 0.3 + ], + "ws_private": 12582912, + "io": [ + 0 + ], + "threads": 8, + "handles": 150 + }, + { + "pid": 7700, + "created": 133500000007700000, + "parent": 1000, + "session": 2, + "image": "remote.exe", + "path": "C:\\Program Files\\Remote\\remote.exe", + "cpu": [ + 0.1 + ], + "ws_private": 10485760, + "io": [ + 0 + ], + "threads": 3, + "handles": 80 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "orbit-id" + }, + { + "pid": 3000, + "identity": "ember-id" + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": true + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + } + ], + "names": { + "explorer-id": "File Explorer", + "orbit-id": "Orbit", + "ember-id": "Ember", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\notes.exe": "Notes", + "c:\\program files\\remote\\remote.exe": "Remote" + }, + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#4a90d9", + "orbit-id": "#d98a4a", + "ember-id": "#d94a5e", + "quill-id": "#8a4ad9" + } +} diff --git a/apps/tasks/scenes/details_chooser.json b/apps/tasks/scenes/details_chooser.json new file mode 100644 index 00000000..00949da9 --- /dev/null +++ b/apps/tasks/scenes/details_chooser.json @@ -0,0 +1,441 @@ +{ + "size": [ + 1120, + 620 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 60 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 16, + "handles": 0, + "base_prio": 8 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 5000 + ], + "threads": 176, + "handles": 3120, + "base_prio": 8 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.3 + ], + "ws_private": 188743680, + "io": [ + 3000 + ], + "threads": 61, + "handles": 3401, + "base_prio": 8 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 6.5 + ], + "ws_private": 220200960, + "io": [ + 42000 + ], + "threads": 34, + "handles": 880, + "base_prio": 8 + }, + { + "pid": 2010, + "created": 133500000002010000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 12.2 + ], + "ws_private": 335544320, + "io": [ + 8000 + ], + "threads": 22, + "handles": 540, + "base_prio": 8 + }, + { + "pid": 2020, + "created": 133500000002020000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 2.1 + ], + "ws_private": 492830720, + "io": [ + 1000 + ], + "threads": 17, + "handles": 410, + "base_prio": 8 + }, + { + "pid": 2030, + "created": 133500000002030000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 0.2 + ], + "ws_private": 96468992, + "io": [ + 0 + ], + "threads": 12, + "handles": 260, + "base_prio": 8 + }, + { + "pid": 2040, + "created": 133500000002040000, + "parent": 2000, + "session": 1, + "image": "ember_report.exe", + "path": "C:\\Program Files\\Ember\\ember_report.exe", + "cpu": [ + 0 + ], + "ws_private": 6291456, + "io": [ + 0 + ], + "threads": 4, + "handles": 90, + "base_prio": 8 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.5 + ], + "ws_private": 167772160, + "io": [ + 9000 + ], + "threads": 12, + "handles": 230, + "base_prio": 8 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 2000 + ], + "threads": 14, + "handles": 480, + "base_prio": 8 + }, + { + "pid": 5100, + "created": 133500000005100000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0 + ], + "ws_private": 15728640, + "io": [ + 0 + ], + "threads": 9, + "handles": 310, + "base_prio": 8 + }, + { + "pid": 6000, + "created": 133500000006000000, + "parent": 1000, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\Harbor\\harbor.exe", + "cpu": [ + 0 + ], + "ws_private": 60817408, + "io": [ + 0 + ], + "threads": 7, + "handles": 150, + "base_prio": 6 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 241172480, + "io": [ + 0 + ], + "threads": 13, + "handles": 220, + "base_prio": 8 + }, + { + "pid": 8000, + "created": 133500000008000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270, + "base_prio": 13 + }, + { + "pid": 9000, + "created": 133500000009000000, + "parent": 1000, + "session": 1, + "image": "nova.exe", + "path": "C:\\Program Files\\Nova\\nova.exe", + "cpu": [ + 0.3 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 6, + "handles": 140, + "base_prio": 8 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 6000, + "identity": "harbor-id" + }, + { + "pid": 7000, + "identity": "quill-id", + "hung": true + } + ], + "hung_s": 30, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "harbor-id": "Harbor", + "quill-id": "Quill", + "c:\\windows\\explorer.exe": "File Explorer", + "c:\\program files\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\harbor\\harbor.exe": "Harbor", + "c:\\program files\\quill\\quill.exe": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\nova\\nova.exe": "Nova" + }, + "services": [ + { + "pid": 5000, + "name": "LocalSvc", + "display": "Local Service Host" + }, + { + "pid": 5100, + "name": "NetSvc", + "display": "Network Service Host" + } + ], + "collapsed": { + "windows": false + }, + "page": "details", + "facts": [ + { + "pid": 4, + "user": "SYSTEM", + "class": "normal", + "efficiency": false + }, + { + "pid": 1000, + "user": "Mara", + "command_line": "C:\\\\Windows\\\\Explorer.EXE", + "class": "normal", + "efficiency": false + }, + { + "pid": 2000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 2010, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=gpu-process --gpu-preferences=UAAAAAAAAADgAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "class": "normal", + "efficiency": false + }, + { + "pid": 2020, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=renderer --lang=it --device-scale-factor=1", + "class": "normal", + "efficiency": false + }, + { + "pid": 2030, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=utility --utility-sub-type=network.mojom.NetworkService", + "class": "normal", + "efficiency": true + }, + { + "pid": 2040, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=crashpad-handler /prefetch:7", + "class": "normal", + "efficiency": false + }, + { + "pid": 3000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Prism\\\\prism.exe\"", + "class": "above", + "efficiency": false + }, + { + "pid": 5000, + "user": "SERVIZIO LOCALE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k LocalService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 5100, + "user": "SERVIZIO DI RETE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k NetworkService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 6000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Harbor\\\\harbor.exe\" --quiet", + "class": "below", + "efficiency": true + }, + { + "pid": 7000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Quill\\\\quill.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 8000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Syncer\\\\syncer.exe\" --profile=\"C:\\\\Users\\\\Mara\\\\AppData\\\\Roaming\\\\Syncer\\\\profiles\\\\default\" --watch=\"D:\\\\Projects\\\\Archive\\\\2026\" --log-level=verbose --retry=5 --background", + "class": "high", + "efficiency": false + }, + { + "pid": 9000, + "unavailable": true + } + ], + "input": [ + "right_click 650,120" + ] +} diff --git a/apps/tasks/scenes/details_cmdline_tip.json b/apps/tasks/scenes/details_cmdline_tip.json new file mode 100644 index 00000000..a669d138 --- /dev/null +++ b/apps/tasks/scenes/details_cmdline_tip.json @@ -0,0 +1,474 @@ +{ + "size": [ + 1700, + 620 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 60 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 16, + "handles": 0, + "base_prio": 8 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 5000 + ], + "threads": 176, + "handles": 3120, + "base_prio": 8 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.3 + ], + "ws_private": 188743680, + "io": [ + 3000 + ], + "threads": 61, + "handles": 3401, + "base_prio": 8 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 6.5 + ], + "ws_private": 220200960, + "io": [ + 42000 + ], + "threads": 34, + "handles": 880, + "base_prio": 8 + }, + { + "pid": 2010, + "created": 133500000002010000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 12.2 + ], + "ws_private": 335544320, + "io": [ + 8000 + ], + "threads": 22, + "handles": 540, + "base_prio": 8 + }, + { + "pid": 2020, + "created": 133500000002020000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 2.1 + ], + "ws_private": 492830720, + "io": [ + 1000 + ], + "threads": 17, + "handles": 410, + "base_prio": 8 + }, + { + "pid": 2030, + "created": 133500000002030000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 0.2 + ], + "ws_private": 96468992, + "io": [ + 0 + ], + "threads": 12, + "handles": 260, + "base_prio": 8 + }, + { + "pid": 2040, + "created": 133500000002040000, + "parent": 2000, + "session": 1, + "image": "ember_report.exe", + "path": "C:\\Program Files\\Ember\\ember_report.exe", + "cpu": [ + 0 + ], + "ws_private": 6291456, + "io": [ + 0 + ], + "threads": 4, + "handles": 90, + "base_prio": 8 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.5 + ], + "ws_private": 167772160, + "io": [ + 9000 + ], + "threads": 12, + "handles": 230, + "base_prio": 8 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 2000 + ], + "threads": 14, + "handles": 480, + "base_prio": 8 + }, + { + "pid": 5100, + "created": 133500000005100000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0 + ], + "ws_private": 15728640, + "io": [ + 0 + ], + "threads": 9, + "handles": 310, + "base_prio": 8 + }, + { + "pid": 6000, + "created": 133500000006000000, + "parent": 1000, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\Harbor\\harbor.exe", + "cpu": [ + 0 + ], + "ws_private": 60817408, + "io": [ + 0 + ], + "threads": 7, + "handles": 150, + "base_prio": 6 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 241172480, + "io": [ + 0 + ], + "threads": 13, + "handles": 220, + "base_prio": 8 + }, + { + "pid": 8000, + "created": 133500000008000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270, + "base_prio": 13 + }, + { + "pid": 9000, + "created": 133500000009000000, + "parent": 1000, + "session": 1, + "image": "nova.exe", + "path": "C:\\Program Files\\Nova\\nova.exe", + "cpu": [ + 0.3 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 6, + "handles": 140, + "base_prio": 8 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 6000, + "identity": "harbor-id" + }, + { + "pid": 7000, + "identity": "quill-id", + "hung": true + } + ], + "hung_s": 30, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "harbor-id": "Harbor", + "quill-id": "Quill", + "c:\\windows\\explorer.exe": "File Explorer", + "c:\\program files\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\harbor\\harbor.exe": "Harbor", + "c:\\program files\\quill\\quill.exe": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\nova\\nova.exe": "Nova" + }, + "services": [ + { + "pid": 5000, + "name": "LocalSvc", + "display": "Local Service Host" + }, + { + "pid": 5100, + "name": "NetSvc", + "display": "Network Service Host" + } + ], + "collapsed": { + "windows": false + }, + "page": "details", + "facts": [ + { + "pid": 4, + "user": "SYSTEM", + "class": "normal", + "efficiency": false + }, + { + "pid": 1000, + "user": "Mara", + "command_line": "C:\\\\Windows\\\\Explorer.EXE", + "class": "normal", + "efficiency": false + }, + { + "pid": 2000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 2010, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=gpu-process --gpu-preferences=UAAAAAAAAADgAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "class": "normal", + "efficiency": false + }, + { + "pid": 2020, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=renderer --lang=it --device-scale-factor=1", + "class": "normal", + "efficiency": false + }, + { + "pid": 2030, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=utility --utility-sub-type=network.mojom.NetworkService", + "class": "normal", + "efficiency": true + }, + { + "pid": 2040, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=crashpad-handler /prefetch:7", + "class": "normal", + "efficiency": false + }, + { + "pid": 3000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Prism\\\\prism.exe\"", + "class": "above", + "efficiency": false + }, + { + "pid": 5000, + "user": "SERVIZIO LOCALE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k LocalService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 5100, + "user": "SERVIZIO DI RETE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k NetworkService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 6000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Harbor\\\\harbor.exe\" --quiet", + "class": "below", + "efficiency": true + }, + { + "pid": 7000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Quill\\\\quill.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 8000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Syncer\\\\syncer.exe\" --profile=\"C:\\\\Users\\\\Mara\\\\AppData\\\\Roaming\\\\Syncer\\\\profiles\\\\default\" --watch=\"D:\\\\Projects\\\\Archive\\\\2026\" --log-level=verbose --retry=5 --background", + "class": "high", + "efficiency": false + }, + { + "pid": 9000, + "unavailable": true + } + ], + "details_columns": [ + { + "id": "name", + "width": 200, + "visible": true + }, + { + "id": "pid", + "width": 72, + "visible": true + }, + { + "id": "user", + "width": 140, + "visible": true + }, + { + "id": "cpu", + "width": 80, + "visible": true + }, + { + "id": "memory", + "width": 100, + "visible": true + }, + { + "id": "command_line", + "width": 320, + "visible": true + } + ], + "input": [ + "hover 1300,440", + "advance 1500" + ] +} diff --git a/apps/tasks/scenes/details_columns_menu.json b/apps/tasks/scenes/details_columns_menu.json new file mode 100644 index 00000000..980b0dc9 --- /dev/null +++ b/apps/tasks/scenes/details_columns_menu.json @@ -0,0 +1,442 @@ +{ + "size": [ + 1120, + 620 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 60 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 16, + "handles": 0, + "base_prio": 8 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 5000 + ], + "threads": 176, + "handles": 3120, + "base_prio": 8 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.3 + ], + "ws_private": 188743680, + "io": [ + 3000 + ], + "threads": 61, + "handles": 3401, + "base_prio": 8 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 6.5 + ], + "ws_private": 220200960, + "io": [ + 42000 + ], + "threads": 34, + "handles": 880, + "base_prio": 8 + }, + { + "pid": 2010, + "created": 133500000002010000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 12.2 + ], + "ws_private": 335544320, + "io": [ + 8000 + ], + "threads": 22, + "handles": 540, + "base_prio": 8 + }, + { + "pid": 2020, + "created": 133500000002020000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 2.1 + ], + "ws_private": 492830720, + "io": [ + 1000 + ], + "threads": 17, + "handles": 410, + "base_prio": 8 + }, + { + "pid": 2030, + "created": 133500000002030000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 0.2 + ], + "ws_private": 96468992, + "io": [ + 0 + ], + "threads": 12, + "handles": 260, + "base_prio": 8 + }, + { + "pid": 2040, + "created": 133500000002040000, + "parent": 2000, + "session": 1, + "image": "ember_report.exe", + "path": "C:\\Program Files\\Ember\\ember_report.exe", + "cpu": [ + 0 + ], + "ws_private": 6291456, + "io": [ + 0 + ], + "threads": 4, + "handles": 90, + "base_prio": 8 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.5 + ], + "ws_private": 167772160, + "io": [ + 9000 + ], + "threads": 12, + "handles": 230, + "base_prio": 8 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 2000 + ], + "threads": 14, + "handles": 480, + "base_prio": 8 + }, + { + "pid": 5100, + "created": 133500000005100000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0 + ], + "ws_private": 15728640, + "io": [ + 0 + ], + "threads": 9, + "handles": 310, + "base_prio": 8 + }, + { + "pid": 6000, + "created": 133500000006000000, + "parent": 1000, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\Harbor\\harbor.exe", + "cpu": [ + 0 + ], + "ws_private": 60817408, + "io": [ + 0 + ], + "threads": 7, + "handles": 150, + "base_prio": 6 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 241172480, + "io": [ + 0 + ], + "threads": 13, + "handles": 220, + "base_prio": 8 + }, + { + "pid": 8000, + "created": 133500000008000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270, + "base_prio": 13 + }, + { + "pid": 9000, + "created": 133500000009000000, + "parent": 1000, + "session": 1, + "image": "nova.exe", + "path": "C:\\Program Files\\Nova\\nova.exe", + "cpu": [ + 0.3 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 6, + "handles": 140, + "base_prio": 8 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 6000, + "identity": "harbor-id" + }, + { + "pid": 7000, + "identity": "quill-id", + "hung": true + } + ], + "hung_s": 30, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "harbor-id": "Harbor", + "quill-id": "Quill", + "c:\\windows\\explorer.exe": "File Explorer", + "c:\\program files\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\harbor\\harbor.exe": "Harbor", + "c:\\program files\\quill\\quill.exe": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\nova\\nova.exe": "Nova" + }, + "services": [ + { + "pid": 5000, + "name": "LocalSvc", + "display": "Local Service Host" + }, + { + "pid": 5100, + "name": "NetSvc", + "display": "Network Service Host" + } + ], + "collapsed": { + "windows": false + }, + "page": "details", + "facts": [ + { + "pid": 4, + "user": "SYSTEM", + "class": "normal", + "efficiency": false + }, + { + "pid": 1000, + "user": "Mara", + "command_line": "C:\\\\Windows\\\\Explorer.EXE", + "class": "normal", + "efficiency": false + }, + { + "pid": 2000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 2010, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=gpu-process --gpu-preferences=UAAAAAAAAADgAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "class": "normal", + "efficiency": false + }, + { + "pid": 2020, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=renderer --lang=it --device-scale-factor=1", + "class": "normal", + "efficiency": false + }, + { + "pid": 2030, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=utility --utility-sub-type=network.mojom.NetworkService", + "class": "normal", + "efficiency": true + }, + { + "pid": 2040, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=crashpad-handler /prefetch:7", + "class": "normal", + "efficiency": false + }, + { + "pid": 3000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Prism\\\\prism.exe\"", + "class": "above", + "efficiency": false + }, + { + "pid": 5000, + "user": "SERVIZIO LOCALE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k LocalService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 5100, + "user": "SERVIZIO DI RETE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k NetworkService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 6000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Harbor\\\\harbor.exe\" --quiet", + "class": "below", + "efficiency": true + }, + { + "pid": 7000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Quill\\\\quill.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 8000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Syncer\\\\syncer.exe\" --profile=\"C:\\\\Users\\\\Mara\\\\AppData\\\\Roaming\\\\Syncer\\\\profiles\\\\default\" --watch=\"D:\\\\Projects\\\\Archive\\\\2026\" --log-level=verbose --retry=5 --background", + "class": "high", + "efficiency": false + }, + { + "pid": 9000, + "unavailable": true + } + ], + "input": [ + "click 400,152", + "command columns" + ] +} diff --git a/apps/tasks/scenes/details_default.json b/apps/tasks/scenes/details_default.json new file mode 100644 index 00000000..74209045 --- /dev/null +++ b/apps/tasks/scenes/details_default.json @@ -0,0 +1,438 @@ +{ + "size": [ + 1120, + 620 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 60 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 16, + "handles": 0, + "base_prio": 8 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 5000 + ], + "threads": 176, + "handles": 3120, + "base_prio": 8 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.3 + ], + "ws_private": 188743680, + "io": [ + 3000 + ], + "threads": 61, + "handles": 3401, + "base_prio": 8 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 6.5 + ], + "ws_private": 220200960, + "io": [ + 42000 + ], + "threads": 34, + "handles": 880, + "base_prio": 8 + }, + { + "pid": 2010, + "created": 133500000002010000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 12.2 + ], + "ws_private": 335544320, + "io": [ + 8000 + ], + "threads": 22, + "handles": 540, + "base_prio": 8 + }, + { + "pid": 2020, + "created": 133500000002020000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 2.1 + ], + "ws_private": 492830720, + "io": [ + 1000 + ], + "threads": 17, + "handles": 410, + "base_prio": 8 + }, + { + "pid": 2030, + "created": 133500000002030000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 0.2 + ], + "ws_private": 96468992, + "io": [ + 0 + ], + "threads": 12, + "handles": 260, + "base_prio": 8 + }, + { + "pid": 2040, + "created": 133500000002040000, + "parent": 2000, + "session": 1, + "image": "ember_report.exe", + "path": "C:\\Program Files\\Ember\\ember_report.exe", + "cpu": [ + 0 + ], + "ws_private": 6291456, + "io": [ + 0 + ], + "threads": 4, + "handles": 90, + "base_prio": 8 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.5 + ], + "ws_private": 167772160, + "io": [ + 9000 + ], + "threads": 12, + "handles": 230, + "base_prio": 8 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 2000 + ], + "threads": 14, + "handles": 480, + "base_prio": 8 + }, + { + "pid": 5100, + "created": 133500000005100000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0 + ], + "ws_private": 15728640, + "io": [ + 0 + ], + "threads": 9, + "handles": 310, + "base_prio": 8 + }, + { + "pid": 6000, + "created": 133500000006000000, + "parent": 1000, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\Harbor\\harbor.exe", + "cpu": [ + 0 + ], + "ws_private": 60817408, + "io": [ + 0 + ], + "threads": 7, + "handles": 150, + "base_prio": 6 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 241172480, + "io": [ + 0 + ], + "threads": 13, + "handles": 220, + "base_prio": 8 + }, + { + "pid": 8000, + "created": 133500000008000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270, + "base_prio": 13 + }, + { + "pid": 9000, + "created": 133500000009000000, + "parent": 1000, + "session": 1, + "image": "nova.exe", + "path": "C:\\Program Files\\Nova\\nova.exe", + "cpu": [ + 0.3 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 6, + "handles": 140, + "base_prio": 8 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 6000, + "identity": "harbor-id" + }, + { + "pid": 7000, + "identity": "quill-id", + "hung": true + } + ], + "hung_s": 30, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "harbor-id": "Harbor", + "quill-id": "Quill", + "c:\\windows\\explorer.exe": "File Explorer", + "c:\\program files\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\harbor\\harbor.exe": "Harbor", + "c:\\program files\\quill\\quill.exe": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\nova\\nova.exe": "Nova" + }, + "services": [ + { + "pid": 5000, + "name": "LocalSvc", + "display": "Local Service Host" + }, + { + "pid": 5100, + "name": "NetSvc", + "display": "Network Service Host" + } + ], + "collapsed": { + "windows": false + }, + "page": "details", + "facts": [ + { + "pid": 4, + "user": "SYSTEM", + "class": "normal", + "efficiency": false + }, + { + "pid": 1000, + "user": "Mara", + "command_line": "C:\\\\Windows\\\\Explorer.EXE", + "class": "normal", + "efficiency": false + }, + { + "pid": 2000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 2010, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=gpu-process --gpu-preferences=UAAAAAAAAADgAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "class": "normal", + "efficiency": false + }, + { + "pid": 2020, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=renderer --lang=it --device-scale-factor=1", + "class": "normal", + "efficiency": false + }, + { + "pid": 2030, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=utility --utility-sub-type=network.mojom.NetworkService", + "class": "normal", + "efficiency": true + }, + { + "pid": 2040, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=crashpad-handler /prefetch:7", + "class": "normal", + "efficiency": false + }, + { + "pid": 3000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Prism\\\\prism.exe\"", + "class": "above", + "efficiency": false + }, + { + "pid": 5000, + "user": "SERVIZIO LOCALE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k LocalService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 5100, + "user": "SERVIZIO DI RETE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k NetworkService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 6000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Harbor\\\\harbor.exe\" --quiet", + "class": "below", + "efficiency": true + }, + { + "pid": 7000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Quill\\\\quill.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 8000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Syncer\\\\syncer.exe\" --profile=\"C:\\\\Users\\\\Mara\\\\AppData\\\\Roaming\\\\Syncer\\\\profiles\\\\default\" --watch=\"D:\\\\Projects\\\\Archive\\\\2026\" --log-level=verbose --retry=5 --background", + "class": "high", + "efficiency": false + }, + { + "pid": 9000, + "unavailable": true + } + ] +} diff --git a/apps/tasks/scenes/details_hidden_shown.json b/apps/tasks/scenes/details_hidden_shown.json new file mode 100644 index 00000000..75432782 --- /dev/null +++ b/apps/tasks/scenes/details_hidden_shown.json @@ -0,0 +1,505 @@ +{ + "size": [ + 1700, + 620 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 60 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 16, + "handles": 0, + "base_prio": 8 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 5000 + ], + "threads": 176, + "handles": 3120, + "base_prio": 8 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.3 + ], + "ws_private": 188743680, + "io": [ + 3000 + ], + "threads": 61, + "handles": 3401, + "base_prio": 8 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 6.5 + ], + "ws_private": 220200960, + "io": [ + 42000 + ], + "threads": 34, + "handles": 880, + "base_prio": 8 + }, + { + "pid": 2010, + "created": 133500000002010000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 12.2 + ], + "ws_private": 335544320, + "io": [ + 8000 + ], + "threads": 22, + "handles": 540, + "base_prio": 8 + }, + { + "pid": 2020, + "created": 133500000002020000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 2.1 + ], + "ws_private": 492830720, + "io": [ + 1000 + ], + "threads": 17, + "handles": 410, + "base_prio": 8 + }, + { + "pid": 2030, + "created": 133500000002030000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 0.2 + ], + "ws_private": 96468992, + "io": [ + 0 + ], + "threads": 12, + "handles": 260, + "base_prio": 8 + }, + { + "pid": 2040, + "created": 133500000002040000, + "parent": 2000, + "session": 1, + "image": "ember_report.exe", + "path": "C:\\Program Files\\Ember\\ember_report.exe", + "cpu": [ + 0 + ], + "ws_private": 6291456, + "io": [ + 0 + ], + "threads": 4, + "handles": 90, + "base_prio": 8 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.5 + ], + "ws_private": 167772160, + "io": [ + 9000 + ], + "threads": 12, + "handles": 230, + "base_prio": 8 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 2000 + ], + "threads": 14, + "handles": 480, + "base_prio": 8 + }, + { + "pid": 5100, + "created": 133500000005100000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0 + ], + "ws_private": 15728640, + "io": [ + 0 + ], + "threads": 9, + "handles": 310, + "base_prio": 8 + }, + { + "pid": 6000, + "created": 133500000006000000, + "parent": 1000, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\Harbor\\harbor.exe", + "cpu": [ + 0 + ], + "ws_private": 60817408, + "io": [ + 0 + ], + "threads": 7, + "handles": 150, + "base_prio": 6 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 241172480, + "io": [ + 0 + ], + "threads": 13, + "handles": 220, + "base_prio": 8 + }, + { + "pid": 8000, + "created": 133500000008000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270, + "base_prio": 13 + }, + { + "pid": 9000, + "created": 133500000009000000, + "parent": 1000, + "session": 1, + "image": "nova.exe", + "path": "C:\\Program Files\\Nova\\nova.exe", + "cpu": [ + 0.3 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 6, + "handles": 140, + "base_prio": 8 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 6000, + "identity": "harbor-id" + }, + { + "pid": 7000, + "identity": "quill-id", + "hung": true + } + ], + "hung_s": 30, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "harbor-id": "Harbor", + "quill-id": "Quill", + "c:\\windows\\explorer.exe": "File Explorer", + "c:\\program files\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\harbor\\harbor.exe": "Harbor", + "c:\\program files\\quill\\quill.exe": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\nova\\nova.exe": "Nova" + }, + "services": [ + { + "pid": 5000, + "name": "LocalSvc", + "display": "Local Service Host" + }, + { + "pid": 5100, + "name": "NetSvc", + "display": "Network Service Host" + } + ], + "collapsed": { + "windows": false + }, + "page": "details", + "facts": [ + { + "pid": 4, + "user": "SYSTEM", + "class": "normal", + "efficiency": false + }, + { + "pid": 1000, + "user": "Mara", + "command_line": "C:\\\\Windows\\\\Explorer.EXE", + "class": "normal", + "efficiency": false + }, + { + "pid": 2000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 2010, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=gpu-process --gpu-preferences=UAAAAAAAAADgAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "class": "normal", + "efficiency": false + }, + { + "pid": 2020, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=renderer --lang=it --device-scale-factor=1", + "class": "normal", + "efficiency": false + }, + { + "pid": 2030, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=utility --utility-sub-type=network.mojom.NetworkService", + "class": "normal", + "efficiency": true + }, + { + "pid": 2040, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=crashpad-handler /prefetch:7", + "class": "normal", + "efficiency": false + }, + { + "pid": 3000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Prism\\\\prism.exe\"", + "class": "above", + "efficiency": false + }, + { + "pid": 5000, + "user": "SERVIZIO LOCALE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k LocalService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 5100, + "user": "SERVIZIO DI RETE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k NetworkService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 6000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Harbor\\\\harbor.exe\" --quiet", + "class": "below", + "efficiency": true + }, + { + "pid": 7000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Quill\\\\quill.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 8000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Syncer\\\\syncer.exe\" --profile=\"C:\\\\Users\\\\Mara\\\\AppData\\\\Roaming\\\\Syncer\\\\profiles\\\\default\" --watch=\"D:\\\\Projects\\\\Archive\\\\2026\" --log-level=verbose --retry=5 --background", + "class": "high", + "efficiency": false + }, + { + "pid": 9000, + "unavailable": true + } + ], + "details_columns": [ + { + "id": "name", + "width": 200, + "visible": true + }, + { + "id": "pid", + "width": 72, + "visible": true + }, + { + "id": "status", + "width": 112, + "visible": true + }, + { + "id": "user", + "width": 140, + "visible": true + }, + { + "id": "cpu", + "width": 80, + "visible": true + }, + { + "id": "memory", + "width": 100, + "visible": true + }, + { + "id": "image", + "width": 140, + "visible": true + }, + { + "id": "priority", + "width": 110, + "visible": true + }, + { + "id": "threads", + "width": 72, + "visible": true + }, + { + "id": "handles", + "width": 80, + "visible": true + }, + { + "id": "session", + "width": 72, + "visible": true + }, + { + "id": "command_line", + "width": 300, + "visible": true + }, + { + "id": "path", + "width": 240, + "visible": true + } + ] +} diff --git a/apps/tasks/scenes/details_landing.json b/apps/tasks/scenes/details_landing.json new file mode 100644 index 00000000..7e21d85e --- /dev/null +++ b/apps/tasks/scenes/details_landing.json @@ -0,0 +1,441 @@ +{ + "size": [ + 1120, + 520 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 60 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 16, + "handles": 0, + "base_prio": 8 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 5000 + ], + "threads": 176, + "handles": 3120, + "base_prio": 8 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.3 + ], + "ws_private": 188743680, + "io": [ + 3000 + ], + "threads": 61, + "handles": 3401, + "base_prio": 8 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 6.5 + ], + "ws_private": 220200960, + "io": [ + 42000 + ], + "threads": 34, + "handles": 880, + "base_prio": 8 + }, + { + "pid": 2010, + "created": 133500000002010000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 12.2 + ], + "ws_private": 335544320, + "io": [ + 8000 + ], + "threads": 22, + "handles": 540, + "base_prio": 8 + }, + { + "pid": 2020, + "created": 133500000002020000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 2.1 + ], + "ws_private": 492830720, + "io": [ + 1000 + ], + "threads": 17, + "handles": 410, + "base_prio": 8 + }, + { + "pid": 2030, + "created": 133500000002030000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 0.2 + ], + "ws_private": 96468992, + "io": [ + 0 + ], + "threads": 12, + "handles": 260, + "base_prio": 8 + }, + { + "pid": 2040, + "created": 133500000002040000, + "parent": 2000, + "session": 1, + "image": "ember_report.exe", + "path": "C:\\Program Files\\Ember\\ember_report.exe", + "cpu": [ + 0 + ], + "ws_private": 6291456, + "io": [ + 0 + ], + "threads": 4, + "handles": 90, + "base_prio": 8 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.5 + ], + "ws_private": 167772160, + "io": [ + 9000 + ], + "threads": 12, + "handles": 230, + "base_prio": 8 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 2000 + ], + "threads": 14, + "handles": 480, + "base_prio": 8 + }, + { + "pid": 5100, + "created": 133500000005100000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0 + ], + "ws_private": 15728640, + "io": [ + 0 + ], + "threads": 9, + "handles": 310, + "base_prio": 8 + }, + { + "pid": 6000, + "created": 133500000006000000, + "parent": 1000, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\Harbor\\harbor.exe", + "cpu": [ + 0 + ], + "ws_private": 60817408, + "io": [ + 0 + ], + "threads": 7, + "handles": 150, + "base_prio": 6 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 241172480, + "io": [ + 0 + ], + "threads": 13, + "handles": 220, + "base_prio": 8 + }, + { + "pid": 8000, + "created": 133500000008000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270, + "base_prio": 13 + }, + { + "pid": 9000, + "created": 133500000009000000, + "parent": 1000, + "session": 1, + "image": "nova.exe", + "path": "C:\\Program Files\\Nova\\nova.exe", + "cpu": [ + 0.3 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 6, + "handles": 140, + "base_prio": 8 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 6000, + "identity": "harbor-id" + }, + { + "pid": 7000, + "identity": "quill-id", + "hung": true + } + ], + "hung_s": 30, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "harbor-id": "Harbor", + "quill-id": "Quill", + "c:\\windows\\explorer.exe": "File Explorer", + "c:\\program files\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\harbor\\harbor.exe": "Harbor", + "c:\\program files\\quill\\quill.exe": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\nova\\nova.exe": "Nova" + }, + "services": [ + { + "pid": 5000, + "name": "LocalSvc", + "display": "Local Service Host" + }, + { + "pid": 5100, + "name": "NetSvc", + "display": "Network Service Host" + } + ], + "collapsed": { + "windows": false + }, + "facts": [ + { + "pid": 4, + "user": "SYSTEM", + "class": "normal", + "efficiency": false + }, + { + "pid": 1000, + "user": "Mara", + "command_line": "C:\\\\Windows\\\\Explorer.EXE", + "class": "normal", + "efficiency": false + }, + { + "pid": 2000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 2010, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=gpu-process --gpu-preferences=UAAAAAAAAADgAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "class": "normal", + "efficiency": false + }, + { + "pid": 2020, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=renderer --lang=it --device-scale-factor=1", + "class": "normal", + "efficiency": false + }, + { + "pid": 2030, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=utility --utility-sub-type=network.mojom.NetworkService", + "class": "normal", + "efficiency": true + }, + { + "pid": 2040, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=crashpad-handler /prefetch:7", + "class": "normal", + "efficiency": false + }, + { + "pid": 3000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Prism\\\\prism.exe\"", + "class": "above", + "efficiency": false + }, + { + "pid": 5000, + "user": "SERVIZIO LOCALE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k LocalService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 5100, + "user": "SERVIZIO DI RETE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k NetworkService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 6000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Harbor\\\\harbor.exe\" --quiet", + "class": "below", + "efficiency": true + }, + { + "pid": 7000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Quill\\\\quill.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 8000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Syncer\\\\syncer.exe\" --profile=\"C:\\\\Users\\\\Mara\\\\AppData\\\\Roaming\\\\Syncer\\\\profiles\\\\default\" --watch=\"D:\\\\Projects\\\\Archive\\\\2026\" --log-level=verbose --retry=5 --background", + "class": "high", + "efficiency": false + }, + { + "pid": 9000, + "unavailable": true + } + ], + "input": [ + "click 400,352", + "command go_details" + ] +} diff --git a/apps/tasks/scenes/details_loading.json b/apps/tasks/scenes/details_loading.json new file mode 100644 index 00000000..1664c38d --- /dev/null +++ b/apps/tasks/scenes/details_loading.json @@ -0,0 +1,342 @@ +{ + "size": [ + 1120, + 620 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 60 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 16, + "handles": 0, + "base_prio": 8 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 5000 + ], + "threads": 176, + "handles": 3120, + "base_prio": 8 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.3 + ], + "ws_private": 188743680, + "io": [ + 3000 + ], + "threads": 61, + "handles": 3401, + "base_prio": 8 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 6.5 + ], + "ws_private": 220200960, + "io": [ + 42000 + ], + "threads": 34, + "handles": 880, + "base_prio": 8 + }, + { + "pid": 2010, + "created": 133500000002010000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 12.2 + ], + "ws_private": 335544320, + "io": [ + 8000 + ], + "threads": 22, + "handles": 540, + "base_prio": 8 + }, + { + "pid": 2020, + "created": 133500000002020000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 2.1 + ], + "ws_private": 492830720, + "io": [ + 1000 + ], + "threads": 17, + "handles": 410, + "base_prio": 8 + }, + { + "pid": 2030, + "created": 133500000002030000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 0.2 + ], + "ws_private": 96468992, + "io": [ + 0 + ], + "threads": 12, + "handles": 260, + "base_prio": 8 + }, + { + "pid": 2040, + "created": 133500000002040000, + "parent": 2000, + "session": 1, + "image": "ember_report.exe", + "path": "C:\\Program Files\\Ember\\ember_report.exe", + "cpu": [ + 0 + ], + "ws_private": 6291456, + "io": [ + 0 + ], + "threads": 4, + "handles": 90, + "base_prio": 8 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.5 + ], + "ws_private": 167772160, + "io": [ + 9000 + ], + "threads": 12, + "handles": 230, + "base_prio": 8 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 2000 + ], + "threads": 14, + "handles": 480, + "base_prio": 8 + }, + { + "pid": 5100, + "created": 133500000005100000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0 + ], + "ws_private": 15728640, + "io": [ + 0 + ], + "threads": 9, + "handles": 310, + "base_prio": 8 + }, + { + "pid": 6000, + "created": 133500000006000000, + "parent": 1000, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\Harbor\\harbor.exe", + "cpu": [ + 0 + ], + "ws_private": 60817408, + "io": [ + 0 + ], + "threads": 7, + "handles": 150, + "base_prio": 6 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 241172480, + "io": [ + 0 + ], + "threads": 13, + "handles": 220, + "base_prio": 8 + }, + { + "pid": 8000, + "created": 133500000008000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270, + "base_prio": 13 + }, + { + "pid": 9000, + "created": 133500000009000000, + "parent": 1000, + "session": 1, + "image": "nova.exe", + "path": "C:\\Program Files\\Nova\\nova.exe", + "cpu": [ + 0.3 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 6, + "handles": 140, + "base_prio": 8 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 6000, + "identity": "harbor-id" + }, + { + "pid": 7000, + "identity": "quill-id", + "hung": true + } + ], + "hung_s": 30, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "harbor-id": "Harbor", + "quill-id": "Quill", + "c:\\windows\\explorer.exe": "File Explorer", + "c:\\program files\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\harbor\\harbor.exe": "Harbor", + "c:\\program files\\quill\\quill.exe": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\nova\\nova.exe": "Nova" + }, + "services": [ + { + "pid": 5000, + "name": "LocalSvc", + "display": "Local Service Host" + }, + { + "pid": 5100, + "name": "NetSvc", + "display": "Network Service Host" + } + ], + "collapsed": { + "windows": false + }, + "page": "details" +} diff --git a/apps/tasks/scenes/details_no_match.json b/apps/tasks/scenes/details_no_match.json new file mode 100644 index 00000000..e3a51bf6 --- /dev/null +++ b/apps/tasks/scenes/details_no_match.json @@ -0,0 +1,442 @@ +{ + "size": [ + 1120, + 620 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 60 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 16, + "handles": 0, + "base_prio": 8 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 5000 + ], + "threads": 176, + "handles": 3120, + "base_prio": 8 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.3 + ], + "ws_private": 188743680, + "io": [ + 3000 + ], + "threads": 61, + "handles": 3401, + "base_prio": 8 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 6.5 + ], + "ws_private": 220200960, + "io": [ + 42000 + ], + "threads": 34, + "handles": 880, + "base_prio": 8 + }, + { + "pid": 2010, + "created": 133500000002010000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 12.2 + ], + "ws_private": 335544320, + "io": [ + 8000 + ], + "threads": 22, + "handles": 540, + "base_prio": 8 + }, + { + "pid": 2020, + "created": 133500000002020000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 2.1 + ], + "ws_private": 492830720, + "io": [ + 1000 + ], + "threads": 17, + "handles": 410, + "base_prio": 8 + }, + { + "pid": 2030, + "created": 133500000002030000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 0.2 + ], + "ws_private": 96468992, + "io": [ + 0 + ], + "threads": 12, + "handles": 260, + "base_prio": 8 + }, + { + "pid": 2040, + "created": 133500000002040000, + "parent": 2000, + "session": 1, + "image": "ember_report.exe", + "path": "C:\\Program Files\\Ember\\ember_report.exe", + "cpu": [ + 0 + ], + "ws_private": 6291456, + "io": [ + 0 + ], + "threads": 4, + "handles": 90, + "base_prio": 8 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.5 + ], + "ws_private": 167772160, + "io": [ + 9000 + ], + "threads": 12, + "handles": 230, + "base_prio": 8 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 2000 + ], + "threads": 14, + "handles": 480, + "base_prio": 8 + }, + { + "pid": 5100, + "created": 133500000005100000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0 + ], + "ws_private": 15728640, + "io": [ + 0 + ], + "threads": 9, + "handles": 310, + "base_prio": 8 + }, + { + "pid": 6000, + "created": 133500000006000000, + "parent": 1000, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\Harbor\\harbor.exe", + "cpu": [ + 0 + ], + "ws_private": 60817408, + "io": [ + 0 + ], + "threads": 7, + "handles": 150, + "base_prio": 6 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 241172480, + "io": [ + 0 + ], + "threads": 13, + "handles": 220, + "base_prio": 8 + }, + { + "pid": 8000, + "created": 133500000008000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270, + "base_prio": 13 + }, + { + "pid": 9000, + "created": 133500000009000000, + "parent": 1000, + "session": 1, + "image": "nova.exe", + "path": "C:\\Program Files\\Nova\\nova.exe", + "cpu": [ + 0.3 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 6, + "handles": 140, + "base_prio": 8 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 6000, + "identity": "harbor-id" + }, + { + "pid": 7000, + "identity": "quill-id", + "hung": true + } + ], + "hung_s": 30, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "harbor-id": "Harbor", + "quill-id": "Quill", + "c:\\windows\\explorer.exe": "File Explorer", + "c:\\program files\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\harbor\\harbor.exe": "Harbor", + "c:\\program files\\quill\\quill.exe": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\nova\\nova.exe": "Nova" + }, + "services": [ + { + "pid": 5000, + "name": "LocalSvc", + "display": "Local Service Host" + }, + { + "pid": 5100, + "name": "NetSvc", + "display": "Network Service Host" + } + ], + "collapsed": { + "windows": false + }, + "page": "details", + "facts": [ + { + "pid": 4, + "user": "SYSTEM", + "class": "normal", + "efficiency": false + }, + { + "pid": 1000, + "user": "Mara", + "command_line": "C:\\\\Windows\\\\Explorer.EXE", + "class": "normal", + "efficiency": false + }, + { + "pid": 2000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 2010, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=gpu-process --gpu-preferences=UAAAAAAAAADgAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "class": "normal", + "efficiency": false + }, + { + "pid": 2020, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=renderer --lang=it --device-scale-factor=1", + "class": "normal", + "efficiency": false + }, + { + "pid": 2030, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=utility --utility-sub-type=network.mojom.NetworkService", + "class": "normal", + "efficiency": true + }, + { + "pid": 2040, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=crashpad-handler /prefetch:7", + "class": "normal", + "efficiency": false + }, + { + "pid": 3000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Prism\\\\prism.exe\"", + "class": "above", + "efficiency": false + }, + { + "pid": 5000, + "user": "SERVIZIO LOCALE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k LocalService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 5100, + "user": "SERVIZIO DI RETE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k NetworkService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 6000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Harbor\\\\harbor.exe\" --quiet", + "class": "below", + "efficiency": true + }, + { + "pid": 7000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Quill\\\\quill.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 8000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Syncer\\\\syncer.exe\" --profile=\"C:\\\\Users\\\\Mara\\\\AppData\\\\Roaming\\\\Syncer\\\\profiles\\\\default\" --watch=\"D:\\\\Projects\\\\Archive\\\\2026\" --log-level=verbose --retry=5 --background", + "class": "high", + "efficiency": false + }, + { + "pid": 9000, + "unavailable": true + } + ], + "input": [ + "key Ctrl+F", + "type zzzz" + ] +} diff --git a/apps/tasks/scenes/details_unknown_user.json b/apps/tasks/scenes/details_unknown_user.json new file mode 100644 index 00000000..de9531a6 --- /dev/null +++ b/apps/tasks/scenes/details_unknown_user.json @@ -0,0 +1,441 @@ +{ + "size": [ + 1120, + 620 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 60 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 16, + "handles": 0, + "base_prio": 8 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 5000 + ], + "threads": 176, + "handles": 3120, + "base_prio": 8 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.3 + ], + "ws_private": 188743680, + "io": [ + 3000 + ], + "threads": 61, + "handles": 3401, + "base_prio": 8 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 6.5 + ], + "ws_private": 220200960, + "io": [ + 42000 + ], + "threads": 34, + "handles": 880, + "base_prio": 8 + }, + { + "pid": 2010, + "created": 133500000002010000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 12.2 + ], + "ws_private": 335544320, + "io": [ + 8000 + ], + "threads": 22, + "handles": 540, + "base_prio": 8 + }, + { + "pid": 2020, + "created": 133500000002020000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 2.1 + ], + "ws_private": 492830720, + "io": [ + 1000 + ], + "threads": 17, + "handles": 410, + "base_prio": 8 + }, + { + "pid": 2030, + "created": 133500000002030000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 0.2 + ], + "ws_private": 96468992, + "io": [ + 0 + ], + "threads": 12, + "handles": 260, + "base_prio": 8 + }, + { + "pid": 2040, + "created": 133500000002040000, + "parent": 2000, + "session": 1, + "image": "ember_report.exe", + "path": "C:\\Program Files\\Ember\\ember_report.exe", + "cpu": [ + 0 + ], + "ws_private": 6291456, + "io": [ + 0 + ], + "threads": 4, + "handles": 90, + "base_prio": 8 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.5 + ], + "ws_private": 167772160, + "io": [ + 9000 + ], + "threads": 12, + "handles": 230, + "base_prio": 8 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 2000 + ], + "threads": 14, + "handles": 480, + "base_prio": 8 + }, + { + "pid": 5100, + "created": 133500000005100000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0 + ], + "ws_private": 15728640, + "io": [ + 0 + ], + "threads": 9, + "handles": 310, + "base_prio": 8 + }, + { + "pid": 6000, + "created": 133500000006000000, + "parent": 1000, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\Harbor\\harbor.exe", + "cpu": [ + 0 + ], + "ws_private": 60817408, + "io": [ + 0 + ], + "threads": 7, + "handles": 150, + "base_prio": 6 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 241172480, + "io": [ + 0 + ], + "threads": 13, + "handles": 220, + "base_prio": 8 + }, + { + "pid": 8000, + "created": 133500000008000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270, + "base_prio": 13 + }, + { + "pid": 9000, + "created": 133500000009000000, + "parent": 1000, + "session": 1, + "image": "nova.exe", + "path": "C:\\Program Files\\Nova\\nova.exe", + "cpu": [ + 0.3 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 6, + "handles": 140, + "base_prio": 8 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 6000, + "identity": "harbor-id" + }, + { + "pid": 7000, + "identity": "quill-id", + "hung": true + } + ], + "hung_s": 30, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "harbor-id": "Harbor", + "quill-id": "Quill", + "c:\\windows\\explorer.exe": "File Explorer", + "c:\\program files\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\harbor\\harbor.exe": "Harbor", + "c:\\program files\\quill\\quill.exe": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\nova\\nova.exe": "Nova" + }, + "services": [ + { + "pid": 5000, + "name": "LocalSvc", + "display": "Local Service Host" + }, + { + "pid": 5100, + "name": "NetSvc", + "display": "Network Service Host" + } + ], + "collapsed": { + "windows": false + }, + "page": "details", + "facts": [ + { + "pid": 4, + "user": "SYSTEM", + "class": "normal", + "efficiency": false + }, + { + "pid": 1000, + "user": "Mara", + "command_line": "C:\\\\Windows\\\\Explorer.EXE", + "class": "normal", + "efficiency": false + }, + { + "pid": 2000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 2010, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=gpu-process --gpu-preferences=UAAAAAAAAADgAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "class": "normal", + "efficiency": false + }, + { + "pid": 2020, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=renderer --lang=it --device-scale-factor=1", + "class": "normal", + "efficiency": false + }, + { + "pid": 2030, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=utility --utility-sub-type=network.mojom.NetworkService", + "class": "normal", + "efficiency": true + }, + { + "pid": 2040, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=crashpad-handler /prefetch:7", + "class": "normal", + "efficiency": false + }, + { + "pid": 3000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Prism\\\\prism.exe\"", + "class": "above", + "efficiency": false + }, + { + "pid": 5000, + "user": "SERVIZIO LOCALE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k LocalService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 5100, + "user": "SERVIZIO DI RETE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k NetworkService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 6000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Harbor\\\\harbor.exe\" --quiet", + "class": "below", + "efficiency": true + }, + { + "pid": 7000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Quill\\\\quill.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 8000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Syncer\\\\syncer.exe\" --profile=\"C:\\\\Users\\\\Mara\\\\AppData\\\\Roaming\\\\Syncer\\\\profiles\\\\default\" --watch=\"D:\\\\Projects\\\\Archive\\\\2026\" --log-level=verbose --retry=5 --background", + "class": "high", + "efficiency": false + }, + { + "pid": 9000, + "unavailable": true + } + ], + "input": [ + "click 400,344" + ] +} diff --git a/apps/tasks/scenes/fit_1100x720.json b/apps/tasks/scenes/fit_1100x720.json new file mode 100644 index 00000000..5228db4a --- /dev/null +++ b/apps/tasks/scenes/fit_1100x720.json @@ -0,0 +1,929 @@ +{ + "size": [ + 1100, + 720 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [], + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + } +} diff --git a/apps/tasks/scenes/fit_520x400.json b/apps/tasks/scenes/fit_520x400.json new file mode 100644 index 00000000..4f1232b0 --- /dev/null +++ b/apps/tasks/scenes/fit_520x400.json @@ -0,0 +1,929 @@ +{ + "size": [ + 520, + 400 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [], + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + } +} diff --git a/apps/tasks/scenes/fit_520x400_query.json b/apps/tasks/scenes/fit_520x400_query.json new file mode 100644 index 00000000..f65d2ed2 --- /dev/null +++ b/apps/tasks/scenes/fit_520x400_query.json @@ -0,0 +1,932 @@ +{ + "size": [ + 520, + 400 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [ + "key Ctrl+F", + "type orbit" + ], + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + } +} diff --git a/apps/tasks/scenes/fit_640x560.json b/apps/tasks/scenes/fit_640x560.json new file mode 100644 index 00000000..f39fe7d1 --- /dev/null +++ b/apps/tasks/scenes/fit_640x560.json @@ -0,0 +1,929 @@ +{ + "size": [ + 640, + 560 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [], + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + } +} diff --git a/apps/tasks/scenes/fit_760x700.json b/apps/tasks/scenes/fit_760x700.json new file mode 100644 index 00000000..6dd09f9b --- /dev/null +++ b/apps/tasks/scenes/fit_760x700.json @@ -0,0 +1,929 @@ +{ + "size": [ + 760, + 700 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [], + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + } +} diff --git a/apps/tasks/scenes/fit_800x560.json b/apps/tasks/scenes/fit_800x560.json new file mode 100644 index 00000000..cd805274 --- /dev/null +++ b/apps/tasks/scenes/fit_800x560.json @@ -0,0 +1,929 @@ +{ + "size": [ + 800, + 560 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [], + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + } +} diff --git a/apps/tasks/scenes/frame_head_1280.json b/apps/tasks/scenes/frame_head_1280.json new file mode 100644 index 00000000..233d8871 --- /dev/null +++ b/apps/tasks/scenes/frame_head_1280.json @@ -0,0 +1,464 @@ +{ + "size": [ + 1280, + 800 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 12000 + ], + "threads": 12, + "handles": 204 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.05 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 710, + "created": 133500000000710000, + "parent": 4, + "session": 0, + "image": "lsass.exe", + "path": "C:\\Windows\\System32\\lsass.exe", + "cpu": [ + 0.05 + ], + "ws_private": 23068672, + "io": [ + 900 + ], + "threads": 11, + "handles": 280 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 7 + ], + "ws_private": 50331648, + "io": [ + 30000 + ], + "threads": 10, + "handles": 280 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 14, + "handles": 284 + }, + { + "pid": 808, + "created": 133500000000808000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 18874368, + "io": [ + 400 + ], + "threads": 11, + "handles": 288 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 12, + "handles": 200 + }, + { + "pid": 950, + "created": 133500000000950000, + "parent": 700, + "session": 0, + "image": "audiodg.exe", + "path": "C:\\Windows\\System32\\audiodg.exe", + "cpu": [ + 31 + ], + "ws_private": 67108864, + "io": [ + 150000 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 14, + "handles": 210 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 2.2 + ], + "ws_private": 188743680, + "io": [ + 40000 + ], + "threads": 13, + "handles": 220 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 100663296, + "io": [ + 12000 + ], + "threads": 8, + "handles": 230 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2100, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.1 + ], + "ws_private": 54525952, + "io": [ + 800 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 2200, + "created": 133500000002200000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 1.4 + ], + "ws_private": 73400320, + "io": [ + 9000 + ], + "threads": 10, + "handles": 240 + }, + { + "pid": 2300, + "created": 133500000002300000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.3 + ], + "ws_private": 41943040, + "io": [ + 500 + ], + "threads": 12, + "handles": 250 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 9 + ], + "ws_private": 2516582400, + "io": [ + 900000 + ], + "threads": 12, + "handles": 230 + }, + { + "pid": 3100, + "created": 133500000003100000, + "parent": 3000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 1 + ], + "ws_private": 325058560, + "io": [ + 20000 + ], + "threads": 14, + "handles": 240 + }, + { + "pid": 3500, + "created": 133500000003500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Games\\Ember\\helper.exe", + "cpu": [ + 0.02 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 280 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 0, + "session": 1, + "image": "ApplicationFrameHost.exe", + "path": "C:\\Windows\\System32\\ApplicationFrameHost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 300 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 4100, + "created": 133500000004100000, + "parent": 4000, + "session": 1, + "image": "CalculatorApp.exe", + "path": "C:\\Program Files\\WindowsApps\\Calc\\CalculatorApp.exe", + "cpu": [ + 0 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 7001, + "created": 133500000007001000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 39845888, + "io": [ + 2500 + ], + "threads": 9, + "handles": 271 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "notes.exe", + "path": "C:\\Tools\\notes.exe", + "cpu": [ + 0 + ], + "ws_private": 12582912, + "io": [ + 0 + ], + "threads": 11, + "handles": 230 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "orbit-id" + }, + { + "pid": 3000, + "identity": "ember-id" + }, + { + "pid": 4100, + "identity": "calc-id" + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 800, + "name": "AudioEndpointBuilder", + "display": "Windows Audio Endpoint Builder" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "names": { + "explorer-id": "File Explorer", + "orbit-id": "Orbit", + "ember-id": "Ember", + "calc-id": "Calculator", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\tools\\notes.exe": "Notes" + }, + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "input": [ + "key Ctrl+F", + "type orb", + "advance 4000" + ] +} diff --git a/apps/tasks/scenes/t5a_toolbar.json b/apps/tasks/scenes/frame_head_800.json similarity index 99% rename from apps/tasks/scenes/t5a_toolbar.json rename to apps/tasks/scenes/frame_head_800.json index 5a53b031..3681f791 100644 --- a/apps/tasks/scenes/t5a_toolbar.json +++ b/apps/tasks/scenes/frame_head_800.json @@ -1,7 +1,7 @@ { "size": [ - 760, - 700 + 800, + 560 ], "machine": { "logical_cpus": 16, diff --git a/apps/tasks/scenes/frame_held.json b/apps/tasks/scenes/frame_held.json new file mode 100644 index 00000000..630a91fb --- /dev/null +++ b/apps/tasks/scenes/frame_held.json @@ -0,0 +1,462 @@ +{ + "size": [ + 1280, + 800 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 12000 + ], + "threads": 12, + "handles": 204 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.05 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 710, + "created": 133500000000710000, + "parent": 4, + "session": 0, + "image": "lsass.exe", + "path": "C:\\Windows\\System32\\lsass.exe", + "cpu": [ + 0.05 + ], + "ws_private": 23068672, + "io": [ + 900 + ], + "threads": 11, + "handles": 280 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 7 + ], + "ws_private": 50331648, + "io": [ + 30000 + ], + "threads": 10, + "handles": 280 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 14, + "handles": 284 + }, + { + "pid": 808, + "created": 133500000000808000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 18874368, + "io": [ + 400 + ], + "threads": 11, + "handles": 288 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 12, + "handles": 200 + }, + { + "pid": 950, + "created": 133500000000950000, + "parent": 700, + "session": 0, + "image": "audiodg.exe", + "path": "C:\\Windows\\System32\\audiodg.exe", + "cpu": [ + 31 + ], + "ws_private": 67108864, + "io": [ + 150000 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 14, + "handles": 210 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 2.2 + ], + "ws_private": 188743680, + "io": [ + 40000 + ], + "threads": 13, + "handles": 220 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 100663296, + "io": [ + 12000 + ], + "threads": 8, + "handles": 230 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2100, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.1 + ], + "ws_private": 54525952, + "io": [ + 800 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 2200, + "created": 133500000002200000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 1.4 + ], + "ws_private": 73400320, + "io": [ + 9000 + ], + "threads": 10, + "handles": 240 + }, + { + "pid": 2300, + "created": 133500000002300000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.3 + ], + "ws_private": 41943040, + "io": [ + 500 + ], + "threads": 12, + "handles": 250 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 9 + ], + "ws_private": 2516582400, + "io": [ + 900000 + ], + "threads": 12, + "handles": 230 + }, + { + "pid": 3100, + "created": 133500000003100000, + "parent": 3000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 1 + ], + "ws_private": 325058560, + "io": [ + 20000 + ], + "threads": 14, + "handles": 240 + }, + { + "pid": 3500, + "created": 133500000003500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Games\\Ember\\helper.exe", + "cpu": [ + 0.02 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 280 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 0, + "session": 1, + "image": "ApplicationFrameHost.exe", + "path": "C:\\Windows\\System32\\ApplicationFrameHost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 300 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 4100, + "created": 133500000004100000, + "parent": 4000, + "session": 1, + "image": "CalculatorApp.exe", + "path": "C:\\Program Files\\WindowsApps\\Calc\\CalculatorApp.exe", + "cpu": [ + 0 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 7001, + "created": 133500000007001000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 39845888, + "io": [ + 2500 + ], + "threads": 9, + "handles": 271 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "notes.exe", + "path": "C:\\Tools\\notes.exe", + "cpu": [ + 0 + ], + "ws_private": 12582912, + "io": [ + 0 + ], + "threads": 11, + "handles": 230 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "orbit-id" + }, + { + "pid": 3000, + "identity": "ember-id" + }, + { + "pid": 4100, + "identity": "calc-id" + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 800, + "name": "AudioEndpointBuilder", + "display": "Windows Audio Endpoint Builder" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "names": { + "explorer-id": "File Explorer", + "orbit-id": "Orbit", + "ember-id": "Ember", + "calc-id": "Calculator", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\tools\\notes.exe": "Notes" + }, + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "input": [ + "hover 600,300" + ] +} diff --git a/apps/tasks/scenes/frame_paused.json b/apps/tasks/scenes/frame_paused.json new file mode 100644 index 00000000..6e0649a2 --- /dev/null +++ b/apps/tasks/scenes/frame_paused.json @@ -0,0 +1,463 @@ +{ + "size": [ + 1280, + 800 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 12000 + ], + "threads": 12, + "handles": 204 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.05 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 710, + "created": 133500000000710000, + "parent": 4, + "session": 0, + "image": "lsass.exe", + "path": "C:\\Windows\\System32\\lsass.exe", + "cpu": [ + 0.05 + ], + "ws_private": 23068672, + "io": [ + 900 + ], + "threads": 11, + "handles": 280 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 7 + ], + "ws_private": 50331648, + "io": [ + 30000 + ], + "threads": 10, + "handles": 280 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 14, + "handles": 284 + }, + { + "pid": 808, + "created": 133500000000808000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 18874368, + "io": [ + 400 + ], + "threads": 11, + "handles": 288 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 12, + "handles": 200 + }, + { + "pid": 950, + "created": 133500000000950000, + "parent": 700, + "session": 0, + "image": "audiodg.exe", + "path": "C:\\Windows\\System32\\audiodg.exe", + "cpu": [ + 31 + ], + "ws_private": 67108864, + "io": [ + 150000 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 14, + "handles": 210 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 2.2 + ], + "ws_private": 188743680, + "io": [ + 40000 + ], + "threads": 13, + "handles": 220 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 100663296, + "io": [ + 12000 + ], + "threads": 8, + "handles": 230 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2100, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.1 + ], + "ws_private": 54525952, + "io": [ + 800 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 2200, + "created": 133500000002200000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 1.4 + ], + "ws_private": 73400320, + "io": [ + 9000 + ], + "threads": 10, + "handles": 240 + }, + { + "pid": 2300, + "created": 133500000002300000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.3 + ], + "ws_private": 41943040, + "io": [ + 500 + ], + "threads": 12, + "handles": 250 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 9 + ], + "ws_private": 2516582400, + "io": [ + 900000 + ], + "threads": 12, + "handles": 230 + }, + { + "pid": 3100, + "created": 133500000003100000, + "parent": 3000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 1 + ], + "ws_private": 325058560, + "io": [ + 20000 + ], + "threads": 14, + "handles": 240 + }, + { + "pid": 3500, + "created": 133500000003500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Games\\Ember\\helper.exe", + "cpu": [ + 0.02 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 280 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 0, + "session": 1, + "image": "ApplicationFrameHost.exe", + "path": "C:\\Windows\\System32\\ApplicationFrameHost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 300 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 4100, + "created": 133500000004100000, + "parent": 4000, + "session": 1, + "image": "CalculatorApp.exe", + "path": "C:\\Program Files\\WindowsApps\\Calc\\CalculatorApp.exe", + "cpu": [ + 0 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 7001, + "created": 133500000007001000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 39845888, + "io": [ + 2500 + ], + "threads": 9, + "handles": 271 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "notes.exe", + "path": "C:\\Tools\\notes.exe", + "cpu": [ + 0 + ], + "ws_private": 12582912, + "io": [ + 0 + ], + "threads": 11, + "handles": 230 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "orbit-id" + }, + { + "pid": 3000, + "identity": "ember-id" + }, + { + "pid": 4100, + "identity": "calc-id" + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 800, + "name": "AudioEndpointBuilder", + "display": "Windows Audio Endpoint Builder" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "names": { + "explorer-id": "File Explorer", + "orbit-id": "Orbit", + "ember-id": "Ember", + "calc-id": "Calculator", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\tools\\notes.exe": "Notes" + }, + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "input": [ + "key Ctrl+P", + "advance 4000" + ] +} diff --git a/apps/tasks/scenes/frame_rail.json b/apps/tasks/scenes/frame_rail.json new file mode 100644 index 00000000..308c8b1e --- /dev/null +++ b/apps/tasks/scenes/frame_rail.json @@ -0,0 +1,460 @@ +{ + "size": [ + 1280, + 800 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 12000 + ], + "threads": 12, + "handles": 204 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.05 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 710, + "created": 133500000000710000, + "parent": 4, + "session": 0, + "image": "lsass.exe", + "path": "C:\\Windows\\System32\\lsass.exe", + "cpu": [ + 0.05 + ], + "ws_private": 23068672, + "io": [ + 900 + ], + "threads": 11, + "handles": 280 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 7 + ], + "ws_private": 50331648, + "io": [ + 30000 + ], + "threads": 10, + "handles": 280 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 14, + "handles": 284 + }, + { + "pid": 808, + "created": 133500000000808000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 18874368, + "io": [ + 400 + ], + "threads": 11, + "handles": 288 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 12, + "handles": 200 + }, + { + "pid": 950, + "created": 133500000000950000, + "parent": 700, + "session": 0, + "image": "audiodg.exe", + "path": "C:\\Windows\\System32\\audiodg.exe", + "cpu": [ + 31 + ], + "ws_private": 67108864, + "io": [ + 150000 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 14, + "handles": 210 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 2.2 + ], + "ws_private": 188743680, + "io": [ + 40000 + ], + "threads": 13, + "handles": 220 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 100663296, + "io": [ + 12000 + ], + "threads": 8, + "handles": 230 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2100, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.1 + ], + "ws_private": 54525952, + "io": [ + 800 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 2200, + "created": 133500000002200000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 1.4 + ], + "ws_private": 73400320, + "io": [ + 9000 + ], + "threads": 10, + "handles": 240 + }, + { + "pid": 2300, + "created": 133500000002300000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.3 + ], + "ws_private": 41943040, + "io": [ + 500 + ], + "threads": 12, + "handles": 250 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 9 + ], + "ws_private": 2516582400, + "io": [ + 900000 + ], + "threads": 12, + "handles": 230 + }, + { + "pid": 3100, + "created": 133500000003100000, + "parent": 3000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 1 + ], + "ws_private": 325058560, + "io": [ + 20000 + ], + "threads": 14, + "handles": 240 + }, + { + "pid": 3500, + "created": 133500000003500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Games\\Ember\\helper.exe", + "cpu": [ + 0.02 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 280 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 0, + "session": 1, + "image": "ApplicationFrameHost.exe", + "path": "C:\\Windows\\System32\\ApplicationFrameHost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 300 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 4100, + "created": 133500000004100000, + "parent": 4000, + "session": 1, + "image": "CalculatorApp.exe", + "path": "C:\\Program Files\\WindowsApps\\Calc\\CalculatorApp.exe", + "cpu": [ + 0 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 7001, + "created": 133500000007001000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 39845888, + "io": [ + 2500 + ], + "threads": 9, + "handles": 271 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "notes.exe", + "path": "C:\\Tools\\notes.exe", + "cpu": [ + 0 + ], + "ws_private": 12582912, + "io": [ + 0 + ], + "threads": 11, + "handles": 230 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "orbit-id" + }, + { + "pid": 3000, + "identity": "ember-id" + }, + { + "pid": 4100, + "identity": "calc-id" + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 800, + "name": "AudioEndpointBuilder", + "display": "Windows Audio Endpoint Builder" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "names": { + "explorer-id": "File Explorer", + "orbit-id": "Orbit", + "ember-id": "Ember", + "calc-id": "Calculator", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\tools\\notes.exe": "Notes" + }, + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "input": [] +} diff --git a/apps/tasks/scenes/frame_rail_collapsed.json b/apps/tasks/scenes/frame_rail_collapsed.json new file mode 100644 index 00000000..d18c4e77 --- /dev/null +++ b/apps/tasks/scenes/frame_rail_collapsed.json @@ -0,0 +1,463 @@ +{ + "size": [ + 1280, + 800 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 12000 + ], + "threads": 12, + "handles": 204 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.05 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 710, + "created": 133500000000710000, + "parent": 4, + "session": 0, + "image": "lsass.exe", + "path": "C:\\Windows\\System32\\lsass.exe", + "cpu": [ + 0.05 + ], + "ws_private": 23068672, + "io": [ + 900 + ], + "threads": 11, + "handles": 280 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 7 + ], + "ws_private": 50331648, + "io": [ + 30000 + ], + "threads": 10, + "handles": 280 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 14, + "handles": 284 + }, + { + "pid": 808, + "created": 133500000000808000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 18874368, + "io": [ + 400 + ], + "threads": 11, + "handles": 288 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 12, + "handles": 200 + }, + { + "pid": 950, + "created": 133500000000950000, + "parent": 700, + "session": 0, + "image": "audiodg.exe", + "path": "C:\\Windows\\System32\\audiodg.exe", + "cpu": [ + 31 + ], + "ws_private": 67108864, + "io": [ + 150000 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 14, + "handles": 210 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 2.2 + ], + "ws_private": 188743680, + "io": [ + 40000 + ], + "threads": 13, + "handles": 220 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 100663296, + "io": [ + 12000 + ], + "threads": 8, + "handles": 230 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2100, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.1 + ], + "ws_private": 54525952, + "io": [ + 800 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 2200, + "created": 133500000002200000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 1.4 + ], + "ws_private": 73400320, + "io": [ + 9000 + ], + "threads": 10, + "handles": 240 + }, + { + "pid": 2300, + "created": 133500000002300000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.3 + ], + "ws_private": 41943040, + "io": [ + 500 + ], + "threads": 12, + "handles": 250 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 9 + ], + "ws_private": 2516582400, + "io": [ + 900000 + ], + "threads": 12, + "handles": 230 + }, + { + "pid": 3100, + "created": 133500000003100000, + "parent": 3000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 1 + ], + "ws_private": 325058560, + "io": [ + 20000 + ], + "threads": 14, + "handles": 240 + }, + { + "pid": 3500, + "created": 133500000003500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Games\\Ember\\helper.exe", + "cpu": [ + 0.02 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 280 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 0, + "session": 1, + "image": "ApplicationFrameHost.exe", + "path": "C:\\Windows\\System32\\ApplicationFrameHost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 300 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 4100, + "created": 133500000004100000, + "parent": 4000, + "session": 1, + "image": "CalculatorApp.exe", + "path": "C:\\Program Files\\WindowsApps\\Calc\\CalculatorApp.exe", + "cpu": [ + 0 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 7001, + "created": 133500000007001000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 39845888, + "io": [ + 2500 + ], + "threads": 9, + "handles": 271 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "notes.exe", + "path": "C:\\Tools\\notes.exe", + "cpu": [ + 0 + ], + "ws_private": 12582912, + "io": [ + 0 + ], + "threads": 11, + "handles": 230 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "orbit-id" + }, + { + "pid": 3000, + "identity": "ember-id" + }, + { + "pid": 4100, + "identity": "calc-id" + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 800, + "name": "AudioEndpointBuilder", + "display": "Windows Audio Endpoint Builder" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "names": { + "explorer-id": "File Explorer", + "orbit-id": "Orbit", + "ember-id": "Ember", + "calc-id": "Calculator", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\tools\\notes.exe": "Notes" + }, + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "input": [ + "key Ctrl+B", + "advance 4000" + ] +} diff --git a/apps/tasks/scenes/t5a_toolbar_hover_more.json b/apps/tasks/scenes/frame_rail_hover.json similarity index 99% rename from apps/tasks/scenes/t5a_toolbar_hover_more.json rename to apps/tasks/scenes/frame_rail_hover.json index 08e8daa6..cb3c8a7e 100644 --- a/apps/tasks/scenes/t5a_toolbar_hover_more.json +++ b/apps/tasks/scenes/frame_rail_hover.json @@ -1,7 +1,7 @@ { "size": [ - 760, - 700 + 1280, + 800 ], "machine": { "logical_cpus": 16, @@ -457,7 +457,7 @@ "windows": false }, "input": [ - "hover 116,22", + "hover 60,774", "advance 300" ] } diff --git a/apps/tasks/scenes/frame_rail_narrow.json b/apps/tasks/scenes/frame_rail_narrow.json new file mode 100644 index 00000000..8406667a --- /dev/null +++ b/apps/tasks/scenes/frame_rail_narrow.json @@ -0,0 +1,460 @@ +{ + "size": [ + 700, + 560 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 12000 + ], + "threads": 12, + "handles": 204 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.05 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 710, + "created": 133500000000710000, + "parent": 4, + "session": 0, + "image": "lsass.exe", + "path": "C:\\Windows\\System32\\lsass.exe", + "cpu": [ + 0.05 + ], + "ws_private": 23068672, + "io": [ + 900 + ], + "threads": 11, + "handles": 280 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 7 + ], + "ws_private": 50331648, + "io": [ + 30000 + ], + "threads": 10, + "handles": 280 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 14, + "handles": 284 + }, + { + "pid": 808, + "created": 133500000000808000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 18874368, + "io": [ + 400 + ], + "threads": 11, + "handles": 288 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 12, + "handles": 200 + }, + { + "pid": 950, + "created": 133500000000950000, + "parent": 700, + "session": 0, + "image": "audiodg.exe", + "path": "C:\\Windows\\System32\\audiodg.exe", + "cpu": [ + 31 + ], + "ws_private": 67108864, + "io": [ + 150000 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 14, + "handles": 210 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 2.2 + ], + "ws_private": 188743680, + "io": [ + 40000 + ], + "threads": 13, + "handles": 220 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 100663296, + "io": [ + 12000 + ], + "threads": 8, + "handles": 230 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2100, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.1 + ], + "ws_private": 54525952, + "io": [ + 800 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 2200, + "created": 133500000002200000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 1.4 + ], + "ws_private": 73400320, + "io": [ + 9000 + ], + "threads": 10, + "handles": 240 + }, + { + "pid": 2300, + "created": 133500000002300000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.3 + ], + "ws_private": 41943040, + "io": [ + 500 + ], + "threads": 12, + "handles": 250 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 9 + ], + "ws_private": 2516582400, + "io": [ + 900000 + ], + "threads": 12, + "handles": 230 + }, + { + "pid": 3100, + "created": 133500000003100000, + "parent": 3000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 1 + ], + "ws_private": 325058560, + "io": [ + 20000 + ], + "threads": 14, + "handles": 240 + }, + { + "pid": 3500, + "created": 133500000003500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Games\\Ember\\helper.exe", + "cpu": [ + 0.02 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 280 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 0, + "session": 1, + "image": "ApplicationFrameHost.exe", + "path": "C:\\Windows\\System32\\ApplicationFrameHost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 300 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 4100, + "created": 133500000004100000, + "parent": 4000, + "session": 1, + "image": "CalculatorApp.exe", + "path": "C:\\Program Files\\WindowsApps\\Calc\\CalculatorApp.exe", + "cpu": [ + 0 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 7001, + "created": 133500000007001000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 39845888, + "io": [ + 2500 + ], + "threads": 9, + "handles": 271 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "notes.exe", + "path": "C:\\Tools\\notes.exe", + "cpu": [ + 0 + ], + "ws_private": 12582912, + "io": [ + 0 + ], + "threads": 11, + "handles": 230 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "orbit-id" + }, + { + "pid": 3000, + "identity": "ember-id" + }, + { + "pid": 4100, + "identity": "calc-id" + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 800, + "name": "AudioEndpointBuilder", + "display": "Windows Audio Endpoint Builder" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "names": { + "explorer-id": "File Explorer", + "orbit-id": "Orbit", + "ember-id": "Ember", + "calc-id": "Calculator", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\tools\\notes.exe": "Notes" + }, + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "input": [] +} diff --git a/apps/tasks/scenes/t5a_toolbar_focus.json b/apps/tasks/scenes/frame_settings.json similarity index 99% rename from apps/tasks/scenes/t5a_toolbar_focus.json rename to apps/tasks/scenes/frame_settings.json index 47ccdf3f..47264ea3 100644 --- a/apps/tasks/scenes/t5a_toolbar_focus.json +++ b/apps/tasks/scenes/frame_settings.json @@ -1,7 +1,7 @@ { "size": [ - 760, - 700 + 1280, + 800 ], "machine": { "logical_cpus": 16, @@ -457,6 +457,6 @@ "windows": false }, "input": [ - "key Ctrl+F" + "key F10" ] } diff --git a/apps/tasks/scenes/frame_settings_nodock.json b/apps/tasks/scenes/frame_settings_nodock.json new file mode 100644 index 00000000..bf673a81 --- /dev/null +++ b/apps/tasks/scenes/frame_settings_nodock.json @@ -0,0 +1,463 @@ +{ + "size": [ + 1280, + 800 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 12000 + ], + "threads": 12, + "handles": 204 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.05 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 710, + "created": 133500000000710000, + "parent": 4, + "session": 0, + "image": "lsass.exe", + "path": "C:\\Windows\\System32\\lsass.exe", + "cpu": [ + 0.05 + ], + "ws_private": 23068672, + "io": [ + 900 + ], + "threads": 11, + "handles": 280 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 7 + ], + "ws_private": 50331648, + "io": [ + 30000 + ], + "threads": 10, + "handles": 280 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 14, + "handles": 284 + }, + { + "pid": 808, + "created": 133500000000808000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 18874368, + "io": [ + 400 + ], + "threads": 11, + "handles": 288 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 12, + "handles": 200 + }, + { + "pid": 950, + "created": 133500000000950000, + "parent": 700, + "session": 0, + "image": "audiodg.exe", + "path": "C:\\Windows\\System32\\audiodg.exe", + "cpu": [ + 31 + ], + "ws_private": 67108864, + "io": [ + 150000 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 14, + "handles": 210 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 2.2 + ], + "ws_private": 188743680, + "io": [ + 40000 + ], + "threads": 13, + "handles": 220 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 100663296, + "io": [ + 12000 + ], + "threads": 8, + "handles": 230 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2100, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.1 + ], + "ws_private": 54525952, + "io": [ + 800 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 2200, + "created": 133500000002200000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 1.4 + ], + "ws_private": 73400320, + "io": [ + 9000 + ], + "threads": 10, + "handles": 240 + }, + { + "pid": 2300, + "created": 133500000002300000, + "parent": 2000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.3 + ], + "ws_private": 41943040, + "io": [ + 500 + ], + "threads": 12, + "handles": 250 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 9 + ], + "ws_private": 2516582400, + "io": [ + 900000 + ], + "threads": 12, + "handles": 230 + }, + { + "pid": 3100, + "created": 133500000003100000, + "parent": 3000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 1 + ], + "ws_private": 325058560, + "io": [ + 20000 + ], + "threads": 14, + "handles": 240 + }, + { + "pid": 3500, + "created": 133500000003500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Games\\Ember\\helper.exe", + "cpu": [ + 0.02 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 280 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 0, + "session": 1, + "image": "ApplicationFrameHost.exe", + "path": "C:\\Windows\\System32\\ApplicationFrameHost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 300 + ], + "threads": 11, + "handles": 240 + }, + { + "pid": 4100, + "created": 133500000004100000, + "parent": 4000, + "session": 1, + "image": "CalculatorApp.exe", + "path": "C:\\Program Files\\WindowsApps\\Calc\\CalculatorApp.exe", + "cpu": [ + 0 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 13, + "handles": 250 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270 + }, + { + "pid": 7001, + "created": 133500000007001000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 39845888, + "io": [ + 2500 + ], + "threads": 9, + "handles": 271 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "notes.exe", + "path": "C:\\Tools\\notes.exe", + "cpu": [ + 0 + ], + "ws_private": 12582912, + "io": [ + 0 + ], + "threads": 11, + "handles": 230 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "orbit-id" + }, + { + "pid": 3000, + "identity": "ember-id" + }, + { + "pid": 4100, + "identity": "calc-id" + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 800, + "name": "AudioEndpointBuilder", + "display": "Windows Audio Endpoint Builder" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "names": { + "explorer-id": "File Explorer", + "orbit-id": "Orbit", + "ember-id": "Ember", + "calc-id": "Calculator", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\tools\\notes.exe": "Notes" + }, + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "input": [ + "key F10" + ], + "dock": false +} diff --git a/apps/tasks/scenes/perf_cpu.json b/apps/tasks/scenes/perf_cpu.json new file mode 100644 index 00000000..b199d70d --- /dev/null +++ b/apps/tasks/scenes/perf_cpu.json @@ -0,0 +1,1955 @@ +{ + "size": [ + 1440, + 900 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "cpu", + "readout": 18 +} diff --git a/apps/tasks/scenes/perf_cpu_chart_focus.json b/apps/tasks/scenes/perf_cpu_chart_focus.json new file mode 100644 index 00000000..f5b825be --- /dev/null +++ b/apps/tasks/scenes/perf_cpu_chart_focus.json @@ -0,0 +1,1959 @@ +{ + "size": [ + 1280, + 800 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "cpu", + "input": [ + "focus chart", + "key Left", + "key Left" + ] +} diff --git a/apps/tasks/scenes/perf_cpu_first_samples.json b/apps/tasks/scenes/perf_cpu_first_samples.json new file mode 100644 index 00000000..0b88fa59 --- /dev/null +++ b/apps/tasks/scenes/perf_cpu_first_samples.json @@ -0,0 +1,1954 @@ +{ + "size": [ + 1280, + 800 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 2, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 34.4, + 35.7, + 37.6, + 38.6, + 37.2, + 33, + 26.3, + 18.4, + 11.1, + 6, + 4.4, + 6.5, + 11.5, + 18, + 24.3, + 28.7, + 30.4, + 29.8, + 27.7, + 25.8, + 25.6 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "cpu" +} diff --git a/apps/tasks/scenes/perf_cpu_many.json b/apps/tasks/scenes/perf_cpu_many.json new file mode 100644 index 00000000..ec089d6c --- /dev/null +++ b/apps/tasks/scenes/perf_cpu_many.json @@ -0,0 +1,5482 @@ +{ + "size": [ + 1440, + 900 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ], + [ + 43.6, + 47.2, + 51.3, + 54.4, + 54.8, + 51.8, + 45.4, + 36.9, + 27.7, + 19.9, + 14.7, + 12.8, + 13.8, + 16.5, + 19.1, + 20.2, + 18.8, + 15, + 9.7, + 4.5, + 2, + 2, + 4.1, + 10.6, + 19, + 27.5, + 34.3, + 38.3, + 39.3, + 38, + 35.9, + 34.5, + 35.3, + 38.8, + 44.5, + 51.3, + 57.4, + 61.2, + 61.4, + 58, + 51.7, + 44, + 36.7, + 31.4, + 28.9, + 29, + 30.7, + 32.5, + 32.7, + 30.2, + 24.9, + 17.5, + 9.6, + 2.9, + 2, + 2, + 2.1, + 7.9, + 14.4, + 20.1, + 23.5 + ], + [ + 47.8, + 50.6, + 53.2, + 53.9, + 51.6, + 46, + 37.9, + 28.7, + 20.3, + 14.3, + 11.7, + 12.5, + 15.7, + 19.7, + 22.9, + 24, + 22.6, + 19.2, + 15.2, + 12.1, + 11.7, + 14.6, + 20.9, + 29.4, + 38.6, + 46.5, + 51.8, + 53.8, + 52.8, + 50.2, + 47.4, + 46.1, + 47.3, + 50.9, + 56, + 61.2, + 64.6, + 65, + 61.7, + 55.2, + 46.7, + 38.2, + 31.2, + 27.1, + 26, + 27.2, + 29.4, + 30.9, + 30.3, + 27, + 21.4, + 14.8, + 8.7, + 4.9, + 4.6, + 8, + 14.4, + 22.1, + 29.5, + 35, + 37.7 + ], + [ + 48.3, + 50.4, + 51.5, + 50.2, + 45.9, + 38.8, + 30.3, + 22, + 15.7, + 12.7, + 13.3, + 17, + 22.3, + 27.5, + 31, + 32.1, + 30.8, + 28, + 25.5, + 24.7, + 26.9, + 32.4, + 40.5, + 49.6, + 58.1, + 64.1, + 66.8, + 66.1, + 62.9, + 58.7, + 55.3, + 54, + 55.2, + 58.4, + 62.3, + 65.3, + 65.8, + 63, + 56.8, + 48.3, + 39.1, + 31.1, + 25.7, + 23.6, + 24.5, + 27.2, + 30.1, + 31.5, + 30.6, + 27.2, + 22.3, + 17.2, + 13.7, + 13.3, + 16.6, + 23, + 31.5, + 40.1, + 47.2, + 51.5, + 52.7 + ], + [ + 46.8, + 48.5, + 48.5, + 45.9, + 40.5, + 33.2, + 25.6, + 19.5, + 16.4, + 16.9, + 21, + 27.2, + 34.1, + 39.8, + 43.2, + 43.9, + 42.5, + 40.4, + 39.2, + 40.4, + 44.5, + 51.5, + 59.9, + 68.2, + 74.5, + 77.6, + 77, + 73.3, + 67.9, + 62.6, + 58.8, + 57.6, + 58.7, + 61.3, + 63.8, + 64.6, + 62.5, + 57.2, + 49.2, + 40.1, + 31.6, + 25.5, + 22.8, + 23.4, + 26.7, + 30.9, + 34.5, + 36, + 35.1, + 32.1, + 28.2, + 25.2, + 24.7, + 27.4, + 33.5, + 42, + 51.2, + 59.3, + 64.8, + 67, + 66.2 + ], + [ + 21.8, + 23.3, + 22.6, + 19.4, + 13.9, + 7.5, + 2, + 2, + 2, + 3.6, + 10.5, + 18.6, + 26, + 31.4, + 33.9, + 33.7, + 31.9, + 30.2, + 30.1, + 32.5, + 37.8, + 44.9, + 52.4, + 58.5, + 61.7, + 61.1, + 57.2, + 50.8, + 43.8, + 37.9, + 34.4, + 33.5, + 34.8, + 36.9, + 38.1, + 37, + 33, + 26.2, + 17.9, + 9.6, + 3.3, + 2, + 2, + 4.4, + 9.9, + 15.4, + 19.3, + 20.8, + 19.9, + 17.4, + 14.9, + 14, + 16, + 21.2, + 29.1, + 38.2, + 46.7, + 52.9, + 55.7, + 55.1, + 51.8 + ], + [ + 23.2, + 24.8, + 23.9, + 20.6, + 15.9, + 11.3, + 8.5, + 8.8, + 12.7, + 19.7, + 28.4, + 37.1, + 44, + 47.9, + 48.8, + 47.3, + 44.9, + 43.3, + 43.7, + 46.8, + 52.1, + 58.3, + 63.8, + 66.8, + 66.4, + 62.3, + 55.4, + 47.3, + 39.7, + 34.1, + 31.5, + 31.5, + 33.3, + 35, + 35.3, + 33, + 28, + 21, + 13.6, + 7.5, + 4.3, + 4.8, + 8.8, + 15.1, + 22.2, + 28.3, + 32.1, + 33.1, + 32, + 29.9, + 28.6, + 29.6, + 33.4, + 40.1, + 48.3, + 56.5, + 62.9, + 66.1, + 65.6, + 61.9, + 56.3 + ], + [ + 28.7, + 30.3, + 29.4, + 26.6, + 23, + 20.5, + 20.5, + 23.9, + 30.5, + 39.2, + 48.4, + 56.2, + 61.2, + 62.9, + 61.5, + 58.4, + 55.2, + 53.5, + 54.1, + 57.2, + 61.8, + 66.3, + 69.1, + 68.9, + 65, + 58.1, + 49.3, + 40.6, + 33.6, + 29.5, + 28.5, + 30, + 32.4, + 34.2, + 33.9, + 31.1, + 26, + 19.9, + 14.4, + 11.4, + 11.8, + 15.8, + 22.7, + 30.9, + 38.7, + 44.3, + 47.2, + 47.2, + 45.5, + 43.7, + 43.3, + 45.4, + 50.2, + 57.1, + 64.4, + 70.5, + 73.7, + 73.3, + 69.3, + 62.9, + 55.7 + ], + [ + 38.6, + 40.1, + 39.1, + 36.8, + 34.6, + 34.1, + 36.6, + 42.2, + 50.2, + 59.2, + 67.4, + 73, + 75.1, + 73.9, + 70.1, + 65.4, + 61.4, + 59.6, + 60.2, + 62.9, + 66.4, + 68.9, + 68.9, + 65.7, + 59.2, + 50.5, + 41.3, + 33.4, + 28.3, + 26.5, + 27.8, + 31, + 34.3, + 36.3, + 35.9, + 33, + 28.6, + 24.1, + 21.3, + 21.5, + 25.3, + 32.2, + 41, + 49.8, + 56.9, + 61.1, + 62.2, + 60.8, + 58.3, + 56.4, + 56.4, + 59, + 63.9, + 69.9, + 75.3, + 78.4, + 78.1, + 74.1, + 67.2, + 58.9, + 51 + ], + [ + 28.1, + 29, + 27.8, + 25.8, + 24.7, + 25.9, + 30.1, + 36.8, + 44.9, + 52.8, + 58.5, + 60.9, + 59.7, + 55.3, + 49.3, + 43.4, + 39.2, + 37.5, + 38.3, + 40.5, + 42.7, + 43.2, + 40.9, + 35.4, + 27.5, + 18.5, + 10.4, + 4.7, + 2.5, + 3.7, + 7.5, + 12.3, + 16.5, + 18.5, + 18.1, + 15.6, + 12.2, + 9.7, + 9.6, + 12.8, + 19.2, + 27.8, + 37, + 45, + 50.2, + 52, + 50.8, + 47.6, + 44.1, + 41.9, + 42.1, + 44.8, + 49, + 53.4, + 56.2, + 56.1, + 52.4, + 45.5, + 36.8, + 27.9, + 20.6 + ], + [ + 43.4, + 43.2, + 41.4, + 39.5, + 39.2, + 41.4, + 46.3, + 53, + 60, + 65.4, + 67.9, + 66.7, + 62, + 55.1, + 47.6, + 41.3, + 37.4, + 36.3, + 37.4, + 39.4, + 40.5, + 39.5, + 35.5, + 29, + 20.9, + 13.1, + 7.3, + 4.9, + 6.1, + 10.5, + 16.5, + 22.6, + 27, + 28.9, + 28.4, + 26.2, + 24, + 23.4, + 25.6, + 31, + 38.8, + 47.7, + 55.9, + 61.6, + 63.9, + 62.7, + 58.9, + 53.9, + 49.6, + 47.3, + 47.6, + 49.9, + 53.2, + 55.6, + 55.8, + 52.8, + 46.4, + 37.9, + 28.6, + 20.6, + 15.3 + ], + [ + 58.1, + 56.3, + 53.6, + 51.6, + 51.6, + 54.2, + 59, + 64.7, + 69.5, + 71.9, + 70.8, + 66.1, + 58.7, + 50.1, + 42.3, + 36.6, + 33.9, + 34, + 35.8, + 37.8, + 38.3, + 36.2, + 31.6, + 25, + 18.1, + 12.7, + 10.2, + 11.3, + 16, + 23, + 30.6, + 37, + 41.1, + 42.3, + 41.3, + 39.4, + 38.2, + 39.1, + 42.9, + 49.3, + 57.2, + 65, + 70.8, + 73.3, + 72.1, + 67.7, + 61.6, + 55.4, + 50.7, + 48.6, + 49, + 51.1, + 53.2, + 53.9, + 51.8, + 46.6, + 38.9, + 30, + 21.9, + 16.1, + 13.7 + ], + [ + 69.8, + 66.2, + 62.5, + 60.2, + 60.4, + 62.9, + 66.9, + 70.9, + 73.1, + 72.3, + 68, + 60.6, + 51.6, + 42.8, + 35.8, + 31.9, + 31.2, + 33, + 35.8, + 37.9, + 38.1, + 35.7, + 31.1, + 25.6, + 20.8, + 18.4, + 19.4, + 24.1, + 31.5, + 40.1, + 48.1, + 53.9, + 56.7, + 56.7, + 54.9, + 52.9, + 52.3, + 54.1, + 58.6, + 65, + 71.8, + 77.2, + 79.8, + 78.6, + 74, + 67, + 59.3, + 52.7, + 48.4, + 47, + 47.9, + 49.8, + 51.1, + 50.3, + 46.7, + 40.5, + 32.7, + 24.9, + 19.1, + 16.6, + 17.7 + ], + [ + 52.7, + 47.4, + 42.9, + 40.6, + 40.8, + 43, + 46, + 48, + 47.7, + 44.1, + 37.4, + 28.7, + 19.5, + 11.9, + 7.1, + 5.8, + 7.6, + 11.3, + 15.2, + 17.6, + 17.7, + 15.4, + 11.5, + 7.6, + 5.4, + 6.1, + 10.4, + 17.7, + 26.7, + 35.6, + 42.6, + 46.7, + 47.5, + 45.7, + 42.8, + 40.5, + 40.1, + 42.3, + 46.7, + 52.1, + 56.9, + 59.3, + 58.3, + 53.7, + 46.3, + 37.7, + 29.6, + 23.6, + 20.6, + 20.5, + 22.3, + 24.4, + 25.2, + 23.5, + 19.3, + 13, + 6.3, + 2, + 2, + 2, + 4 + ], + [ + 54.2, + 47.8, + 43.1, + 41, + 41.4, + 43.4, + 45.3, + 45.7, + 43.2, + 37.7, + 29.9, + 21.2, + 13.5, + 8.3, + 6.7, + 8.5, + 13, + 18.4, + 23, + 25.6, + 25.7, + 23.6, + 20.7, + 18.6, + 18.9, + 22.4, + 29, + 37.6, + 46.8, + 54.5, + 59.3, + 60.7, + 58.9, + 55.2, + 51.2, + 48.5, + 48.2, + 50.3, + 54, + 57.8, + 60.1, + 59.4, + 55.2, + 48, + 39, + 30.1, + 22.9, + 18.8, + 17.9, + 19.6, + 22.5, + 25, + 25.6, + 23.7, + 19.5, + 14.2, + 9.5, + 7.1, + 8, + 12.5, + 19.9 + ], + [ + 50.9, + 44.2, + 40.1, + 38.9, + 40, + 41.9, + 43.1, + 42.1, + 38.3, + 32.1, + 24.4, + 17.1, + 12, + 10.2, + 12.1, + 17.1, + 23.8, + 30.4, + 35.2, + 37.5, + 37.3, + 35.4, + 33.4, + 33, + 35.3, + 40.6, + 48.3, + 57, + 64.7, + 70, + 71.6, + 69.8, + 65.3, + 59.8, + 55, + 52.2, + 51.9, + 53.8, + 56.6, + 58.7, + 58.5, + 55.2, + 48.7, + 40.1, + 30.9, + 23.2, + 18.3, + 16.8, + 18.6, + 22.4, + 26.5, + 29.4, + 29.9, + 28, + 24.5, + 20.7, + 18.4, + 19.1, + 23.1, + 30.3, + 39.3 + ], + [ + 44.7, + 39, + 36.3, + 36.6, + 38.6, + 40.8, + 41.5, + 39.9, + 35.6, + 29.6, + 23.3, + 18.5, + 16.6, + 18.5, + 23.8, + 31.3, + 39.3, + 46.1, + 50.4, + 51.8, + 50.8, + 48.9, + 47.6, + 48.4, + 52, + 58.1, + 65.7, + 72.9, + 78.1, + 79.9, + 78, + 73, + 66.2, + 59.5, + 54.5, + 52, + 52.1, + 53.9, + 55.8, + 56.3, + 54.2, + 49, + 41.4, + 32.8, + 25.1, + 19.8, + 18.1, + 19.9, + 24.4, + 30, + 35, + 38.1, + 38.5, + 36.8, + 34.1, + 32, + 32.1, + 35.3, + 41.7, + 50.2, + 59.3 + ], + [ + 14.2, + 10.5, + 10.2, + 12.4, + 15.6, + 18.2, + 18.8, + 16.9, + 12.9, + 7.9, + 3.8, + 2, + 3.7, + 8.8, + 16.7, + 25.6, + 33.7, + 39.6, + 42.3, + 42.2, + 40.1, + 37.9, + 36.9, + 38.4, + 42.5, + 48.3, + 54.6, + 59.3, + 61.2, + 59.4, + 54.1, + 46.6, + 38.4, + 31.5, + 27.1, + 25.5, + 26.4, + 28.3, + 29.7, + 29, + 25.6, + 19.7, + 12.3, + 5.1, + 2, + 2, + 2, + 4.9, + 11.7, + 18.6, + 23.9, + 26.6, + 26.6, + 24.9, + 23, + 22.4, + 24.4, + 29.4, + 36.9, + 45.4, + 53.1 + ], + [ + 10.3, + 9.6, + 12, + 16.2, + 20.6, + 23.6, + 24.2, + 22.4, + 19, + 15.7, + 13.9, + 15.2, + 19.8, + 27.4, + 36.5, + 45.4, + 52.2, + 56, + 56.4, + 54.3, + 51, + 48.2, + 47.3, + 49, + 52.9, + 57.7, + 61.8, + 63.6, + 62, + 56.9, + 49.1, + 40.1, + 31.9, + 25.9, + 23, + 23.1, + 25.1, + 27.5, + 28.6, + 27.3, + 23.5, + 17.8, + 11.6, + 6.9, + 5, + 6.8, + 12, + 19.6, + 27.8, + 34.9, + 39.5, + 41.2, + 40.4, + 38.5, + 37, + 37.5, + 40.7, + 46.5, + 53.8, + 60.9, + 66.1 + ], + [ + 11.4, + 14, + 19, + 25, + 30.2, + 33.3, + 33.8, + 32.1, + 29.6, + 27.8, + 28.4, + 32.1, + 38.7, + 47.4, + 56.3, + 63.6, + 68, + 68.9, + 66.5, + 62.2, + 57.7, + 54.5, + 53.6, + 55.2, + 58.4, + 61.7, + 63.5, + 62.4, + 57.8, + 50.3, + 41.2, + 32.3, + 25.3, + 21.5, + 21, + 23.1, + 26.5, + 29.4, + 30.5, + 29.1, + 25.4, + 20.7, + 16.6, + 14.8, + 16.3, + 21.4, + 29.2, + 38.2, + 46.5, + 52.6, + 55.6, + 55.6, + 53.6, + 51.2, + 49.9, + 50.9, + 54.6, + 60.1, + 66.1, + 70.9, + 72.8 + ], + [ + 18.7, + 24.4, + 31.6, + 38.7, + 43.9, + 46.5, + 46.4, + 44.7, + 42.9, + 42.6, + 44.9, + 50.1, + 57.6, + 65.9, + 73.1, + 77.8, + 78.8, + 76.3, + 71.2, + 65.1, + 59.7, + 56.4, + 55.7, + 57.3, + 59.7, + 61.5, + 61, + 57.5, + 50.9, + 42.4, + 33.5, + 26.1, + 21.6, + 20.7, + 23.1, + 27.4, + 32.1, + 35.5, + 36.6, + 35.2, + 32.1, + 28.9, + 27.1, + 28.2, + 32.6, + 40, + 49.1, + 58, + 65.1, + 69.1, + 69.6, + 67.5, + 64, + 60.9, + 59.7, + 60.9, + 64.3, + 68.9, + 72.9, + 74.8, + 73.3 + ], + [ + 8.1, + 16.1, + 24.5, + 31.5, + 35.9, + 37.3, + 36.3, + 34.3, + 32.9, + 33.5, + 36.8, + 42.5, + 49.6, + 56.2, + 60.8, + 61.9, + 59.3, + 53.7, + 46.3, + 39.2, + 33.7, + 30.9, + 30.8, + 32.5, + 34.3, + 34.8, + 32.6, + 27.6, + 20.2, + 12, + 4.7, + 2, + 2, + 2, + 6.6, + 12.9, + 18.4, + 21.9, + 22.8, + 21.4, + 19, + 17.3, + 17.6, + 21, + 27.5, + 35.9, + 44.8, + 52.2, + 56.8, + 57.7, + 55.4, + 51, + 46.1, + 42.5, + 41.2, + 42.4, + 45.3, + 48.5, + 50.3, + 49.3, + 45 + ], + [ + 26.2, + 35.3, + 43.5, + 49.2, + 51.8, + 51.4, + 49.1, + 46.5, + 45.2, + 46.2, + 49.8, + 55.1, + 60.7, + 64.9, + 66, + 63.6, + 57.7, + 49.7, + 41.2, + 34.1, + 29.5, + 28, + 28.9, + 30.9, + 32.5, + 32, + 28.9, + 23.4, + 16.4, + 9.8, + 5.3, + 4.1, + 6.7, + 12.3, + 19.7, + 27, + 32.7, + 35.6, + 35.9, + 34.3, + 32.5, + 31.9, + 33.9, + 38.8, + 46, + 54.1, + 61.4, + 66.1, + 67.2, + 64.7, + 59.5, + 53.2, + 47.5, + 43.8, + 42.7, + 43.9, + 46.2, + 48, + 47.7, + 44.5, + 38.2 + ], + [ + 46.3, + 55, + 61.7, + 65.1, + 65, + 62.4, + 58.6, + 55.3, + 53.9, + 55.1, + 58.4, + 62.7, + 66.2, + 67.4, + 65.3, + 59.7, + 51.6, + 42.4, + 34.1, + 28.2, + 25.6, + 25.9, + 28.2, + 31, + 32.4, + 31.6, + 28.2, + 23.1, + 17.6, + 13.5, + 12.2, + 14.6, + 20.5, + 28.5, + 37.1, + 44.3, + 49.1, + 50.7, + 49.9, + 47.8, + 46.2, + 46.4, + 49.3, + 54.7, + 61.5, + 68.1, + 72.6, + 73.8, + 71.3, + 65.6, + 58.2, + 50.7, + 44.9, + 41.8, + 41.4, + 42.9, + 44.8, + 45.4, + 43.6, + 38.9, + 31.8 + ], + [ + 65.5, + 72.5, + 76.3, + 76.5, + 73.6, + 68.7, + 63.5, + 59.8, + 58.5, + 59.6, + 62.3, + 65.2, + 66.5, + 65, + 60.2, + 52.5, + 43.4, + 34.6, + 27.9, + 24.5, + 24.4, + 27.1, + 31, + 34.4, + 36, + 35.1, + 32, + 27.8, + 24.3, + 23.1, + 25.1, + 30.6, + 38.7, + 47.9, + 56.3, + 62.3, + 65.1, + 64.8, + 62.4, + 59.6, + 58, + 58.6, + 61.7, + 66.7, + 72.1, + 76.2, + 77.5, + 75.1, + 69.4, + 61.3, + 52.7, + 45.2, + 40.4, + 38.6, + 39.3, + 41.4, + 43.2, + 43.1, + 40.4, + 35.2, + 28.5 + ], + [ + 57, + 61, + 61.4, + 58.2, + 52.4, + 45.7, + 39.9, + 36.2, + 35.1, + 36.3, + 38.5, + 40, + 39.4, + 35.8, + 29.2, + 20.9, + 12.3, + 5.3, + 2, + 2, + 4.1, + 9, + 14.3, + 18.2, + 19.8, + 18.9, + 16.3, + 13.5, + 12.1, + 13.5, + 18.3, + 25.8, + 34.9, + 43.7, + 50.5, + 54, + 54.1, + 51.5, + 47.5, + 43.9, + 42.1, + 42.8, + 45.7, + 49.7, + 53.2, + 54.4, + 52.5, + 47.1, + 39, + 29.8, + 21.4, + 15.2, + 12.3, + 12.6, + 14.9, + 17.8, + 19.7, + 19.3, + 16.3, + 11.5, + 6.2 + ], + [ + 66.8, + 67.3, + 64, + 57.8, + 49.9, + 42.3, + 36.6, + 33.6, + 33.4, + 35, + 36.8, + 37.3, + 35.3, + 30.4, + 23.4, + 15.6, + 8.9, + 4.9, + 4.5, + 7.7, + 13.5, + 20.3, + 26.3, + 30.2, + 31.4, + 30.4, + 28.3, + 26.7, + 27.2, + 30.7, + 37.1, + 45.4, + 53.9, + 60.9, + 64.9, + 65.2, + 62.3, + 57.2, + 51.8, + 47.7, + 45.9, + 46.6, + 49.1, + 51.8, + 53.2, + 51.9, + 47.3, + 39.9, + 30.8, + 22, + 15.2, + 11.5, + 11.4, + 14, + 18.1, + 21.9, + 23.9, + 23.4, + 20.7, + 16.8, + 13.4 + ], + [ + 70.3, + 67.2, + 60.9, + 52.5, + 43.7, + 36.4, + 31.9, + 30.4, + 31.5, + 33.8, + 35.5, + 35.4, + 32.7, + 27.5, + 21.2, + 15.2, + 11.3, + 10.8, + 14, + 20.3, + 28.2, + 35.9, + 41.8, + 45, + 45.3, + 43.8, + 42, + 41.3, + 43.2, + 47.9, + 54.7, + 62.4, + 69.1, + 73.1, + 73.6, + 70.4, + 64.6, + 57.7, + 51.5, + 47.4, + 46, + 46.9, + 49, + 50.6, + 50.1, + 46.8, + 40.6, + 32.4, + 23.9, + 16.9, + 12.8, + 12.5, + 15.4, + 20.5, + 26.1, + 30.4, + 32.4, + 31.9, + 29.6, + 26.9, + 25.4 + ], + [ + 68.2, + 62.2, + 53.8, + 44.6, + 36.4, + 30.7, + 28.3, + 29, + 31.8, + 34.9, + 36.8, + 36.5, + 33.6, + 29, + 24.1, + 20.6, + 20, + 23, + 29.3, + 37.8, + 46.6, + 54, + 58.7, + 60.3, + 59.2, + 57, + 55.1, + 55, + 57.5, + 62.5, + 68.7, + 74.6, + 78.5, + 79, + 75.9, + 69.6, + 61.6, + 53.8, + 47.7, + 44.4, + 43.9, + 45.4, + 47.3, + 48, + 46.3, + 41.9, + 35.1, + 27.6, + 20.9, + 16.8, + 16.3, + 19.5, + 25.3, + 32.3, + 38.7, + 43, + 44.6, + 43.8, + 41.8, + 40.2, + 40.5 + ], + [ + 38.4, + 30.7, + 21.7, + 13.2, + 6.8, + 3.8, + 4.3, + 7.6, + 12, + 16, + 18.1, + 17.7, + 15.1, + 11.5, + 8.5, + 7.8, + 10.3, + 16.1, + 24.5, + 33.7, + 42, + 47.8, + 50.3, + 49.6, + 46.9, + 43.6, + 41.5, + 41.6, + 44.3, + 48.7, + 53.5, + 57, + 57.6, + 54.7, + 48.4, + 40, + 31.1, + 23.6, + 18.7, + 17, + 18, + 20.3, + 22.3, + 22.6, + 20.3, + 15.5, + 9.4, + 3.6, + 2, + 2, + 2.3, + 8.5, + 16.5, + 24.5, + 30.7, + 34.2, + 34.8, + 33.4, + 31.5, + 30.6, + 32.1 + ], + [ + 31.8, + 23.7, + 15.5, + 9, + 5.7, + 6.1, + 9.7, + 15.3, + 21.1, + 25.6, + 27.6, + 27.1, + 24.9, + 22.4, + 21.4, + 23.1, + 28, + 35.6, + 44.6, + 53.1, + 59.5, + 62.6, + 62.1, + 58.9, + 54.3, + 50.2, + 47.9, + 48.1, + 50.5, + 54, + 56.9, + 57.7, + 55.3, + 49.5, + 41.2, + 32, + 23.6, + 17.7, + 15.1, + 15.8, + 18.5, + 21.9, + 24.2, + 24.3, + 21.9, + 17.6, + 12.9, + 9.4, + 8.8, + 11.6, + 17.9, + 26.3, + 35.2, + 42.9, + 47.8, + 49.6, + 48.7, + 46.4, + 44.2, + 43.8, + 45.9 + ], + [ + 27, + 19.8, + 13.7, + 10.3, + 10.6, + 14.5, + 20.9, + 28.3, + 34.7, + 39, + 40.5, + 39.6, + 37.7, + 36.2, + 36.8, + 40.3, + 46.5, + 54.5, + 62.7, + 69.1, + 72.5, + 72.2, + 68.6, + 62.9, + 56.9, + 52.3, + 50, + 50.3, + 52.4, + 54.8, + 55.9, + 54.3, + 49.6, + 42.1, + 33.2, + 24.6, + 18.2, + 15, + 15.4, + 18.7, + 23.3, + 27.6, + 30.2, + 30.2, + 28, + 24.6, + 21.7, + 20.9, + 23.2, + 28.9, + 37.1, + 46.3, + 54.8, + 60.7, + 63.4, + 62.8, + 60, + 56.6, + 54.1, + 53.8, + 56 + ], + [ + 26.5, + 21.1, + 17.9, + 18.1, + 22, + 28.8, + 37.1, + 45.2, + 51.3, + 54.5, + 54.9, + 53.3, + 51.3, + 50.6, + 52.2, + 56.5, + 63, + 70.2, + 76.2, + 79.6, + 79.4, + 75.5, + 69.1, + 61.6, + 55, + 50.6, + 48.9, + 49.6, + 51.5, + 53, + 52.6, + 49.3, + 43.2, + 35.3, + 27.2, + 20.7, + 17.3, + 17.6, + 21.2, + 26.9, + 33.1, + 37.9, + 40.4, + 40.2, + 38.3, + 35.9, + 34.8, + 36.2, + 40.9, + 48.2, + 57.1, + 65.6, + 72.1, + 75.4, + 75, + 71.7, + 67, + 62.5, + 59.8, + 59.5, + 61.5 + ], + [ + 7.2, + 4.3, + 4.3, + 7.9, + 14.6, + 23.3, + 32.3, + 39.7, + 44.3, + 45.7, + 44.4, + 41.8, + 39.5, + 39.1, + 41.2, + 45.6, + 51.3, + 56.6, + 59.8, + 59.7, + 55.9, + 49, + 40.6, + 32.5, + 26.3, + 22.9, + 22.4, + 23.9, + 25.9, + 26.8, + 25.4, + 21.2, + 14.9, + 7.9, + 2, + 2, + 2, + 2.4, + 8.9, + 16.5, + 23.3, + 27.9, + 29.7, + 29.1, + 27.3, + 25.7, + 26, + 29.2, + 35.1, + 42.9, + 50.9, + 57.4, + 60.8, + 60.6, + 57, + 51.2, + 45, + 39.9, + 37.3, + 37.2, + 39 + ], + [ + 17.1, + 16.8, + 19.7, + 25.8, + 34.3, + 43.5, + 51.6, + 57.1, + 59.2, + 58.1, + 54.8, + 51.1, + 48.5, + 48.1, + 50.2, + 54.1, + 58.3, + 61.2, + 61.2, + 57.8, + 51.1, + 42.4, + 33.3, + 25.8, + 21.1, + 19.7, + 20.9, + 23.6, + 25.9, + 26.6, + 24.7, + 20.5, + 14.9, + 9.7, + 6.5, + 6.6, + 10.3, + 17.1, + 25.6, + 33.8, + 40.2, + 43.7, + 44.3, + 42.9, + 40.8, + 39.8, + 41, + 45, + 51.1, + 58.1, + 64.1, + 67.5, + 67.3, + 63.6, + 57.1, + 49.4, + 42.5, + 37.7, + 35.6, + 36.1, + 37.9 + ], + [ + 30.9, + 32.8, + 37.7, + 45.3, + 54, + 62.2, + 68.2, + 70.7, + 69.6, + 65.8, + 60.6, + 55.9, + 53.1, + 52.8, + 54.7, + 57.7, + 60.2, + 60.6, + 57.8, + 51.8, + 43.4, + 34.2, + 26, + 20.4, + 18.3, + 19.4, + 22.7, + 26.5, + 29.3, + 29.9, + 28, + 24.3, + 20.2, + 17.3, + 17.2, + 20.6, + 27.2, + 35.9, + 45, + 52.6, + 57.4, + 59, + 57.8, + 55.1, + 52.6, + 51.7, + 53.4, + 57.4, + 62.8, + 68, + 71.2, + 71.2, + 67.5, + 60.7, + 52.2, + 43.9, + 37.3, + 33.6, + 32.9, + 34.4, + 36.5 + ], + [ + 46.3, + 49.6, + 55.6, + 63.3, + 71, + 76.8, + 79.5, + 78.5, + 74.2, + 68, + 61.4, + 56.3, + 53.7, + 53.6, + 55.4, + 57.6, + 58.4, + 56.7, + 51.9, + 44.4, + 35.7, + 27.5, + 21.6, + 19, + 20, + 23.9, + 29.1, + 34, + 37.1, + 37.6, + 35.8, + 32.9, + 30.5, + 30, + 32.7, + 38.6, + 46.9, + 56.1, + 64.3, + 70, + 72.2, + 71.2, + 67.9, + 63.9, + 60.9, + 60, + 61.7, + 65.3, + 69.3, + 72.2, + 72.3, + 69, + 62.5, + 53.8, + 44.7, + 37, + 32, + 30.4, + 31.5, + 34.3, + 36.9 + ], + [ + 36.8, + 40.8, + 46.8, + 53.4, + 58.8, + 61.5, + 60.6, + 56.1, + 49, + 41.1, + 34.1, + 29.4, + 27.5, + 28.2, + 30, + 31.5, + 31.1, + 28, + 22.2, + 14.6, + 7, + 2, + 2, + 2, + 3.6, + 10, + 16.6, + 21.9, + 24.8, + 25, + 23.3, + 21.2, + 20.3, + 21.9, + 26.6, + 33.8, + 42.5, + 50.7, + 56.7, + 59.3, + 58.3, + 54.4, + 49.1, + 44.1, + 40.8, + 40, + 41.6, + 44.4, + 46.9, + 47.4, + 44.8, + 39, + 30.8, + 21.6, + 13.3, + 7.6, + 5.3, + 6.3, + 9.6, + 13.8, + 16.9 + ], + [ + 48.3, + 52.2, + 57.3, + 62, + 64.5, + 63.7, + 59.4, + 52.1, + 43.3, + 35, + 28.6, + 25.3, + 24.9, + 26.6, + 28.8, + 30, + 28.9, + 25.1, + 19.3, + 12.8, + 7.4, + 4.6, + 5.5, + 10, + 17.1, + 25.1, + 32.2, + 37.1, + 39.1, + 38.6, + 36.8, + 35.2, + 35.5, + 38.4, + 44.1, + 51.5, + 59, + 64.9, + 67.7, + 66.8, + 62.5, + 56.1, + 49.3, + 43.8, + 40.8, + 40.4, + 41.9, + 44, + 45, + 43.5, + 39, + 31.9, + 23.3, + 15.1, + 9.1, + 6.4, + 7.3, + 11.2, + 16.7, + 21.9, + 25.4 + ], + [ + 55.5, + 58.9, + 62.6, + 64.9, + 64.4, + 60.5, + 53.5, + 44.6, + 35.5, + 28.1, + 23.6, + 22.5, + 24.1, + 27.2, + 30, + 31.1, + 29.7, + 26, + 21, + 16.4, + 13.9, + 14.6, + 18.9, + 26.2, + 34.9, + 43.4, + 49.9, + 53.4, + 53.8, + 52.2, + 49.8, + 48.5, + 49.5, + 53, + 58.7, + 65.1, + 70.4, + 73.2, + 72.3, + 67.9, + 60.8, + 52.7, + 45.5, + 40.4, + 38.2, + 38.6, + 40.4, + 42.1, + 42, + 39.2, + 33.7, + 26.4, + 18.9, + 13.1, + 10.2, + 11.1, + 15.4, + 21.8, + 28.8, + 34.4, + 37.7 + ], + [ + 58.4, + 61.1, + 63.2, + 63.2, + 60.2, + 54, + 45.6, + 36.5, + 28.7, + 23.5, + 21.8, + 23.5, + 27.3, + 31.7, + 35.1, + 36.2, + 34.8, + 31.6, + 28, + 25.7, + 26.1, + 29.9, + 36.8, + 45.7, + 54.8, + 62.3, + 66.9, + 68.1, + 66.5, + 63.4, + 60.4, + 59.1, + 60.3, + 63.8, + 68.7, + 73.2, + 75.8, + 75.1, + 70.8, + 63.6, + 54.8, + 46.3, + 39.6, + 36, + 35.4, + 37.1, + 39.5, + 40.9, + 40.2, + 36.8, + 31.4, + 25.1, + 19.8, + 17, + 17.8, + 22.2, + 29.3, + 37.4, + 44.9, + 50.1, + 52.4 + ], + [ + 34.1, + 36.1, + 36.8, + 35.1, + 30.3, + 23, + 14.6, + 6.9, + 2, + 2, + 2, + 5.7, + 11.5, + 17, + 20.5, + 21.5, + 20.2, + 17.6, + 15.5, + 15.4, + 18.3, + 24.3, + 32.7, + 41.7, + 49.6, + 54.9, + 56.6, + 55, + 51.1, + 46.6, + 43, + 41.7, + 42.9, + 45.9, + 49.4, + 51.8, + 51.4, + 47.7, + 40.9, + 32, + 22.9, + 15.3, + 10.6, + 9.3, + 10.9, + 14, + 17.1, + 18.6, + 17.7, + 14.4, + 9.7, + 5.2, + 2.6, + 3.2, + 7.4, + 14.6, + 23.5, + 32.1, + 38.8, + 42.6, + 43.3 + ], + [ + 32.6, + 34.2, + 33.9, + 31, + 25.5, + 18.4, + 11.3, + 6.1, + 4, + 5.7, + 10.6, + 17.6, + 24.7, + 30.5, + 33.6, + 34.1, + 32.6, + 30.7, + 29.9, + 31.5, + 36.1, + 43.2, + 51.5, + 59.3, + 64.7, + 66.7, + 65.1, + 60.5, + 54.6, + 49, + 45.2, + 44.1, + 45.2, + 47.6, + 49.8, + 50, + 47.2, + 41.3, + 33, + 24, + 16.1, + 10.8, + 8.9, + 10.5, + 14.5, + 19.1, + 22.9, + 24.4, + 23.5, + 20.6, + 17.2, + 14.8, + 15.1, + 18.7, + 25.5, + 34.3, + 43.5, + 51.1, + 55.9, + 57.3, + 55.8 + ], + [ + 32.1, + 33.5, + 32.8, + 29.5, + 24.2, + 18.3, + 13.5, + 11.5, + 13, + 18.1, + 25.7, + 34.1, + 41.5, + 46.6, + 48.6, + 48.1, + 46.2, + 44.5, + 44.6, + 47.3, + 52.7, + 59.6, + 66.6, + 71.9, + 74, + 72.4, + 67.4, + 60.4, + 53.1, + 47.2, + 43.8, + 43.2, + 44.6, + 46.5, + 47.4, + 46, + 41.5, + 34.6, + 26.3, + 18.6, + 13.1, + 11.1, + 12.7, + 17.2, + 23.3, + 29, + 33, + 34.4, + 33.4, + 31.1, + 29, + 28.7, + 31.3, + 37.1, + 45.3, + 54.2, + 62.2, + 67.6, + 69.5, + 67.9, + 63.9 + ], + [ + 34.6, + 36.2, + 35.3, + 32.1, + 27.7, + 23.7, + 21.8, + 23, + 27.9, + 35.5, + 44.6, + 53.1, + 59.6, + 62.9, + 63.2, + 61.2, + 58.6, + 56.9, + 57.4, + 60.6, + 65.7, + 71.5, + 76.2, + 78.3, + 76.8, + 71.7, + 64.1, + 55.7, + 48.1, + 42.9, + 40.7, + 41.1, + 43, + 44.8, + 44.9, + 42.3, + 37.2, + 30.4, + 23.4, + 18.2, + 16, + 17.6, + 22.6, + 29.6, + 37, + 43.1, + 46.7, + 47.5, + 46.2, + 44.2, + 43.3, + 44.6, + 48.9, + 55.7, + 63.8, + 71.5, + 77, + 79.1, + 77.6, + 73, + 66.9 + ], + [ + 17.4, + 19, + 18.1, + 15.4, + 12.3, + 10.4, + 11.2, + 15.4, + 22.5, + 31.5, + 40.5, + 47.8, + 52.1, + 52.9, + 50.8, + 47.2, + 43.8, + 42, + 42.6, + 45.6, + 49.9, + 53.8, + 55.8, + 54.6, + 49.8, + 42.2, + 33.1, + 24.5, + 17.9, + 14.5, + 14.1, + 16.1, + 18.8, + 20.6, + 20.3, + 17.4, + 12.4, + 6.8, + 2.1, + 2, + 2, + 6.4, + 14, + 22.6, + 30.3, + 35.6, + 38, + 37.7, + 35.8, + 33.9, + 33.7, + 36, + 41, + 47.6, + 54.5, + 59.7, + 61.9, + 60.4, + 55.4, + 48.3, + 40.8 + ], + [ + 28.5, + 29.9, + 28.9, + 26.7, + 24.9, + 25, + 28, + 34.1, + 42.3, + 51.1, + 58.6, + 63.4, + 64.5, + 62.3, + 57.8, + 52.7, + 48.6, + 46.8, + 47.4, + 50, + 53.1, + 54.9, + 54.2, + 50.2, + 43.1, + 34.2, + 25.1, + 17.8, + 13.4, + 12.6, + 14.6, + 18.3, + 21.9, + 23.9, + 23.5, + 20.7, + 16.6, + 12.7, + 10.7, + 11.8, + 16.5, + 24.1, + 33.2, + 41.9, + 48.5, + 52.1, + 52.5, + 50.6, + 47.8, + 45.8, + 45.9, + 48.6, + 53.4, + 59, + 63.6, + 65.7, + 64.3, + 59.4, + 51.8, + 43.2, + 35.4 + ], + [ + 42.8, + 43.4, + 42.1, + 40.2, + 39.4, + 40.9, + 45.4, + 52.2, + 60.1, + 67.4, + 72.2, + 73.5, + 71.2, + 66, + 59.5, + 53.4, + 49.2, + 47.6, + 48.4, + 50.6, + 52.4, + 52.4, + 49.5, + 43.6, + 35.4, + 26.7, + 19.1, + 14.3, + 13.1, + 15.3, + 19.9, + 25.1, + 29.4, + 31.5, + 31, + 28.6, + 25.6, + 23.7, + 24.4, + 28.3, + 35.2, + 44.1, + 53.2, + 60.6, + 65, + 66, + 63.9, + 60.2, + 56.4, + 54.2, + 54.4, + 57, + 61, + 64.8, + 66.8, + 65.7, + 61.1, + 53.6, + 44.6, + 35.8, + 29 + ], + [ + 58.2, + 57.6, + 55.5, + 53.6, + 53.4, + 55.8, + 60.8, + 67.2, + 73.6, + 78.2, + 79.6, + 77.3, + 71.7, + 64.2, + 56.5, + 50.2, + 46.6, + 45.8, + 47.1, + 49, + 49.9, + 48.5, + 44.3, + 37.6, + 29.8, + 22.6, + 17.7, + 16.3, + 18.6, + 23.8, + 30.5, + 36.7, + 41.2, + 42.9, + 42.3, + 40.2, + 38.3, + 38.3, + 41, + 46.8, + 54.8, + 63.5, + 71.1, + 75.9, + 77.2, + 75, + 70.5, + 65.1, + 60.6, + 58.3, + 58.6, + 60.8, + 63.7, + 65.6, + 65.1, + 61.3, + 54.4, + 45.6, + 36.5, + 29, + 24.5 + ], + [ + 48.2, + 45.9, + 42.9, + 40.8, + 40.9, + 43.5, + 48.1, + 53.3, + 57.4, + 58.8, + 56.7, + 51.1, + 43, + 34.3, + 26.5, + 21.3, + 19.1, + 19.7, + 21.8, + 23.7, + 24.1, + 21.9, + 17.2, + 10.8, + 4.5, + 2, + 2, + 2, + 6.3, + 13.9, + 21.8, + 28.2, + 31.9, + 32.9, + 31.7, + 29.7, + 28.7, + 30, + 34.1, + 40.6, + 48.3, + 55.5, + 60.3, + 61.8, + 59.5, + 54.3, + 47.6, + 41.1, + 36.5, + 34.5, + 35.1, + 37, + 38.9, + 39.1, + 36.5, + 30.8, + 22.9, + 14.3, + 6.7, + 2, + 2 + ], + [ + 58.6, + 54.5, + 50.5, + 48.2, + 48.3, + 50.8, + 54.5, + 57.9, + 59.3, + 57.6, + 52.5, + 44.5, + 35.4, + 26.7, + 20.3, + 17.1, + 17.1, + 19.4, + 22.6, + 24.8, + 24.9, + 22.5, + 18.1, + 13, + 9, + 7.5, + 9.6, + 15.2, + 23.2, + 32, + 39.9, + 45.3, + 47.6, + 47.1, + 45, + 42.9, + 42.4, + 44.4, + 48.9, + 55.1, + 61.3, + 65.9, + 67.4, + 65.2, + 59.6, + 52, + 44, + 37.5, + 33.5, + 32.4, + 33.5, + 35.5, + 36.6, + 35.5, + 31.6, + 25.3, + 17.6, + 10.5, + 5.6, + 4.1, + 6.4 + ], + [ + 63.9, + 58.2, + 53.6, + 51.3, + 51.5, + 53.6, + 56.3, + 57.8, + 56.7, + 52.5, + 45.3, + 36.4, + 27.6, + 20.5, + 16.6, + 16.3, + 18.9, + 23.1, + 27.2, + 29.8, + 29.9, + 27.6, + 24, + 20.7, + 19.2, + 20.8, + 25.9, + 33.8, + 43, + 51.6, + 58.2, + 61.5, + 61.5, + 59.2, + 56, + 53.6, + 53.2, + 55.4, + 59.6, + 64.6, + 68.6, + 70.1, + 68.1, + 62.6, + 54.6, + 45.7, + 37.7, + 32.2, + 29.8, + 30.2, + 32.3, + 34.5, + 35.2, + 33.4, + 29.1, + 23, + 16.9, + 12.3, + 10.8, + 12.9, + 18.5 + ], + [ + 63.8, + 57.2, + 52.6, + 50.7, + 51.3, + 53.2, + 54.9, + 54.8, + 51.9, + 46, + 38.1, + 29.7, + 22.6, + 18.4, + 17.8, + 20.7, + 25.9, + 31.7, + 36.5, + 39, + 39, + 37, + 34.4, + 32.9, + 33.8, + 38, + 45, + 53.9, + 62.7, + 69.8, + 73.8, + 74.2, + 71.6, + 67.3, + 63, + 60.3, + 59.9, + 62, + 65.4, + 68.8, + 70.2, + 68.7, + 63.7, + 55.9, + 46.7, + 38, + 31.4, + 28, + 27.8, + 30.2, + 33.5, + 36.1, + 36.6, + 34.7, + 30.6, + 25.8, + 21.8, + 20.3, + 22.2, + 27.7, + 35.7 + ], + [ + 35.4, + 28.9, + 25.2, + 24.3, + 25.6, + 27.6, + 28.6, + 27.4, + 23.4, + 17.1, + 9.7, + 3.1, + 2, + 2, + 2, + 7, + 14.2, + 21, + 25.8, + 27.9, + 27.4, + 25.6, + 23.8, + 23.8, + 26.6, + 32.3, + 40.1, + 48.4, + 55.5, + 59.8, + 60.4, + 57.6, + 52.4, + 46.4, + 41.4, + 38.6, + 38.5, + 40.3, + 42.8, + 44.4, + 43.6, + 39.6, + 32.6, + 23.9, + 15, + 7.9, + 3.8, + 3.4, + 6, + 10.3, + 14.8, + 17.7, + 18.3, + 16.4, + 13.1, + 9.8, + 8.3, + 9.8, + 14.7, + 22.4, + 31.6 + ], + [ + 28.8, + 23.6, + 21.6, + 22.4, + 24.7, + 27, + 27.7, + 26, + 21.7, + 15.9, + 10.2, + 6.3, + 5.5, + 8.4, + 14.6, + 22.7, + 30.9, + 37.5, + 41.4, + 42.4, + 41.2, + 39.2, + 38, + 39.1, + 42.9, + 49, + 56.3, + 62.9, + 67.1, + 67.8, + 64.9, + 59, + 51.7, + 44.8, + 39.8, + 37.6, + 37.9, + 39.7, + 41.4, + 41.5, + 38.9, + 33.4, + 25.7, + 17.4, + 10.3, + 6, + 5.3, + 8.2, + 13.4, + 19.5, + 24.7, + 27.7, + 28.1, + 26.4, + 23.9, + 22.3, + 23, + 26.9, + 33.7, + 42.4, + 51.2 + ], + [ + 22.8, + 20, + 20.4, + 23.2, + 26.8, + 29.5, + 30.2, + 28.3, + 24.4, + 19.9, + 16.5, + 15.6, + 18.3, + 24.3, + 32.6, + 41.7, + 49.6, + 54.9, + 57.1, + 56.3, + 53.9, + 51.5, + 50.7, + 52.2, + 56.3, + 61.9, + 67.5, + 71.5, + 72.3, + 69.4, + 63.3, + 55.1, + 46.8, + 40.1, + 36, + 34.9, + 36, + 38.1, + 39.3, + 38.5, + 34.8, + 28.9, + 21.7, + 15.2, + 11, + 10.2, + 13.1, + 19, + 26.3, + 33.4, + 38.6, + 41, + 40.9, + 39.1, + 37.4, + 37.2, + 39.6, + 45, + 52.5, + 60.7, + 67.8 + ], + [ + 20.3, + 20.5, + 23.7, + 28.5, + 33.2, + 36.3, + 36.9, + 35.1, + 32, + 29.1, + 28.1, + 30.1, + 35.5, + 43.6, + 52.8, + 61.3, + 67.6, + 70.5, + 70.2, + 67.4, + 63.7, + 60.7, + 59.9, + 61.5, + 65.2, + 69.6, + 73, + 73.9, + 71.4, + 65.4, + 57.1, + 48, + 40, + 34.5, + 32.3, + 33, + 35.4, + 37.9, + 39, + 37.6, + 33.8, + 28.3, + 22.7, + 18.8, + 18, + 20.8, + 26.9, + 35, + 43.5, + 50.4, + 54.6, + 55.8, + 54.7, + 52.7, + 51.3, + 52, + 55.4, + 61.2, + 68.2, + 74.7, + 79 + ] + ], + "facts": { + "arch": "x64", + "cores": 36, + "logical": 72, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "cpu" +} diff --git a/apps/tasks/scenes/perf_cpu_narrow.json b/apps/tasks/scenes/perf_cpu_narrow.json new file mode 100644 index 00000000..8e8c8e7b --- /dev/null +++ b/apps/tasks/scenes/perf_cpu_narrow.json @@ -0,0 +1,1954 @@ +{ + "size": [ + 1280, + 800 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "cpu" +} diff --git a/apps/tasks/scenes/perf_cpu_short.json b/apps/tasks/scenes/perf_cpu_short.json new file mode 100644 index 00000000..28d44c4d --- /dev/null +++ b/apps/tasks/scenes/perf_cpu_short.json @@ -0,0 +1,1954 @@ +{ + "size": [ + 1280, + 560 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "cpu" +} diff --git a/apps/tasks/scenes/perf_cpu_who_hover.json b/apps/tasks/scenes/perf_cpu_who_hover.json new file mode 100644 index 00000000..9869267b --- /dev/null +++ b/apps/tasks/scenes/perf_cpu_who_hover.json @@ -0,0 +1,1958 @@ +{ + "size": [ + 1440, + 900 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "cpu", + "input": [ + "hover 700,572", + "advance 300" + ] +} diff --git a/apps/tasks/scenes/perf_disk_hdd_idle.json b/apps/tasks/scenes/perf_disk_hdd_idle.json new file mode 100644 index 00000000..5f32b105 --- /dev/null +++ b/apps/tasks/scenes/perf_disk_hdd_idle.json @@ -0,0 +1,1963 @@ +{ + "size": [ + 1440, + 900 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ], + "kind": "ssd", + "model": "Samsung SSD 980 PRO 2TB", + "capacity_gib": 1863, + "volumes": "C" + }, + { + "number": 1, + "active": [ + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.5, + 0.6, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.6, + 0.4, + 0.4, + 0.6, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.6, + 0.6 + ], + "mbps": [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1 + ], + "kind": "hdd", + "model": "WDC WD40EZAZ-00SF3B0", + "capacity_gib": 3725, + "volumes": "D" + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "disk", + "resource_id": 1 +} diff --git a/apps/tasks/scenes/perf_disk_ssd.json b/apps/tasks/scenes/perf_disk_ssd.json new file mode 100644 index 00000000..8f267de2 --- /dev/null +++ b/apps/tasks/scenes/perf_disk_ssd.json @@ -0,0 +1,1964 @@ +{ + "size": [ + 1440, + 900 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ], + "kind": "ssd", + "model": "Samsung SSD 980 PRO 2TB", + "capacity_gib": 1863, + "volumes": "C" + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ], + "kind": "hdd", + "model": "WDC WD40EZAZ-00SF3B0", + "capacity_gib": 3725, + "volumes": "D" + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "disk", + "readout": 18, + "resource_id": 0 +} diff --git a/apps/tasks/scenes/perf_fit_cpu_520x400.json b/apps/tasks/scenes/perf_fit_cpu_520x400.json new file mode 100644 index 00000000..86617a40 --- /dev/null +++ b/apps/tasks/scenes/perf_fit_cpu_520x400.json @@ -0,0 +1,1955 @@ +{ + "size": [ + 520, + 400 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "cpu", + "readout": 18 +} diff --git a/apps/tasks/scenes/perf_fit_cpu_640x560.json b/apps/tasks/scenes/perf_fit_cpu_640x560.json new file mode 100644 index 00000000..b9d30310 --- /dev/null +++ b/apps/tasks/scenes/perf_fit_cpu_640x560.json @@ -0,0 +1,1955 @@ +{ + "size": [ + 640, + 560 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "cpu", + "readout": 18 +} diff --git a/apps/tasks/scenes/perf_fit_cpu_760x700.json b/apps/tasks/scenes/perf_fit_cpu_760x700.json new file mode 100644 index 00000000..e13c084d --- /dev/null +++ b/apps/tasks/scenes/perf_fit_cpu_760x700.json @@ -0,0 +1,1955 @@ +{ + "size": [ + 760, + 700 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "cpu", + "readout": 18 +} diff --git a/apps/tasks/scenes/perf_fit_disk_520x400.json b/apps/tasks/scenes/perf_fit_disk_520x400.json new file mode 100644 index 00000000..6edb508e --- /dev/null +++ b/apps/tasks/scenes/perf_fit_disk_520x400.json @@ -0,0 +1,1964 @@ +{ + "size": [ + 520, + 400 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ], + "kind": "ssd", + "model": "Samsung SSD 980 PRO 2TB", + "capacity_gib": 1863, + "volumes": "C" + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ], + "kind": "hdd", + "model": "WDC WD40EZAZ-00SF3B0", + "capacity_gib": 3725, + "volumes": "D" + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "disk", + "readout": 18, + "resource_id": 0 +} diff --git a/apps/tasks/scenes/perf_fit_disk_640x560.json b/apps/tasks/scenes/perf_fit_disk_640x560.json new file mode 100644 index 00000000..3dac0907 --- /dev/null +++ b/apps/tasks/scenes/perf_fit_disk_640x560.json @@ -0,0 +1,1964 @@ +{ + "size": [ + 640, + 560 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ], + "kind": "ssd", + "model": "Samsung SSD 980 PRO 2TB", + "capacity_gib": 1863, + "volumes": "C" + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ], + "kind": "hdd", + "model": "WDC WD40EZAZ-00SF3B0", + "capacity_gib": 3725, + "volumes": "D" + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "disk", + "readout": 18, + "resource_id": 0 +} diff --git a/apps/tasks/scenes/perf_fit_memory_520x400.json b/apps/tasks/scenes/perf_fit_memory_520x400.json new file mode 100644 index 00000000..59ea2802 --- /dev/null +++ b/apps/tasks/scenes/perf_fit_memory_520x400.json @@ -0,0 +1,1954 @@ +{ + "size": [ + 520, + 400 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 54, + 55, + 55, + 56, + 56, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 57, + 57, + 57, + 56, + 56, + 55, + 55, + 54, + 53, + 53, + 52, + 52, + 51, + 51, + 51, + 50, + 50, + 50, + 50, + 50, + 50, + 50, + 51, + 51, + 51, + 52, + 52, + 53, + 53, + 54, + 55, + 55, + 56, + 56, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 57, + 57 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 34.4, + 35.7, + 37.6, + 38.6, + 37.2, + 33, + 26.3, + 18.4, + 11.1, + 6, + 4.4, + 6.5, + 11.5, + 18, + 24.3, + 28.7, + 30.4, + 29.8, + 27.7, + 25.8, + 25.6 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "memory" +} diff --git a/apps/tasks/scenes/perf_fit_memory_640x560.json b/apps/tasks/scenes/perf_fit_memory_640x560.json new file mode 100644 index 00000000..a2c91f30 --- /dev/null +++ b/apps/tasks/scenes/perf_fit_memory_640x560.json @@ -0,0 +1,1954 @@ +{ + "size": [ + 640, + 560 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 54, + 55, + 55, + 56, + 56, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 57, + 57, + 57, + 56, + 56, + 55, + 55, + 54, + 53, + 53, + 52, + 52, + 51, + 51, + 51, + 50, + 50, + 50, + 50, + 50, + 50, + 50, + 51, + 51, + 51, + 52, + 52, + 53, + 53, + 54, + 55, + 55, + 56, + 56, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 57, + 57 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 34.4, + 35.7, + 37.6, + 38.6, + 37.2, + 33, + 26.3, + 18.4, + 11.1, + 6, + 4.4, + 6.5, + 11.5, + 18, + 24.3, + 28.7, + 30.4, + 29.8, + 27.7, + 25.8, + 25.6 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "memory" +} diff --git a/apps/tasks/scenes/perf_list_many.json b/apps/tasks/scenes/perf_list_many.json new file mode 100644 index 00000000..2335546c --- /dev/null +++ b/apps/tasks/scenes/perf_list_many.json @@ -0,0 +1,2106 @@ +{ + "size": [ + 1440, + 900 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ], + "kind": "ssd", + "model": "Samsung SSD 980 PRO 2TB", + "capacity_gib": 1863, + "volumes": "C" + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ], + "kind": "hdd", + "model": "WDC WD40EZAZ-00SF3B0", + "capacity_gib": 3725, + "volumes": "D" + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ], + "description": "Intel(R) Wi-Fi 6E AX211 160MHz", + "link_mbit": 1201, + "ipv4": [ + "192.0.2.24" + ], + "ipv6": [ + "2001:db8::1c4a:7e12:93f0:55aa" + ] + }, + { + "id": 3, + "name": "vEthernet (WSL)", + "connected": true, + "description": "Hyper-V Virtual Ethernet Adapter", + "link_mbit": 10000, + "rx_mbit": [ + 0.155, + 0.2725, + 0.34500000000000003, + 0.26749999999999996, + 0.3275, + 0.29, + 0.21749999999999997, + 0.0875, + 0.075, + 0.015, + 0, + 0.075, + 0.075, + 0.12250000000000001, + 0.185, + 0.35, + 0.325, + 0.3675, + 0.32999999999999996, + 0.27749999999999997, + 0.0925, + 0.145, + 0, + 0.02, + 0.0225, + 0.12, + 0.11499999999999999, + 0.1825, + 0.29, + 0.275, + 0.3825, + 0.2975, + 0.2375, + 0.0725, + 0.09, + 0.027500000000000004, + 0, + 0, + 0.1275, + 0.11000000000000001, + 0.26, + 0.3525, + 0.34750000000000003, + 0.325, + 0.22000000000000003, + 0.16999999999999998, + 0.08, + 0.017499999999999998, + 0, + 0, + 0.0625, + 0.0475, + 0.1675, + 0.175, + 0.36, + 0.2725, + 0.29, + 0.215, + 0.28500000000000003, + 0.1775, + 0.31 + ], + "tx_mbit": [ + 0.02, + 0.03, + 0.025, + 0.027500000000000004, + 0.0375, + 0.034999999999999996, + 0.0225, + 0.02, + 0.0125, + 0.0125, + 0.01, + 0.0125, + 0.0125, + 0.025, + 0.02, + 0.027500000000000004, + 0.04, + 0.0375, + 0.025, + 0.017499999999999998, + 0.015, + 0.0125, + 0.0125, + 0.005, + 0.0125, + 0.02, + 0.0225, + 0.0325, + 0.0325, + 0.0325, + 0.025, + 0.034999999999999996, + 0.0225, + 0.015, + 0.005, + 0.005, + 0.0125, + 0.015, + 0.015, + 0.0225, + 0.03, + 0.027500000000000004, + 0.0375, + 0.0325, + 0.027500000000000004, + 0.015, + 0.0125, + 0.0125, + 0.0075, + 0.01, + 0.017499999999999998, + 0.01, + 0.0125, + 0.025, + 0.0225, + 0.03, + 0.025, + 0.0225, + 0.027500000000000004, + 0.0125, + 0.027500000000000004 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false, + "description": "Realtek PCIe 2.5GbE Family Controller", + "rx_mbit": [], + "tx_mbit": [] + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "cpu" +} diff --git a/apps/tasks/scenes/perf_memory.json b/apps/tasks/scenes/perf_memory.json new file mode 100644 index 00000000..1c1cec72 --- /dev/null +++ b/apps/tasks/scenes/perf_memory.json @@ -0,0 +1,1954 @@ +{ + "size": [ + 1280, + 800 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 54, + 55, + 55, + 56, + 56, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 57, + 57, + 57, + 56, + 56, + 55, + 55, + 54, + 53, + 53, + 52, + 52, + 51, + 51, + 51, + 50, + 50, + 50, + 50, + 50, + 50, + 50, + 51, + 51, + 51, + 52, + 52, + 53, + 53, + 54, + 55, + 55, + 56, + 56, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 57, + 57 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 34.4, + 35.7, + 37.6, + 38.6, + 37.2, + 33, + 26.3, + 18.4, + 11.1, + 6, + 4.4, + 6.5, + 11.5, + 18, + 24.3, + 28.7, + 30.4, + 29.8, + 27.7, + 25.8, + 25.6 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "memory" +} diff --git a/apps/tasks/scenes/perf_memory_high.json b/apps/tasks/scenes/perf_memory_high.json new file mode 100644 index 00000000..5e0cc92a --- /dev/null +++ b/apps/tasks/scenes/perf_memory_high.json @@ -0,0 +1,1955 @@ +{ + "size": [ + 1440, + 900 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 93, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 58, + 59, + 59, + 60, + 60, + 61, + 61, + 62, + 62, + 63, + 63, + 64, + 64, + 65, + 65, + 66, + 66, + 67, + 67, + 68, + 70, + 71, + 72, + 73, + 74, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 87, + 88, + 89, + 90, + 91, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 34.4, + 35.7, + 37.6, + 38.6, + 37.2, + 33, + 26.3, + 18.4, + 11.1, + 6, + 4.4, + 6.5, + 11.5, + 18, + 24.3, + 28.7, + 30.4, + 29.8, + 27.7, + 25.8, + 25.6 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "memory", + "readout": 30 +} diff --git a/apps/tasks/scenes/perf_net_ethernet_off.json b/apps/tasks/scenes/perf_net_ethernet_off.json new file mode 100644 index 00000000..b490cc57 --- /dev/null +++ b/apps/tasks/scenes/perf_net_ethernet_off.json @@ -0,0 +1,1974 @@ +{ + "size": [ + 1440, + 900 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ], + "kind": "ssd", + "model": "Samsung SSD 980 PRO 2TB", + "capacity_gib": 1863, + "volumes": "C" + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ], + "kind": "hdd", + "model": "WDC WD40EZAZ-00SF3B0", + "capacity_gib": 3725, + "volumes": "D" + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ], + "description": "Intel(R) Wi-Fi 6E AX211 160MHz", + "link_mbit": 1201, + "ipv4": [ + "192.0.2.24" + ], + "ipv6": [ + "2001:db8::1c4a:7e12:93f0:55aa" + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false, + "description": "Realtek PCIe 2.5GbE Family Controller", + "rx_mbit": [], + "tx_mbit": [] + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "network", + "resource_id": 2 +} diff --git a/apps/tasks/scenes/perf_net_wifi.json b/apps/tasks/scenes/perf_net_wifi.json new file mode 100644 index 00000000..5bbafdc1 --- /dev/null +++ b/apps/tasks/scenes/perf_net_wifi.json @@ -0,0 +1,1975 @@ +{ + "size": [ + 1440, + 900 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4, + "commit_total": 22760000000, + "commit_limit": 39300000000 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ], + "kind": "ssd", + "model": "Samsung SSD 980 PRO 2TB", + "capacity_gib": 1863, + "volumes": "C" + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ], + "kind": "hdd", + "model": "WDC WD40EZAZ-00SF3B0", + "capacity_gib": 3725, + "volumes": "D" + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ], + "description": "Intel(R) Wi-Fi 6E AX211 160MHz", + "link_mbit": 1201, + "ipv4": [ + "192.0.2.24" + ], + "ipv6": [ + "2001:db8::1c4a:7e12:93f0:55aa" + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false, + "description": "Realtek PCIe 2.5GbE Family Controller", + "rx_mbit": [], + "tx_mbit": [] + } + ], + "cores": [ + [ + 30, + 39, + 46.3, + 50.5, + 51.3, + 49.3, + 46, + 42.9, + 41.5, + 42.7, + 46.1, + 50.7, + 54.9, + 57, + 55.9, + 51.2, + 43.6, + 34.6, + 26.1, + 19.7, + 16.4, + 16.1, + 18, + 20.5, + 21.9, + 21.2, + 17.8, + 12.5, + 6.4, + 2, + 2, + 2, + 5.5, + 13, + 21.3, + 28.8, + 33.9, + 36, + 35.5, + 33.6, + 32, + 32, + 34.7, + 40.1, + 47.1, + 54.2, + 59.7, + 62, + 60.6, + 55.8, + 48.9, + 41.7, + 35.8, + 32.4, + 31.8, + 33.1, + 35.1, + 36.1, + 34.7, + 30.3, + 23.3 + ], + [ + 49.8, + 57.4, + 62.2, + 63.5, + 61.4, + 57.1, + 52.4, + 48.7, + 47.4, + 48.5, + 51.4, + 54.7, + 56.7, + 55.9, + 51.8, + 44.7, + 35.7, + 26.6, + 19.3, + 15, + 14.1, + 16.1, + 19.5, + 22.7, + 24.3, + 23.4, + 20.1, + 15.6, + 11.5, + 9.4, + 10.5, + 15.1, + 22.7, + 31.7, + 40.3, + 46.8, + 50.2, + 50.6, + 48.7, + 46.2, + 44.5, + 45.1, + 48.2, + 53.4, + 59.3, + 64.2, + 66.5, + 65.2, + 60.3, + 52.9, + 44.4, + 36.9, + 31.6, + 29.3, + 29.7, + 31.6, + 33.3, + 33.4, + 30.9, + 25.8, + 18.9 + ], + [ + 66.7, + 71.7, + 73.1, + 70.9, + 66, + 59.7, + 54, + 50.2, + 49.1, + 50.2, + 52.6, + 54.5, + 54.4, + 51.3, + 45.2, + 36.8, + 27.9, + 20.3, + 15.4, + 14.1, + 16.2, + 20.5, + 25.4, + 29.2, + 30.8, + 29.9, + 27.1, + 23.9, + 21.9, + 22.6, + 26.6, + 33.7, + 42.6, + 51.7, + 59.1, + 63.5, + 64.4, + 62.5, + 59, + 55.6, + 53.9, + 54.6, + 57.6, + 61.9, + 66, + 68.2, + 67.1, + 62.5, + 55, + 46, + 37.4, + 30.7, + 27.1, + 26.7, + 28.5, + 31.2, + 33, + 32.6, + 29.7, + 24.7, + 18.9 + ], + [ + 78.4, + 79.9, + 77.7, + 72.3, + 65, + 57.5, + 51.7, + 48.4, + 47.9, + 49.3, + 51.2, + 51.9, + 50.3, + 45.7, + 38.7, + 30.6, + 23.2, + 18.2, + 16.7, + 18.9, + 23.9, + 30.2, + 36.1, + 40.1, + 41.4, + 40.4, + 38.2, + 36.3, + 36.3, + 39.2, + 45.2, + 53.4, + 62.3, + 70, + 74.9, + 76.2, + 74.2, + 69.9, + 64.8, + 60.8, + 59, + 59.7, + 62.3, + 65.4, + 67.4, + 66.9, + 63, + 56, + 47.1, + 38, + 30.5, + 26, + 25, + 26.9, + 30.5, + 34, + 36, + 35.5, + 32.7, + 28.5, + 24.5 + ], + [ + 59.7, + 57.7, + 52.2, + 44.2, + 35.6, + 28.1, + 23.1, + 21.1, + 21.8, + 23.8, + 25.5, + 25.6, + 23, + 17.8, + 11.1, + 4.5, + 2, + 2, + 2, + 5.7, + 13.1, + 20.7, + 26.7, + 30.2, + 30.8, + 29.5, + 27.6, + 26.7, + 28.3, + 32.7, + 39.5, + 47.5, + 54.9, + 59.9, + 61.5, + 59.3, + 54.3, + 47.9, + 41.8, + 37.6, + 36.1, + 36.9, + 39.1, + 41, + 41.1, + 38.3, + 32.4, + 24.3, + 15.5, + 7.8, + 2.8, + 2, + 3.4, + 7.8, + 12.9, + 17.2, + 19.2, + 18.7, + 16.3, + 13.2, + 11.2 + ], + [ + 59.1, + 53.9, + 46, + 36.9, + 28.3, + 22, + 18.9, + 18.9, + 21.1, + 24, + 25.9, + 25.6, + 22.7, + 17.8, + 12.4, + 8.1, + 6.6, + 8.6, + 14, + 22, + 30.6, + 38.3, + 43.4, + 45.6, + 45, + 43, + 41.1, + 40.9, + 43.3, + 48.3, + 54.8, + 61.4, + 66.1, + 67.8, + 65.6, + 60.2, + 52.8, + 45.1, + 38.9, + 35.3, + 60, + 61.8, + 63.6, + 65.4, + 67.2, + 69, + 70.8, + 72.6, + 74.4, + 76.2, + 78, + 79.8, + 81.6, + 83.4, + 85.2, + 87, + 88.8, + 90.6, + 92.4, + 94.2, + 96 + ], + [ + 54.2, + 46.9, + 37.9, + 29, + 21.9, + 18, + 17.6, + 20.1, + 24, + 27.8, + 29.8, + 29.4, + 26.8, + 22.8, + 19.2, + 17.7, + 19.3, + 24.4, + 32.3, + 41.4, + 50, + 56.5, + 59.7, + 59.7, + 57.5, + 54.6, + 52.5, + 52.6, + 55.3, + 60, + 65.3, + 69.5, + 71.1, + 69.2, + 63.8, + 55.8, + 47.1, + 39.3, + 34, + 31.8, + 32.2, + 34.3, + 36.2, + 36.6, + 34.4, + 29.6, + 23.2, + 16.8, + 12, + 10.4, + 12.4, + 17.8, + 25.3, + 33.1, + 39.5, + 43.3, + 44.3, + 43.1, + 41.2, + 40.1, + 41.3 + ], + [ + 47.5, + 39.4, + 30.8, + 23.6, + 19.3, + 18.6, + 21.3, + 26.2, + 31.7, + 36, + 38.1, + 37.7, + 35.4, + 32.6, + 31, + 32, + 36.2, + 43.5, + 52.4, + 61.3, + 68.4, + 72.4, + 72.9, + 70.4, + 66.4, + 62.5, + 60.2, + 60.4, + 62.9, + 66.7, + 70.2, + 71.8, + 70.3, + 65.2, + 57.4, + 48.3, + 39.6, + 33.1, + 29.7, + 29.6, + 31.8, + 34.9, + 37.1, + 37.2, + 34.7, + 30.3, + 25.1, + 20.9, + 19.2, + 21.1, + 26.5, + 34.4, + 43.2, + 51.1, + 56.5, + 58.9, + 58.5, + 56.5, + 54.4, + 53.9, + 55.9 + ], + [ + 17.9, + 10.3, + 3.4, + 2, + 2, + 2, + 6.8, + 13.7, + 20, + 24.4, + 26.2, + 25.4, + 23.4, + 21.7, + 21.9, + 24.9, + 30.8, + 38.9, + 47.4, + 54.6, + 59, + 59.7, + 57.1, + 52.1, + 46.5, + 41.9, + 39.6, + 39.8, + 42, + 44.7, + 46.4, + 45.4, + 41.3, + 34.2, + 25.3, + 16.4, + 9.2, + 5.2, + 4.6, + 7.1, + 11.2, + 15.2, + 17.7, + 17.8, + 15.5, + 11.8, + 8.3, + 6.7, + 8.2, + 13.1, + 20.9, + 30, + 38.8, + 45.4, + 48.9, + 49.1, + 46.8, + 43.7, + 41.3, + 41, + 43.2 + ], + [ + 15.9, + 9.9, + 5.8, + 4.9, + 7.7, + 13.8, + 21.6, + 29.6, + 35.9, + 39.6, + 40.3, + 39, + 37.1, + 36.1, + 37.5, + 41.7, + 48.2, + 55.8, + 62.6, + 66.9, + 67.8, + 65, + 59.3, + 52.3, + 45.8, + 41.2, + 39.3, + 39.8, + 41.8, + 43.5, + 43.5, + 40.6, + 34.8, + 26.9, + 18.4, + 11.2, + 6.8, + 6, + 8.6, + 13.7, + 19.4, + 24.2, + 26.7, + 26.7, + 24.6, + 22, + 20.3, + 21.1, + 25.2, + 32.2, + 41, + 49.9, + 57.1, + 61.3, + 61.9, + 59.4, + 55.2, + 51, + 48.3, + 48, + 50.1 + ], + [ + 19, + 15.4, + 14.4, + 17, + 23, + 31.3, + 40.2, + 47.9, + 53.1, + 55.1, + 54.4, + 52.1, + 49.9, + 49.4, + 51.5, + 55.9, + 62, + 67.9, + 72, + 72.9, + 70.2, + 64.1, + 56.2, + 48.1, + 41.7, + 37.9, + 37, + 38.2, + 40.2, + 41.2, + 40, + 36, + 29.7, + 22.2, + 15.5, + 11.1, + 10.1, + 12.9, + 18.6, + 25.7, + 32.4, + 37.2, + 39.3, + 38.9, + 37, + 35.2, + 35.2, + 37.9, + 43.5, + 51.3, + 59.7, + 67, + 71.4, + 72.3, + 69.6, + 64.6, + 58.7, + 53.8, + 51, + 50.8, + 52.7 + ], + [ + 27.5, + 26.4, + 28.5, + 33.9, + 42, + 51.3, + 59.8, + 66, + 68.9, + 68.6, + 65.9, + 62.5, + 60, + 59.6, + 61.8, + 65.9, + 70.6, + 74.2, + 75.2, + 72.7, + 66.8, + 58.5, + 49.5, + 41.6, + 36.3, + 34.2, + 34.9, + 37.2, + 39.5, + 40.1, + 38.3, + 34.1, + 28.2, + 22.3, + 18.2, + 17.3, + 20, + 26, + 34, + 42.1, + 48.8, + 52.7, + 53.8, + 52.6, + 50.6, + 49.5, + 50.5, + 54.3, + 60.5, + 67.8, + 74.5, + 78.9, + 79.9, + 77.1, + 71.4, + 64.3, + 57.4, + 52.4, + 50.1, + 50.4, + 52.2 + ], + [ + 16.3, + 17.5, + 22, + 29.2, + 38.1, + 46.7, + 53.4, + 56.9, + 56.9, + 53.8, + 49.2, + 44.8, + 42, + 41.6, + 43.6, + 46.9, + 49.9, + 51, + 49, + 43.7, + 35.7, + 26.4, + 17.9, + 11.6, + 8.5, + 8.8, + 11.5, + 15, + 17.7, + 18.3, + 16.4, + 12.4, + 7.8, + 4.2, + 3.2, + 5.6, + 11.5, + 19.8, + 28.8, + 36.8, + 42.2, + 44.4, + 43.8, + 41.5, + 39.1, + 38.3, + 39.9, + 43.9, + 49.7, + 55.4, + 59.5, + 60.5, + 57.9, + 51.9, + 43.9, + 35.6, + 28.8, + 24.7, + 23.5, + 24.6, + 26.6 + ], + [ + 31.4, + 34.4, + 40.2, + 48, + 56.1, + 62.8, + 66.6, + 66.6, + 63.3, + 57.7, + 51.5, + 46.4, + 43.7, + 43.5, + 45.3, + 47.7, + 49, + 47.9, + 43.6, + 36.4, + 27.7, + 19, + 12.3, + 8.7, + 8.7, + 11.8, + 16.4, + 21.1, + 24.1, + 24.6, + 22.9, + 19.7, + 16.7, + 15.6, + 17.4, + 22.7, + 30.7, + 39.9, + 48.5, + 54.9, + 58, + 57.8, + 55.1, + 51.5, + 48.6, + 47.8, + 49.5, + 53.2, + 57.7, + 61.3, + 62.4, + 60, + 54.2, + 45.9, + 36.9, + 28.8, + 23.3, + 20.9, + 21.5, + 23.8, + 26.3 + ], + [ + 46.5, + 50.3, + 56.4, + 63.5, + 69.7, + 73.4, + 73.5, + 70, + 63.7, + 56.2, + 49.2, + 44.3, + 42.2, + 42.5, + 44.3, + 46, + 45.9, + 43.1, + 37.5, + 29.8, + 21.8, + 15.1, + 11.3, + 11.2, + 14.5, + 20.2, + 26.5, + 31.7, + 34.7, + 35.1, + 33.4, + 31, + 29.7, + 30.7, + 34.9, + 41.9, + 50.6, + 59.2, + 66, + 69.7, + 69.7, + 66.6, + 61.9, + 57.1, + 53.9, + 53.1, + 54.7, + 57.7, + 60.7, + 61.8, + 60, + 54.9, + 47, + 37.8, + 29.2, + 22.7, + 19.5, + 19.7, + 22.3, + 26, + 29.1 + ], + [ + 59, + 63, + 68.5, + 73.8, + 77.3, + 77.5, + 74.1, + 67.5, + 59.2, + 50.8, + 44.2, + 40.3, + 39.4, + 40.7, + 42.8, + 44.1, + 43.1, + 39.4, + 33.5, + 26.6, + 20.4, + 16.7, + 16.5, + 20, + 26.3, + 33.9, + 41, + 46.1, + 48.5, + 48.2, + 46.5, + 44.8, + 44.7, + 47.3, + 52.8, + 60.3, + 68.3, + 75, + 78.8, + 79, + 75.7, + 70, + 63.5, + 58.1, + 54.9, + 54.4, + 55.9, + 58.2, + 59.6, + 58.7, + 54.7, + 47.8, + 39.2, + 30.5, + 23.7, + 20, + 19.9, + 23, + 27.8, + 32.7, + 36.2 + ] + ], + "facts": { + "arch": "x64", + "cores": 8, + "logical": 16, + "sockets": 1, + "base_mhz": 3000, + "l1_kb": 640, + "l2_kb": 10240, + "l3_kb": 24576, + "virtualization": true, + "uptime_s": 274375 + } + }, + "page": "performance", + "resource": "network", + "readout": 18, + "resource_id": 1 +} diff --git a/apps/tasks/scenes/rows_compact.json b/apps/tasks/scenes/rows_compact.json new file mode 100644 index 00000000..b770f2dc --- /dev/null +++ b/apps/tasks/scenes/rows_compact.json @@ -0,0 +1,337 @@ +{ + "size": [ + 1000, + 640 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.1 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 4000, + "identity": "orbit-id" + }, + { + "pid": 5000, + "identity": "quill-id" + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "pending", + "quill-id": "none", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 2, + "input": [ + "key Ctrl+-" + ] +} diff --git a/apps/tasks/scenes/rows_heat.json b/apps/tasks/scenes/rows_heat.json new file mode 100644 index 00000000..5830e1c8 --- /dev/null +++ b/apps/tasks/scenes/rows_heat.json @@ -0,0 +1,212 @@ +{ + "size": [ + 1000, + 560 + ], + "mode": "list", + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 10, + "created": 133500000000010000, + "parent": 1000, + "session": 1, + "image": "app0.exe", + "path": "C:\\Apps\\app0.exe", + "cpu": [ + 0.2 + ], + "ws_private": 94371840, + "io": [ + 104857.6 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 11, + "created": 133500000000011000, + "parent": 1000, + "session": 1, + "image": "app1.exe", + "path": "C:\\Apps\\app1.exe", + "cpu": [ + 1.5 + ], + "ws_private": 262144000, + "io": [ + 734003.2 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 12, + "created": 133500000000012000, + "parent": 1000, + "session": 1, + "image": "app2.exe", + "path": "C:\\Apps\\app2.exe", + "cpu": [ + 6 + ], + "ws_private": 629145600, + "io": [ + 2097152 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 13, + "created": 133500000000013000, + "parent": 1000, + "session": 1, + "image": "app3.exe", + "path": "C:\\Apps\\app3.exe", + "cpu": [ + 18 + ], + "ws_private": 1363148800, + "io": [ + 8388608 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 14, + "created": 133500000000014000, + "parent": 1000, + "session": 1, + "image": "app4.exe", + "path": "C:\\Apps\\app4.exe", + "cpu": [ + 40 + ], + "ws_private": 2726297600, + "io": [ + 31457280 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 30, + "created": 133500000000030000, + "parent": 1000, + "session": 1, + "image": "mix0.exe", + "path": "C:\\Apps\\mix0.exe", + "cpu": [ + 40 + ], + "ws_private": 94371840, + "io": [ + 104857.6 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 31, + "created": 133500000000031000, + "parent": 1000, + "session": 1, + "image": "mix1.exe", + "path": "C:\\Apps\\mix1.exe", + "cpu": [ + 0.2 + ], + "ws_private": 2726297600, + "io": [ + 104857.6 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 32, + "created": 133500000000032000, + "parent": 1000, + "session": 1, + "image": "mix2.exe", + "path": "C:\\Apps\\mix2.exe", + "cpu": [ + 0.2 + ], + "ws_private": 94371840, + "io": [ + 31457280 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 33, + "created": 133500000000033000, + "parent": 1000, + "session": 1, + "image": "mix3.exe", + "path": "C:\\Apps\\mix3.exe", + "cpu": [ + 18 + ], + "ws_private": 262144000, + "io": [ + 2097152 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [], + "services": [], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": {}, + "names": { + "c:\\apps\\app0.exe": "App0", + "c:\\apps\\app1.exe": "App1", + "c:\\apps\\app2.exe": "App2", + "c:\\apps\\app3.exe": "App3", + "c:\\apps\\app4.exe": "App4", + "c:\\apps\\mix0.exe": "Mix0", + "c:\\apps\\mix1.exe": "Mix1", + "c:\\apps\\mix2.exe": "Mix2", + "c:\\apps\\mix3.exe": "Mix3" + }, + "ticks": 2, + "input": [], + "sort": { + "col": "name", + "desc": false + } +} diff --git a/apps/tasks/scenes/rows_hover.json b/apps/tasks/scenes/rows_hover.json new file mode 100644 index 00000000..81a523c0 --- /dev/null +++ b/apps/tasks/scenes/rows_hover.json @@ -0,0 +1,338 @@ +{ + "size": [ + 1000, + 640 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.1 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 4000, + "identity": "orbit-id" + }, + { + "pid": 5000, + "identity": "quill-id" + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "pending", + "quill-id": "none", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 2, + "input": [ + "click 300,324", + "hover 300,260" + ] +} diff --git a/apps/tasks/scenes/rows_hung.json b/apps/tasks/scenes/rows_hung.json new file mode 100644 index 00000000..d54d6070 --- /dev/null +++ b/apps/tasks/scenes/rows_hung.json @@ -0,0 +1,336 @@ +{ + "size": [ + 1000, + 560 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.1 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 4000, + "identity": "orbit-id" + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": true + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 2, + "input": [] +} diff --git a/apps/tasks/scenes/rows_icons.json b/apps/tasks/scenes/rows_icons.json new file mode 100644 index 00000000..d3d481d1 --- /dev/null +++ b/apps/tasks/scenes/rows_icons.json @@ -0,0 +1,335 @@ +{ + "size": [ + 1000, + 672 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.1 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 4000, + "identity": "orbit-id" + }, + { + "pid": 5000, + "identity": "quill-id" + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "pending", + "quill-id": "none", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 2, + "input": [] +} diff --git a/apps/tasks/scenes/rows_loading.json b/apps/tasks/scenes/rows_loading.json new file mode 100644 index 00000000..2da30dff --- /dev/null +++ b/apps/tasks/scenes/rows_loading.json @@ -0,0 +1,335 @@ +{ + "size": [ + 1000, + 560 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.1 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 4000, + "identity": "orbit-id" + }, + { + "pid": 5000, + "identity": "quill-id" + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "pending", + "quill-id": "none", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 0, + "input": [] +} diff --git a/apps/tasks/scenes/rows_no_match.json b/apps/tasks/scenes/rows_no_match.json new file mode 100644 index 00000000..9fd21d68 --- /dev/null +++ b/apps/tasks/scenes/rows_no_match.json @@ -0,0 +1,338 @@ +{ + "size": [ + 1000, + 560 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.1 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 4000, + "identity": "orbit-id" + }, + { + "pid": 5000, + "identity": "quill-id" + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "pending", + "quill-id": "none", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 2, + "input": [ + "key Ctrl+F", + "type xyz" + ] +} diff --git a/apps/tasks/scenes/rows_roles.json b/apps/tasks/scenes/rows_roles.json new file mode 100644 index 00000000..f93a17fe --- /dev/null +++ b/apps/tasks/scenes/rows_roles.json @@ -0,0 +1,442 @@ +{ + "size": [ + 1120, + 640 + ], + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 52, + "commit_pct": 40, + "cpu_pct": 18, + "dpc_irq_pct": 1.4 + }, + "ticks": 2, + "mode": "grouped", + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 60 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 16, + "handles": 0, + "base_prio": 8 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209715, + "io": [ + 5000 + ], + "threads": 176, + "handles": 3120, + "base_prio": 8 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 0, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.3 + ], + "ws_private": 188743680, + "io": [ + 3000 + ], + "threads": 61, + "handles": 3401, + "base_prio": 8 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 6.5 + ], + "ws_private": 220200960, + "io": [ + 42000 + ], + "threads": 34, + "handles": 880, + "base_prio": 8 + }, + { + "pid": 2010, + "created": 133500000002010000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 12.2 + ], + "ws_private": 335544320, + "io": [ + 8000 + ], + "threads": 22, + "handles": 540, + "base_prio": 8 + }, + { + "pid": 2020, + "created": 133500000002020000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 2.1 + ], + "ws_private": 492830720, + "io": [ + 1000 + ], + "threads": 17, + "handles": 410, + "base_prio": 8 + }, + { + "pid": 2030, + "created": 133500000002030000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\Ember\\ember.exe", + "cpu": [ + 0.2 + ], + "ws_private": 96468992, + "io": [ + 0 + ], + "threads": 12, + "handles": 260, + "base_prio": 8 + }, + { + "pid": 2040, + "created": 133500000002040000, + "parent": 2000, + "session": 1, + "image": "ember_report.exe", + "path": "C:\\Program Files\\Ember\\ember_report.exe", + "cpu": [ + 0 + ], + "ws_private": 6291456, + "io": [ + 0 + ], + "threads": 4, + "handles": 90, + "base_prio": 8 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 1.5 + ], + "ws_private": 167772160, + "io": [ + 9000 + ], + "threads": 12, + "handles": 230, + "base_prio": 8 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.1 + ], + "ws_private": 25165824, + "io": [ + 2000 + ], + "threads": 14, + "handles": 480, + "base_prio": 8 + }, + { + "pid": 5100, + "created": 133500000005100000, + "parent": 4, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0 + ], + "ws_private": 15728640, + "io": [ + 0 + ], + "threads": 9, + "handles": 310, + "base_prio": 8 + }, + { + "pid": 6000, + "created": 133500000006000000, + "parent": 1000, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\Harbor\\harbor.exe", + "cpu": [ + 0 + ], + "ws_private": 60817408, + "io": [ + 0 + ], + "threads": 7, + "handles": 150, + "base_prio": 6 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 241172480, + "io": [ + 0 + ], + "threads": 13, + "handles": 220, + "base_prio": 8 + }, + { + "pid": 8000, + "created": 133500000008000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.1 + ], + "ws_private": 47185920, + "io": [ + 3000 + ], + "threads": 8, + "handles": 270, + "base_prio": 13 + }, + { + "pid": 9000, + "created": 133500000009000000, + "parent": 1000, + "session": 1, + "image": "nova.exe", + "path": "C:\\Program Files\\Nova\\nova.exe", + "cpu": [ + 0.3 + ], + "ws_private": 35651584, + "io": [ + 0 + ], + "threads": 6, + "handles": 140, + "base_prio": 8 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id" + }, + { + "pid": 2000, + "identity": "ember-id" + }, + { + "pid": 3000, + "identity": "prism-id" + }, + { + "pid": 6000, + "identity": "harbor-id" + }, + { + "pid": 7000, + "identity": "quill-id", + "hung": true + } + ], + "hung_s": 30, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "harbor-id": "Harbor", + "quill-id": "Quill", + "c:\\windows\\explorer.exe": "File Explorer", + "c:\\program files\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\harbor\\harbor.exe": "Harbor", + "c:\\program files\\quill\\quill.exe": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\program files\\nova\\nova.exe": "Nova" + }, + "services": [ + { + "pid": 5000, + "name": "LocalSvc", + "display": "Local Service Host" + }, + { + "pid": 5100, + "name": "NetSvc", + "display": "Network Service Host" + } + ], + "collapsed": { + "windows": false + }, + "facts": [ + { + "pid": 4, + "user": "SYSTEM", + "class": "normal", + "efficiency": false + }, + { + "pid": 1000, + "user": "Mara", + "command_line": "C:\\\\Windows\\\\Explorer.EXE", + "class": "normal", + "efficiency": false + }, + { + "pid": 2000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 2010, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=gpu-process --gpu-preferences=UAAAAAAAAADgAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "class": "normal", + "efficiency": false + }, + { + "pid": 2020, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=renderer --lang=it --device-scale-factor=1", + "class": "normal", + "efficiency": false + }, + { + "pid": 2030, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=utility --utility-sub-type=network.mojom.NetworkService", + "class": "normal", + "efficiency": true + }, + { + "pid": 2040, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Ember\\\\ember.exe\" --type=crashpad-handler /prefetch:7", + "class": "normal", + "efficiency": false + }, + { + "pid": 3000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Prism\\\\prism.exe\"", + "class": "above", + "efficiency": false + }, + { + "pid": 5000, + "user": "SERVIZIO LOCALE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k LocalService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 5100, + "user": "SERVIZIO DI RETE", + "command_line": "C:\\\\Windows\\\\system32\\\\svchost.exe -k NetworkService -p", + "class": "normal", + "efficiency": false + }, + { + "pid": 6000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Harbor\\\\harbor.exe\" --quiet", + "class": "below", + "efficiency": true + }, + { + "pid": 7000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Quill\\\\quill.exe\"", + "class": "normal", + "efficiency": false + }, + { + "pid": 8000, + "user": "Mara", + "command_line": "\"C:\\\\Program Files\\\\Syncer\\\\syncer.exe\" --profile=\"C:\\\\Users\\\\Mara\\\\AppData\\\\Roaming\\\\Syncer\\\\profiles\\\\default\" --watch=\"D:\\\\Projects\\\\Archive\\\\2026\" --log-level=verbose --retry=5 --background", + "class": "high", + "efficiency": false + }, + { + "pid": 9000, + "unavailable": true + } + ], + "input": [ + "click 500,268", + "key Right", + "advance 600" + ] +} diff --git a/apps/tasks/scenes/run_dialog_empty.json b/apps/tasks/scenes/run_dialog_empty.json new file mode 100644 index 00000000..91d40cd9 --- /dev/null +++ b/apps/tasks/scenes/run_dialog_empty.json @@ -0,0 +1,718 @@ +{ + "size": [ + 984, + 560 + ], + "mode": "list", + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 41, + "commit_pct": 38, + "cpu_pct": 3.2, + "dpc_irq_pct": 0.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 94 + ], + "ws_private": 8192, + "io": [ + 0 + ], + "threads": 16, + "handles": 0 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.014 + ], + "ws_private": 63763482, + "io": [ + 12249 + ], + "threads": 41, + "handles": 144 + }, + { + "pid": 40, + "created": 133500000000040000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.022 + ], + "ws_private": 9632618, + "io": [ + 1375 + ], + "threads": 43, + "handles": 975 + }, + { + "pid": 64, + "created": 133500000000064000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.027 + ], + "ws_private": 40758530, + "io": [ + 12100 + ], + "threads": 35, + "handles": 801 + }, + { + "pid": 84, + "created": 133500000000084000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.028 + ], + "ws_private": 59903688, + "io": [ + 7249 + ], + "threads": 23, + "handles": 182 + }, + { + "pid": 116, + "created": 133500000000116000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.05 + ], + "ws_private": 28821974, + "io": [ + 3576 + ], + "threads": 43, + "handles": 209 + }, + { + "pid": 136, + "created": 133500000000136000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.027 + ], + "ws_private": 13086726, + "io": [ + 2280 + ], + "threads": 28, + "handles": 795 + }, + { + "pid": 140, + "created": 133500000000140000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.036 + ], + "ws_private": 64572218, + "io": [ + 5314 + ], + "threads": 27, + "handles": 417 + }, + { + "pid": 156, + "created": 133500000000156000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.031 + ], + "ws_private": 51066978, + "io": [ + 6195 + ], + "threads": 10, + "handles": 886 + }, + { + "pid": 184, + "created": 133500000000184000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.023 + ], + "ws_private": 68976709, + "io": [ + 9691 + ], + "threads": 11, + "handles": 328 + }, + { + "pid": 224, + "created": 133500000000224000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.035 + ], + "ws_private": 37294088, + "io": [ + 3497 + ], + "threads": 21, + "handles": 260 + }, + { + "pid": 228, + "created": 133500000000228000, + "parent": 4, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.041 + ], + "ws_private": 54109050, + "io": [ + 2893 + ], + "threads": 25, + "handles": 767 + }, + { + "pid": 264, + "created": 133500000000264000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 0.022 + ], + "ws_private": 31875862, + "io": [ + 12767 + ], + "threads": 37, + "handles": 553 + }, + { + "pid": 284, + "created": 133500000000284000, + "parent": 4, + "session": 0, + "image": "csrss.exe", + "path": "C:\\Windows\\System32\\csrss.exe", + "cpu": [ + 0.047 + ], + "ws_private": 66512847, + "io": [ + 6488 + ], + "threads": 39, + "handles": 286 + }, + { + "pid": 296, + "created": 133500000000296000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.057 + ], + "ws_private": 51267224, + "io": [ + 4175 + ], + "threads": 6, + "handles": 364 + }, + { + "pid": 332, + "created": 133500000000332000, + "parent": 4, + "session": 0, + "image": "lsass.exe", + "path": "C:\\Windows\\System32\\lsass.exe", + "cpu": [ + 0.046 + ], + "ws_private": 19543466, + "io": [ + 10185 + ], + "threads": 34, + "handles": 475 + }, + { + "pid": 348, + "created": 133500000000348000, + "parent": 4, + "session": 1, + "image": "RuntimeBroker.exe", + "path": "C:\\Windows\\System32\\RuntimeBroker.exe", + "cpu": [ + 0.021 + ], + "ws_private": 19221900, + "io": [ + 17416 + ], + "threads": 12, + "handles": 710 + }, + { + "pid": 376, + "created": 133500000000376000, + "parent": 4, + "session": 1, + "image": "conhost.exe", + "path": "C:\\Windows\\System32\\conhost.exe", + "cpu": [ + 0.026 + ], + "ws_private": 23189470, + "io": [ + 10477 + ], + "threads": 17, + "handles": 190 + }, + { + "pid": 392, + "created": 133500000000392000, + "parent": 4, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\orbit\\orbit.exe", + "cpu": [ + 0.163 + ], + "ws_private": 246572740, + "io": [ + 77531 + ], + "threads": 34, + "handles": 308 + }, + { + "pid": 420, + "created": 133500000000420000, + "parent": 4, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\quill\\quill.exe", + "cpu": [ + 0.205 + ], + "ws_private": 62701655, + "io": [ + 66820 + ], + "threads": 36, + "handles": 606 + }, + { + "pid": 456, + "created": 133500000000456000, + "parent": 4, + "session": 1, + "image": "marble.exe", + "path": "C:\\Program Files\\marble\\marble.exe", + "cpu": [ + 0.02 + ], + "ws_private": 245587156, + "io": [ + 39212 + ], + "threads": 43, + "handles": 920 + }, + { + "pid": 464, + "created": 133500000000464000, + "parent": 4, + "session": 1, + "image": "lantern.exe", + "path": "C:\\Program Files\\lantern\\lantern.exe", + "cpu": [ + 0.099 + ], + "ws_private": 273055829, + "io": [ + 73070 + ], + "threads": 43, + "handles": 956 + }, + { + "pid": 468, + "created": 133500000000468000, + "parent": 4, + "session": 1, + "image": "pebble.exe", + "path": "C:\\Program Files\\pebble\\pebble.exe", + "cpu": [ + 0.309 + ], + "ws_private": 106922248, + "io": [ + 88252 + ], + "threads": 13, + "handles": 931 + }, + { + "pid": 504, + "created": 133500000000504000, + "parent": 4, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\harbor\\harbor.exe", + "cpu": [ + 0.227 + ], + "ws_private": 195255648, + "io": [ + 33472 + ], + "threads": 11, + "handles": 124 + }, + { + "pid": 508, + "created": 133500000000508000, + "parent": 4, + "session": 1, + "image": "tundra.exe", + "path": "C:\\Program Files\\tundra\\tundra.exe", + "cpu": [ + 0.047 + ], + "ws_private": 250346132, + "io": [ + 7881 + ], + "threads": 18, + "handles": 542 + }, + { + "pid": 548, + "created": 133500000000548000, + "parent": 4, + "session": 1, + "image": "cobalt.exe", + "path": "C:\\Program Files\\cobalt\\cobalt.exe", + "cpu": [ + 0.066 + ], + "ws_private": 192903506, + "io": [ + 45600 + ], + "threads": 20, + "handles": 584 + }, + { + "pid": 552, + "created": 133500000000552000, + "parent": 4, + "session": 1, + "image": "willow.exe", + "path": "C:\\Program Files\\willow\\willow.exe", + "cpu": [ + 0.237 + ], + "ws_private": 105914043, + "io": [ + 39778 + ], + "threads": 11, + "handles": 772 + }, + { + "pid": 584, + "created": 133500000000584000, + "parent": 4, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\ember\\ember.exe", + "cpu": [ + 0.151 + ], + "ws_private": 73785238, + "io": [ + 82088 + ], + "threads": 7, + "handles": 628 + }, + { + "pid": 592, + "created": 133500000000592000, + "parent": 4, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\prism\\prism.exe", + "cpu": [ + 0.296 + ], + "ws_private": 143698895, + "io": [ + 57548 + ], + "threads": 22, + "handles": 342 + }, + { + "pid": 608, + "created": 133500000000608000, + "parent": 4, + "session": 1, + "image": "atlas.exe", + "path": "C:\\Program Files\\atlas\\atlas.exe", + "cpu": [ + 0.239 + ], + "ws_private": 124528679, + "io": [ + 1226 + ], + "threads": 35, + "handles": 605 + }, + { + "pid": 636, + "created": 133500000000636000, + "parent": 4, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\orbit\\orbit.exe", + "cpu": [ + 0.267 + ], + "ws_private": 187077684, + "io": [ + 25945 + ], + "threads": 12, + "handles": 958 + }, + { + "pid": 668, + "created": 133500000000668000, + "parent": 4, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\quill\\quill.exe", + "cpu": [ + 0.01 + ], + "ws_private": 130624145, + "io": [ + 46646 + ], + "threads": 6, + "handles": 571 + }, + { + "pid": 708, + "created": 133500000000708000, + "parent": 4, + "session": 1, + "image": "marble.exe", + "path": "C:\\Program Files\\marble\\marble.exe", + "cpu": [ + 0.15 + ], + "ws_private": 292837724, + "io": [ + 684 + ], + "threads": 43, + "handles": 320 + }, + { + "pid": 728, + "created": 133500000000728000, + "parent": 4, + "session": 1, + "image": "lantern.exe", + "path": "C:\\Program Files\\lantern\\lantern.exe", + "cpu": [ + 0.328 + ], + "ws_private": 109166829, + "io": [ + 12233 + ], + "threads": 41, + "handles": 223 + }, + { + "pid": 744, + "created": 133500000000744000, + "parent": 4, + "session": 1, + "image": "pebble.exe", + "path": "C:\\Program Files\\pebble\\pebble.exe", + "cpu": [ + 0.012 + ], + "ws_private": 189593291, + "io": [ + 16208 + ], + "threads": 31, + "handles": 932 + }, + { + "pid": 764, + "created": 133500000000764000, + "parent": 4, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\harbor\\harbor.exe", + "cpu": [ + 0.021 + ], + "ws_private": 279354087, + "io": [ + 40819 + ], + "threads": 4, + "handles": 563 + }, + { + "pid": 796, + "created": 133500000000796000, + "parent": 4, + "session": 1, + "image": "tundra.exe", + "path": "C:\\Program Files\\tundra\\tundra.exe", + "cpu": [ + 0.101 + ], + "ws_private": 149904659, + "io": [ + 51223 + ], + "threads": 38, + "handles": 977 + }, + { + "pid": 824, + "created": 133500000000824000, + "parent": 4, + "session": 1, + "image": "cobalt.exe", + "path": "C:\\Program Files\\cobalt\\cobalt.exe", + "cpu": [ + 0.038 + ], + "ws_private": 44966074, + "io": [ + 17781 + ], + "threads": 41, + "handles": 624 + }, + { + "pid": 860, + "created": 133500000000860000, + "parent": 4, + "session": 1, + "image": "willow.exe", + "path": "C:\\Program Files\\willow\\willow.exe", + "cpu": [ + 0.242 + ], + "ws_private": 241794264, + "io": [ + 14371 + ], + "threads": 30, + "handles": 302 + }, + { + "pid": 864, + "created": 133500000000864000, + "parent": 4, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\ember\\ember.exe", + "cpu": [ + 0.317 + ], + "ws_private": 193291826, + "io": [ + 33114 + ], + "threads": 38, + "handles": 844 + }, + { + "pid": 888, + "created": 133500000000888000, + "parent": 4, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\prism\\prism.exe", + "cpu": [ + 0.001 + ], + "ws_private": 153477581, + "io": [ + 74864 + ], + "threads": 40, + "handles": 806 + } + ], + "ticks": 2, + "input": [ + "command run_new" + ] +} diff --git a/apps/tasks/scenes/run_dialog_history.json b/apps/tasks/scenes/run_dialog_history.json new file mode 100644 index 00000000..bffc23d4 --- /dev/null +++ b/apps/tasks/scenes/run_dialog_history.json @@ -0,0 +1,727 @@ +{ + "size": [ + 984, + 560 + ], + "mode": "list", + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 41, + "commit_pct": 38, + "cpu_pct": 3.2, + "dpc_irq_pct": 0.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 94 + ], + "ws_private": 8192, + "io": [ + 0 + ], + "threads": 16, + "handles": 0 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.014 + ], + "ws_private": 63763482, + "io": [ + 12249 + ], + "threads": 41, + "handles": 144 + }, + { + "pid": 40, + "created": 133500000000040000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.022 + ], + "ws_private": 9632618, + "io": [ + 1375 + ], + "threads": 43, + "handles": 975 + }, + { + "pid": 64, + "created": 133500000000064000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.027 + ], + "ws_private": 40758530, + "io": [ + 12100 + ], + "threads": 35, + "handles": 801 + }, + { + "pid": 84, + "created": 133500000000084000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.028 + ], + "ws_private": 59903688, + "io": [ + 7249 + ], + "threads": 23, + "handles": 182 + }, + { + "pid": 116, + "created": 133500000000116000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.05 + ], + "ws_private": 28821974, + "io": [ + 3576 + ], + "threads": 43, + "handles": 209 + }, + { + "pid": 136, + "created": 133500000000136000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.027 + ], + "ws_private": 13086726, + "io": [ + 2280 + ], + "threads": 28, + "handles": 795 + }, + { + "pid": 140, + "created": 133500000000140000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.036 + ], + "ws_private": 64572218, + "io": [ + 5314 + ], + "threads": 27, + "handles": 417 + }, + { + "pid": 156, + "created": 133500000000156000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.031 + ], + "ws_private": 51066978, + "io": [ + 6195 + ], + "threads": 10, + "handles": 886 + }, + { + "pid": 184, + "created": 133500000000184000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.023 + ], + "ws_private": 68976709, + "io": [ + 9691 + ], + "threads": 11, + "handles": 328 + }, + { + "pid": 224, + "created": 133500000000224000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.035 + ], + "ws_private": 37294088, + "io": [ + 3497 + ], + "threads": 21, + "handles": 260 + }, + { + "pid": 228, + "created": 133500000000228000, + "parent": 4, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.041 + ], + "ws_private": 54109050, + "io": [ + 2893 + ], + "threads": 25, + "handles": 767 + }, + { + "pid": 264, + "created": 133500000000264000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 0.022 + ], + "ws_private": 31875862, + "io": [ + 12767 + ], + "threads": 37, + "handles": 553 + }, + { + "pid": 284, + "created": 133500000000284000, + "parent": 4, + "session": 0, + "image": "csrss.exe", + "path": "C:\\Windows\\System32\\csrss.exe", + "cpu": [ + 0.047 + ], + "ws_private": 66512847, + "io": [ + 6488 + ], + "threads": 39, + "handles": 286 + }, + { + "pid": 296, + "created": 133500000000296000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.057 + ], + "ws_private": 51267224, + "io": [ + 4175 + ], + "threads": 6, + "handles": 364 + }, + { + "pid": 332, + "created": 133500000000332000, + "parent": 4, + "session": 0, + "image": "lsass.exe", + "path": "C:\\Windows\\System32\\lsass.exe", + "cpu": [ + 0.046 + ], + "ws_private": 19543466, + "io": [ + 10185 + ], + "threads": 34, + "handles": 475 + }, + { + "pid": 348, + "created": 133500000000348000, + "parent": 4, + "session": 1, + "image": "RuntimeBroker.exe", + "path": "C:\\Windows\\System32\\RuntimeBroker.exe", + "cpu": [ + 0.021 + ], + "ws_private": 19221900, + "io": [ + 17416 + ], + "threads": 12, + "handles": 710 + }, + { + "pid": 376, + "created": 133500000000376000, + "parent": 4, + "session": 1, + "image": "conhost.exe", + "path": "C:\\Windows\\System32\\conhost.exe", + "cpu": [ + 0.026 + ], + "ws_private": 23189470, + "io": [ + 10477 + ], + "threads": 17, + "handles": 190 + }, + { + "pid": 392, + "created": 133500000000392000, + "parent": 4, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\orbit\\orbit.exe", + "cpu": [ + 0.163 + ], + "ws_private": 246572740, + "io": [ + 77531 + ], + "threads": 34, + "handles": 308 + }, + { + "pid": 420, + "created": 133500000000420000, + "parent": 4, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\quill\\quill.exe", + "cpu": [ + 0.205 + ], + "ws_private": 62701655, + "io": [ + 66820 + ], + "threads": 36, + "handles": 606 + }, + { + "pid": 456, + "created": 133500000000456000, + "parent": 4, + "session": 1, + "image": "marble.exe", + "path": "C:\\Program Files\\marble\\marble.exe", + "cpu": [ + 0.02 + ], + "ws_private": 245587156, + "io": [ + 39212 + ], + "threads": 43, + "handles": 920 + }, + { + "pid": 464, + "created": 133500000000464000, + "parent": 4, + "session": 1, + "image": "lantern.exe", + "path": "C:\\Program Files\\lantern\\lantern.exe", + "cpu": [ + 0.099 + ], + "ws_private": 273055829, + "io": [ + 73070 + ], + "threads": 43, + "handles": 956 + }, + { + "pid": 468, + "created": 133500000000468000, + "parent": 4, + "session": 1, + "image": "pebble.exe", + "path": "C:\\Program Files\\pebble\\pebble.exe", + "cpu": [ + 0.309 + ], + "ws_private": 106922248, + "io": [ + 88252 + ], + "threads": 13, + "handles": 931 + }, + { + "pid": 504, + "created": 133500000000504000, + "parent": 4, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\harbor\\harbor.exe", + "cpu": [ + 0.227 + ], + "ws_private": 195255648, + "io": [ + 33472 + ], + "threads": 11, + "handles": 124 + }, + { + "pid": 508, + "created": 133500000000508000, + "parent": 4, + "session": 1, + "image": "tundra.exe", + "path": "C:\\Program Files\\tundra\\tundra.exe", + "cpu": [ + 0.047 + ], + "ws_private": 250346132, + "io": [ + 7881 + ], + "threads": 18, + "handles": 542 + }, + { + "pid": 548, + "created": 133500000000548000, + "parent": 4, + "session": 1, + "image": "cobalt.exe", + "path": "C:\\Program Files\\cobalt\\cobalt.exe", + "cpu": [ + 0.066 + ], + "ws_private": 192903506, + "io": [ + 45600 + ], + "threads": 20, + "handles": 584 + }, + { + "pid": 552, + "created": 133500000000552000, + "parent": 4, + "session": 1, + "image": "willow.exe", + "path": "C:\\Program Files\\willow\\willow.exe", + "cpu": [ + 0.237 + ], + "ws_private": 105914043, + "io": [ + 39778 + ], + "threads": 11, + "handles": 772 + }, + { + "pid": 584, + "created": 133500000000584000, + "parent": 4, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\ember\\ember.exe", + "cpu": [ + 0.151 + ], + "ws_private": 73785238, + "io": [ + 82088 + ], + "threads": 7, + "handles": 628 + }, + { + "pid": 592, + "created": 133500000000592000, + "parent": 4, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\prism\\prism.exe", + "cpu": [ + 0.296 + ], + "ws_private": 143698895, + "io": [ + 57548 + ], + "threads": 22, + "handles": 342 + }, + { + "pid": 608, + "created": 133500000000608000, + "parent": 4, + "session": 1, + "image": "atlas.exe", + "path": "C:\\Program Files\\atlas\\atlas.exe", + "cpu": [ + 0.239 + ], + "ws_private": 124528679, + "io": [ + 1226 + ], + "threads": 35, + "handles": 605 + }, + { + "pid": 636, + "created": 133500000000636000, + "parent": 4, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\orbit\\orbit.exe", + "cpu": [ + 0.267 + ], + "ws_private": 187077684, + "io": [ + 25945 + ], + "threads": 12, + "handles": 958 + }, + { + "pid": 668, + "created": 133500000000668000, + "parent": 4, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\quill\\quill.exe", + "cpu": [ + 0.01 + ], + "ws_private": 130624145, + "io": [ + 46646 + ], + "threads": 6, + "handles": 571 + }, + { + "pid": 708, + "created": 133500000000708000, + "parent": 4, + "session": 1, + "image": "marble.exe", + "path": "C:\\Program Files\\marble\\marble.exe", + "cpu": [ + 0.15 + ], + "ws_private": 292837724, + "io": [ + 684 + ], + "threads": 43, + "handles": 320 + }, + { + "pid": 728, + "created": 133500000000728000, + "parent": 4, + "session": 1, + "image": "lantern.exe", + "path": "C:\\Program Files\\lantern\\lantern.exe", + "cpu": [ + 0.328 + ], + "ws_private": 109166829, + "io": [ + 12233 + ], + "threads": 41, + "handles": 223 + }, + { + "pid": 744, + "created": 133500000000744000, + "parent": 4, + "session": 1, + "image": "pebble.exe", + "path": "C:\\Program Files\\pebble\\pebble.exe", + "cpu": [ + 0.012 + ], + "ws_private": 189593291, + "io": [ + 16208 + ], + "threads": 31, + "handles": 932 + }, + { + "pid": 764, + "created": 133500000000764000, + "parent": 4, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\harbor\\harbor.exe", + "cpu": [ + 0.021 + ], + "ws_private": 279354087, + "io": [ + 40819 + ], + "threads": 4, + "handles": 563 + }, + { + "pid": 796, + "created": 133500000000796000, + "parent": 4, + "session": 1, + "image": "tundra.exe", + "path": "C:\\Program Files\\tundra\\tundra.exe", + "cpu": [ + 0.101 + ], + "ws_private": 149904659, + "io": [ + 51223 + ], + "threads": 38, + "handles": 977 + }, + { + "pid": 824, + "created": 133500000000824000, + "parent": 4, + "session": 1, + "image": "cobalt.exe", + "path": "C:\\Program Files\\cobalt\\cobalt.exe", + "cpu": [ + 0.038 + ], + "ws_private": 44966074, + "io": [ + 17781 + ], + "threads": 41, + "handles": 624 + }, + { + "pid": 860, + "created": 133500000000860000, + "parent": 4, + "session": 1, + "image": "willow.exe", + "path": "C:\\Program Files\\willow\\willow.exe", + "cpu": [ + 0.242 + ], + "ws_private": 241794264, + "io": [ + 14371 + ], + "threads": 30, + "handles": 302 + }, + { + "pid": 864, + "created": 133500000000864000, + "parent": 4, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\ember\\ember.exe", + "cpu": [ + 0.317 + ], + "ws_private": 193291826, + "io": [ + 33114 + ], + "threads": 38, + "handles": 844 + }, + { + "pid": 888, + "created": 133500000000888000, + "parent": 4, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\prism\\prism.exe", + "cpu": [ + 0.001 + ], + "ws_private": 153477581, + "io": [ + 74864 + ], + "threads": 40, + "handles": 806 + } + ], + "ticks": 2, + "input": [ + "command run_new", + "key Alt+Down", + "advance 300" + ], + "run_history": [ + "notepad C:\\Users\\Public\\readme.txt", + "cmd /k ipconfig /all", + "C:\\Tools\\Quill\\quill.exe", + "control.exe", + "https://example.com/status" + ] +} diff --git a/apps/tasks/scenes/run_dialog_typed.json b/apps/tasks/scenes/run_dialog_typed.json new file mode 100644 index 00000000..00afb1f0 --- /dev/null +++ b/apps/tasks/scenes/run_dialog_typed.json @@ -0,0 +1,726 @@ +{ + "size": [ + 984, + 560 + ], + "mode": "list", + "machine": { + "logical_cpus": 16, + "total_phys": 34359738368, + "mem_load": 41, + "commit_pct": 38, + "cpu_pct": 3.2, + "dpc_irq_pct": 0.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 94 + ], + "ws_private": 8192, + "io": [ + 0 + ], + "threads": 16, + "handles": 0 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.014 + ], + "ws_private": 63763482, + "io": [ + 12249 + ], + "threads": 41, + "handles": 144 + }, + { + "pid": 40, + "created": 133500000000040000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.022 + ], + "ws_private": 9632618, + "io": [ + 1375 + ], + "threads": 43, + "handles": 975 + }, + { + "pid": 64, + "created": 133500000000064000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.027 + ], + "ws_private": 40758530, + "io": [ + 12100 + ], + "threads": 35, + "handles": 801 + }, + { + "pid": 84, + "created": 133500000000084000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.028 + ], + "ws_private": 59903688, + "io": [ + 7249 + ], + "threads": 23, + "handles": 182 + }, + { + "pid": 116, + "created": 133500000000116000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.05 + ], + "ws_private": 28821974, + "io": [ + 3576 + ], + "threads": 43, + "handles": 209 + }, + { + "pid": 136, + "created": 133500000000136000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.027 + ], + "ws_private": 13086726, + "io": [ + 2280 + ], + "threads": 28, + "handles": 795 + }, + { + "pid": 140, + "created": 133500000000140000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.036 + ], + "ws_private": 64572218, + "io": [ + 5314 + ], + "threads": 27, + "handles": 417 + }, + { + "pid": 156, + "created": 133500000000156000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.031 + ], + "ws_private": 51066978, + "io": [ + 6195 + ], + "threads": 10, + "handles": 886 + }, + { + "pid": 184, + "created": 133500000000184000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.023 + ], + "ws_private": 68976709, + "io": [ + 9691 + ], + "threads": 11, + "handles": 328 + }, + { + "pid": 224, + "created": 133500000000224000, + "parent": 4, + "session": 1, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.035 + ], + "ws_private": 37294088, + "io": [ + 3497 + ], + "threads": 21, + "handles": 260 + }, + { + "pid": 228, + "created": 133500000000228000, + "parent": 4, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.041 + ], + "ws_private": 54109050, + "io": [ + 2893 + ], + "threads": 25, + "handles": 767 + }, + { + "pid": 264, + "created": 133500000000264000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 0.022 + ], + "ws_private": 31875862, + "io": [ + 12767 + ], + "threads": 37, + "handles": 553 + }, + { + "pid": 284, + "created": 133500000000284000, + "parent": 4, + "session": 0, + "image": "csrss.exe", + "path": "C:\\Windows\\System32\\csrss.exe", + "cpu": [ + 0.047 + ], + "ws_private": 66512847, + "io": [ + 6488 + ], + "threads": 39, + "handles": 286 + }, + { + "pid": 296, + "created": 133500000000296000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.057 + ], + "ws_private": 51267224, + "io": [ + 4175 + ], + "threads": 6, + "handles": 364 + }, + { + "pid": 332, + "created": 133500000000332000, + "parent": 4, + "session": 0, + "image": "lsass.exe", + "path": "C:\\Windows\\System32\\lsass.exe", + "cpu": [ + 0.046 + ], + "ws_private": 19543466, + "io": [ + 10185 + ], + "threads": 34, + "handles": 475 + }, + { + "pid": 348, + "created": 133500000000348000, + "parent": 4, + "session": 1, + "image": "RuntimeBroker.exe", + "path": "C:\\Windows\\System32\\RuntimeBroker.exe", + "cpu": [ + 0.021 + ], + "ws_private": 19221900, + "io": [ + 17416 + ], + "threads": 12, + "handles": 710 + }, + { + "pid": 376, + "created": 133500000000376000, + "parent": 4, + "session": 1, + "image": "conhost.exe", + "path": "C:\\Windows\\System32\\conhost.exe", + "cpu": [ + 0.026 + ], + "ws_private": 23189470, + "io": [ + 10477 + ], + "threads": 17, + "handles": 190 + }, + { + "pid": 392, + "created": 133500000000392000, + "parent": 4, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\orbit\\orbit.exe", + "cpu": [ + 0.163 + ], + "ws_private": 246572740, + "io": [ + 77531 + ], + "threads": 34, + "handles": 308 + }, + { + "pid": 420, + "created": 133500000000420000, + "parent": 4, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\quill\\quill.exe", + "cpu": [ + 0.205 + ], + "ws_private": 62701655, + "io": [ + 66820 + ], + "threads": 36, + "handles": 606 + }, + { + "pid": 456, + "created": 133500000000456000, + "parent": 4, + "session": 1, + "image": "marble.exe", + "path": "C:\\Program Files\\marble\\marble.exe", + "cpu": [ + 0.02 + ], + "ws_private": 245587156, + "io": [ + 39212 + ], + "threads": 43, + "handles": 920 + }, + { + "pid": 464, + "created": 133500000000464000, + "parent": 4, + "session": 1, + "image": "lantern.exe", + "path": "C:\\Program Files\\lantern\\lantern.exe", + "cpu": [ + 0.099 + ], + "ws_private": 273055829, + "io": [ + 73070 + ], + "threads": 43, + "handles": 956 + }, + { + "pid": 468, + "created": 133500000000468000, + "parent": 4, + "session": 1, + "image": "pebble.exe", + "path": "C:\\Program Files\\pebble\\pebble.exe", + "cpu": [ + 0.309 + ], + "ws_private": 106922248, + "io": [ + 88252 + ], + "threads": 13, + "handles": 931 + }, + { + "pid": 504, + "created": 133500000000504000, + "parent": 4, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\harbor\\harbor.exe", + "cpu": [ + 0.227 + ], + "ws_private": 195255648, + "io": [ + 33472 + ], + "threads": 11, + "handles": 124 + }, + { + "pid": 508, + "created": 133500000000508000, + "parent": 4, + "session": 1, + "image": "tundra.exe", + "path": "C:\\Program Files\\tundra\\tundra.exe", + "cpu": [ + 0.047 + ], + "ws_private": 250346132, + "io": [ + 7881 + ], + "threads": 18, + "handles": 542 + }, + { + "pid": 548, + "created": 133500000000548000, + "parent": 4, + "session": 1, + "image": "cobalt.exe", + "path": "C:\\Program Files\\cobalt\\cobalt.exe", + "cpu": [ + 0.066 + ], + "ws_private": 192903506, + "io": [ + 45600 + ], + "threads": 20, + "handles": 584 + }, + { + "pid": 552, + "created": 133500000000552000, + "parent": 4, + "session": 1, + "image": "willow.exe", + "path": "C:\\Program Files\\willow\\willow.exe", + "cpu": [ + 0.237 + ], + "ws_private": 105914043, + "io": [ + 39778 + ], + "threads": 11, + "handles": 772 + }, + { + "pid": 584, + "created": 133500000000584000, + "parent": 4, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\ember\\ember.exe", + "cpu": [ + 0.151 + ], + "ws_private": 73785238, + "io": [ + 82088 + ], + "threads": 7, + "handles": 628 + }, + { + "pid": 592, + "created": 133500000000592000, + "parent": 4, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\prism\\prism.exe", + "cpu": [ + 0.296 + ], + "ws_private": 143698895, + "io": [ + 57548 + ], + "threads": 22, + "handles": 342 + }, + { + "pid": 608, + "created": 133500000000608000, + "parent": 4, + "session": 1, + "image": "atlas.exe", + "path": "C:\\Program Files\\atlas\\atlas.exe", + "cpu": [ + 0.239 + ], + "ws_private": 124528679, + "io": [ + 1226 + ], + "threads": 35, + "handles": 605 + }, + { + "pid": 636, + "created": 133500000000636000, + "parent": 4, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\orbit\\orbit.exe", + "cpu": [ + 0.267 + ], + "ws_private": 187077684, + "io": [ + 25945 + ], + "threads": 12, + "handles": 958 + }, + { + "pid": 668, + "created": 133500000000668000, + "parent": 4, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\quill\\quill.exe", + "cpu": [ + 0.01 + ], + "ws_private": 130624145, + "io": [ + 46646 + ], + "threads": 6, + "handles": 571 + }, + { + "pid": 708, + "created": 133500000000708000, + "parent": 4, + "session": 1, + "image": "marble.exe", + "path": "C:\\Program Files\\marble\\marble.exe", + "cpu": [ + 0.15 + ], + "ws_private": 292837724, + "io": [ + 684 + ], + "threads": 43, + "handles": 320 + }, + { + "pid": 728, + "created": 133500000000728000, + "parent": 4, + "session": 1, + "image": "lantern.exe", + "path": "C:\\Program Files\\lantern\\lantern.exe", + "cpu": [ + 0.328 + ], + "ws_private": 109166829, + "io": [ + 12233 + ], + "threads": 41, + "handles": 223 + }, + { + "pid": 744, + "created": 133500000000744000, + "parent": 4, + "session": 1, + "image": "pebble.exe", + "path": "C:\\Program Files\\pebble\\pebble.exe", + "cpu": [ + 0.012 + ], + "ws_private": 189593291, + "io": [ + 16208 + ], + "threads": 31, + "handles": 932 + }, + { + "pid": 764, + "created": 133500000000764000, + "parent": 4, + "session": 1, + "image": "harbor.exe", + "path": "C:\\Program Files\\harbor\\harbor.exe", + "cpu": [ + 0.021 + ], + "ws_private": 279354087, + "io": [ + 40819 + ], + "threads": 4, + "handles": 563 + }, + { + "pid": 796, + "created": 133500000000796000, + "parent": 4, + "session": 1, + "image": "tundra.exe", + "path": "C:\\Program Files\\tundra\\tundra.exe", + "cpu": [ + 0.101 + ], + "ws_private": 149904659, + "io": [ + 51223 + ], + "threads": 38, + "handles": 977 + }, + { + "pid": 824, + "created": 133500000000824000, + "parent": 4, + "session": 1, + "image": "cobalt.exe", + "path": "C:\\Program Files\\cobalt\\cobalt.exe", + "cpu": [ + 0.038 + ], + "ws_private": 44966074, + "io": [ + 17781 + ], + "threads": 41, + "handles": 624 + }, + { + "pid": 860, + "created": 133500000000860000, + "parent": 4, + "session": 1, + "image": "willow.exe", + "path": "C:\\Program Files\\willow\\willow.exe", + "cpu": [ + 0.242 + ], + "ws_private": 241794264, + "io": [ + 14371 + ], + "threads": 30, + "handles": 302 + }, + { + "pid": 864, + "created": 133500000000864000, + "parent": 4, + "session": 1, + "image": "ember.exe", + "path": "C:\\Program Files\\ember\\ember.exe", + "cpu": [ + 0.317 + ], + "ws_private": 193291826, + "io": [ + 33114 + ], + "threads": 38, + "handles": 844 + }, + { + "pid": 888, + "created": 133500000000888000, + "parent": 4, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\prism\\prism.exe", + "cpu": [ + 0.001 + ], + "ws_private": 153477581, + "io": [ + 74864 + ], + "threads": 40, + "handles": 806 + } + ], + "ticks": 2, + "input": [ + "command run_new", + "type notepad C:\\Users\\Public\\readme.txt" + ], + "run_history": [ + "notepad C:\\Users\\Public\\readme.txt", + "cmd /k ipconfig /all", + "C:\\Tools\\Quill\\quill.exe", + "control.exe", + "https://example.com/status" + ] +} diff --git a/apps/tasks/scenes/hdr_traces.json b/apps/tasks/scenes/run_head.json similarity index 96% rename from apps/tasks/scenes/hdr_traces.json rename to apps/tasks/scenes/run_head.json index 98a16b1f..d0a86ce8 100644 --- a/apps/tasks/scenes/hdr_traces.json +++ b/apps/tasks/scenes/run_head.json @@ -1,6 +1,6 @@ { "size": [ - 640, + 984, 560 ], "mode": "list", @@ -42,46 +42,7 @@ ], "ws_private": 63763482, "io": [ - 1500, - 1900, - 2300, - 1600, - 2000, - 2400, - 1700, - 2100, - 2500, - 1800, - 2200, - 1500, - 1900, - 2300, - 1600, - 2000, - 2400, - 1700, - 2100, - 2500, - 1800, - 2200, - 1500, - 1900, - 2300, - 1600, - 2000, - 2400, - 1700, - 50000000, - 2500, - 1800, - 2200, - 1500, - 1900, - 2300, - 1600, - 2000, - 2400, - 1700 + 12249 ], "threads": 41, "handles": 144 @@ -750,6 +711,6 @@ "handles": 806 } ], - "ticks": 40, + "ticks": 2, "input": [] } diff --git a/apps/tasks/scenes/strip_calm.json b/apps/tasks/scenes/strip_calm.json new file mode 100644 index 00000000..539c82cb --- /dev/null +++ b/apps/tasks/scenes/strip_calm.json @@ -0,0 +1,929 @@ +{ + "size": [ + 1280, + 800 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [], + "sys": { + "cpu": [ + 32.6, + 32.4, + 35.3, + 39.5, + 38.9, + 39.2, + 42.3, + 43.4, + 39, + 44.9, + 40.3, + 40, + 44.5, + 38.3, + 39.4, + 36.3, + 35.3, + 37.6, + 37.6, + 35.4, + 33.4, + 27.8, + 29.6, + 27.4, + 24.3, + 27.3, + 21.3, + 24.9, + 20.4, + 19.3, + 23.3, + 23.6, + 24.7, + 25, + 25.9, + 26.4, + 23.3, + 26.5, + 26.8, + 31.4, + 31.3, + 32.4, + 36.8, + 35.4, + 40.1, + 39.4, + 38.3, + 40.7, + 42, + 41.4, + 40.8, + 43.9, + 42.1, + 40, + 41.4, + 39.6, + 37.3, + 37, + 33.5, + 31.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3351, + 3371, + 3385, + 3410, + 3409, + 3446, + 3428, + 3423, + 3445, + 3424, + 3408, + 3400, + 3351, + 3338, + 3313, + 3302, + 3288, + 3258, + 3249, + 3265, + 3244, + 3265, + 3300, + 3317, + 3325, + 3345, + 3373, + 3384, + 3403, + 3440, + 3427, + 3444, + 3421, + 3447, + 3427, + 3401, + 3370, + 3374, + 3330, + 3306, + 3295, + 3292, + 3263, + 3242, + 3257, + 3249, + 3294, + 3280, + 3310, + 3331, + 3366, + 3381, + 3412, + 3402, + 3415, + 3435, + 3436, + 3450, + 3432, + 3437, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9, + 15.3, + 12.7, + 16, + 19.5, + 15.4, + 13.1, + 14.9, + 13.9, + 11.1, + 2.4, + 1.1, + 0.8, + 0, + 0, + 5.7, + 9.3, + 6.6, + 12, + 11.8, + 12.4, + 16.9, + 17, + 18.3, + 16.4, + 8, + 9.3, + 1.9, + 6.3, + 0.8, + 0.3, + 4.5, + 0.8, + 9.6, + 7.7, + 9.5, + 14.7, + 15, + 16.5, + 19.6, + 14.1, + 17, + 6.5, + 8.5, + 6.7, + 0.4, + 3.2, + 4.4, + 3.5, + 0.2, + 10, + 8.8, + 10.9, + 16.6, + 17.6, + 12.9, + 19.3, + 13, + 9.1, + 7.8, + 12 + ], + "mbps": [ + 33.7, + 41.7, + 45.9, + 42.9, + 50.6, + 55.6, + 46.8, + 37.1, + 30.1, + 21.2, + 19.8, + 13.6, + 6.2, + 10.3, + 5, + 20.1, + 16.6, + 36.9, + 32.9, + 41.4, + 43.9, + 54.6, + 50.3, + 50.1, + 35, + 27.9, + 19, + 13.1, + 12.3, + 2.7, + 14.9, + 7.7, + 10.3, + 18, + 27.5, + 37.5, + 45, + 56.4, + 54.8, + 52.5, + 42.8, + 38.5, + 38.1, + 29.5, + 18.4, + 6.7, + 12, + 11.5, + 4.1, + 9.8, + 19.5, + 26.1, + 34.6, + 46.7, + 50.5, + 56.9, + 51.7, + 52.6, + 41.7, + 28.9, + 48 + ] + }, + { + "number": 1, + "active": [ + 1, + 1.2, + 1.7, + 2.1, + 1.9, + 2.1, + 2.3, + 1.8, + 2.4, + 2, + 2.2, + 2.2, + 2, + 1.8, + 1.3, + 0.5, + 1, + 0.2, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.3, + 0, + 0.1, + 0, + 0.4, + 0.1, + 0.6, + 0.7, + 1.1, + 1.7, + 1.9, + 2.2, + 1.7, + 2.3, + 2, + 2, + 1.6, + 1.9, + 1.8, + 1.2, + 1.2, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.7, + 0.2, + 0.1, + 0.4, + 0.4, + 0.5, + 0.2, + 0.5, + 0, + 0.2, + 0.8, + 1.4 + ], + "mbps": [ + 0.5, + 0.3, + 0.4, + 0.7, + 0.7, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.4, + 0.4, + 0, + 0.1, + 0, + 0.2, + 0.3, + 0, + 0, + 0, + 0.3, + 0.2, + 0.3, + 0.6, + 0.4, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.8, + 0.7, + 0.7, + 0.7, + 0.6, + 0.4, + 0.4, + 0.6, + 0.5, + 0.5, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0.3, + 0.2, + 0.1, + 0.4, + 0.2, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.2, + 10.9, + 13.8, + 10.7, + 13.1, + 11.6, + 8.7, + 3.5, + 3, + 0.6, + 0, + 3, + 3, + 4.9, + 7.4, + 14, + 13, + 14.7, + 13.2, + 11.1, + 3.7, + 5.8, + 0, + 0.8, + 0.9, + 4.8, + 4.6, + 7.3, + 11.6, + 11, + 15.3, + 11.9, + 9.5, + 2.9, + 3.6, + 1.1, + 0, + 0, + 5.1, + 4.4, + 10.4, + 14.1, + 13.9, + 13, + 8.8, + 6.8, + 3.2, + 0.7, + 0, + 0, + 2.5, + 1.9, + 6.7, + 7, + 14.4, + 10.9, + 11.6, + 8.6, + 11.4, + 7.1, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.2, + 1, + 1.1, + 1.5, + 1.4, + 0.9, + 0.8, + 0.5, + 0.5, + 0.4, + 0.5, + 0.5, + 1, + 0.8, + 1.1, + 1.6, + 1.5, + 1, + 0.7, + 0.6, + 0.5, + 0.5, + 0.2, + 0.5, + 0.8, + 0.9, + 1.3, + 1.3, + 1.3, + 1, + 1.4, + 0.9, + 0.6, + 0.2, + 0.2, + 0.5, + 0.6, + 0.6, + 0.9, + 1.2, + 1.1, + 1.5, + 1.3, + 1.1, + 0.6, + 0.5, + 0.5, + 0.3, + 0.4, + 0.7, + 0.4, + 0.5, + 1, + 0.9, + 1.2, + 1, + 0.9, + 1.1, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + } +} diff --git a/apps/tasks/scenes/strip_cell_hover.json b/apps/tasks/scenes/strip_cell_hover.json new file mode 100644 index 00000000..41a22778 --- /dev/null +++ b/apps/tasks/scenes/strip_cell_hover.json @@ -0,0 +1,933 @@ +{ + "size": [ + 1280, + 800 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [ + "hover 700,90", + "advance 300" + ], + "sys": { + "cpu": [ + 33.4, + 34.6, + 37.1, + 34.5, + 38, + 39.1, + 42.6, + 38.3, + 41.2, + 43.8, + 39.6, + 43.3, + 41.8, + 40.8, + 39, + 37.3, + 35.3, + 37.1, + 37.3, + 35.3, + 32, + 31.8, + 27.4, + 26, + 27.8, + 25.5, + 21, + 24.2, + 21, + 24.6, + 20.7, + 22.9, + 25, + 24.4, + 23.8, + 25.9, + 28.9, + 24.6, + 31.1, + 28.2, + 30.9, + 31.8, + 36.4, + 38, + 39.9, + 40.4, + 41.2, + 39.5, + 39.5, + 42.6, + 40.8, + 41.4, + 38.8, + 38.3, + 37.5, + 37.4, + 37.5, + 34.9, + 34.3, + 36.1, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3337, + 3381, + 3383, + 3429, + 3410, + 3455, + 3447, + 3451, + 3430, + 3434, + 3419, + 3394, + 3368, + 3346, + 3299, + 3304, + 3287, + 3251, + 3271, + 3275, + 3245, + 3291, + 3296, + 3316, + 3312, + 3334, + 3387, + 3397, + 3412, + 3410, + 3448, + 3430, + 3428, + 3416, + 3423, + 3398, + 3399, + 3345, + 3332, + 3320, + 3289, + 3273, + 3277, + 3279, + 3270, + 3250, + 3268, + 3295, + 3319, + 3330, + 3356, + 3388, + 3413, + 3419, + 3442, + 3449, + 3459, + 3431, + 3444, + 3433, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 4.9, + 14.9, + 9.7, + 14.3, + 12.3, + 12.1, + 14.9, + 10, + 7.1, + 6.3, + 3.9, + 5, + 4.2, + 0.7, + 2.9, + 3.5, + 9.5, + 11.7, + 10.6, + 9.5, + 18.5, + 12.9, + 14.7, + 10.8, + 15.6, + 7.5, + 3.4, + 7.1, + 4.5, + 0.4, + 3.6, + 0.7, + 1.3, + 3.5, + 8.3, + 10.5, + 9.5, + 18.7, + 19.2, + 14, + 10.8, + 13.4, + 5.9, + 6.4, + 8.3, + 1.3, + 3.8, + 0, + 5.2, + 2.3, + 5.4, + 8.1, + 13, + 12.5, + 13.2, + 13.1, + 17.1, + 18.6, + 10.2, + 9.2, + 12 + ], + "mbps": [ + 24.9, + 31.2, + 50, + 48.3, + 46.1, + 47.5, + 48.3, + 43.8, + 36.5, + 30.5, + 13.4, + 11.2, + 12.7, + 2.2, + 15.7, + 20, + 23.3, + 36, + 42.7, + 42.4, + 56.3, + 54.6, + 54.2, + 48.2, + 41.9, + 35.9, + 22.6, + 13.8, + 12.7, + 4.5, + 6.6, + 7.2, + 14.3, + 24.9, + 34.7, + 44.7, + 47.2, + 50.8, + 47.2, + 49.5, + 50.1, + 37.9, + 33.6, + 23.3, + 12.1, + 15.5, + 9.4, + 8, + 3.8, + 20.8, + 28.6, + 30.7, + 35.2, + 43.2, + 50.5, + 57.6, + 52.7, + 41.1, + 40.5, + 32.8, + 48 + ] + }, + { + "number": 1, + "active": [ + 0.8, + 0.9, + 1.7, + 1.8, + 1.6, + 2.4, + 1.7, + 1.8, + 2.4, + 2.4, + 2, + 1.7, + 1.8, + 1.8, + 0.9, + 1.4, + 1.2, + 0.8, + 0.5, + 0.4, + 0, + 0, + 0, + 0.3, + 0.1, + 0, + 0, + 0.3, + 0.2, + 1.3, + 1.2, + 0.8, + 0.9, + 1.7, + 2, + 2.3, + 1.8, + 1.9, + 1.9, + 1.7, + 2.1, + 1.6, + 1.4, + 1.7, + 1.5, + 1.3, + 1.3, + 0.9, + 0, + 0.6, + 0.6, + 0, + 0.3, + 0.4, + 0.4, + 0, + 0.2, + 0.3, + 0.4, + 1.2, + 0.6 + ], + "mbps": [ + 0.3, + 0.6, + 0.5, + 0.7, + 0.8, + 0.5, + 0.8, + 0.6, + 0.5, + 0.8, + 0.5, + 0.7, + 0.6, + 0.3, + 0.4, + 0.3, + 0.4, + 0.2, + 0, + 0.1, + 0, + 0.1, + 0.1, + 0.2, + 0.3, + 0.2, + 0.2, + 0.4, + 0.2, + 0.3, + 0.3, + 0.4, + 0.5, + 0.4, + 0.8, + 0.8, + 0.8, + 0.7, + 0.8, + 0.7, + 0.5, + 0.6, + 0.7, + 0.7, + 0.3, + 0.5, + 0.3, + 0.3, + 0.2, + 0.1, + 0, + 0.2, + 0.3, + 0.2, + 0.1, + 0.1, + 0, + 0.4, + 0.1, + 0.4, + 0.3 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 5.1, + 9.5, + 10.7, + 11.5, + 12.5, + 11.5, + 7.2, + 3.8, + 3.8, + 1.7, + 0, + 0, + 6.1, + 4.8, + 8.3, + 11.2, + 15, + 11.3, + 12.7, + 6.6, + 3.8, + 4.8, + 0, + 0.2, + 2.9, + 6, + 10, + 9.6, + 13.3, + 11.1, + 15.3, + 9.3, + 11.1, + 3.1, + 1.4, + 2.8, + 0.7, + 0, + 5.2, + 4.2, + 7.5, + 12.4, + 12.7, + 11.6, + 11.2, + 11.2, + 5.4, + 4.2, + 0, + 0, + 4.2, + 2.6, + 6.4, + 9.6, + 14.8, + 12, + 15.6, + 12.1, + 6.7, + 4.2, + 12.4 + ], + "tx_mbit": [ + 0.8, + 1.3, + 1.3, + 1.5, + 1, + 0.9, + 1.1, + 0.6, + 0.3, + 0.1, + 0, + 0.2, + 0.3, + 0.5, + 1, + 1.1, + 1.4, + 1.1, + 0.9, + 0.9, + 0.6, + 0.3, + 0.1, + 0.2, + 0.3, + 0.8, + 0.8, + 0.9, + 1.2, + 1.4, + 1, + 1.3, + 0.6, + 0.8, + 0.3, + 0.5, + 0.5, + 0.4, + 0.6, + 0.8, + 1.1, + 1.2, + 1.6, + 1.4, + 1.2, + 0.6, + 0.8, + 0.4, + 0.5, + 0.4, + 0.2, + 0.7, + 0.7, + 1.1, + 0.9, + 1.6, + 1.3, + 1.3, + 1.1, + 0.4, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + }, + "cells_open": true +} diff --git a/apps/tasks/scenes/strip_close_visible.json b/apps/tasks/scenes/strip_close_visible.json new file mode 100644 index 00000000..1d083633 --- /dev/null +++ b/apps/tasks/scenes/strip_close_visible.json @@ -0,0 +1,932 @@ +{ + "size": [ + 1280, + 800 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [ + "hover 330,90", + "advance 300" + ], + "sys": { + "cpu": [ + 29.4, + 30.7, + 35.7, + 38.7, + 35.9, + 36.9, + 37.9, + 39.1, + 42.3, + 43.3, + 41.5, + 40.8, + 39, + 42.9, + 37.4, + 41.5, + 35, + 36.3, + 36.5, + 34.3, + 34.6, + 31.7, + 29.2, + 29.6, + 28.1, + 25.7, + 21.4, + 20.5, + 20.7, + 22.5, + 23.6, + 19.2, + 23.4, + 24.9, + 23.7, + 26.9, + 26, + 30.3, + 28.8, + 29.4, + 34.5, + 35.6, + 37.6, + 39.1, + 36.7, + 40.4, + 43, + 41.8, + 43.5, + 43.5, + 40.5, + 40.9, + 44.5, + 38.3, + 41.2, + 39.9, + 35.6, + 36.3, + 33.7, + 35, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3346, + 3389, + 3383, + 3409, + 3416, + 3454, + 3420, + 3431, + 3434, + 3400, + 3386, + 3402, + 3373, + 3333, + 3333, + 3314, + 3298, + 3257, + 3252, + 3253, + 3280, + 3288, + 3270, + 3317, + 3337, + 3343, + 3373, + 3409, + 3411, + 3412, + 3421, + 3452, + 3443, + 3448, + 3437, + 3390, + 3389, + 3361, + 3331, + 3325, + 3280, + 3290, + 3261, + 3253, + 3260, + 3247, + 3270, + 3298, + 3302, + 3333, + 3342, + 3355, + 3394, + 3411, + 3439, + 3425, + 3440, + 3448, + 3429, + 3416, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 10.1, + 10.8, + 14.3, + 12.3, + 12.2, + 13.5, + 19, + 15.2, + 14.3, + 9.1, + 6.1, + 0.9, + 0, + 0, + 0, + 5.9, + 5.2, + 6.6, + 12, + 10.5, + 18.5, + 13.6, + 12.3, + 12.2, + 10.1, + 10.3, + 10, + 9.8, + 1.6, + 6.5, + 2.6, + 0.2, + 5.4, + 7.4, + 6.6, + 15.8, + 14.8, + 11.4, + 20.1, + 19.2, + 10.9, + 11.8, + 14.2, + 7.3, + 8.4, + 1.4, + 2.7, + 5.3, + 2.1, + 8.3, + 2.7, + 5.6, + 15.8, + 15.2, + 19.1, + 16.6, + 15.3, + 11.2, + 13.4, + 5.9, + 12 + ], + "mbps": [ + 32.4, + 44.3, + 51.5, + 43.4, + 55, + 45.7, + 48, + 43.1, + 37.1, + 26.4, + 13, + 17, + 10.8, + 4.8, + 16.7, + 14.8, + 28.3, + 26.7, + 34.8, + 42.6, + 55.8, + 45, + 53.7, + 44.9, + 40.6, + 30.7, + 22.6, + 24, + 10.7, + 12, + 12.5, + 16, + 8.5, + 28.4, + 29, + 35.6, + 42.9, + 49.7, + 48, + 55, + 44.8, + 38.8, + 31.7, + 31.3, + 17.6, + 18.2, + 11.9, + 11.1, + 8.4, + 14.7, + 15.4, + 28, + 35.4, + 43.3, + 44.3, + 44.9, + 57, + 46.8, + 45.7, + 32, + 48 + ] + }, + { + "number": 1, + "active": [ + 1.3, + 1, + 1, + 2, + 1.6, + 1.6, + 1.7, + 1.9, + 1.5, + 1.9, + 1.9, + 2.1, + 1.2, + 1.2, + 1.6, + 0.7, + 0.4, + 1, + 0, + 0, + 0, + 0.2, + 0.2, + 0.1, + 0.1, + 0.6, + 0, + 0.2, + 0.2, + 0.5, + 0.7, + 1.2, + 1.2, + 2.1, + 1.4, + 1.8, + 2, + 2.3, + 1.7, + 2, + 2.3, + 1.3, + 1.1, + 1.6, + 1.4, + 1.2, + 1, + 0.8, + 0, + 0, + 0.6, + 0, + 0, + 0, + 0, + 0.4, + 0.4, + 0.2, + 0.6, + 0.5, + 1.3 + ], + "mbps": [ + 0.4, + 0.4, + 0.5, + 0.6, + 0.6, + 0.8, + 0.7, + 0.8, + 0.7, + 0.9, + 0.6, + 0.6, + 0.5, + 0.6, + 0.5, + 0.5, + 0.4, + 0.2, + 0.2, + 0, + 0, + 0.1, + 0.3, + 0, + 0, + 0.1, + 0.2, + 0.4, + 0.2, + 0.3, + 0.5, + 0.3, + 0.6, + 0.7, + 0.8, + 0.5, + 0.7, + 0.8, + 0.5, + 0.8, + 0.5, + 0.7, + 0.5, + 0.6, + 0.6, + 0.4, + 0.3, + 0.1, + 0.1, + 0.2, + 0, + 0, + 0, + 0.1, + 0.1, + 0.1, + 0, + 0.3, + 0.4, + 0.5, + 0.4 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.3, + 7.3, + 9.6, + 14.8, + 14.5, + 9.4, + 6, + 3, + 3.9, + 1.8, + 3.3, + 3.6, + 6.8, + 7.1, + 10.4, + 10.6, + 11.9, + 10.9, + 13.9, + 8.3, + 4.9, + 1.9, + 3.7, + 0, + 3.6, + 7, + 9.5, + 12.3, + 9.8, + 13, + 11.8, + 13.8, + 8.1, + 7.9, + 5.3, + 0, + 0, + 4.5, + 5, + 9, + 7.6, + 12, + 12, + 12.2, + 13.6, + 7.7, + 6.6, + 3.1, + 1.8, + 2.1, + 0, + 2.4, + 7.9, + 9.5, + 12.9, + 10.7, + 14.4, + 13.6, + 8, + 5.8, + 12.4 + ], + "tx_mbit": [ + 0.5, + 0.9, + 1.4, + 1.4, + 1.1, + 1.2, + 0.9, + 0.8, + 0.2, + 0.4, + 0.2, + 0.4, + 0.5, + 1, + 1, + 1, + 1.4, + 1.3, + 1.4, + 0.8, + 0.5, + 0.7, + 0.6, + 0.2, + 0.2, + 0.7, + 1, + 1.3, + 1, + 1.2, + 1.3, + 0.9, + 0.6, + 0.9, + 0.8, + 0.4, + 0.4, + 0.3, + 0.6, + 0.8, + 1.2, + 0.9, + 1.5, + 1.4, + 1, + 1.2, + 0.5, + 0.2, + 0.1, + 0.2, + 0.2, + 0.7, + 1, + 0.7, + 0.9, + 1.3, + 1.3, + 1.1, + 0.8, + 0.5, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + } +} diff --git a/apps/tasks/scenes/strip_closed.json b/apps/tasks/scenes/strip_closed.json new file mode 100644 index 00000000..735a33d7 --- /dev/null +++ b/apps/tasks/scenes/strip_closed.json @@ -0,0 +1,931 @@ +{ + "size": [ + 1280, + 800 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [ + "command strip_off" + ], + "sys": { + "cpu": [ + 29.2, + 31.4, + 32.2, + 35.4, + 36.4, + 37.1, + 37.7, + 41.3, + 42.8, + 42.4, + 43.7, + 41.6, + 39.6, + 41.9, + 41.2, + 40, + 39.2, + 37, + 34, + 31.9, + 34.1, + 29.6, + 30.1, + 29.4, + 27.2, + 24.7, + 23.5, + 23.1, + 21.1, + 23.4, + 21.7, + 20.4, + 20.4, + 20.6, + 26.2, + 25.1, + 28.2, + 27.1, + 29.8, + 32.9, + 34.9, + 30.9, + 33.8, + 36, + 39.1, + 37.4, + 40.7, + 41.7, + 39.5, + 40.7, + 39.6, + 39.6, + 43.9, + 41.6, + 38.2, + 40.3, + 35.5, + 37.7, + 34.1, + 34.7, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3343, + 3366, + 3404, + 3411, + 3421, + 3433, + 3424, + 3427, + 3437, + 3410, + 3393, + 3403, + 3351, + 3341, + 3307, + 3309, + 3275, + 3255, + 3243, + 3245, + 3267, + 3277, + 3277, + 3317, + 3327, + 3349, + 3382, + 3399, + 3415, + 3437, + 3423, + 3454, + 3440, + 3451, + 3436, + 3408, + 3374, + 3364, + 3325, + 3315, + 3306, + 3274, + 3267, + 3254, + 3270, + 3253, + 3265, + 3283, + 3295, + 3339, + 3342, + 3362, + 3380, + 3421, + 3425, + 3429, + 3429, + 3440, + 3423, + 3401, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9.5, + 7.8, + 11.1, + 16, + 20.4, + 16.8, + 11.8, + 9.7, + 14, + 9.7, + 8, + 7.5, + 1.7, + 0, + 2.3, + 2.6, + 10.2, + 9.9, + 16, + 13.3, + 16.2, + 12, + 18.6, + 11.5, + 8.4, + 13.4, + 5.2, + 4.2, + 6.3, + 2.5, + 5.4, + 3.2, + 3.1, + 5.9, + 5.2, + 10.1, + 14.9, + 15.6, + 11.5, + 16.3, + 10.9, + 9.7, + 13.4, + 3.5, + 9.2, + 7.1, + 0.4, + 0.4, + 0, + 3.5, + 10.7, + 13.3, + 9.2, + 11.5, + 12.6, + 18.8, + 16.1, + 11.9, + 15.2, + 6.7, + 12 + ], + "mbps": [ + 31.8, + 33.9, + 51.7, + 49.7, + 50, + 56.2, + 47.4, + 42.1, + 27.5, + 29.5, + 23.9, + 15.1, + 4.6, + 5.6, + 12.7, + 21, + 28.8, + 34.4, + 37.6, + 51, + 49.1, + 48.5, + 49.6, + 42.2, + 42, + 40.8, + 27.6, + 17.4, + 14.6, + 8.4, + 11, + 12.8, + 12.9, + 27.1, + 34.9, + 43.6, + 47.3, + 48.3, + 50.6, + 48.8, + 46.5, + 47.1, + 29.3, + 25.7, + 23.8, + 7.3, + 11.8, + 5.4, + 6.2, + 11.5, + 24.9, + 33.7, + 32.1, + 43.6, + 47.2, + 46.4, + 50.2, + 49.2, + 36.3, + 34.5, + 48 + ] + }, + { + "number": 1, + "active": [ + 0.8, + 1.5, + 1, + 2.1, + 1.4, + 2, + 2.4, + 2.4, + 2.4, + 1.7, + 2.3, + 1.9, + 1.9, + 1.8, + 1.3, + 1.1, + 0.7, + 1, + 0.9, + 0.2, + 0.3, + 0.1, + 0.2, + 0, + 0, + 0.3, + 0.3, + 0.9, + 0.5, + 0.7, + 0.6, + 1.6, + 0.9, + 1.2, + 1.9, + 1.8, + 2.4, + 1.8, + 2, + 2.4, + 1.8, + 2, + 1.7, + 1.5, + 0.8, + 1.3, + 1, + 0.5, + 0.6, + 0.1, + 0, + 0, + 0.5, + 0, + 0, + 0, + 0.5, + 0.1, + 0.4, + 0.5, + 0.8 + ], + "mbps": [ + 0.6, + 0.5, + 0.7, + 0.4, + 0.5, + 0.5, + 0.8, + 0.9, + 0.9, + 0.8, + 0.5, + 0.5, + 0.7, + 0.5, + 0.4, + 0.4, + 0.3, + 0.2, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0, + 0, + 0.1, + 0.2, + 0.1, + 0.2, + 0.3, + 0.3, + 0.5, + 0.4, + 0.5, + 0.6, + 0.6, + 0.9, + 0.6, + 0.7, + 0.9, + 0.7, + 0.7, + 0.5, + 0.4, + 0.6, + 0.3, + 0.3, + 0.3, + 0.4, + 0.1, + 0.1, + 0.3, + 0, + 0, + 0.2, + 0.1, + 0.2, + 0.2, + 0.2, + 0.5, + 0.5 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 6.5, + 9.8, + 10, + 14.7, + 13.8, + 9.9, + 6.9, + 4.3, + 4, + 0.8, + 0, + 0, + 1.6, + 6.4, + 8.1, + 12.7, + 11.3, + 13.8, + 8, + 8.7, + 8, + 4.6, + 0, + 0, + 0, + 7.2, + 9.9, + 8.4, + 10.7, + 13, + 14.4, + 8.8, + 9.8, + 4.9, + 1.7, + 4.2, + 1.6, + 4.4, + 5.2, + 4.2, + 10.9, + 12.3, + 10, + 13.2, + 13.1, + 9.1, + 5.6, + 0.8, + 2.4, + 0, + 3.1, + 6.9, + 8.3, + 11.8, + 11.9, + 13.2, + 11.6, + 13.9, + 10.8, + 6.1, + 12.4 + ], + "tx_mbit": [ + 0.7, + 1.2, + 1.4, + 1.2, + 1, + 1.1, + 0.9, + 0.4, + 0.2, + 0.5, + 0.2, + 0.7, + 0.7, + 0.7, + 1.3, + 1.1, + 1.1, + 1.3, + 0.9, + 0.7, + 0.6, + 0.3, + 0.5, + 0.2, + 0.3, + 0.5, + 0.9, + 1, + 1.4, + 1.3, + 1.2, + 1.1, + 0.8, + 0.9, + 0.3, + 0.1, + 0.1, + 0.6, + 0.6, + 0.6, + 1.2, + 1.1, + 1.4, + 1, + 1.2, + 0.9, + 0.6, + 0.3, + 0.6, + 0.4, + 0.3, + 0.7, + 0.7, + 1.3, + 1.1, + 1.2, + 1.1, + 1, + 1.2, + 0.7, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + } +} diff --git a/apps/tasks/scenes/strip_first_samples.json b/apps/tasks/scenes/strip_first_samples.json new file mode 100644 index 00000000..dfadf639 --- /dev/null +++ b/apps/tasks/scenes/strip_first_samples.json @@ -0,0 +1,929 @@ +{ + "size": [ + 1280, + 800 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 0, + "input": [], + "sys": { + "cpu": [ + 30.8, + 35.2, + 37.8, + 36.3, + 38, + 36.8, + 41.2, + 43.5, + 43, + 43, + 42.8, + 40.9, + 40.1, + 41.9, + 38.5, + 38, + 35.8, + 36.7, + 32.4, + 31, + 32, + 31, + 28.1, + 29.5, + 26.2, + 24.3, + 24.7, + 20.2, + 24.4, + 22.7, + 22.3, + 20.1, + 20.2, + 20.7, + 25.3, + 24.4, + 24.6, + 27.7, + 26.3, + 29.1, + 34, + 32.7, + 34.1, + 34.8, + 35.2, + 40.8, + 42.9, + 38.6, + 44.5, + 42, + 42.3, + 42.3, + 41.3, + 38.7, + 38.2, + 41.9, + 40.1, + 36.2, + 33.9, + 32.8, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3346, + 3366, + 3382, + 3417, + 3434, + 3453, + 3432, + 3443, + 3419, + 3404, + 3421, + 3396, + 3370, + 3335, + 3331, + 3283, + 3264, + 3273, + 3281, + 3259, + 3284, + 3274, + 3286, + 3326, + 3334, + 3349, + 3360, + 3376, + 3427, + 3409, + 3449, + 3432, + 3443, + 3414, + 3424, + 3388, + 3372, + 3354, + 3328, + 3301, + 3278, + 3300, + 3285, + 3257, + 3241, + 3283, + 3275, + 3303, + 3304, + 3329, + 3333, + 3363, + 3384, + 3402, + 3419, + 3434, + 3437, + 3432, + 3417, + 3415, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 7.1, + 13.2, + 17.9, + 14.1, + 15, + 13, + 15, + 12.4, + 6.7, + 5.8, + 5, + 5.3, + 0, + 5.8, + 6.6, + 5.3, + 10.5, + 4.7, + 10.3, + 10.9, + 11, + 16.3, + 19.4, + 12.2, + 9.8, + 10.6, + 3.8, + 9.4, + 1.5, + 5.6, + 0.8, + 0.1, + 3.7, + 4.4, + 4.9, + 9.9, + 17.8, + 15.2, + 13.1, + 11.3, + 10.9, + 14.9, + 8.9, + 6.4, + 1.3, + 1.7, + 6.5, + 0, + 4.4, + 8.3, + 2.9, + 5.1, + 9.2, + 17.4, + 13.8, + 15.5, + 13.7, + 14.6, + 17, + 8, + 12 + ], + "mbps": [ + 25.5, + 40.1, + 38.9, + 47.5, + 58.2, + 57.1, + 52.3, + 43.7, + 31.9, + 20.2, + 14.6, + 9, + 7.8, + 7, + 12.4, + 9.2, + 18.6, + 37, + 42.4, + 49.6, + 51.7, + 47.3, + 54.8, + 43.4, + 47.3, + 38.5, + 32.1, + 18.6, + 16, + 11.7, + 2.1, + 3.9, + 11.7, + 18.2, + 35.6, + 33.6, + 48.3, + 56.4, + 53.8, + 50.2, + 43, + 38.8, + 33.6, + 30, + 16.3, + 12.8, + 8.5, + 9.4, + 6.4, + 18.8, + 17.9, + 33.9, + 43.8, + 49.3, + 51, + 50.7, + 56.2, + 49.5, + 45.9, + 29, + 48 + ] + }, + { + "number": 1, + "active": [ + 0.9, + 0.7, + 1.2, + 1.3, + 1.6, + 2.2, + 2, + 1.8, + 1.7, + 2.4, + 1.8, + 1.8, + 1.9, + 1, + 1, + 1, + 0.9, + 0.5, + 0.7, + 0.3, + 0, + 0.2, + 0, + 0.3, + 0, + 0.2, + 0.4, + 0.1, + 0.4, + 0.6, + 0.5, + 1.4, + 1.2, + 1.3, + 1.4, + 1.5, + 2.3, + 1.5, + 2.4, + 2.3, + 2, + 2.1, + 1.5, + 1.8, + 1, + 1.2, + 0.8, + 0.9, + 0.3, + 0, + 0.2, + 0, + 0, + 0.1, + 0, + 0, + 0, + 0.8, + 0.9, + 1.1, + 0.8 + ], + "mbps": [ + 0.4, + 0.6, + 0.5, + 0.7, + 0.5, + 0.7, + 0.7, + 0.8, + 0.6, + 0.7, + 0.7, + 0.5, + 0.6, + 0.4, + 0.3, + 0.4, + 0.4, + 0.2, + 0, + 0.3, + 0.2, + 0, + 0, + 0.2, + 0.3, + 0, + 0.3, + 0.4, + 0.3, + 0.4, + 0.3, + 0.5, + 0.5, + 0.6, + 0.8, + 0.6, + 0.6, + 0.8, + 0.6, + 0.8, + 0.6, + 0.5, + 0.6, + 0.7, + 0.5, + 0.2, + 0.4, + 0.3, + 0, + 0, + 0.2, + 0.1, + 0, + 0.2, + 0.1, + 0.1, + 0.2, + 0.3, + 0.3, + 0.1, + 0.2 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 8.5, + 9.9, + 12.8, + 10.4, + 14.4, + 12.5, + 7.7, + 4, + 1.1, + 1.6, + 1.3, + 4.1, + 6.3, + 4.3, + 7.5, + 11.9, + 15.3, + 15.1, + 11.8, + 10.4, + 5, + 0.9, + 0.9, + 3, + 2, + 6.6, + 6.3, + 12.5, + 9.4, + 15.6, + 14.3, + 12.8, + 6.1, + 6.8, + 4.4, + 1.2, + 0, + 3.2, + 2, + 6.2, + 8.2, + 13.1, + 15.2, + 12.1, + 8.9, + 8.5, + 5.6, + 5.7, + 3.5, + 4, + 0, + 6.5, + 9.4, + 9, + 9.3, + 12.9, + 14.5, + 12.3, + 6.4, + 4.4, + 12.4 + ], + "tx_mbit": [ + 0.5, + 0.9, + 1.3, + 1.5, + 1, + 1.4, + 1.1, + 0.4, + 0.6, + 0.2, + 0.4, + 0.2, + 0.6, + 0.9, + 1, + 1.4, + 1.2, + 1.5, + 1, + 0.8, + 0.7, + 0.6, + 0.3, + 0.1, + 0.4, + 0.4, + 0.7, + 1.1, + 1, + 1.3, + 1.3, + 1.1, + 0.9, + 0.7, + 0.4, + 0.3, + 0.5, + 0.4, + 0.6, + 0.7, + 0.7, + 1.1, + 1.4, + 1.1, + 1.4, + 1.2, + 0.6, + 0.3, + 0.2, + 0.5, + 0.1, + 0.6, + 0.8, + 0.7, + 1.4, + 1.3, + 1.1, + 1.2, + 1.2, + 1, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + } +} diff --git a/apps/tasks/scenes/strip_hung.json b/apps/tasks/scenes/strip_hung.json new file mode 100644 index 00000000..41b3c441 --- /dev/null +++ b/apps/tasks/scenes/strip_hung.json @@ -0,0 +1,930 @@ +{ + "size": [ + 1280, + 800 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": true + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [], + "sys": { + "cpu": [ + 32.6, + 31.6, + 35.9, + 39.4, + 40.4, + 40.5, + 39.3, + 41.6, + 42.7, + 42.8, + 43.1, + 43.2, + 38.7, + 38.2, + 37.3, + 38.4, + 36.4, + 39.2, + 33.8, + 36.1, + 34.4, + 29.7, + 29.9, + 25.6, + 25.1, + 27.4, + 25.3, + 23.4, + 23.2, + 22.2, + 21.3, + 20.9, + 21.6, + 26.1, + 21.2, + 24.4, + 27.7, + 24.6, + 31.5, + 31.8, + 33.4, + 33, + 32.5, + 37.2, + 37.6, + 36.8, + 40, + 38.8, + 40.1, + 43.9, + 44.5, + 40.7, + 39.5, + 39.2, + 37.5, + 40.4, + 38.4, + 37.6, + 34.1, + 33.9, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3349, + 3375, + 3387, + 3392, + 3435, + 3432, + 3426, + 3434, + 3431, + 3412, + 3390, + 3377, + 3356, + 3348, + 3332, + 3304, + 3279, + 3261, + 3279, + 3245, + 3251, + 3285, + 3291, + 3314, + 3308, + 3339, + 3379, + 3386, + 3423, + 3431, + 3448, + 3430, + 3439, + 3425, + 3436, + 3415, + 3390, + 3379, + 3333, + 3322, + 3295, + 3263, + 3255, + 3243, + 3257, + 3274, + 3281, + 3281, + 3324, + 3339, + 3362, + 3363, + 3389, + 3416, + 3431, + 3416, + 3450, + 3435, + 3423, + 3422, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 5.6, + 7.4, + 12.1, + 14.6, + 14.9, + 12.7, + 11, + 12.6, + 6.9, + 6.1, + 4.4, + 2.4, + 1.5, + 3.7, + 1.9, + 2, + 8.5, + 13.1, + 14, + 11.1, + 15.7, + 15.1, + 18.9, + 15.8, + 15.4, + 6.1, + 4.9, + 1.4, + 0, + 1.9, + 3.3, + 5.3, + 6.8, + 5.3, + 9, + 11.4, + 14.7, + 11.3, + 13.2, + 11.7, + 11.4, + 15, + 10.1, + 10.4, + 6.9, + 3.6, + 0, + 0, + 5.1, + 2.2, + 5.1, + 6.4, + 11.3, + 12.7, + 16.7, + 14.7, + 14.9, + 10.3, + 8.3, + 9.9, + 12 + ], + "mbps": [ + 30.6, + 38.3, + 43.5, + 52.6, + 53.9, + 49.7, + 52, + 41.6, + 29.1, + 27.2, + 14.9, + 13.4, + 14.6, + 8.6, + 8.4, + 17, + 23.5, + 28.7, + 38.1, + 46.4, + 44.7, + 56.9, + 44.7, + 52.7, + 46.6, + 32.6, + 29, + 24.2, + 12.2, + 7.1, + 1.1, + 4.4, + 14.2, + 26.8, + 32, + 43.6, + 50.8, + 55.6, + 53.3, + 57.6, + 43.5, + 47.9, + 28.8, + 30.3, + 22.8, + 13.4, + 13.8, + 11.4, + 6.3, + 13.5, + 26.6, + 32.2, + 36.4, + 51, + 51.5, + 46.9, + 46.6, + 49.9, + 41, + 29.6, + 48 + ] + }, + { + "number": 1, + "active": [ + 0.8, + 0.8, + 1.7, + 1.8, + 1.3, + 1.7, + 1.8, + 2.4, + 1.7, + 1.8, + 1.5, + 1.3, + 1.2, + 1.6, + 1.4, + 0.9, + 0.9, + 1, + 0.4, + 0.6, + 0, + 0, + 0, + 0, + 0, + 0.6, + 0.7, + 0.1, + 0.3, + 0.6, + 1.3, + 1.6, + 1.5, + 1.2, + 1.7, + 2.1, + 2, + 1.7, + 1.7, + 2.4, + 2.2, + 2.1, + 1.9, + 1.8, + 0.9, + 0.8, + 1, + 0.5, + 0, + 0.6, + 0.4, + 0.2, + 0, + 0.3, + 0.3, + 0.5, + 0.5, + 0.2, + 0.2, + 0.5, + 1.2 + ], + "mbps": [ + 0.6, + 0.4, + 0.4, + 0.7, + 0.6, + 0.5, + 0.7, + 0.7, + 0.8, + 0.6, + 0.6, + 0.6, + 0.5, + 0.3, + 0.6, + 0.5, + 0.2, + 0.2, + 0, + 0.1, + 0, + 0, + 0.2, + 0, + 0.3, + 0, + 0.3, + 0.2, + 0.3, + 0.5, + 0.4, + 0.4, + 0.5, + 0.7, + 0.8, + 0.5, + 0.9, + 0.5, + 0.9, + 0.7, + 0.7, + 0.7, + 0.6, + 0.6, + 0.6, + 0.3, + 0.4, + 0.2, + 0.3, + 0.2, + 0.2, + 0.1, + 0, + 0, + 0.1, + 0.2, + 0.1, + 0.1, + 0.4, + 0.4, + 0.4 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 10, + 12.2, + 13.9, + 12.9, + 12.4, + 9.3, + 8.5, + 4.6, + 4.5, + 1.7, + 0, + 4.5, + 4.4, + 7.2, + 9.3, + 11.7, + 14.3, + 15.6, + 9.7, + 10.1, + 4, + 3.9, + 2.6, + 3.2, + 1.7, + 3.7, + 5.3, + 9.7, + 14.7, + 11.3, + 11.1, + 13, + 9.8, + 3.6, + 1.8, + 1.1, + 1.7, + 5, + 1.6, + 9.8, + 9.5, + 11.3, + 12.4, + 11.4, + 9.7, + 10.6, + 5.1, + 3.5, + 0, + 1, + 3.7, + 6.6, + 8.2, + 9.5, + 9.8, + 12.7, + 14.3, + 13.3, + 6, + 6.4, + 12.4 + ], + "tx_mbit": [ + 0.7, + 0.9, + 1.4, + 1.3, + 1.3, + 1.3, + 0.7, + 0.4, + 0.5, + 0.6, + 0.2, + 0.3, + 0.5, + 0.9, + 1.1, + 1.3, + 1.3, + 1, + 0.9, + 0.7, + 0.5, + 0.4, + 0.4, + 0, + 0.1, + 0.3, + 0.6, + 1.3, + 1, + 1.5, + 1, + 1, + 0.6, + 0.5, + 0.3, + 0.5, + 0.6, + 0.4, + 0.4, + 0.9, + 1, + 1.4, + 1.6, + 1.2, + 1.1, + 1, + 0.9, + 0.6, + 0.1, + 0.4, + 0.5, + 0.8, + 1, + 1.2, + 1.1, + 1.6, + 1.4, + 1.2, + 1.2, + 0.7, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + }, + "hung_s": 42 +} diff --git a/apps/tasks/scenes/strip_line.json b/apps/tasks/scenes/strip_line.json new file mode 100644 index 00000000..eae07ec9 --- /dev/null +++ b/apps/tasks/scenes/strip_line.json @@ -0,0 +1,929 @@ +{ + "size": [ + 1280, + 600 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [], + "sys": { + "cpu": [ + 32.9, + 34.4, + 36.3, + 38.9, + 38.9, + 39.9, + 40.7, + 40.9, + 40.9, + 39.3, + 40.4, + 44.5, + 43.4, + 39.6, + 38.5, + 38, + 39, + 37.7, + 32.9, + 31.6, + 34.5, + 32.4, + 27.5, + 28.4, + 28.7, + 25.5, + 23, + 25.1, + 20, + 20.6, + 22.3, + 19.5, + 21.9, + 21.3, + 26.4, + 24.7, + 27.2, + 30.3, + 30.7, + 33.4, + 33.1, + 33.7, + 32.1, + 33.7, + 38.4, + 36.2, + 42, + 40.8, + 43.7, + 43.2, + 41.2, + 39.5, + 40.4, + 42.1, + 41.5, + 40.5, + 39, + 36.6, + 35.4, + 31.3, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3369, + 3372, + 3379, + 3407, + 3411, + 3417, + 3424, + 3422, + 3417, + 3409, + 3419, + 3403, + 3359, + 3339, + 3328, + 3295, + 3290, + 3270, + 3264, + 3269, + 3283, + 3261, + 3279, + 3320, + 3331, + 3364, + 3366, + 3397, + 3405, + 3432, + 3422, + 3453, + 3453, + 3443, + 3432, + 3418, + 3366, + 3349, + 3344, + 3319, + 3304, + 3279, + 3266, + 3250, + 3247, + 3252, + 3288, + 3298, + 3288, + 3308, + 3366, + 3383, + 3393, + 3417, + 3434, + 3442, + 3437, + 3451, + 3446, + 3435, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 8.3, + 10.9, + 15.7, + 13.8, + 15.6, + 16.9, + 17.8, + 10.5, + 6.1, + 7, + 2.6, + 2.2, + 0, + 0, + 6.2, + 5.6, + 5.6, + 11.9, + 7.1, + 17.5, + 19.4, + 12.5, + 17.9, + 10.3, + 17.2, + 7, + 5.7, + 1.8, + 4.7, + 6, + 1.7, + 0, + 0.5, + 3.3, + 6.5, + 11.8, + 10.5, + 12.3, + 12.4, + 14.8, + 12.7, + 9.1, + 10.3, + 9.8, + 4.7, + 1.4, + 4.5, + 3.5, + 2.2, + 3.6, + 8.5, + 9, + 9.2, + 9.5, + 16, + 13.3, + 15.4, + 18.3, + 15, + 10.1, + 12 + ], + "mbps": [ + 31.8, + 34.9, + 47.9, + 53, + 56.9, + 46.9, + 52.8, + 46.1, + 28.4, + 26.6, + 15.4, + 7, + 5.5, + 12.6, + 8.3, + 18.1, + 20.5, + 30.4, + 37.4, + 43.3, + 51.1, + 50.9, + 46.3, + 47.9, + 39, + 33.2, + 30.1, + 23.4, + 11.8, + 13.3, + 1.3, + 17.2, + 10.7, + 28.9, + 34.9, + 34.8, + 44.6, + 54.4, + 55.8, + 48.7, + 46.5, + 42.8, + 32.1, + 26, + 19.3, + 18.7, + 14.4, + 10, + 10.5, + 11.6, + 19.9, + 26.5, + 38.8, + 47.3, + 46.9, + 47.9, + 56.8, + 47.8, + 37.4, + 38.4, + 48 + ] + }, + { + "number": 1, + "active": [ + 1.4, + 0.9, + 1.2, + 1.7, + 2, + 2, + 1.6, + 2.1, + 1.8, + 1.9, + 1.8, + 2.1, + 2.1, + 1.5, + 1.7, + 0.8, + 0.8, + 0.1, + 0.8, + 0.4, + 0, + 0, + 0.2, + 0, + 0.4, + 0.5, + 0.5, + 0.2, + 0.1, + 0.8, + 0.6, + 1.2, + 1.8, + 1.9, + 1.8, + 1.9, + 1.7, + 2.5, + 2, + 1.5, + 1.8, + 1.6, + 1.9, + 1.2, + 0.7, + 0.6, + 0.7, + 0.8, + 0.6, + 0, + 0, + 0, + 0, + 0.1, + 0, + 0.2, + 0, + 0.6, + 1, + 0.4, + 0.9 + ], + "mbps": [ + 0.5, + 0.5, + 0.5, + 0.4, + 0.4, + 0.5, + 0.6, + 0.8, + 0.6, + 0.8, + 0.8, + 0.7, + 0.8, + 0.6, + 0.6, + 0.3, + 0.1, + 0.4, + 0.4, + 0.2, + 0, + 0.3, + 0, + 0.2, + 0, + 0.1, + 0.1, + 0.3, + 0.3, + 0.3, + 0.5, + 0.6, + 0.6, + 0.6, + 0.5, + 0.6, + 0.5, + 0.9, + 0.6, + 0.7, + 0.7, + 0.6, + 0.8, + 0.6, + 0.7, + 0.6, + 0.3, + 0.4, + 0.2, + 0.3, + 0.2, + 0.1, + 0.1, + 0.3, + 0.2, + 0.1, + 0.3, + 0.2, + 0.2, + 0.4, + 0.5 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 8.1, + 7.8, + 12.6, + 13.1, + 14.3, + 10.9, + 6, + 5.8, + 2.7, + 1.4, + 3, + 2.2, + 5.2, + 4, + 8.2, + 11.6, + 15, + 14.5, + 13, + 6.1, + 3.5, + 0.4, + 1.6, + 0, + 0, + 2.4, + 6.8, + 7.3, + 13.5, + 12.4, + 13.8, + 8.9, + 9, + 7.1, + 0.6, + 2.7, + 2.7, + 3.2, + 6.1, + 4.9, + 10.4, + 11.5, + 13.7, + 10.6, + 11.5, + 7.7, + 6.7, + 5.4, + 0, + 2.7, + 2.9, + 3.9, + 8.4, + 11.5, + 14.1, + 11.7, + 14.6, + 9.1, + 5.8, + 3.8, + 12.4 + ], + "tx_mbit": [ + 1, + 1.1, + 1.5, + 1.5, + 1.4, + 1.1, + 1.1, + 0.8, + 0.4, + 0.4, + 0.4, + 0.5, + 0.4, + 0.8, + 0.8, + 1.1, + 1.4, + 1.4, + 1.3, + 1.2, + 0.5, + 0.4, + 0.1, + 0.4, + 0.2, + 0.7, + 0.6, + 1.1, + 1.5, + 1.5, + 1, + 1.2, + 0.7, + 0.7, + 0.5, + 0.1, + 0.1, + 0.5, + 0.6, + 1, + 1, + 1, + 1.1, + 1.5, + 1.2, + 0.7, + 0.5, + 0.5, + 0.3, + 0.6, + 0.2, + 0.3, + 1, + 1.3, + 1.3, + 1.2, + 1.5, + 1.1, + 0.7, + 0.4, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + } +} diff --git a/apps/tasks/scenes/strip_line_hung.json b/apps/tasks/scenes/strip_line_hung.json new file mode 100644 index 00000000..ff97c1b7 --- /dev/null +++ b/apps/tasks/scenes/strip_line_hung.json @@ -0,0 +1,930 @@ +{ + "size": [ + 1280, + 600 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 58, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": true + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [], + "sys": { + "cpu": [ + 34.4, + 35.1, + 37.5, + 39.4, + 40.5, + 41.2, + 38.2, + 39, + 39, + 40.1, + 43.6, + 41.1, + 42.8, + 42.1, + 41.3, + 37.6, + 37.6, + 36, + 36.5, + 34.1, + 33.4, + 32.2, + 26, + 28.6, + 26.7, + 22.2, + 24.2, + 21, + 23.5, + 19.2, + 23.4, + 24.1, + 21, + 23.2, + 25.2, + 27, + 23.3, + 25, + 31.4, + 29.6, + 33.1, + 36.2, + 34.2, + 38.2, + 39, + 36.7, + 39.2, + 40.9, + 39.4, + 43.3, + 44.1, + 39.7, + 43.6, + 39.3, + 38.6, + 41.8, + 36.8, + 34.1, + 34.5, + 31.2, + 34 + ], + "mem": [ + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58, + 58 + ], + "speed_mhz": [ + 3330, + 3366, + 3399, + 3418, + 3425, + 3439, + 3438, + 3447, + 3413, + 3424, + 3417, + 3375, + 3372, + 3334, + 3310, + 3287, + 3275, + 3264, + 3277, + 3243, + 3246, + 3261, + 3301, + 3296, + 3342, + 3346, + 3370, + 3407, + 3418, + 3427, + 3429, + 3445, + 3438, + 3416, + 3411, + 3413, + 3368, + 3367, + 3349, + 3314, + 3312, + 3278, + 3254, + 3252, + 3266, + 3264, + 3265, + 3291, + 3314, + 3324, + 3340, + 3386, + 3375, + 3415, + 3427, + 3436, + 3432, + 3418, + 3414, + 3419, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9.4, + 12.3, + 9.9, + 18.3, + 16.1, + 17.3, + 18.9, + 12.5, + 10.4, + 10.4, + 3.2, + 6.7, + 3.5, + 5.8, + 6.9, + 0.3, + 8.8, + 5, + 7.5, + 16.8, + 16.9, + 12.2, + 17.3, + 16.3, + 9.8, + 14.4, + 4.7, + 7, + 0, + 1.1, + 0.1, + 1.9, + 5, + 4.4, + 10.8, + 12.7, + 13.7, + 12.3, + 14.3, + 14.7, + 16.7, + 10.9, + 9.5, + 9.8, + 8.9, + 5.1, + 0, + 0.9, + 4.3, + 0.2, + 8.2, + 12, + 11, + 9.8, + 12.4, + 13.2, + 14.1, + 15.6, + 8.3, + 7.3, + 12 + ], + "mbps": [ + 32.4, + 34.7, + 47.2, + 45.5, + 49.7, + 49.4, + 52.3, + 40.9, + 29.1, + 32.7, + 13.3, + 5.4, + 11.7, + 4.5, + 13.3, + 8.6, + 28.6, + 28.6, + 41.4, + 45.5, + 43.9, + 52.8, + 55.9, + 53.1, + 43.5, + 31, + 21.1, + 13.4, + 12.2, + 6.7, + 12.6, + 11.8, + 10.6, + 26.5, + 35.4, + 39.9, + 51.2, + 52.4, + 45.2, + 56.3, + 52.5, + 45.6, + 31.6, + 26.7, + 12.4, + 17.6, + 8.9, + 4.7, + 4.4, + 14, + 22.7, + 24.7, + 31.2, + 48.6, + 55.3, + 49.9, + 55.4, + 42.2, + 45, + 37.1, + 48 + ] + }, + { + "number": 1, + "active": [ + 1.4, + 1.2, + 1.9, + 1.2, + 1.6, + 1.5, + 2.1, + 2.4, + 2.1, + 2.2, + 2.4, + 1.9, + 1.6, + 1.9, + 1.4, + 0.8, + 1, + 1, + 0.1, + 0.1, + 0.1, + 0.4, + 0, + 0, + 0.2, + 0.2, + 0.7, + 0, + 0.2, + 1.1, + 1.1, + 0.9, + 1.6, + 1.8, + 1.3, + 2.1, + 2.2, + 2, + 1.6, + 2.3, + 2, + 1.3, + 1.4, + 1.6, + 1.2, + 0.6, + 0.7, + 0.2, + 0.4, + 0.6, + 0, + 0.5, + 0.2, + 0, + 0, + 0, + 0.7, + 0.5, + 1.1, + 0.6, + 1 + ], + "mbps": [ + 0.5, + 0.3, + 0.6, + 0.7, + 0.8, + 0.6, + 0.5, + 0.6, + 0.6, + 0.7, + 0.5, + 0.7, + 0.4, + 0.5, + 0.4, + 0.3, + 0.4, + 0.3, + 0.1, + 0.1, + 0.1, + 0.2, + 0, + 0, + 0.2, + 0.2, + 0.2, + 0.3, + 0.1, + 0.4, + 0.5, + 0.4, + 0.6, + 0.7, + 0.4, + 0.6, + 0.8, + 0.7, + 0.6, + 0.5, + 0.5, + 0.7, + 0.5, + 0.3, + 0.6, + 0.6, + 0.5, + 0.1, + 0.1, + 0.3, + 0, + 0.2, + 0.1, + 0.2, + 0, + 0, + 0.1, + 0.2, + 0.2, + 0.4, + 0.3 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 8.3, + 11.8, + 13.2, + 13.8, + 13.2, + 10.2, + 8.5, + 8.3, + 1.9, + 2.6, + 2.7, + 0, + 3.5, + 7.9, + 8.5, + 11.8, + 15, + 10.6, + 11.5, + 8.5, + 7.3, + 0.9, + 0, + 0, + 0.8, + 4, + 7.6, + 9.5, + 13.8, + 14.8, + 12.8, + 12.8, + 9.2, + 3.5, + 4.1, + 3.5, + 1.3, + 0.2, + 2.6, + 6.9, + 8.7, + 14.4, + 12, + 11.9, + 12.7, + 11.4, + 5.3, + 5.8, + 3.8, + 2.9, + 3.3, + 6.4, + 5.8, + 8.2, + 11, + 15, + 10.4, + 11.4, + 8.6, + 5.2, + 12.4 + ], + "tx_mbit": [ + 0.9, + 0.9, + 1.3, + 1.3, + 1.5, + 1.2, + 0.9, + 1, + 0.6, + 0.1, + 0.4, + 0.7, + 0.9, + 0.8, + 1.1, + 1, + 1.1, + 1.3, + 0.8, + 0.7, + 0.5, + 0.8, + 0.2, + 0.6, + 0.4, + 0.4, + 0.6, + 1.1, + 1.3, + 1.2, + 1.3, + 1, + 0.9, + 0.8, + 0.3, + 0.4, + 0.3, + 0.4, + 0.8, + 1, + 1, + 1.4, + 1.5, + 1.2, + 1, + 1.1, + 0.7, + 0.6, + 0.3, + 0.5, + 0.6, + 0.8, + 0.7, + 0.9, + 1.1, + 1.2, + 1.2, + 1.2, + 1.2, + 0.7, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + }, + "hung_s": 42 +} diff --git a/apps/tasks/scenes/strip_memory.json b/apps/tasks/scenes/strip_memory.json new file mode 100644 index 00000000..17c5627d --- /dev/null +++ b/apps/tasks/scenes/strip_memory.json @@ -0,0 +1,929 @@ +{ + "size": [ + 1280, + 800 + ], + "mode": "grouped", + "machine": { + "logical_cpus": 16, + "total_phys": 34145000000, + "mem_load": 93, + "commit_pct": 40, + "cpu_pct": 34, + "dpc_irq_pct": 1.4 + }, + "procs": [ + { + "pid": 0, + "created": 0, + "parent": 0, + "session": 0, + "image": "", + "path": null, + "cpu": [ + 40 + ], + "ws_private": 10486, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4, + "created": 133500000000004000, + "parent": 0, + "session": 0, + "image": "System", + "path": "C:\\Windows\\System32\\ntoskrnl.exe", + "cpu": [ + 0.4 + ], + "ws_private": 209920, + "io": [ + 11000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 700, + "created": 133500000000700000, + "parent": 4, + "session": 0, + "image": "services.exe", + "path": "C:\\Windows\\System32\\services.exe", + "cpu": [ + 0.1 + ], + "ws_private": 9437184, + "io": [ + 300 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 800, + "created": 133500000000800000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.2 + ], + "ws_private": 50331648, + "io": [ + 29000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 804, + "created": 133500000000804000, + "parent": 700, + "session": 0, + "image": "svchost.exe", + "path": "C:\\Windows\\System32\\svchost.exe", + "cpu": [ + 0.3 + ], + "ws_private": 32505856, + "io": [ + 1200 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 900, + "created": 133500000000900000, + "parent": 4, + "session": 1, + "image": "dwm.exe", + "path": "C:\\Windows\\System32\\dwm.exe", + "cpu": [ + 1.2 + ], + "ws_private": 167772160, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 1000, + "created": 133500000001000000, + "parent": 700, + "session": 1, + "image": "explorer.exe", + "path": "C:\\Windows\\explorer.exe", + "cpu": [ + 0.4 + ], + "ws_private": 220200960, + "io": [ + 5000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2000, + "created": 133500000002000000, + "parent": 1000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 4.1 + ], + "ws_private": 641728512, + "io": [ + 100000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2100, + "created": 133500000002100000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 5.2 + ], + "ws_private": 360710144, + "io": [ + 20000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 2110, + "created": 133500000002110000, + "parent": 2000, + "session": 1, + "image": "ember.exe", + "path": "C:\\Games\\Ember\\ember.exe", + "cpu": [ + 3.1 + ], + "ws_private": 926941184, + "io": [ + 300000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 3000, + "created": 133500000003000000, + "parent": 1000, + "session": 1, + "image": "prism.exe", + "path": "C:\\Program Files\\Prism\\prism.exe", + "cpu": [ + 18.2 + ], + "ws_private": 220200960, + "io": [ + 800000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 4000, + "created": 133500000004000000, + "parent": 1000, + "session": 1, + "image": "orbit.exe", + "path": "C:\\Program Files\\Orbit\\orbit.exe", + "cpu": [ + 0.8 + ], + "ws_private": 157286400, + "io": [ + 2000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 5000, + "created": 133500000005000000, + "parent": 1000, + "session": 1, + "image": "quill.exe", + "path": "C:\\Program Files\\Quill\\quill.exe", + "cpu": [ + 0 + ], + "ws_private": 224395264, + "io": [ + 0 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7000, + "created": 133500000007000000, + "parent": 1000, + "session": 1, + "image": "syncer.exe", + "path": "C:\\Program Files\\Syncer\\syncer.exe", + "cpu": [ + 0.2 + ], + "ws_private": 62914560, + "io": [ + 4000 + ], + "threads": 8, + "handles": 200 + }, + { + "pid": 7500, + "created": 133500000007500000, + "parent": 1000, + "session": 1, + "image": "helper.exe", + "path": "C:\\Tools\\helper.exe", + "cpu": [ + 0.1 + ], + "ws_private": 14680064, + "io": [ + 100 + ], + "threads": 8, + "handles": 200 + } + ], + "windows": [ + { + "pid": 1000, + "identity": "explorer-id", + "hung": false + }, + { + "pid": 2000, + "identity": "ember-id", + "hung": false + }, + { + "pid": 3000, + "identity": "prism-id", + "hung": false + }, + { + "pid": 4000, + "identity": "orbit-id", + "hung": false + }, + { + "pid": 5000, + "identity": "quill-id", + "hung": false + } + ], + "services": [ + { + "pid": 800, + "name": "Audiosrv", + "display": "Windows Audio" + }, + { + "pid": 804, + "name": "Dhcp", + "display": "DHCP Client" + } + ], + "collapsed": { + "apps": false, + "background": false, + "windows": false + }, + "icons": { + "explorer-id": "#E3B341", + "ember-id": "#E4572E", + "prism-id": "#3E7BE6", + "orbit-id": "#7C5CFF", + "quill-id": "#8A5BE0", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\helper.exe": "none" + }, + "names": { + "explorer-id": "File Explorer", + "ember-id": "Ember", + "prism-id": "Prism", + "orbit-id": "Orbit", + "quill-id": "Quill", + "c:\\program files\\syncer\\syncer.exe": "Syncer", + "c:\\tools\\helper.exe": "Helper", + "c:\\games\\ember\\ember.exe": "Ember", + "c:\\program files\\prism\\prism.exe": "Prism", + "c:\\program files\\orbit\\orbit.exe": "Orbit", + "c:\\program files\\quill\\quill.exe": "Quill" + }, + "ticks": 60, + "input": [], + "sys": { + "cpu": [ + 29.6, + 33.2, + 32.6, + 36.7, + 40.7, + 40.3, + 42.4, + 42, + 40.3, + 42, + 41, + 43.6, + 42, + 41.4, + 41.1, + 37.6, + 39.8, + 35.8, + 36.1, + 33.4, + 32.8, + 30.8, + 26.3, + 30.4, + 24.6, + 27.8, + 23.7, + 20.4, + 25, + 20.5, + 19.2, + 21.6, + 25.4, + 22.5, + 25.7, + 25, + 24.4, + 25.7, + 31.1, + 28.8, + 29.8, + 30.6, + 36.6, + 39.1, + 37.9, + 36.5, + 40, + 41.1, + 39.8, + 41.7, + 42.3, + 39.7, + 39, + 41.9, + 42.6, + 41.7, + 35.4, + 35.6, + 32.1, + 33.4, + 34 + ], + "mem": [ + 80, + 80, + 81, + 81, + 81, + 82, + 82, + 82, + 82, + 83, + 83, + 83, + 84, + 84, + 84, + 85, + 85, + 85, + 85, + 86, + 86, + 86, + 87, + 87, + 87, + 88, + 88, + 88, + 88, + 89, + 89, + 89, + 90, + 90, + 90, + 91, + 91, + 91, + 91, + 92, + 92, + 92, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93 + ], + "speed_mhz": [ + 3352, + 3365, + 3375, + 3408, + 3445, + 3453, + 3456, + 3420, + 3436, + 3420, + 3391, + 3377, + 3348, + 3346, + 3299, + 3299, + 3284, + 3265, + 3273, + 3270, + 3259, + 3291, + 3298, + 3308, + 3324, + 3350, + 3360, + 3413, + 3402, + 3442, + 3420, + 3430, + 3436, + 3414, + 3420, + 3413, + 3375, + 3344, + 3327, + 3315, + 3302, + 3273, + 3266, + 3251, + 3275, + 3262, + 3262, + 3269, + 3318, + 3320, + 3350, + 3364, + 3406, + 3432, + 3422, + 3430, + 3447, + 3451, + 3430, + 3405, + 3420 + ], + "disks": [ + { + "number": 0, + "active": [ + 9.2, + 12.5, + 16, + 12.7, + 18.7, + 14.1, + 10.5, + 14.3, + 10.8, + 9.7, + 4, + 0.6, + 3, + 0.3, + 2, + 2.9, + 4.8, + 13.1, + 11.5, + 13.5, + 15.3, + 15.5, + 17.8, + 18.1, + 10.1, + 6.7, + 3.8, + 1.7, + 3.6, + 0.3, + 0, + 1.2, + 0, + 3.5, + 11.6, + 13.7, + 11.6, + 12.9, + 12.4, + 16.1, + 14.6, + 12.6, + 9.6, + 5.7, + 7.2, + 3.9, + 0.3, + 5.1, + 0.6, + 3.5, + 8.3, + 8.3, + 13.6, + 15.7, + 10.8, + 18.1, + 18.9, + 12.9, + 11.6, + 14.1, + 12 + ], + "mbps": [ + 36.2, + 41.6, + 48.5, + 45.2, + 58.9, + 50.9, + 48.3, + 37.5, + 37.5, + 31, + 12.8, + 16.6, + 13.1, + 2.3, + 7.8, + 8.7, + 22.7, + 33.2, + 42.4, + 40.8, + 49.3, + 51, + 50.6, + 54.2, + 34.7, + 34.1, + 29.6, + 25, + 8.8, + 12.4, + 7.2, + 13.6, + 13.6, + 26.2, + 23.5, + 40.4, + 38.8, + 53, + 53.9, + 47.4, + 52.9, + 48.2, + 41, + 30.5, + 22.8, + 7.7, + 5.1, + 11.6, + 13.4, + 14.8, + 18.9, + 33.1, + 39.4, + 46.7, + 50.7, + 45.6, + 53.9, + 49.3, + 37.8, + 27.1, + 48 + ] + }, + { + "number": 1, + "active": [ + 1.3, + 1.1, + 1.4, + 1.3, + 2.2, + 2.3, + 1.7, + 2.4, + 2.1, + 2.1, + 1.7, + 1.5, + 1.4, + 1.9, + 1.6, + 1.5, + 0.7, + 0.4, + 0, + 0.2, + 0.6, + 0, + 0, + 0.5, + 0.2, + 0, + 0.2, + 0.1, + 0.8, + 0.8, + 0.9, + 0.9, + 1.1, + 1.9, + 1.3, + 2.1, + 1.5, + 1.9, + 1.8, + 2, + 2, + 2.2, + 1.9, + 1.3, + 0.8, + 0.7, + 1.2, + 0.9, + 0.5, + 0, + 0.6, + 0, + 0.4, + 0.2, + 0.2, + 0.6, + 0.4, + 0.7, + 0.8, + 0.5, + 0.8 + ], + "mbps": [ + 0.5, + 0.4, + 0.5, + 0.6, + 0.7, + 0.8, + 0.7, + 0.8, + 0.5, + 0.6, + 0.5, + 0.7, + 0.7, + 0.4, + 0.5, + 0.4, + 0.4, + 0.1, + 0.2, + 0.2, + 0, + 0, + 0.2, + 0.2, + 0, + 0.1, + 0.2, + 0.3, + 0.2, + 0.3, + 0.5, + 0.3, + 0.7, + 0.7, + 0.6, + 0.6, + 0.5, + 0.8, + 0.8, + 0.8, + 0.7, + 0.5, + 0.4, + 0.7, + 0.5, + 0.5, + 0.4, + 0.3, + 0.4, + 0.4, + 0.2, + 0.3, + 0.2, + 0.3, + 0.3, + 0.2, + 0.3, + 0.2, + 0.4, + 0.3, + 0.5 + ] + } + ], + "adapters": [ + { + "id": 1, + "name": "Wi-Fi", + "wifi": true, + "rx_mbit": [ + 7.6, + 9.6, + 10.7, + 10.4, + 15.2, + 10.4, + 7.2, + 7.3, + 1.1, + 0, + 0, + 3.1, + 3.6, + 8.7, + 11.7, + 13.4, + 13.9, + 11.6, + 9.8, + 9, + 4, + 5, + 3.4, + 2.9, + 2.7, + 5.8, + 4.8, + 11.3, + 13.1, + 13, + 13.6, + 10.5, + 6, + 7.8, + 6, + 0, + 1.8, + 0, + 4.1, + 9.2, + 7.7, + 10.9, + 10.1, + 10.7, + 12.8, + 10.3, + 4, + 5.6, + 1.1, + 3.4, + 2.8, + 3, + 7.3, + 11.2, + 12.3, + 14.7, + 9.8, + 10.6, + 7, + 6.4, + 12.4 + ], + "tx_mbit": [ + 0.9, + 1, + 1.3, + 1.3, + 1, + 0.9, + 0.8, + 0.7, + 0.8, + 0.2, + 0.6, + 0.3, + 0.4, + 0.7, + 1, + 1.2, + 1, + 1, + 1.1, + 1.1, + 0.5, + 0.8, + 0.2, + 0.4, + 0.5, + 0.4, + 0.7, + 1.2, + 1.3, + 1, + 1, + 1.1, + 1, + 0.6, + 0.5, + 0.4, + 0.4, + 0.2, + 0.5, + 0.9, + 1.1, + 1.3, + 1.3, + 1.2, + 1.1, + 0.9, + 0.7, + 0.3, + 0.6, + 0.1, + 0.7, + 0.7, + 1, + 0.9, + 1.1, + 1.3, + 1.5, + 1.3, + 1.2, + 0.4, + 1.1 + ] + }, + { + "id": 2, + "name": "Ethernet", + "connected": false + } + ] + } +} diff --git a/apps/tasks/scenes/suite_about.json b/apps/tasks/scenes/suite_about.json index 91fb034b..933ffc63 100644 --- a/apps/tasks/scenes/suite_about.json +++ b/apps/tasks/scenes/suite_about.json @@ -1,6 +1,6 @@ { "size": [ - 640, + 800, 560 ], "mode": "list", diff --git a/apps/tasks/scenes/suite_notice.json b/apps/tasks/scenes/suite_notice.json index 6b8605fa..8dd37b0f 100644 --- a/apps/tasks/scenes/suite_notice.json +++ b/apps/tasks/scenes/suite_notice.json @@ -1,6 +1,6 @@ { "size": [ - 640, + 800, 560 ], "mode": "list", diff --git a/apps/tasks/scenes/t1_first_frame.json b/apps/tasks/scenes/t1_first_frame.json index 1998a2d1..24b577f9 100644 --- a/apps/tasks/scenes/t1_first_frame.json +++ b/apps/tasks/scenes/t1_first_frame.json @@ -1,6 +1,6 @@ { "size": [ - 640, + 800, 560 ], "mode": "list", diff --git a/apps/tasks/scenes/t1_focus.json b/apps/tasks/scenes/t1_focus.json index 63449b07..a415fc2c 100644 --- a/apps/tasks/scenes/t1_focus.json +++ b/apps/tasks/scenes/t1_focus.json @@ -1,6 +1,6 @@ { "size": [ - 640, + 800, 560 ], "mode": "list", @@ -713,7 +713,7 @@ ], "ticks": 2, "input": [ - "click 200,118", + "click 200,176", "key Down", "key Down" ] diff --git a/apps/tasks/scenes/t1_inactive.json b/apps/tasks/scenes/t1_inactive.json index 2312146a..543c5b80 100644 --- a/apps/tasks/scenes/t1_inactive.json +++ b/apps/tasks/scenes/t1_inactive.json @@ -1,6 +1,6 @@ { "size": [ - 640, + 800, 560 ], "mode": "list", @@ -713,7 +713,7 @@ ], "ticks": 2, "input": [ - "click 200,118", + "click 200,176", "active off" ] } diff --git a/apps/tasks/scenes/t1_list_busy.json b/apps/tasks/scenes/t1_list_busy.json index 95ee9e93..c1c56caf 100644 --- a/apps/tasks/scenes/t1_list_busy.json +++ b/apps/tasks/scenes/t1_list_busy.json @@ -1,6 +1,6 @@ { "size": [ - 640, + 800, 560 ], "mode": "list", diff --git a/apps/tasks/scenes/t1_list_calm.json b/apps/tasks/scenes/t1_list_calm.json index 379c3564..d0a86ce8 100644 --- a/apps/tasks/scenes/t1_list_calm.json +++ b/apps/tasks/scenes/t1_list_calm.json @@ -1,6 +1,6 @@ { "size": [ - 640, + 984, 560 ], "mode": "list", diff --git a/apps/tasks/scenes/t1_more_menu.json b/apps/tasks/scenes/t1_more_menu.json index f66884ea..9d6213be 100644 --- a/apps/tasks/scenes/t1_more_menu.json +++ b/apps/tasks/scenes/t1_more_menu.json @@ -1,6 +1,6 @@ { "size": [ - 640, + 800, 560 ], "mode": "list", diff --git a/apps/tasks/scenes/t1_paused.json b/apps/tasks/scenes/t1_paused.json index c2c2e7bf..8dc9428c 100644 --- a/apps/tasks/scenes/t1_paused.json +++ b/apps/tasks/scenes/t1_paused.json @@ -1,6 +1,6 @@ { "size": [ - 640, + 800, 560 ], "mode": "list", diff --git a/apps/tasks/scenes/t1_read_error.json b/apps/tasks/scenes/t1_read_error.json index b10ad57b..aec7d682 100644 --- a/apps/tasks/scenes/t1_read_error.json +++ b/apps/tasks/scenes/t1_read_error.json @@ -1,6 +1,6 @@ { "size": [ - 640, + 800, 560 ], "mode": "list", diff --git a/apps/tasks/scenes/t3a_grouped.json b/apps/tasks/scenes/t3a_grouped.json index a4358030..f67c3896 100644 --- a/apps/tasks/scenes/t3a_grouped.json +++ b/apps/tasks/scenes/t3a_grouped.json @@ -441,6 +441,14 @@ "display": "DHCP Client" } ], + "icons": { + "explorer-id": "#E3B341", + "orbit-id": "#8A5BE0", + "ember-id": "#E4572E", + "calc-id": "#4EA4E8", + "c:\\program files\\syncer\\syncer.exe": "#2EA0D8", + "c:\\tools\\notes.exe": "pending" + }, "names": { "explorer-id": "File Explorer", "orbit-id": "Orbit", diff --git a/apps/tasks/scenes/t3a_part_of_windows_collapsed_hot.json b/apps/tasks/scenes/t3a_part_of_windows_collapsed_hot.json index fe9dbbf9..80985189 100644 --- a/apps/tasks/scenes/t3a_part_of_windows_collapsed_hot.json +++ b/apps/tasks/scenes/t3a_part_of_windows_collapsed_hot.json @@ -1,7 +1,7 @@ { "size": [ 760, - 520 + 572 ], "machine": { "logical_cpus": 16, @@ -90,7 +90,7 @@ "image": "svchost.exe", "path": "C:\\Windows\\System32\\svchost.exe", "cpu": [ - 7 + 16 ], "ws_private": 50331648, "io": [ diff --git a/apps/tasks/scenes/t5b_multi.json b/apps/tasks/scenes/t5b_multi.json index 81e87be8..9843c62c 100644 --- a/apps/tasks/scenes/t5b_multi.json +++ b/apps/tasks/scenes/t5b_multi.json @@ -457,7 +457,7 @@ "windows": false }, "input": [ - "click 200,120", + "click 200,260", "key Shift+Down", "key Shift+Down" ] diff --git a/apps/tasks/src/app/dock.rs b/apps/tasks/src/app/dock.rs new file mode 100644 index 00000000..056b56db --- /dev/null +++ b/apps/tasks/src/app/dock.rs @@ -0,0 +1,72 @@ +//! The dock as Tasks reaches it: whether a dock runs and a request that it open its Settings on a page (the accent colour +//! item of the Settings menu opens Appearance). A trait so that scenes and tests run without a dock, and a recorder +//! that keeps what was asked. + +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::Mutex; + +use oled_sys::docklink::{self, SettingsPage}; + +/// What the window asks of the dock. +pub trait DockLink: Send + Sync { + /// True while the dock of this suite runs. + fn running(&self) -> bool; + /// Asks the dock to open its Settings on `page`; true once the request is posted. + fn open_settings(&self, page: SettingsPage) -> bool; +} + +/// The real dock: oled_sys::docklink. +pub struct Win32Dock; + +impl DockLink for Win32Dock { + fn running(&self) -> bool { + docklink::dock_running() + } + + fn open_settings(&self, page: SettingsPage) -> bool { + docklink::open_dock_settings(page) + } +} + +/// A dock that is there or not as the test says, and remembers every request. +pub struct RecordingDock { + running: AtomicBool, + asked: Mutex>, +} + +impl Default for RecordingDock { + fn default() -> RecordingDock { + RecordingDock::new(true) + } +} + +impl RecordingDock { + pub fn new(running: bool) -> RecordingDock { + RecordingDock { running: AtomicBool::new(running), asked: Mutex::new(Vec::new()) } + } + + pub fn set_running(&self, on: bool) { + self.running.store(on, Ordering::SeqCst); + } + + /// The pages asked for, in order. + pub fn asked(&self) -> Vec { + self.asked.lock().map(|v| v.clone()).unwrap_or_default() + } +} + +impl DockLink for RecordingDock { + fn running(&self) -> bool { + self.running.load(Ordering::SeqCst) + } + + fn open_settings(&self, page: SettingsPage) -> bool { + if !self.running() { + return false; + } + if let Ok(mut v) = self.asked.lock() { + v.push(page); + } + true + } +} diff --git a/apps/tasks/src/app/exec.rs b/apps/tasks/src/app/exec.rs index 29253159..bb5656f2 100644 --- a/apps/tasks/src/app/exec.rs +++ b/apps/tasks/src/app/exec.rs @@ -1,8 +1,12 @@ //! The executor (T3.7): Close, End, End now, End process tree and Reopen run on an act thread, every key re-checked //! immediately before it is touched. The types, the Executor trait and the RecordingExecutor are TF0's; the order of -//! a kill list and its checks run over the Os trait, so tests drive them with a fake. +//! a kill list and its checks run over the Os trait, so tests drive them with a fake. Priority, efficiency mode, their +//! undo and the restart of Windows Explorer are tune's, run on act threads of the same kind. + +pub mod tune; use std::collections::{HashMap, HashSet}; +use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex}; use oled_sys::admin::policy::{descendants, HelperFacts, ProcEdge, TargetFacts}; @@ -22,6 +26,7 @@ use windows::Win32::UI::WindowsAndMessaging::{ FindWindowExW, GetClassNameW, GetWindowThreadProcessId, PostMessageW, WM_CLOSE, }; +use self::tune::{RestartOutcome, RestartRefusal, RestartReq, TuneBatch, TuneDone, TuneOutcome, UndoBook, UndoEntry}; use super::access::{self, Refusal, ACCESS_DENIED}; use super::launch::Launcher; use crate::model::classify::{path_class, PathClass}; @@ -85,18 +90,52 @@ pub struct ActionDone { /// The UI's one way to act on processes. pub trait Executor: Send + Sync { fn submit(&self, b: Batch); + + /// Priority, efficiency mode, their restore or a read (tune::run) off the UI thread; one TuneDone::Process per + /// target comes back through the proxy. An executor that runs nothing drops it. + fn tune(&self, b: TuneBatch) { + let _ = b; + } + + /// The restart of Windows Explorer (tune::restart) off the UI thread; its TuneDone::Explorer comes back through the + /// proxy. An executor that runs nothing drops it. + fn restart_explorer(&self, r: RestartReq) { + let _ = r; + } + + /// What this session changed on `key` and can put back (the undo book); None when nothing, and by default. + fn undo_entry(&self, key: ProcKey) -> Option { + let _ = key; + None + } } -/// Keeps every batch and runs nothing; every Harness test and scene. +/// Keeps every batch and runs nothing; every Harness test and scene. Its book answers undo_entry, so a scene can show +/// what a session changed. #[derive(Default)] pub struct RecordingExecutor { pub batches: Mutex>, + pub tunes: Mutex>, + pub restarts: Mutex>, + pub book: Mutex, } impl Executor for RecordingExecutor { fn submit(&self, b: Batch) { self.batches.lock().unwrap_or_else(|p| p.into_inner()).push(b); } + + fn tune(&self, b: TuneBatch) { + self.tunes.lock().unwrap_or_else(|p| p.into_inner()).push(b); + } + + fn restart_explorer(&self, r: RestartReq) { + self.restarts.lock().unwrap_or_else(|p| p.into_inner()).push(r); + } + + fn undo_entry(&self, key: ProcKey) -> Option { + self.book.lock().unwrap_or_else(|p| p.into_inner()).get(key).copied() + } } /// ERROR_INVALID_PARAMETER: OpenProcess of a pid that is gone. @@ -110,6 +149,8 @@ pub const INVALID_WINDOW: u32 = 1400; /// The act thread's stack: a kill list needs little (its buffers are on the heap). const ACT_STACK: usize = 64 * 1024; +/// A tune batch or a restart: the token and snapshot reads keep their buffers on the heap too, with room to spare. +const TUNE_STACK: usize = 128 * 1024; /// Reopen calls ShellExecuteExW, which loads shell extensions on the calling thread: the stack they expect. const REOPEN_STACK: usize = 1024 * 1024; @@ -330,16 +371,43 @@ pub struct Win32Executor { launcher: Arc, proxy: Mutex>, system_root: String, + /// This session's undo book: tune threads write it, the UI reads it (undo_entry); no system call is made while it + /// is locked. + book: Arc>, + /// One tune batch at a time, so each one starts from the book the last one left. + tune_turn: Arc>, + /// A restart of Windows Explorer is running. + restarting: Arc, } impl Win32Executor { pub fn new(l: Arc) -> Arc { - Arc::new(Win32Executor { launcher: l, proxy: Mutex::new(None), system_root: windows_dir() }) + Arc::new(Win32Executor { + launcher: l, + proxy: Mutex::new(None), + system_root: windows_dir(), + book: Arc::new(Mutex::new(UndoBook::default())), + tune_turn: Arc::new(Mutex::new(())), + restarting: Arc::new(AtomicBool::new(false)), + }) } pub fn attach(&self, p: Proxy) { *self.proxy.lock().unwrap_or_else(|e| e.into_inner()) = Some(p); } + + fn proxy(&self) -> Option { + self.proxy.lock().unwrap_or_else(|e| e.into_inner()).clone() + } +} + +/// Clears the restart flag when the restart's thread ends, however it ends. +struct Restarting(Arc); + +impl Drop for Restarting { + fn drop(&mut self) { + self.0.store(false, Ordering::Release); + } } impl Executor for Win32Executor { @@ -378,6 +446,84 @@ impl Executor for Win32Executor { } } } + + /// The batch on its own thread, after the one before it: the book is copied out, worked on with no lock held while + /// the system is called, and put back. Each target comes back as a TuneDone; when the thread cannot start, every + /// member comes back as Failed. + fn tune(&self, b: TuneBatch) { + let proxy = self.proxy(); + let failed: Vec = b + .targets + .iter() + .map(|t| TuneDone::Process { + row: t.row, + verb: b.verb, + members: t.members.iter().map(|&k| (k, TuneOutcome::Failed(NOT_ENOUGH_MEMORY))).collect(), + }) + .collect(); + let (book, turn, root, to_ui) = + (Arc::clone(&self.book), Arc::clone(&self.tune_turn), self.system_root.clone(), proxy.clone()); + let spawned = std::thread::Builder::new().name("tasks-act".into()).stack_size(TUNE_STACK).spawn(move || { + let _turn = turn.lock().unwrap_or_else(|e| e.into_inner()); + let mut work = book.lock().unwrap_or_else(|e| e.into_inner()).clone(); + let done = tune::run(&mut tune::Win32Tune::new(), &b, &mut work, &root); + *book.lock().unwrap_or_else(|e| e.into_inner()) = work; + let (mut keys, mut made) = (0usize, 0usize); + for d in &done { + if let TuneDone::Process { members, .. } = d { + keys += members.len(); + made += members.iter().filter(|m| matches!(m.1, TuneOutcome::Done(_))).count(); + } + } + oled_sys::log!("tasks: tune {:?}: {keys} keys, {made} done", b.verb); + if let Some(p) = to_ui { + for d in done { + let _ = p.send(Box::new(d)); + } + } + }); + if let Err(e) = spawned { + oled_sys::log!("tasks: no act thread ({e})"); + if let Some(p) = proxy { + for d in failed { + let _ = p.send(Box::new(d)); + } + } + } + } + + /// The restart on its own thread; a second one while it runs is refused as Busy. Its outcome comes back as a + /// TuneDone::Explorer. + fn restart_explorer(&self, r: RestartReq) { + let proxy = self.proxy(); + let row = r.row; + let send = move |p: Option, outcome: RestartOutcome| { + if let Some(p) = p { + let _ = p.send(Box::new(TuneDone::Explorer { row, outcome })); + } + }; + if self.restarting.swap(true, Ordering::AcqRel) { + send(proxy, RestartOutcome::Refused(RestartRefusal::Busy)); + return; + } + let flag = Restarting(Arc::clone(&self.restarting)); + let (root, to_ui) = (self.system_root.clone(), proxy.clone()); + let spawned = std::thread::Builder::new().name("tasks-act".into()).stack_size(TUNE_STACK).spawn(move || { + let outcome = tune::restart(&mut tune::Win32Shell::new(), &r, &root); + drop(flag); + oled_sys::log!("tasks: restart of the shell: {outcome:?}"); + send(to_ui, outcome); + }); + if let Err(e) = spawned { + oled_sys::log!("tasks: no act thread ({e})"); + self.restarting.store(false, Ordering::Release); + send(proxy, RestartOutcome::Failed(NOT_ENOUGH_MEMORY)); + } + } + + fn undo_entry(&self, key: ProcKey) -> Option { + self.book.lock().unwrap_or_else(|e| e.into_inner()).get(key).copied() + } } /// The Windows folder (GetSystemWindowsDirectoryW); empty when it cannot be read (then no path counts as under it, diff --git a/apps/tasks/src/app/exec/tune.rs b/apps/tasks/src/app/exec/tune.rs new file mode 100644 index 00000000..d8876d11 --- /dev/null +++ b/apps/tasks/src/app/exec/tune.rs @@ -0,0 +1,960 @@ +//! Priority, efficiency mode and their undo, and the restart of Windows Explorer: a pure core over two seams (TuneOs for +//! one process, ShellOs for the shell) so tests drive every rule with fakes; the Win32 forms run only on a 'tasks-act' +//! thread (exec.rs). Tempo reale is never set: PriorityClass, the only level a change can name, has no such value, and a +//! process found at it is shown and never changed. Every change is checked by its key alone before anything is opened, +//! then again on fresh facts read through a new handle just before it is made, and recorded in this session's undo +//! book so the same menu can put back what the process had. + +use std::collections::{HashMap, HashSet}; +use std::time::{Duration, Instant}; + +use oled_sys::admin::policy::{check_target, HelperFacts, TargetFacts, TargetVerb}; +use oled_sys::pipe::{current_user_sid, user_sid_of_pid, Integrity}; +use oled_sysmon::{ProcKey, ProcTable, SnapshotReader}; +use oled_trust::frame::admin::DenyReason; +pub use oled_trust::frame::admin::PriorityClass; +use oled_ui::model::RowKey; +use windows::core::{HSTRING, PCWSTR, PWSTR}; +use windows::Win32::Foundation::{CloseHandle, GetLastError, FILETIME, WAIT_OBJECT_0}; +use windows::Win32::System::SystemInformation::GetSystemTimeAsFileTime; +use windows::Win32::System::Threading::{ + CreateProcessW, GetPriorityClass, GetProcessInformation, OpenProcess, ProcessPowerThrottling, + ProcessProtectionLevelInfo, SetPriorityClass, SetProcessInformation, WaitForSingleObject, + ABOVE_NORMAL_PRIORITY_CLASS, BELOW_NORMAL_PRIORITY_CLASS, CREATE_NO_WINDOW, HIGH_PRIORITY_CLASS, + IDLE_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, PROCESS_ACCESS_RIGHTS, PROCESS_CREATION_FLAGS, PROCESS_INFORMATION, + PROCESS_POWER_THROTTLING_CURRENT_VERSION, PROCESS_POWER_THROTTLING_EXECUTION_SPEED, PROCESS_POWER_THROTTLING_STATE, + PROCESS_PROTECTION_LEVEL_INFORMATION, PROCESS_QUERY_LIMITED_INFORMATION, PROCESS_SET_INFORMATION, + PROCESS_SYNCHRONIZE, PROCESS_TERMINATE, PROTECTION_LEVEL_NONE, REALTIME_PRIORITY_CLASS, STARTUPINFOW, +}; +use windows::Win32::UI::WindowsAndMessaging::GetShellWindow; + +use super::{handle, thread_pid, KillGuard, Os, OsHandle, Win32Os, INVALID_PARAMETER}; +use crate::app::access::{self, MemberFacts, Prober, Refusal, Win32Prober, ACCESS_DENIED}; +use crate::model::classify::{never_suspend, path_class, PathClass, SuspendBlock}; + +/// ERROR_INVALID_DATA: a priority class outside the six Windows defines. +pub const INVALID_DATA: u32 = 13; +/// WAIT_TIMEOUT: the old shell's window still stands after the wait (its process never ended). +pub const WAIT_TIMEOUT: u32 = 258; +/// The most processes the undo book holds; a change to one more is refused (every change stays undoable). +pub const BOOK_CAP: usize = 1024; +/// How long Windows has to bring a shell window back after the old shell ended. +pub const RESTART_WAIT_MS: u64 = 5_000; +/// How much longer a new explorer.exe that Windows started has to make its window before nothing more is done. +pub const RESTART_SLOW_MS: u64 = 10_000; +/// How often the shell window is looked for while waiting. +pub const RESTART_POLL_MS: u32 = 100; +/// How long the old shell has to exit once it was ended (part of the wait). +const EXIT_WAIT_MS: u32 = 2_000; + +/// A priority class as Windows reports it: one of the five levels Tasks can set, or Tempo reale, which it only shows. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum Class { + Level(PriorityClass), + Realtime, +} + +impl Class { + /// GetPriorityClass's value; None for 0 (the call failed) and any value outside the six classes. + pub fn from_win32(v: u32) -> Option { + let level = |l| Some(Class::Level(l)); + match v { + x if x == IDLE_PRIORITY_CLASS.0 => level(PriorityClass::Idle), + x if x == BELOW_NORMAL_PRIORITY_CLASS.0 => level(PriorityClass::BelowNormal), + x if x == NORMAL_PRIORITY_CLASS.0 => level(PriorityClass::Normal), + x if x == ABOVE_NORMAL_PRIORITY_CLASS.0 => level(PriorityClass::AboveNormal), + x if x == HIGH_PRIORITY_CLASS.0 => level(PriorityClass::High), + x if x == REALTIME_PRIORITY_CLASS.0 => Some(Class::Realtime), + _ => None, + } + } +} + +/// The value SetPriorityClass takes for a level; never REALTIME_PRIORITY_CLASS, which no level maps to. +pub fn win32_class(l: PriorityClass) -> u32 { + match l { + PriorityClass::Idle => IDLE_PRIORITY_CLASS.0, + PriorityClass::BelowNormal => BELOW_NORMAL_PRIORITY_CLASS.0, + PriorityClass::Normal => NORMAL_PRIORITY_CLASS.0, + PriorityClass::AboveNormal => ABOVE_NORMAL_PRIORITY_CLASS.0, + PriorityClass::High => HIGH_PRIORITY_CLASS.0, + } +} + +/// The execution-speed part of a process's power throttling (ProcessPowerThrottling). +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum Throttle { + /// Windows decides (the bit is not in the control mask): how every process starts. + Auto, + /// Throttled (EcoQoS): efficiency mode. + On, + /// Never throttled. + Off, +} + +impl Throttle { + /// The state of the execution-speed bit in a PROCESS_POWER_THROTTLING_STATE's masks. + pub fn of_masks(control: u32, state: u32) -> Throttle { + let bit = PROCESS_POWER_THROTTLING_EXECUTION_SPEED; + match (control & bit != 0, state & bit != 0) { + (false, _) => Throttle::Auto, + (true, true) => Throttle::On, + (true, false) => Throttle::Off, + } + } + + /// The masks with the execution-speed bit set to this state and every other bit as it was. + pub fn into_masks(self, control: u32, state: u32) -> (u32, u32) { + let bit = PROCESS_POWER_THROTTLING_EXECUTION_SPEED; + match self { + Throttle::Auto => (control & !bit, state & !bit), + Throttle::On => (control | bit, state | bit), + Throttle::Off => (control | bit, state & !bit), + } + } +} + +/// What a process runs at now. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct Reading { + pub class: Class, + /// None when Windows does not say. + pub throttle: Option, +} + +impl Reading { + /// Efficiency mode: throttled (EcoQoS); None when the throttling cannot be read. + pub fn efficiency(&self) -> Option { + self.throttle.map(|t| t == Throttle::On) + } +} + +/// A class and a throttling to put back. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub struct Tuning { + pub class: PriorityClass, + pub throttle: Throttle, +} + +/// What this session changed on one process. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct UndoEntry { + /// The class and the throttling before this session's first change: what Restore puts back. A throttling that + /// could not be read counts as Auto, the state every process starts in. + pub first: Tuning, + /// The class efficiency mode off puts back: the one before this session turned it on, or the level chosen while + /// it was on; None when this session has not turned it on (off then sets Normal). + pub before_efficiency: Option, +} + +impl UndoEntry { + /// This session put the process in efficiency mode and has not taken it out. + pub fn efficiency(&self) -> bool { + self.before_efficiency.is_some() + } +} + +/// This session's changes, by key: a pid reused by another process is another key and finds nothing here. Entries +/// die with their process (each batch drops the ones that are gone) and when the process is back where it was. +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct UndoBook { + entries: HashMap, +} + +impl UndoBook { + pub fn get(&self, key: ProcKey) -> Option<&UndoEntry> { + self.entries.get(&key) + } + + /// Sets or clears the entry of `key` (scenes and tests preset a book with it). + pub fn set(&mut self, key: ProcKey, entry: Option) { + match entry { + Some(e) => { + self.entries.insert(key, e); + } + None => { + self.entries.remove(&key); + } + } + } + + pub fn len(&self) -> usize { + self.entries.len() + } + + pub fn is_empty(&self) -> bool { + self.entries.is_empty() + } + + /// Keeps the entries whose process `alive` says still lives. + pub fn retain_live(&mut self, mut alive: impl FnMut(ProcKey) -> bool) { + self.entries.retain(|k, _| alive(*k)); + } + + fn full(&self) -> bool { + self.entries.len() >= BOOK_CAP + } +} + +/// What a tune batch does to each member. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum TuneVerb { + /// The class and the throttling, read; nothing is changed and no rule but the key's applies. + Read, + /// Sets the level (Bassa is PriorityClass::Idle). + Priority(PriorityClass), + /// On: throttled and the Idle class, as Windows' Task Manager does. Off: the throttling back to Auto and the class + /// of the undo book's before_efficiency, or Normal. + Efficiency(bool), + /// Puts back what the process had before this session's first change. + Restore, +} + +/// One row's part of a tune batch: the processes it acts on (a group's members, each judged on its own). +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct TuneTarget { + pub row: RowKey, + pub members: Vec, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct TuneBatch { + pub verb: TuneVerb, + pub targets: Vec, + /// The keys never changed, from the latest frame when the batch is made (access::guard). + pub guard: KillGuard, +} + +/// Why a change is not made: typed for the UI's reason texts. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum TuneRefusal { + /// A rule the End commands share (the shell, Tasks and its ancestors, the dock, the idle and system processes, the + /// critical set, a protected process, needs administrator): its text is access::why's. + Rule(Refusal), + /// Another session's process, or another user's in this session ("Solo per i processi della tua sessione"). + NotYours, + /// A process the desktop, text input or sound needs (classify::never_suspend). + NeverTouch(SuspendBlock), + /// At Tempo reale: shown, never changed. + Realtime, + /// Restore when this session changed nothing on the process. + NothingToRestore, + /// The undo book holds BOOK_CAP processes already. + BookFull, +} + +/// One member's result. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum TuneOutcome { + /// Made (Read: read); what the process runs at now. + Done(Reading), + /// The key's process is gone (or its pid now names another process): nothing was changed. + Gone, + /// Windows refused the handle or the change: only an administrator may (an elevated process). + NeedsAdmin, + Refused(TuneRefusal), + /// The Win32 code; nothing was changed (a half-made change is taken back). + Failed(u32), +} + +/// A restart of Windows Explorer, asked for on the row of the shell. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct RestartReq { + pub row: RowKey, + /// The shell's key in the latest frame; it must still own the shell window when the restart runs. + pub shell: ProcKey, + pub guard: KillGuard, +} + +/// Why a restart was not started; nothing was ended. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum RestartRefusal { + /// The key is not the process of the shell window now, not explorer.exe of the Windows folder, or not the frame's + /// shell. + NotShell, + /// Tasks does not run at medium integrity: explorer.exe started by it would not run with the user's rights. + Elevated, + /// Another restart is running. + Busy, + /// A rule of the End commands (another session, the critical flag set or unknown, protected). + Rule(Refusal), +} + +/// What a restart did. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum RestartOutcome { + /// The shell ended and Windows brought a new shell window within RESTART_WAIT_MS. + Back, + /// The shell ended, no shell window came back in time and no explorer.exe was on its way: Tasks started + /// %SystemRoot%\explorer.exe. + Started, + /// The shell ended and the explorer.exe Windows started had no window yet after RESTART_SLOW_MS more: Tasks started + /// none (never two shells). + Slow, + /// Nothing was ended. + Refused(RestartRefusal), + /// The key's process is gone: nothing was ended. + Gone, + /// Windows refused to end it (an elevated shell): nothing was ended. + NeedsAdmin, + /// Ending it failed, or its window still stands after the wait (WAIT_TIMEOUT); nothing was started. + Failed(u32), + /// The shell ended, none came back and explorer.exe could not be started: the Win32 code. + NoShell(u32), +} + +/// AppMsg: what a tune batch or a restart did; the screen routes it to the band. +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum TuneDone { + /// One per target of a TuneBatch: each member's outcome, in member order, each key once. + Process { row: RowKey, verb: TuneVerb, members: Vec<(ProcKey, TuneOutcome)> }, + /// The restart of Windows Explorer. + Explorer { row: RowKey, outcome: RestartOutcome }, +} + +/// The system calls of a tune batch, behind a trait so the rules and their order run over a fake in tests +/// (tests/tune.rs); only an act thread uses Win32Tune. +pub trait TuneOs { + /// OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION), with PROCESS_SET_INFORMATION too when `set`; Err is the Win32 + /// code. + fn open(&mut self, pid: u32, set: bool) -> Result; + /// GetProcessTimes: the create time. + fn created(&mut self, h: OsHandle) -> Option; + /// ProcessIdToSessionId (the pid cannot be reused while a handle is open). + fn session(&mut self, pid: u32) -> Option; + /// QueryFullProcessImageNameW. + fn image_path(&mut self, h: OsHandle) -> Result; + /// IsProcessCritical. + fn critical(&mut self, h: OsHandle) -> Option; + /// GetProcessInformation(ProcessProtectionLevelInfo): a protection level other than none. + fn protected(&mut self, h: OsHandle) -> Option; + /// The process's token user is this process's user; None when it cannot be read. + fn same_user(&mut self, h: OsHandle, pid: u32) -> Option; + /// GetPriorityClass. + fn class(&mut self, h: OsHandle) -> Result; + /// GetProcessInformation(ProcessPowerThrottling). + fn throttle(&mut self, h: OsHandle) -> Result; + /// SetPriorityClass: a level, never Tempo reale. + fn set_class(&mut self, h: OsHandle, l: PriorityClass) -> Result<(), u32>; + /// SetProcessInformation(ProcessPowerThrottling), the execution-speed bit only. + fn set_throttle(&mut self, h: OsHandle, t: Throttle) -> Result<(), u32>; + /// CloseHandle. + fn close(&mut self, h: OsHandle); +} + +/// The rules a frame can decide, for both verbs that change a process: check_target SetPriority and SetEfficiency with +/// the guard's helper facts, then the shell, Tasks' ancestor chain and the never-touch list. The band and the row menu +/// ask before they offer a command; the act thread asks again on fresh facts (act_refusal). +pub fn refusal(t: &TargetFacts, g: &KillGuard) -> Option { + let policy = check_target(TargetVerb::SetPriority, t, &g.helper) + .and_then(|()| check_target(TargetVerb::SetEfficiency, t, &g.helper)); + match policy { + Err(DenyReason::OwnProcess) if g.shell == Some(t.key) => return Some(TuneRefusal::Rule(Refusal::Shell)), + Err(DenyReason::OtherSession) => return Some(TuneRefusal::NotYours), + Err(d) => return Some(TuneRefusal::Rule(Refusal::Deny(d))), + Ok(()) => {} + } + if g.shell == Some(t.key) { + return Some(TuneRefusal::Rule(Refusal::Shell)); + } + if g.own_chain.contains(&t.key) { + return Some(TuneRefusal::Rule(Refusal::Deny(DenyReason::OwnProcess))); + } + never_suspend(&t.image_name).map(TuneRefusal::NeverTouch) +} + +/// The menu's rule: refusal, then a process a medium process may not end (an elevated one: why.admin). +pub fn menu_refusal(f: &MemberFacts, g: &KillGuard) -> Option { + refusal(&f.target, g).or((!f.can_terminate).then_some(TuneRefusal::Rule(Refusal::Limited))) +} + +/// refusal on the fresh facts of the act thread, where a fact that cannot be read refuses: an unknown critical flag +/// as critical, an unknown user as another's (protected unknown is set as protected by the caller). +fn act_refusal(t: &TargetFacts, same_user: Option, g: &KillGuard) -> Option { + if let Some(r) = refusal(t, g) { + return Some(r); + } + if t.critical_flag != Some(false) { + return Some(TuneRefusal::Rule(Refusal::Deny(DenyReason::Critical))); + } + if same_user != Some(true) { + return Some(TuneRefusal::NotYours); + } + None +} + +/// A change worked out from what the process runs at now and the book's entry. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +struct Step { + class: PriorityClass, + /// None: the throttling is left as it is. + throttle: Option, + /// The book's entry after the change; None when nothing is left to put back. + entry: Option, +} + +/// The change `verb` makes on a process at `level` with `throttle`, given its book entry. The first state is kept from +/// the first change on; setting a level while this session's efficiency mode is on makes it the class off puts back. +/// Turning efficiency on over a process already throttled at Idle by something else keeps no earlier class (off sets +/// Normal). A change that brings the process back to its first state, efficiency off, leaves no entry. +fn plan( + verb: TuneVerb, + level: PriorityClass, + throttle: Option, + entry: Option, +) -> Result { + let first = entry.map_or(Tuning { class: level, throttle: throttle.unwrap_or(Throttle::Auto) }, |e| e.first); + let before = entry.and_then(|e| e.before_efficiency); + let (class, set, before) = match verb { + TuneVerb::Read => (level, None, before), + TuneVerb::Priority(l) => (l, None, before.map(|_| l)), + TuneVerb::Efficiency(true) => { + let already = throttle == Some(Throttle::On) && level == PriorityClass::Idle; + let earlier = if already { PriorityClass::Normal } else { level }; + (PriorityClass::Idle, Some(Throttle::On), Some(before.unwrap_or(earlier))) + } + TuneVerb::Efficiency(false) => (before.unwrap_or(PriorityClass::Normal), Some(Throttle::Auto), None), + TuneVerb::Restore => { + let e = entry.ok_or(TuneRefusal::NothingToRestore)?; + return Ok(Step { class: e.first.class, throttle: Some(e.first.throttle), entry: None }); + } + }; + let after = Tuning { class, throttle: set.or(throttle).unwrap_or(Throttle::Auto) }; + let entry = (after != first || before.is_some()).then_some(UndoEntry { first, before_efficiency: before }); + Ok(Step { class, throttle: set, entry }) +} + +fn open_error(code: u32) -> TuneOutcome { + match code { + ACCESS_DENIED => TuneOutcome::NeedsAdmin, + INVALID_PARAMETER => TuneOutcome::Gone, + code => TuneOutcome::Failed(code), + } +} + +fn read_now(os: &mut dyn TuneOs, h: OsHandle) -> Result { + let class = os.class(h)?; + Ok(Reading { class, throttle: os.throttle(h).ok() }) +} + +/// The class, then the throttling; when the throttling fails the class is put back, so a change is whole or not made. +fn apply(os: &mut dyn TuneOs, h: OsHandle, step: &Step, was: PriorityClass) -> Result<(), u32> { + os.set_class(h, step.class)?; + if let Some(t) = step.throttle { + if let Err(code) = os.set_throttle(h, t) { + let _ = os.set_class(h, was); + return Err(code); + } + } + Ok(()) +} + +/// One member: (1) the key alone, before anything is opened (a change only); (2) a fresh query handle, which holds +/// the pid for the rest: its create time (a mismatch is Gone), the reading, then for a change the facts and every +/// rule; (3) only then a second handle with PROCESS_SET_INFORMATION and the change. Every handle is closed on every +/// path; a key found gone loses its book entry. +fn tune_key( + os: &mut dyn TuneOs, + key: ProcKey, + verb: TuneVerb, + g: &KillGuard, + book: &mut UndoBook, + system_root: &str, +) -> TuneOutcome { + if verb != TuneVerb::Read { + if let Some(r) = access::key_refusal(key, g) { + return TuneOutcome::Refused(TuneRefusal::Rule(r)); + } + } + let q = match os.open(key.pid, false) { + Ok(h) => h, + Err(code) => return open_error(code), + }; + let out = judge_and_tune(os, q, key, verb, g, book, system_root); + os.close(q); + if out == TuneOutcome::Gone { + book.set(key, None); + } + out +} + +fn judge_and_tune( + os: &mut dyn TuneOs, + q: OsHandle, + key: ProcKey, + verb: TuneVerb, + g: &KillGuard, + book: &mut UndoBook, + system_root: &str, +) -> TuneOutcome { + let created = os.created(q); + if created != Some(key.created) { + return TuneOutcome::Gone; + } + let now = match read_now(os, q) { + Ok(r) => r, + Err(code) => return TuneOutcome::Failed(code), + }; + if verb == TuneVerb::Read { + return TuneOutcome::Done(now); + } + let path = match os.image_path(q) { + Ok(p) => p, + Err(code) => return TuneOutcome::Failed(code), + }; + let facts = TargetFacts { + key, + live_created: created, + // Unknown counts as session 0: refused. + session: os.session(key.pid).unwrap_or(0), + image_name: path.rsplit(['\\', '/']).next().unwrap_or_default().to_string(), + has_image_path: !path.is_empty(), + under_system_root: path_class(Some(&path), system_root) == PathClass::SystemRoot, + critical_flag: os.critical(q), + // Unknown counts as protected: refused. + protected: os.protected(q).unwrap_or(true), + hosts_reboot_service: false, + }; + if let Some(r) = act_refusal(&facts, os.same_user(q, key.pid), g) { + return TuneOutcome::Refused(r); + } + let Class::Level(level) = now.class else { return TuneOutcome::Refused(TuneRefusal::Realtime) }; + let entry = book.get(key).copied(); + let step = match plan(verb, level, now.throttle, entry) { + Ok(s) => s, + Err(r) => return TuneOutcome::Refused(r), + }; + if entry.is_none() && step.entry.is_some() && book.full() { + return TuneOutcome::Refused(TuneRefusal::BookFull); + } + let s = match os.open(key.pid, true) { + Ok(h) => h, + Err(code) => return open_error(code), + }; + // The query handle holds the pid, so this is the same process; its create time is read again all the same. + let applied = if os.created(s) == Some(key.created) { Some(apply(os, s, &step, level)) } else { None }; + os.close(s); + match applied { + None => return TuneOutcome::Gone, + Some(Err(code)) => return open_error(code), + Some(Ok(())) => {} + } + book.set(key, step.entry); + let planned = Reading { class: Class::Level(step.class), throttle: step.throttle.or(now.throttle) }; + TuneOutcome::Done(read_now(os, q).unwrap_or(planned)) +} + +/// Drops the book entries whose key no longer names a live process (gone, or its pid reused); a process Tasks may +/// not open keeps its entry. +fn prune(os: &mut dyn TuneOs, book: &mut UndoBook) { + book.retain_live(|key| match os.open(key.pid, false) { + Ok(h) => { + let same = os.created(h) == Some(key.created); + os.close(h); + same + } + Err(code) => code != INVALID_PARAMETER, + }); +} + +/// One tune batch, in target order: one TuneDone::Process per target, each member once. `book` is this session's; +/// the entries of processes that are gone are dropped first. `system_root` is the Windows folder. +pub fn run(os: &mut dyn TuneOs, b: &TuneBatch, book: &mut UndoBook, system_root: &str) -> Vec { + if b.verb != TuneVerb::Read { + prune(os, book); + } + b.targets + .iter() + .map(|t| { + let mut seen = HashSet::with_capacity(t.members.len()); + let members = t + .members + .iter() + .filter(|k| seen.insert(**k)) + .map(|&k| (k, tune_key(os, k, b.verb, &b.guard, book, system_root))) + .collect(); + TuneDone::Process { row: t.row, verb: b.verb, members } + }) + .collect() +} + +/// The system calls of a restart, behind a trait so its decision table runs over a fake with its own clock in tests +/// (tests/tune.rs). Only an act thread uses Win32Shell: no test ends or starts the real shell. +pub trait ShellOs { + /// The pid owning the shell window (GetShellWindow), None when there is none. + fn shell_pid(&mut self) -> Option; + /// OpenProcess(PROCESS_TERMINATE | PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_SYNCHRONIZE). + fn open(&mut self, pid: u32) -> Result; + fn created(&mut self, h: OsHandle) -> Option; + fn session(&mut self, pid: u32) -> Option; + fn image_path(&mut self, h: OsHandle) -> Result; + fn critical(&mut self, h: OsHandle) -> Option; + /// TerminateProcess(h, 1). + fn terminate(&mut self, h: OsHandle) -> Result<(), u32>; + /// Waits up to `ms` for the process to end; true when it has. + fn wait_exit(&mut self, h: OsHandle, ms: u32) -> bool; + fn close(&mut self, h: OsHandle); + /// Milliseconds of a monotonic clock. + fn now_ms(&mut self) -> u64; + fn sleep_ms(&mut self, ms: u32); + /// The system time as a create time is (100 ns since 1601). + fn system_time(&mut self) -> u64; + /// An explorer.exe whose image is `exe`, in `session`, created after `since`: one Windows started. + fn explorer_since(&mut self, exe: &str, since: u64, session: u32) -> bool; + /// CreateProcessW(exe) with this process's token. + fn start_explorer(&mut self, exe: &str) -> Result<(), u32>; + /// The integrity level Tasks runs at. + fn own_level(&mut self) -> Option; +} + +/// Restart of Windows Explorer, only for the shell: the frame's shell key, still owning the shell window, its image +/// %SystemRoot%\explorer.exe, this session, and the End rules but the parent one (Tasks started from the desktop is +/// the shell's child, and ending the shell does not end it). Tasks must run at medium so that an explorer.exe it starts +/// has the user's rights. Then: end it, wait up to RESTART_WAIT_MS for Windows to bring a new shell window; when none +/// comes and Windows has started no explorer.exe meanwhile, look once more and start %SystemRoot%\explorer.exe; when +/// Windows has started one, wait RESTART_SLOW_MS more for its window and start nothing (never two shells). +pub fn restart(os: &mut dyn ShellOs, r: &RestartReq, system_root: &str) -> RestartOutcome { + if r.guard.shell != Some(r.shell) { + return RestartOutcome::Refused(RestartRefusal::NotShell); + } + let root = system_root.trim_end_matches('\\'); + if root.is_empty() { + return RestartOutcome::Refused(RestartRefusal::NotShell); + } + if os.own_level() != Some(Integrity::Medium) { + return RestartOutcome::Refused(RestartRefusal::Elevated); + } + let h = match os.open(r.shell.pid) { + Ok(h) => h, + Err(ACCESS_DENIED) => return RestartOutcome::NeedsAdmin, + Err(INVALID_PARAMETER) => return RestartOutcome::Gone, + Err(code) => return RestartOutcome::Failed(code), + }; + let out = end_and_wait(os, h, r, &format!("{root}\\explorer.exe")); + os.close(h); + out +} + +fn end_and_wait(os: &mut dyn ShellOs, h: OsHandle, r: &RestartReq, explorer: &str) -> RestartOutcome { + let key = r.shell; + if os.created(h) != Some(key.created) { + return RestartOutcome::Gone; + } + if os.shell_pid() != Some(key.pid) { + return RestartOutcome::Refused(RestartRefusal::NotShell); + } + let path = match os.image_path(h) { + Ok(p) => p, + Err(code) => return RestartOutcome::Failed(code), + }; + if !path.eq_ignore_ascii_case(explorer) { + return RestartOutcome::Refused(RestartRefusal::NotShell); + } + let session = os.session(key.pid).unwrap_or(0); + let facts = TargetFacts { + key, + live_created: Some(key.created), + session, + image_name: "explorer.exe".to_string(), + has_image_path: true, + under_system_root: true, + critical_flag: os.critical(h), + protected: false, + hosts_reboot_service: false, + }; + let helper = HelperFacts { parent: ProcKey { pid: 0, created: 0 }, ..r.guard.helper }; + if let Err(d) = check_target(TargetVerb::Terminate, &facts, &helper) { + return RestartOutcome::Refused(RestartRefusal::Rule(Refusal::Deny(d))); + } + if facts.critical_flag != Some(false) { + return RestartOutcome::Refused(RestartRefusal::Rule(Refusal::Deny(DenyReason::Critical))); + } + let since = os.system_time(); + match os.terminate(h) { + Ok(()) => {} + Err(ACCESS_DENIED) => return RestartOutcome::NeedsAdmin, + Err(code) => return RestartOutcome::Failed(code), + } + // From here the shell is ended: the outcome says what took its place. The handle stays open, so the old pid is + // never reused meanwhile and a shell window of another pid is a new shell. + let _ = os.wait_exit(h, EXIT_WAIT_MS); + let deadline = os.now_ms() + RESTART_WAIT_MS; + if shell_back(os, key.pid, deadline) { + return RestartOutcome::Back; + } + if os.explorer_since(explorer, since, session) { + let deadline = os.now_ms() + RESTART_SLOW_MS; + return if shell_back(os, key.pid, deadline) { RestartOutcome::Back } else { RestartOutcome::Slow }; + } + match os.shell_pid() { + Some(p) if p != key.pid => RestartOutcome::Back, + Some(_) => RestartOutcome::Failed(WAIT_TIMEOUT), + None => match os.start_explorer(explorer) { + Ok(()) => RestartOutcome::Started, + Err(code) => RestartOutcome::NoShell(code), + }, + } +} + +/// Looks for a shell window of a pid other than `old` every RESTART_POLL_MS until `deadline`. +fn shell_back(os: &mut dyn ShellOs, old: u32, deadline: u64) -> bool { + loop { + if os.shell_pid().is_some_and(|p| p != old) { + return true; + } + if os.now_ms() >= deadline { + return false; + } + os.sleep_ms(RESTART_POLL_MS); + } +} + +/// The system's TuneOs; only an act thread uses it (and the tests, on a testee child they started). +pub struct Win32Tune { + own_sid: Option, +} + +impl Win32Tune { + /// Reads this process's user once for the batch. + pub fn new() -> Win32Tune { + Win32Tune { own_sid: current_user_sid().ok() } + } +} + +impl Default for Win32Tune { + fn default() -> Self { + Win32Tune::new() + } +} + +/// The last Win32 error of this thread. +fn last_error() -> u32 { + // SAFETY: no arguments; reads this thread's last-error value. + unsafe { GetLastError() }.0 +} + +/// The throttling masks of an open process. +fn throttle_masks(h: OsHandle) -> Result<(u32, u32), u32> { + let mut st = + PROCESS_POWER_THROTTLING_STATE { Version: PROCESS_POWER_THROTTLING_CURRENT_VERSION, ..Default::default() }; + let size = std::mem::size_of::() as u32; + let p = (&mut st as *mut PROCESS_POWER_THROTTLING_STATE).cast(); + // SAFETY: st is a local of the size passed; h is an open process handle. + unsafe { GetProcessInformation(handle(h), ProcessPowerThrottling, p, size) }.map_err(|e| access::win32_code(&e))?; + Ok((st.ControlMask, st.StateMask)) +} + +impl TuneOs for Win32Tune { + fn open(&mut self, pid: u32, set: bool) -> Result { + let set_right = if set { PROCESS_SET_INFORMATION } else { PROCESS_ACCESS_RIGHTS(0) }; + let rights = PROCESS_QUERY_LIMITED_INFORMATION | set_right; + // SAFETY: OpenProcess takes no pointers; tune_key closes the handle on every path. + match unsafe { OpenProcess(rights, false, pid) } { + Ok(h) => Ok(OsHandle(h.0 as isize)), + Err(e) => Err(access::win32_code(&e)), + } + } + + fn created(&mut self, h: OsHandle) -> Option { + access::creation_time(handle(h)) + } + + fn session(&mut self, pid: u32) -> Option { + Win32Os.session(pid) + } + + fn image_path(&mut self, h: OsHandle) -> Result { + Win32Os.image_path(h) + } + + fn critical(&mut self, h: OsHandle) -> Option { + Win32Os.critical(h) + } + + fn protected(&mut self, h: OsHandle) -> Option { + let mut info = PROCESS_PROTECTION_LEVEL_INFORMATION::default(); + let size = std::mem::size_of::() as u32; + let p = (&mut info as *mut PROCESS_PROTECTION_LEVEL_INFORMATION).cast(); + // SAFETY: info is a local of the size passed; h is an open process handle. + unsafe { GetProcessInformation(handle(h), ProcessProtectionLevelInfo, p, size) }.ok()?; + Some(info.ProtectionLevel != PROTECTION_LEVEL_NONE) + } + + fn same_user(&mut self, _h: OsHandle, pid: u32) -> Option { + // The caller's open handle holds the pid, so this reads the same process. + let own = self.own_sid.as_deref()?; + user_sid_of_pid(pid).ok().map(|sid| sid == own) + } + + fn class(&mut self, h: OsHandle) -> Result { + // SAFETY: h is an open process handle. + match unsafe { GetPriorityClass(handle(h)) } { + 0 => Err(last_error()), + v => Class::from_win32(v).ok_or(INVALID_DATA), + } + } + + fn throttle(&mut self, h: OsHandle) -> Result { + throttle_masks(h).map(|(c, s)| Throttle::of_masks(c, s)) + } + + fn set_class(&mut self, h: OsHandle, l: PriorityClass) -> Result<(), u32> { + // SAFETY: h is an open handle with PROCESS_SET_INFORMATION whose rules were checked just now. + unsafe { SetPriorityClass(handle(h), PROCESS_CREATION_FLAGS(win32_class(l))) } + .map_err(|e| access::win32_code(&e)) + } + + fn set_throttle(&mut self, h: OsHandle, t: Throttle) -> Result<(), u32> { + // Every bit but execution speed stays as it was (as Windows reports it; none when it cannot be read). + let (control, state) = throttle_masks(h).unwrap_or((0, 0)); + let (control, state) = t.into_masks(control, state); + let st = PROCESS_POWER_THROTTLING_STATE { + Version: PROCESS_POWER_THROTTLING_CURRENT_VERSION, + ControlMask: control, + StateMask: state, + }; + let size = std::mem::size_of::() as u32; + let p = (&st as *const PROCESS_POWER_THROTTLING_STATE).cast(); + // SAFETY: st is a local of the size passed; h is an open handle with PROCESS_SET_INFORMATION. + unsafe { SetProcessInformation(handle(h), ProcessPowerThrottling, p, size) }.map_err(|e| access::win32_code(&e)) + } + + fn close(&mut self, h: OsHandle) { + access::close(handle(h)); + } +} + +/// The system's ShellOs; only the act thread of a restart uses it. +pub(super) struct Win32Shell { + start: Instant, +} + +impl Win32Shell { + pub(super) fn new() -> Win32Shell { + Win32Shell { start: Instant::now() } + } +} + +impl ShellOs for Win32Shell { + fn shell_pid(&mut self) -> Option { + // SAFETY: GetShellWindow takes nothing. + let w = unsafe { GetShellWindow() }; + if w.0.is_null() { + None + } else { + thread_pid(w) + } + } + + fn open(&mut self, pid: u32) -> Result { + let rights = PROCESS_TERMINATE | PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_SYNCHRONIZE; + // SAFETY: OpenProcess takes no pointers; restart closes the handle on every path. + match unsafe { OpenProcess(rights, false, pid) } { + Ok(h) => Ok(OsHandle(h.0 as isize)), + Err(e) => Err(access::win32_code(&e)), + } + } + + fn created(&mut self, h: OsHandle) -> Option { + access::creation_time(handle(h)) + } + + fn session(&mut self, pid: u32) -> Option { + Win32Os.session(pid) + } + + fn image_path(&mut self, h: OsHandle) -> Result { + Win32Os.image_path(h) + } + + fn critical(&mut self, h: OsHandle) -> Option { + Win32Os.critical(h) + } + + fn terminate(&mut self, h: OsHandle) -> Result<(), u32> { + Win32Os.terminate(h) + } + + fn wait_exit(&mut self, h: OsHandle, ms: u32) -> bool { + // SAFETY: h is an open handle with SYNCHRONIZE. + let r = unsafe { WaitForSingleObject(handle(h), ms) }; + r == WAIT_OBJECT_0 + } + + fn close(&mut self, h: OsHandle) { + access::close(handle(h)); + } + + fn now_ms(&mut self) -> u64 { + u64::try_from(self.start.elapsed().as_millis()).unwrap_or(u64::MAX) + } + + fn sleep_ms(&mut self, ms: u32) { + std::thread::sleep(Duration::from_millis(u64::from(ms))); + } + + fn system_time(&mut self) -> u64 { + // SAFETY: no arguments; returns the time by value. + let t: FILETIME = unsafe { GetSystemTimeAsFileTime() }; + (u64::from(t.dwHighDateTime) << 32) | u64::from(t.dwLowDateTime) + } + + fn explorer_since(&mut self, exe: &str, since: u64, session: u32) -> bool { + let mut t = ProcTable::new(); + if SnapshotReader::new().read(&mut t).is_err() { + return false; + } + let candidates: Vec = t + .rows + .iter() + .filter(|r| r.session == session && r.key.created > since) + .filter(|r| t.names.to_string_lossy(r.image).eq_ignore_ascii_case("explorer.exe")) + .map(|r| r.key) + .collect(); + candidates.into_iter().any(|key| { + let mut q = Win32Tune { own_sid: None }; + let Ok(h) = TuneOs::open(&mut q, key.pid, false) else { return false }; + let ours = q.created(h) == Some(key.created) && q.image_path(h).is_ok_and(|p| p.eq_ignore_ascii_case(exe)); + q.close(h); + ours + }) + } + + fn start_explorer(&mut self, exe: &str) -> Result<(), u32> { + let app = HSTRING::from(exe); + let dir = HSTRING::from(exe.rsplit_once('\\').map_or("", |(d, _)| d)); + // The command line is the quoted path alone; CreateProcessW may write into it, so it is a buffer of ours. + let mut line: Vec = + std::iter::once(u16::from(b'"')).chain(app.iter().copied()).chain([u16::from(b'"'), 0]).collect(); + let si = STARTUPINFOW { cb: std::mem::size_of::() as u32, ..Default::default() }; + let mut pi = PROCESS_INFORMATION::default(); + // CREATE_NO_WINDOW is ignored for a program of the windows subsystem (the shell is one): it is passed so that + // every process the suite starts carries it. + // SAFETY: app, dir and line are NUL-terminated and live for the call; si and pi are valid for it. + unsafe { + CreateProcessW( + PCWSTR(app.as_ptr()), + Some(PWSTR(line.as_mut_ptr())), + None, + None, + false, + CREATE_NO_WINDOW, + None, + PCWSTR(dir.as_ptr()), + &si, + &mut pi, + ) + } + .map_err(|e| access::win32_code(&e))?; + // SAFETY: both handles came from the successful CreateProcessW above and are closed once. + unsafe { + let _ = CloseHandle(pi.hThread); + let _ = CloseHandle(pi.hProcess); + } + Ok(()) + } + + fn own_level(&mut self) -> Option { + Win32Prober.own_level() + } +} diff --git a/apps/tasks/src/app/launch.rs b/apps/tasks/src/app/launch.rs index 7af6feed..77773290 100644 --- a/apps/tasks/src/app/launch.rs +++ b/apps/tasks/src/app/launch.rs @@ -1,16 +1,34 @@ //! The only way UI code starts a process (house rule 1): Windows' Task Manager, a Reopen and the restart after an //! update go through a Launcher. app::main installs the Win32 one; every Harness test and scene records instead. +//! Folio and the browser get the user's rights whatever Tasks runs at (launch_route): a Tasks run as administrator +//! hands them to the desktop shell and never starts them with its own token. +use std::mem::ManuallyDrop; use std::path::{Path, PathBuf}; -use std::sync::Mutex; +use std::sync::{Arc, Mutex}; use oled_shellmodel::startmenu::system_dir; use oled_sys::pipe::Integrity; -use windows::core::{w, HSTRING, PCWSTR, PWSTR}; -use windows::Win32::Foundation::{CloseHandle, ERROR_PATH_NOT_FOUND}; +use oled_ui::host::Proxy; +use windows::core::{w, Interface, BSTR, HSTRING, PCWSTR, PWSTR}; +use windows::Win32::Foundation::{ + CloseHandle, ERROR_CALL_NOT_IMPLEMENTED, ERROR_FILE_NOT_FOUND, ERROR_NOT_ENOUGH_MEMORY, ERROR_PATH_NOT_FOUND, HWND, +}; +use windows::Win32::System::Com::{ + CoAllowSetForegroundWindow, CoCreateInstance, CoInitializeEx, CoTaskMemFree, CoUninitialize, IDispatch, + IServiceProvider, CLSCTX_INPROC_SERVER, CLSCTX_LOCAL_SERVER, COINIT_APARTMENTTHREADED, +}; use windows::Win32::System::Threading::{CreateProcessW, CREATE_NO_WINDOW, PROCESS_INFORMATION, STARTUPINFOW}; -use windows::Win32::UI::Shell::{ShellExecuteExW, SEE_MASK_FLAG_NO_UI, SEE_MASK_NOASYNC, SHELLEXECUTEINFOW}; -use windows::Win32::UI::WindowsAndMessaging::SW_SHOWNORMAL; +use windows::Win32::System::Variant::{VariantClear, VARIANT, VT_BSTR, VT_I4}; +use windows::Win32::UI::Shell::{ + FileOpenDialog, IFileOpenDialog, ILCreateFromPathW, ILFree, IShellBrowser, IShellDispatch2, IShellFolderViewDual, + IShellWindows, SHOpenFolderAndSelectItems, SID_STopLevelBrowser, ShellExecuteExW, ShellWindows, CSIDL_DESKTOP, + FOS_FILEMUSTEXIST, FOS_FORCEFILESYSTEM, SEE_MASK_DOENVSUBST, SEE_MASK_FLAG_NO_UI, SEE_MASK_INVOKEIDLIST, + SEE_MASK_NOASYNC, SHELLEXECUTEINFOW, SIGDN_FILESYSPATH, SVGIO_BACKGROUND, SWC_DESKTOP, SWFO_NEEDDISPATCH, +}; +use windows::Win32::UI::WindowsAndMessaging::{ + AllowSetForegroundWindow, GetWindowThreadProcessId, ASFW_ANY, SW_SHOWNORMAL, +}; use super::access::{Prober, Win32Prober}; @@ -21,12 +39,173 @@ pub trait Launcher: Send + Sync { fn open_taskmgr(&self) -> Result<(), u32>; /// ShellExecuteExW(launch, SEE_MASK_NOASYNC | SEE_MASK_FLAG_NO_UI); COM STA on the caller. fn open_launch(&self, launch: &str) -> Result<(), u32>; + /// Opens a web address in the default browser, on a click only. The act of the band's Search online: the real + /// launcher runs it off the UI thread and reports a failure as a LaunchFailed message; the default is open_launch. + /// The browser gets the user's rights only: the real launcher asks the shell from its own process only when Tasks + /// runs at medium (launch_route), and from any other level, or an unknown one, hands the address to the desktop + /// shell or starts nothing. + fn open_url(&self, url: &str) -> Result<(), u32> { + self.open_launch(url) + } /// CreateProcessW(current_exe, no arguments). fn restart_self(&self) -> Result<(), u32>; + + /// The Folio next to this Tasks: files.exe of an installed image (dock.exe, suite.json and files.exe beside + /// tasks.exe); None for any other Tasks, and by default. + fn files_beside(&self) -> Option { + None + } + /// Starts Folio on the folder of `file` with the file selected (files.exe --select : Folio takes one target). + /// The real launcher follows open_location's rule on the caller's thread (COM STA there). + fn start_files(&self, files: &Path, file: &Path) -> Result<(), u32> { + let _ = (files, file); + Err(ERROR_CALL_NOT_IMPLEMENTED.0) + } + /// Opens the folder of `file` in the shell's own window with the file selected (SHOpenFolderAndSelectItems). + fn select_in_shell(&self, file: &Path) -> Result<(), u32> { + let _ = file; + Err(ERROR_CALL_NOT_IMPLEMENTED.0) + } + /// Opens the folder of `file` with the file selected: in Folio when it sits beside this Tasks, else in the + /// shell's window. Tasks does not read the dock's settings, so the choice is the installed image's alone. + /// The real launcher starts Folio itself only when Tasks runs at medium (launch_route); from any other level, or + /// an unknown one, the desktop shell starts it with the user's rights, and when the desktop shell cannot, the + /// shell's own window opens instead: Tasks' administrator token never reaches Folio. + fn open_location(&self, file: &Path) -> Result<(), u32> { + file.parent().filter(|p| !p.as_os_str().is_empty()).ok_or(ERROR_PATH_NOT_FOUND.0)?; + match self.files_beside() { + Some(files) => self.start_files(&files, file), + None => self.select_in_shell(file), + } + } + /// The properties sheet of `file` (ShellExecuteExW, verb properties). + fn show_properties(&self, file: &Path) -> Result<(), u32> { + let _ = file; + Err(ERROR_CALL_NOT_IMPLEMENTED.0) + } + /// What Run new task was given: a program, a folder, a document or an address, started with ShellExecuteExW (verb + /// open) at Tasks' own level, never elevated. Called only after OK or Enter. A failure comes back as the code + /// or, for the real launcher, as a LaunchFailed message. + fn run_command(&self, text: &str) -> Result<(), u32> { + let _ = text; + Err(ERROR_CALL_NOT_IMPLEMENTED.0) + } + /// Run new task's "Browse...": the system's open-file dialog (no file-type filter) over the window `owner` (a + /// window handle, 0 for none). The choice comes back as a BrowseDone message. + fn browse_program(&self, owner: isize) -> Result<(), u32> { + let _ = owner; + Err(ERROR_CALL_NOT_IMPLEMENTED.0) + } +} + +/// AppMsg: the open-file dialog of Run new task ended; the path chosen, None when it was cancelled. +pub struct BrowseDone(pub Option); + +/// What Run new task hands to the shell: the file (a program, a folder, a document, an address) and its arguments. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct RunTarget { + pub file: String, + pub params: String, } -/// The real launcher; installed only by app::main. -pub struct Win32Launcher; +/// Splits what was typed into the file and its arguments, as the Run box does: a quoted start is the file up to the +/// closing quote; a text that names an existing path as a whole is that file; otherwise the first word is the file and +/// the rest its arguments. None for a blank text. `exists` tells whether a whole text is an existing path. +pub fn run_target(text: &str, exists: &dyn Fn(&str) -> bool) -> Option { + let text = text.trim(); + if text.is_empty() { + return None; + } + if let Some(rest) = text.strip_prefix('"') { + let (file, params) = rest.split_once('"').unwrap_or((rest, "")); + return (!file.trim().is_empty()) + .then(|| RunTarget { file: file.trim().to_string(), params: params.trim().to_string() }); + } + if !text.contains(char::is_whitespace) || exists(text) { + return Some(RunTarget { file: text.to_string(), params: String::new() }); + } + let (file, params) = text.split_once(char::is_whitespace).unwrap_or((text, "")); + Some(RunTarget { file: file.to_string(), params: params.trim().to_string() }) +} + +/// The text with each %NAME% replaced by `lookup` of NAME; a name it does not know stays as written. +pub fn expand_env(text: &str, lookup: &dyn Fn(&str) -> Option) -> String { + let mut out = String::with_capacity(text.len()); + let mut rest = text; + while let Some(start) = rest.find('%') { + out.push_str(&rest[..start]); + let after = &rest[start + 1..]; + match after.find('%') { + Some(end) if end > 0 && lookup(&after[..end]).is_some() => { + out.push_str(&lookup(&after[..end]).unwrap_or_default()); + rest = &after[end + 1..]; + } + _ => { + out.push('%'); + rest = after; + } + } + } + out.push_str(rest); + out +} + +/// AppMsg: an act that the real launcher ran off the UI thread failed with this code (the notice line says so). +pub struct LaunchFailed(pub u32); + +/// Runs `job` on a new "tasks-act" thread in a COM single-threaded apartment (the shell's folder, properties and +/// URL launches need one and may wait for the launch to end), then tells `report` the code of a failure. The thread +/// is returned for a test to join. +pub fn run_in_apartment( + job: impl FnOnce() -> Result<(), u32> + Send + 'static, + report: Arc, +) -> Option> { + let again = Arc::clone(&report); + let spawned = std::thread::Builder::new().name("tasks-act".into()).spawn(move || { + // SAFETY: paired with the CoUninitialize below when it succeeded; nothing else runs on this thread. + let com = unsafe { CoInitializeEx(None, COINIT_APARTMENTTHREADED) }.is_ok(); + if let Err(code) = job() { + report(code); + } + if com { + // SAFETY: this thread's CoInitializeEx succeeded above. + unsafe { CoUninitialize() }; + } + }); + match spawned { + Ok(h) => Some(h), + Err(e) => { + oled_sys::log!("tasks: no launch thread ({e})"); + again(ERROR_NOT_ENOUGH_MEMORY.0); + None + } + } +} + +/// The real launcher; installed only by app::main. The acts the band asks for (folder, properties, web search) run +/// off the UI thread; a failure comes back through the proxy. Folio and the browser start from Tasks' process only +/// on the Direct route (Tasks at medium); otherwise the desktop shell starts them (desktop_open), never Tasks' token. +#[derive(Default)] +pub struct Win32Launcher { + proxy: Mutex>, +} + +impl Win32Launcher { + /// app::main: the window's proxy, once there is a window. + pub fn attach(&self, p: Proxy) { + *self.proxy.lock().unwrap_or_else(|e| e.into_inner()) = Some(p); + } + + fn off_ui(&self, job: impl FnOnce() -> Result<(), u32> + Send + 'static) { + let proxy = self.proxy.lock().unwrap_or_else(|e| e.into_inner()).clone(); + let report: Arc = Arc::new(move |code| { + if let Some(p) = &proxy { + let _ = p.send(Box::new(LaunchFailed(code))); + } + }); + run_in_apartment(job, report); + } +} impl Launcher for Win32Launcher { fn open_taskmgr(&self) -> Result<(), u32> { @@ -40,20 +219,290 @@ impl Launcher for Win32Launcher { } fn open_launch(&self, launch: &str) -> Result<(), u32> { - shell_execute(&HSTRING::from(launch), None, SEE_MASK_NOASYNC | SEE_MASK_FLAG_NO_UI) + open_by_shell(launch) + } + + fn open_url(&self, url: &str) -> Result<(), u32> { + let url = HSTRING::from(url); + self.off_ui(move || match launch_route(Win32Prober.own_level()) { + Route::Direct => open_by_shell(&url.to_string()), + Route::DesktopShell => desktop_open(&url, None, None), + }); + Ok(()) + } + + fn run_command(&self, text: &str) -> Result<(), u32> { + let text = text.to_string(); + self.off_ui(move || run_by_shell(&text)); + Ok(()) + } + + fn browse_program(&self, owner: isize) -> Result<(), u32> { + let proxy = self.proxy.lock().unwrap_or_else(|e| e.into_inner()).clone(); + let spawned = std::thread::Builder::new().name("tasks-browse".into()).spawn(move || { + // SAFETY: paired with the CoUninitialize below when it succeeded; nothing else runs on this thread. + let com = unsafe { CoInitializeEx(None, COINIT_APARTMENTTHREADED) }.is_ok(); + let path = pick_file(owner); + if let Some(p) = &proxy { + let _ = p.send(Box::new(BrowseDone(path))); + } + if com { + // SAFETY: this thread's CoInitializeEx succeeded above. + unsafe { CoUninitialize() }; + } + }); + spawned.map(|_| ()).map_err(|_| ERROR_NOT_ENOUGH_MEMORY.0) + } + + fn open_location(&self, file: &Path) -> Result<(), u32> { + file.parent().filter(|p| !p.as_os_str().is_empty()).ok_or(ERROR_PATH_NOT_FOUND.0)?; + let (file, files) = (file.to_path_buf(), self.files_beside()); + self.off_ui(move || match (files, launch_route(Win32Prober.own_level())) { + (Some(files), Route::Direct) => start_files_at(&files, &file), + (Some(files), Route::DesktopShell) => files_through_desktop(&files, &file), + (None, _) => select_item(&file), + }); + Ok(()) + } + + fn show_properties(&self, file: &Path) -> Result<(), u32> { + let file = file.to_path_buf(); + self.off_ui(move || properties_of(&file)); + Ok(()) } fn restart_self(&self) -> Result<(), u32> { let exe = std::env::current_exe().map_err(|e| e.raw_os_error().map_or(1, |c| c as u32))?; create_process(&HSTRING::from(exe.as_os_str()), None) } + + fn files_beside(&self) -> Option { + let tasks = std::env::current_exe().ok()?; + files_beside_tasks(&tasks, &|p| p.is_file()) + } + + fn start_files(&self, files: &Path, file: &Path) -> Result<(), u32> { + match launch_route(Win32Prober.own_level()) { + Route::Direct => start_files_at(files, file), + Route::DesktopShell => files_through_desktop(files, file), + } + } + + fn select_in_shell(&self, file: &Path) -> Result<(), u32> { + select_item(file) + } +} + +/// Run new task: the text split into file and arguments, then ShellExecuteExW with the verb open (never runas: the +/// program starts at Tasks' own level; one that asks for more is asked by Windows), the person's folder as the working +/// directory, no UI on a failure. COM STA on the caller. +fn run_by_shell(text: &str) -> Result<(), u32> { + let env = |name: &str| std::env::var(name).ok(); + let target = run_target(text, &|p| Path::new(&expand_env(p, &env)).exists()).ok_or(ERROR_FILE_NOT_FOUND.0)?; + let file = HSTRING::from(target.file.as_str()); + let params = HSTRING::from(target.params.as_str()); + let dir = std::env::var_os("USERPROFILE").map(|d| HSTRING::from(d.to_string_lossy().as_ref())); + let mut sei = SHELLEXECUTEINFOW { + cbSize: std::mem::size_of::() as u32, + fMask: SEE_MASK_NOASYNC | SEE_MASK_FLAG_NO_UI | SEE_MASK_DOENVSUBST, + lpVerb: w!("open"), + lpFile: PCWSTR(file.as_ptr()), + lpParameters: if target.params.is_empty() { PCWSTR::null() } else { PCWSTR(params.as_ptr()) }, + lpDirectory: dir.as_ref().map_or(PCWSTR::null(), |d| PCWSTR(d.as_ptr())), + nShow: SW_SHOWNORMAL.0, + ..Default::default() + }; + // SAFETY: sei carries its cbSize; the strings (NUL-terminated HSTRINGs and a static) live for the call. + unsafe { ShellExecuteExW(&mut sei) }.map_err(|e| e.code().0 as u32) +} + +/// The open-file dialog over `owner`, files of the file system only, no file-type filter; the path chosen, None when +/// it was cancelled or could not be shown. COM STA on the caller. +fn pick_file(owner: isize) -> Option { + // SAFETY: plain COM calls on interfaces created here; the path string the dialog hands out is copied, then freed. + unsafe { + let dialog: IFileOpenDialog = CoCreateInstance(&FileOpenDialog, None, CLSCTX_INPROC_SERVER).ok()?; + let options = dialog.GetOptions().ok()?; + dialog.SetOptions(options | FOS_FORCEFILESYSTEM | FOS_FILEMUSTEXIST).ok()?; + dialog.Show(Some(HWND(owner as *mut core::ffi::c_void))).ok()?; + let item = dialog.GetResult().ok()?; + let name = item.GetDisplayName(SIGDN_FILESYSPATH).ok()?; + let path = name.to_string().ok(); + CoTaskMemFree(Some(name.0 as *const core::ffi::c_void)); + path + } +} + +/// ShellExecuteExW(launch) with the verb open, no UI on a failure; COM STA on the caller. +fn open_by_shell(launch: &str) -> Result<(), u32> { + shell_execute(&HSTRING::from(launch), None, SEE_MASK_NOASYNC | SEE_MASK_FLAG_NO_UI) +} + +/// files.exe on the file's folder with the file selected, in its own folder (never the file's, which a lingering Folio +/// would then hold open). +fn start_files_at(files: &Path, file: &Path) -> Result<(), u32> { + let line = format!("\"{}\" {}", files.display(), files_args(file)); + let dir = files.parent().map(|d| HSTRING::from(d.as_os_str())); + create_process_line(&HSTRING::from(files.as_os_str()), &line, dir.as_ref()) +} + +/// files.exe on the file's folder with the file selected, started by the desktop shell in its own folder (as +/// start_files_at), with the user's rights; when the desktop shell cannot start it, the shell's own window on the +/// file's folder, which Explorer opens at its own level. Never CreateProcessW. COM STA on the caller. +fn files_through_desktop(files: &Path, file: &Path) -> Result<(), u32> { + let dir = files.parent().map(|d| HSTRING::from(d.as_os_str())); + let args = HSTRING::from(files_args(file).as_str()); + desktop_open(&HSTRING::from(files.as_os_str()), Some(&args), dir.as_ref()).or_else(|code| { + oled_sys::log!("tasks: the desktop shell did not start Folio ({code:#010x}); the shell's window opens"); + select_item(file) + }) +} + +/// Starts `file` (a program or a web address) with `args`, in `dir` when given, through the desktop shell, so that +/// Explorer runs it with the user's rights and never with Tasks' token: IShellWindows::FindWindowSW(CSIDL_DESKTOP) -> +/// IServiceProvider::QueryService(SID_STopLevelBrowser) -> IShellBrowser::QueryActiveShellView -> +/// IShellView::GetItemObject(SVGIO_BACKGROUND) as IShellFolderViewDual -> Application as IShellDispatch2 -> +/// ShellExecute, verb open, SW_SHOWNORMAL. Explorer is first given the foreground right that Tasks holds from the +/// click, so the program opens in front. Err when the desktop shell cannot be reached or refuses. COM STA on the +/// caller. +fn desktop_open(file: &HSTRING, args: Option<&HSTRING>, dir: Option<&HSTRING>) -> Result<(), u32> { + let run = || -> windows::core::Result<()> { + // SAFETY: COM STA on the caller; every interface is used on this thread only and released when it goes out + // of scope; the VARIANTs given by pointer outlive the calls; hwnd is only read back as a window handle. + unsafe { + let windows: IShellWindows = CoCreateInstance(&ShellWindows, None, CLSCTX_LOCAL_SERVER)?; + let (loc, root) = (Arg::i4(CSIDL_DESKTOP as i32), Arg::empty()); + let mut hwnd = 0i32; + let desktop = windows.FindWindowSW(&loc.0, &root.0, SWC_DESKTOP, &mut hwnd, SWFO_NEEDDISPATCH)?; + let browser: IShellBrowser = desktop.cast::()?.QueryService(&SID_STopLevelBrowser)?; + let background: IDispatch = browser.QueryActiveShellView()?.GetItemObject(SVGIO_BACKGROUND)?; + let shell: IShellDispatch2 = background.cast::()?.Application()?.cast()?; + let mut explorer = 0u32; + GetWindowThreadProcessId(HWND(hwnd as isize as *mut core::ffi::c_void), Some(&mut explorer)); + if explorer == 0 || AllowSetForegroundWindow(explorer).is_err() { + let _ = AllowSetForegroundWindow(ASFW_ANY); + } + let _ = CoAllowSetForegroundWindow(&shell, None); + let (args, dir) = (Arg::opt_text(args), Arg::opt_text(dir)); + let (verb, show) = (Arg::text(&HSTRING::from("open")), Arg::i4(SW_SHOWNORMAL.0)); + shell.ShellExecute(&BSTR::from_wide(file), &args.0, &dir.0, &verb.0, &show.0) + } + }; + run().map_err(|e| e.code().0 as u32) +} + +/// A VARIANT argument of the desktop shell's automation calls, cleared (VariantClear) when it is dropped. +struct Arg(VARIANT); + +impl Arg { + /// VT_EMPTY: an optional argument left out. + fn empty() -> Self { + Arg(VARIANT::default()) + } + + fn i4(n: i32) -> Self { + let mut v = VARIANT::default(); + // SAFETY: v is a zeroed VARIANT (VT_EMPTY); the type tag and its union member are written together. + unsafe { + let inner = &mut *v.Anonymous.Anonymous; + inner.vt = VT_I4; + inner.Anonymous.lVal = n; + } + Arg(v) + } + + fn text(s: &HSTRING) -> Self { + let mut v = VARIANT::default(); + // SAFETY: as in i4; the BSTR belongs to the VARIANT, which VariantClear frees when it is dropped. + unsafe { + let inner = &mut *v.Anonymous.Anonymous; + inner.vt = VT_BSTR; + inner.Anonymous.bstrVal = ManuallyDrop::new(BSTR::from_wide(s)); + } + Arg(v) + } + + fn opt_text(s: Option<&HSTRING>) -> Self { + s.map_or_else(Self::empty, Self::text) + } +} + +impl Drop for Arg { + fn drop(&mut self) { + // SAFETY: self.0 is a VARIANT built by the constructors above and owned here. + let _ = unsafe { VariantClear(&mut self.0) }; + } +} + +/// The shell's window on the file's folder with the file selected; COM STA on the caller. +fn select_item(file: &Path) -> Result<(), u32> { + let wide = HSTRING::from(file.as_os_str()); + // SAFETY: wide is NUL-terminated and lives for the call; the item list it returns is freed once below. + let item = unsafe { ILCreateFromPathW(PCWSTR(wide.as_ptr())) }; + if item.is_null() { + return Err(ERROR_PATH_NOT_FOUND.0); + } + // SAFETY: item is a valid absolute item id list; a null folder with no children selects `item` in its folder. + let done = unsafe { SHOpenFolderAndSelectItems(item, None, 0) }; + // SAFETY: item came from ILCreateFromPathW and is freed exactly once. + unsafe { ILFree(Some(item)) }; + done.map_err(|e| e.code().0 as u32) +} + +/// The properties sheet of the file; COM STA on the caller, which waits until the sheet is up (SEE_MASK_NOASYNC). +fn properties_of(file: &Path) -> Result<(), u32> { + let wide = HSTRING::from(file.as_os_str()); + let mut sei = SHELLEXECUTEINFOW { + cbSize: std::mem::size_of::() as u32, + fMask: SEE_MASK_INVOKEIDLIST | SEE_MASK_NOASYNC, + lpVerb: w!("properties"), + lpFile: PCWSTR(wide.as_ptr()), + nShow: SW_SHOWNORMAL.0, + ..Default::default() + }; + // SAFETY: sei carries its cbSize; the strings (a NUL-terminated HSTRING and a static) live for the call. + unsafe { ShellExecuteExW(&mut sei) }.map_err(|e| e.code().0 as u32) +} + +/// files.exe beside `tasks`: only in an installed image (dock.exe and suite.json beside tasks.exe) that also holds +/// files.exe. `is_file` is the seam. +pub fn files_beside_tasks(tasks: &Path, is_file: &dyn Fn(&Path) -> bool) -> Option { + let dir = tasks.parent()?; + let installed = is_file(&dir.join("dock.exe")) && is_file(&dir.join("suite.json")); + let files = dir.join("files.exe"); + (installed && is_file(&files)).then_some(files) +} + +/// The arguments of files.exe for a file: --select and the file, quoted. Folio takes one target only and opens the +/// file's folder itself; a folder argument beside --select is refused (usage error). +pub fn files_args(file: &Path) -> String { + format!("--select \"{}\"", file.display()) +} + +/// The URL of a web search for `name` and `suffix`: the words percent-encoded as UTF-8. +pub fn search_url(name: &str, suffix: &str) -> String { + let words = format!("{name} {suffix}"); + let mut url = String::from("https://www.bing.com/search?q="); + for b in words.trim().bytes() { + if b.is_ascii_alphanumeric() || matches!(b, b'-' | b'_' | b'.' | b'~') { + url.push(char::from(b)); + } else { + url.push_str(&format!("%{b:02X}")); + } + } + url } /// CreateProcessW(app, no arguments) with `dir` as its working directory, or the caller's when None. fn create_process(app: &HSTRING, dir: Option<&HSTRING>) -> Result<(), u32> { - // The command line is the quoted path alone; CreateProcessW may write into it, so it is a buffer of ours. - let mut line: Vec = - std::iter::once(u16::from(b'"')).chain(app.iter().copied()).chain([u16::from(b'"'), 0]).collect(); + // The command line is the quoted path alone. + create_process_line(app, &format!("\"{app}\""), dir) +} + +/// CreateProcessW(app, line) with `dir` as its working directory, or the caller's when None. +fn create_process_line(app: &HSTRING, line: &str, dir: Option<&HSTRING>) -> Result<(), u32> { + // CreateProcessW may write into the command line, so it is a buffer of ours. + let mut line: Vec = line.encode_utf16().chain(std::iter::once(0)).collect(); let si = STARTUPINFOW { cb: std::mem::size_of::() as u32, ..Default::default() }; let mut pi = PROCESS_INFORMATION::default(); // CREATE_NO_WINDOW is ignored for a program of the windows subsystem (tasks.exe and Task Manager are): it is passed @@ -101,6 +550,25 @@ pub fn taskmgr_direct(own: Option) -> bool { matches!(own, Some(Integrity::High | Integrity::System)) } +/// How the real launcher starts Folio and the browser (Open file location, Search online). +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Route { + /// From Tasks' own process (CreateProcessW for Folio, ShellExecuteExW for an address): Tasks has the user's rights. + Direct, + /// Through the desktop shell (Explorer, at the user's medium level), never with Tasks' token. + DesktopShell, +} + +/// The route of a Tasks at `own`: Direct only at medium. A Tasks run as administrator (High), as System, below medium +/// or unable to read its level hands Folio and the browser to the desktop shell, for the reason the Explorer restart +/// is refused from it: what it starts itself carries its token, not the user's rights. +pub fn launch_route(own: Option) -> Route { + match own { + Some(Integrity::Medium) => Route::Direct, + _ => Route::DesktopShell, + } +} + /// ShellExecuteExW(file) with the verb open and SW_SHOWNORMAL, `dir` as its working directory when given. fn shell_execute(file: &HSTRING, dir: Option<&HSTRING>, mask: u32) -> Result<(), u32> { let mut sei = SHELLEXECUTEINFOW { @@ -122,12 +590,25 @@ pub enum LaunchReq { TaskMgr, Launch(String), RestartSelf, + /// files.exe started on the file's folder with the file selected: (files.exe, file). + FolioSelect(PathBuf, PathBuf), + /// The shell's own window opened on the file's folder with the file selected. + ShellSelect(PathBuf), + Properties(PathBuf), + /// Run new task was given this text (after OK or Enter). + Run(String), + /// Run new task's open-file dialog was asked for, over this window. + Browse(isize), } /// Records every request and starts nothing; returns Ok(()). Every test and scene uses it. #[derive(Default)] pub struct RecordingLauncher { pub reqs: Mutex>, + /// The Folio this launcher pretends sits beside Tasks (None: no installed image). + pub files: Mutex>, + /// The code run_command fails with (None: it succeeds). + pub run_result: Mutex>, } impl RecordingLauncher { @@ -151,12 +632,105 @@ impl Launcher for RecordingLauncher { self.push(LaunchReq::RestartSelf); Ok(()) } + + fn files_beside(&self) -> Option { + self.files.lock().unwrap_or_else(|p| p.into_inner()).clone() + } + + fn start_files(&self, files: &Path, file: &Path) -> Result<(), u32> { + self.push(LaunchReq::FolioSelect(files.to_path_buf(), file.to_path_buf())); + Ok(()) + } + + fn select_in_shell(&self, file: &Path) -> Result<(), u32> { + self.push(LaunchReq::ShellSelect(file.to_path_buf())); + Ok(()) + } + + fn show_properties(&self, file: &Path) -> Result<(), u32> { + self.push(LaunchReq::Properties(file.to_path_buf())); + Ok(()) + } + + fn run_command(&self, text: &str) -> Result<(), u32> { + self.push(LaunchReq::Run(text.to_string())); + self.run_result.lock().unwrap_or_else(|p| p.into_inner()).map_or(Ok(()), Err) + } + + fn browse_program(&self, owner: isize) -> Result<(), u32> { + self.push(LaunchReq::Browse(owner)); + Ok(()) + } } #[cfg(test)] mod tests { use super::*; + fn never(_: &str) -> bool { + false + } + + #[test] + fn run_text_splits_into_a_file_and_its_arguments() { + let t = |s: &str, exists: &dyn Fn(&str) -> bool| run_target(s, exists).map(|r| (r.file, r.params)); + assert_eq!(t("notepad", &never), Some(("notepad".into(), "".into()))); + assert_eq!(t(" cmd /k dir ", &never), Some(("cmd".into(), "/k dir".into()))); + assert_eq!( + t("\"C:\\Program Files\\A B\\a.exe\" -x 1", &never), + Some(("C:\\Program Files\\A B\\a.exe".into(), "-x 1".into())) + ); + assert_eq!(t("\"C:\\a b\\c.exe\"", &never), Some(("C:\\a b\\c.exe".into(), "".into()))); + let whole = |p: &str| p == "C:\\Program Files\\A B\\a.exe"; + assert_eq!( + t("C:\\Program Files\\A B\\a.exe", &whole), + Some(("C:\\Program Files\\A B\\a.exe".into(), "".into())) + ); + assert_eq!( + t("C:\\Program Files\\A B\\a.exe", &never), + Some(("C:\\Program".into(), "Files\\A B\\a.exe".into())) + ); + assert_eq!(t("https://example.com/a b", &never), Some(("https://example.com/a".into(), "b".into()))); + assert_eq!(t(" ", &never), None); + assert_eq!(t("\"\"", &never), None); + } + + #[test] + fn environment_names_expand_and_unknown_ones_stay() { + let look = |n: &str| (n == "TEMP").then(|| "C:\\T".to_string()); + assert_eq!(expand_env("%TEMP%\\x.exe", &look), "C:\\T\\x.exe"); + assert_eq!(expand_env("%NOPE%\\x", &look), "%NOPE%\\x"); + assert_eq!(expand_env("100%", &look), "100%"); + assert_eq!(expand_env("a%%b", &look), "a%%b"); + } + + #[test] + fn run_new_task_never_elevates() { + let src = include_str!("launch.rs").replace("\r\n", "\n"); + let body = &src[src.find("fn run_by_shell(").unwrap()..]; + let body = &body[..body.find("\n}\n").unwrap()]; + let verb = ["run", "as"].concat(); + assert!(!body.contains(verb.as_str()), "no elevating verb"); + assert!(body.contains("w!(\"open\")"), "the verb is open"); + let default = + &src[src.find("fn run_command(&self, text: &str) -> Result<(), u32> {\n let _ = text;").unwrap()..]; + assert!(default[..200].contains("ERROR_CALL_NOT_IMPLEMENTED"), "a launcher that does not say starts nothing"); + } + + #[test] + fn the_recording_launcher_records_a_run_and_a_browse_and_starts_nothing() { + let l = RecordingLauncher::default(); + assert_eq!(l.run_command("notepad x.txt"), Ok(())); + assert_eq!(l.browse_program(7), Ok(())); + *l.run_result.lock().unwrap() = Some(2); + assert_eq!(l.run_command("nope"), Err(2)); + let reqs = l.reqs.lock().unwrap().clone(); + assert_eq!( + reqs, + vec![LaunchReq::Run("notepad x.txt".into()), LaunchReq::Browse(7), LaunchReq::Run("nope".into())] + ); + } + #[test] fn recording_launcher_records_in_order() { let l = RecordingLauncher::default(); @@ -170,6 +744,91 @@ mod tests { ); } + /// The location opens in Folio only from an installed image that holds files.exe, else in the shell's window; + /// either way once, on the file's folder. + #[test] + fn the_location_opens_in_folio_beside_tasks_else_in_the_shell() { + let file = Path::new(r"C:\Apps\Ember\ember.exe"); + let l = RecordingLauncher::default(); + assert_eq!(l.open_location(file), Ok(())); + *l.files.lock().unwrap() = Some(PathBuf::from(r"C:\Suite\files.exe")); + assert_eq!(l.open_location(file), Ok(())); + let reqs = l.reqs.lock().unwrap().clone(); + assert_eq!( + reqs, + [ + LaunchReq::ShellSelect(file.to_path_buf()), + LaunchReq::FolioSelect(PathBuf::from(r"C:\Suite\files.exe"), file.to_path_buf()), + ] + ); + assert_eq!(l.open_location(Path::new("ember.exe")), Err(ERROR_PATH_NOT_FOUND.0), "no folder, nothing opens"); + } + + /// Folio is beside Tasks only in an installed image that has files.exe. + #[test] + fn folio_is_beside_tasks_only_in_an_installed_image() { + let tasks = Path::new(r"C:\Suite\tasks.exe"); + let has = + |names: &'static [&'static str]| move |p: &Path| names.iter().any(|n| p == Path::new(r"C:\Suite").join(n)); + let all = has(&["dock.exe", "suite.json", "files.exe"]); + assert_eq!(files_beside_tasks(tasks, &all), Some(PathBuf::from(r"C:\Suite\files.exe"))); + assert_eq!(files_beside_tasks(tasks, &has(&["dock.exe", "files.exe"])), None, "no suite.json"); + assert_eq!(files_beside_tasks(tasks, &has(&["suite.json", "files.exe"])), None, "no dock.exe"); + assert_eq!(files_beside_tasks(tasks, &has(&["dock.exe", "suite.json"])), None, "no files.exe"); + } + + /// Folio gets the file alone after --select, quoted: it takes one target only and opens the file's folder with the + /// file selected. A file in a drive root has no folder argument whose closing backslash would escape its quote. + #[test] + fn folio_is_given_the_file_alone() { + assert_eq!(files_args(Path::new(r"C:\My Apps\Ember Pro.exe")), r#"--select "C:\My Apps\Ember Pro.exe""#); + assert_eq!(files_args(Path::new(r"C:\ember.exe")), r#"--select "C:\ember.exe""#); + } + + /// The search words are percent-encoded as UTF-8 and nothing else is left that a URL would read. + #[test] + fn the_search_url_encodes_the_words() { + assert_eq!(search_url("Ember", "process"), "https://www.bing.com/search?q=Ember%20process"); + assert_eq!( + search_url("caf\u{e9} & co/x?y=1#z", "processo"), + "https://www.bing.com/search?q=caf%C3%A9%20%26%20co%2Fx%3Fy%3D1%23z%20processo" + ); + assert_eq!(search_url("a+b%", "p"), "https://www.bing.com/search?q=a%2Bb%25%20p"); + assert_eq!(search_url("", "p"), "https://www.bing.com/search?q=p"); + } + + /// A shell act runs on its own COM apartment thread (never the caller's), and its failure is reported from there. + #[test] + fn a_shell_act_runs_in_its_own_apartment_and_reports_a_failure() { + use windows::Win32::Foundation::S_FALSE; + let caller = std::thread::current().id(); + let (tx, rx) = std::sync::mpsc::channel(); + let seen = tx.clone(); + let report: Arc = Arc::new(move |code| { + let _ = tx.send(("failed", code, std::thread::current().id())); + }); + let handle = run_in_apartment( + move || { + // SAFETY: a second initialisation of the same mode only counts; it is undone right below. + let again = unsafe { CoInitializeEx(None, COINIT_APARTMENTTHREADED) }; + if again.is_ok() { + // SAFETY: paired with the successful call just above. + unsafe { CoUninitialize() }; + } + let _ = seen.send(("com", u32::from(again == S_FALSE), std::thread::current().id())); + Err(87) + }, + report, + ) + .expect("a thread"); + handle.join().expect("the thread ends"); + let first = rx.recv().expect("the job ran"); + let second = rx.recv().expect("the failure was reported"); + assert_eq!((first.0, first.1), ("com", 1), "the thread was in an apartment already (S_FALSE)"); + assert_eq!((second.0, second.1), ("failed", 87)); + assert_ne!(first.2, caller, "off the caller's thread"); + } + /// Task Manager is the file of the system directory given, never a bare name that the shell would look up in the /// working directory first. #[test] @@ -206,4 +865,68 @@ mod tests { assert!(!taskmgr_direct(own), "{own:?}"); } } + + /// Folio and the browser start from Tasks' own process only at medium, the user's level; any other level, or one + /// that cannot be read, hands them to the desktop shell. + #[test] + fn only_a_medium_tasks_starts_folio_and_the_browser_itself() { + assert_eq!(launch_route(Some(Integrity::Medium)), Route::Direct); + let others = + [None, Some(Integrity::Untrusted), Some(Integrity::Low), Some(Integrity::High), Some(Integrity::System)]; + for own in others { + assert_eq!(launch_route(own), Route::DesktopShell, "{own:?}"); + } + } + + /// A Tasks run as administrator never hands its token to Folio or the browser: in the real launcher, Folio's + /// CreateProcessW and the in-process ShellExecuteExW are reached on the Direct route only, the desktop shell on the + /// other; the desktop shell's helpers start nothing in-process, and Folio's falls back to the shell's window alone. + #[test] + fn an_elevated_tasks_starts_folio_and_the_browser_through_the_desktop_shell() { + let src = include_str!("launch.rs").replace("\r\n", "\n"); + let real = &src[src.find("impl Launcher for Win32Launcher {").unwrap()..]; + let body = |name: &str| { + let b = &real[real.find(name).unwrap()..]; + b[..b.find("\n }\n").unwrap()].to_string() + }; + let acts = ["fn open_location(&self", "fn open_url(&self", "fn start_files(&self"]; + let direct = ["start_files_at(", "create_process", "open_by_shell(", "shell_execute("]; + for name in acts { + let b = body(name); + assert!(b.contains("launch_route(Win32Prober.own_level())"), "the route is read: {b}"); + assert!(b.contains("Route::DesktopShell"), "{b}"); + for line in b.lines().filter(|l| direct.iter().any(|c| l.contains(c))) { + assert!(line.contains("Route::Direct"), "only the Direct route starts in-process: {line}"); + } + } + assert!(body(acts[0]).contains("Route::DesktopShell) => files_through_desktop(&files, &file)"), "Folio"); + assert!(body(acts[1]).contains("Route::DesktopShell => desktop_open(&url, None, None)"), "the address"); + assert!(body(acts[2]).contains("Route::DesktopShell => files_through_desktop(files, file)"), "Folio"); + let helper = |name: &str| { + let h = &src[src.find(name).unwrap()..]; + h[..h.find("\n}\n").unwrap()].to_string() + }; + let desktop = helper("fn desktop_open("); + let chain = [ + "FindWindowSW(", + "SID_STopLevelBrowser", + "QueryActiveShellView()", + "SVGIO_BACKGROUND", + "IShellFolderViewDual", + "IShellDispatch2", + ".ShellExecute(", + "\"open\"", + ]; + for step in chain { + assert!(desktop.contains(step), "{step}: {desktop}"); + } + let folio = helper("fn files_through_desktop("); + assert!(folio.contains("desktop_open(") && folio.contains("select_item(file)"), "{folio}"); + for h in [desktop, folio] { + for own in ["CreateProcessW", "create_process", "ShellExecuteExW", "shell_execute(", "open_by_shell("] { + assert!(!h.contains(own), "{own} in {h}"); + } + assert!(!h.contains("start_files_at("), "{h}"); + } + } } diff --git a/apps/tasks/src/app/mod.rs b/apps/tasks/src/app/mod.rs index c7bd5c03..aa2f02e0 100644 --- a/apps/tasks/src/app/mod.rs +++ b/apps/tasks/src/app/mod.rs @@ -3,6 +3,7 @@ pub mod access; pub mod args; +pub mod dock; pub mod dock_names; pub mod exec; #[cfg(feature = "fault-inject")] @@ -16,6 +17,7 @@ pub mod names_bin; pub mod options; pub mod paths; pub mod presence; +pub mod procinfo; pub mod resolver; pub mod sampling; pub mod selftest; @@ -48,8 +50,23 @@ pub const STAGE_BETA: bool = true; /// The key the main window's placement is stored under. pub const MAIN_PLACEMENT: PlacementKey = PlacementKey("main"); /// The window's size at its first start and its minimum, logical px. -const WINDOW_SIZE: SizeL = SizeL { w: 640, h: 560 }; +const WINDOW_SIZE: SizeL = SizeL { w: 1100, h: 720 }; const WINDOW_MIN: SizeL = SizeL { w: 520, h: 400 }; +/// The main window's spec: its first-start size, its minimum and where its placement is kept. +pub fn main_spec(title: String, opened_by_chord: bool) -> WindowSpec { + WindowSpec { + kind: WindowKind::Opaque { min: WINDOW_MIN, caption: Caption::System }, + class: WINDOW_CLASS, + title: title.into(), + size: WINDOW_SIZE, + owner: None, + esc_closes: true, + placement: Some(MAIN_PLACEMENT), + icon_resource: Some(1), + opened_by_chord, + } +} + /// The system root of Deps::inert: the fixtures' Windows folder (scenes and Harness tests classify against it). const INERT_SYSTEM_ROOT: &str = "C:\\Windows"; @@ -61,8 +78,11 @@ pub struct Deps { pub state: state::StateHandle, pub sampling: sampling::Sampling, pub resolver: Option, + /// The reader of the facts the snapshot does not carry (user, command line, priority class, efficiency mode). + pub procinfo: Option, pub launcher: Arc, pub exec: Arc, + pub dock: Arc, pub instance: Option, pub system_root: String, pub install_dir: Option, @@ -80,8 +100,10 @@ impl Deps { state: state::StateHandle::default(), sampling: sampling::Sampling::inert(), resolver: None, + procinfo: None, launcher, exec, + dock: Arc::new(dock::RecordingDock::default()), instance: None, system_root: INERT_SYSTEM_ROOT.to_string(), install_dir: None, @@ -154,7 +176,8 @@ fn run_window(show: Show, paths: &paths::Paths) -> ExitCode { // (9) The stores, the launcher and the executor. let options = options::load(paths); let state = state::load(paths); - let launcher: Arc = Arc::new(launch::Win32Launcher); + let win_launcher = Arc::new(launch::Win32Launcher::default()); + let launcher: Arc = win_launcher.clone(); let executor = exec::Win32Executor::new(Arc::clone(&launcher)); // (10) The sampler starts now, so snapshot A runs while the window is built. let first = @@ -183,17 +206,7 @@ fn run_window(show: Show, paths: &paths::Paths) -> ExitCode { let title_key = if STAGE_BETA { k::TASKS_WINDOW_TITLE_BETA } else { k::TASKS_WINDOW_TITLE }; let title = oled_sys::i18n::subst(&strings::t(lang, title_key), &[("name", name.as_ref())]); let stored = state.load(MAIN_PLACEMENT).is_some(); - let spec = WindowSpec { - kind: WindowKind::Opaque { min: WINDOW_MIN, caption: Caption::System }, - class: WINDOW_CLASS, - title: title.into(), - size: WINDOW_SIZE, - owner: None, - esc_closes: true, - placement: Some(MAIN_PLACEMENT), - icon_resource: Some(1), - opened_by_chord: show.from_chord || !stored, - }; + let spec = main_spec(title, show.from_chord || !stored); let deps = Deps { lang, nf: num_fmt(lang), @@ -201,8 +214,10 @@ fn run_window(show: Show, paths: &paths::Paths) -> ExitCode { state: state.clone(), sampling, resolver: None, + procinfo: None, launcher, exec: executor.clone(), + dock: Arc::new(dock::Win32Dock), instance, system_root: system_root(), install_dir, @@ -222,11 +237,16 @@ fn run_window(show: Show, paths: &paths::Paths) -> ExitCode { let poster = proxy.clone(); state.attach(Box::new(move || poster.send(Box::new(state::StateDirty)))); executor.attach(proxy.clone()); + win_launcher.attach(proxy.clone()); let _presence = event_loop.hwnd(w).map(|hwnd| presence::install(proxy.clone(), hwnd)); let names = resolver::ResolverDeps::new(paths, root.as_ref().map(|r| r.path.as_path()), lang); if let Some(r) = resolver::start(proxy.clone(), names) { let _ = proxy.send(Box::new(resolver::Started(r))); } + // The process-facts reader starts the same way and sleeps until a page asks it for rows. + if let Some(p) = procinfo::start(proxy.clone()) { + let _ = proxy.send(Box::new(procinfo::Started(p))); + } // The suite's Updated message reaches the screen's app_message (TS3). // SAFETY: a NUL-terminated string that lives for the call. let updated = unsafe { RegisterWindowMessageW(&HSTRING::from(oled_sys::selftest::UPDATED_MESSAGE)) }; diff --git a/apps/tasks/src/app/options.rs b/apps/tasks/src/app/options.rs index 0090324d..8a51f9d6 100644 --- a/apps/tasks/src/app/options.rs +++ b/apps/tasks/src/app/options.rs @@ -32,6 +32,34 @@ pub enum OpenSort { Memory, } +/// "names" | "icons": the left bar's saved width (a narrow window collapses it by itself without changing this). +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum RailMode { + #[default] + Names, + Icons, +} + +/// "auto" | "line" | "off": the resource strip above the list (read by the strip itself). +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum StripMode { + #[default] + Auto, + Line, + Off, +} + +/// One column of the Details page as tasks.json keeps it (the shape of Folio's files.json columns). +#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +pub struct ColumnPref { + pub id: String, + pub width: i32, + pub visible: bool, +} + +/// The most columns the file may list; the page has fewer. +const MAX_COLUMN_PREFS: usize = 32; + #[derive(Clone, Debug, PartialEq, Eq)] pub struct TasksOptions { /// "0.5" | "1" | "2" | "5" | "paused". @@ -39,6 +67,10 @@ pub struct TasksOptions { pub density: Density, pub always_on_top: bool, pub open_sorted_by: OpenSort, + pub rail: RailMode, + pub resource_strip: StripMode, + /// The Details page's columns in order; empty: the page's own defaults. Ids this version does not know are ignored. + pub details_columns: Vec, } impl Default for TasksOptions { @@ -48,6 +80,9 @@ impl Default for TasksOptions { density: Density::Standard, always_on_top: false, open_sorted_by: OpenSort::Auto, + rail: RailMode::Names, + resource_strip: StripMode::Auto, + details_columns: Vec::new(), } } } @@ -64,6 +99,10 @@ const DENSITY: [(&str, Density); 2] = [("standard", Density::Standard), ("compac const DENSITY_NAMES: &[&str] = &["standard", "compact"]; const SORT: [(&str, OpenSort); 3] = [("auto", OpenSort::Auto), ("cpu", OpenSort::Cpu), ("memory", OpenSort::Memory)]; const SORT_NAMES: &[&str] = &["auto", "cpu", "memory"]; +const RAIL: [(&str, RailMode); 2] = [("names", RailMode::Names), ("icons", RailMode::Icons)]; +const RAIL_NAMES: &[&str] = &["names", "icons"]; +const STRIP: [(&str, StripMode); 3] = [("auto", StripMode::Auto), ("line", StripMode::Line), ("off", StripMode::Off)]; +const STRIP_NAMES: &[&str] = &["auto", "line", "off"]; impl Options for TasksOptions { const VERSION: u16 = 1; @@ -74,7 +113,16 @@ impl Options for TasksOptions { } fn known_keys() -> &'static [&'static str] { - &["version", "refresh", "density", "always_on_top", "open_sorted_by"] + &[ + "version", + "refresh", + "density", + "always_on_top", + "open_sorted_by", + "rail", + "resource_strip", + "details_columns", + ] } /// Key by key: a wrong type is Problem::Type, an unknown string Problem::UnknownValue; the key keeps the last good @@ -89,13 +137,16 @@ impl Options for TasksOptions { density: r.named("density", &DENSITY, DENSITY_NAMES).unwrap_or(base.density), always_on_top: r.bool("always_on_top").unwrap_or(base.always_on_top), open_sorted_by: r.named("open_sorted_by", &SORT, SORT_NAMES).unwrap_or(base.open_sorted_by), + rail: r.named("rail", &RAIL, RAIL_NAMES).unwrap_or(base.rail), + resource_strip: r.named("resource_strip", &STRIP, STRIP_NAMES).unwrap_or(base.resource_strip), + details_columns: r.columns("details_columns").unwrap_or(base.details_columns), }; (out, errors) } fn to_template(&self) -> String { let mut s = String::from(Self::template_mark()); - s.push_str("\n// Read when the window opens. The More menu writes the same keys.\n{\n \"version\": 1,\n"); + s.push_str("\n// Read when the window opens. The Settings menu writes the same keys.\n{\n \"version\": 1,\n"); s.push_str(" // How often the list refreshes: \"0.5\", \"1\", \"2\" or \"5\" seconds, or \"paused\".\n"); s.push_str(&format!(" \"refresh\": \"{}\",\n", name_of(&REFRESH, self.refresh))); s.push_str(" // Row height: \"standard\" or \"compact\".\n"); @@ -103,7 +154,14 @@ impl Options for TasksOptions { s.push_str(" // Keep the window above other windows: true or false.\n"); s.push_str(&format!(" \"always_on_top\": {},\n", self.always_on_top)); s.push_str(" // The column the list opens sorted by: \"auto\", \"cpu\" or \"memory\".\n"); - s.push_str(&format!(" \"open_sorted_by\": \"{}\"\n}}\n", name_of(&SORT, self.open_sorted_by))); + s.push_str(&format!(" \"open_sorted_by\": \"{}\",\n", name_of(&SORT, self.open_sorted_by))); + s.push_str(" // The left bar: \"names\" (pages with their names) or \"icons\" (icons only).\n"); + s.push_str(&format!(" \"rail\": \"{}\",\n", name_of(&RAIL, self.rail))); + s.push_str(" // The resource strip above the list: \"auto\", \"line\" or \"off\".\n"); + s.push_str(&format!(" \"resource_strip\": \"{}\",\n", name_of(&STRIP, self.resource_strip))); + s.push_str(" // The Details page's columns in order, each {\"id\", \"width\", \"visible\"};\n"); + s.push_str(" // empty means the default columns.\n"); + s.push_str(&format!(" \"details_columns\": {}\n}}\n", jsonc::js_block(&self.details_columns))); s } @@ -144,6 +202,21 @@ impl Reader<'_> { found } + /// A list of {id, width, visible}: an entry of the wrong shape is skipped, the key as a whole must be a list. + fn columns(&mut self, key: &str) -> Option> { + let raw = self.v.get(key)?; + let Some(list) = raw.as_array() else { + self.error(key, Problem::Type { expected: "a list of columns" }); + return None; + }; + Some( + list.iter() + .filter_map(|e| serde_json::from_value::(e.clone()).ok()) + .take(MAX_COLUMN_PREFS) + .collect(), + ) + } + fn bool(&mut self, key: &str) -> Option { let raw = self.v.get(key)?; let b = raw.as_bool(); @@ -221,6 +294,12 @@ mod tests { density: Density::Compact, always_on_top: true, open_sorted_by: OpenSort::Memory, + rail: RailMode::Icons, + resource_strip: StripMode::Line, + details_columns: vec![ + ColumnPref { id: "name".into(), width: 220, visible: true }, + ColumnPref { id: "command_line".into(), width: 400, visible: false }, + ], }; let text = o.to_template(); assert!(text.starts_with(TasksOptions::template_mark())); @@ -248,6 +327,9 @@ mod tests { o.density = Density::Compact; o.always_on_top = true; o.open_sorted_by = OpenSort::Cpu; + o.rail = RailMode::Icons; + o.resource_strip = StripMode::Off; + o.details_columns = vec![ColumnPref { id: "user".into(), width: 150, visible: true }]; }) .unwrap(); let second = load(&paths); @@ -257,7 +339,10 @@ mod tests { refresh: Refresh::Five, density: Density::Compact, always_on_top: true, - open_sorted_by: OpenSort::Cpu + open_sorted_by: OpenSort::Cpu, + rail: RailMode::Icons, + resource_strip: StripMode::Off, + details_columns: vec![ColumnPref { id: "user".into(), width: 150, visible: true }], } ); // No roaming folder: defaults, nothing written. @@ -266,6 +351,38 @@ mod tests { let _ = std::fs::remove_dir_all(&d); } + #[test] + fn the_bar_and_the_strip_read_their_names_and_refuse_others() { + let (o, errors) = parse_text("{\n \"rail\": \"icons\",\n \"resource_strip\": \"line\"\n}"); + assert_eq!((o.rail, o.resource_strip), (RailMode::Icons, StripMode::Line)); + assert!(errors.is_empty()); + let (o, errors) = parse_text("{\n \"rail\": \"wide\",\n \"resource_strip\": 3\n}"); + assert_eq!((o.rail, o.resource_strip), (RailMode::Names, StripMode::Auto), "the defaults stand"); + assert_eq!(errors.len(), 2); + assert_eq!(errors[0].path, "rail"); + assert!(matches!(errors[0].problem, Problem::UnknownValue { .. })); + assert!(matches!(errors[1].problem, Problem::Type { .. })); + } + + #[test] + fn the_details_columns_keep_their_order_and_skip_what_is_malformed() { + let text = "{\n \"details_columns\": [\n {\"id\": \"pid\", \"width\": 90, \"visible\": true},\n \ + {\"id\": \"user\"},\n {\"id\": \"a-column-of-a-later-version\", \"width\": 50, \"visible\": false},\n \ + 7\n ]\n}"; + let (o, errors) = parse_text(text); + assert!(errors.is_empty()); + let ids: Vec<&str> = o.details_columns.iter().map(|c| c.id.as_str()).collect(); + assert_eq!( + ids, + ["pid", "a-column-of-a-later-version"], + "a wrong shape is skipped, an unknown id is kept as it is" + ); + let (o, errors) = parse_text("{\n \"details_columns\": \"all\"\n}"); + assert!(o.details_columns.is_empty()); + assert_eq!(errors.len(), 1); + assert_eq!(errors[0].path, "details_columns"); + } + #[test] fn wrong_values_keep_the_last_good_one() { let good = TasksOptions { refresh: Refresh::Five, ..TasksOptions::default() }; diff --git a/apps/tasks/src/app/procinfo.rs b/apps/tasks/src/app/procinfo.rs new file mode 100644 index 00000000..032592a5 --- /dev/null +++ b/apps/tasks/src/app/procinfo.rs @@ -0,0 +1,1006 @@ +//! The facts of a process that the snapshot does not carry: its user, its command line, its priority class and whether +//! it runs in efficiency mode, read on a thread of their own ("tasks-procinfo") for the rows a page shows. +//! +//! Every read opens the process with PROCESS_QUERY_LIMITED_INFORMATION and nothing more, and reads nothing from the +//! process's memory: the user comes from its token (TOKEN_QUERY), the command line from the kernel's copy +//! (NtQueryInformationProcess, ProcessCommandLineInformation), the class and the throttling from two queries. The +//! create time of the handle is checked against the key before anything is read, so a pid that names another process +//! now answers Gone, never that process's facts. +//! +//! The thread sleeps on a condition variable with no timeout: it reads only while a consumer asks. The consumer asks +//! through its ProcInfoBook with the keys of the rows it shows (visible rows go to the front of a queue of at most +//! MAX_PENDING keys); the book sends what it has no answer for and, every REFRESH_MS, the class and the throttling of +//! the keys still asked (the user and the command line are read once). A refusal is kept as not available and never +//! asked again for that key. Answers wait in an outbox; one ProcInfoDone at a time tells the window to take them. +//! Nothing here logs a command line or a user name. +//! +//! A consumer: start(proxy) after the window opens and keep the ProcInfo that Started carries; while its page shows, on +//! every frame, retain_live with the snapshot's keys and one request naming every row on screen (visible); on +//! ProcInfoDone, take_from; then read user, command_line, class and efficiency by key ("—" for None). + +use std::collections::{HashMap, VecDeque}; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::{Arc, Condvar, Mutex, MutexGuard}; +use std::time::{Duration, Instant}; + +use oled_sysmon::ProcKey; +use oled_ui::host::Proxy; +use windows::core::{PCWSTR, PWSTR}; +use windows::Wdk::System::Threading::{NtQueryInformationProcess, ProcessCommandLineInformation}; +use windows::Win32::Foundation::{ERROR_INSUFFICIENT_BUFFER, FILETIME, HANDLE, UNICODE_STRING}; +use windows::Win32::Security::{ + GetLengthSid, GetTokenInformation, IsValidSid, LookupAccountSidW, TokenUser, PSID, SID_NAME_USE, TOKEN_QUERY, + TOKEN_USER, +}; +use windows::Win32::System::Threading::{ + GetCurrentThread, GetPriorityClass, GetProcessInformation, GetThreadTimes, OpenProcess, OpenProcessToken, + ProcessPowerThrottling, SetThreadPriority, PROCESS_POWER_THROTTLING_CURRENT_VERSION, + PROCESS_POWER_THROTTLING_STATE, PROCESS_QUERY_LIMITED_INFORMATION, THREAD_PRIORITY_BELOW_NORMAL, +}; + +use super::access; +use super::exec::tune::{Class, Throttle}; +use super::exec::INVALID_PARAMETER; + +/// The reader thread's name. +pub const THREAD_NAME: &str = "tasks-procinfo"; +/// Keys waiting at most: a background key past it is refused, a visible batch pushes the last ones out. +pub const MAX_PENDING: usize = 256; +/// Keys read between two looks at the outbox. +pub const BATCH: usize = 32; +/// Waits this long for the thread at stop, then lets it go (as the resolver). +pub const STOP_WAIT_MS: u64 = 1000; +/// The class and the throttling of a key still asked are read again after this long. +pub const REFRESH_MS: u64 = 5000; +/// A key sent and not answered after this long is sent again (the reader pushed it out of its queue). +pub const REASK_MS: u64 = 2000; +/// Processes the book knows at most; the least recently asked goes first. +pub const MAX_ENTRIES: usize = 1024; +/// Bytes the book holds at most, its texts and its entries. +pub const MAX_BOOK_BYTES: usize = 2 * 1024 * 1024; +/// A command line is cut at 32 KiB of UTF-16, as much as the admin helper's reply holds. +pub const MAX_CMDLINE_UNITS: usize = oled_trust::frame::admin::MAX_TEXT_UNITS; +/// Answers the outbox holds at most; past it the oldest go (their keys are asked again after REASK_MS). +pub const MAX_OUTBOX: usize = 1024; +/// Account names the reader keeps, by SID; past it the cache starts again. +pub const MAX_SIDS: usize = 256; + +/// The longest kernel copy of a command line: 32767 units, the longest Windows takes, after its UNICODE_STRING. +const CMD_BUF_MAX: usize = 65_536 + 64; +/// Where the command line buffer starts; it grows when a process needs it, up to CMD_BUF_MAX, and stays. +const CMD_BUF_START: usize = 4096; +/// A TokenUser answer larger than this is not read. +const MAX_TOKEN_USER: usize = 1024; +/// An account or domain name longer than this is not read. +const MAX_NAME_UNITS: usize = 1024; +/// NTSTATUS values that mean "a larger buffer": STATUS_INFO_LENGTH_MISMATCH, STATUS_BUFFER_TOO_SMALL, +/// STATUS_BUFFER_OVERFLOW. +const STATUS_LARGER: [u32; 3] = [0xC000_0004, 0xC000_0023, 0x8000_0005]; + +// ------------------------------------------------------------------ the jobs and the answers + +/// What the thread reads for a key. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum Kind { + /// Every fact: the first read of a key. + Read, + /// The class and the throttling only. + Refresh, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub struct Job { + pub key: ProcKey, + pub kind: Kind, +} + +/// What the reader learned of one process; each part None when Windows would not say. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Facts { + /// The account's name as Windows gives it ("SYSTEM", "SERVIZIO LOCALE"), without its domain. + pub user: Option>, + /// At most MAX_CMDLINE_UNITS units; None also when the book had no room left for it. + pub command_line: Option>, + /// The command line was longer and is cut at MAX_CMDLINE_UNITS. + pub command_line_cut: bool, + pub class: Option, + pub throttle: Option, +} + +impl Facts { + /// Efficiency mode: the execution speed throttled (EcoQoS). + pub fn efficiency(&self) -> Option { + self.throttle.map(|t| t == Throttle::On) + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum Answer { + /// A Read. + Facts(ProcKey, Facts), + /// A Refresh. + Tuning { key: ProcKey, class: Option, throttle: Option }, + /// Windows refused a query handle: not available. + Denied(ProcKey), + /// No live process has the key: its pid names no process, or another one now. + Gone(ProcKey), +} + +impl Answer { + pub fn key(&self) -> ProcKey { + match self { + Answer::Facts(k, _) | Answer::Denied(k) | Answer::Gone(k) => *k, + Answer::Tuning { key, .. } => *key, + } + } +} + +/// AppMsg: answers wait in the reader's outbox; take them (ProcInfoBook::take_from). One at a time until taken. +pub struct ProcInfoDone; + +/// AppMsg: the reader started after the window opened (it needs the window's proxy); the screen keeps it. +pub struct Started(pub ProcInfo); + +// ------------------------------------------------------------------ the queue (pure) + +fn merge(a: Kind, b: Kind) -> Kind { + if a == Kind::Read || b == Kind::Read { + Kind::Read + } else { + Kind::Refresh + } +} + +/// The keys waiting: front first, at most MAX_PENDING, each key once. +#[derive(Debug, Default)] +pub struct Queue { + items: VecDeque, +} + +impl Queue { + /// Queues `jobs`: when `front`, at the front in their own order (a key waiting already moves there), else at the + /// back (a key waiting already stays where it is). A Read and a Refresh of one key make one Read. Returns the keys + /// that are not waiting after the call: a background job past MAX_PENDING is refused, a front batch pushes the last + /// jobs out (and keeps its own first MAX_PENDING). + pub fn push(&mut self, jobs: &[Job], front: bool) -> Vec { + let mut out = Vec::new(); + if !front { + for j in jobs { + if let Some(w) = self.items.iter_mut().find(|w| w.key == j.key) { + w.kind = merge(w.kind, j.kind); + } else if self.items.len() >= MAX_PENDING { + out.push(j.key); + } else { + self.items.push_back(*j); + } + } + return out; + } + let mut index: HashMap = HashMap::with_capacity(jobs.len()); + let mut batch: Vec = Vec::with_capacity(jobs.len()); + for j in jobs { + match index.get(&j.key).and_then(|&i| batch.get_mut(i)) { + Some(b) => b.kind = merge(b.kind, j.kind), + None => { + index.insert(j.key, batch.len()); + batch.push(*j); + } + } + } + self.items.retain(|w| match index.get(&w.key).and_then(|&i| batch.get_mut(i)) { + Some(b) => { + b.kind = merge(b.kind, w.kind); + false + } + None => true, + }); + if batch.len() > MAX_PENDING { + out.extend(batch.drain(MAX_PENDING..).map(|j| j.key)); + } + for j in batch.into_iter().rev() { + self.items.push_front(j); + } + while self.items.len() > MAX_PENDING { + if let Some(j) = self.items.pop_back() { + out.push(j.key); + } + } + out + } + + pub fn pop(&mut self) -> Option { + self.items.pop_front() + } + + pub fn len(&self) -> usize { + self.items.len() + } + + pub fn is_empty(&self) -> bool { + self.items.is_empty() + } +} + +// ------------------------------------------------------------------ the thread + +/// What the thread does with a job; the real one asks Windows, a test's answers from its own rules. +pub trait Backend: Send + 'static { + fn read(&mut self, job: Job) -> Answer; +} + +/// What the thread did, for the budget and the tests. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct Stats { + /// Times the thread woke with work. + pub wakes: u64, + pub batches: u64, + pub reads: u64, + pub refreshes: u64, + /// Denied or Gone answers. + pub not_available: u64, + /// Wall time spent inside reads, microseconds. + pub busy_us: u64, + /// The thread's own CPU time (kernel and user, 100 ns) after its last batch, at the clock tick's grain. + pub cpu_100ns: u64, +} + +#[derive(Default)] +struct State { + queue: Queue, + outbox: Vec, + /// A ProcInfoDone is on its way and its answers are not taken yet. + notified: bool, + finished: bool, + stats: Stats, +} + +struct Shared { + state: Mutex, + wake: Condvar, + exit: AtomicBool, +} + +fn lock(s: &Shared) -> MutexGuard<'_, State> { + s.state.lock().unwrap_or_else(|e| e.into_inner()) +} + +/// The reader thread; stopped within STOP_WAIT_MS by stop (or on drop). +pub struct ProcInfo { + shared: Arc, + thread: Option>, +} + +impl ProcInfo { + /// Queues jobs (see Queue::push); visible rows ask at the front. Returns the keys not waiting after the call. + pub fn request(&self, jobs: &[Job], visible: bool) -> Vec { + if jobs.is_empty() { + return Vec::new(); + } + let (out, waiting) = { + let mut g = lock(&self.shared); + let out = g.queue.push(jobs, visible); + (out, !g.queue.is_empty()) + }; + if waiting { + self.shared.wake.notify_all(); + } + out + } + + /// The answers waiting; the next answer sends a new ProcInfoDone. + pub fn take(&self) -> Vec { + let mut g = lock(&self.shared); + g.notified = false; + std::mem::take(&mut g.outbox) + } + + /// Jobs waiting. + pub fn pending(&self) -> usize { + lock(&self.shared).queue.len() + } + + pub fn stats(&self) -> Stats { + lock(&self.shared).stats + } + + /// Stops the thread: at most STOP_WAIT_MS for it, then it is let go (it ends by itself when its read returns, and + /// touches nothing on the way). + pub fn stop(self) { + drop(self); + } + + fn shutdown(&mut self) { + let Some(thread) = self.thread.take() else { return }; + { + let _g = lock(&self.shared); + self.shared.exit.store(true, Ordering::Release); + self.shared.wake.notify_all(); + } + let deadline = Instant::now() + Duration::from_millis(STOP_WAIT_MS); + let mut g = lock(&self.shared); + while !g.finished { + let left = deadline.saturating_duration_since(Instant::now()); + if left.is_zero() { + return; // the JoinHandle is dropped: the thread detaches + } + g = self.shared.wake.wait_timeout(g, left).unwrap_or_else(|e| e.into_inner()).0; + } + drop(g); + let _ = thread.join(); + } +} + +impl Drop for ProcInfo { + fn drop(&mut self) { + self.shutdown(); + } +} + +/// Runs `make` on a new thread THREAD_NAME (below normal priority: the answers are for rows on screen, never ahead of +/// the window) and serves the jobs with what it returns; `notify` tells the consumer that answers wait. None when the +/// thread cannot be created. +pub fn spawn_with( + make: impl FnOnce() -> B + Send + 'static, + notify: impl Fn() + Send + 'static, +) -> Option { + let shared = + Arc::new(Shared { state: Mutex::new(State::default()), wake: Condvar::new(), exit: AtomicBool::new(false) }); + let worker = Arc::clone(&shared); + let thread = std::thread::Builder::new() + .name(THREAD_NAME.into()) + .spawn(move || { + // SAFETY: lowers the priority of this thread only. + let _ = unsafe { SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL) }; + let mut backend = make(); + serve(&worker, &mut backend, ¬ify); + drop(backend); + let mut g = lock(&worker); + g.finished = true; + worker.wake.notify_all(); + }) + .ok()?; + Some(ProcInfo { shared, thread: Some(thread) }) +} + +/// The reader over Windows, answering through the window's proxy. +pub fn start(proxy: Proxy) -> Option { + oled_sys::log!("tasks: process facts reader started"); + spawn_with(Win32Facts::new, move || { + let _ = proxy.send(Box::new(ProcInfoDone)); + }) +} + +/// The loop: wait for work (no timeout), take up to BATCH jobs, read them, put the answers in the outbox and notify +/// once until they are taken. +fn serve(shared: &Shared, backend: &mut B, notify: &dyn Fn()) { + let exit = || shared.exit.load(Ordering::Acquire); + loop { + let mut batch = Vec::with_capacity(BATCH); + { + let mut g = lock(shared); + while g.queue.is_empty() && !exit() { + g = shared.wake.wait(g).unwrap_or_else(|e| e.into_inner()); + } + if exit() { + return; + } + g.stats.wakes += 1; + while batch.len() < BATCH { + match g.queue.pop() { + Some(j) => batch.push(j), + None => break, + } + } + } + let started = Instant::now(); + let mut answers = Vec::with_capacity(batch.len()); + for job in batch { + if exit() { + return; + } + answers.push((job.kind, backend.read(job))); + } + let busy = u64::try_from(started.elapsed().as_micros()).unwrap_or(u64::MAX); + let cpu = thread_cpu_100ns(); + let send = { + let mut g = lock(shared); + for (kind, a) in answers { + match (&a, kind) { + (Answer::Denied(_) | Answer::Gone(_), _) => g.stats.not_available += 1, + (_, Kind::Read) => g.stats.reads += 1, + (_, Kind::Refresh) => g.stats.refreshes += 1, + } + g.outbox.push(a); + } + let over = g.outbox.len().saturating_sub(MAX_OUTBOX); + g.outbox.drain(..over); + g.stats.batches += 1; + g.stats.busy_us = g.stats.busy_us.saturating_add(busy); + g.stats.cpu_100ns = cpu; + !std::mem::replace(&mut g.notified, true) + }; + if send { + notify(); + } + } +} + +fn filetime_100ns(t: FILETIME) -> u64 { + (u64::from(t.dwHighDateTime) << 32) | u64::from(t.dwLowDateTime) +} + +/// The calling thread's CPU time, kernel and user, in 100 ns; 0 when it cannot be read. +fn thread_cpu_100ns() -> u64 { + let (mut c, mut e, mut k, mut u) = + (FILETIME::default(), FILETIME::default(), FILETIME::default(), FILETIME::default()); + // SAFETY: the pseudo handle of this thread; four local out-parameters. + if unsafe { GetThreadTimes(GetCurrentThread(), &mut c, &mut e, &mut k, &mut u) }.is_err() { + return 0; + } + filetime_100ns(k).saturating_add(filetime_100ns(u)) +} + +// ------------------------------------------------------------------ Windows' side + +/// The answer to a refused OpenProcess: no such pid is Gone, any other refusal not available (Denied). +fn refused(key: ProcKey, code: u32) -> Answer { + if code == INVALID_PARAMETER { + Answer::Gone(key) + } else { + Answer::Denied(key) + } +} + +/// The reader over Windows: one query handle per job, closed before the next; account names kept by SID. +pub struct Win32Facts { + names: HashMap, Option>>, + /// u64 words: aligned for the UNICODE_STRING the kernel writes first. + cmd: Vec, +} + +impl Default for Win32Facts { + fn default() -> Win32Facts { + Win32Facts::new() + } +} + +impl Win32Facts { + pub fn new() -> Win32Facts { + Win32Facts { names: HashMap::new(), cmd: vec![0; CMD_BUF_START / 8] } + } + + fn user(&mut self, h: HANDLE) -> Option> { + let mut token = HANDLE::default(); + // SAFETY: h is an open process handle; token receives a new handle, closed below on every path. + unsafe { OpenProcessToken(h, TOKEN_QUERY, &mut token) }.ok()?; + let out = self.user_of_token(token); + access::close(token); + out + } + + fn user_of_token(&mut self, token: HANDLE) -> Option> { + let mut len = 0u32; + // SAFETY: a size query: no buffer; len receives the bytes needed. + let _ = unsafe { GetTokenInformation(token, TokenUser, None, 0, &mut len) }; + let size = len as usize; + if size < std::mem::size_of::() || size > MAX_TOKEN_USER { + return None; + } + let mut buf = vec![0u64; size.div_ceil(8)]; + // SAFETY: buf has at least len writable bytes, aligned for the TOKEN_USER the call writes first. + unsafe { GetTokenInformation(token, TokenUser, Some(buf.as_mut_ptr().cast()), len, &mut len) }.ok()?; + // SAFETY: the call succeeded: buf starts with a TOKEN_USER; its SID pointer is followed only once it is found + // to lie inside buf, below. + let sid = unsafe { (*buf.as_ptr().cast::()).User.Sid }; + let start = (sid.0 as usize).checked_sub(buf.as_ptr() as usize)?; + // SAFETY: the same bytes of buf, read as bytes. + let bytes = unsafe { std::slice::from_raw_parts(buf.as_ptr().cast::(), buf.len() * 8) }; + let head = bytes.get(start..start.checked_add(8)?)?; + // A SID: revision, sub-authority count, a 6-byte authority, then four bytes per sub-authority. + let sid_len = 8 + 4 * usize::from(*head.get(1)?); + let sid_bytes = bytes.get(start..start.checked_add(sid_len)?)?; + // SAFETY: sid points to sid_len bytes inside buf (alive here), checked above. + if !unsafe { IsValidSid(sid) }.as_bool() || unsafe { GetLengthSid(sid) } as usize != sid_len { + return None; + } + if let Some(name) = self.names.get(sid_bytes) { + return name.clone(); + } + let name = account_name(sid); + if self.names.len() >= MAX_SIDS { + self.names.clear(); + } + self.names.insert(sid_bytes.into(), name.clone()); + name + } + + /// The command line and whether it was cut; None when the kernel does not give it. + fn command_line(&mut self, h: HANDLE) -> Option<(String, bool)> { + for _ in 0..2 { + let cap = self.cmd.len() * 8; + let mut filled = 0u32; + // SAFETY: cmd has cap writable bytes, 8-aligned; h has PROCESS_QUERY_LIMITED_INFORMATION, enough for this + // class; filled receives the bytes written or needed. + let st = unsafe { + NtQueryInformationProcess( + h, + ProcessCommandLineInformation, + self.cmd.as_mut_ptr().cast(), + cap as u32, + &mut filled, + ) + }; + if st.0 >= 0 { + return parse_command_line(&self.cmd, filled as usize); + } + let need = filled as usize; + if !STATUS_LARGER.contains(&(st.0 as u32)) || need <= cap || need > CMD_BUF_MAX { + return None; + } + self.cmd.resize(need.div_ceil(8), 0); + } + None + } +} + +/// Opens the process of `key` for queries and checks that it is that process; the caller closes the handle. +fn open(key: ProcKey) -> Result { + // SAFETY: OpenProcess takes no pointers; the handle is closed on every path (here or by the caller). + match unsafe { OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, false, key.pid) } { + Ok(h) if access::creation_time(h) == Some(key.created) => Ok(h), + Ok(h) => { + access::close(h); + Err(Answer::Gone(key)) + } + Err(e) => Err(refused(key, access::win32_code(&e))), + } +} + +fn class_of(h: HANDLE) -> Option { + // SAFETY: h is an open process handle. + match unsafe { GetPriorityClass(h) } { + 0 => None, + v => Class::from_win32(v), + } +} + +fn throttle_of(h: HANDLE) -> Option { + let mut st = + PROCESS_POWER_THROTTLING_STATE { Version: PROCESS_POWER_THROTTLING_CURRENT_VERSION, ..Default::default() }; + let size = std::mem::size_of::() as u32; + let p = (&mut st as *mut PROCESS_POWER_THROTTLING_STATE).cast(); + // SAFETY: st is a local of the size passed; h is an open process handle. + unsafe { GetProcessInformation(h, ProcessPowerThrottling, p, size) }.ok()?; + Some(Throttle::of_masks(st.ControlMask, st.StateMask)) +} + +/// The name of an account (no domain); None when Windows has none for it. +fn account_name(sid: PSID) -> Option> { + let mut name = vec![0u16; 64]; + let mut domain = vec![0u16; 64]; + for _ in 0..2 { + let (mut n, mut d) = (name.len() as u32, domain.len() as u32); + let mut kind = SID_NAME_USE::default(); + // SAFETY: sid is a valid SID; name and domain have n and d writable units; the counts are in/out. + let r = unsafe { + LookupAccountSidW( + PCWSTR::null(), + sid, + Some(PWSTR(name.as_mut_ptr())), + &mut n, + Some(PWSTR(domain.as_mut_ptr())), + &mut d, + &mut kind, + ) + }; + match r { + Ok(()) => { + let s = String::from_utf16_lossy(name.get(..n as usize)?); + return (!s.is_empty()).then(|| Arc::from(s)); + } + Err(e) if access::win32_code(&e) == ERROR_INSUFFICIENT_BUFFER.0 => { + let (n, d) = (n as usize, d as usize); + if n > MAX_NAME_UNITS || d > MAX_NAME_UNITS { + return None; + } + name.resize(n.max(name.len()), 0); + domain.resize(d.max(domain.len()), 0); + } + Err(_) => return None, + } + } + None +} + +/// The text of the kernel's copy in `buf` (`filled` bytes written): a UNICODE_STRING whose text follows it. Another +/// process wrote that text: it is taken only from inside the bytes the call filled, never through the pointer. +fn parse_command_line(buf: &[u64], filled: usize) -> Option<(String, bool)> { + let cap = buf.len() * 8; + let filled = filled.min(cap); + let header = std::mem::size_of::(); + if filled < header { + return None; + } + // SAFETY: buf is 8-aligned and holds at least a header (filled <= cap); its integers are read as written and its + // pointer only compared, never followed. + let head = unsafe { std::ptr::read(buf.as_ptr().cast::()) }; + if head.Length == 0 { + return Some((String::new(), false)); + } + let offset = (head.Buffer.0 as usize).checked_sub(buf.as_ptr() as usize)?; + let span = text_span(offset, usize::from(head.Length), header, filled)?; + // SAFETY: the same cap bytes of buf, read as u16 (cap is even, the alignment 8). + let words = unsafe { std::slice::from_raw_parts(buf.as_ptr().cast::(), cap / 2) }; + Some(cut_command_line(words.get(span)?)) +} + +/// The u16 range of the text from its byte `offset` and `len`: after the `header`, even, and inside the `filled` +/// bytes; None otherwise. +fn text_span(offset: usize, len: usize, header: usize, filled: usize) -> Option> { + let end = offset.checked_add(len)?; + (offset >= header && offset.is_multiple_of(2) && len.is_multiple_of(2) && end <= filled) + .then_some(offset / 2..end / 2) +} + +/// A command line of at most MAX_CMDLINE_UNITS units (a surrogate pair is never split) and whether it was cut. +pub fn cut_command_line(units: &[u16]) -> (String, bool) { + if units.len() <= MAX_CMDLINE_UNITS { + return (String::from_utf16_lossy(units), false); + } + let mut end = MAX_CMDLINE_UNITS; + if units.get(end - 1).is_some_and(|u| (0xD800..0xDC00).contains(u)) { + end -= 1; + } + (String::from_utf16_lossy(units.get(..end).unwrap_or_default()), true) +} + +impl Backend for Win32Facts { + fn read(&mut self, job: Job) -> Answer { + let h = match open(job.key) { + Ok(h) => h, + Err(a) => return a, + }; + let answer = match job.kind { + Kind::Read => { + let (command_line, command_line_cut) = match self.command_line(h) { + Some((text, cut)) => (Some(text.into_boxed_str()), cut), + None => (None, false), + }; + let facts = Facts { + user: self.user(h), + command_line, + command_line_cut, + class: class_of(h), + throttle: throttle_of(h), + }; + Answer::Facts(job.key, facts) + } + Kind::Refresh => Answer::Tuning { key: job.key, class: class_of(h), throttle: throttle_of(h) }, + }; + access::close(h); + answer + } +} + +// ------------------------------------------------------------------ the book + +/// What the book knows of one process. +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum Known { + /// Asked, not answered yet. + Waiting, + Facts(Facts), + /// Windows refused a query handle, or the key names no live process: never asked again. + NotAvailable, +} + +#[derive(Debug)] +struct Entry { + known: Known, + /// When the facts, or their class and throttling, were last read; None: never read again (a scene's). + read_at: Option, + /// When the key's job was sent and whether at the front; None: nothing waits in the reader. + sent: Option<(Instant, bool)>, + /// The class and the throttling are read again (false once a re-read was refused or Windows gave neither). + refresh: bool, + /// The ask that last named the key. + asked: u64, + bytes: usize, +} + +impl Entry { + fn new(sent: Option<(Instant, bool)>, asked: u64) -> Entry { + Entry { known: Known::Waiting, read_at: None, sent, refresh: false, asked, bytes: bytes_of(&Known::Waiting) } + } +} + +fn bytes_of(k: &Known) -> usize { + let texts = match k { + Known::Facts(f) => f.user.as_deref().map_or(0, str::len) + f.command_line.as_deref().map_or(0, str::len), + _ => 0, + }; + std::mem::size_of::<(ProcKey, Entry)>() + texts +} + +/// The answers the rows read, by key (pid and create time): a reused pid is another key and finds nothing of the old +/// process. At most MAX_ENTRIES entries and MAX_BOOK_BYTES; the least recently asked go first, never one the latest ask +/// named. Entries go when their process leaves the snapshot (retain_live). +#[derive(Debug, Default)] +pub struct ProcInfoBook { + entries: HashMap, + bytes: usize, + tick: u64, +} + +impl ProcInfoBook { + /// The jobs an ask of `keys` (the rows shown, `visible` for the ones on screen) sends now: a Read for a key not + /// known, not sent, sent REASK_MS ago or more, or sent at the back and now visible; a Refresh, by the same rule, + /// for facts read REFRESH_MS ago or more. Marks them sent. + pub fn jobs_for(&mut self, keys: &[ProcKey], visible: bool, now: Instant) -> Vec { + self.tick += 1; + let tick = self.tick; + let since = |t: Instant| now.saturating_duration_since(t); + let due = |sent: Option<(Instant, bool)>| match sent { + None => true, + Some((at, front)) => since(at) >= Duration::from_millis(REASK_MS) || (visible && !front), + }; + let mut jobs = Vec::new(); + for &key in keys { + if let Some(e) = self.entries.get_mut(&key) { + e.asked = tick; + let kind = match e.known { + Known::Waiting => Kind::Read, + Known::Facts(_) => Kind::Refresh, + Known::NotAvailable => continue, + }; + let stale = e.read_at.is_some_and(|t| since(t) >= Duration::from_millis(REFRESH_MS)); + if due(e.sent) && (kind == Kind::Read || (e.refresh && stale)) { + e.sent = Some((now, visible)); + jobs.push(Job { key, kind }); + } + continue; + } + if self.entries.len() >= MAX_ENTRIES && !self.evict_one(None) { + continue; // every entry was named by this ask + } + let e = Entry::new(Some((now, visible)), tick); + self.bytes += e.bytes; + self.entries.insert(key, e); + jobs.push(Job { key, kind: Kind::Read }); + } + jobs + } + + /// Keys the reader did not keep (refused, or pushed out of its queue): sent again with the next ask. + pub fn not_waiting(&mut self, keys: &[ProcKey]) { + for k in keys { + if let Some(e) = self.entries.get_mut(k) { + e.sent = None; + } + } + } + + /// Asks the reader for `keys` (jobs_for, then the reader's queue), after taking the answers already waiting (so + /// that a ProcInfoDone left unhandled never stops the notifications); true when a known fact changed. One ask names + /// every row on screen: the latest ask's rows are the ones the caps never push out. + pub fn request(&mut self, r: &ProcInfo, keys: &[ProcKey], visible: bool, now: Instant) -> bool { + let changed = self.take_from(r, now); + let jobs = self.jobs_for(keys, visible, now); + let dropped = r.request(&jobs, visible); + self.not_waiting(&dropped); + changed + } + + /// Takes the reader's answers (after a ProcInfoDone); true when a known fact changed. + pub fn take_from(&mut self, r: &ProcInfo, now: Instant) -> bool { + self.apply(r.take(), now) + } + + /// Stores answers; an answer for a key the book no longer holds is dropped. True when a known fact changed. + pub fn apply(&mut self, answers: Vec, now: Instant) -> bool { + let mut changed = false; + for a in answers { + let key = a.key(); + let Some(e) = self.entries.get_mut(&key) else { continue }; + e.sent = None; + let next = match (a, &mut e.known) { + (Answer::Facts(_, f), _) => { + e.read_at = Some(now); + e.refresh = f.class.is_some() || f.throttle.is_some(); + Known::Facts(f) + } + (Answer::Tuning { class, throttle, .. }, Known::Facts(f)) => { + changed |= f.class != class || f.throttle != throttle; + f.class = class; + f.throttle = throttle; + e.read_at = Some(now); + e.refresh = class.is_some() || throttle.is_some(); + continue; + } + (Answer::Tuning { .. }, _) => continue, + (Answer::Denied(_) | Answer::Gone(_), Known::Facts(_)) => { + e.refresh = false; + continue; + } + (Answer::Denied(_) | Answer::Gone(_), _) => Known::NotAvailable, + }; + changed |= e.known != next; + self.store(key, next); + } + changed + } + + /// Sets what is known of `key`, or forgets it (scenes and tests preset a book with it; nothing re-reads a set + /// entry). A new key finds no room when every entry was named by the latest ask. + pub fn set(&mut self, key: ProcKey, known: Option) { + let Some(known) = known else { + if let Some(e) = self.entries.remove(&key) { + self.bytes -= e.bytes; + } + return; + }; + if !self.entries.contains_key(&key) { + if self.entries.len() >= MAX_ENTRIES && !self.evict_one(Some(key)) { + return; // every entry was named by the latest ask + } + let e = Entry::new(None, self.tick); + self.bytes += e.bytes; + self.entries.insert(key, e); + } + if let Some(e) = self.entries.get_mut(&key) { + e.read_at = None; + e.refresh = false; + e.sent = None; + } + self.store(key, known); + } + + /// Keeps the entries whose process `alive` says still lives. + pub fn retain_live(&mut self, mut alive: impl FnMut(ProcKey) -> bool) { + let mut freed = 0; + self.entries.retain(|k, e| { + let keep = alive(*k); + if !keep { + freed += e.bytes; + } + keep + }); + self.bytes -= freed; + } + + pub fn get(&self, key: ProcKey) -> Option<&Known> { + self.entries.get(&key).map(|e| &e.known) + } + + pub fn facts(&self, key: ProcKey) -> Option<&Facts> { + match self.get(key) { + Some(Known::Facts(f)) => Some(f), + _ => None, + } + } + + pub fn user(&self, key: ProcKey) -> Option<&str> { + self.facts(key).and_then(|f| f.user.as_deref()) + } + + pub fn command_line(&self, key: ProcKey) -> Option<&str> { + self.facts(key).and_then(|f| f.command_line.as_deref()) + } + + pub fn class(&self, key: ProcKey) -> Option { + self.facts(key).and_then(|f| f.class) + } + + pub fn efficiency(&self, key: ProcKey) -> Option { + self.facts(key).and_then(Facts::efficiency) + } + + pub fn len(&self) -> usize { + self.entries.len() + } + + pub fn is_empty(&self) -> bool { + self.entries.is_empty() + } + + /// The bytes held, texts and entries. + pub fn bytes(&self) -> usize { + self.bytes + } + + /// Puts `known` in the entry of `key` (which exists) within the byte cap: the least recently asked other entries + /// go first; when every other one was named by the latest ask, these facts keep no command line. + fn store(&mut self, key: ProcKey, mut known: Known) { + let Some(old) = self.entries.get(&key).map(|e| e.bytes) else { return }; + let mut bytes = bytes_of(&known); + while self.bytes - old + bytes > MAX_BOOK_BYTES { + if self.evict_one(Some(key)) { + continue; + } + if let Known::Facts(f) = &mut known { + f.command_line = None; + } + bytes = bytes_of(&known); + break; + } + if let Some(e) = self.entries.get_mut(&key) { + self.bytes = self.bytes - e.bytes + bytes; + e.bytes = bytes; + e.known = known; + } + } + + /// Removes the least recently asked entry not named by the latest ask (and not `keep`); false when there is none. + fn evict_one(&mut self, keep: Option) -> bool { + let tick = self.tick; + let oldest = self + .entries + .iter() + .filter(|(k, e)| e.asked < tick && Some(**k) != keep) + .min_by_key(|(_, e)| e.asked) + .map(|(k, _)| *k); + match oldest.and_then(|k| self.entries.remove(&k)) { + Some(e) => { + self.bytes -= e.bytes; + true + } + None => false, + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn a_refused_open_is_gone_only_for_a_pid_that_names_nothing() { + let k = ProcKey { pid: 9, created: 1 }; + assert_eq!(refused(k, INVALID_PARAMETER), Answer::Gone(k)); + assert_eq!(refused(k, access::ACCESS_DENIED), Answer::Denied(k)); + assert_eq!(refused(k, 1), Answer::Denied(k), "any other refusal: not available, never retried"); + } + + #[test] + fn the_text_span_stays_inside_the_filled_bytes() { + let h = 16; + assert_eq!(text_span(16, 8, h, 24), Some(8..12)); + assert_eq!(text_span(16, 8, h, 23), None, "past the filled bytes"); + assert_eq!(text_span(14, 4, h, 64), None, "inside the header"); + assert_eq!(text_span(17, 4, h, 64), None, "odd offset"); + assert_eq!(text_span(16, 3, h, 64), None, "odd length"); + assert_eq!(text_span(usize::MAX - 1, 4, h, 64), None, "overflow"); + } + + /// A buffer as the kernel fills it: the UNICODE_STRING, then the text; `point` moves the text's pointer. + fn kernel_copy(text: &str, point: impl FnOnce(usize) -> usize) -> (Vec, usize) { + let units: Vec = text.encode_utf16().collect(); + let header = std::mem::size_of::(); + let mut buf = vec![0u64; (header + units.len() * 2).div_ceil(8) + 1]; + let base = buf.as_ptr() as usize; + let n = (units.len() * 2) as u16; + let head = UNICODE_STRING { Length: n, MaximumLength: n, Buffer: PWSTR(point(base + header) as *mut u16) }; + // SAFETY: buf holds the header and the units after it; the pointer written is never followed. + unsafe { + let p = buf.as_mut_ptr().cast::(); + std::ptr::write(p.cast::(), head); + std::ptr::copy_nonoverlapping(units.as_ptr(), p.add(header).cast::(), units.len()); + } + (buf, header + units.len() * 2) + } + + #[test] + fn the_kernel_copy_is_read_only_from_inside_the_buffer() { + let (buf, filled) = kernel_copy("app.exe --x", |p| p); + assert_eq!(parse_command_line(&buf, filled), Some(("app.exe --x".to_string(), false))); + let (buf, filled) = kernel_copy("app.exe --x", |p| p + 4096); + assert_eq!(parse_command_line(&buf, filled), None, "a pointer past the buffer"); + let (buf, filled) = kernel_copy("app.exe --x", |p| p - 64); + assert_eq!(parse_command_line(&buf, filled), None, "a pointer before it"); + let (buf, filled) = kernel_copy("app.exe --x", |p| p); + assert_eq!(parse_command_line(&buf, filled - 2), None, "the text longer than what was filled"); + assert_eq!(parse_command_line(&buf, 4), None, "less than a header"); + let (buf, filled) = kernel_copy("", |_| 0); + assert_eq!(parse_command_line(&buf, filled), Some((String::new(), false))); + } +} diff --git a/apps/tasks/src/app/resolver.rs b/apps/tasks/src/app/resolver.rs index 08fc1c16..0098de50 100644 --- a/apps/tasks/src/app/resolver.rs +++ b/apps/tasks/src/app/resolver.rs @@ -170,6 +170,11 @@ impl Resolver { queued } + /// The queue holds MAX_PENDING requests: the next one is dropped, whatever it is. + pub fn is_full(&self) -> bool { + self.pending() >= MAX_PENDING + } + /// Requests waiting. pub fn pending(&self) -> usize { lock(&self.shared).queue.len() @@ -637,6 +642,17 @@ pub struct Identity { pub aumid: Option, } +/// What the name book knows of a program's icon. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum IconState { + /// Not answered yet. + Pending, + /// The bitmap is in the book. + Ready, + /// The answer was that there is none (kept: never asked again). + None, +} + /// What the UI asks for once per session (see NameBook::first). #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub enum Ask { @@ -666,6 +682,11 @@ fn icon_bytes(b: &IconBitmap) -> usize { impl IconStore { /// The icon of `id`; counts as drawn. + /// Whether an icon is stored (not counted as drawn). + pub fn contains(&self, id: IdentityId) -> bool { + self.map.contains_key(&id) + } + pub fn get(&self, id: IdentityId) -> Option<&IconBitmap> { let e = self.map.get(&id)?; self.tick.set(self.tick.get() + 1); @@ -717,8 +738,14 @@ pub struct NameBook { publishers: HashMap>, icons: IconStore, asked: HashSet, + /// Programs the resolver answered with no icon. + icon_failed: HashSet, /// Scenes: identity key -> name. fixture: HashMap, + /// Scenes: a program with no answer has none (no resolver runs to give one). + fixture_no_icons: bool, + /// Scenes: programs whose icon is still to come, whatever the rule above says. + fixture_pending: HashSet, } impl NameBook { @@ -733,6 +760,21 @@ impl NameBook { self.asked.insert(a) } + /// Takes `a` back as not asked, so that the next frame asks again (its request was dropped because the queue was + /// full). + pub fn unask(&mut self, a: Ask) { + self.asked.remove(&a); + } + + /// Asks the resolver for `a` once per session: `make` builds the request the first time only. A request dropped + /// because the queue is full is not kept as asked, so a later frame retries. A duplicate of a waiting request is kept as asked (unless the queue is full too, then it is + /// retried, which costs one more duplicate). + pub fn ask(&mut self, resolver: &Resolver, a: Ask, make: impl FnOnce() -> Request, visible: bool) { + if self.first(a) && !resolver.request(make(), visible) && resolver.is_full() { + self.unask(a); + } + } + pub fn identity(&self, hwnd: isize, pid: u32) -> Option<&Identity> { self.identities.get(&(hwnd, pid)) } @@ -755,6 +797,41 @@ impl NameBook { self.icons.get(id) } + /// Whether the icon of `id` is here, known to be missing, or still to come. + pub fn icon_state(&self, id: IdentityId) -> IconState { + if self.icons.contains(id) { + IconState::Ready + } else if self.fixture_pending.contains(&id) { + IconState::Pending + } else if self.icon_failed.contains(&id) || self.fixture_no_icons { + IconState::None + } else { + IconState::Pending + } + } + + /// Scenes: no answer means no icon (nothing runs to answer), instead of the pending look. + pub fn set_fixture_no_icons(&mut self, on: bool) { + self.fixture_no_icons = on; + } + + /// Scenes: the icon of this identity has not come yet. + pub fn set_fixture_pending(&mut self, id: IdentityId) { + self.fixture_pending.insert(id); + } + + /// Scenes: the icon of an identity, as an answer would give it. + pub fn set_fixture_icon(&mut self, id: IdentityId, bitmap: Option) { + match bitmap { + Some(b) => { + self.icons.insert(id, b); + } + None => { + self.icon_failed.insert(id); + } + } + } + pub fn icons(&self) -> &IconStore { &self.icons } @@ -790,11 +867,18 @@ pub fn on_done(b: &mut NameBook, m: ResolverDone) -> bool { changed |= NameBook::set_name(&mut b.exe_names, e, &name); } } - Answer::Icon { identity, bitmap, .. } => { - if let Some(bitmap) = bitmap { - changed |= b.icons.insert(identity, bitmap); + Answer::Icon { identity, bitmap, .. } => match bitmap { + Some(bitmap) => { + if b.icons.insert(identity, bitmap) { + b.icon_failed.remove(&identity); + changed = true; + } else { + // Too big to keep: the row shows its placeholder. + changed |= b.icon_failed.insert(identity); + } } - } + None => changed |= b.icon_failed.insert(identity), + }, Answer::Publisher { exe_id, publisher } => { if let Some(p) = publisher { // A publisher is not drawn in a row: it changes nothing the pipeline shows. diff --git a/apps/tasks/src/app/sampling.rs b/apps/tasks/src/app/sampling.rs index ee88b9d2..be7e665d 100644 --- a/apps/tasks/src/app/sampling.rs +++ b/apps/tasks/src/app/sampling.rs @@ -15,13 +15,13 @@ use super::options::TasksOptions; use crate::engine::cadence::{self, Control, Refresh}; use crate::engine::frame::Frame; use crate::engine::host::{default_samplers, FrameSink, HostStats, SamplerHost}; -use crate::engine::need::{need_set, ViewNeeds}; +use crate::engine::need::{need_set, Strip, StripCells, ViewNeeds}; use crate::model::view::{ColumnId, Page, ViewMode}; use crate::ui::screen::{FrameReady, TIMER_SNAPSHOT_B}; /// The columns of the beta, in the need set of every view (the column chooser is T8's). -pub const DEFAULT_COLUMNS: [ColumnId; 5] = - [ColumnId::Name, ColumnId::Cpu, ColumnId::Memory, ColumnId::Io, ColumnId::Pid]; +pub const DEFAULT_COLUMNS: [ColumnId; 6] = + [ColumnId::Name, ColumnId::Status, ColumnId::Cpu, ColumnId::Memory, ColumnId::Io, ColumnId::Pid]; /// The machine's CPU load under which the idle rule may slow the sampler down. const CALM_CPU_PCT: f32 = 10.0; @@ -237,16 +237,31 @@ pub struct ControlInputs { pub machine_cpu_pct: f32, pub mode: ViewMode, pub windows_rows_visible: bool, + /// The page on show. + pub page: Page, + /// The cells of the resource strip on Processes. + pub cells: StripCells, } +/// The resources the Performance list shows at all times: the processor (its per-processor loads and its speed in the +/// first line), the memory, and the disks and adapters it lists and opens pages for. +const PERFORMANCE_LIST: [Strip; 4] = [Strip::Cpu, Strip::Memory, Strip::Disk, Strip::Network]; + /// The sampler's control, pure. Windows, Hung and PerCore follow need_set exactly. pub fn control_of(i: &ControlInputs, o: &TasksOptions, now_ms: u64) -> Control { let minimised_or_cloaked = i.minimised || i.cloaked; + let mut cells = [Strip::Cpu; 5]; + let shown = i.cells.fill(&mut cells); + let strips: &[Strip] = match i.page { + Page::Performance => &PERFORMANCE_LIST, + Page::Processes => &cells[..shown], + _ => &[], + }; let need = need_set(&ViewNeeds { - page: Page::Processes, + page: i.page, mode: i.mode, columns: &DEFAULT_COLUMNS, - strips: &[], + strips, expanded: &[], windows_rows_visible: i.windows_rows_visible, verdict_on: false, @@ -377,8 +392,85 @@ mod tests { assert!(!grouped.has(Need::Services)); let open = control_of(&ControlInputs { windows_rows_visible: true, ..inputs() }, &o, 0).need; assert!(open.has(Need::Services)); + // The Status column shows in every mode: it needs the window list for the not-responding check. for mode in [ViewMode::Tree, ViewMode::List] { - assert!(!control_of(&ControlInputs { mode, ..inputs() }, &o, 0).need.has(Need::Windows)); + let need = control_of(&ControlInputs { mode, ..inputs() }, &o, 0).need; + assert!(need.has(Need::Windows) && need.has(Need::Hung), "{mode:?}"); + } + } + + #[test] + fn the_defaults_bring_no_system_data() { + let o = TasksOptions::default(); + let d = ControlInputs::default(); + assert_eq!((d.page, d.cells), (Page::Processes, StripCells::NONE)); + for mode in [ViewMode::Grouped, ViewMode::Tree, ViewMode::List] { + let need = control_of(&ControlInputs { mode, ..inputs() }, &o, 0).need; + assert!(!need.has(Need::Disks) && !need.has(Need::Nics) && !need.has(Need::CpuFacts), "{mode:?}"); + } + } + + #[test] + fn the_strip_cells_and_the_page_set_the_system_needs() { + let o = TasksOptions::default(); + let need = |i: ControlInputs| control_of(&i, &o, 0).need; + let disk = need(ControlInputs { cells: StripCells::NONE.with(Strip::Disk), ..inputs() }); + assert!(disk.has(Need::Disks) && !disk.has(Need::Nics) && !disk.has(Need::CpuFacts)); + let net = need(ControlInputs { cells: StripCells::NONE.with(Strip::Network), ..inputs() }); + assert!(net.has(Need::Nics) && !net.has(Need::Disks)); + let cpu = need(ControlInputs { cells: StripCells::NONE.with(Strip::Cpu), ..inputs() }); + assert!(cpu.has(Need::CpuFacts) && !cpu.has(Need::Disks) && !cpu.has(Need::Nics)); + let mem = need(ControlInputs { cells: StripCells::NONE.with(Strip::Memory), ..inputs() }); + assert!(!mem.has(Need::Disks) && !mem.has(Need::Nics) && !mem.has(Need::CpuFacts)); + // A shown strip reads the hung apps in the list and tree views too. + let cells = StripCells::NONE.with(Strip::Memory); + let list = need(ControlInputs { mode: ViewMode::List, cells, ..inputs() }); + assert!(list.has(Need::Hung) && list.has(Need::Windows)); + // Performance lists the processor with its speed, the memory, the disks and the adapters, whatever the strip says. + let perf = need(ControlInputs { page: Page::Performance, ..inputs() }); + assert!(perf.has(Need::CpuFacts) && perf.has(Need::PerCore)); + assert!(perf.has(Need::Disks) && perf.has(Need::Nics)); + // Other pages ignore the cells. + let all = StripCells::ALL.iter().fold(StripCells::NONE, |s, x| s.with(*x)); + for page in [Page::Details, Page::Services] { + let n = need(ControlInputs { page, cells: all, ..inputs() }); + assert!(!n.has(Need::Disks) && !n.has(Need::Nics) && !n.has(Need::CpuFacts), "{page:?}"); + } + } + + #[test] + fn the_performance_page_carries_the_disk_and_adapter_needs_and_other_pages_drop_them() { + let o = TasksOptions::default(); + let perf = control_of(&ControlInputs { page: Page::Performance, ..inputs() }, &o, 0).need; + assert!(perf.has(Need::Disks) && perf.has(Need::Nics)); + for page in [Page::Details, Page::Services, Page::Processes] { + let n = control_of(&ControlInputs { page, ..inputs() }, &o, 0).need; + assert!(!n.has(Need::Disks) && !n.has(Need::Nics), "{page:?}"); + } + } + + #[test] + fn the_details_page_reads_the_processes_and_the_hung_windows_and_nothing_of_the_system() { + let o = TasksOptions::default(); + let n = control_of(&ControlInputs { page: Page::Details, mode: ViewMode::List, ..inputs() }, &o, 0).need; + assert!(n.has(Need::Procs) && n.has(Need::Hung) && n.has(Need::Windows), "the Status column needs them"); + assert!(!n.has(Need::PerCore) && !n.has(Need::Services), "no per-core times, no service list"); + } + + #[test] + fn system_data_stops_with_the_window() { + use crate::engine::cadence::period_ms; + let o = TasksOptions::default(); + let all = StripCells::ALL.iter().fold(StripCells::NONE, |s, x| s.with(*x)); + let i = ControlInputs { cells: all, ..inputs() }; + assert_eq!(period_ms(&control_of(&i, &o, 0), false), Some(1000)); + for stopped in [ + ControlInputs { minimised: true, ..i }, + ControlInputs { cloaked: true, ..i }, + ControlInputs { display_off: true, ..i }, + ControlInputs { paused: true, ..i }, + ] { + assert_eq!(period_ms(&control_of(&stopped, &o, 0), false), None, "{stopped:?}"); } } diff --git a/apps/tasks/src/app/state.rs b/apps/tasks/src/app/state.rs index b94c9b3f..1b317aee 100644 --- a/apps/tasks/src/app/state.rs +++ b/apps/tasks/src/app/state.rs @@ -28,6 +28,10 @@ const WRITE_DELAY_MS: u32 = 2000; const FILE_CAP: u64 = 64 * 1024; /// Placements of other monitor layouts kept in the file, the current one included; the oldest is dropped. pub const MAX_LAYOUTS: usize = 8; +/// Entries kept of what Run new task was given, newest first. +pub const MAX_RUN_HISTORY: usize = 10; +/// The longest entry kept (chars): a longer text is run but not remembered, so the file stays small. +pub const MAX_RUN_ENTRY: usize = 1024; /// The main window's placement under one monitor layout, as the file holds it. #[derive(Clone, Debug, PartialEq, Eq)] @@ -53,6 +57,8 @@ struct Inner { layout: String, /// Reads the layout id now; None: the id never changes (tests). layout_fn: Option String>, + /// What Run new task was given, newest first, at most MAX_RUN_HISTORY, no two equal. + run_history: Vec, /// Tree mode's collapsed nodes (row keys), for the session only: never written. tree_collapsed: std::collections::HashSet, /// Changed since the last flush. @@ -99,6 +105,18 @@ impl StateHandle { } } + /// What Run new task was given before, newest first. + pub fn run_history(&self) -> Vec { + self.lock().run_history.clone() + } + + /// Remembers one more thing given to Run new task: it goes first, an equal earlier entry (same letters, any case) + /// is merged into it, and only the newest MAX_RUN_HISTORY stay. A blank or very long text is not remembered. + pub fn push_run(&self, text: &str) { + let mut g = self.lock(); + push_run_entry(&mut g.run_history, text); + } + /// Whether the Tree node of this row key is collapsed (session only). pub fn tree_collapsed(&self, key: u64) -> bool { self.lock().tree_collapsed.contains(&key) @@ -237,6 +255,13 @@ fn apply_file(g: &mut Inner, bytes: &[u8]) -> bool { for (i, name) in COLLAPSED_KEYS.iter().enumerate() { g.collapsed[i] = v.get("collapsed").and_then(|c| c.get(name)).and_then(Value::as_bool); } + g.run_history.clear(); + if let Some(list) = v.get("run_history").and_then(Value::as_array) { + // The file's order is newest first: the oldest is pushed first. + for e in list.iter().rev().filter_map(Value::as_str) { + push_run_entry(&mut g.run_history, e); + } + } let mut entries = Vec::new(); if let Some(map) = v.get("placements").and_then(Value::as_object) { for (id, e) in map { @@ -258,6 +283,18 @@ fn apply_file(g: &mut Inner, bytes: &[u8]) -> bool { const COLLAPSED_KEYS: [&str; 3] = ["apps", "background", "windows"]; +/// The history rule of Run new task (see `StateHandle::push_run`). +fn push_run_entry(list: &mut Vec, text: &str) { + let text = text.trim(); + if text.is_empty() || text.chars().count() > MAX_RUN_ENTRY { + return; + } + let key = text.to_lowercase(); + list.retain(|e| e.to_lowercase() != key); + list.insert(0, text.to_string()); + list.truncate(MAX_RUN_HISTORY); +} + /// One placement of the file; None when a field is missing or the wrong type. fn entry_of(id: &str, v: &Value) -> Option { let r = v.get("rect")?.as_array()?; @@ -309,6 +346,9 @@ fn render(g: &Inner) -> Vec { root.insert("version".into(), json!(1)); root.insert("placements".into(), Value::Object(placements)); root.insert("collapsed".into(), Value::Object(collapsed)); + if !g.run_history.is_empty() { + root.insert("run_history".into(), json!(g.run_history)); + } if let Some(m) = g.view { let name = match m { ViewMode::Grouped => "grouped", @@ -449,6 +489,42 @@ mod tests { let _ = std::fs::remove_dir_all(&d); } + #[test] + fn run_history_is_newest_first_without_duplicates_and_capped_at_ten() { + let s = StateHandle::default(); + for n in 0..12 { + s.push_run(&format!("prog{n}.exe")); + } + let h = s.run_history(); + assert_eq!(h.len(), MAX_RUN_HISTORY, "only the last ten stay"); + assert_eq!((h[0].as_str(), h[9].as_str()), ("prog11.exe", "prog2.exe")); + s.push_run(" PROG5.exe "); + let h = s.run_history(); + assert_eq!(h[0], "PROG5.exe", "an equal entry in any case moves to the front with the new spelling"); + assert_eq!(h.iter().filter(|e| e.eq_ignore_ascii_case("prog5.exe")).count(), 1); + assert_eq!(h.len(), MAX_RUN_HISTORY); + s.push_run(" "); + s.push_run(&"x".repeat(MAX_RUN_ENTRY + 1)); + assert_eq!(s.run_history(), h, "a blank or an enormous text is not remembered"); + } + + #[test] + fn run_history_survives_a_restart_in_the_same_order() { + let d = temp("runhist"); + let p = Paths { roaming: None, local: Some(d.clone()) }; + let a = load_with(&p, "aaaa"); + for e in ["one", "two", "one", "three"] { + a.push_run(e); + } + a.touch(); + a.flush(); + let b = load_with(&p, "aaaa"); + assert_eq!(b.run_history(), vec!["three", "one", "two"]); + let raw: Value = serde_json::from_slice(&std::fs::read(d.join("state.json")).unwrap()).unwrap(); + assert_eq!(raw["run_history"], json!(["three", "one", "two"])); + let _ = std::fs::remove_dir_all(&d); + } + #[test] fn state_bad_file_ignored() { let d = temp("bad"); diff --git a/apps/tasks/src/engine/frame.rs b/apps/tasks/src/engine/frame.rs index 1ee9cf74..aeeb9d3d 100644 --- a/apps/tasks/src/engine/frame.rs +++ b/apps/tasks/src/engine/frame.rs @@ -1,5 +1,6 @@ //! The data one sampler tick produces. Real: the samplers fill it, the window reads it. use crate::engine::need::NeedSet; +use crate::engine::sysinfo::SysExtra; use crate::model::classify::PathMap; use crate::model::verdict::SysState; use oled_sysmon::cpu::CpuDelta; @@ -70,10 +71,17 @@ pub struct Frame { /// error: the snapshot failed; such a frame carries no procs (take, TQ4). pub error: Option, pub tick_us: u32, + /// Disks, adapters and processor facts from the system thread; None while no need asks for them. The result is + /// the thread's latest, one tick old at most. + pub sys_extra: Option>, } pub trait Sampler: Send { fn need(&self) -> crate::engine::need::Need; + /// Whether this sampler runs for the need set (default: its own need is in it). + fn wanted(&self, need: NeedSet) -> bool { + need.has(self.need()) + } fn sample(&mut self, now_us: u64, out: &mut Frame) -> Result<(), SysmonError>; } diff --git a/apps/tasks/src/engine/host.rs b/apps/tasks/src/engine/host.rs index 4b0c7ade..0d4bb479 100644 --- a/apps/tasks/src/engine/host.rs +++ b/apps/tasks/src/engine/host.rs @@ -4,6 +4,7 @@ use crate::engine::frame::{Frame, Sampler}; use crate::engine::paths::{PathSampler, Win32Paths}; use crate::engine::services::{ScmServices, ServiceSampler}; use crate::engine::sys::{CoreSampler, ProcSampler}; +use crate::engine::sysinfo::{SysSampler, WinSys}; use crate::engine::windows::{Win32Windows, WindowSampler}; use oled_sysmon::cpu::{logical_cpus, SystemCpu}; use oled_sysmon::mem::memory; @@ -185,8 +186,9 @@ impl Worker { work.windows_fresh = false; work.services_fresh = false; work.error = None; + work.sys_extra = None; for s in &mut self.samplers { - if control.need.has(s.need()) { + if s.wanted(control.need) { // A failed sampler leaves its error in the frame (ProcSampler) or its old data. let _ = s.sample(start, &mut work); } @@ -277,6 +279,7 @@ impl SamplerHost { into.sys.clone_from(&slot.sys); into.error = slot.error; into.tick_us = slot.tick_us; + into.sys_extra.clone_from(&slot.sys_extra); into.added.clear(); into.gone.clear(); into.dt_ms = dt_ms; @@ -320,7 +323,8 @@ impl Drop for SamplerHost { } } -/// ProcSampler, PathSampler, CoreSampler, WindowSampler, ServiceSampler, in this order. +/// ProcSampler, PathSampler, CoreSampler, WindowSampler, ServiceSampler, +/// SysSampler, in this order. pub fn default_samplers() -> Vec> { vec![ Box::new(ProcSampler::new()), @@ -328,6 +332,7 @@ pub fn default_samplers() -> Vec> { Box::new(CoreSampler::new()), Box::new(WindowSampler::new(Win32Windows)), Box::new(ServiceSampler::new(ScmServices)), + Box::new(SysSampler::new(WinSys::default())), ] } diff --git a/apps/tasks/src/engine/mod.rs b/apps/tasks/src/engine/mod.rs index 728daab8..0e4f1d6d 100644 --- a/apps/tasks/src/engine/mod.rs +++ b/apps/tasks/src/engine/mod.rs @@ -6,6 +6,7 @@ pub mod need; pub mod paths; pub mod services; pub mod sys; +pub mod sysinfo; pub mod trace; pub mod windows; @@ -86,6 +87,7 @@ mod tests { services_error: None, error: None, tick_us: 0, + sys_extra: None, }; assert_eq!(f.windows.len(), 1); let _ = ( diff --git a/apps/tasks/src/engine/need.rs b/apps/tasks/src/engine/need.rs index 650f69c0..fc73f58f 100644 --- a/apps/tasks/src/engine/need.rs +++ b/apps/tasks/src/engine/need.rs @@ -14,6 +14,8 @@ pub enum Need { GpuTotal, GpuPerProc, Services, + /// Processor speed and facts, uptime (the system thread). + CpuFacts, } #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] @@ -41,6 +43,38 @@ pub enum Strip { Gpu, } +/// A small set of strip cells, so the window's inputs stay Copy. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct StripCells(u8); + +impl StripCells { + pub const NONE: StripCells = StripCells(0); + pub const ALL: [Strip; 5] = [Strip::Cpu, Strip::Memory, Strip::Disk, Strip::Network, Strip::Gpu]; + const fn bit(s: Strip) -> u8 { + 1 << s as u8 + } + pub const fn with(self, s: Strip) -> StripCells { + StripCells(self.0 | Self::bit(s)) + } + pub const fn has(self, s: Strip) -> bool { + self.0 & Self::bit(s) != 0 + } + pub const fn is_empty(self) -> bool { + self.0 == 0 + } + /// The cells in the order of Strip, into `buf`; returns how many. + pub fn fill(self, buf: &mut [Strip; 5]) -> usize { + let mut n = 0; + for s in Self::ALL { + if self.has(s) { + buf[n] = s; + n += 1; + } + } + n + } +} + pub struct ViewNeeds<'a> { pub page: Page, pub mode: ViewMode, @@ -63,7 +97,9 @@ pub fn need_set(v: &ViewNeeds) -> NeedSet { if v.page != Page::Startup || v.verdict_on { set = set.with(Need::Procs); } - let windows = grouped || v.verdict_on; + // The strip's verdict reads the hung apps: any shown strip on Processes brings them, whatever the view. + let strip_on = processes && !v.strips.is_empty(); + let windows = grouped || v.verdict_on || strip_on; let hung = windows || has_col(ColumnId::Status); if hung { // Hung always brings Windows: the hung check walks the window list. @@ -78,12 +114,17 @@ pub fn need_set(v: &ViewNeeds) -> NeedSet { if performance && v.expanded.contains(&Strip::Memory) { set = set.with(Need::MemLists); } - if performance && has_strip(Strip::Disk) { + // The strip's Disco and Rete cells show on Processes; the Performance list shows every disk and adapter. + let strip_shown = processes || performance; + if strip_shown && has_strip(Strip::Disk) { set = set.with(Need::Disks); } - if performance && has_strip(Strip::Network) { + if strip_shown && has_strip(Strip::Network) { set = set.with(Need::Nics); } + if strip_shown && has_strip(Strip::Cpu) { + set = set.with(Need::CpuFacts); + } if performance && has_strip(Strip::Gpu) { set = set.with(Need::GpuTotal); } @@ -100,7 +141,7 @@ pub fn need_set(v: &ViewNeeds) -> NeedSet { mod tests { use super::*; - const ALL: [Need; 10] = [ + const ALL: [Need; 11] = [ Need::Procs, Need::Windows, Need::Hung, @@ -111,6 +152,7 @@ mod tests { Need::GpuTotal, Need::GpuPerProc, Need::Services, + Need::CpuFacts, ]; fn set_of(list: &[Need]) -> NeedSet { @@ -129,6 +171,20 @@ mod tests { } } + #[test] + fn a_shown_strip_brings_the_hung_check_in_every_view() { + for mode in [ViewMode::Grouped, ViewMode::Tree, ViewMode::List] { + let on = need_set(&ViewNeeds { mode, windows_rows_visible: false, strips: &[Strip::Memory], ..base() }); + assert!(on.has(Need::Windows) && on.has(Need::Hung), "{mode:?}"); + let off = need_set(&ViewNeeds { mode, windows_rows_visible: false, strips: &[], ..base() }); + assert_eq!(off.has(Need::Hung), mode == ViewMode::Grouped, "{mode:?}"); + } + // Another page has no strip and no verdict. + let other = + need_set(&ViewNeeds { page: Page::Services, mode: ViewMode::List, strips: &[Strip::Memory], ..base() }); + assert!(!other.has(Need::Hung)); + } + #[test] fn need_set_table() { use Need::*; @@ -179,7 +235,7 @@ mod tests { ( "performance cpu strip", ViewNeeds { page: Page::Performance, strips: &[Strip::Cpu], ..base() }, - vec![Procs, PerCore], + vec![Procs, PerCore, CpuFacts], ), ( "performance every strip, memory expanded", @@ -189,7 +245,7 @@ mod tests { expanded: &[Strip::Memory], ..base() }, - vec![Procs, PerCore, MemLists, Disks, Nics, GpuTotal], + vec![Procs, PerCore, MemLists, Disks, Nics, GpuTotal, CpuFacts], ), ( "performance memory strip not expanded", @@ -203,10 +259,55 @@ mod tests { ), ("services page", ViewNeeds { page: Page::Services, ..base() }, vec![Procs, Services]), ( - "strips outside performance are ignored", - ViewNeeds { strips: &[Strip::Disk, Strip::Gpu], ..base() }, + "processes strip: disk cell", + ViewNeeds { strips: &[Strip::Disk], ..base() }, + vec![Procs, Windows, Hung, PerCore, Services, Disks], + ), + ( + "processes strip: network cell", + ViewNeeds { strips: &[Strip::Network], ..base() }, + vec![Procs, Windows, Hung, PerCore, Services, Nics], + ), + ( + "processes strip: cpu cell brings the facts and the hung check, not the cores", + ViewNeeds { mode: ViewMode::List, windows_rows_visible: false, strips: &[Strip::Cpu], ..base() }, + vec![Procs, Windows, Hung, CpuFacts], + ), + ( + "processes strip: memory cell brings nothing more", + ViewNeeds { strips: &[Strip::Memory], ..base() }, + vec![Procs, Windows, Hung, PerCore, Services], + ), + ( + "processes strip: all four cells", + ViewNeeds { strips: &[Strip::Cpu, Strip::Memory, Strip::Disk, Strip::Network], ..base() }, + vec![Procs, Windows, Hung, PerCore, Services, Disks, Nics, CpuFacts], + ), + ( + "performance disk only", + ViewNeeds { page: Page::Performance, strips: &[Strip::Disk], ..base() }, + vec![Procs, Disks], + ), + ( + "performance network only", + ViewNeeds { page: Page::Performance, strips: &[Strip::Network], ..base() }, + vec![Procs, Nics], + ), + ( + "strips on the other pages are ignored", + ViewNeeds { page: Page::Services, strips: &[Strip::Disk, Strip::Network, Strip::Cpu], ..base() }, + vec![Procs, Services], + ), + ( + "gpu cell only counts on performance", + ViewNeeds { strips: &[Strip::Gpu], ..base() }, vec![Procs, Windows, Hung, PerCore, Services], ), + ( + "details page ignores the strip", + ViewNeeds { page: Page::Details, strips: &[Strip::Disk, Strip::Cpu], ..base() }, + vec![Procs], + ), ]; for (name, view, want) in cases { assert_eq!(need_set(&view), set_of(&want), "{name}"); @@ -222,6 +323,20 @@ mod tests { assert!(need_set(&on).has(Need::Procs)); } + #[test] + fn strip_cells_are_a_set() { + let none = StripCells::default(); + assert!(none.is_empty() && none == StripCells::NONE); + let c = StripCells::NONE.with(Strip::Network).with(Strip::Cpu); + assert!(c.has(Strip::Cpu) && c.has(Strip::Network) && !c.has(Strip::Disk) && !c.is_empty()); + let mut buf = [Strip::Gpu; 5]; + let n = c.fill(&mut buf); + assert_eq!(&buf[..n], &[Strip::Cpu, Strip::Network]); + assert_eq!(c.with(Strip::Cpu), c); + let all = StripCells::ALL.iter().fold(none, |s, x| s.with(*x)); + assert_eq!(all.fill(&mut buf), 5); + } + #[test] fn set_bits_are_distinct() { let mut seen = NeedSet::EMPTY; diff --git a/apps/tasks/src/engine/sysinfo.rs b/apps/tasks/src/engine/sysinfo.rs new file mode 100644 index 00000000..cd23fc81 --- /dev/null +++ b/apps/tasks/src/engine/sysinfo.rs @@ -0,0 +1,467 @@ +//! Disks, adapters and processor facts, read on their own thread ("tasks-sys") so the sampler tick never waits for them. +//! +//! The thread sleeps on a condition variable with no timeout: it reads once each time the sampler pokes it, which the +//! sampler does once per tick while a need asks for the data, so the page cadence is the tick's own and a hidden, +//! minimised or paused window never wakes it. The thread starts at the first poke; with empty needs it never exists. +//! The tick only takes a Mutex slot and signals the condition. +use crate::engine::frame::{Frame, Sampler}; +use crate::engine::need::{Need, NeedSet}; +use oled_sysmon::cpuinfo::{CpuFacts, CpuReading, CpuState}; +use oled_sysmon::disk::{DiskReport, DiskState}; +use oled_sysmon::net::{NetReport, NetState}; +use oled_sysmon::SysmonError; +use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; +use std::sync::{Arc, Condvar, Mutex, MutexGuard}; +use windows::Win32::Foundation::FILETIME; +use windows::Win32::System::Threading::{GetCurrentThread, GetThreadTimes}; + +pub const WANT_DISKS: u8 = 1; +pub const WANT_NICS: u8 = 2; +pub const WANT_CPU: u8 = 4; + +/// Kernel plus user time of the "tasks-sys" thread in this process, 100 ns units, as of its last read (the bench reads it). +static THREAD_CPU_100NS: AtomicU64 = AtomicU64::new(0); +/// Reads completed by every "tasks-sys" thread of this process. +static READS_TOTAL: AtomicU64 = AtomicU64::new(0); + +pub fn sys_thread_cpu_100ns() -> u64 { + THREAD_CPU_100NS.load(Ordering::Relaxed) +} + +pub fn sys_reads_total() -> u64 { + READS_TOTAL.load(Ordering::Relaxed) +} + +/// A result older than this when the sampler comes back (a stop in between) is dropped, not shown as current. +pub const STALE_US: u64 = 15_000_000; + +/// What the thread read last. A part is None while its need was not asked. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct SysExtra { + /// 1 for the first read of a thread, then up by one. + pub seq: u64, + pub disks: Option, + pub nics: Option, + /// Current speed and uptime. + pub cpu: Option, + /// Architecture, topology, virtualisation: read once and kept. + pub cpu_facts: Option, +} + +/// The wanted parts of a need set. +pub fn want_of(need: NeedSet) -> u8 { + let mut w = 0; + if need.has(Need::Disks) { + w |= WANT_DISKS; + } + if need.has(Need::Nics) { + w |= WANT_NICS; + } + if need.has(Need::CpuFacts) { + w |= WANT_CPU; + } + w +} + +/// The readers behind the thread, so tests can stand in for the machine. +pub trait SysSource: Send { + /// Fills the parts in `want` and leaves the others None. A part that was not wanted is forgotten, so the rates + /// of its next read never span the gap. + fn read(&mut self, want: u8, out: &mut SysExtra); +} + +/// The real readers of oled-sysmon. +#[derive(Default)] +pub struct WinSys { + disks: Option, + nets: Option, + cpu: Option, +} + +impl SysSource for WinSys { + fn read(&mut self, want: u8, out: &mut SysExtra) { + if want & WANT_DISKS != 0 { + out.disks = Some(self.disks.get_or_insert_with(DiskState::new).read()); + } else { + self.disks = None; + } + if want & WANT_NICS != 0 { + out.nics = Some(self.nets.get_or_insert_with(NetState::new).read()); + } else { + self.nets = None; + } + if want & WANT_CPU != 0 { + let cpu = self.cpu.get_or_insert_with(CpuState::new); + out.cpu = Some(cpu.read()); + out.cpu_facts = Some(cpu.facts()); + } else { + self.cpu = None; + } + } +} + +fn lock(m: &Mutex) -> MutexGuard<'_, T> { + m.lock().unwrap_or_else(|e| e.into_inner()) +} + +#[derive(Default)] +struct Ctl { + pending: bool, + exit: bool, + want: u8, +} + +struct Shared { + /// Taken by the worker when it starts. + src: Mutex>, + ctl: Mutex, + cv: Condvar, + slot: Mutex>>, + reads: AtomicU64, + wakes: AtomicU64, + alive: AtomicBool, +} + +fn thread_cpu_100ns() -> u64 { + let (mut c, mut e, mut k, mut u) = + (FILETIME::default(), FILETIME::default(), FILETIME::default(), FILETIME::default()); + // SAFETY: the pseudo handle of this thread needs no closing; the out pointers are locals. + let ok = unsafe { GetThreadTimes(GetCurrentThread(), &mut c, &mut e, &mut k, &mut u) }; + if ok.is_err() { + return 0; + } + let join = |f: FILETIME| (u64::from(f.dwHighDateTime) << 32) | u64::from(f.dwLowDateTime); + join(k) + join(u) +} + +fn worker(shared: &Shared) { + let Some(mut src) = lock(&shared.src).take() else { return }; + shared.alive.store(true, Ordering::Release); + let mut seq = 0u64; + loop { + let want = { + let mut g = lock(&shared.ctl); + while !g.pending && !g.exit { + g = shared.cv.wait(g).unwrap_or_else(|e| e.into_inner()); + } + shared.wakes.fetch_add(1, Ordering::Relaxed); + if g.exit { + break; + } + g.pending = false; + g.want + }; + if want == 0 { + continue; + } + let mut out = SysExtra::default(); + src.read(want, &mut out); + if lock(&shared.ctl).exit { + break; + } + seq += 1; + out.seq = seq; + *lock(&shared.slot) = Some(Arc::new(out)); + THREAD_CPU_100NS.store(thread_cpu_100ns(), Ordering::Relaxed); + READS_TOTAL.fetch_add(1, Ordering::Relaxed); + shared.reads.fetch_add(1, Ordering::Relaxed); + } + shared.alive.store(false, Ordering::Release); +} + +/// Pokes the thread once per tick and hands the latest result to the frame. need() is Disks; wanted() is any of the +/// three needs the thread serves. +pub struct SysSampler { + shared: Arc>, + started: bool, + /// u64::MAX before the first call. + last_call_us: u64, + error: Option, +} + +impl SysSampler { + pub fn new(src: S) -> Self { + SysSampler { + shared: Arc::new(Shared { + src: Mutex::new(Some(src)), + ctl: Mutex::new(Ctl::default()), + cv: Condvar::new(), + slot: Mutex::new(None), + reads: AtomicU64::new(0), + wakes: AtomicU64::new(0), + alive: AtomicBool::new(false), + }), + started: false, + last_call_us: u64::MAX, + error: None, + } + } + + /// Reads the thread has completed. + pub fn reads(&self) -> u64 { + self.shared.reads.load(Ordering::Relaxed) + } + + /// Times the thread woke up (zero while nobody asked). + pub fn wakes(&self) -> u64 { + self.shared.wakes.load(Ordering::Relaxed) + } + + /// True from the thread's start until it ends. + pub fn thread_alive(&self) -> bool { + self.shared.alive.load(Ordering::Acquire) + } + + pub fn thread_started(&self) -> bool { + self.started + } + + /// Win32 code of the last failure to start the thread. + pub fn start_error(&self) -> Option { + self.error + } + + fn start_worker(&mut self) -> Result<(), u32> { + if self.started { + return Ok(()); + } + let shared = Arc::clone(&self.shared); + std::thread::Builder::new() + .name("tasks-sys".into()) + .stack_size(256 * 1024) + .spawn(move || worker(&shared)) + .map_err(|e| e.raw_os_error().map_or(8, |c| c as u32))?; + self.started = true; + Ok(()) + } + + fn poke(&self, want: u8) { + let mut g = lock(&self.shared.ctl); + g.want = want; + g.pending = true; + drop(g); + self.shared.cv.notify_one(); + } +} + +impl Sampler for SysSampler { + fn need(&self) -> Need { + Need::Disks + } + + fn wanted(&self, need: NeedSet) -> bool { + want_of(need) != 0 + } + + fn sample(&mut self, now_us: u64, out: &mut Frame) -> Result<(), SysmonError> { + let want = want_of(out.need); + if want == 0 { + return Ok(()); + } + let gap = self.last_call_us != u64::MAX && now_us.saturating_sub(self.last_call_us) >= STALE_US; + self.last_call_us = now_us; + { + let mut slot = lock(&self.shared.slot); + if gap { + *slot = None; + } + out.sys_extra = slot.clone(); + } + match self.start_worker() { + Ok(()) => self.poke(want), + Err(code) => self.error = Some(code), + } + Ok(()) + } +} + +/// Tells the thread to end; never joins it (it may sit inside a slow disk call and ends with the process). +impl Drop for SysSampler { + fn drop(&mut self) { + lock(&self.shared.ctl).exit = true; + self.shared.cv.notify_one(); + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::sync::atomic::AtomicUsize; + use std::time::{Duration, Instant}; + + /// Counts its reads; optionally blocks inside a read until released. + struct Fake { + reads: Arc, + wants: Arc>>, + gate: Option, Condvar)>>, + } + + impl SysSource for Fake { + fn read(&mut self, want: u8, out: &mut SysExtra) { + self.reads.fetch_add(1, Ordering::SeqCst); + lock(&self.wants).push(want); + if let Some(g) = &self.gate { + let mut open = lock(&g.0); + while !*open { + open = g.1.wait(open).unwrap_or_else(|e| e.into_inner()); + } + } + if want & WANT_DISKS != 0 { + out.disks = Some(DiskReport::default()); + } + if want & WANT_NICS != 0 { + out.nics = Some(NetReport::default()); + } + } + } + + fn fake() -> (Fake, Arc, Arc>>) { + let (reads, wants) = (Arc::new(AtomicUsize::new(0)), Arc::new(Mutex::new(Vec::new()))); + (Fake { reads: Arc::clone(&reads), wants: Arc::clone(&wants), gate: None }, reads, wants) + } + + fn until(what: &str, mut f: impl FnMut() -> bool) { + let t = Instant::now(); + while !f() { + assert!(t.elapsed() < Duration::from_secs(5), "timed out waiting for {what}"); + std::thread::sleep(Duration::from_millis(2)); + } + } + + fn frame(need: &[Need]) -> Frame { + Frame { need: need.iter().fold(NeedSet::EMPTY, |s, n| s.with(*n)), ..Frame::default() } + } + + #[test] + fn want_follows_the_three_needs() { + let w = |n: &[Need]| want_of(n.iter().fold(NeedSet::EMPTY, |s, x| s.with(*x))); + assert_eq!(w(&[]), 0); + assert_eq!(w(&[Need::Procs, Need::PerCore, Need::Services]), 0); + assert_eq!(w(&[Need::Disks]), WANT_DISKS); + assert_eq!(w(&[Need::Nics]), WANT_NICS); + assert_eq!(w(&[Need::CpuFacts]), WANT_CPU); + assert_eq!(w(&[Need::Disks, Need::Nics, Need::CpuFacts]), WANT_DISKS | WANT_NICS | WANT_CPU); + } + + #[test] + fn wanted_is_any_of_the_three() { + let (f, _, _) = fake(); + let s = SysSampler::new(f); + let set = |n: Need| NeedSet::EMPTY.with(n); + assert!(!s.wanted(NeedSet::EMPTY)); + assert!(!s.wanted(set(Need::Procs))); + assert!(s.wanted(set(Need::Disks)) && s.wanted(set(Need::Nics)) && s.wanted(set(Need::CpuFacts))); + } + + #[test] + fn no_need_no_thread() { + let (f, reads, _) = fake(); + let mut s = SysSampler::new(f); + let mut fr = frame(&[Need::Procs]); + for t in 0..5 { + s.sample(t * 1_000_000, &mut fr).unwrap(); + } + std::thread::sleep(Duration::from_millis(100)); + assert!(!s.thread_started() && !s.thread_alive()); + assert_eq!((s.wakes(), s.reads(), reads.load(Ordering::SeqCst)), (0, 0, 0)); + assert!(fr.sys_extra.is_none()); + } + + #[test] + fn one_read_per_poke_and_the_result_arrives_a_tick_later() { + let (f, reads, wants) = fake(); + let mut s = SysSampler::new(f); + let mut fr = frame(&[Need::Disks, Need::Nics]); + s.sample(0, &mut fr).unwrap(); + assert!(fr.sys_extra.is_none(), "the first tick has no result yet"); + until("the first read", || s.reads() == 1); + let mut fr2 = frame(&[Need::Disks, Need::Nics]); + s.sample(1_000_000, &mut fr2).unwrap(); + let x = fr2.sys_extra.clone().expect("the first read"); + assert_eq!(x.seq, 1); + assert!(x.disks.is_some() && x.nics.is_some() && x.cpu.is_none()); + until("the second read", || s.reads() == 2); + assert_eq!(reads.load(Ordering::SeqCst), 2); + assert_eq!(*lock(&wants), vec![WANT_DISKS | WANT_NICS; 2]); + // No poke: no read. + std::thread::sleep(Duration::from_millis(150)); + assert_eq!(reads.load(Ordering::SeqCst), 2); + assert!(s.thread_alive()); + } + + #[test] + fn the_wanted_parts_follow_the_need() { + let (f, _, wants) = fake(); + let mut s = SysSampler::new(f); + s.sample(0, &mut frame(&[Need::Disks])).unwrap(); + until("a read", || s.reads() == 1); + s.sample(1_000_000, &mut frame(&[Need::Nics])).unwrap(); + until("a second read", || s.reads() == 2); + assert_eq!(*lock(&wants), vec![WANT_DISKS, WANT_NICS]); + } + + #[test] + fn the_tick_never_waits_for_the_thread() { + let gate = Arc::new((Mutex::new(false), Condvar::new())); + let (mut f, reads, _) = fake(); + f.gate = Some(Arc::clone(&gate)); + let mut s = SysSampler::new(f); + let mut fr = frame(&[Need::Disks]); + s.sample(0, &mut fr).unwrap(); + until("the read to be inside", || reads.load(Ordering::SeqCst) == 1); + let t = Instant::now(); + for i in 1..=50u64 { + let mut fr = frame(&[Need::Disks]); + s.sample(i * 1_000, &mut fr).unwrap(); + assert!(fr.sys_extra.is_none()); + } + assert!(t.elapsed() < Duration::from_millis(200), "50 ticks took {:?}", t.elapsed()); + assert_eq!(s.reads(), 0); + // Release: the pokes that piled up are one read. + *lock(&gate.0) = true; + gate.1.notify_all(); + until("both reads", || s.reads() == 2); + std::thread::sleep(Duration::from_millis(100)); + assert_eq!(s.reads(), 2, "the pokes coalesce"); + } + + #[test] + fn a_result_after_a_long_gap_is_dropped() { + let (f, _, _) = fake(); + let mut s = SysSampler::new(f); + s.sample(0, &mut frame(&[Need::Disks])).unwrap(); + until("a read", || s.reads() == 1); + let mut fr = frame(&[Need::Disks]); + s.sample(STALE_US - 1, &mut fr).unwrap(); + assert!(fr.sys_extra.is_some()); + until("a read", || s.reads() == 2); + let mut fr = frame(&[Need::Disks]); + s.sample(STALE_US - 1 + STALE_US, &mut fr).unwrap(); + assert!(fr.sys_extra.is_none(), "the old result is not current"); + } + + #[test] + fn dropping_the_sampler_ends_the_thread() { + let (f, _, _) = fake(); + let mut s = SysSampler::new(f); + s.sample(0, &mut frame(&[Need::Disks])).unwrap(); + until("alive", || s.thread_alive()); + let shared = Arc::clone(&s.shared); + drop(s); + until("the thread to end", || !shared.alive.load(Ordering::Acquire)); + } + + #[test] + fn the_real_readers_answer_on_this_machine() { + let mut w = WinSys::default(); + let mut x = SysExtra::default(); + w.read(WANT_DISKS | WANT_NICS | WANT_CPU, &mut x); + assert!(x.disks.is_some() && x.nics.is_some()); + let facts = x.cpu_facts.expect("facts"); + assert!(facts.logical >= 1); + assert!(x.cpu.expect("reading").uptime_ms > 0); + let mut y = SysExtra::default(); + w.read(WANT_CPU, &mut y); + assert!(y.disks.is_none() && y.nics.is_none() && y.cpu.is_some()); + } +} diff --git a/apps/tasks/src/model/history.rs b/apps/tasks/src/model/history.rs new file mode 100644 index 00000000..894141ba --- /dev/null +++ b/apps/tasks/src/model/history.rs @@ -0,0 +1,538 @@ +//! The 60-sample histories the Performance page and the resource strip draw (one ring per series). +//! +//! One push per good frame (a frame with a read error is not good), none while paused, so a paused window shows what it +//! showed. A series with no value yet (the first read of a disk, the first CPU delta) is not pushed: the chart starts +//! empty and fills from the right. A disk or adapter that stops answering after it has samples pushes 0 so its time +//! axis stays aligned with the others. +use crate::engine::frame::Frame; +use crate::engine::need::Need; +use oled_sysmon::net::Adapter; +use oled_sysmon::percore::{core_loads, CoreTimes}; +use oled_sysmon::ring::Ring; + +/// Samples kept per series. +pub const SAMPLES: usize = 60; + +/// One physical disk: active time (0..=100) and read plus write bytes per second. +#[derive(Clone, Debug)] +pub struct DiskSeries { + pub number: u32, + pub active: Ring, + pub throughput: Ring, +} + +/// One adapter: received and sent bytes per second. +#[derive(Clone, Debug)] +pub struct NicSeries { + pub id: u64, + pub received: Ring, + pub sent: Ring, +} + +#[derive(Clone, Debug)] +pub struct SysHistory { + cpu: Ring, + mem: Ring, + speed: Ring, + cores: Vec, + disks: Vec, + nics: Vec, + prev_cores: Vec, + loads: Vec, + pushes: u64, +} + +impl Default for SysHistory { + fn default() -> SysHistory { + SysHistory { + cpu: Ring::new(SAMPLES), + mem: Ring::new(SAMPLES), + speed: Ring::new(SAMPLES), + cores: Vec::new(), + disks: Vec::new(), + nics: Vec::new(), + prev_cores: Vec::new(), + loads: Vec::new(), + pushes: 0, + } + } +} + +fn push_or_zero(r: &mut Ring, v: Option) { + match v { + Some(v) => r.push(v), + None if !r.is_empty() => r.push(0.0), + None => {} + } +} + +impl SysHistory { + /// Machine CPU, 0..=100. + pub fn cpu(&self) -> &Ring { + &self.cpu + } + /// Memory in use, 0..=100. + pub fn mem(&self) -> &Ring { + &self.mem + } + /// Current CPU clock, MHz. + pub fn speed(&self) -> &Ring { + &self.speed + } + /// One ring per logical processor, 0..=100. + pub fn cores(&self) -> &[Ring] { + &self.cores + } + /// In disk-number order. + pub fn disks(&self) -> &[DiskSeries] { + &self.disks + } + pub fn disk(&self, number: u32) -> Option<&DiskSeries> { + self.disks.iter().find(|d| d.number == number) + } + /// In the order the adapters were first seen. + pub fn nics(&self) -> &[NicSeries] { + &self.nics + } + pub fn nic(&self, id: u64) -> Option<&NicSeries> { + self.nics.iter().find(|n| n.id == id) + } + /// Frames pushed so far (paused and error frames are not counted). + pub fn pushes(&self) -> u64 { + self.pushes + } + + /// One frame. Returns whether it was pushed: false for a frame with a read error and while paused. + pub fn push(&mut self, f: &Frame, paused: bool) -> bool { + if paused || f.error.is_some() { + return false; + } + self.pushes += 1; + if let Some(c) = f.sys.cpu { + self.cpu.push(c.fraction()); + } + if let Some(m) = f.sys.mem { + self.mem.push(f32::from(m.load_pct)); + } + // A group whose need is off is reset, not left behind: when it comes back its chart starts empty and fills + // from the right instead of joining samples from minutes ago. The frame's parts of a group that is off + // (stale per-core times, a previous read) are never used. + if f.need.has(Need::PerCore) { + self.push_cores(&f.sys.cores); + } else { + self.cores.clear(); + self.prev_cores.clear(); + } + let extra = f.sys_extra.as_deref(); + if f.need.has(Need::CpuFacts) { + if let Some(speed) = extra.and_then(|x| x.cpu).and_then(|c| c.speed) { + self.speed.push(speed.current_mhz as f32); + } + } else { + self.speed.clear(); + } + match extra.and_then(|x| x.disks.as_ref()) { + Some(d) if f.need.has(Need::Disks) => self.push_disks(d), + _ if !f.need.has(Need::Disks) => self.disks.clear(), + _ => {} + } + match extra.and_then(|x| x.nics.as_ref()) { + Some(n) if f.need.has(Need::Nics) => self.push_nics(&n.adapters), + _ if !f.need.has(Need::Nics) => self.nics.clear(), + _ => {} + } + true + } + + fn push_cores(&mut self, now: &[CoreTimes]) { + if now.is_empty() { + return; + } + if self.prev_cores.len() == now.len() { + core_loads(&self.prev_cores, now, &mut self.loads); + self.cores.resize_with(now.len(), || Ring::new(SAMPLES)); + for (r, v) in self.cores.iter_mut().zip(&self.loads) { + r.push(*v); + } + } else { + // The count changed (or the first frame): the rings start over. + self.cores.clear(); + } + self.prev_cores.clear(); + self.prev_cores.extend_from_slice(now); + } + + fn push_disks(&mut self, report: &oled_sysmon::disk::DiskReport) { + self.disks.retain(|s| report.disks.iter().any(|d| d.number == s.number)); + for d in &report.disks { + if self.disk(d.number).is_none() { + self.disks.push(DiskSeries { + number: d.number, + active: Ring::new(SAMPLES), + throughput: Ring::new(SAMPLES), + }); + } + } + self.disks.sort_by_key(|s| s.number); + for d in &report.disks { + let Some(s) = self.disks.iter_mut().find(|s| s.number == d.number) else { continue }; + push_or_zero(&mut s.active, d.rates.map(|r| r.active_percent)); + push_or_zero(&mut s.throughput, d.rates.map(|r| (r.read_bytes_per_s + r.write_bytes_per_s) as f32)); + } + } + + fn push_nics(&mut self, adapters: &[Adapter]) { + self.nics.retain(|s| adapters.iter().any(|a| a.id == s.id)); + for a in adapters { + if self.nic(a.id).is_none() { + self.nics.push(NicSeries { id: a.id, received: Ring::new(SAMPLES), sent: Ring::new(SAMPLES) }); + } + } + for a in adapters { + let Some(s) = self.nics.iter_mut().find(|s| s.id == a.id) else { continue }; + push_or_zero(&mut s.received, a.rates.map(|r| r.received_bytes_per_s as f32)); + push_or_zero(&mut s.sent, a.rates.map(|r| r.sent_bytes_per_s as f32)); + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::engine::need::NeedSet; + use crate::engine::sysinfo::SysExtra; + use oled_sysmon::cpu::CpuDelta; + use oled_sysmon::cpuinfo::{CpuReading, CpuSpeed}; + use oled_sysmon::disk::{Disk, DiskKind, DiskRates, DiskReport}; + use oled_sysmon::mem::MemSample; + use oled_sysmon::net::{AdapterKind, NetRates, NetReport}; + use oled_sysmon::SysmonError; + use std::sync::Arc; + + fn mem(load: u8) -> MemSample { + MemSample { + load_pct: load, + total_phys: 100, + avail_phys: 100 - u64::from(load), + commit_total: 0, + commit_limit: 100, + } + } + + fn frame(cpu_busy: u64, load: u8) -> Frame { + let mut f = Frame::default(); + f.sys.cpu = Some(CpuDelta { d_idle: 100 - cpu_busy, d_total: 100 }); + f.sys.mem = Some(mem(load)); + f + } + + fn values(r: &Ring) -> Vec { + (0..r.len()).rev().filter_map(|b| r.get(b)).collect() + } + + fn disk(number: u32, rates: Option<(f32, f64, f64)>) -> Disk { + Disk { + number, + available: true, + kind: DiskKind::Ssd, + model: None, + capacity_bytes: None, + removable: false, + volumes: vec![], + rates: rates.map(|(a, r, w)| DiskRates { active_percent: a, read_bytes_per_s: r, write_bytes_per_s: w }), + } + } + + fn nic(id: u64, rates: Option<(f64, f64)>) -> Adapter { + Adapter { + id, + index: id as u32, + name: String::new(), + description: String::new(), + kind: AdapterKind::Ethernet, + physical: true, + connected: true, + link_tx_bits_per_s: None, + link_rx_bits_per_s: None, + rates: rates.map(|(r, s)| NetRates { received_bytes_per_s: r, sent_bytes_per_s: s }), + } + } + + fn with_extra(mut f: Frame, x: SysExtra) -> Frame { + f.need = NeedSet::EMPTY.with(Need::Disks).with(Need::Nics).with(Need::CpuFacts); + f.sys_extra = Some(Arc::new(x)); + f + } + + #[test] + fn rings_wrap_at_sixty() { + let mut h = SysHistory::default(); + for i in 0..75u32 { + assert!(h.push(&frame(u64::from(i % 100), (i % 100) as u8), false)); + } + assert_eq!((h.cpu().len(), h.cpu().capacity(), h.mem().len()), (SAMPLES, SAMPLES, SAMPLES)); + // The newest at the end, the oldest 60 pushes back. + assert_eq!(h.mem().get(0), Some(74.0)); + assert_eq!(h.mem().get(59), Some(15.0)); + assert_eq!(h.pushes(), 75); + } + + #[test] + fn one_push_per_good_frame() { + let mut h = SysHistory::default(); + h.push(&frame(10, 20), false); + h.push(&frame(30, 40), false); + assert_eq!(values(h.cpu()), vec![10.0, 30.0]); + assert_eq!(values(h.mem()), vec![20.0, 40.0]); + let mut bad = frame(99, 99); + bad.error = Some(SysmonError::Status(-5)); + assert!(!h.push(&bad, false)); + assert_eq!((h.cpu().len(), h.mem().len(), h.pushes()), (2, 2, 2)); + } + + #[test] + fn frozen_while_paused() { + let mut h = SysHistory::default(); + h.push(&frame(10, 20), false); + for _ in 0..5 { + assert!(!h.push(&frame(90, 90), true)); + } + assert_eq!(values(h.cpu()), vec![10.0]); + assert_eq!(h.pushes(), 1); + assert!(h.push(&frame(50, 50), false)); + assert_eq!(values(h.cpu()), vec![10.0, 50.0]); + } + + #[test] + fn unmeasured_values_are_not_pushed() { + let mut h = SysHistory::default(); + let mut f = Frame::default(); + f.sys.mem = Some(mem(30)); + assert!(h.push(&f, false)); + assert!(h.cpu().is_empty()); + assert_eq!(h.mem().len(), 1); + } + + fn cores(rows: &[(u64, u64)]) -> Vec { + // (kernel incl. idle, user); idle is half the kernel time. + rows.iter().map(|&(k, u)| CoreTimes { idle: k / 2, kernel: k, user: u, dpc: 0, interrupt: 0 }).collect() + } + + #[test] + fn one_ring_per_logical_processor() { + let mut h = SysHistory::default(); + let mut f = want(Frame::default(), &[Need::PerCore]); + f.sys.cores = cores(&[(0, 0), (0, 0), (0, 0)]); + h.push(&f, false); + assert!(h.cores().is_empty(), "the first frame has no delta"); + f.sys.cores = cores(&[(100, 0), (100, 100), (100, 0)]); + h.push(&f, false); + assert_eq!(h.cores().len(), 3); + assert!(h.cores().iter().all(|r| r.len() == 1)); + // Core 1 did twice the work of core 0 over the same wall time. + let (a, b) = (h.cores()[0].get(0).unwrap(), h.cores()[1].get(0).unwrap()); + assert!(b > a && (0.0..=100.0).contains(&b), "{a} {b}"); + f.sys.cores = cores(&[(200, 0), (200, 100), (200, 0)]); + h.push(&f, false); + assert!(h.cores().iter().all(|r| r.len() == 2)); + } + + #[test] + fn a_new_processor_count_starts_over() { + let mut h = SysHistory::default(); + let mut f = want(Frame::default(), &[Need::PerCore]); + for n in [2usize, 2, 2, 4, 4] { + f.sys.cores = cores(&vec![(100 * h.pushes() + 100, 10); n]); + h.push(&f, false); + } + assert_eq!(h.cores().len(), 4); + assert!(h.cores().iter().all(|r| r.len() == 1)); + } + + #[test] + fn disk_rings_follow_the_report() { + let mut h = SysHistory::default(); + let mk = |disks: Vec| { + with_extra(Frame::default(), SysExtra { seq: 1, disks: Some(DiskReport { disks }), ..Default::default() }) + }; + // First read: no rates yet, no samples. + h.push(&mk(vec![disk(0, None)]), false); + assert_eq!(h.disks().len(), 1); + assert!(h.disk(0).unwrap().active.is_empty()); + h.push(&mk(vec![disk(0, Some((12.0, 1000.0, 500.0))), disk(1, None)]), false); + assert_eq!(values(&h.disk(0).unwrap().active), vec![12.0]); + assert_eq!(values(&h.disk(0).unwrap().throughput), vec![1500.0]); + assert!(h.disk(1).unwrap().active.is_empty()); + // Disk 0 stops answering: 0 keeps its axis. Disk 1 starts. + h.push(&mk(vec![disk(0, None), disk(1, Some((50.0, 0.0, 0.0)))]), false); + assert_eq!(values(&h.disk(0).unwrap().active), vec![12.0, 0.0]); + assert_eq!(values(&h.disk(1).unwrap().active), vec![50.0]); + // Disk 0 goes: its rings go. + h.push(&mk(vec![disk(1, Some((60.0, 0.0, 0.0)))]), false); + assert!(h.disk(0).is_none()); + assert_eq!(h.disks().len(), 1); + assert_eq!(values(&h.disk(1).unwrap().active), vec![50.0, 60.0]); + } + + #[test] + fn disks_stay_in_number_order() { + let mut h = SysHistory::default(); + let report = |ns: &[u32]| { + with_extra( + Frame::default(), + SysExtra { + disks: Some(DiskReport { disks: ns.iter().map(|n| disk(*n, None)).collect() }), + ..Default::default() + }, + ) + }; + h.push(&report(&[2]), false); + h.push(&report(&[0, 2]), false); + assert_eq!(h.disks().iter().map(|d| d.number).collect::>(), vec![0, 2]); + } + + #[test] + fn adapter_rings_follow_the_report() { + let mut h = SysHistory::default(); + let mk = |ads: Vec| { + with_extra( + Frame::default(), + SysExtra { nics: Some(NetReport { available: true, adapters: ads }), ..Default::default() }, + ) + }; + h.push(&mk(vec![nic(7, None)]), false); + assert!(h.nic(7).unwrap().received.is_empty()); + h.push(&mk(vec![nic(7, Some((100.0, 20.0)))]), false); + h.push(&mk(vec![nic(7, Some((300.0, 40.0))), nic(9, Some((1.0, 2.0)))]), false); + assert_eq!(values(&h.nic(7).unwrap().received), vec![100.0, 300.0]); + assert_eq!(values(&h.nic(7).unwrap().sent), vec![20.0, 40.0]); + assert_eq!(values(&h.nic(9).unwrap().received), vec![1.0]); + h.push(&mk(vec![nic(9, Some((5.0, 6.0)))]), false); + assert!(h.nic(7).is_none()); + assert_eq!(h.nics().len(), 1); + } + + #[test] + fn cpu_speed_ring() { + let mut h = SysHistory::default(); + let reading = |mhz| CpuReading { speed: Some(CpuSpeed { current_mhz: mhz, base_mhz: 3000 }), uptime_ms: 1 }; + h.push(&with_extra(Frame::default(), SysExtra { cpu: Some(reading(3420)), ..Default::default() }), false); + h.push( + &with_extra( + Frame::default(), + SysExtra { cpu: Some(CpuReading { speed: None, uptime_ms: 2 }), ..Default::default() }, + ), + false, + ); + h.push(&want(Frame::default(), &[Need::CpuFacts]), false); + assert_eq!(values(h.speed()), vec![3420.0]); + } + + fn want(mut f: Frame, needs: &[Need]) -> Frame { + f.need = needs.iter().fold(NeedSet::EMPTY, |s, n| s.with(*n)); + f + } + + #[test] + fn stale_core_times_without_the_need_are_not_pushed() { + let mut h = SysHistory::default(); + let mut f = Frame::default(); + // The host does not clear sys.cores when nothing fills it: old snapshots stay, one per buffer. + for k in [300u64, 100, 200, 300, 100, 200] { + f.sys.cores = cores(&[(k, k), (k, 0)]); + assert!(h.push(&f, false)); + } + assert!(h.cores().is_empty()); + // The need comes: the grid starts empty and fills from real deltas only. + let mut f = want(Frame::default(), &[Need::PerCore]); + f.sys.cores = cores(&[(100, 0), (100, 0)]); + h.push(&f, false); + assert!(h.cores().is_empty()); + f.sys.cores = cores(&[(200, 0), (200, 0)]); + h.push(&f, false); + assert!(h.cores().iter().all(|r| r.len() == 1)); + } + + #[test] + fn processor_rings_reset_when_the_need_goes() { + let mut h = SysHistory::default(); + let mut f = want(Frame::default(), &[Need::PerCore]); + for k in [100u64, 200, 300] { + f.sys.cores = cores(&[(k, 0), (k, 0)]); + h.push(&f, false); + } + assert_eq!(h.cores().len(), 2); + f.need = NeedSet::EMPTY; + h.push(&f, false); + assert!(h.cores().is_empty()); + f.need = NeedSet::EMPTY.with(Need::PerCore); + f.sys.cores = cores(&[(400, 0), (400, 0)]); + h.push(&f, false); + assert!(h.cores().is_empty(), "no delta against a snapshot from before the gap"); + } + + fn extra_all() -> SysExtra { + SysExtra { + seq: 1, + disks: Some(DiskReport { disks: vec![disk(0, Some((10.0, 1.0, 1.0)))] }), + nics: Some(NetReport { available: true, adapters: vec![nic(1, Some((1.0, 2.0)))] }), + cpu: Some(CpuReading { speed: Some(CpuSpeed { current_mhz: 3000, base_mhz: 3000 }), uptime_ms: 1 }), + ..Default::default() + } + } + + #[test] + fn disks_reset_when_their_need_is_off() { + let mut h = SysHistory::default(); + let on = want(with_extra(Frame::default(), extra_all()), &[Need::Disks]); + h.push(&on, false); + h.push(&on, false); + assert_eq!(values(&h.disk(0).unwrap().active).len(), 2); + // Off for a while, the previous read may still ride on the first frame after the change. + let off = want(with_extra(Frame::default(), extra_all()), &[]); + h.push(&off, false); + assert!(h.disks().is_empty()); + h.push(&on, false); + assert_eq!(values(&h.disk(0).unwrap().active), vec![10.0]); + } + + #[test] + fn adapters_reset_when_their_need_is_off() { + let mut h = SysHistory::default(); + let on = want(with_extra(Frame::default(), extra_all()), &[Need::Nics]); + h.push(&on, false); + h.push(&on, false); + assert_eq!(h.nic(1).unwrap().received.len(), 2); + h.push(&want(with_extra(Frame::default(), extra_all()), &[]), false); + assert!(h.nics().is_empty()); + h.push(&on, false); + assert_eq!(values(&h.nic(1).unwrap().received), vec![1.0]); + } + + #[test] + fn speed_resets_when_its_need_is_off() { + let mut h = SysHistory::default(); + let on = want(with_extra(Frame::default(), extra_all()), &[Need::CpuFacts]); + h.push(&on, false); + h.push(&on, false); + assert_eq!(h.speed().len(), 2); + h.push(&want(with_extra(Frame::default(), extra_all()), &[]), false); + assert!(h.speed().is_empty()); + h.push(&on, false); + assert_eq!(h.speed().len(), 1); + } + + #[test] + fn a_group_is_pushed_only_with_its_need() { + let mut h = SysHistory::default(); + h.push(&want(with_extra(Frame::default(), extra_all()), &[Need::Disks]), false); + assert!(h.nics().is_empty() && h.speed().is_empty() && h.disks().len() == 1); + } + + #[test] + fn no_extra_leaves_the_sys_rings_alone() { + let mut h = SysHistory::default(); + h.push(&frame(10, 10), false); + assert!(h.disks().is_empty() && h.nics().is_empty() && h.speed().is_empty() && h.cores().is_empty()); + } +} diff --git a/apps/tasks/src/model/mod.rs b/apps/tasks/src/model/mod.rs index 9c544c45..80e30fa3 100644 --- a/apps/tasks/src/model/mod.rs +++ b/apps/tasks/src/model/mod.rs @@ -1,5 +1,6 @@ pub mod classify; pub mod group; +pub mod history; pub mod order; pub mod rates; pub mod tree; diff --git a/apps/tasks/src/model/verdict.rs b/apps/tasks/src/model/verdict.rs index 12dcc2c5..a2906649 100644 --- a/apps/tasks/src/model/verdict.rs +++ b/apps/tasks/src/model/verdict.rs @@ -427,6 +427,172 @@ fn verdict_of(rule: Rule, st: &VerdictState, now: u64) -> Option { }) } +// ---- the resource strip's verdict: three rules, the first that matches wins + +/// Memory in use at or above this share is "almost full". +pub const STRIP_MEMORY_PCT: u8 = 90; +/// The CPU of an app is averaged over this long before the busiest is named. +pub const BUSIEST_WINDOW_MS: u64 = 5000; + +/// An app that does not respond: its name, a process of it (what the row is found by) and how long it has not. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct HungApp { + pub name: String, + pub pid: u32, + pub secs: u64, +} + +/// The busiest app: its name, a process of it and its average share of the whole processor. +#[derive(Clone, Debug, PartialEq)] +pub struct Busiest { + pub name: String, + pub pid: u32, + pub cpu: f32, +} + +/// What the strip says about the machine. +#[derive(Clone, Debug, PartialEq)] +pub enum StripVerdict { + /// One app or more that do not respond, the one that has not for longest first. + Hung(Vec), + /// Memory in use, in percent, at or above the limit. + MemoryFull(u8), + /// Nothing is wrong; the busiest app when one is measured. + Calm(Option), +} + +/// The strip's verdict: an app that does not respond, then memory nearly full, then all normal. +pub fn strip_verdict(mut hung: Vec, mem_pct: Option, busiest: Option) -> StripVerdict { + if !hung.is_empty() { + hung.sort_by(|a, b| b.secs.cmp(&a.secs).then_with(|| a.name.cmp(&b.name))); + return StripVerdict::Hung(hung); + } + match mem_pct { + Some(p) if p >= STRIP_MEMORY_PCT => StripVerdict::MemoryFull(p), + _ => StripVerdict::Calm(busiest), + } +} + +/// The mean of a value over a sliding window of time, per key. A key that is not pushed in a round is forgotten. +#[derive(Debug, Default)] +pub struct Averager { + window_ms: u64, + series: HashMap>, +} + +impl Averager { + pub fn new(window_ms: u64) -> Averager { + Averager { window_ms, series: HashMap::new() } + } + + /// A value of `key` at `t_ms`; values older than the window are dropped. + pub fn push(&mut self, key: u64, t_ms: u64, v: f32) { + let q = self.series.entry(key).or_default(); + q.push_back((t_ms, if v.is_finite() { v } else { 0.0 })); + while q.front().is_some_and(|f| t_ms.saturating_sub(f.0) > self.window_ms) { + q.pop_front(); + } + } + + /// The end of a round at `t_ms`: the keys that were not pushed in it go. + pub fn end_round(&mut self, t_ms: u64) { + self.series.retain(|_, q| q.back().is_some_and(|b| b.0 == t_ms)); + } + + /// The mean of the window; None for a key that has no value. + pub fn mean(&self, key: u64) -> Option { + let q = self.series.get(&key)?; + (!q.is_empty()).then(|| q.iter().map(|v| v.1).sum::() / q.len() as f32) + } +} + +/// When each hung app was first seen hung: apps that answer again are forgotten, new ones are noted at `now_ms`. +pub fn note_hung(since: &mut Vec<(u64, u64)>, hung_keys: &[u64], now_ms: u64) { + since.retain(|(k, _)| hung_keys.contains(k)); + for k in hung_keys { + if !since.iter().any(|(s, _)| s == k) { + since.push((*k, now_ms)); + } + } +} + +#[cfg(test)] +mod strip_tests { + use super::*; + + fn hung(name: &str, secs: u64) -> HungApp { + HungApp { name: name.into(), pid: 10, secs } + } + fn busy(name: &str) -> Busiest { + Busiest { name: name.into(), pid: 7, cpu: 18.2 } + } + + #[test] + fn a_hung_app_beats_full_memory_and_calm() { + let v = strip_verdict(vec![hung("Quill", 42)], Some(97), Some(busy("Prism"))); + assert_eq!(v, StripVerdict::Hung(vec![hung("Quill", 42)])); + } + + #[test] + fn full_memory_beats_calm_at_ninety_and_not_below() { + assert_eq!(strip_verdict(vec![], Some(90), None), StripVerdict::MemoryFull(90)); + assert_eq!(strip_verdict(vec![], Some(93), Some(busy("Prism"))), StripVerdict::MemoryFull(93)); + assert_eq!(strip_verdict(vec![], Some(89), None), StripVerdict::Calm(None)); + assert_eq!(strip_verdict(vec![], None, Some(busy("Prism"))), StripVerdict::Calm(Some(busy("Prism")))); + } + + #[test] + fn hung_apps_come_longest_first() { + let v = strip_verdict(vec![hung("Orbit", 5), hung("Quill", 42), hung("Ash", 5)], None, None); + let StripVerdict::Hung(list) = v else { panic!("hung") }; + let names: Vec<&str> = list.iter().map(|h| h.name.as_str()).collect(); + assert_eq!(names, ["Quill", "Ash", "Orbit"]); + } + + #[test] + fn the_average_covers_the_window_only() { + let mut a = Averager::new(BUSIEST_WINDOW_MS); + for (t, v) in [(0, 90.0), (1000, 10.0), (2000, 10.0), (7000, 10.0)] { + a.push(1, t, v); + } + // The 90 and the first 10 are older than 5 s at t = 7000. + assert_eq!(a.mean(1), Some(10.0)); + a.push(2, 7000, 30.0); + assert_eq!(a.mean(2), Some(30.0)); + assert_eq!(a.mean(3), None); + } + + #[test] + fn a_key_that_is_not_pushed_is_forgotten() { + let mut a = Averager::new(BUSIEST_WINDOW_MS); + a.push(1, 1000, 5.0); + a.push(2, 1000, 6.0); + a.end_round(1000); + a.push(1, 2000, 7.0); + a.end_round(2000); + assert_eq!(a.mean(2), None, "gone"); + assert_eq!(a.mean(1), Some(6.0)); + } + + #[test] + fn a_non_finite_sample_counts_as_zero() { + let mut a = Averager::new(BUSIEST_WINDOW_MS); + a.push(1, 0, f32::NAN); + a.push(1, 1000, 10.0); + assert_eq!(a.mean(1), Some(5.0)); + } + + #[test] + fn hung_since_keeps_the_first_sight_and_forgets_the_answered() { + let mut since = Vec::new(); + note_hung(&mut since, &[1, 2], 1000); + note_hung(&mut since, &[1, 3], 5000); + assert_eq!(since, vec![(1, 1000), (3, 5000)]); + note_hung(&mut since, &[], 6000); + assert!(since.is_empty()); + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/apps/tasks/src/model/view.rs b/apps/tasks/src/model/view.rs index c6787465..5a96eb1a 100644 --- a/apps/tasks/src/model/view.rs +++ b/apps/tasks/src/model/view.rs @@ -5,6 +5,7 @@ pub enum Page { #[default] Processes, Performance, + Details, Startup, Services, } @@ -47,6 +48,7 @@ pub enum ColumnId { Started, Path, CommandLine, + Image, Status, Gpu, GpuEngine, diff --git a/apps/tasks/src/ui/actions.rs b/apps/tasks/src/ui/actions.rs index 6b889c11..d1e8840f 100644 --- a/apps/tasks/src/ui/actions.rs +++ b/apps/tasks/src/ui/actions.rs @@ -14,7 +14,7 @@ use oled_ui::verbs::Verb; use oled_ui::widgets::VirtualTable; use oled_ui::{CommandId, EventCx, TimerId, UiLang}; -use super::commands::{CLOSE_OR_END, END_NOW, END_TREE, REOPEN}; +use super::commands::{CLOSE_ONLY, CLOSE_OR_END, END_NOW, END_ONLY, END_TREE, REOPEN}; use super::grouped::HostEnv; use super::rows::{group_key, proc_key, Decor, RowAct, RowEntry, RowKind, TasksTable}; use super::screen::{TasksScreen, TIMER_CLOSE_CHECK, TIMER_NOTES}; @@ -119,6 +119,8 @@ pub struct ActionState { menu: Option>, notes_armed: Option, close_armed: Option, + /// The processes this session put in efficiency mode, as far as the screen has been told (the Status column). + eco: std::collections::HashSet, } impl ActionState { @@ -129,6 +131,15 @@ impl ActionState { self.fixture.get_or_insert_with(FixtureProber::default); } + /// Marks `keys` as in efficiency mode (true) or not, for the Status column. + pub fn set_eco(&mut self, keys: &[ProcKey], on: bool) -> bool { + let mut changed = false; + for k in keys { + changed |= if on { self.eco.insert(*k) } else { self.eco.remove(k) }; + } + changed + } + /// The keys a fixed environment's probe reports as limited (needs administrator). pub fn set_fixture_limited(&mut self, keys: Vec) { self.fixture.get_or_insert_with(FixtureProber::default).limited = keys; @@ -159,6 +170,11 @@ impl ActionState { self.menu = Some(keys); } + /// The rows of the open menu, taken: the pick that follows acts on them. + pub(crate) fn take_menu(&mut self) -> Option> { + self.menu.take() + } + pub(crate) fn env(&self) -> HostEnv { self.env.unwrap_or_else(HostEnv::live) } @@ -276,6 +292,15 @@ pub(crate) fn guard_of(st: &ActionState, v: &View, install_dir: Option<&std::pat access::guard(v.procs(), &v.frame().paths, env.own_pid, env.shell_pid, env.session, dock.as_deref()) } +/// Whether a row's process, or any member of its group, is in this session's efficiency mode. +fn in_efficiency(st: &ActionState, r: &RowEntry) -> bool { + match r.kind { + RowKind::Proc(p) => st.eco.contains(&p), + RowKind::Group(_) => st.group(r.key).is_some_and(|(_, m)| m.iter().any(|k| st.eco.contains(k))), + _ => false, + } +} + /// The inline action of a row: Close or End on the top rows of Apps and Background in Grouped mode, unless the /// keys alone refuse every member (the shell, Tasks, its ancestors, the dock) or the row is another session's. fn inline_action(st: &ActionState, r: &RowEntry, v: &View, g: &KillGuard, lang: UiLang) -> Option { @@ -348,9 +373,11 @@ pub fn decorate(v: &View, st: &mut ActionState, rows: &mut Vec, now: u let guard = (v.mode() == ViewMode::Grouped).then(|| guard_of(st, v, v.install_dir())); let mut revived: Vec = Vec::new(); for r in rows.iter_mut() { + let eco = !st.eco.is_empty() && in_efficiency(st, r); let Some(s) = st.states.get(&r.key) else { - if let Some(a) = guard.as_ref().and_then(|g| inline_action(st, r, v, g, lang)) { - v.set_act(r.key, RowAct { note: None, action: Some(a) }); + let action = guard.as_ref().and_then(|g| inline_action(st, r, v, g, lang)); + if eco || action.is_some() { + v.set_act(r.key, RowAct { eco, note: None, action }); } continue; }; @@ -360,11 +387,12 @@ pub fn decorate(v: &View, st: &mut ActionState, rows: &mut Vec, now: u r.out.busy = true; r.vals = s.entry.vals; let key = if verb == ActVerb::Close { k::TASKS_ROW_CLOSING } else { k::TASKS_ROW_ENDING }; - RowAct { note: Some((t(lang, key), FgRole::Secondary)), action: None } + RowAct { eco, note: Some((t(lang, key), FgRole::Secondary)), action: None } } - None => RowAct::default(), + None => RowAct { eco, ..RowAct::default() }, }, Phase::StillOpen => RowAct { + eco, note: Some((t(lang, k::TASKS_ROW_STILL_OPEN), FgRole::Attention)), action: Some(RowAction { label: Verb::EndNow.label(lang), command: END_NOW }), }, @@ -378,14 +406,15 @@ pub fn decorate(v: &View, st: &mut ActionState, rows: &mut Vec, now: u ghost_look(r); if *reopen { RowAct { + eco, note: Some((t(lang, k::TASKS_ROW_ENDED_REOPEN), FgRole::Disabled)), action: Some(RowAction { label: t(lang, k::TASKS_ROW_REOPEN), command: REOPEN }), } } else { - RowAct { note: Some((t(lang, k::TASKS_ROW_ENDED), FgRole::Disabled)), action: None } + RowAct { eco, note: Some((t(lang, k::TASKS_ROW_ENDED), FgRole::Disabled)), action: None } } } - Phase::Note { text, fg, .. } => RowAct { note: Some((text.clone(), *fg)), action: None }, + Phase::Note { text, fg, .. } => RowAct { eco, note: Some((text.clone(), *fg)), action: None }, }; if act != RowAct::default() { v.set_act(r.key, act); @@ -399,6 +428,7 @@ pub fn decorate(v: &View, st: &mut ActionState, rows: &mut Vec, now: u /// The rows we ended that left the list stay as ghosts, in their place, for the rest of their time. fn insert_ghosts(v: &View, st: &ActionState, rows: &mut Vec, lang: UiLang) { + let eco = false; let mut ended: Vec<(&RowKey, &RowState)> = st.states.iter().filter(|(_, s)| matches!(s.phase, Phase::Ended { .. })).collect(); if ended.is_empty() { @@ -432,11 +462,12 @@ fn insert_ghosts(v: &View, st: &ActionState, rows: &mut Vec, lang: UiL let reopen = matches!(s.phase, Phase::Ended { reopen: true, .. }); let act = if reopen { RowAct { + eco, note: Some((t(lang, k::TASKS_ROW_ENDED_REOPEN), FgRole::Disabled)), action: Some(RowAction { label: t(lang, k::TASKS_ROW_REOPEN), command: REOPEN }), } } else { - RowAct { note: Some((t(lang, k::TASKS_ROW_ENDED), FgRole::Disabled)), action: None } + RowAct { eco, note: Some((t(lang, k::TASKS_ROW_ENDED), FgRole::Disabled)), action: None } }; v.set_act(*key, act); rows.insert(at.min(rows.len()), g); @@ -514,9 +545,12 @@ pub fn on_command(s: &mut TasksScreen, cx: &mut EventCx, id: CommandId) { let now = cx.now_ms(); let (keys, from_menu) = match s.p.actions.menu.take() { Some(keys) => (keys, true), + // The band's own buttons act on the selection alone, never on the focused row. + None if matches!(id, CLOSE_ONLY | END_ONLY) => (super::band::selection_keys(s), false), None => (selected_keys(&s.table), false), }; - act(s, cx, id, &keys, from_menu, now); + // The band's buttons are as explicit as a menu pick: Part of Windows rows are not refused by the keyboard rule. + act(s, cx, id, &keys, from_menu || matches!(id, CLOSE_ONLY | END_ONLY), now); } /// The end of every event and data call (screen.rs): a menu that ended forgets its rows, the table's pending output @@ -638,8 +672,8 @@ fn act(s: &mut TasksScreen, cx: &mut EventCx, id: CommandId, keys: &[RowKey], fr let Some(verb) = row_verb(&s.p.actions, &s.v, &r).filter(|_| !busy) else { continue }; let is_proc = matches!(r.kind, RowKind::Proc(_)); let (av, tree) = match (id, verb) { - (CLOSE_OR_END, RowVerb::Close) => (ActVerb::Close, false), - (CLOSE_OR_END, _) => (ActVerb::End, !is_proc), + (CLOSE_OR_END | CLOSE_ONLY, RowVerb::Close) => (ActVerb::Close, false), + (CLOSE_OR_END | END_ONLY, _) => (ActVerb::End, !is_proc), (END_NOW, _) => (ActVerb::EndNow, !is_proc), (END_TREE, _) if is_proc => (ActVerb::EndTree, true), _ => continue, diff --git a/apps/tasks/src/ui/ask.rs b/apps/tasks/src/ui/ask.rs new file mode 100644 index 00000000..0bc41e66 --- /dev/null +++ b/apps/tasks/src/ui/ask.rs @@ -0,0 +1,145 @@ +//! What the rows on screen ask the resolver for: the identity of their windows, the name and the icon of their program, +//! visible rows first and each key once per session; and the answers the rows show (the placeholder tile until the +//! icon arrives). + +use std::ops::Range; + +use oled_shellmodel::identity::key_from_exe_path; +use oled_sysmon::ProcKey; +use oled_ui::art::Art; +use oled_ui::model::ListModel; + +use super::grouped::is_service_host; +use super::rows::{RowIcon, RowKind, TasksTable}; +use super::view::View; +use crate::app::resolver::{Ask, NameBook, Request, Resolver}; +use crate::model::classify::ImagePath; +use crate::model::group::{AppKey, ExeId, Group, Grouping, IdentityId}; +use crate::model::view::Section; + +/// The program a row stands for: the process whose exe tells its name and icon, the identity its icon is filed under +/// and the processes whose windows give it an identity. +struct Subject<'a> { + pk: ProcKey, + identity: Option, + group: Option<&'a Group>, +} + +fn subject_of_group<'a>(g: &'a Group) -> Option> { + let pk = g.members.first().copied()?; + let identity = match g.key { + AppKey::App(id) => Some(id), + _ => None, + }; + Some(Subject { pk, identity, group: Some(g) }) +} + +/// Asks for the visible rows `window` of `model` and tells the model what the book knows. true when a row's icon +/// changed (the caller repaints). `resolver` None (scenes, before the thread started): nothing is asked, nothing is +/// marked as asked. +pub fn visible( + v: &View, + grouping: &Grouping, + names: &mut NameBook, + model: &mut TasksTable, + window: Range, + resolver: Option<&Resolver>, + px: u16, +) -> bool { + let frame = v.frame(); + let mut changed = false; + let end = window.end.min(model.rows.len()); + for i in window.start.min(end)..end { + let (key, kind, parent, section) = { + let e = &model.rows[i]; + (e.key, e.kind, e.parent, e.section) + }; + let group_of = |ak: AppKey| grouping.groups.iter().find(|g| g.key == ak); + let subject = match kind { + RowKind::Section(_) | RowKind::Hardware => continue, + RowKind::Group(ak) => group_of(ak).and_then(subject_of_group), + RowKind::Proc(pk) | RowKind::Ghost(pk) => { + // A member of a group is that group's program. + let parent_group = parent.and_then(|p| model.row_of(p)).and_then(|r| match model.rows[r].kind { + RowKind::Group(ak) => group_of(ak), + _ => None, + }); + match parent_group { + Some(g) => subject_of_group(g), + None => Some(Subject { pk, identity: None, group: None }), + } + } + }; + let Some(sub) = subject else { continue }; + let path = match frame.paths.get(sub.pk) { + Some(ImagePath::Path(p)) => Some(p.to_string()), + _ => None, + }; + let path_pending = frame.paths.get(sub.pk).is_none(); + let exe_id: Option = v + .procs() + .index_of(sub.pk) + .and_then(|ix| v.info_rows().get(ix)) + .filter(|i| i.key == sub.pk) + .and_then(|i| i.exe); + let identity = sub.identity.or_else(|| path.as_deref().map(|p| IdentityId(v.intern(&key_from_exe_path(p))))); + let art = if is_service_host(v, sub.pk) { + Art::ProcService + } else if section == Some(Section::Windows) { + Art::ProcWindows + } else { + Art::Program + }; + changed |= model.set_row_icon(key, RowIcon { identity, art, pending: path_pending && identity.is_none() }); + if let Some(id) = identity { + changed |= model.note_icon(id, names.icon_state(id), names.icon_of(id)); + } + let (Some(resolver), Some(path)) = (resolver, path) else { continue }; + let windows: Vec<_> = frame + .windows + .iter() + .filter(|w| match sub.group { + Some(g) => g.members.contains(&w.owner), + None => w.owner == sub.pk, + }) + .collect(); + // The identity of each window of the program. + for w in &windows { + let make = || { + let exe = match frame.paths.get(w.owner) { + Some(ImagePath::Path(p)) => p.to_string(), + _ => String::new(), + }; + Request::Identity { hwnd: w.hwnd, pid: w.owner.pid, exe } + }; + names.ask(resolver, Ask::Identity(w.hwnd, w.owner.pid), make, true); + } + let aumid = windows.iter().find_map(|w| names.identity(w.hwnd, w.owner.pid)).and_then(|i| i.aumid.clone()); + // The program's name, by its identity and by its exe. + if let (Some(id), Some(_)) = (sub.identity, sub.group) { + let make = || Request::Name { + identity: Some(id), + exe_id, + key: v.interned(id.0), + exe: path.clone(), + aumid: aumid.clone(), + }; + names.ask(resolver, Ask::Name(id), make, true); + } + if let Some(e) = exe_id { + let make = || Request::Name { + identity: None, + exe_id: Some(e), + key: key_from_exe_path(&path), + exe: path.clone(), + aumid: None, + }; + names.ask(resolver, Ask::ExeName(e), make, true); + } + if let Some(id) = identity { + let make = || Request::Icon { identity: id, exe: path, aumid, px }; + names.ask(resolver, Ask::Icon(id), make, true); + } + } + changed +} diff --git a/apps/tasks/src/ui/band.rs b/apps/tasks/src/ui/band.rs new file mode 100644 index 00000000..41b920c8 --- /dev/null +++ b/apps/tasks/src/ui/band.rs @@ -0,0 +1,1140 @@ +//! The command band (Processes): between the resource strip and the column header, 44 high with 8 below it, margins 0 16 +//! 0 20. It shows the selection and what can be done to it: Close, End task, Efficiency mode, Priority, Open file +//! location, Properties and More. The row menu offers the same acts from the same plan, so a command is enabled or +//! refused for the same reason in both places. Every act goes through the commands (commands.rs), the executor and the +//! launcher; a disabled one keeps its reason as its tooltip and its note. + +use std::path::PathBuf; + +use oled_sys::i18n::S; +use oled_sysmon::ProcKey; +use oled_ui::gfx::image::IconBitmap; +use oled_ui::model::{IconRef, ListModel, RowKey, TableModel, TableOut}; +use oled_ui::node::Text; +use oled_ui::widgets::{BandSelection, BarEntry, BarStyle, ButtonKind, CommandBar, CommandBarOut, CommandItem}; +use oled_ui::{ + Anchor, CommandId, Event, EventCx, Glyph, LayoutCx, MenuItem, NodeId, PaintCx, RectP, UiLang, Widget, WidgetId, +}; + +use super::actions::{self, RowVerb}; +use super::commands::{ + self, BAND_PRIORITY, CLOSE_ONLY, COLLAPSE_ROW, COLUMNS, COPY_PATH, EFFICIENCY, END_NOW, END_ONLY, END_TREE, + EXPAND_ROW, GO_DETAILS, OPEN_PATH, PRIO_ABOVE, PRIO_BELOW, PRIO_HIGH, PRIO_LOW, PRIO_NORMAL, PRIO_RESTORE, + PROPERTIES, RESTART_EXPLORER, SEARCH_ONLINE, +}; +use super::details; +use super::pages; +use super::rows::RowKind; +use super::screen::TasksScreen; +use super::{grouped, order}; +use crate::app::access::{self, MemberFacts}; +use crate::app::exec::tune::{ + self, PriorityClass, RestartOutcome, RestartRefusal, RestartReq, TuneBatch, TuneDone, TuneOutcome, TuneRefusal, + TuneTarget, TuneVerb, +}; +use crate::app::exec::KillGuard; +use crate::model::classify::ImagePath; +use crate::model::view::Page; +use crate::strings::{k, t}; + +/// The band's widget. +pub const BAND: WidgetId = WidgetId(0x30); + +/// The band's slot: the band is 44 high and 8 more are left below it (logical px). +pub const HEIGHT: i32 = 52; +const BAR_H: i32 = 44; +/// The margins left and right of the band (logical px). +const MARGIN_L: i32 = 20; +const MARGIN_R: i32 = 16; +/// The names a notice lists before it says how many more there are. +const NOTICE_NAMES: usize = 3; + +/// A priority as the band shows it: one of the five levels it can set, or Realtime, which it only shows. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Level { + Set(PriorityClass), + Realtime, +} + +/// The level a base priority (the snapshot's) stands for: 4 is Low, 6 Below normal, 8 Normal, 10 Above normal, 13 High +/// and 24 Realtime; a value between takes the nearest level below it. None for a process with no priority read (0). +pub fn level_of(base_prio: i32) -> Option { + Some(match base_prio { + ..=0 => return None, + 1..=4 => Level::Set(PriorityClass::Idle), + 5..=6 => Level::Set(PriorityClass::BelowNormal), + 7..=8 => Level::Set(PriorityClass::Normal), + 9..=10 => Level::Set(PriorityClass::AboveNormal), + 11..=15 => Level::Set(PriorityClass::High), + _ => Level::Realtime, + }) +} + +/// The levels the band can set, highest first, each with its command and its name. +pub const LEVELS: [(PriorityClass, CommandId, S); 5] = [ + (PriorityClass::High, PRIO_HIGH, k::TASKS_BAND_LEVEL_HIGH), + (PriorityClass::AboveNormal, PRIO_ABOVE, k::TASKS_BAND_LEVEL_ABOVE), + (PriorityClass::Normal, PRIO_NORMAL, k::TASKS_BAND_LEVEL_NORMAL), + (PriorityClass::BelowNormal, PRIO_BELOW, k::TASKS_BAND_LEVEL_BELOW), + (PriorityClass::Idle, PRIO_LOW, k::TASKS_BAND_LEVEL_LOW), +]; + +/// The name of a level. +pub fn level_name(l: Level, lang: UiLang) -> Text { + match l { + Level::Realtime => t(lang, k::TASKS_BAND_LEVEL_REALTIME), + Level::Set(c) => t(lang, LEVELS.iter().find(|e| e.0 == c).map_or(k::TASKS_BAND_LEVEL_NORMAL, |e| e.2)), + } +} + +/// The level a priority command sets. +pub fn class_of(id: CommandId) -> Option { + LEVELS.iter().find(|e| e.1 == id).map(|e| e.0) +} + +/// What the band knows of one selected row: its processes, what the rules say of them, and what it would act on. +#[derive(Clone, Debug)] +pub struct RowFacts { + pub key: RowKey, + pub kind: RowKind, + pub verb: RowVerb, + /// The app's name (a group) or the process's shown name. + pub name: String, + /// The image name of a process row. + pub image: String, + pub pid: Option, + pub members: Vec, + /// Windows of the members, and how many of them do not respond. + pub windows: u32, + pub hung: u32, + pub expandable: bool, + pub expanded: bool, + /// Every member is refused by the End rules: the reason of the first (None inside: nothing to say). + pub end_refused: Option>, + /// Every member is refused by the rules of priority and efficiency mode: the reason of the first. + pub tune_refused: Option>, + pub path: Option, + /// The level of the row's main process (the one owning its window, else the first). + pub level: Option, + /// Every member the rules allow is in efficiency mode (this session's book). + pub eco: bool, + /// The level this session found the process at, when it changed it. + pub restore: Option, + /// The members this session changed (what Restore acts on). + pub restore_members: Vec, + /// The shell's key when it is one of the members. + pub shell: Option, +} + +/// Whether one command is offered and, when it is not, why. +#[derive(Clone, Debug, PartialEq)] +pub struct Avail { + pub enabled: bool, + pub why: Option, +} + +impl Avail { + fn yes() -> Avail { + Avail { enabled: true, why: None } + } + + fn no(why: Option) -> Avail { + Avail { enabled: false, why } + } +} + +/// What a selection offers: every command of the band and of the row menu, from the facts of its rows. +#[derive(Clone, Debug, PartialEq)] +pub struct Plan { + pub close: Avail, + pub end: Avail, + pub end_now: Avail, + pub end_tree: Avail, + pub efficiency: Avail, + /// The selection is in efficiency mode. + pub eco_on: bool, + pub priority: Avail, + /// The level of the first row's main process. + pub level: Option, + /// Whether the five levels can be chosen (never at Realtime). + pub levels: Avail, + /// The level this session can put back. + pub restore: Option, + pub open_path: Avail, + pub properties: Avail, + pub search: Avail, + pub copy_path: Avail, + /// The selection is Windows Explorer, the shell: the restart is offered. + pub restart: bool, + pub expand: bool, + pub collapse: bool, +} + +fn first_why(rows: &[RowFacts], pick: impl Fn(&RowFacts) -> &Option>) -> Option { + rows.iter().find_map(|r| pick(r).clone().flatten()) +} + +/// The plan of a selection. +pub fn plan(rows: &[RowFacts], lang: UiLang) -> Plan { + let one = rows.len() == 1; + let note = |key| Some(t(lang, key)); + let nothing = || Avail::no(note(k::TASKS_BAND_WHY_NOTHING)); + if rows.is_empty() { + let none = nothing(); + return Plan { + close: none.clone(), + end: none.clone(), + end_now: none.clone(), + end_tree: none.clone(), + efficiency: none.clone(), + eco_on: false, + priority: none.clone(), + level: None, + levels: none.clone(), + restore: None, + open_path: none.clone(), + properties: none.clone(), + search: none.clone(), + copy_path: none, + restart: false, + expand: false, + collapse: false, + }; + } + let end_ok = rows.iter().any(|r| r.end_refused.is_none()); + let end_why = first_why(rows, |r| &r.end_refused); + let end = if end_ok { Avail::yes() } else { Avail::no(end_why.clone()) }; + let close = if rows.iter().any(|r| r.verb == RowVerb::Close && r.end_refused.is_none()) { + Avail::yes() + } else if !end_ok { + Avail::no(end_why.clone()) + } else if rows.iter().any(|r| r.hung > 0) { + Avail::no(note(k::TASKS_BAND_WHY_HUNG)) + } else if rows.iter().any(|r| r.windows > 0) { + // Its windows are there, but this row's verb is End (a member or a process of Tree or List): Close is the app's. + Avail::no(note(k::TASKS_BAND_WHY_OWN_WINDOWS)) + } else { + Avail::no(note(k::TASKS_BAND_WHY_NO_WINDOW)) + }; + let end_tree = if !rows.iter().any(|r| matches!(r.kind, RowKind::Proc(_))) { + Avail::no(note(k::TASKS_BAND_WHY_TREE_GROUP)) + } else if rows.iter().any(|r| matches!(r.kind, RowKind::Proc(_)) && r.end_refused.is_none()) { + Avail::yes() + } else { + Avail::no(end_why) + }; + let tune_ok = rows.iter().any(|r| r.tune_refused.is_none()); + let tune = if tune_ok { Avail::yes() } else { Avail::no(first_why(rows, |r| &r.tune_refused)) }; + let level = rows.first().and_then(|r| r.level); + let levels = if !tune_ok { + tune.clone() + } else if rows.iter().all(|r| r.level == Some(Level::Realtime)) { + Avail::no(note(k::TASKS_BAND_WHY_REALTIME)) + } else { + Avail::yes() + }; + let eco_on = rows.iter().filter(|r| r.tune_refused.is_none()).all(|r| r.eco) + && rows.iter().any(|r| r.tune_refused.is_none()); + let path_for = |has: bool| { + if !one { + Avail::no(note(k::TASKS_BAND_WHY_ONE_ONLY)) + } else if has { + Avail::yes() + } else { + Avail::no(note(k::TASKS_BAND_WHY_NO_PATH)) + } + }; + let has_path = rows.first().is_some_and(|r| r.path.is_some()); + let single = rows.first().filter(|_| one); + // The row menu hides End now on Part of Windows rows; the band's menu is a menu pick, which the keyboard rule does + // not refuse, so the plan refuses it here. + let end_now = if end_ok && rows.iter().any(|r| r.verb == RowVerb::EndTask) { + Avail::no(note(k::TASKS_BAND_WHY_END_NOW_WINDOWS)) + } else { + end.clone() + }; + Plan { + close, + end_now, + end, + end_tree, + efficiency: tune.clone(), + eco_on, + priority: tune, + level, + levels, + restore: rows.iter().find_map(|r| r.restore), + open_path: path_for(has_path), + properties: path_for(has_path), + search: if one { Avail::yes() } else { Avail::no(note(k::TASKS_BAND_WHY_ONE_ONLY)) }, + copy_path: path_for(has_path), + restart: single.is_some_and(|r| r.shell.is_some()), + expand: single.is_some_and(|r| r.expandable && !r.expanded), + collapse: single.is_some_and(|r| r.expandable && r.expanded), + } +} + +/// The reason text of a refusal of the priority and efficiency rules. +fn tune_why(r: TuneRefusal, key: ProcKey, g: &KillGuard, lang: UiLang) -> Option { + match r { + TuneRefusal::Rule(r) => access::why(r, key, g).map(|w| t(lang, w)), + TuneRefusal::NotYours => Some(t(lang, k::TASKS_BAND_WHY_SESSION)), + TuneRefusal::NeverTouch(_) => Some(t(lang, k::TASKS_BAND_WHY_NEVER)), + TuneRefusal::Realtime => Some(t(lang, k::TASKS_BAND_WHY_REALTIME)), + TuneRefusal::BookFull => Some(t(lang, k::TASKS_BAND_WHY_BOOK_FULL)), + TuneRefusal::NothingToRestore => None, + } +} + +/// The row's name as the menu and the band say it: a group's label without its count, a process's image name. +pub fn name_of(s: &TasksScreen, kind: RowKind, key: RowKey, label: &str, members: usize) -> String { + match kind { + RowKind::Proc(p) => s.v.shown_name(key, p), + _ => label.strip_suffix(&format!(" ({members})")).unwrap_or(label).to_string(), + } +} + +/// The facts of the rows of `keys`, in order; a row with no verb (a section, the hardware row, a ghost) or no +/// process is left out. +pub fn gather(s: &mut TasksScreen, keys: &[RowKey], lang: UiLang) -> Vec { + let guard = actions::guard_of(&s.p.actions, &s.v, s.deps.install_dir.as_deref()); + let mut out = Vec::new(); + let mut changed = false; + for &key in keys { + let model = s.table.model(); + let Some(i) = model.row_of(key) else { continue }; + let Some(r) = model.rows.get(i).cloned() else { continue }; + let label = model.name(i).to_string(); + let Some(verb) = actions::row_verb(&s.p.actions, &s.v, &r) else { continue }; + let members = actions::members_of(&s.p.actions, &r); + let Some(&first) = members.first() else { continue }; + let frame = s.v.frame(); + let main = frame.windows.iter().find(|w| members.contains(&w.owner)).map_or(first, |w| w.owner); + let (windows, hung) = frame + .windows + .iter() + .filter(|w| members.contains(&w.owner)) + .fold((0u32, 0u32), |(n, h), w| (n + 1, h + u32::from(w.hung))); + let path = std::iter::once(main).chain(members.iter().copied()).find_map(|m| match frame.paths.get(m) { + Some(ImagePath::Path(p)) => Some(PathBuf::from(&**p)), + _ => None, + }); + let level = + s.p.facts + .class(main) + .map(details::level_of_class) + .or_else(|| s.v.procs().find(main).and_then(|p| level_of(p.base_prio))); + // The rules, member by member: a row is refused when every member is. + let (mut end_first, mut tune_first) = (None, None); + let (mut end_all, mut tune_all) = (true, true); + let mut allowed: Vec = Vec::new(); + for m in &members { + let probe = s.p.actions.probe(*m); + let f: MemberFacts = access::facts(*m, s.v.procs(), &s.v.frame().paths, &s.deps.system_root, probe); + match access::menu_refusal(&f, &guard) { + Some(r) => { + end_first.get_or_insert((r, *m)); + } + None => end_all = false, + } + match tune::menu_refusal(&f, &guard) { + Some(r) => { + tune_first.get_or_insert((r, *m)); + } + None => { + tune_all = false; + allowed.push(*m); + } + } + } + let end_refused = end_all.then(|| end_first.and_then(|(r, m)| access::why(r, m, &guard).map(|w| t(lang, w)))); + let tune_refused = tune_all.then(|| tune_first.and_then(|(r, m)| tune_why(r, m, &guard, lang))); + let entries: Vec<_> = members.iter().map(|m| (*m, s.deps.exec.undo_entry(*m))).collect(); + for (m, e) in &entries { + changed |= s.p.actions.set_eco(&[*m], e.is_some_and(|e| e.efficiency())); + } + // The reader's word on a process is fresher than this session's book; the book speaks where it has said none. + let eco = !allowed.is_empty() + && allowed.iter().all(|m| { + s.p.facts + .efficiency(*m) + .unwrap_or_else(|| entries.iter().any(|(k, e)| k == m && e.is_some_and(|e| e.efficiency()))) + }); + let restore = + entries.iter().find(|(m, e)| *m == main && e.is_some()).or_else(|| entries.iter().find(|e| e.1.is_some())); + let restore = restore.and_then(|(_, e)| e.map(|e| e.first.class)); + let restore_members = entries.iter().filter(|(_, e)| e.is_some()).map(|(m, _)| *m).collect(); + let (image, pid) = match r.kind { + RowKind::Proc(p) => { + let mut n = String::new(); + s.v.proc_name(p, &mut n); + (n, Some(p.pid)) + } + _ => (String::new(), None), + }; + out.push(RowFacts { + key, + kind: r.kind, + verb, + name: name_of(s, r.kind, key, &label, members.len()), + image, + pid, + windows, + hung, + expandable: r.expandable, + expanded: r.expanded, + end_refused, + tune_refused, + path, + level, + eco, + restore, + restore_members, + shell: guard.shell.filter(|sh| members.contains(sh)), + members, + }); + } + s.p.band.pipeline |= changed; + out +} + +/// The picture the table's row shows for the one selected row (the program's own icon, else its placeholder tile); +/// none for no row or several, where the band keeps its glyph. +fn selection_icon(s: &TasksScreen, keys: &[RowKey]) -> Option<(IconRef, IconBitmap)> { + let [key] = keys else { return None }; + let model = s.table.model(); + let e = model.rows.get(model.row_of(*key)?)?; + let r = model.icon_ref(e)?; + Some((r, model.icon(r, 0)?.clone())) +} + +/// The selection slot of the band: its icon, its name and the number of processes. +pub fn selection_of(rows: &[RowFacts], lang: UiLang) -> Option { + let subst = |key, args: &[(&str, &str)]| Text::from(oled_sys::i18n::subst(&t(lang, key), args)); + match rows { + [] => None, + [r] => { + let count = matches!(r.kind, RowKind::Group(_)).then(|| match r.members.len() { + 1 => t(lang, k::TASKS_BAND_COUNT_ONE), + n => subst(k::TASKS_BAND_COUNT_N, &[("n", &n.to_string())]), + }); + let glyph = if matches!(r.kind, RowKind::Group(_)) { Glyph::Window } else { Glyph::Executable }; + Some(BandSelection { glyph, name: Text::from(r.name.clone()), count }) + } + many => { + let procs: usize = many.iter().map(|r| r.members.len()).sum(); + let count = match procs { + 1 => t(lang, k::TASKS_BAND_COUNT_ONE), + n => subst(k::TASKS_BAND_COUNT_N, &[("n", &n.to_string())]), + }; + Some(BandSelection { + glyph: Glyph::Window, + name: subst(k::TASKS_BAND_MANY, &[("n", &many.len().to_string())]), + count: Some(count), + }) + } + } +} + +fn subst(lang: UiLang, key: S, args: &[(&str, &str)]) -> Text { + Text::from(oled_sys::i18n::subst(&t(lang, key), args)) +} + +/// The tooltip of Close: what it closes, or why it cannot. +fn close_tip(rows: &[RowFacts], p: &Plan, lang: UiLang) -> Text { + if !p.close.enabled { + return p.close.why.clone().unwrap_or_else(|| Text::from("")); + } + match rows { + [r] if r.windows == 1 => subst(lang, k::TASKS_BAND_TIP_CLOSE_1, &[("name", &r.name)]), + [r] => subst(lang, k::TASKS_BAND_TIP_CLOSE_N, &[("name", &r.name), ("n", &r.windows.to_string())]), + _ => t(lang, k::TASKS_BAND_TIP_CLOSE_MANY), + } +} + +fn end_tip(rows: &[RowFacts], p: &Plan, lang: UiLang) -> Text { + if !p.end.enabled { + return p.end.why.clone().unwrap_or_else(|| Text::from("")); + } + match rows { + // Part of Windows: what the row menu's End task says it risks. + [r] if r.verb == RowVerb::EndTask => { + let risk = t(lang, k::TASKS_VERB_END_TASK_DESC); + subst(lang, k::TASKS_BAND_TIP_END_TASK, &[("name", &r.name), ("risk", &risk)]) + } + [r] => subst(lang, k::TASKS_BAND_TIP_END, &[("name", &r.name)]), + _ => subst(lang, k::TASKS_BAND_TIP_END_MANY, &[("n", &rows.len().to_string())]), + } +} + +/// A menu row for a command of the plan: disabled with its reason as the note. +fn row(id: CommandId, label: Text, glyph: Option, chord: Option, a: &Avail) -> MenuItem { + MenuItem::Custom { + id, + label, + glyph, + chord, + enabled: a.enabled, + checked: None, + note: if a.enabled { None } else { a.why.clone() }, + danger: false, + } +} + +/// The five levels with the current one checked, and Restore when this session changed the level. +pub fn priority_items(p: &Plan, lang: UiLang) -> Vec { + let mut v: Vec = LEVELS + .iter() + .map(|(class, id, key)| MenuItem::Custom { + id: *id, + label: t(lang, *key), + glyph: None, + chord: None, + enabled: p.levels.enabled, + checked: Some(p.level == Some(Level::Set(*class))), + note: if p.levels.enabled { None } else { p.levels.why.clone() }, + danger: false, + }) + .collect(); + if let Some(class) = p.restore { + v.push(MenuItem::Separator); + let name = level_name(Level::Set(class), lang); + let label = subst(lang, k::TASKS_BAND_RESTORE, &[("level", &name)]); + v.push(row(PRIO_RESTORE, label, None, None, &Avail::yes())); + } + v +} + +/// The Efficiency mode row: checked while the selection is in it. +pub fn efficiency_item(p: &Plan, lang: UiLang) -> MenuItem { + let mut item = row(EFFICIENCY, t(lang, k::TASKS_BAND_EFFICIENCY), Some(Glyph::CmdEfficiency), None, &p.efficiency); + if let MenuItem::Custom { checked, .. } = &mut item { + *checked = Some(p.eco_on); + } + item +} + +/// The Priority submenu of the row menu. +pub fn priority_submenu(p: &Plan, lang: UiLang) -> MenuItem { + let label = match p.level { + Some(l) => subst(lang, k::TASKS_BAND_PRIORITY, &[("level", &level_name(l, lang))]), + None => t(lang, k::TASKS_BAND_PRIORITY_PLAIN), + }; + if p.priority.enabled { + return MenuItem::Submenu { label, glyph: Some(Glyph::CmdPriority), items: priority_items(p, lang) }; + } + row(BAND_PRIORITY, label, Some(Glyph::CmdPriority), None, &p.priority) +} + +/// The More menu's own items: Search online, Copy path and Go to details | End process tree, End now | Restart Explorer. +fn more_items(p: &Plan, lang: UiLang, page: Page) -> Vec { + let mut v = vec![ + row(SEARCH_ONLINE, t(lang, k::TASKS_BAND_SEARCH_ONLINE), Some(Glyph::LineGlobe), None, &p.search), + row(COPY_PATH, t(lang, k::TASKS_BAND_COPY_PATH), Some(Glyph::CmdCopy), None, &p.copy_path), + ]; + if page == Page::Details { + v.push(row(COLUMNS, t(lang, k::TASKS_BAND_COLUMNS), Some(Glyph::CmdView), None, &Avail::yes())); + } else if pages::entry(Page::Details).built { + v.push(row(GO_DETAILS, t(lang, k::TASKS_BAND_GO_DETAILS), Some(Glyph::PageDetails), None, &Avail::yes())); + } + v.push(MenuItem::Separator); + for (id, label, a) in [ + (END_TREE, t(lang, k::TASKS_VERB_END_TREE), &p.end_tree), + (END_NOW, oled_ui::verbs::Verb::EndNow.label(lang), &p.end_now), + ] { + let mut item = row(id, label, None, None, a); + if let MenuItem::Custom { danger, .. } = &mut item { + *danger = true; + } + v.push(item); + } + if p.restart { + v.push(MenuItem::Separator); + v.push(row( + RESTART_EXPLORER, + t(lang, k::TASKS_BAND_RESTART_EXPLORER), + Some(Glyph::Restart), + None, + &Avail::yes(), + )); + } + v +} + +/// The band: the kit's command band and what the screen last worked out for it. +#[derive(Default)] +pub struct BandState { + bar: Option, + /// What the bar was last filled for: the selection, the frame and the tune counter. + sig: Option<(Vec, u64, u64, u64)>, + /// Counts the outcomes of tune batches: a change of the book is a reason to fill the bar again. + epoch: u64, + /// The Status column has to be built again: a mark of efficiency mode changed. + pipeline: bool, +} + +impl BandState { + /// The reader told something new about a process: the bar is filled again. + pub fn note_facts(&mut self) { + self.epoch += 1; + } + + /// The bar's commands after the last layout (tests read it). + pub fn bar(&self) -> Option<&CommandBar> { + self.bar.as_ref() + } + + /// The last Altro menu's own rows are built by the screen; this only tells the bar its menu closed. + pub fn on_menu_closed(&mut self) { + if let Some(b) = self.bar.as_mut() { + b.set_open(None); + b.set_more_open(false); + } + } + + pub fn event(&mut self, cx: &mut EventCx, ev: &Event) -> Option { + self.bar.as_mut()?.event(cx, ev) + } +} + +/// The bar, built on first use: every button at its place, filled by sync. +fn ensure(st: &mut BandState, lang: UiLang) -> &mut CommandBar { + st.bar.get_or_insert_with(|| { + let item = |id, glyph, key, kind| CommandItem::new(id, glyph, t(lang, key), kind); + let entries = vec![ + BarEntry::Item(item(CLOSE_ONLY, Glyph::CmdCloseWindow, k::TASKS_BAND_CLOSE_PLAIN, ButtonKind::Command)), + BarEntry::Item(item(END_ONLY, Glyph::CmdEndTask, k::TASKS_BAND_END, ButtonKind::Destructive)), + BarEntry::Item( + item(EFFICIENCY, Glyph::CmdEfficiency, k::TASKS_BAND_EFFICIENCY, ButtonKind::Toggle).fold(1), + ), + BarEntry::Item( + item(BAND_PRIORITY, Glyph::CmdPriority, k::TASKS_BAND_PRIORITY_PLAIN, ButtonKind::Menu).fold(2), + ), + BarEntry::Item(item(OPEN_PATH, Glyph::LineFolder, k::TASKS_BAND_OPEN_PATH, ButtonKind::Command).fold(3)), + BarEntry::Item(item(PROPERTIES, Glyph::LineInfo, k::TASKS_BAND_PROPERTIES, ButtonKind::Command).fold(4)), + BarEntry::More, + ]; + let mut bar = CommandBar::new(BAND, BarStyle::Band, entries); + bar.set_name(t(lang, k::TASKS_BAND_NAME)); + bar.set_empty_text(Some(t(lang, k::TASKS_BAND_EMPTY))); + bar + }) +} + +/// The selected rows' keys in table order (no focused-row fallback: nothing selected is the empty band). +pub(crate) fn selection_keys(s: &TasksScreen) -> Vec { + let mut keys = Vec::new(); + s.table.selection().for_each(s.table.model(), &mut |_, key| keys.push(key)); + keys +} + +/// The node F6 gives the focus to: the first button of the bar that can take it, else the More button; None while the +/// band shows nothing but its sentence. +pub fn focus_node(s: &TasksScreen) -> Option { + if !details::hosts_band(s.chrome.page()) { + return None; + } + let bar = s.p.band.bar.as_ref()?; + let first = bar.visible().into_iter().find(|id| bar.item(*id).is_some_and(|it| it.enabled)); + first.and_then(|id| bar.node_of(id)).or_else(|| bar.visible().first().and_then(|_| bar.more_node())) +} + +/// Lays the band out at `rect`; returns the height it took (physical px): none on a page that has no band. +pub fn layout(s: &mut TasksScreen, cx: &mut LayoutCx, rect: RectP) -> i32 { + if !details::hosts_band(s.chrome.page()) { + return 0; + } + let lang = s.deps.lang; + let bar = ensure(&mut s.p.band, lang); + let r = RectP { l: rect.l + cx.px(MARGIN_L), t: rect.t, r: rect.r - cx.px(MARGIN_R), b: rect.t + cx.px(BAR_H) }; + bar.layout(cx, r); + cx.px(HEIGHT) +} + +pub fn paint(s: &TasksScreen, cx: &mut PaintCx) { + if !details::hosts_band(s.chrome.page()) { + return; + } + if let Some(bar) = s.p.band.bar.as_ref() { + bar.paint(cx); + } +} + +/// The end of every call: fills the bar again when the selection, the frame or the book changed. +pub fn sync(s: &mut TasksScreen, cx: &mut EventCx) { + if !details::hosts_band(s.chrome.page()) { + return; + } + let keys = selection_keys(s); + let icon = selection_icon(s, &keys); + let icon_sig = icon.as_ref().map_or(0, |(r, b)| (u64::from(r.0) + 1) << 32 | u64::from(b.width)); + let sig = (keys, s.v.frame().seq, s.p.band.epoch, icon_sig); + if s.p.band.sig.as_ref() == Some(&sig) { + return; + } + let lang = cx.lang(); + let rows = gather(s, &sig.0, lang); + let p = plan(&rows, lang); + s.p.band.sig = Some(sig); + let (close_tip, end_tip) = (close_tip(&rows, &p, lang), end_tip(&rows, &p, lang)); + let del = oled_ui::verbs::Verb::Close.chord().map(|c| Text::from(c.label(lang))); + // Del is named only where it does what the button does: it closes a selection whose every row closes and ends one + // row that ends; it ends the End rows of a mixed selection too, and it is refused on Part of Windows. + let del_close = !rows.is_empty() && rows.iter().all(|r| r.verb == RowVerb::Close); + let del_end = matches!(rows.as_slice(), [r] if r.verb == RowVerb::End); + let name = rows.first().map(|r| r.name.clone()).unwrap_or_default(); + let close_label = match rows.as_slice() { + [r] => subst(lang, k::TASKS_BAND_CLOSE, &[("name", &r.name)]), + _ => t(lang, k::TASKS_BAND_CLOSE_PLAIN), + }; + let selection = selection_of(&rows, lang); + let bar = ensure(&mut s.p.band, lang); + bar.set_selection(selection); + bar.set_selection_icon(icon.map(|(_, b)| b)); + let tip = |a: &Avail, ok: Text| if a.enabled { ok } else { a.why.clone().unwrap_or_else(|| Text::from("")) }; + if let Some(it) = bar.item_mut(CLOSE_ONLY) { + it.label = close_label; + it.enabled = p.close.enabled; + it.tip = close_tip; + it.shortcut = del.clone().filter(|_| del_close); + } + if let Some(it) = bar.item_mut(END_ONLY) { + it.enabled = p.end.enabled; + it.tip = end_tip; + it.shortcut = del.filter(|_| del_end); + } + if let Some(it) = bar.item_mut(EFFICIENCY) { + it.enabled = p.efficiency.enabled; + it.on = p.eco_on; + it.tip = + tip(&p.efficiency, t(lang, if p.eco_on { k::TASKS_BAND_TIP_EFF_ON } else { k::TASKS_BAND_TIP_EFF_OFF })); + } + let level_label = match p.level { + Some(l) => subst(lang, k::TASKS_BAND_PRIORITY, &[("level", &level_name(l, lang))]), + None => t(lang, k::TASKS_BAND_PRIORITY_PLAIN), + }; + if let Some(it) = bar.item_mut(BAND_PRIORITY) { + it.label = level_label; + it.enabled = p.priority.enabled; + it.tip = tip(&p.priority, t(lang, k::TASKS_BAND_TIP_PRIORITY)); + it.submenu = priority_items(&p, lang); + } + if let Some(it) = bar.item_mut(OPEN_PATH) { + it.enabled = p.open_path.enabled; + it.tip = tip(&p.open_path, subst(lang, k::TASKS_BAND_TIP_OPEN_PATH, &[("name", &name)])); + } + if let Some(it) = bar.item_mut(PROPERTIES) { + it.enabled = p.properties.enabled; + it.tip = tip(&p.properties, t(lang, k::TASKS_BAND_TIP_PROPERTIES)); + } + cx.relayout(); + // The Status column follows the book of the rows just read. + if std::mem::take(&mut s.p.band.pipeline) { + let now = cx.now_ms(); + s.run_pipeline(cx, now); + } +} + +/// A tune batch for `rows`: one target per row, each with its members (Restore: the ones this session changed). +fn submit_tune(s: &mut TasksScreen, rows: &[RowFacts], verb: TuneVerb) { + let targets: Vec = rows + .iter() + .filter(|r| r.tune_refused.is_none()) + .filter_map(|r| { + let members = if verb == TuneVerb::Restore { r.restore_members.clone() } else { r.members.clone() }; + (!members.is_empty()).then_some(TuneTarget { row: r.key, members }) + }) + .collect(); + if targets.is_empty() { + return; + } + let guard = actions::guard_of(&s.p.actions, &s.v, s.deps.install_dir.as_deref()); + s.deps.exec.tune(TuneBatch { verb, targets, guard }); +} + +/// A notice for a failed act of the launcher. +pub(crate) fn open_failed(s: &mut TasksScreen, cx: &mut EventCx, code: u32) { + let text = subst(cx.lang(), k::TASKS_BAND_NOTE_OPEN_FAILED, &[("code", &code.to_string())]); + s.notices.show(cx, text, None); +} + +/// The commands of the band and of the row menu that act on the selection (or on the rows of the open menu). +pub fn on_command(s: &mut TasksScreen, cx: &mut EventCx, id: CommandId) { + let lang = cx.lang(); + // The rows of the open band menu (or of a row menu), else the selection: never the focused row. + let keys = s.p.actions.take_menu().unwrap_or_else(|| selection_keys(s)); + let rows = gather(s, &keys, lang); + if rows.is_empty() { + return; + } + let p = plan(&rows, lang); + let one = rows.first().filter(|_| rows.len() == 1); + match id { + EFFICIENCY if p.efficiency.enabled => submit_tune(s, &rows, TuneVerb::Efficiency(!p.eco_on)), + PRIO_RESTORE if p.restore.is_some() => submit_tune(s, &rows, TuneVerb::Restore), + _ if class_of(id).is_some() && p.levels.enabled => { + if let Some(class) = class_of(id) { + submit_tune(s, &rows, TuneVerb::Priority(class)); + } + } + OPEN_PATH if p.open_path.enabled => { + if let Some(path) = one.and_then(|r| r.path.clone()) { + if let Err(code) = s.deps.launcher.open_location(&path) { + open_failed(s, cx, code); + } + } + } + PROPERTIES if p.properties.enabled => { + if let Some(path) = one.and_then(|r| r.path.clone()) { + if let Err(code) = s.deps.launcher.show_properties(&path) { + open_failed(s, cx, code); + } + } + } + SEARCH_ONLINE if p.search.enabled => { + if let Some(r) = one { + let suffix = t(lang, k::TASKS_BAND_SEARCH_SUFFIX); + if let Err(code) = s.deps.launcher.open_url(&crate::app::launch::search_url(&r.name, &suffix)) { + open_failed(s, cx, code); + } + } + } + COPY_PATH if p.copy_path.enabled => { + if let Some(path) = one.and_then(|r| r.path.as_ref()) { + cx.clipboard().set_text(&path.to_string_lossy()); + } + } + RESTART_EXPLORER if p.restart => { + if let Some((r, shell)) = one.and_then(|r| r.shell.map(|sh| (r, sh))) { + let guard = actions::guard_of(&s.p.actions, &s.v, s.deps.install_dir.as_deref()); + s.deps.exec.restart_explorer(RestartReq { row: r.key, shell, guard }); + } + } + GO_DETAILS if pages::entry(Page::Details).built && s.chrome.page() == Page::Processes => { + let target = one.and_then(|r| details::main_of(s, &r.members)); + details::go_to(s, cx, target); + } + EXPAND_ROW | COLLAPSE_ROW => { + if let Some(r) = one { + let open = id == EXPAND_ROW; + let out = TableOut::ExpandRequested(r.key, open); + if grouped::on_table_out(cx, &mut s.p.grouped, &out, &s.deps.state) { + let now = cx.now_ms(); + s.run_pipeline(cx, now); + } + } + } + _ => {} + } +} + +/// What the bar asked for: a command, the Priority menu or the More menu. +pub fn on_out(s: &mut TasksScreen, cx: &mut EventCx, out: CommandBarOut) { + let lang = cx.lang(); + match out { + CommandBarOut::Command(id) => commands::dispatch(s, cx, id), + CommandBarOut::OpenMenu(id, rect) => { + let keys = selection_keys(s); + let p = plan(&gather(s, &keys, lang), lang); + s.p.actions.set_menu(keys); + cx.open_menu(priority_items(&p, lang), Anchor::Below(rect)); + order::note_menu_open(&mut s.p.order); + if let Some(b) = s.p.band.bar.as_mut() { + b.set_open(Some(id)); + } + } + CommandBarOut::OpenMore(rect) => { + let keys = selection_keys(s); + let p = plan(&gather(s, &keys, lang), lang); + s.p.actions.set_menu(keys); + s.p.details.set_more(rect); + let page = s.chrome.page(); + let Some(bar) = s.p.band.bar.as_mut() else { return }; + let items = bar.more_menu(more_items(&p, lang, page)); + bar.set_more_open(true); + cx.open_menu(items, Anchor::Below(rect)); + order::note_menu_open(&mut s.p.order); + } + } +} + +/// The notice of a tune batch: the worst thing that happened (Failed, then NeedsAdmin, then Refused) and the processes +/// it happened to, or None when every change was made (or its process was gone). Pure. +pub fn tune_notice( + outcomes: &[(ProcKey, TuneOutcome)], + name: &dyn Fn(ProcKey) -> String, + why: &dyn Fn(TuneRefusal, ProcKey) -> Option, + lang: UiLang, +) -> Option { + let rank = |o: &TuneOutcome| match o { + TuneOutcome::Failed(_) => 3, + TuneOutcome::NeedsAdmin => 2, + TuneOutcome::Refused(TuneRefusal::NothingToRestore) => 0, + TuneOutcome::Refused(_) => 1, + _ => 0, + }; + let worst = outcomes.iter().map(|o| rank(&o.1)).max().unwrap_or(0); + if worst == 0 { + return None; + } + let hit: Vec<&(ProcKey, TuneOutcome)> = outcomes.iter().filter(|o| rank(&o.1) == worst).collect(); + let mut names: Vec = Vec::new(); + for (key, _) in &hit { + let n = name(*key); + if !n.is_empty() && !names.contains(&n) { + names.push(n); + } + } + let shown = names.iter().take(NOTICE_NAMES).cloned().collect::>().join(", "); + let more = names.len().saturating_sub(NOTICE_NAMES); + let names = if more > 0 { + format!("{shown} {}", oled_sys::i18n::subst(&t(lang, k::TASKS_ROW_MORE), &[("n", &more.to_string())])) + } else { + shown + }; + let first = hit.first()?; + Some(match first.1 { + TuneOutcome::Failed(code) => { + subst(lang, k::TASKS_BAND_NOTE_FAILED, &[("names", &names), ("code", &code.to_string())]) + } + TuneOutcome::NeedsAdmin => subst(lang, k::TASKS_BAND_NOTE_ADMIN, &[("names", &names)]), + TuneOutcome::Refused(r) => { + let reason = why(r, first.0)?; + subst(lang, k::TASKS_BAND_NOTE_REFUSED, &[("names", &names), ("why", &reason)]) + } + _ => return None, + }) +} + +/// The notice of a restart of Explorer; None when it came back (or started again) or was not there to end. +pub fn restart_notice(o: RestartOutcome, shell: ProcKey, g: &KillGuard, lang: UiLang) -> Option { + let code = |key, c: u32| subst(lang, key, &[("code", &c.to_string())]); + match o { + RestartOutcome::Back | RestartOutcome::Started | RestartOutcome::Gone => None, + RestartOutcome::Slow => Some(t(lang, k::TASKS_BAND_RESTART_SLOW)), + RestartOutcome::NeedsAdmin => Some(t(lang, k::TASKS_WHY_ADMIN)), + RestartOutcome::Failed(c) => Some(code(k::TASKS_BAND_RESTART_FAILED, c)), + RestartOutcome::NoShell(c) => Some(code(k::TASKS_BAND_RESTART_NO_SHELL, c)), + RestartOutcome::Refused(RestartRefusal::NotShell) => Some(t(lang, k::TASKS_BAND_RESTART_NOT_SHELL)), + RestartOutcome::Refused(RestartRefusal::Elevated) => Some(t(lang, k::TASKS_BAND_RESTART_ELEVATED)), + RestartOutcome::Refused(RestartRefusal::Busy) => Some(t(lang, k::TASKS_BAND_RESTART_BUSY)), + RestartOutcome::Refused(RestartRefusal::Rule(r)) => access::why(r, shell, g).map(|w| t(lang, w)), + } +} + +/// A tune batch or a restart came back (AppMsg): the Status column follows the book, a refusal or a failure is said in the +/// notice line, and the bar is filled again. +pub fn on_tune_done(s: &mut TasksScreen, cx: &mut EventCx, m: TuneDone) { + let lang = cx.lang(); + let guard = actions::guard_of(&s.p.actions, &s.v, s.deps.install_dir.as_deref()); + let notice = match &m { + TuneDone::Process { members, .. } => { + for (key, _) in members { + let on = s.deps.exec.undo_entry(*key).is_some_and(|e| e.efficiency()); + s.p.actions.set_eco(&[*key], on); + // What the reader saw before the change is stale: it reads the process again. + s.p.facts.set(*key, None); + } + let name = |k: ProcKey| { + let mut n = String::new(); + s.v.proc_name(k, &mut n); + n + }; + tune_notice(members, &name, &|r, k| tune_why(r, k, &guard, lang), lang) + } + TuneDone::Explorer { outcome, .. } => { + restart_notice(*outcome, guard.shell.unwrap_or(ProcKey { pid: 0, created: 0 }), &guard, lang) + } + }; + if let Some(text) = notice { + s.notices.show(cx, text, None); + } + s.p.band.epoch += 1; +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::app::access::Refusal; + + fn key(pid: u32) -> ProcKey { + ProcKey { pid, created: u64::from(pid) } + } + + #[test] + fn base_priorities_map_to_the_six_levels() { + let set = |c| Some(Level::Set(c)); + for (base, want) in [ + (4, set(PriorityClass::Idle)), + (6, set(PriorityClass::BelowNormal)), + (8, set(PriorityClass::Normal)), + (10, set(PriorityClass::AboveNormal)), + (13, set(PriorityClass::High)), + (24, Some(Level::Realtime)), + (7, set(PriorityClass::Normal)), + (9, set(PriorityClass::AboveNormal)), + (0, None), + (-1, None), + ] { + assert_eq!(level_of(base), want, "base priority {base}"); + } + assert!(LEVELS.len() == 5, "Realtime is never a level to choose"); + } + + #[test] + fn a_level_command_names_one_level() { + for (class, id, _) in LEVELS { + assert_eq!(class_of(id), Some(class)); + } + assert_eq!(class_of(EFFICIENCY), None); + } + + fn names(k: ProcKey) -> String { + format!("p{}", k.pid) + } + + fn reasons(r: TuneRefusal, _: ProcKey) -> Option { + Some(Text::from(match r { + TuneRefusal::NotYours => "not yours", + _ => "rule", + })) + } + + #[test] + fn a_notice_says_the_worst_outcome_and_who_it_hit() { + let lang = UiLang::EN; + let say = |o: &[(ProcKey, TuneOutcome)]| tune_notice(o, &names, &reasons, lang).map(|t| t.to_string()); + let done = TuneOutcome::Done(tune::Reading { class: tune::Class::Realtime, throttle: None }); + assert_eq!(say(&[(key(1), done)]), None, "a change that was made says nothing"); + assert_eq!(say(&[(key(1), TuneOutcome::Gone)]), None, "a process that is gone says nothing"); + assert_eq!(say(&[(key(1), TuneOutcome::Refused(TuneRefusal::NothingToRestore))]), None); + assert_eq!( + say(&[(key(1), done), (key(2), TuneOutcome::Refused(TuneRefusal::NotYours))]).as_deref(), + Some("Not changed for p2: not yours") + ); + assert_eq!( + say(&[(key(1), TuneOutcome::NeedsAdmin), (key(2), TuneOutcome::Refused(TuneRefusal::NotYours))]).as_deref(), + Some("Not changed for p1: needs administrator rights"), + "needing administrator rights outranks a refusal" + ); + assert_eq!( + say(&[(key(1), TuneOutcome::NeedsAdmin), (key(2), TuneOutcome::Failed(87))]).as_deref(), + Some("Couldn't change p2 (87)"), + "a failure outranks both" + ); + let many: Vec<_> = (1..=5).map(|p| (key(p), TuneOutcome::Refused(TuneRefusal::NotYours))).collect(); + assert_eq!(say(&many).as_deref(), Some("Not changed for p1, p2, p3 +2: not yours")); + let twice = [(key(1), TuneOutcome::NeedsAdmin), (key(1), TuneOutcome::NeedsAdmin)]; + assert_eq!(say(&twice).as_deref(), Some("Not changed for p1: needs administrator rights"), "each name once"); + } + + #[test] + fn the_italian_notice_is_italian() { + let o = [(key(1), TuneOutcome::Refused(TuneRefusal::NotYours))]; + let t = tune_notice(&o, &names, &reasons, UiLang::IT).map(|t| t.to_string()); + assert_eq!(t.as_deref(), Some("Non modificato per p1: not yours")); + } + + fn guard() -> KillGuard { + KillGuard { + helper: oled_sys::admin::policy::HelperFacts { + self_pid: 1, + parent: key(0), + session: 1, + dock_family: [None; 4], + }, + own_chain: Vec::new(), + shell: None, + } + } + + #[test] + fn a_restart_that_worked_says_nothing() { + let lang = UiLang::EN; + let g = guard(); + let say = |o| restart_notice(o, key(1), &g, lang).map(|t| t.to_string()); + for o in [RestartOutcome::Back, RestartOutcome::Started, RestartOutcome::Gone] { + assert_eq!(say(o), None, "{o:?}"); + } + assert_eq!(say(RestartOutcome::Slow).as_deref(), Some("Explorer is slow to come back: give it a moment")); + assert_eq!(say(RestartOutcome::Failed(5)).as_deref(), Some("Couldn't restart Explorer (5)")); + assert_eq!( + say(RestartOutcome::Refused(RestartRefusal::Busy)).as_deref(), + Some("Explorer is already restarting") + ); + assert_eq!( + say(RestartOutcome::Refused(RestartRefusal::Rule(Refusal::Shell))).as_deref(), + Some("The taskbar and desktop would close") + ); + } + + fn facts(refused: Option>, tune: Option>) -> RowFacts { + RowFacts { + key: RowKey(1), + kind: RowKind::Hardware, + verb: RowVerb::End, + name: "x".into(), + image: String::new(), + pid: None, + members: vec![key(1)], + windows: 0, + hung: 0, + expandable: false, + expanded: false, + end_refused: refused, + tune_refused: tune, + path: Some(PathBuf::from("C:\\x\\x.exe")), + level: Some(Level::Set(PriorityClass::Normal)), + eco: false, + restore: None, + restore_members: Vec::new(), + shell: None, + } + } + + #[test] + fn a_selection_of_refused_rows_is_refused_and_a_mixed_one_is_not() { + let lang = UiLang::EN; + let no = Some(Some(Text::from("nope"))); + let all = plan(&[facts(no.clone(), no.clone()), facts(no.clone(), no.clone())], lang); + assert!(!all.end.enabled && !all.efficiency.enabled && !all.priority.enabled); + assert_eq!(all.end.why.map(|t| t.to_string()).as_deref(), Some("nope")); + let mixed = plan(&[facts(no.clone(), no.clone()), facts(None, None)], lang); + assert!(mixed.end.enabled && mixed.efficiency.enabled && mixed.priority.enabled); + assert!(!mixed.eco_on, "a row not in efficiency mode"); + let mut on = facts(None, None); + on.eco = true; + assert!(plan(&[facts(no.clone(), no), on], lang).eco_on, "refused rows do not count against the toggle"); + } + + #[test] + fn restore_is_offered_with_the_level_this_session_found() { + let lang = UiLang::EN; + let mut f = facts(None, None); + assert!(plan(std::slice::from_ref(&f), lang).restore.is_none()); + f.restore = Some(PriorityClass::BelowNormal); + let p = plan(&[f], lang); + let items = priority_items(&p, lang); + match items.last() { + Some(MenuItem::Custom { id, label, .. }) => { + assert_eq!(*id, PRIO_RESTORE); + assert_eq!(label.to_string(), "Restore Below normal"); + } + other => panic!("{other:?}"), + } + } + + #[test] + fn the_band_strings_are_all_in_italian() { + let p = plan(&[facts(None, None)], UiLang::IT); + let items = priority_items(&p, UiLang::IT); + let names: Vec = items + .iter() + .filter_map(|i| match i { + MenuItem::Custom { label, .. } => Some(label.to_string()), + _ => None, + }) + .collect(); + assert_eq!(names, ["Alta", "Superiore al normale", "Normale", "Inferiore al normale", "Bassa"]); + } +} diff --git a/apps/tasks/src/ui/chrome.rs b/apps/tasks/src/ui/chrome.rs index f6b47cca..4c1ae866 100644 --- a/apps/tasks/src/ui/chrome.rs +++ b/apps/tasks/src/ui/chrome.rs @@ -1,45 +1,89 @@ -//! The toolbar: the Processes tab, the status, the search field and the More button, all of the kit's Toolbar. Filled by -//! TA-T1a (T1.4) and TA-T5a (T5.1). +//! The frame around the page: the left bar, the page head and the status line. The bar and the head have their own files +//! (rail.rs, head.rs); this one holds what they share (the page, the counts, the paused look) and the status line. -use oled_ui::model::FgRole; -use oled_ui::widgets::{FieldKind, FieldOut, PageTabs, TextField, Toolbar, ToolbarButton, ToolbarOut}; -use oled_ui::{CommandId, Event, EventCx, Glyph, LayoutCx, PaintCx, RectP, TypeRole, UiLang, Widget, WidgetId}; +use oled_sysmon::fmt::{self, Cell, NumFmt}; +use oled_ui::model::{Align, FgRole}; +use oled_ui::text::Trim; +use oled_ui::widgets::{Button, ButtonKind, ButtonOut}; +use oled_ui::{ + Chord, CommandId, Event, EventCx, Glyph, Ink, LayoutCx, Node, NodeId, PaintCx, PointP, RectP, Role, TypeRole, + UiLang, Widget, WidgetId, +}; -use super::commands::{MORE, PAGE_PROCESSES}; -use super::screen::{TasksScreen, CHROME}; +use super::commands::{ + MORE, PAGE_DETAILS, PAGE_PERFORMANCE, PAGE_PROCESSES, PAUSE, RAIL_TOGGLE, VIEW_GROUPED, VIEW_LIST, VIEW_TREE, +}; +pub use super::head::SEARCH; +use super::head::{Head, HeadOut, HEIGHT as HEAD_H, VIEW_MENU, VIEW_SEG}; +use super::rail::{self, Rail, RailOut, RAIL, RAIL_TOGGLE_BUTTON}; +use super::screen::{TasksScreen, CHROME, STATUS_H}; +use super::{more_menu, pages}; +use crate::app::options::RailMode; use crate::app::sampling::Status; +use crate::model::view::{Page, ViewMode}; use crate::strings::{k, t}; -/// The search field's widget id (the toolbar's buttons and tab are nodes of CHROME). -pub const SEARCH: WidgetId = WidgetId(5); -/// The search field's width, logical px. -const FIELD_W: i32 = 200; -/// The kit's page tab and toolbar measures the More button's place follows (logical px). -const TAB_PAD: i32 = 8; -const MARGIN: i32 = 16; -const GROUP_GAP: i32 = 12; -const BUTTON_SIDE: i32 = 28; - -/// What the toolbar tells the screen. +/// The status line's pause button. +pub const STATUS_PAUSE: WidgetId = WidgetId(0x14); + +/// The status line's padding, the button's height and the gaps between its parts, logical px. +const STATUS_PAD: i32 = 14; +const PAUSE_H: i32 = 24; +const PART_GAP: i32 = 12; +const HELD_GLYPH: i32 = 14; +const HELD_GAP: i32 = 6; +/// The slot of the status line's node among the nodes of CHROME. +const STATUS_SLOT: u32 = 2; + +/// What the frame tells the screen. #[derive(Clone, Debug, PartialEq, Eq)] pub enum ChromeOut { Command(CommandId), /// The search field's text changed. Query(String), + /// The menu button of a narrow head: the plate to open the view menu under. + ViewMenu(RectP), +} + +/// What the lists hold: the apps (known while the grouped list is built), the processes and their threads. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct Totals { + pub apps: Option, + pub procs: usize, + pub threads: u64, } #[derive(Default)] pub struct Chrome { - rect: RectP, + rail: Rail, + head: Head, + page: Page, status: Option, - /// (matching, all) while a query stands: it replaces the status text. + /// (matching, all) while a query stands: it replaces the head's count. count: Option<(usize, usize)>, - toolbar: Option, - /// What the search field holds (a mirror: the kit's field is only reachable with a mutable borrow). - typed: String, - more_rect: RectP, - /// The language the toolbar's texts were written in. + totals: Totals, + held: bool, + /// The bar as the last layout had it: collapsed (by the saved choice or by a narrow window). + collapsed: bool, + pause: Option