Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9baae8d08f | ||
|
|
331cb08939
|
||
|
|
55d879e530 | ||
|
|
5b69972ca2
|
||
|
|
cc973aa11b | ||
|
|
cbcd556df9
|
||
|
|
6575c5c5e5
|
||
|
|
1b9304247b | ||
|
|
837e5eba1d
|
||
|
|
f498437ada
|
||
|
|
4305a49291 | ||
|
|
8ba9d620af
|
No files matched your search
@@ -6,13 +6,13 @@ body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Tip: **About → Report bug** inside the app pre-fills this form (version, modules,
|
||||
Tip: **Settings → About → Report a bug** inside the app pre-fills this form (version, modules,
|
||||
console errors) and saves a `bugreport-*.zip` you can attach below.
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: OmniDeck version
|
||||
placeholder: "0.0.1-alpha.1 (1ab1b36) — shown in About"
|
||||
placeholder: "0.2.0 (1a2b3c4) — shown in Settings → About"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
@@ -48,7 +48,7 @@ body:
|
||||
attributes:
|
||||
label: Console errors
|
||||
description: >
|
||||
For web app issues, paste the console errors that About → Report bug captured (they are
|
||||
For web app issues, paste the console errors that Settings → About → Report a bug captured (they are
|
||||
in the pre-filled issue and the zip). Release builds have no DevTools, so there is no
|
||||
other way to copy them. Leave empty for native mini-apps.
|
||||
render: text
|
||||
|
||||
+29
-1
@@ -6,6 +6,32 @@ All notable changes to OmniDeck are documented here. The format follows
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.2.0] — 2026-11-03
|
||||
|
||||
The end of phase P2. The eight web apps of the catalog run inside OmniDeck on Microsoft Edge
|
||||
WebView2, with their notifications, site permissions and memory figures, beside the clock, timer and
|
||||
calculator and the new weather, calendar and media player modules. Any module can open in a window
|
||||
of its own, web pages go full screen, a bug report can be prepared from inside the app, and the
|
||||
memory governor rests the modules no one is looking at, a minimized window's included. The
|
||||
0.2.0-alpha.1 to 0.2.0-alpha.4 notes list all of it in detail: 0.2.0 is the same app as
|
||||
0.2.0-alpha.4. Stocks, the finished Dynamic and Comfort layouts, Vietnamese and Japanese arrive in P3.
|
||||
|
||||
## [0.2.0-alpha.4] — 2026-11-03
|
||||
|
||||
Fourth P2 alpha, the build to try out before 0.2.0: the memory governor now also rests the module
|
||||
of a minimized window. The web app list every copy downloads was updated the same day: Spotify's
|
||||
"Continue with Google, Facebook or Apple" buttons now sign in inside the app, and a Discord or
|
||||
Facebook call that is playing sound is never put to sleep.
|
||||
|
||||
### Fixed
|
||||
- The module on screen when you minimized OmniDeck, or closed it to the notification area, kept
|
||||
running at full size for as long as the window stayed away, even above the memory limits. It now
|
||||
rests like any other hidden module: suspended after 5 minutes and closed down after 30 (or whatever
|
||||
Settings → Memory says), unless it is playing, kept running or has notifications on. It comes back,
|
||||
on the page it showed, when the window does.
|
||||
- A player that stops after playing out of sight for a while is no longer closed down at once: the
|
||||
time it spent playing does not count as time unused.
|
||||
|
||||
## [0.2.0-alpha.3] — 2026-11-02
|
||||
|
||||
Third P2 alpha, the build to try out before 0.2.0: pop-out windows, web pages in full screen, an icon
|
||||
@@ -235,7 +261,9 @@ user-facing features yet: the window only shows the version.
|
||||
- Supported platform narrowed to Windows 11 (24H2 or later), x64.
|
||||
- App data moves to `%LocalAppData%\OmniDeck.Data`, outside Velopack's install folder.
|
||||
|
||||
[Unreleased]: https://github.com/poli0981/OmniDeck/compare/v0.2.0-alpha.3...HEAD
|
||||
[Unreleased]: https://github.com/poli0981/OmniDeck/compare/v0.2.0...HEAD
|
||||
[0.2.0]: https://github.com/poli0981/OmniDeck/compare/v0.2.0-alpha.4...v0.2.0
|
||||
[0.2.0-alpha.4]: https://github.com/poli0981/OmniDeck/compare/v0.2.0-alpha.3...v0.2.0-alpha.4
|
||||
[0.2.0-alpha.3]: https://github.com/poli0981/OmniDeck/compare/v0.2.0-alpha.2...v0.2.0-alpha.3
|
||||
[0.2.0-alpha.2]: https://github.com/poli0981/OmniDeck/compare/v0.2.0-alpha.1...v0.2.0-alpha.2
|
||||
[0.2.0-alpha.1]: https://github.com/poli0981/OmniDeck/compare/v0.1.1...v0.2.0-alpha.1
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
**OmniDeck** — ứng dụng desktop **Windows 11** (24H2+, x64) gom các mini-app native (đồng hồ, hẹn giờ, máy tính, thời tiết, lịch, chứng khoán, media player) và các web app tuyển chọn (Spotify, Discord, YouTube, Google…, chạy trên WebView2) vào một cửa sổ, với **RAM governor** tự suspend/hibernate module.
|
||||
|
||||
- Open-source **GPL-3.0**; cài & cập nhật bằng **Velopack** (per-user, không admin).
|
||||
- Trạng thái: **pre-alpha** — kickoff 28/10/2026, P0 từ 02/11/2026, v1.0 ~23/05/2027 (`docs/ROADMAP.md`).
|
||||
- Trạng thái: **alpha** — P0–P2 xong (0.2.0, 03/11/2026); P3 xong phần code ở các PR draft #58–#69 (Legal 1.2 ở #70), merge theo thứ tự; lịch và các mốc ở `docs/ROADMAP.md`.
|
||||
|
||||
## 2. Luật vàng (KHÔNG được vi phạm)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
- **.NET 10 (LTS), C# 14**, SDK ghim trong `global.json` · **WPF** + **WPF-UI 4.3** (Fluent; quy ước ở `docs/WPFUI-CONVENTIONS.md`)
|
||||
- **Velopack** 1.2 — `vpk` là local tool trong `.config/dotnet-tools.json`, luôn cùng version với thư viện
|
||||
- Dự kiến từ P1: CommunityToolkit.Mvvm, M.E.DependencyInjection, Serilog, SQLite + Dapper, WebView2 SDK, LibVLCSharp, ScottPlot, Ical.Net, H.NotifyIcon (bảng version ở `docs/SPEC.md` §7)
|
||||
- Thư viện chính: CommunityToolkit.Mvvm, M.E.DependencyInjection, Serilog, SQLite + Dapper, WebView2 SDK, LibVLCSharp + libVLC, Ical.Net, H.NotifyIcon, Markdig (bảng version ở `docs/SPEC.md` §7). Biểu đồ tự vẽ bằng WPF, không dùng thư viện chart.
|
||||
- Test: **xUnit v3** (`xunit.v3.mtp-off`, chạy qua VSTest)
|
||||
- Analyzer (warnings = errors): .NET analyzers latest, **SonarAnalyzer.CSharp**, **Roslynator**, **Meziantou**, **ReferenceTrimmer** — khai báo trong `Directory.Build.props`
|
||||
- i18n: `.resx` EN (neutral) / VI / JA
|
||||
@@ -36,11 +36,11 @@
|
||||
```
|
||||
OmniDeck.slnx · Directory.Build.props · global.json · .config/dotnet-tools.json · Settings.XamlStyler
|
||||
src/OmniDeck.App/ WPF shell — exe OmniDeck.exe; Program.Main (Velopack) → OdApp (OdApp.xaml)
|
||||
src/OmniDeck.Core/ contracts, governor, storage, services (hiện có OdVersionInfo)
|
||||
src/OmniDeck.Modules/ mini-app (tạo ở P1) · src/OmniDeck.Web/ web runner (tạo ở P2)
|
||||
src/OmniDeck.Core/ contracts, module host, governor, storage, settings, localization, token theme
|
||||
src/OmniDeck.Modules/ mini-app (clock, timer, calculator, weather, calendar, media) · src/OmniDeck.Web/ web runner + catalog
|
||||
tests/OmniDeck.Tests/ xUnit v3
|
||||
catalog/ webapps.json + webapps.schema.json
|
||||
scripts/ pack.ps1 (publish + vpk pack), validate-catalog.ps1
|
||||
scripts/ pack.ps1 (publish + vpk pack), validate-catalog.ps1, make-icon.ps1
|
||||
```
|
||||
|
||||
## 5. Lệnh
|
||||
@@ -53,6 +53,7 @@ dotnet format OmniDeck.slnx --verify-no-changes
|
||||
dotnet xstyler -c Settings.XamlStyler -d src -r -p # bỏ -p để tự định dạng
|
||||
pwsh scripts/validate-catalog.ps1
|
||||
pwsh scripts/pack.ps1 -Version 0.0.1-local # publish + Velopack → Releases/ (Velopack cần ≥ 0.0.1)
|
||||
$env:OMNIDECK_DATA_ROOT = "$env:TEMP\OmniDeck.Dev" # chỉ bản Debug đọc: chạy bản dev cạnh bản đã cài, không đụng dữ liệu thật
|
||||
```
|
||||
|
||||
Repo dùng CRLF (`.gitattributes`, `.editorconfig`); file do tool tạo có thể là LF → chạy `unix2dos` cho `.cs`/`.xaml` trước `dotnet format`. XamlStyler ghi XAML kèm BOM (`.editorconfig` khai báo `charset = utf-8-bom` cho `*.xaml`).
|
||||
|
||||
+3
-3
@@ -41,11 +41,11 @@ dotnet run --project src/OmniDeck.App
|
||||
|
||||
- Naming: namespace `OmniDeck.*`, public type prefix `Od*`, interfaces `IOd*`; the application class is `OdApp`.
|
||||
- Language: C# 14, nullable enabled, file-scoped namespaces; methods returning an awaitable end in `Async`.
|
||||
- Strings: user-facing text goes in `.resx` (EN neutral + VI + JA). Never concatenate localized fragments; use format placeholders.
|
||||
- Strings: user-facing text goes in `.resx` (EN neutral; the VI and JA translations arrive in P3). Never concatenate localized fragments; use format placeholders.
|
||||
- App data goes under `%LocalAppData%\OmniDeck.Data`, never into Velopack's install folder `%LocalAppData%\OmniDeck` ([ARCHITECTURE](docs/ARCHITECTURE.md) §5).
|
||||
- Commits: imperative subject ≤ 72 chars; scope prefix encouraged (`governor:`, `web:`, `stocks:`, `docs:`, `ci:`).
|
||||
- Commits: imperative subject ≤ 72 chars, with a type prefix: `feat:`, `fix:`, `docs:`, `chore:`, `ci:` or `deps:`.
|
||||
- Signatures: `main` only accepts verified (signed) commits. Signed commits are appreciated; pull requests with unsigned commits are squash-merged, so GitHub signs the result.
|
||||
- Branches: `feat/…`, `fix/…`, `docs/…`, `chore/…`, `ci/…` off `main`; PRs to `main` with the template filled in. Required checks must pass before merge.
|
||||
- Branches: `feat/…`, `fix/…`, `docs/…`, `chore/…`, `ci/…` off `main` (`release/…` for release preparation); PRs to `main` with the template filled in. Required checks must pass before merge.
|
||||
- One PR = one concern. Screenshots/GIFs for UI changes, please.
|
||||
|
||||
## Reporting bugs
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<RepositoryUrl>https://github.com/poli0981/OmniDeck</RepositoryUrl>
|
||||
<PackageProjectUrl>https://github.com/poli0981/OmniDeck</PackageProjectUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<Version>0.2.0-alpha.3</Version>
|
||||
<Version>0.2.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Build-time analyzers (warnings are errors). They live here rather than in each .csproj:
|
||||
|
||||
@@ -13,37 +13,37 @@ OmniDeck combines a set of lightweight native mini-apps (weather, calculator, st
|
||||
|
||||
It is built on WPF (.NET 10 LTS) and **WebView2**, which reuses the Edge runtime that ships with Windows 11 instead of bundling a browser engine. That is what keeps the installer small while still running full web apps.
|
||||
|
||||
**Project status: alpha.** 0.2.0-alpha.2 (phase P2) runs the curated web apps beside the clock, timer, calculator, weather, calendar and media player, with pop-out windows and an in-app bug report. Stocks, the polished Dynamic and Comfort presets, and the Vietnamese and Japanese translations come in P3; the 0.9 public beta is planned for April 2027 and v1.0 for May 2027 ([roadmap](docs/ROADMAP.md)). Until then, expect missing features and changes between versions.
|
||||
**Project status: alpha.** 0.2.0, the end of phase P2, runs the curated web apps beside the clock, timer, calculator, weather, calendar and media player, with pop-out windows and an in-app bug report. Stocks, the polished Dynamic and Comfort presets, and the Vietnamese and Japanese translations come in P3; the 0.9 public beta is planned for December 2026 and v1.0 for the end of January 2027 ([roadmap](docs/ROADMAP.md)). Until then, expect missing features and changes between versions.
|
||||
|
||||
## Planned features (v1.0)
|
||||
|
||||
- **Native mini-apps** — clock & world clocks, countdown timer, calculator, weather (Open-Meteo), local calendar with `.ics` import/export, stock watchlist with candlestick charts (US/EU markets), and a full-codec media player (libVLC).
|
||||
- **Native mini-apps** — clock & world clocks, countdown timer, calculator, weather (Open-Meteo), local calendar with `.ics` import/export, stock watchlist with candlestick charts (Twelve Data with your own key: its free plan covers US listings, while home-market EU listings and indices need a paid plan), and a full-codec media player (libVLC).
|
||||
- **Curated web apps** — each runs in its own WebView2 profile with a per-app navigation allowlist. Web notifications become Windows toasts. Adding a new app is a JSON entry, not a release ([catalog docs](docs/WEBAPP-CATALOG.md)).
|
||||
- **Pop-out windows** — any module can move into a window of its own, and go full screen there.
|
||||
- **RAM governor** — inactive modules are automatically suspended and then hibernated, with a hard memory cap. A built-in task-manager panel shows per-module RAM with manual suspend/kill ([details](docs/RAM-GOVERNOR.md)).
|
||||
- **RAM governor** — inactive modules are automatically suspended and then hibernated, with a hard memory cap. Settings → Memory lists the running modules with their memory, and Suspend, Hibernate, Close and Keep running buttons ([details](docs/RAM-GOVERNOR.md)).
|
||||
- **Three UI presets** — Dynamic, Standard, and Comfort, implemented as design-token presets over one theme engine, with per-token overrides ([details](docs/UI-MODES.md)).
|
||||
- **Privacy** — zero telemetry, zero data collection. Everything is stored locally ([privacy policy](docs/legal/PRIVACY.md)).
|
||||
- **Languages** — English, Tiếng Việt, 日本語.
|
||||
|
||||
## The trade-off, stated up front
|
||||
|
||||
Running web apps means running Chromium processes. OmniDeck manages this aggressively (suspend → hibernate → dispose), but with several web apps active it can legitimately use several GiB of RAM. The governor enforces a hard cap of **6 GiB** (configurable); when the cap is hit, least-recently-used modules are hibernated automatically. If you want a 100 MB app, this is not that app — if you want *one* app instead of six Electron installs, it is.
|
||||
Running web apps means running Chromium processes. OmniDeck manages this aggressively (suspend → hibernate → dispose), but with several web apps active it can legitimately use several GiB of RAM. The governor enforces a hard cap of **6 GiB, or half your RAM if that is less** (configurable); when the cap is hit, least-recently-used modules are hibernated automatically. If you want a 100 MB app, this is not that app — if you want *one* app instead of six Electron installs, it is.
|
||||
|
||||
## Known limitations of web apps
|
||||
|
||||
These are properties of the web versions of the services, documented here so they are not reported as OmniDeck bugs:
|
||||
|
||||
- **Spotify** runs the Web Player: audio quality is lower than the desktop app, and playback relies on DRM (Widevine), which ships with the WebView2 runtime (P0 spike #1). If a future runtime drops it, the entry is disabled with an explanation (see the [ROADMAP](docs/ROADMAP.md) risk register).
|
||||
- **Spotify** runs the Web Player: audio quality is lower than the desktop app, and playback relies on DRM (Widevine), which ships with the WebView2 runtime (P0 spike #1). If a future runtime drops it, the Spotify entry comes out of the catalog until it plays again (see the [ROADMAP](docs/ROADMAP.md) risk register).
|
||||
- **Discord** web has no native global push-to-talk and limited screen sharing. A host-side global hotkey is on the roadmap's backlog.
|
||||
- Web app availability, layout, and sign-in flows are controlled by the respective service providers and can change or break at any time.
|
||||
|
||||
## Install
|
||||
|
||||
1. Requirements: **Windows 11 (24H2 or later), x64.** Windows 10 is not supported. The Microsoft Edge **WebView2 Runtime** ships with Windows 11.
|
||||
2. Download a build from [Releases](https://github.com/poli0981/OmniDeck/releases) and run `OmniDeck-win-Setup.exe` (per-user, no admin required). Every version before 1.0 is published as a **pre-release** for testing.
|
||||
3. On first run, review and acknowledge the legal documents (EULA, disclaimer, privacy policy, third-party notices), then pick a UI preset and language.
|
||||
2. Download a build from [Releases](https://github.com/poli0981/OmniDeck/releases) and run `OmniDeck-win-Setup.exe` (per-user, no admin required). Every version before 1.0 is published as a **pre-release** for testing. The `OmniDeck-win-Portable.zip` beside it is not supported yet: it still keeps its data in `%LocalAppData%\OmniDeck.Data`, and nothing removes that data when you delete the folder.
|
||||
3. On first run, review and acknowledge the legal documents (EULA, disclaimer, privacy policy, third-party notices), then pick a language and a layout preset.
|
||||
|
||||
Updates are delivered in-app via Velopack; you can also check manually from **About**. Builds are not yet Authenticode-signed, so Windows SmartScreen may warn about an unknown publisher — see [SECURITY](SECURITY.md) for how to verify a download.
|
||||
Updates are delivered in-app via Velopack; you can also check manually from **Settings → About**. Builds are not yet Authenticode-signed, so Windows SmartScreen may warn about an unknown publisher — see [SECURITY](SECURITY.md) for how to verify a download.
|
||||
|
||||
## Reporting bugs
|
||||
|
||||
|
||||
@@ -64,6 +64,8 @@ public interface IOdModule
|
||||
|
||||
`OdModuleHost` runs the contract. It initializes a module on first open, builds its view when it has none (first open, or after hibernation), keeps the view of the visible module, and moves hidden ones down the ladder when the shell or the governor asks; it refuses to suspend or hibernate a module whose `CanSuspendAsync` returns false. Calls run one at a time on the UI thread. The shell's navigation view is chrome only: every module item navigates to one shared stage page, whose content is the view the host hands back, so the control never creates or caches module views.
|
||||
|
||||
When the main window is minimized or hidden in the tray, nothing it holds is on screen: `OdModuleHost.SetMainWindowAwayAsync` makes its module Idle, so the ladder and the caps apply to it, while it stays the module the window shows. When the window comes back, the module is activated again, and gets a new view if it was hibernated meanwhile. The stage keeps the old view while the window is away, so a full screen and the page survive a minimize. Since a minimized window never unloads its view, `ActivateAsync` must undo whatever `SuspendAsync` stopped (Clock and Timer restart their ticking there), and a web app hides its browser before asking WebView2 to suspend, which WebView2 does only for a hidden browser.
|
||||
|
||||
A view asks for full screen with `OdFullscreen.Request(view, on)`, a bubbling routed event raised from the view itself, since content it hosts in a window of its own (a video overlay) is outside the main window's tree. The main window then:
|
||||
|
||||
- covers the monitor it is on (`OdMonitors.BoundsOf`, `OdWindowCover`), and keeps where it was;
|
||||
|
||||
@@ -14,6 +14,8 @@ The governor is the feature that makes "many apps in one" viable. It moves every
|
||||
|
||||
A module in a window of its own (a pop-out) is visible while that window is open, so it stays Active whatever the main window shows; closing the window puts it back on the ladder as a hidden module.
|
||||
|
||||
The main window's module is hidden too while that window is minimized or hidden in the tray: it goes Idle when the window goes away and down the ladder from there, and it is active again when the window comes back (rebuilt, if it was hibernated meanwhile). Pop-outs keep their rule above, even when their own window is minimized.
|
||||
|
||||
Reactivation from Suspended is instant. From Hibernated it is a cold open (view rebuild and page reload, about 0.6–2.5 s); that is acceptable because the profile keeps the user signed in. After the last web app has been hibernated, the next one also restarts the browser process (about 160 ms).
|
||||
|
||||
## 2. Defaults (all configurable in Settings → Memory)
|
||||
@@ -38,6 +40,8 @@ A module that works while hidden is **resident** (`IOdResidency`): in P2, a web
|
||||
|
||||
Pinned modules are skipped by cap enforcement; if the hard cap is exceeded purely by pinned modules, the governor toasts a warning instead of killing audio.
|
||||
|
||||
Time spent pinned does not count as time hidden: each pass restarts a pinned module's hidden time, so a player that stops after an hour out of sight is suspended `IdleAfter` later and hibernated `HibernateAfter` later, not on the next pass.
|
||||
|
||||
## 4. Cap enforcement
|
||||
|
||||
Total footprint = shell process + Σ all WebView2 processes, sampled every `PollInterval`.
|
||||
|
||||
+11
-9
@@ -1,10 +1,12 @@
|
||||
# OmniDeck — Roadmap to v1.0 (May 2027)
|
||||
# OmniDeck — Roadmap to v1.0 (January 2027)
|
||||
|
||||
Solo-developer plan, ~29 weeks from the start of P0 (2 November 2026). Each phase has exit criteria; slipping triggers the cut order in §4, never a death march.
|
||||
Solo-developer plan from the kickoff (28 October 2026) to v1.0. Each phase has exit criteria; slipping triggers the cut order in §4, never a death march.
|
||||
|
||||
> **Re-baselined 2026-10-28.** The first draft assumed a 20 July 2026 start and a January 2027 release. Development actually starts on 2 November 2026, so every phase keeps its original length and moves; P2 gains one buffer week for Tết (Lunar New Year, 6 February 2027). Windows 10 support was dropped at the same time ([SPEC](SPEC.md) §1).
|
||||
>
|
||||
> **Re-baselined 2026-11-02.** P0 and P1 both finished early, on 30 October 2026, so P2 started on 2 November 2026 instead of 11 January 2027. P3 and P4 keep their dates until P2 exits, and are re-baselined then.
|
||||
>
|
||||
> **Re-baselined 2026-11-03.** P2 exited with `0.2.0` on 3 November 2026, and P3 was written alongside its last days, as draft pull requests that merge once `0.2.0` is out. The remaining phases are planned with a buffer rather than their original lengths: `0.3.0` in early December 2026, the `0.9` public beta in mid-December, and `1.0` at the end of January 2027, before Tết (6 February 2027). 23 May 2027, the previous target, stays as the latest date.
|
||||
|
||||
## 1. Phases
|
||||
|
||||
@@ -47,28 +49,28 @@ As delivered: eight work packages (PRs #20–#25, #27 and #29) and three release
|
||||
- **P3 accessibility:** UI Automation exposes WPF-UI 4.3's navigation items as data items with no Invoke or Select pattern; keyboard users reach them with Tab and Enter. The accent swatches are announced by their hex codes.
|
||||
- **P2:** pop-out module windows, deferred by the P1 plan.
|
||||
|
||||
### P2 — Web runner & core modules (from 2 Nov 2026; planned 11 Jan – 7 Mar 2027)
|
||||
### P2 — Web runner & core modules (11 Jan – 7 Mar 2027) — done early, 3 Nov 2026
|
||||
|
||||
Full web runner (profiles, nav policy, SSO popups, notifications→toast, permissions, downloads, suspend/hibernate, catalog fetch) with the v1 catalog; weather; calendar (local + .ics); media player v1 on LibVLCSharp. Bug-report flow end to end (CDP capture → scrubber → prefilled issue + zip).
|
||||
|
||||
**Exit (0.2.0):** dogfood daily — Gmail + Discord + YouTube stay signed in across hibernation; a full day's use stays under the hard cap.
|
||||
|
||||
As delivered so far: the `0.1.1` hotfix (a tray icon that leaked GDI objects), then the plan's ten work packages and two catalog pull requests, released as `0.2.0-alpha.1` and `0.2.0-alpha.2` on 2 November 2026. `0.2.0` follows about a week of dogfooding against the exit criterion. Changed on the way:
|
||||
As delivered: the `0.1.1` hotfix (a tray icon that leaked GDI objects), then the plan's ten work packages, two catalog pull requests and a fix that lets the governor rest a minimized window's module, released as `0.2.0-alpha.1` to `0.2.0-alpha.4` on 2 and 3 November 2026, and as `0.2.0` on 3 November, once the maintainer signed it off. Changed on the way:
|
||||
|
||||
- Downloads use WebView2's own flyout rather than a progress row of OmniDeck's, and permission questions sit in a bar above the page, because no dialog can cover WebView2 ([SPEC](SPEC.md) §4).
|
||||
- Web apps with notifications on stay resident: the time ladder skips them ([RAM-GOVERNOR](RAM-GOVERNOR.md) §3).
|
||||
- Pop-out windows move the module's view, so web pages and videos keep running through the move ([ARCHITECTURE](ARCHITECTURE.md) §2).
|
||||
- Left for later: web app favicons, `.ics` subscriptions (they would need a privacy policy update) and Discord's global push-to-talk hotkey (all in §5), and the weather charts, which wait for ScottPlot in P3.
|
||||
|
||||
### P3 — Stocks, presets, i18n (8 Mar – 11 Apr 2027)
|
||||
### P3 — Stocks, presets, i18n (3 Nov – early Dec 2026; planned 8 Mar – 11 Apr 2027)
|
||||
|
||||
Stocks module (Twelve Data with the user's own key, which spike #7 left as the only provider; watchlist, candlesticks); Dynamic and Comfort presets polished to spec (UI-MODES token table); VI + JA translations; accessibility pass (text scaling, contrast themes, keyboard nav).
|
||||
|
||||
**Exit (0.3.0):** feature-complete against SPEC v1 scope.
|
||||
|
||||
### P4 — Beta & release (12 Apr – 23 May 2027)
|
||||
### P4 — Beta & release (mid-Dec 2026 – end of Jan 2027; planned 12 Apr – 23 May 2027)
|
||||
|
||||
**0.9 public beta** (~18 Apr) via GitHub Releases + the community Discord; two stabilization cycles driven by bug reports; docs final pass; **v1.0 target 23 May 2027**.
|
||||
**0.9 public beta** (~mid-December 2026) via GitHub Releases + the community Discord; two stabilization cycles driven by bug reports; docs final pass; **v1.0 target end of January 2027**, 23 May 2027 at the latest.
|
||||
|
||||
## 2. Versioning
|
||||
|
||||
@@ -89,7 +91,7 @@ Every version below 1.0.0 is published as a GitHub **pre-release**; 1.0.0 is the
|
||||
|
||||
| Risk | Impact | Mitigation |
|
||||
|---|---|---|
|
||||
| Widevine unavailable in WebView2 on target machines | Spotify won't play | **Retired by spike #1:** the evergreen runtime ships Widevine and Spotify plays without flags. If a future runtime breaks EME, the bug report's EME self-check shows it. Fallback unchanged: ship the Spotify entry disabled with a note |
|
||||
| Widevine unavailable in WebView2 on target machines | Spotify won't play | **Retired by spike #1:** the evergreen runtime ships Widevine and Spotify plays without flags. If a future runtime breaks EME, Spotify stops playing and users report it. Fallback: take the Spotify entry out of the catalog (the schema has no "disabled" state), with a note in the release notes and Discussions |
|
||||
| Google blocks sign-in in WebView2 | Google group unusable | **Spike #2:** sign-in works with the default user agent, and one sign-in covers the `google` group. Google's hop to country-code domains needs `navAllowSets` (P2). Client hints name WebView2, so Google could still block it later; fallback: treat it as an upstream limitation, documented |
|
||||
| LibVLCSharp airspace friction in WPF | Media UX degraded | **Retired by spike #6:** overlay controls and fullscreen in place work in a `FluentWindow`. Pop-out, in P2, moves the same view, so the video keeps playing and the overlay follows. FlyleafLib is not needed |
|
||||
| Free API tiers change (Twelve Data/Stooq) | Stocks degraded | **Materialized for Stooq** (2026-10-30), which now blocks scripted clients. Spike #7 leaves Twelve Data with the user's own key as the only provider; its free plan covers US listings. The provider abstraction stays; Stocks is first in the cut order (§4) |
|
||||
@@ -107,4 +109,4 @@ The web runner, governor, legal gate, and the trivial modules are never cut —
|
||||
|
||||
## 5. Post-v1 backlog (unordered)
|
||||
|
||||
Finnhub provider (real-time US), Google Calendar native sync, `.ics` calendar subscriptions, multi-point global hotkeys per web app (Discord's push-to-talk among them), web app favicons in the sidebar, catalog entries from §4 of WEBAPP-CATALOG, per-module popout window session restore, portable build.
|
||||
Finnhub provider (real-time US), Google Calendar native sync, `.ics` calendar subscriptions, multi-point global hotkeys per web app (Discord's push-to-talk among them), web app favicons in the sidebar, catalog entries from §4 of WEBAPP-CATALOG, per-module popout window session restore, a truly portable build (data beside the program; the Portable zip Velopack makes today still keeps its data in `%LocalAppData%\OmniDeck.Data`).
|
||||
+6
-5
@@ -1,6 +1,6 @@
|
||||
# OmniDeck — Functional Specification
|
||||
|
||||
Status: draft for v1.0 (target May 2027) · Applies to: Windows 11 (24H2 or later), x64 only
|
||||
Status: draft for v1.0 (target January 2027) · Applies to: Windows 11 (24H2 or later), x64 only
|
||||
|
||||
## 1. Goals and non-goals
|
||||
|
||||
@@ -52,8 +52,8 @@ All mini-apps implement the module contract in [ARCHITECTURE](ARCHITECTURE.md) a
|
||||
- Import/export **iCalendar (.ics)** via Ical.Net.
|
||||
- Event reminders raise toasts (same running-app caveat as alarms).
|
||||
|
||||
### 3.5 Stocks (US/EU)
|
||||
- **Watchlist** with quote, day change, sparkline; detail view with candlestick/OHLC + volume charts (ScottPlot 5), range 1M/6M/1Y/5Y.
|
||||
### 3.5 Stocks
|
||||
- **Watchlist** with quote, day change, sparkline; detail view with candlestick/OHLC + volume charts, range 1M/6M/1Y/5Y. Charts are drawn by OmniDeck's own WPF controls, which follow the design tokens, High Contrast and screen readers; no charting library is bundled (decided 3 November 2026).
|
||||
- **Provider** behind `IOdQuoteProvider`: `TwelveData`, with the user's own API key (free Basic plan or paid). The module asks for the key on first use; it is stored via **DPAPI**, never in plaintext or logs.
|
||||
- **Coverage depends on the user's plan.** The free plan covers US stocks, ETFs and US-listed ADRs. Home-market EU listings need Grow, and indices need Pro. Symbol search (`show_plan=true`, free) labels each listing with the plan it needs, and a plan error reads "not available on your Twelve Data plan".
|
||||
- **Stooq was dropped** in P0 because it now blocks scripted clients ([spike #7](spikes/07-providers.md)).
|
||||
@@ -65,7 +65,7 @@ All mini-apps implement the module contract in [ARCHITECTURE](ARCHITECTURE.md) a
|
||||
- Local files and folders, playlist (m3u load/save), subtitles (embedded + external `.srt`/`.ass`, encoding selection), audio track & device selection, speed 0.25–4×, snapshot.
|
||||
- libVLC initializes lazily on first open; the player counts as **pinned** while playback is active (governor may not suspend it). Suspend stops and disposes the player, and hibernate disposes libVLC too: playback holds 280–520 MB committed.
|
||||
- **Fullscreen** makes the module's own window cover the monitor. **Pop-out** moves the player's view, video window included, into the new window, so playback goes on; the track re-selection and seek that a second video view would need ([spike #6](spikes/06-libvlcsharp.md)) are not used.
|
||||
- **Build:** x64 only (`VlcWindowsX86Enabled` and `VlcWindowsArm64Enabled` set to false), with the trimmed plugin set: about 86 MB raw, 39 MB compressed.
|
||||
- **Build:** x64 only (`VlcWindowsX86Enabled` and `VlcWindowsArm64Enabled` set to false), with the trimmed plugin set: about 80 MB raw (as built, below).
|
||||
- **As built in P2:**
|
||||
- The player opens local files, folders and .m3u playlists, from its buttons or dropped on it, and saves the queue as an .m3u.
|
||||
- The queue and where playback stood live in the database (`media_playlists`), so they survive restarts.
|
||||
@@ -122,7 +122,8 @@ All mini-apps implement the module contract in [ARCHITECTURE](ARCHITECTURE.md) a
|
||||
| CommunityToolkit.Mvvm | 8.4.2 | |
|
||||
| Serilog / Serilog.Sinks.File | 4.4.0 / 7.0.0 | |
|
||||
| Dapper / Microsoft.Data.Sqlite | 2.1.89 / 10.0.14 | |
|
||||
| ScottPlot.WPF | 5.1.59 | stocks charts |
|
||||
| Markdig | 1.5.1 | renders the legal documents |
|
||||
| Microsoft.Extensions.DependencyInjection | 10.0.14 | composition root |
|
||||
| LibVLCSharp.WPF / VideoLAN.LibVLC.Windows | 3.10.2 / 3.0.24 | media |
|
||||
| Ical.Net | 5.2.3 | calendar (v5 API) |
|
||||
| H.NotifyIcon.Wpf | 2.4.1 | tray |
|
||||
|
||||
@@ -53,7 +53,7 @@ Top-level file fields: `$schema` (optional editor hint), `schemaVersion` (int, c
|
||||
| id | profile | audioPin | Notes |
|
||||
|---|---|---|---|
|
||||
| spotify | spotify | yes | Web Player; DRM works in the runtime ([spike #1](spikes/01-drm-widevine.md)). "Continue with Google / Facebook / Apple" move the main frame to `accounts.google.com`, `www.facebook.com` and `appleid.apple.com` and back, so those hosts and the `google-account-domains` set are listed (each hop checked up to the provider's sign-in page on 2 November 2026) |
|
||||
| discord | discord | yes | pinned while a voice or video call plays audio; no global PTT on web; host hotkey partial mitigation |
|
||||
| discord | discord | yes | pinned while a voice or video call plays audio; no global push-to-talk on the web; a host-side hotkey is on the post-v1 backlog |
|
||||
| youtube | google | yes | sign-in hops to Google's country-code domains, allowed through the `google-account-domains` set like every `google` entry ([spike #2](spikes/02-google-sign-in.md)) |
|
||||
| gmail | google | no | |
|
||||
| gcalendar | google | no | |
|
||||
@@ -63,4 +63,4 @@ Top-level file fields: `$schema` (optional editor hint), `schemaVersion` (int, c
|
||||
|
||||
## 4. Known-good candidates for post-v1 PRs
|
||||
|
||||
WhatsApp Web, Telegram Web, X, Reddit, Notion — all verified-working-in-Edge, low-controversy additions the community can contribute following §2.
|
||||
WhatsApp Web, Telegram Web, X, Reddit, Notion — low-controversy candidates that work in Microsoft Edge but have not been checked in OmniDeck yet; the community can propose them following §2.
|
||||
@@ -121,6 +121,7 @@ public partial class OdMainWindow : INavigationViewPageProvider
|
||||
};
|
||||
|
||||
SetUpNavigation(theme);
|
||||
ListenForAway();
|
||||
|
||||
// WPF ignores the Windows text size; re-read it when it may have changed (docs/UI-MODES.md §4).
|
||||
Activated += (_, _) => theme.RefreshTextScale();
|
||||
@@ -402,13 +403,32 @@ public partial class OdMainWindow : INavigationViewPageProvider
|
||||
|
||||
private void OnTrayNotificationClicked(object sender, RoutedEventArgs e) => _notifier.OnClicked();
|
||||
|
||||
/// <summary>A click on a notification brings the window up, on the module that raised it.</summary>
|
||||
/// <summary>Minimized or in the tray, the window shows nothing: its module goes down the ladder meanwhile.</summary>
|
||||
private void ListenForAway()
|
||||
{
|
||||
IsVisibleChanged += (_, _) => OnAwayChanged(this, EventArgs.Empty);
|
||||
StateChanged += OnAwayChanged;
|
||||
}
|
||||
|
||||
private async void OnAwayChanged(object? sender, EventArgs e) =>
|
||||
await _shell.SetWindowAwayAsync(!IsVisible || WindowState == WindowState.Minimized);
|
||||
|
||||
/// <summary>
|
||||
/// A click on a notification brings the window up, on the module that raised it. It navigates first,
|
||||
/// so a module the window showed before is not woken up only to be hidden again.
|
||||
/// </summary>
|
||||
private async void OnNotificationClicked(object? sender, OdNotificationClickedEventArgs e)
|
||||
{
|
||||
Present();
|
||||
if (e.Target is { } target)
|
||||
try
|
||||
{
|
||||
await _shell.NavigateAsync(target);
|
||||
if (e.Target is { } target)
|
||||
{
|
||||
await _shell.NavigateAsync(target);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Present();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ public sealed partial class OdShellViewModel : ObservableObject, IDisposable
|
||||
private readonly List<OdModuleItemViewModel> _openOrder = [];
|
||||
private IReadOnlyList<string> _pinned = [];
|
||||
private string _sidebarShape = "";
|
||||
private bool _windowAway;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _currentTarget = LibraryTarget;
|
||||
@@ -146,6 +147,26 @@ public sealed partial class OdShellViewModel : ObservableObject, IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The main window was minimized or hidden in the tray (<paramref name="away"/>), or is back. Away,
|
||||
/// its module goes down the ladder like any hidden one; back, it is active again. The stage keeps its
|
||||
/// view meanwhile, so a full screen and the page stay as they were; a module hibernated while away
|
||||
/// comes back with a new view.
|
||||
/// </summary>
|
||||
public async Task SetWindowAwayAsync(bool away)
|
||||
{
|
||||
if (away == _windowAway)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_windowAway = away;
|
||||
if (await _host.SetMainWindowAwayAsync(away) is { } view)
|
||||
{
|
||||
CurrentView = view;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The palette's entries in the current language: every module, then the shell commands.</summary>
|
||||
public IReadOnlyList<OdPaletteEntry> PaletteEntries()
|
||||
{
|
||||
|
||||
@@ -99,6 +99,12 @@ public sealed class OdRamGovernor : IDisposable
|
||||
var demoted = false;
|
||||
foreach (var hosted in Demotable().Where(hosted => !StaysResident(hosted)))
|
||||
{
|
||||
// A player that plays is in use even though hidden: its hidden time starts when it stops.
|
||||
if (await _host.IsPinnedAsync(hosted.Info.Id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var hiddenFor = now - hosted.LastActive;
|
||||
if (hiddenFor >= options.HibernateAfter)
|
||||
{
|
||||
|
||||
@@ -58,9 +58,15 @@ public sealed class OdModuleHost : IDisposable
|
||||
/// <summary>Every registered module, in registration order.</summary>
|
||||
public IReadOnlyList<OdHostedModule> Modules { get; }
|
||||
|
||||
/// <summary>The module visible in the main window; <see langword="null"/> while the shell shows one of its own pages.</summary>
|
||||
/// <summary>
|
||||
/// The main window's module; <see langword="null"/> while the shell shows one of its own pages. While
|
||||
/// the window is away (<see cref="IsMainWindowAway"/>) it stays here but goes down the ladder.
|
||||
/// </summary>
|
||||
public OdHostedModule? Current { get; private set; }
|
||||
|
||||
/// <summary>Whether the main window is minimized or hidden in the tray, so that nothing it holds is on screen.</summary>
|
||||
public bool IsMainWindowAway { get; private set; }
|
||||
|
||||
public OdHostedModule? Find(string moduleId) => _byId.GetValueOrDefault(moduleId);
|
||||
|
||||
/// <summary>
|
||||
@@ -81,7 +87,7 @@ public sealed class OdModuleHost : IDisposable
|
||||
throw new InvalidOperationException($"Module '{moduleId}' shows in a window of its own.");
|
||||
}
|
||||
|
||||
if (hosted == Current && hosted.View is { } shown)
|
||||
if (hosted == Current && hosted.View is { } shown && hosted.State == OdModuleState.Active)
|
||||
{
|
||||
return shown;
|
||||
}
|
||||
@@ -156,6 +162,77 @@ public sealed class OdModuleHost : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The main window went away (minimized, or hidden in the tray) or came back. Away, its module is
|
||||
/// hidden like any other and goes down the ladder (docs/RAM-GOVERNOR.md §1), yet stays
|
||||
/// <see cref="Current"/>. Back, that module is active again, with a new view if it was hibernated
|
||||
/// meanwhile; the view to show is returned, or <see langword="null"/> when the window shows a shell page
|
||||
/// or is away. Calls that overtake each other settle on the latest one.
|
||||
/// </summary>
|
||||
public async Task<FrameworkElement?> SetMainWindowAwayAsync(bool away)
|
||||
{
|
||||
IsMainWindowAway = away;
|
||||
await _gate.WaitAsync();
|
||||
try
|
||||
{
|
||||
if (Current is not { } current)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (IsMainWindowAway)
|
||||
{
|
||||
if (current.State == OdModuleState.Active)
|
||||
{
|
||||
current.LastActive = _time.GetUtcNow();
|
||||
SetState(current, OdModuleState.Idle);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (current.State == OdModuleState.Active && current.View is { } shown)
|
||||
{
|
||||
return shown;
|
||||
}
|
||||
|
||||
var view = await EnsureViewAsync(current);
|
||||
await current.Module.ActivateAsync();
|
||||
current.LastActive = _time.GetUtcNow();
|
||||
SetState(current, OdModuleState.Active);
|
||||
return view;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_gate.Release();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether a hidden module refuses to be suspended right now, as a player does while it plays. Time
|
||||
/// spent so pinned is not time hidden: its hidden time restarts, so the ladder counts from the moment
|
||||
/// the pin ends (docs/RAM-GOVERNOR.md §3).
|
||||
/// </summary>
|
||||
public async Task<bool> IsPinnedAsync(string moduleId)
|
||||
{
|
||||
var hosted = Get(moduleId);
|
||||
await _gate.WaitAsync();
|
||||
try
|
||||
{
|
||||
if (hosted.State is not (OdModuleState.Idle or OdModuleState.Suspended) || await hosted.Module.CanSuspendAsync())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
hosted.LastActive = _time.GetUtcNow();
|
||||
return true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_gate.Release();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Hides the visible module while the shell shows one of its own pages.</summary>
|
||||
public async Task HideAsync()
|
||||
{
|
||||
@@ -309,8 +386,13 @@ public sealed class OdModuleHost : IDisposable
|
||||
}
|
||||
|
||||
Current = null;
|
||||
previous.LastActive = _time.GetUtcNow();
|
||||
SetState(previous, OdModuleState.Idle);
|
||||
|
||||
// One the window already hid while it was away keeps its place on the ladder.
|
||||
if (previous.State == OdModuleState.Active)
|
||||
{
|
||||
previous.LastActive = _time.GetUtcNow();
|
||||
SetState(previous, OdModuleState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetState(OdHostedModule hosted, OdModuleState state)
|
||||
|
||||
@@ -26,7 +26,15 @@ public sealed class OdClockModule : IOdModule
|
||||
return new OdClockView { DataContext = _viewModel };
|
||||
}
|
||||
|
||||
public Task ActivateAsync() => Task.CompletedTask;
|
||||
/// <summary>
|
||||
/// Ticks again after a suspension. The view's Loaded event does that when it comes back on stage, but a
|
||||
/// window that was minimized never unloaded it.
|
||||
/// </summary>
|
||||
public Task ActivateAsync()
|
||||
{
|
||||
_viewModel?.StartTicking();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task<bool> CanSuspendAsync() => Task.FromResult(true);
|
||||
|
||||
|
||||
@@ -31,7 +31,15 @@ public sealed class OdTimerModule(OdTimerService service) : IOdModule
|
||||
return new OdTimerView { DataContext = _viewModel };
|
||||
}
|
||||
|
||||
public Task ActivateAsync() => Task.CompletedTask;
|
||||
/// <summary>
|
||||
/// Ticks again after a suspension. The view's Loaded event does that when it comes back on stage, but a
|
||||
/// window that was minimized never unloaded it.
|
||||
/// </summary>
|
||||
public Task ActivateAsync()
|
||||
{
|
||||
_viewModel?.StartTicking();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task<bool> CanSuspendAsync() => Task.FromResult(true);
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ public partial class OdWebAppView : IOdWebSurface
|
||||
return;
|
||||
}
|
||||
|
||||
// WebView2 suspends only a hidden browser, and a minimized window does not hide it.
|
||||
_browser.Visibility = Visibility.Hidden;
|
||||
core.MemoryUsageTargetLevel = CoreWebView2MemoryUsageTargetLevel.Low;
|
||||
try
|
||||
{
|
||||
@@ -70,6 +72,8 @@ public partial class OdWebAppView : IOdWebSurface
|
||||
{
|
||||
core.Resume();
|
||||
}
|
||||
|
||||
_browser.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
public async Task<int?> CountCookiesAsync(Uri page) =>
|
||||
|
||||
@@ -339,6 +339,92 @@ public sealed class OdRamGovernorTests : IDisposable
|
||||
Assert.IsType<InvalidOperationException>(failure);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Ladder_TakesTheMainWindowsModule_OnlyWhileTheWindowIsAway() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
using var governor = NewGovernor(host);
|
||||
await host.ShowAsync("clock");
|
||||
|
||||
_time.Advance(TimeSpan.FromHours(1));
|
||||
await governor.TickAsync();
|
||||
Assert.Equal(OdModuleState.Active, State(host, "clock"));
|
||||
|
||||
await host.SetMainWindowAwayAsync(away: true);
|
||||
_time.Advance(TimeSpan.FromMinutes(5));
|
||||
await governor.TickAsync();
|
||||
Assert.Equal(OdModuleState.Suspended, State(host, "clock"));
|
||||
|
||||
_time.Advance(TimeSpan.FromMinutes(25));
|
||||
await governor.TickAsync();
|
||||
Assert.Equal(OdModuleState.Hibernated, State(host, "clock"));
|
||||
|
||||
Assert.NotNull(await host.SetMainWindowAwayAsync(away: false));
|
||||
Assert.Equal(OdModuleState.Active, State(host, "clock"));
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void SoftCap_TakesTheMainWindowsModule_OnlyWhileTheWindowIsAway() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
using var governor = NewGovernor(host);
|
||||
await host.ShowAsync("web");
|
||||
_memory.Committed = 5 * GiB;
|
||||
|
||||
await governor.TickAsync();
|
||||
Assert.Equal(OdModuleState.Active, State(host, "web"));
|
||||
|
||||
await host.SetMainWindowAwayAsync(away: true);
|
||||
await governor.TickAsync();
|
||||
Assert.Equal(OdModuleState.Hibernated, State(host, "web"));
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void Ladder_CountsHiddenTimeFromTheEndOfAPin() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
using var governor = NewGovernor(host);
|
||||
await host.ShowAsync("clock");
|
||||
await host.ShowAsync("calc");
|
||||
_clock.CanSuspend = false;
|
||||
|
||||
_time.Advance(TimeSpan.FromMinutes(40));
|
||||
await governor.TickAsync();
|
||||
Assert.Equal(OdModuleState.Idle, State(host, "clock"));
|
||||
|
||||
// It stopped playing: hidden for 40 minutes, but in use until now.
|
||||
_clock.CanSuspend = true;
|
||||
_time.Advance(TimeSpan.FromMinutes(4));
|
||||
await governor.TickAsync();
|
||||
Assert.Equal(OdModuleState.Idle, State(host, "clock"));
|
||||
|
||||
_time.Advance(TimeSpan.FromMinutes(1));
|
||||
await governor.TickAsync();
|
||||
Assert.Equal(OdModuleState.Suspended, State(host, "clock"));
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void KeptRunningAndResidentModules_StayUp_WhileTheWindowIsAway() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
using var governor = NewGovernor(host);
|
||||
governor.SetKeptRunning("clock", keep: true);
|
||||
_web.StaysResident = true;
|
||||
|
||||
await host.ShowAsync("clock");
|
||||
await host.SetMainWindowAwayAsync(away: true);
|
||||
_time.Advance(TimeSpan.FromHours(1));
|
||||
await governor.TickAsync();
|
||||
Assert.Equal(OdModuleState.Idle, State(host, "clock"));
|
||||
|
||||
await host.SetMainWindowAwayAsync(away: false);
|
||||
await host.ShowAsync("web");
|
||||
await host.SetMainWindowAwayAsync(away: true);
|
||||
_time.Advance(TimeSpan.FromHours(1));
|
||||
await governor.TickAsync();
|
||||
Assert.Equal(OdModuleState.Idle, State(host, "web"));
|
||||
});
|
||||
|
||||
private static OdModuleState? State(OdModuleHost host, string id) => host.Find(id)?.State;
|
||||
|
||||
/// <summary>Opens clock, timer and web one after another, then calc, so the first three are hidden.</summary>
|
||||
|
||||
@@ -90,6 +90,35 @@ public sealed class OdBuiltInModulesTests : IDisposable
|
||||
Assert.Empty(calculatorAgain.History);
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void ClockAndTimer_TickAgain_WhenTheWindowComesBackAfterASuspension() => OdSta.Run(async () =>
|
||||
{
|
||||
using var timers = new OdTimerService(_time, new OdFakeNotifier());
|
||||
using var host = NewHost(new OdClockModule(), new OdTimerModule(timers));
|
||||
|
||||
// A minimized window never unloads its view, so only activation can restart the ticking.
|
||||
var clock = (OdClockViewModel)(await host.ShowAsync("clock")).DataContext;
|
||||
await host.SetMainWindowAwayAsync(away: true);
|
||||
Assert.True(await host.SuspendAsync("clock", OdSuspendReason.Hidden));
|
||||
var clockShown = clock.Clocks[0].TimeText;
|
||||
_time.Advance(TimeSpan.FromMinutes(1));
|
||||
await Task.Delay(50);
|
||||
Assert.Equal(clockShown, clock.Clocks[0].TimeText);
|
||||
await host.SetMainWindowAwayAsync(away: false);
|
||||
Assert.NotEqual(clockShown, clock.Clocks[0].TimeText, StringComparer.Ordinal);
|
||||
|
||||
var timer = (OdTimerViewModel)(await host.ShowAsync("timer")).DataContext;
|
||||
timer.ToggleStopwatchCommand.Execute(null);
|
||||
await host.SetMainWindowAwayAsync(away: true);
|
||||
Assert.True(await host.SuspendAsync("timer", OdSuspendReason.Hidden));
|
||||
var timerShown = timer.StopwatchText;
|
||||
_time.Advance(TimeSpan.FromSeconds(30));
|
||||
await Task.Delay(50);
|
||||
Assert.Equal(timerShown, timer.StopwatchText);
|
||||
await host.SetMainWindowAwayAsync(away: false);
|
||||
Assert.NotEqual(timerShown, timer.StopwatchText, StringComparer.Ordinal);
|
||||
});
|
||||
|
||||
private OdModuleHost NewHost(params IOdModule[] modules)
|
||||
{
|
||||
var database = new OdDatabase(_temp.Combine("omnideck.db"), pooling: false);
|
||||
|
||||
@@ -284,6 +284,130 @@ public sealed class OdModuleHostTests : IDisposable
|
||||
Assert.Equal(Start.AddMinutes(2), clock.LastActive);
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void WindowAway_HidesItsModule_ButKeepsItCurrent() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
var view = await host.ShowAsync("clock");
|
||||
var changes = new List<string>();
|
||||
host.StateChanged += (_, e) => changes.Add($"{e.Module.Info.Id}:{e.Previous}>{e.Module.State}");
|
||||
_time.Advance(TimeSpan.FromMinutes(2));
|
||||
|
||||
Assert.Null(await host.SetMainWindowAwayAsync(away: true));
|
||||
Assert.Null(await host.SetMainWindowAwayAsync(away: true));
|
||||
|
||||
var clock = host.Find("clock")!;
|
||||
Assert.True(host.IsMainWindowAway);
|
||||
Assert.Same(clock, host.Current);
|
||||
Assert.Equal(OdModuleState.Idle, clock.State);
|
||||
Assert.Equal(Start.AddMinutes(2), clock.LastActive);
|
||||
Assert.True(await host.SuspendAsync("clock", OdSuspendReason.Hidden));
|
||||
|
||||
_time.Advance(TimeSpan.FromMinutes(1));
|
||||
Assert.Same(view, await host.SetMainWindowAwayAsync(away: false));
|
||||
|
||||
Assert.False(host.IsMainWindowAway);
|
||||
Assert.Equal(OdModuleState.Active, clock.State);
|
||||
Assert.Equal(Start.AddMinutes(3), clock.LastActive);
|
||||
Assert.Equal(new[] { "clock:Active>Idle", "clock:Idle>Suspended", "clock:Suspended>Active" }, changes, StringComparer.Ordinal);
|
||||
Assert.Equal(new[] { "init", "view", "activate", "suspend:Hidden", "activate" }, _clock.Calls, StringComparer.Ordinal);
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void WindowBack_AfterAHibernation_BuildsANewView() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
var first = await host.ShowAsync("clock");
|
||||
await host.SetMainWindowAwayAsync(away: true);
|
||||
Assert.True(await host.HibernateAsync("clock"));
|
||||
|
||||
var second = await host.SetMainWindowAwayAsync(away: false);
|
||||
|
||||
Assert.NotNull(second);
|
||||
Assert.NotSame(first, second);
|
||||
Assert.Same(second, host.Find("clock")?.View);
|
||||
Assert.Equal(OdModuleState.Active, host.Find("clock")?.State);
|
||||
Assert.Equal(new[] { "init", "view", "activate", "hibernate", "view", "activate" }, _clock.Calls, StringComparer.Ordinal);
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void WindowAway_OnAShellPage_ChangesNoModule() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
await host.ShowAsync("clock");
|
||||
await host.HideAsync();
|
||||
_time.Advance(TimeSpan.FromMinutes(1));
|
||||
|
||||
Assert.Null(await host.SetMainWindowAwayAsync(away: true));
|
||||
Assert.Null(await host.SetMainWindowAwayAsync(away: false));
|
||||
|
||||
Assert.Null(host.Current);
|
||||
Assert.Equal(OdModuleState.Idle, host.Find("clock")?.State);
|
||||
Assert.Equal(Start, host.Find("clock")?.LastActive);
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void ShowingAnotherModule_WhileAway_LeavesTheFirstOneWhereTheLadderHasIt() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
await host.ShowAsync("clock");
|
||||
await host.SetMainWindowAwayAsync(away: true);
|
||||
_time.Advance(TimeSpan.FromMinutes(6));
|
||||
await host.SuspendAsync("clock", OdSuspendReason.Hidden);
|
||||
|
||||
// A notification for Timer, clicked while the window is in the tray.
|
||||
await host.ShowAsync("timer");
|
||||
|
||||
Assert.Equal(OdModuleState.Suspended, host.Find("clock")?.State);
|
||||
Assert.Equal(Start, host.Find("clock")?.LastActive);
|
||||
Assert.Same(host.Find("timer"), host.Current);
|
||||
Assert.Equal(OdModuleState.Active, host.Find("timer")?.State);
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void ShowingTheWindowsOwnModule_WhileAway_ActivatesItAgain() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
var view = await host.ShowAsync("clock");
|
||||
await host.SetMainWindowAwayAsync(away: true);
|
||||
await host.SuspendAsync("clock", OdSuspendReason.Hidden);
|
||||
|
||||
Assert.Same(view, await host.ShowAsync("clock"));
|
||||
|
||||
Assert.Equal(OdModuleState.Active, host.Find("clock")?.State);
|
||||
Assert.Equal(new[] { "init", "view", "activate", "suspend:Hidden", "activate" }, _clock.Calls, StringComparer.Ordinal);
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void APopOut_StaysActive_WhileTheMainWindowIsAway() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
await host.ShowAsync("clock");
|
||||
await host.PopOutAsync("timer");
|
||||
|
||||
await host.SetMainWindowAwayAsync(away: true);
|
||||
|
||||
Assert.Equal(OdModuleState.Active, host.Find("timer")?.State);
|
||||
Assert.Equal(OdModuleState.Idle, host.Find("clock")?.State);
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void IsPinned_RestartsTheHiddenTime_OfAModuleThatRefusesToSuspend() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
await host.ShowAsync("clock");
|
||||
await host.ShowAsync("timer");
|
||||
_clock.CanSuspend = false;
|
||||
_time.Advance(TimeSpan.FromMinutes(40));
|
||||
|
||||
Assert.True(await host.IsPinnedAsync("clock"));
|
||||
Assert.Equal(Start.AddMinutes(40), host.Find("clock")?.LastActive);
|
||||
|
||||
_clock.CanSuspend = true;
|
||||
Assert.False(await host.IsPinnedAsync("clock"));
|
||||
Assert.False(await host.IsPinnedAsync("timer"));
|
||||
});
|
||||
|
||||
private OdModuleHost NewHost(params IOdModule[] more) => new(
|
||||
[_clock, _timer, .. more],
|
||||
new OdDatabase(_temp.Combine("omnideck.db"), pooling: false),
|
||||
|
||||
@@ -326,6 +326,49 @@ public sealed class OdShellViewModelTests : IDisposable
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void WindowAway_HidesTheModule_AndBackShowsItAgain_OnTheSameView() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
using var shell = NewShell(host);
|
||||
await shell.NavigateAsync("clock");
|
||||
var view = shell.CurrentView;
|
||||
var changed = new List<string?>();
|
||||
shell.PropertyChanged += (_, e) => changed.Add(e.PropertyName);
|
||||
|
||||
await shell.SetWindowAwayAsync(away: true);
|
||||
await shell.SetWindowAwayAsync(away: true);
|
||||
Assert.Equal(OdModuleState.Idle, host.Find("clock")?.State);
|
||||
Assert.Equal(OdModuleState.Idle, shell.Library[0].State);
|
||||
Assert.Same(view, shell.CurrentView);
|
||||
|
||||
await shell.SetWindowAwayAsync(away: false);
|
||||
Assert.Equal(OdModuleState.Active, host.Find("clock")?.State);
|
||||
Assert.Same(view, shell.CurrentView);
|
||||
|
||||
// The stage keeps its view, so a module in full screen stays there.
|
||||
Assert.DoesNotContain(nameof(OdShellViewModel.CurrentView), changed, StringComparer.Ordinal);
|
||||
Assert.Equal("clock", shell.CurrentTarget);
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void WindowBack_AfterAHibernation_ShowsTheNewView() => OdSta.Run(async () =>
|
||||
{
|
||||
using var host = NewHost();
|
||||
using var shell = NewShell(host);
|
||||
await shell.NavigateAsync("clock");
|
||||
var view = shell.CurrentView;
|
||||
|
||||
await shell.SetWindowAwayAsync(away: true);
|
||||
Assert.True(await host.HibernateAsync("clock"));
|
||||
Assert.Same(view, shell.CurrentView);
|
||||
|
||||
await shell.SetWindowAwayAsync(away: false);
|
||||
Assert.NotNull(shell.CurrentView);
|
||||
Assert.NotSame(view, shell.CurrentView);
|
||||
Assert.Same(host.Find("clock")?.View, shell.CurrentView);
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void ABrandName_IsShownAsWritten()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user