Compare commits

..
Author SHA1 Message Date
dependabot[bot] 90f667e551 deps: Bump Ical.Net from 5.2.3 to 5.2.4 (#76)
---
updated-dependencies:
- dependency-name: Ical.Net
  dependency-version: 5.2.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-10 06:01:26 +00:00
dependabot[bot] 0cf7d45b89 deps: Bump Markdig from 1.5.1 to 1.6.0 (#77)
---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-10 12:53:02 +07:00
dependabot[bot] 2700e1ffea deps: Bump the build-tooling group with 2 updates (#75)
Bumps dotnet-sonarscanner from 12.0.0 to 12.1.0
Bumps Meziantou.Analyzer from 3.0.318 to 3.0.321

---
updated-dependencies:
- dependency-name: dotnet-sonarscanner
  dependency-version: 12.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: build-tooling
- dependency-name: Meziantou.Analyzer
  dependency-version: 3.0.321
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: build-tooling
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-09 22:49:42 +00:00
dependabot[bot] eb079f601a Merge pull request #74 from poli0981/dependabot/github_actions/actions-469a5665a3
ci: Bump the actions group with 4 updates
2026-11-10 05:45:14 +07:00
poli0981 cf268cec7a Merge pull request #70 from poli0981/docs/legal-1.2
docs: legal documents 1.2
2026-11-03 20:02:53 +07:00
poli0981 d765eabb99 Merge remote-tracking branch 'origin/main' into docs/legal-1.2 2026-11-03 19:04:20 +07:00
poli0981 12591e256f Merge pull request #73 from poli0981/release/0.3.0-alpha.1
chore: release 0.3.0-alpha.1
2026-11-03 19:03:26 +07:00
poli0981andClaude Opus 5.5 28b4416cf5 chore: release 0.3.0-alpha.1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 18:58:23 +07:00
poli0981 589857b61f Merge pull request #72 from poli0981/chore/stocks-module-tests
test: the Stocks module goes down the ladder and comes back
2026-11-03 18:57:49 +07:00
poli0981andClaude Opus 5.5 8fadbf05e4 test: the Stocks module goes down the ladder and comes back
Hosts OdStocksModule as the other built-in modules are: shown, hidden,
suspended, hibernated, shown again with a new view and closed; and
before the host initializes it, it creates no view and has none to
activate or rest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 18:53:02 +07:00
poli0981 f0573f7e67 Merge pull request #69 from poli0981/docs/p3-exit
docs: what P3 delivered
2026-11-03 18:50:32 +07:00
poli0981 516acc5758 Merge remote-tracking branch 'origin/main' into docs/p3-exit 2026-11-03 18:45:06 +07:00
poli0981 660aded5f8 Merge pull request #68 from poli0981/feat/p3-ja
feat: Japanese
2026-11-03 18:45:01 +07:00
poli0981 fad655559a Merge remote-tracking branch 'origin/main' into feat/p3-ja 2026-11-03 18:39:40 +07:00
poli0981 12807bb4fa Merge pull request #67 from poli0981/feat/p3-vi
feat: Vietnamese
2026-11-03 18:39:36 +07:00
poli0981 1d112de39f Merge remote-tracking branch 'origin/main' into feat/p3-vi 2026-11-03 18:34:47 +07:00
poli0981 7b3ab04b07 Merge pull request #66 from poli0981/feat/p3-i18n
feat: the groundwork for translations
2026-11-03 18:34:42 +07:00
poli0981andClaude Opus 5.5 3648253156 test: the settings lists and the alarm form follow a change of language
A change of language refreshes the language, theme, preset and accent
lists in place, and the alarm form's repeats and time hint, keeping
their items and the form's choice. The settings page tests join the
culture collection for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 18:30:33 +07:00
poli0981 0a23d50ac3 Merge remote-tracking branch 'origin/main' into feat/p3-i18n 2026-11-03 18:21:12 +07:00
poli0981 abf7810c8b Merge pull request #65 from poli0981/feat/p3-a11y
feat: an accessibility pass over the shell and the modules
2026-11-03 18:21:07 +07:00
poli0981andClaude Opus 5.5 1fa5524ede test: the names OdAutomationNames gives laid-out template parts
Registers the class handlers as the shell does and lays out the parts:
every scroll bar and slider command, the names by part and the ones
already set, the sidebar's pane button as the pane opens and closes on
WPF-UI's own template, an editable combo box's text box, and the
maximize button's converters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 18:16:16 +07:00
poli0981 d2e3f990a7 Merge remote-tracking branch 'origin/main' into feat/p3-a11y 2026-11-03 18:06:42 +07:00
poli0981 cd4e7b7dc9 Merge pull request #64 from poli0981/feat/p3-presets
feat: preset palettes, touch targets and live previews
2026-11-03 18:06:38 +07:00
poli0981 ba703abbdb Merge remote-tracking branch 'origin/main' into feat/p3-presets 2026-11-03 18:00:47 +07:00
poli0981 d3bacec396 Merge pull request #63 from poli0981/feat/p3-update-channel
feat: choose whether updates include pre-releases
2026-11-03 18:00:41 +07:00
poli0981andClaude Opus 5.5 e2ed465f66 ci: leave the Velopack update adapter out of coverage
OdVelopackUpdateService only hands the channel to Velopack's update
manager, which needs an installed copy and GitHub's releases; the
channel logic (OdUpdateChannel) is tested on its own, as for the
WebView2 and libVLC wrappers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:55:40 +07:00
poli0981 10d5f2b2ad Merge remote-tracking branch 'origin/main' into feat/p3-update-channel 2026-11-03 17:49:28 +07:00
poli0981 3466ee79dc Merge pull request #62 from poli0981/feat/p3-alarms
feat: alarms in Timer, at a time of day
2026-11-03 17:49:23 +07:00
poli0981 3c72f8e0f9 Merge remote-tracking branch 'origin/main' into feat/p3-alarms 2026-11-03 17:44:37 +07:00
poli0981 1040abd699 Merge pull request #61 from poli0981/feat/p3-stocks-detail
feat: a listing's details in Stocks, charted from a month to five years
2026-11-03 17:44:31 +07:00
poli0981 74f00d0006 Merge remote-tracking branch 'origin/main' into feat/p3-stocks-detail 2026-11-03 17:39:46 +07:00
poli0981 7725ee13bd Merge pull request #60 from poli0981/feat/p3-stocks
feat: Stocks, a watchlist with the user's own Twelve Data key
2026-11-03 17:39:00 +07:00
poli0981 8bc97df1cc Merge remote-tracking branch 'origin/main' into feat/p3-stocks 2026-11-03 17:34:24 +07:00
poli0981 678cd4e5f5 Merge pull request #59 from poli0981/feat/p3-stocks-data
feat: the Stocks data layer, and a DPAPI store for the user's secrets
2026-11-03 17:33:52 +07:00
poli0981 99f50141f2 Merge remote-tracking branch 'origin/main' into feat/p3-stocks-data 2026-11-03 17:28:51 +07:00
poli0981 237dae4284 Merge pull request #58 from poli0981/feat/p3-charts
feat: charts drawn by OmniDeck itself, and a 48-hour chart in Weather
2026-11-03 17:28:18 +07:00
poli0981 67762f06e9 Merge branch 'feat/p3-ja' into docs/p3-exit
# Conflicts:
#	CLAUDE.md
#	docs/ROADMAP.md
2026-11-03 15:35:27 +07:00
poli0981 371ac37ce7 Merge branch 'feat/p3-vi' into feat/p3-ja 2026-11-03 15:33:39 +07:00
poli0981 a6c28a6e0c Merge branch 'feat/p3-i18n' into feat/p3-vi 2026-11-03 15:33:35 +07:00
poli0981 b4a27862f3 Merge branch 'feat/p3-a11y' into feat/p3-i18n 2026-11-03 15:33:32 +07:00
poli0981 d4bd8535af Merge branch 'feat/p3-presets' into feat/p3-a11y 2026-11-03 15:33:28 +07:00
poli0981 4a20b5c87c Merge branch 'feat/p3-update-channel' into feat/p3-presets 2026-11-03 15:33:25 +07:00
poli0981 e11bc8fe88 Merge branch 'feat/p3-alarms' into feat/p3-update-channel 2026-11-03 15:33:21 +07:00
poli0981 d630386a0c Merge branch 'feat/p3-stocks-detail' into feat/p3-alarms 2026-11-03 15:33:18 +07:00
poli0981 d08c3a56b9 Merge branch 'feat/p3-stocks' into feat/p3-stocks-detail 2026-11-03 15:33:15 +07:00
poli0981 35a9a6e954 Merge branch 'feat/p3-stocks-data' into feat/p3-stocks 2026-11-03 15:33:11 +07:00
poli0981 aaffcf6db8 Merge branch 'feat/p3-charts' into feat/p3-stocks-data 2026-11-03 15:33:08 +07:00
poli0981 196089865c Merge branch 'main' of https://github.com/poli0981/OmniDeck into feat/p3-charts
# Conflicts:
#	CHANGELOG.md
2026-11-03 15:32:49 +07:00
poli0981 9baae8d08f Merge pull request #71 from poli0981/release/0.2.0
chore: release 0.2.0
2026-11-03 15:29:53 +07:00
poli0981andClaude Opus 5.5 331cb08939 chore: release 0.2.0
The end of phase P2, signed off by the maintainer: the same app as
0.2.0-alpha.4, under its own version. The ROADMAP marks P2 done and moves
the rest as agreed on 3 November: 0.3.0 in early December 2026, the 0.9
public beta in mid-December, 1.0 at the end of January 2027 and 23 May 2027
at the latest. README, SPEC, CLAUDE.md and the bug report's version
placeholder follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 15:25:19 +07:00
poli0981andClaude Opus 5.5 8fb4582421 docs: the P3 resource soak
An hour of a Debug build cycling eight pages through the command palette,
with Idle after 1 minute and Hibernate after 2: flat GDI and USER objects
and private commit while the script ran, one step in handles at the run's
first web request, and the last 18 minutes left untouched after outside
input took the palette out of the script's reach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 15:13:35 +07:00
poli0981andClaude Opus 5.5 2b1f691e5f docs: legal documents 1.2
PRIVACY spells out what Open-Meteo and Twelve Data receive, says that
requests OmniDeck makes itself name the app and its version in their
User-Agent, and that media snapshots in Pictures\OmniDeck stay when the
app is uninstalled. EULA no longer describes libVLC as coming in a later
version. THIRD-PARTY-NOTICES drops the planned ScottPlot row, which P3's
own charts replaced, and renumbers the sections after it. DISCLAIMER only
moves to 1.2 with the others: the documents share one version.

OdLegal.Version is 1.2, so everyone acknowledges the documents once more
at their next start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:55:49 +07:00
poli0981 f92a98441e Merge branch 'feat/p3-ja' into docs/p3-exit 2026-11-03 14:42:38 +07:00
poli0981 9c77a81383 Merge branch 'feat/p3-vi' into feat/p3-ja 2026-11-03 14:42:35 +07:00
poli0981 404c5d8e7d Merge branch 'feat/p3-i18n' into feat/p3-vi 2026-11-03 14:42:33 +07:00
poli0981andClaude Opus 5.5 b88a8e9c3c fix: one view model cannot stop a change of language
FollowCulture went through WeakEventManager, which stops delivering at the
first handler that throws. In CI a settings view model left over from another
test, whose temporary database was already gone, threw while refreshing its
web-app list, and the onboarding view model under test never saw the change.

OdLocalization now keeps its own weak list of followers and calls each one on
its own: a follower that throws is logged and keeps its old texts, and the
others still follow. Disposable view models stop following in Dispose
(UnfollowCulture).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:42:23 +07:00
poli0981andClaude Opus 5.5 6bd9198b65 docs: what P3 delivered
ROADMAP says what P3 delivered, work package by work package, and that
Weather's charts came in P3, drawn by OmniDeck itself. ARCHITECTURE's
layout gains Charts, the i18n and accessibility helpers and od-drive.
SPEC §5 says how languages and accessibility were built and where their
rules live. README lists alarms, accessibility, live language changes and
TRANSLATING. SECURITY says how the Twelve Data key travels. CLAUDE.md gets
the P3 status, the i18n and accessibility conventions and the new doc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:28:24 +07:00
poli0981andClaude Opus 5.5 7cbbb884a9 feat: Japanese
Japanese string tables for the shell, the modules and the web runner, 544
strings, worded as Windows 11's Japanese UI words things
(docs/TRANSLATING.md §7: voice, terms, formats and fonts). Japanese joins
the language list as 日本語, and falls back to Yu Gothic UI, as WPF does for
windows tagged ja.

The English tables' headers no longer say the translations are coming.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:25:37 +07:00
poli0981 daef28386b Merge branch 'feat/p3-i18n' into feat/p3-vi 2026-11-03 14:22:14 +07:00
poli0981andClaude Opus 5.5 b5889265fc feat: Vietnamese
Vietnamese string tables for the shell, the modules and the web runner,
543 strings in all, worded with Windows' own Vietnamese terms
(docs/TRANSLATING.md §6, which now holds the voice and the glossary).
Vietnamese joins the language list as Tiếng Việt.

Found while checking it live: the title bar's search button gets an
automation ID, which no language changes (od-drive finds it by that), and
a text box's clear button gets a name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:22:13 +07:00
poli0981 f6ba62f7de Merge branch 'feat/p3-a11y' into feat/p3-i18n 2026-11-03 14:15:16 +07:00
poli0981andClaude Opus 5.5 2940ab289d docs: follow the renumbered hard rules section
WPFUI-CONVENTIONS gained an accessibility section, so its hard rules are §9
now: the spike note's link pointed at a fragment that no longer exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:15:06 +07:00
poli0981andClaude Opus 5.5 1fc58ce634 feat: the groundwork for translations
A change of language now reaches the whole UI. View models that build
text in code read it again through OdLocalization.FollowCulture, a weak
subscription that needs no unsubscribing. Lists the user picks from
(OdChoice, OdLocalizedOption, preset cards, swatches) change their texts
in place, so the selection bound to them stays. WebView2 starts in the UI
language.

The language list names each shipped language in itself (OdLanguages).
The clock's 12-hour time and Weather's day labels are formats in the
string tables, and the calendar's interval reads as one phrase ("every 2
weeks") instead of a sentence built around a combo box. The palette
matches Latin letters whatever their accents. The legal text is marked as
English, and the bug report's issue stays English, with module ids.

Tests run in US English whatever the machine's languages; a translation
test checks keys, placeholders and empty texts once translations exist.
docs/TRANSLATING.md says how it all works.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:03:14 +07:00
poli0981andClaude Opus 5.5 c095a5920e feat: an accessibility pass over the shell and the modules
Screen readers get the sidebar as two lists of selectable, invokable items
(OdNavigationView, OdNavItem): WPF-UI's item controls wrapped each item in
a data item with neither. OdAutomationNames names the template buttons
WPF-UI leaves unnamed or names after a glyph (title bar, pane button,
scroll bar, slider, number box, password reveal), on first layout since
WPF raises Loaded only where it is handled.

Rows say which row their buttons act on ({res:OdLocRow}), list items are
named as they read instead of as records print, calendar days give the
whole date, toggles name what they do now, titles are headings, and
OdStatusText makes status lines live regions WPF actually announces.

Keyboard: the palette lists each settings tab, Check for updates, Report a
bug and Open the data folder; pop-outs answer Ctrl+K and Ctrl+W; Enter and
Delete act on the media queue and the calculator history; the palette and
Ctrl+1-9 move the focus into the page they open.

Large text: width tokens grow with Od.Font.Base, tile buttons wrap, and the
calculator's keys keep their labels. Out-of-month days dim to 0.7 (AA on
light), not at all in High Contrast, which also hides the accent swatches,
now a named list. scripts/od-drive.ps1 drives and audits a dev build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:46:26 +07:00
poli0981andClaude Opus 5.5 997bb1df67 feat: preset palettes, touch targets and live previews
Comfort's secondary and tertiary text reaches 7:1 (AAA) and every other
preset's 4.5:1 (AA) on each WPF-UI surface of the light and dark themes,
through text brushes the preset layer replaces; High Contrast keeps
Windows' colors. New tokens: Od.Contrast.Target, Od.Nav.IconSize and the
row margins, so the CI token rule now covers every view and literal
margins, paddings and corner radii too.

Text size now reaches pages and modules: the navigation view's frame cut
property inheritance, and WPF-UI fixes lists, tooltips and sidebar labels
at 12-14 px. Check boxes, radio buttons, drop-downs, switches, list, menu
and sidebar items get the preset's minimum touch target.

Onboarding's preset cards each render with that preset's own layer.
Dynamic's gradient accents are cut: they would make text contrast vary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:59:10 +07:00
poli0981andClaude Opus 5.5 cbb826e469 feat: choose whether updates include pre-releases
P3 WP8, a P4 blocker pulled forward: OdVelopackUpdateService asked for
pre-releases unconditionally, so after 1.0 a stable install would have
been offered every later beta.

- OdSettings.Prereleases (bool?) and OdUpdateChannel: without a choice,
  a pre-release build (a SemVer suffix, or below 1.0.0) keeps taking
  pre-releases and a stable build takes stable releases only.
- Each update check builds its Velopack source for the channel in use;
  the manager that found an update downloads and applies it.
- Settings → About: "Get pre-release versions (alphas and betas)", shown
  at its effective value. RELEASING notes that all releases stay on the
  one "win" channel, so a beta moves to 1.0 as an ordinary update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:24:03 +07:00
poli0981andClaude Opus 5.5 8c900e592f feat: alarms in Timer, at a time of day
P3 WP5, closing the SPEC §3.1 gap: until now only countdowns rang.

- An alarm is a time of day, once, daily, on weekdays or at weekends,
  with an optional label and an on/off switch. OdAlarmService keeps them
  in a settings document of their own (timer-alarms) and, like the timer
  service, outlives the Timer module, so alarms ring whether or not it
  was opened, as a notification that opens Timer.
- They ring only while OmniDeck runs, as the screen says: one that came
  due while it was closed is not shown later, and one the PC slept
  through rings on waking only within the hour. A one-off alarm turns
  itself off once it rang.
- OdAlarmSchedule is pure and works in local wall-clock time: a time a
  daylight-saving change skips rings once the clock is past the gap, and
  one that happens twice rings the first time only.
- The service reads its alarms on first use, so building the container
  opens no database file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:20:50 +07:00
poli0981andClaude Opus 5.5 3f30f2a449 feat: a listing's details in Stocks, charted from a month to five years
P3 WP4. Choosing a watchlist row opens its details: where it trades and
whether that market is open, the day's and the 52-week range, the volume,
and a candle chart with its volume band over 1 month, 6 months, 1 year or
5 years.

- The year of daily bars, fetched once per trading day for the
  sparklines, serves the first three ranges (22, 126 and 252 bars); the
  five years of weekly bars are fetched, one credit, only when that range
  is chosen, and then cached. The last bar follows the live quote, on the
  listing's own trading day (New York's for US listings).
- The chart's name is a summary of the range (from, to, change, highest
  and lowest, with their days); the arrow keys read each bar out, in a
  live region too, and a check box shows the same bars as a table.
- A range without bars says so, over whatever was cached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:08:57 +07:00
poli0981andClaude Opus 5.5 ddd9ccb320 feat: Stocks, a watchlist with the user's own Twelve Data key
P3 WP3, the Stocks module (docs/SPEC.md §3.5), Light, after Weather:

- Setup: the first screen explains the key and links to Twelve Data's
  sign-up; "Test and save" spends one credit on api_usage and keeps the
  key (DPAPI) only when Twelve Data accepts it, with the plan's limits.
  The key panel changes or removes it; the watchlist and its last figures
  stay either way.
- Watchlist in the settings document: price, signed change with its
  direction, a sparkline of the last month and the price's time; each row
  reads as one sentence. Delete, Alt+Up/Down and a context menu edit it.
- Search (free) labels listings the plan does not reach; those cannot be
  added, and one that fails for its plan or as unknown is not asked for
  again that session.
- OdStocksRefresher spends credits on stale quotes first, in batches of a
  minute's credits, then the daily series behind the sparklines while
  more than 100 credits are left today. It never retries by itself; a
  minute limit says when the rest goes. The refresh interval grows when
  the day's credits would not last the session, and the screen says so.
- It refreshes only while on screen: Activate starts a one-minute check,
  DeactivateAsync stops it, so a minimized or tray-hidden OmniDeck spends
  nothing. Rejected keys, spent credits and an unreachable service show
  in a bar over the last figures. Every screen carries the disclaimer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:03:22 +07:00
poli0981andClaude Opus 5.5 b529bf0bc5 feat: modules hear when they leave the screen (DeactivateAsync)
IOdModule.DeactivateAsync, a default no-op, is what RAM-GOVERNOR §1
promises for Idle: the host calls it whenever a module goes from Active to
Idle (another module shows, the window goes away, a pop-out closes), after
the next one is active. One that throws is logged and hidden all the same.
Clock and Timer stop ticking there, and Weather drops a fetch under way.
Stocks will stop refreshing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:52:04 +07:00
poli0981andClaude Opus 5.5 d6f0871561 feat: the Stocks data layer, and a DPAPI store for the user's secrets
P3 WP2: everything Stocks needs below its screens.

- IOdSecretStore / OdDpapiSecretStore (Core): one file per secret in
  OmniDeck.Data\secrets, encrypted with DPAPI for the current user and
  OmniDeck's own entropy, written atomically, plain text wiped after use.
  A file that no longer decrypts reads as no secret. Not in settings.json,
  so exports never carry it; the scrubber now also takes "apikey"
  Authorization values out of bug reports.
- OdTwelveData: quotes in batches, daily or weekly series, symbol search
  with the plan each listing needs, and api_usage. The key goes in an
  Authorization: apikey header per request, never in the URL or on the
  shared client; logs name the endpoint and a count, never a key or a
  symbol. Answers are read leniently: every figure may be missing, and a
  plan limit or an unknown symbol fails one listing, not the batch.
- OdCreditLimiter: at most the plan's credits per rolling minute and per
  UTC day, failed calls included, a 429 honoured until the next minute or
  day, and the count kept in app_meta across restarts.
- OdMarketHours and OdStocksFreshness: quotes refresh while the US market
  trades, once more for the final price after the close, and not again
  until the next session (holidays included); series last until half an
  hour after the next close.
- OdStocksCache over migration 0006 (stocks_quotes_cache,
  stocks_series_cache); the watchlist will live in the settings document.
- Tests use hand-written answers shaped like Twelve Data's, with invented
  symbols, as its terms keep its data out of the repository. The two
  private fake HTTP handlers became one shared OdFakeHttp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:48:56 +07:00
poli0981 55d879e530 Merge pull request #57 from poli0981/docs/post-p2-drift
docs: bring the public docs in line with what P2 shipped
2026-11-03 11:39:04 +07:00
poli0981 e92e70c2d9 Merge branch 'docs/post-p2-drift' into feat/p3-charts 2026-11-03 11:34:51 +07:00
poli0981 5b69972ca2 Merge remote-tracking branch 'origin/main' into docs/post-p2-drift 2026-11-03 11:33:59 +07:00
poli0981andClaude Opus 5.5 56426c7c01 feat: charts drawn by OmniDeck itself, and a 48-hour chart in Weather
P3 needs charts for Stocks, and ROADMAP held Weather's for them. Instead
of ScottPlot (SkiaSharp, HarfBuzz and OpenTK: about 20 MB and six more
license blocks), the charts are WPF elements of OmniDeck's own
(src/OmniDeck.Modules/Charts), decided on 2026-11-03:

- OdChartScale (round 1-2-5 value axes), OdDateTicks (time labels by
  hours, days, weeks, months or years, in the culture's short forms) and
  OdChartKeys (cursor keys) are pure and tested on their own.
- OdChartBase draws with WPF's own pens and text. Its brushes follow the
  theme by resource reference, High Contrast included, its line weight is
  Od.Chart.LineWeight and its labels Od.Font.Caption. A cursor moves with
  the mouse or the arrow keys; the automation peer names the chart by its
  Summary and exposes the values at the cursor as a read-only Value.
- OdCandleChart (candles or OHLC bars, volume band, hollow rising
  candles), OdLineBarChart and OdSparkline (decoration, hidden from
  screen readers).

Weather shows its next 48 hours as temperature over the chance of rain,
with a summary sentence and a readout per hour; the list stays as text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:32:58 +07:00
poli0981 cc973aa11b Merge pull request #56 from poli0981/release/0.2.0-alpha.4
chore: release 0.2.0-alpha.4
2026-11-03 11:22:57 +07:00
poli0981 cbcd556df9 Merge remote-tracking branch 'origin/main' into release/0.2.0-alpha.4 2026-11-03 11:18:27 +07:00
poli0981andClaude Opus 5.5 6575c5c5e5 docs: bring the public docs in line with what P2 shipped
- README: Stocks covers US listings on Twelve Data's free plan; Settings →
  Memory replaces the "task-manager panel"; the hard cap is 6 GiB or half
  the RAM; what happens if Spotify's DRM goes away; the Portable zip is
  not supported yet; onboarding asks for the language first; Settings →
  About.
- ROADMAP: no EME self-check exists, and the catalog has no "disabled"
  state; the backlog's portable build means one that keeps its data beside
  the program.
- SPEC: no charting library (charts are drawn in-house, decided today);
  Markdig and dependency injection in §7; one libVLC size.
- WEBAPP-CATALOG: no host hotkey exists for Discord yet; §4's candidates
  have not been checked in OmniDeck.
- CLAUDE.md, CONTRIBUTING, the bug template: current status, stack and
  layout; the dev data root; commit prefixes; Settings → About.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:18:13 +07:00
poli0981 1b9304247b Merge pull request #55 from poli0981/fix/governor-away
fix: a minimized or tray-hidden window lets its module rest
2026-11-03 11:16:32 +07:00
poli0981andClaude Opus 5.5 837e5eba1d chore: release 0.2.0-alpha.4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:15:28 +07:00
poli0981 f498437ada Merge remote-tracking branch 'origin/main' into fix/governor-away 2026-11-03 11:12:57 +07:00
poli0981 4305a49291 Merge pull request #54 from poli0981/chore/dev-data-root
chore: a development build can use a data root of its own
2026-11-03 11:09:25 +07:00
poli0981 7af21aab09 Merge remote-tracking branch 'origin/main' into chore/dev-data-root 2026-11-03 11:05:13 +07:00
poli0981andClaude Opus 5.5 8ba9d620af fix: a minimized or tray-hidden window lets its module rest
The module on screen when the main window was minimized, or closed to the
notification area, stayed Active for as long as the window was away: the
governor never suspended or hibernated it, and the caps never took it.

The host now hears when the window goes away and comes back
(SetMainWindowAwayAsync). Away, its module goes Idle and down the ladder
like any hidden module, while staying the one the window shows; back, it
is activated again, with a new view if it was hibernated meanwhile. The
stage keeps its view while away, so a full screen and the page survive a
minimize. A notification click navigates before bringing the window up.

Because a minimized window never unloads its view, Clock and Timer restart
their ticking in ActivateAsync, and a web app hides its browser before
asking WebView2 to suspend, which it does only for a hidden browser.

Time spent pinned (a player playing) no longer counts as time hidden, so a
player that stops after an hour out of sight is not hibernated at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:05:11 +07:00
poli0981 e5f2835229 Merge pull request #43 from poli0981/feat/catalog-c2
feat(catalog): Spotify's third-party sign-in hops, and audioPin for calls
2026-11-03 10:53:27 +07:00
poli0981andClaude Opus 5.5 76b27e86ed chore: a development build can use a data root of its own
A Debug build reads OMNIDECK_DATA_ROOT and, when it is set, keeps its
settings, database, web sign-ins and logs there, under a single-instance
name of its own, so it runs beside an installed OmniDeck without touching
that copy's data. Release builds never read the variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 10:52:59 +07:00
poli0981 66812dc467 Merge remote-tracking branch 'origin/main' into feat/catalog-c2 2026-11-03 10:49:02 +07:00
poli0981 e82507db2d Merge pull request #53 from poli0981/dependabot/nuget/build-tooling-f93e7cef44
deps: Bump the build-tooling group with 1 update
2026-11-03 10:48:20 +07:00
dependabot[bot] 14f9e63f12 deps: Bump the build-tooling group with 1 update
Bumps Meziantou.Analyzer from 3.0.317 to 3.0.318

---
updated-dependencies:
- dependency-name: Meziantou.Analyzer
  dependency-version: 3.0.318
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: build-tooling
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-02 19:19:37 +00:00
poli0981 e279e94056 Merge branch 'main' into feat/catalog-c2 2026-11-02 13:03:35 +07:00
poli0981 d33d6fa442 Merge pull request #52 from poli0981/release/0.2.0-alpha.3
chore: release 0.2.0-alpha.3
2026-11-02 12:54:09 +07:00
poli0981andClaude Opus 5.5 a36c846271 chore: release 0.2.0-alpha.3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:49:27 +07:00
poli0981 5c769ae082 Merge pull request #51 from poli0981/feat/p2-polish
feat: P2 polish: app icon, Play/Pause state, docs re-baselined
2026-11-02 12:48:57 +07:00
poli0981 e7acfef005 Merge remote-tracking branch 'origin/main' into feat/p2-polish 2026-11-02 12:42:37 +07:00
poli0981andClaude Opus 5.5 60a57b23e0 docs: re-baseline on what P2 built, and record the resource soak
ROADMAP: P2 started on 2 November 2026, as soon as P1 was done; what it
delivered so far, what changed on the way and what was left for later.
Settings import/export shipped in P1, so it leaves P3's list.

README, SPEC, ARCHITECTURE and CONTRIBUTING now describe P2 as built:
pop-out windows, web notifications, permission questions, downloads,
the bug report's flow and contents, Spotify's DRM and Discord's hotkey.

RAM-GOVERNOR: a soak of 21 pop-out and 21 page full-screen round trips
left GDI and USER objects and handles flat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:42:36 +07:00
poli0981andClaude Opus 5.5 5f1a965153 feat: an application icon, and a Play/Pause button that shows which
OmniDeck had no icon of its own: the executable, its windows, the
taskbar and Velopack's Setup showed defaults. scripts/make-icon.ps1 draws
the monogram the tray icon uses, a bold "O" on Windows' default accent
blue, at the sizes Windows asks for, into Assets/OmniDeck.ico. The
executable carries it (WPF windows take it from there) and vpk pack gets
it with --icon. It stands in until a designed icon replaces the file.

The media player's Play/Pause button always showed Play; it now shows
Pause while playing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:32:38 +07:00
poli0981 b5c629907b Merge pull request #50 from poli0981/fix/p2-media-controls
fix: the media control bar keeps its seek bar and buttons when narrow
2026-11-02 12:30:28 +07:00
poli0981 c3a79402b8 Merge remote-tracking branch 'origin/main' into fix/p2-media-controls 2026-11-02 12:26:25 +07:00
poli0981andClaude Opus 5.5 0c9912cc53 fix: the media control bar keeps its seek bar and buttons when narrow
The bar was one row: beside the queue, at the window's default size, the
seek bar shrank to almost nothing and the queue button was cut off. The
title, time and seek bar now have rows of their own above the buttons, and
the volume slider shrinks before anything is cut off. WPF-UI's Slider style
asks for 104 px, so the volume slider sets MinWidth="0" and its column
decides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:26:09 +07:00
poli0981 39019f4fb3 Merge pull request #49 from poli0981/feat/p2-pop-out
feat: pop-out windows, and web full screen
2026-11-02 12:24:41 +07:00
poli0981andClaude Opus 5.5 9b8086d925 docs: changelog for pop-out windows and web full screen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:19:36 +07:00
poli0981 8f7a94973f Merge remote-tracking branch 'origin/main' into feat/p2-pop-out 2026-11-02 12:19:22 +07:00
poli0981andClaude Opus 5.5 1d4babcd41 feat: pop-out windows for modules
Any module can move into a window of its own, from its sidebar menu or
its library tile. The host keeps it active there, out of the governor's
reach, beside whatever the main window shows; asking for it again brings
its window up. Closing the window docks the module back, hidden, and
"Return to main window" shows it in the main window.

The view itself moves, so WPF re-parents a web app's browser and a
video's window: both keep running, without spike #6's track re-selection
and seek. The window lets go of the view before it closes and hands the
windows it owns to the main window, since LibVLCSharp's overlay would
otherwise close for good with it. Pop-outs have their own full screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:19:21 +07:00
poli0981 c21621403b Merge pull request #48 from poli0981/release/0.2.0-alpha.2
chore: release 0.2.0-alpha.2
2026-11-02 12:03:40 +07:00
poli0981andClaude Opus 5.5 311cdf641b chore: release 0.2.0-alpha.2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 11:59:45 +07:00
poli0981andClaude Opus 5.5 4925eee1fd feat: a web page's full screen takes the window with it
A page that shows something full screen (a video, say) asks the window
for full screen through OdFullscreen, as the media player does; when the
window leaves first (Esc, another module), the page is told to leave too.

The window cover moves out of the main window into OdWindowCover, with
tests, so pop-out windows can use it next. In full screen the frame now
overlaps the pixels the folded pane's template still keeps, so the module
fills the monitor exactly instead of starting 9 px from the left edge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 11:59:20 +07:00
poli0981 e2e94c6f5c Merge branch 'main' into feat/catalog-c2 2026-11-02 11:51:25 +07:00
poli0981 6467c87982 Merge pull request #47 from poli0981/feat/p2-media-fullscreen
feat: media full screen and tray controls
2026-11-02 11:46:16 +07:00
poli0981 966e1fb23f Merge remote-tracking branch 'origin/main' into feat/p2-media-fullscreen 2026-11-02 11:41:15 +07:00
poli0981andClaude Opus 5.5 e8ea8aa925 feat: media full screen and tray controls
- OdFullscreen (Core): a view asks for full screen with a bubbling routed
  event raised from itself (its video overlay is a window of its own) and
  learns the answer through an inherited attached property on the stage.
- The main window covers its monitor (OdMonitors, LibraryImport), hides
  the title bar, unlinks it from the navigation view and folds the pane
  to zero width; changing the pane mode would re-template the view and
  re-create the player's video window. Esc, hiding to the tray or showing
  another module ends it.
- The media overlay: a full-screen button, double-click on the picture
  (the overlay is alpha 1 over a picture, so clicks reach it) and Esc;
  the queue steps aside meanwhile.
- IOdMediaControls: while a player has a file loaded, the tray menu shows
  it with Play/Pause, Next and Previous.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 11:40:33 +07:00
poli0981 f52965cdde Merge pull request #46 from poli0981/feat/p2-media-options
feat: media player options: tracks, subtitles, speed, device, snapshot
2026-11-02 11:33:41 +07:00
poli0981andClaude Opus 5.5 5491f6594f feat: media player options: tracks, subtitles, speed, device, snapshot
The overlay's More menu, built when it opens from the file playing:
- audio and subtitle tracks, and a subtitle file (kept if the file
  reopens, dropped when the next file starts);
- the subtitles' encoding (Automatic, UTF-8, common code pages): libVLC
  reads subsdec-encoding only when a file opens, so a new choice reopens
  the file where it stood;
- speed 0.25x to 4x, put back on each file since libVLC starts each at
  normal speed;
- the audio device, without libVLC's own id-less "Default" next to
  "Windows default";
- a snapshot of the picture in Pictures\OmniDeck, named after the file.
Speed, encoding and device are kept in the module's settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 11:29:12 +07:00
poli0981 e52b4d679c Merge pull request #45 from poli0981/ci/sonar-native-wrappers
ci: leave the native-engine wrappers out of Sonar coverage
2026-11-02 11:18:25 +07:00
poli0981 763cc93de0 Merge remote-tracking branch 'origin/main' into ci/sonar-native-wrappers 2026-11-02 11:13:29 +07:00
poli0981 be89c978a6 Merge pull request #44 from poli0981/feat/p2-media
feat: add the media player, first part
2026-11-02 11:13:10 +07:00
poli0981andClaude Opus 5.5 16d6e64b0c ci: leave the native-engine wrappers out of Sonar coverage
OdWebRuntime wraps the WebView2 runtime and OdVlcEngine/OdVlcPlayer wrap
libVLC; like the views, they only run against engines CI does not load,
which kept PRs #38 and #39 just under the 80 % new-code coverage gate
(77.3 % and 76.6 %, no issues). The logic around them stays covered, and
the memory reporter's path before any web app opens gets a test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 11:11:53 +07:00
poli0981andClaude Opus 5.5 6b898994a3 feat: add the media player, first part
- OdMediaModule (Heavy): local audio and video through LibVLCSharp 3.10.2
  and libVLC 3.0.24. libVLC starts with the first file played.
- Files, folders and .m3u playlists from the buttons or dropped on the
  player; the queue can be saved as .m3u. The queue and where playback
  stood live in media_playlists (migration 0005) and survive restarts.
- Pinned while playing; suspending lets the player go and keeps the
  position, hibernating lets libVLC go too (spike #6: 280-520 MB).
- libVLC events are posted to the UI thread; only its errors reach the
  log, as warnings, less the three known harmless messages.
- The overlay covers libVLC's blank video window until a picture plays.
- Packaging: x64 only, the SPEC plugin folders without the network access
  plugins (about 80 MB raw) in libvlc\win-x64.
- Third-party notices: LibVLCSharp and libVLC move to bundled, with the
  LGPL-2.1 and GPL-2.0 texts (pre-approved P2 entries).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 11:08:27 +07:00
poli0981andClaude Opus 5.5 fbc2a3c2b6 feat(catalog): Spotify's third-party sign-in hops, and audioPin for calls
- spotify: "Continue with Google / Facebook / Apple" are links to
  accounts.spotify.com/login/<provider>, which redirect the main frame to
  accounts.google.com, www.facebook.com and appleid.apple.com and back.
  The entry lists those hosts and the google-account-domains set (Google's
  SetSID hops), so sign-in no longer leaves for the default browser.
- discord and facebook: audioPin true, so a call that is playing audio is
  never suspended; review rule 5 now allows calls.
- updated: 2026-11-03, so installed 0.2.0-alpha.1 copies, which ship the
  2026-11-02 catalog, take this one at their next daily check.
- Tests follow the catalog's own date and cover the new hosts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 10:52:05 +07:00
poli0981 df161596f8 Merge pull request #42 from poli0981/feat/p2-bug-report
feat: report a bug from About or the error dialog
2026-11-02 10:47:38 +07:00
poli0981andClaude Opus 5.5 48ba07c2ad feat: report a bug from About or the error dialog
- OdScrubber (Core, pure): the user's profile folder, URL queries and
  fragments, cookie values, bearer tokens, JWTs, long hex and base64 runs,
  email addresses and numeric ids of 15+ digits come out of every file.
- OdBugReporter composes the report: version and commit, Windows build,
  preset, modules with state, hidden time and memory, the last 500 log
  lines, sign-in cookie counts, and a web app's console.
- The dialog previews issue.md and lets the user pick the subject. Save
  writes reports\bugreport-<stamp>.zip (ten kept), shows it in Explorer
  and opens the bug form with only the short fields in its query.
- The error dialog gains Report bug, which passes in the error shown.
- While any dialog is open the main window hides the module stage, since a
  web app's native browser window would cover the dialog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 10:43:53 +07:00
poli0981 7e6d0f474a Merge pull request #41 from poli0981/release/0.2.0-alpha.1
release: 0.2.0-alpha.1
2026-11-02 10:39:00 +07:00
poli0981andClaude Opus 5.5 a0b473459c release: 0.2.0-alpha.1
First P2 alpha: the catalog's web apps on WebView2, with notifications,
site permissions and memory figures, plus Weather and Calendar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 10:34:43 +07:00
poli0981 4d24d2243c Merge pull request #40 from poli0981/feat/p2-web-notifications
feat: web app notifications, permission questions and Settings > Web apps
2026-11-02 10:34:08 +07:00
poli0981andClaude Opus 5.5 779cb13002 feat: web app notifications, permission questions and Settings > Web apps
- Notifications: NotificationReceived is always handled. When the app's
  switch is on (default: the catalog's flag), it becomes a tray
  notification "App: title" with the body below, cut to what a balloon
  holds. ReportShown follows; a click opens the app and reports
  ReportClicked to the page. OdNotification gains a Clicked callback the
  tray runs after opening the target.
- Residency: an app with notifications on stays live while hidden.
- Permissions: device and data kinds are asked once per app in a bar above
  the browser (no content dialog can cover WebView2) and kept in
  settings.json (web.apps.<id>.permissions); SavesInProfile is off.
  Autoplay and persistent storage are left to the browser, the rest is
  refused.
- Settings > Web apps: notification switches, answered permissions with
  Ask again, Clear data per profile group (closes the apps, clears the
  profile through a hidden browser, resets sign-in health), and the
  catalog's date and last check.
- Downloads keep WebView2's own flyout (SmartScreen, dangerous files).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 10:29:58 +07:00
poli0981 1a2b41be40 Merge pull request #39 from poli0981/feat/p2-web-governor
feat: count the web apps' processes in the RAM governor
2026-11-02 10:09:50 +07:00
poli0981andClaude Opus 5.5 cdf8b1f004 feat: count the web apps' processes in the RAM governor
The governor now measures OmniDeck's own process plus whatever the memory
reporters follow. The web runner reports every WebView2 process: renderers
go to the app whose page they host (main frame id, else a host only one
app shows), and the browser, GPU and utility processes are shared.

- Victims: resident modules last, then least recently used, Heavy first,
  then the module that uses more.
- A hibernated web app counts as gone in the same pass (and the shared
  processes with the last one); the next pass measures again.
- When the shell, the shared processes and the web apps that stay are
  above the hard cap on their own, it warns instead of hibernating.
- IOdResidency: modules that work while hidden skip the time ladder; the
  caps take them last and say so with a notification that reopens them.
- Settings > Memory shows each web app's figure and a shared row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 10:05:05 +07:00
poli0981 6edea9bb01 Merge pull request #38 from poli0981/feat/p2-web-runner
feat: run the catalog's web apps in WebView2
2026-11-02 09:52:21 +07:00
poli0981 5b46489596 Merge pull request #37 from poli0981/feat/p2-catalog-runtime
feat: load the web-app catalog and check main's copy daily
2026-11-02 09:50:41 +07:00
poli0981 176cf3cf4a Merge branch 'feat/p2-catalog-runtime' into feat/p2-web-runner 2026-11-02 09:47:10 +07:00
poli0981 3a609e88c3 Merge remote-tracking branch 'origin/main' into feat/p2-catalog-runtime 2026-11-02 09:46:34 +07:00
poli0981andClaude Opus 5.5 677e58f5c2 feat: run the catalog's web apps in WebView2
Every catalog entry becomes a Heavy module hosted in one shared WebView2
environment, one profile per catalog profile.

- Navigation policy: main frame stays on navAllow and its named sets over
  HTTPS; web and mail links elsewhere open in the default browser, other
  schemes are blocked. A link that keeps leaving is held back after 3
  opens in 30 s.
- Sign-in popups on popupAllow hosts open in an in-app window on the same
  profile.
- Suspend lowers the memory target and suspends the browser; hibernate
  keeps the page in memory and disposes the control; a crashed page reloads
  once, then asks.
- Console capture over CDP into two session rings for the bug report.
- Sign-in health counts each profile's cookies (never values) at first
  load and at close, and warns when a profile comes back empty.
- Quit closes every module, then waits up to 3 s for the browser process
  to exit so cookies reach disk. --wv2-logging turns on Chromium logging.
- Third-party notices list the WebView2 SDK (BSD-3-Clause).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 09:46:29 +07:00
poli0981 eef73cac86 Merge pull request #36 from poli0981/feat/p2-calendar
feat: add the calendar module
2026-11-02 09:29:17 +07:00
poli0981 43eb0e0da7 Merge remote-tracking branch 'origin/main' into feat/p2-catalog-runtime 2026-11-02 09:26:14 +07:00
poli0981andClaude Opus 5.5 6019bc6c33 feat: load the web-app catalog and check main's copy daily
WP2 creates OmniDeck.Web with the catalog runtime:

- OdCatalog and OdCatalogEntry read webapps.json strictly (unknown,
  missing or null properties are errors) through source-generated JSON.
- OdCatalogValidator applies the rules validate-catalog.ps1 checks in CI;
  its test runs on the repository's file so the two stay in step.
- OdCatalogService uses the newer of the catalog bundled with the build
  and the last one fetched. A minute after start, then at most once a
  day, it fetches main's copy with If-None-Match, keeps a valid one
  atomically in the data root, and applies it from the next start.
- The CI token rule now covers OmniDeck.Web views, and an architecture
  test keeps the web runner off the shell and the built-in modules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 09:25:12 +07:00
poli0981 038c695987 Merge branch 'main' into feat/p2-calendar 2026-11-02 09:24:50 +07:00
poli0981 932385a71e Merge pull request #33 from poli0981/feat/catalog-schema-v2
feat(catalog): schema v2 with named navAllowSets for Google's account domains
2026-11-02 09:19:50 +07:00
poli0981 6dbfa9e6d4 Merge remote-tracking branch 'origin/feat/catalog-schema-v2' into feat/p2-catalog-runtime 2026-11-02 09:18:45 +07:00
poli0981 503f7bd607 Merge remote-tracking branch 'origin/main' into feat/catalog-schema-v2 2026-11-02 09:15:52 +07:00
poli0981 209fea4e7f Merge remote-tracking branch 'origin/main' into feat/p2-calendar 2026-11-02 09:15:20 +07:00
poli0981andClaude Opus 5.5 8fb9de8702 feat: add the calendar module
Local events with repeats, reminders and .ics import and export
(docs/SPEC.md §3), in a month grid, a week list or a 30-day agenda.

- OdCalendarStore keeps events in calendar_events (migration 0004) as
  local wall-clock times, with the RRULE, the removed dates and the
  reminder; the module and the reminders share it and hear its changes.
- OdRecurrence expands repeats through Ical.Net 5.2.3, imported rules
  (BYDAY, COUNT, ...) included; the editor writes daily, weekly, monthly
  or yearly rules with an interval and an end date, and keeps a rule it
  cannot show unless the user picks another.
- OdIcs reads and writes .ics files; fixed-zone times become local, and
  UIDs make a second import update instead of duplicate.
- OdReminderService starts with the app, so reminders fire whether or not
  Calendar was opened, only while OmniDeck runs; clicking one opens Calendar.
- THIRD-PARTY-NOTICES: Ical.Net (MIT) and NodaTime (Apache-2.0) move to
  the bundled list (pre-approved for P2 packages).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 09:14:52 +07:00
poli0981 835185f26e Merge pull request #35 from poli0981/feat/p2-weather
feat: add the weather module
2026-11-02 09:04:33 +07:00
poli0981 59d49656d7 Merge remote-tracking branch 'origin/main' into feat/catalog-schema-v2 2026-11-02 09:01:35 +07:00
poli0981 bf30b52fb8 Merge remote-tracking branch 'origin/main' into feat/p2-weather 2026-11-02 09:01:32 +07:00
poli0981andClaude Opus 5.5 bb729f8348 feat: add the weather module
Forecasts from Open-Meteo (keyless; the only weather service PRIVACY
lists) for the places the user saves by searching for a city: no device or
IP location. It shows the conditions now, the next 48 hours and the next
7 days, in the region's units or the user's choice.

- OdOpenMeteo builds the requests and parses the answers into records;
  anything unexpected becomes a JsonException.
- OdWeatherService serves a forecast younger than 30 minutes from the
  weather_cache table (migration 0003), fetches older ones again, shows
  the last one as stale when Open-Meteo is out of reach, and never retries
  by itself. Its log lines name neither places nor coordinates.
- The module fetches only while it is on screen; suspending it cancels
  the request in flight. The attribution links to Open-Meteo.com.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 09:00:59 +07:00
poli0981 f60d455647 Merge pull request #34 from poli0981/feat/p2-foundation
feat: lay the P2 foundation in the module contract and the shell
2026-11-02 08:49:50 +07:00
poli0981andClaude Opus 5.5 0c7a3b684b feat: lay the P2 foundation in the module contract and the shell
- IOdModuleContext gives modules the shared HTTP client (OdHttp: one
  HttpClient naming OmniDeck in its User-Agent, no cookies, 15 s timeout)
  and the database for their own tables.
- Notifications carry a target: a module's notifications open it when
  clicked, through the tray icon's balloon-click event.
- OdModuleInfo.DisplayName shows a brand name as written, for web apps.
- The host activates the new module before hiding the old one, so a module
  that fails to start leaves the shell as it was, and CloseAllAsync closes
  every open module; quitting now runs it before the app shuts down.
- The theme engine re-applies the theme only when Windows' look (dark or
  light, accent, High Contrast, animations) actually changed.
- Stale comments fixed. The OmniDeck.Web project is created with the web
  runner (WP3): an empty project would trip ReferenceTrimmer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 08:46:33 +07:00
poli0981 e03d809492 Merge pull request #32 from poli0981/release/0.1.1
release: 0.1.1
2026-11-02 08:36:38 +07:00
poli0981andClaude Opus 5.5 230f7dc8c7 feat(catalog): schema v2 with named navAllowSets for Google's account domains
Google's sign-in hops to accounts.google.<ccTLD> (for example
accounts.google.com.vn/accounts/SetSID) to set its cookies; spike #2 saw
YouTube blocked there. Schema v2 adds top-level navAllowSets, named lists
of domains that entries reference by name, and google-account-domains
lists the 186 country-code account hosts from google.com/supported_domains.
Every google-profile entry references it, since they share one sign-in.

validate-catalog.ps1 now checks that every set an entry names exists,
that every set is used, and counts sets when checking popupAllow coverage.
No released build reads the catalog yet, so moving to v2 strands no client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 08:36:10 +07:00
poli0981 5400c6dbe4 Merge pull request #31 from poli0981/fix/tray-icon-gdi-leak
fix: draw the tray icon in-house and stop repeating crash reports
2026-11-02 08:35:15 +07:00
poli0981andClaude Opus 5.5 9b86f98846 release: 0.1.1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 08:31:44 +07:00
poli0981andClaude Opus 5.5 eb243b7f07 fix: draw the tray icon in-house and stop repeating crash reports
The tray icon used H.NotifyIcon's GeneratedIconSource bound to the accent
brushes. In 2.4.1 every redraw leaks an icon handle (Icon.FromHandle never
destroys it) and every brush change adds one more redraw handler, so redraws
grew quadratically with each accent or theme change until the process ran out
of GDI objects: "A generic error occurred in GDI+" thousands of times a
second, then WPF render failures.

- OdTrayIcon renders the icon with WPF and loads it from ICO bytes, so each
  icon owns its handle and the taskbar icon frees the one it replaces. It
  redraws only when the colors change.
- OdCrashHandler reports a repeating failure once a minute, with a repeat
  count, instead of logging and showing every occurrence.
- Logs are kept for seven days by age (31 files at most), as SPEC §5 and the
  privacy policy say.
- OdThemeEngine applies a custom accent before the theme dictionaries, as
  WPF-UI does with the Windows accent, so toggle switches no longer lag one
  pick behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 08:30:47 +07:00
poli0981 67d2bb635f Merge pull request #30 from poli0981/release/0.1.0
release: 0.1.0
2026-10-30 17:12:03 +07:00
poli0981 78f230c517 Merge remote-tracking branch 'origin/main' into release/0.1.0 2026-10-30 17:07:47 +07:00
poli0981 4c2342620f Merge pull request #29 from poli0981/feat/p1-polish
feat: polish presets, keyboard and accessibility; check for updates daily
2026-10-30 17:07:32 +07:00
poli0981andClaude Opus 5.5 26675d1bd0 docs: closing the window quits when the tray is off
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 17:06:59 +07:00
poli0981andClaude Opus 5.5 30a6280d5e release: 0.1.0
The P1 exit release: the CHANGELOG section, <Version> in
Directory.Build.props, P1 marked done in the roadmap with what carries
forward, and the README status (alpha).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 17:02:33 +07:00
poli0981 322068f1cd Merge remote-tracking branch 'origin/main' into feat/p1-polish 2026-10-30 17:01:53 +07:00
poli0981andClaude Opus 5.5 ac544cbc52 feat: polish presets, keyboard and accessibility; check for updates daily
P1 WP8, the last work package before 0.1.0.

- The sidebar follows the layout preset at run time, not only at start:
  Dynamic closes it to icons with each name in a tooltip, and Comfort's
  Od.Nav.MaxVisibleItems (6) caps it while keeping the module on screen
  in view. OdThemeEngine raises Applied after each token rebuild.
- Keyboard: Ctrl+1 to Ctrl+9 open the sidebar's modules, Ctrl+, opens
  Settings (OdShellViewModel.ShortcutTarget, unit-tested).
- High Contrast: Windows' accent wins over a custom one; the legal
  documents' rules, table lines and quote bars use theme brushes.
- Screen readers name preset cards and settings choices by their titles
  (ToString), not by the record's debug text.
- The command palette sets MinHeight 0: FluentWindow's style sets 320,
  which kept the window tall above a short list.
- Updates: opening Settings > About checks once, and OdUpdateWatcher
  checks three minutes after start and then daily, notifying once per
  new version (docs/ARCHITECTURE.md section 7; PRIVACY already lists
  update checks).
- Tests for OdMotion, the watcher, the capped sidebar and the shortcuts.
- ARCHITECTURE (layout, startup, updates), UI-MODES (what P1 built and
  what waits for P3), third-party notices (a test-only package),
  CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 17:01:53 +07:00
poli0981 d77e951a10 Merge pull request #28 from poli0981/release/0.1.0-alpha.2
release: 0.1.0-alpha.2
2026-10-30 16:59:09 +07:00
poli0981 349f67a45b Merge remote-tracking branch 'origin/main' into release/0.1.0-alpha.2 2026-10-30 16:54:49 +07:00
poli0981 f3d70d503a Merge pull request #27 from poli0981/feat/p1-settings
feat: add settings, the legal gate, onboarding and About
2026-10-30 16:48:41 +07:00
poli0981andClaude Opus 5.5 10c065fe20 release: 0.1.0-alpha.2
The CHANGELOG section for the second alpha (settings, legal gate,
onboarding, the in-app updater) and <Version> in Directory.Build.props.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 16:45:18 +07:00
poli0981 a400fd6f89 Merge remote-tracking branch 'origin/main' into feat/p1-settings 2026-10-30 16:42:31 +07:00
poli0981andClaude Opus 5.5 8a8f7d95e0 feat: add settings, the legal gate, onboarding and About
P1 WP7.

- Legal gate: before the main window, the first run (and the first run
  after each legal update) shows the license agreement, disclaimer,
  privacy policy and third-party notices from the app's legal folder,
  rendered from Markdown into a FlowDocument with Markdig. Continue
  waits for the "I have read" box; the acknowledged version and time
  go to app_meta. Only absolute http, https and mailto links open.
- Onboarding: a short first-run setup for the language and the layout
  preset, applied as you choose.
- Settings, in the sidebar footer: General (language, keep running in
  the notification area, start with Windows through the HKCU Run key,
  which starts in the tray), Appearance (theme, preset, text size,
  animations, accent), Memory (the governor's thresholds above the
  running-modules panel, which moves here from the sidebar), Data (open
  the data folder, export and import settings) and About (version,
  update check and download through Velopack, links, legal documents).
- The command palette gains Settings and Running modules.

Markdig 1.5.1 (BSD-2-Clause) joins the third-party notices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 16:42:23 +07:00
poli0981 cda1552a1c Merge pull request #26 from poli0981/release/0.1.0-alpha.1
release: 0.1.0-alpha.1
2026-10-30 16:32:35 +07:00
poli0981 fbc41e25b6 Merge remote-tracking branch 'origin/main' into release/0.1.0-alpha.1 2026-10-30 16:28:17 +07:00
poli0981 99790377c8 Merge pull request #25 from poli0981/feat/p1-modules
feat: add the Clock, Timer and Calculator modules
2026-10-30 16:27:27 +07:00
poli0981andClaude Opus 5.5 8cbb83a0b8 release: 0.1.0-alpha.1
Move the unreleased notes under 0.1.0-alpha.1 and set the dev-build
version to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 16:23:51 +07:00
poli0981 07f686ceee Merge remote-tracking branch 'origin/main' into feat/p1-modules 2026-10-30 16:23:07 +07:00
poli0981andClaude Opus 5.5 ae8187e39d feat: add the Clock, Timer and Calculator modules
P1 WP6. A new OmniDeck.Modules project holds the built-in mini-apps
(docs/SPEC.md §3.1-3.2). It references Core and WPF-UI but never the
shell, and has its own string table, registered at startup.

- Clock: local time plus world clocks in 12- or 24-hour time, each with
  its offset from here; zones live in the module's settings document.
- Timer: countdowns from presets or a custom length and name, and a
  stopwatch with laps. OdTimerService owns the timing, so timers keep
  running while the module is hibernated or closed, and finished ones
  raise a notification. The tray menu starts a 5-minute quick timer.
- Calculator: a recursive-descent evaluator (precedence, right-assoc ^,
  !, %, constants, trigonometry exact at right angles in degrees,
  implicit multiplication), standard and scientific keypads as data,
  keyboard input, session history and copy.

Module views bind to view-model state rather than BasedOn styles, so
they build without the app's resources and the tests construct them.
Icons are nameof(SymbolRegular.X), checked at compile time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 16:22:43 +07:00
poli0981 055be54be8 Merge pull request #24 from poli0981/feat/p1-governor
feat: add the RAM governor v1 and the running-modules panel
2026-10-30 16:15:50 +07:00
poli0981 f880b8d87c Merge remote-tracking branch 'origin/main' into feat/p1-governor 2026-10-30 16:12:11 +07:00
poli0981 717bd86e1f Merge pull request #23 from poli0981/feat/p1-shell
feat: add the shell, the module contract and host, the palette and the tray
2026-10-30 16:00:09 +07:00
poli0981andClaude Opus 5.5 77fcbe11df feat: add the RAM governor v1 and the running-modules panel
P1 WP5. OdRamGovernor (Core) polls every 10 s on the UI thread and
works through OdModuleHost. Hidden modules are suspended after
IdleAfter and hibernated after HibernateAfter. Above the soft cap the
least recently used one is hibernated: recency counts in poll
intervals, and heavy modules go first. Above the hard cap it
hibernates as many as it takes and notifies once per excursion.

Modules the user keeps running, and modules whose CanSuspendAsync is
false, are never demoted. The metric is private commit, behind
IOdMemory so tests drive a fake gauge with FakeTimeProvider. Caps
default to min(4.5 GiB, 35 % of RAM) and min(6 GiB, 50 %), and all
thresholds live in settings.json under memory.

The running-modules panel opens from the sidebar's Memory item until
the settings pages exist. It shows each module's state and last use and
OmniDeck's memory against both caps, and acts through the governor
(Suspend, Hibernate, Close, Keep running).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:55:59 +07:00
poli0981andClaude Opus 5.5 944e45950a ci: build Core before dotnet format loads the app's XAML
The window XAML now resolves {res:OdLoc ...} from OmniDeck.Core. dotnet
format runs before the build, so the markup compiler found no Core
assembly, the windows lost their generated base class and fields, and
the analyzers flagged code that compiles fine (IDE0060, S2325, S1125).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:55:07 +07:00
poli0981 bc44fa5554 Merge remote-tracking branch 'origin/main' into feat/p1-shell 2026-10-30 15:38:38 +07:00
poli0981andClaude Opus 5.5 b11568d6bb feat: add the shell, the module contract and host, the palette and the tray
P1 WP4. The module contract from docs/ARCHITECTURE.md §2 lands in Core,
which now takes the WPF dependency, together with OdModuleHost: it
initializes a module once, builds its view on first open and after
hibernation, keeps the visible one and demotes hidden ones on request,
refusing when CanSuspendAsync says no. Each module gets its own settings
document in the new module_settings table.

The shell window is rebuilt around it. The navigation view is chrome
only: pinned modules, then open ones, then the library page; every
module item navigates to one shared stage whose content the host
supplies. Ctrl+K (or the title-bar search box) opens a fuzzy command
palette over modules and shell commands. Closing the window hides it in
the tray (H.NotifyIcon), whose balloons carry module notifications; a
second launch brings it back. Errors now show in an in-window dialog.

UI strings move to Resources/Strings.resx behind OdLocalization and
{res:OdLoc Key}, which live in Core so modules can use them too; a test
keeps the string table and the sources in step. The theme engine now
re-applies the look only when an appearance setting changes.

Third-party notices list CommunityToolkit.Mvvm and H.NotifyIcon, as
approved for P1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:38:37 +07:00
poli0981 196538d62d Merge pull request #22 from poli0981/feat/p1-theme
feat: add the theme engine and the Od.* preset tokens (WP3)
2026-10-30 15:00:01 +07:00
poli0981 1567bcae25 Merge remote-tracking branch 'origin/main' into feat/p1-theme 2026-10-30 14:56:58 +07:00
poli0981andClaude Opus 5.5 3ea5a1c665 feat: add the theme engine and the Od.* preset tokens
The theme engine follows docs/UI-MODES.md and spike #5:

- Core: OdPreset holds the UI-MODES §2 token table (Dynamic, Standard,
  Comfort). OdTokens.Compute applies the user's font scale
  (0.85–1.4), the Windows text size (up to 225%) and the motion switch
  as plain, tested arithmetic. OdTokenKeys names the Od.* resource
  keys. Settings gain FontScale, MotionEnabled and AccentColor, all
  normalized.
- App: OdThemeEngine runs two independent axes.
  - Light/Dark/System goes through WPF-UI's ApplicationThemeManager;
    High Contrast follows the system, and an optional accent color
    applies.
  - The preset layer is a code-built ResourceDictionary, replaced in
    place whenever the settings, the Windows text size (registry,
    re-read on WM_SETTINGCHANGE and window activation) or user
    preferences change.
  - OdStyles.xaml adds implicit styles where WPF-UI 4.3 reads sizes
    through StaticResource. Keys it reads dynamically are overridden
    in the preset layer.
  - OdMotion runs token-driven animation from code, since a style
    storyboard cannot take a DynamicResource.
- Tests: preset values against the table, heading scale, the
  multiplication and clamping of text and font scale, motion off,
  preset fallback, settings normalization, the published resource
  types, in-place replacement and the registry text-scale parsing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:56:45 +07:00
poli0981 4181d9d754 Merge pull request #21 from poli0981/feat/p1-storage
feat: add the local database and schema migrations (WP2)
2026-10-30 14:56:39 +07:00
poli0981andClaude Opus 5.5 769756c060 test: cover logging and crash handling
SonarCloud put WP1's new-code coverage at 76.9%: the logger setup and
the crash handler had no tests. The crash handler now takes an
IOdErrorPresenter (a message box until the shell's dialog host lands
in WP4) and a TimeProvider. Its UI, fatal and unobserved paths are
plain methods that tests can call without a WPF Application.

New tests: the logger writes daily files under the data root; a UI
failure is logged and shown with its support code; a failure while
the dialog is showing is logged but not stacked; fatal and unobserved
exceptions are logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:52:39 +07:00
poli0981 2b84a874d0 Merge remote-tracking branch 'origin/main' into feat/p1-storage 2026-10-30 14:51:09 +07:00
poli0981 3a481b9ad6 Merge pull request #20 from poli0981/feat/p1-foundation
feat: lay the P1 foundation (WP1)
2026-10-30 14:50:39 +07:00
poli0981andClaude Opus 5.5 ff4378c701 docs: list Dapper and SQLite in the third-party notices
Dapper, Microsoft.Data.Sqlite, SQLitePCLRaw and the public-domain
SQLite library now ship in the app, so they move from planned to
bundled with their versions and copyright notices. Approved by the
maintainer for the P1 packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:50:05 +07:00
poli0981andClaude Opus 5.5 2ab2fba933 feat: add the local database and schema migrations
OdDatabase opens omnideck.db in the data root (SQLite through Dapper,
WAL journal, foreign keys on) and brings the schema up to date at
startup. Migrations are SQL files embedded in Core and named
NNNN_name.sql. Each applies once, in order, inside its own
transaction, and app_meta records the version. A failing step rolls
back and leaves the version where it was.

app_meta holds app-wide facts behind IOdAppMeta; the legal-gate
acknowledgment keys are already defined. Pools are cleared on exit, so
the database file is released.

Tests: version 0 when empty, contiguous core versions, each step
applied once, rollback on failure, duplicate versions rejected, and
app_meta set and overwrite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:50:04 +07:00
poli0981andClaude Opus 5.5 05a9def6b4 docs: list DI and Serilog in the third-party notices
Microsoft.Extensions.DependencyInjection (+ .Abstractions) and Serilog
with Serilog.Sinks.File now ship in the app, so they move from planned
to bundled. The Apache License 2.0 text joins the license section for
Serilog. The maintainer approved notice updates for the P1 packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:46:54 +07:00
poli0981andClaude Opus 5.5 7f14eb8f07 feat: lay the P1 foundation
- Startup: Program.Main runs Velopack's hooks first. Uninstalling now
  deletes %LocalAppData%\OmniDeck.Data, as PRIVACY promises. A
  single-instance guard follows (named mutex plus an activation event):
  a second OmniDeck brings the first one forward and exits. OdApp then
  builds the data root, the logger and the service container
  (ValidateOnBuild), and shows the window. OdApp.xaml is now a plain
  page, so WPF no longer generates a Main of its own.
- Core:
  - OdDataRoot, which refuses to point at Velopack's install folder;
  - OdJsonFile: atomic writes, and corrupt files set aside;
  - OdSettings (an immutable record with source-generated JSON) behind
    IOdSettingsService;
  - OdSingleInstanceGuard;
  - AddOmniDeckCore.
- App:
  - Serilog to rolling files in the data root, kept for seven days;
  - OdCrashHandler, which logs every unhandled exception and shows a
    support code for UI-thread failures while the app keeps running;
  - AddOmniDeckApp.
- Tests: data root, JSON file, settings, the single-instance guard,
  container validation, the Core-must-not-reference-the-shell rule, and
  support codes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:46:53 +07:00
poli0981 e551838319 Merge pull request #19 from poli0981/docs/legal-1.1
docs: legal documents 1.1, without Stooq and Messenger
2026-10-30 14:34:59 +07:00
poli0981 e5c80d41e8 Merge remote-tracking branch 'origin/main' into docs/legal-1.1 2026-10-30 14:31:29 +07:00
poli0981 5813e2dd82 Merge pull request #18 from poli0981/docs/p0-exit
docs: fold the P0 spike results into the design docs
2026-10-30 14:31:24 +07:00
poli0981andClaude Opus 5.5 c63b5da92b docs: legal documents 1.1, without Stooq and Messenger
The maintainer approved these edits (rule 9 of CLAUDE.md).

- EULA, DISCLAIMER, PRIVACY: version 1.1, effective from the first
  release after 0.0.1-alpha.1, with a one-line note of what changed.
- PRIVACY: the network list names only Twelve Data, contacted only
  after the user enters their own API key.
- DISCLAIMER: market data comes from Twelve Data with the user's key;
  Messenger is gone from the list of web apps.
- EULA: Stooq is gone from the example data services.
- THIRD-PARTY-NOTICES: the Stooq row is removed, the Twelve Data row
  says what it provides, and Messenger is gone from the catalog list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:24:20 +07:00
poli0981 4f57e38c95 Merge remote-tracking branch 'origin/main' into docs/p0-exit 2026-10-30 14:21:57 +07:00
poli0981 bc0b7dd3ed Merge pull request #17 from poli0981/docs/spike-06-libvlcsharp
docs: record spike #6, LibVLCSharp in WPF
2026-10-30 14:21:52 +07:00
poli0981andClaude Opus 5.5 9a055fba64 docs: fold the P0 spike results into the design docs
- RAM-GOVERNOR:
  - measured costs per rung;
  - private commit is the metric;
  - the soft cap hibernates, since Suspended frees almost no memory;
  - caps default relative to physical RAM;
  - shared WebView2 processes are reported, never demoted.
- SPEC:
  - Twelve Data is the only stocks provider, with plan-dependent coverage and a credit budget;
  - libVLC fullscreen, pop-out hand-over and build size;
  - Google's country-code sign-in domains;
  - CDP capture always on, with an errors-only ring.
- ROADMAP: P0 marked done with a summary; risks updated (DRM and libVLC retired, Stooq handled, session loss added).
- SECURITY, WEBAPP-CATALOG, CHANGELOG follow.

The legal documents still mention Stooq and Messenger. They change in a
separate PR, once the maintainer approves the edits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:21:44 +07:00
477 changed files with 39179 additions and 227 deletions

No files matched your search

+2 -2
View File
@@ -10,7 +10,7 @@
"rollForward": false
},
"dotnet-sonarscanner": {
"version": "12.0.0",
"version": "12.1.0",
"commands": [
"dotnet-sonarscanner"
],
@@ -24,4 +24,4 @@
"rollForward": false
}
}
}
}
+10 -2
View File
@@ -51,6 +51,14 @@ dotnet_diagnostic.IDE0005.severity = warning # unnecessary using
dotnet_diagnostic.CA1848.severity = none # LoggerMessage delegates: overkill here
dotnet_diagnostic.MA0026.severity = suggestion # TODO comments: SonarCloud (S1135) already tracks them
[src/OmniDeck.App/**.cs]
# UI code must resume on the dispatcher thread, so ConfigureAwait(false) is wrong here.
[src/{OmniDeck.App,OmniDeck.Modules,OmniDeck.Web}/**.cs]
# UI code (the shell, the modules and the web runner) must resume on the dispatcher thread, so ConfigureAwait(false) is wrong here.
dotnet_diagnostic.MA0004.severity = none
[src/OmniDeck.Core/{Modules,Governor}/**.cs]
# The module host and the governor drive module views from the dispatcher thread as well.
dotnet_diagnostic.MA0004.severity = none
[tests/**.cs]
# Tests await on the STA dispatcher (OdSta) or in xUnit's own context; xUnit1030 forbids ConfigureAwait(false) there.
dotnet_diagnostic.MA0004.severity = none
+3 -3
View File
@@ -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.3.0-alpha.1 (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
+15 -8
View File
@@ -34,7 +34,7 @@ jobs:
with:
persist-credentials: false
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
global-json-file: global.json
@@ -51,24 +51,31 @@ jobs:
- name: Restore pinned tools
run: dotnet tool restore
# dotnet format loads the app with the XAML markup compiler, which needs OmniDeck.Core.dll on
# disk to resolve {res:OdLoc ...}; without it the window classes lose their generated half and
# the analyzers report phantom findings.
- name: Build Core for the XAML compiler
run: dotnet build src/OmniDeck.Core/OmniDeck.Core.csproj --no-restore
- name: Verify C# formatting
run: dotnet format OmniDeck.slnx --verify-no-changes --no-restore
- name: Verify XAML formatting (XamlStyler)
run: dotnet xstyler -c Settings.XamlStyler -d src -r -p
- name: Design tokens only in module views
- name: Design tokens only in views
shell: pwsh
run: |
# docs/UI-MODES.md §2: module views consume Od.* tokens, never a literal FontSize.
# docs/UI-MODES.md §2: views consume Od.* tokens, never a literal font size, or a literal
# margin, padding or corner radius other than zero.
$hits = Get-ChildItem -Path src -Recurse -Filter *.xaml |
Where-Object { $_.FullName -match '[\\/]OmniDeck\.Modules[\\/]' } |
Select-String -Pattern 'FontSize\s*=\s*"\s*\d'
Where-Object { $_.FullName -notmatch '[\\/](bin|obj)[\\/]' } |
Select-String -Pattern 'FontSize\s*=\s*"\s*\d', '(?<![\w.])(Margin|Padding|CornerRadius)\s*=\s*"[^"{]*[1-9]'
if ($hits) {
$hits | ForEach-Object { Write-Host "::error file=$($_.Path),line=$($_.LineNumber)::Literal FontSize in a module view; use an Od.* token." }
$hits | ForEach-Object { Write-Host "::error file=$($_.Path),line=$($_.LineNumber)::Literal size in a view; use an Od.* token." }
exit 1
}
Write-Host 'No literal FontSize in module views.'
Write-Host 'No literal font sizes, margins, paddings or corner radii in views.'
- name: Build (Release, warnings are errors)
run: dotnet build OmniDeck.slnx -c Release --no-restore
@@ -99,7 +106,7 @@ jobs:
with:
persist-credentials: false
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
global-json-file: global.json
+3 -3
View File
@@ -49,12 +49,12 @@ jobs:
persist-credentials: false
- if: matrix.language == 'csharp'
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
global-json-file: global.json
- name: Initialize CodeQL
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
@@ -66,6 +66,6 @@ jobs:
run: dotnet build OmniDeck.slnx -c Release -p:RunAnalyzers=false
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
category: "/language:${{ matrix.language }}"
+1 -1
View File
@@ -41,7 +41,7 @@ jobs:
fetch-depth: 0 # the main-ancestry check below needs history
persist-credentials: false
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
global-json-file: global.json
+1 -1
View File
@@ -40,6 +40,6 @@ jobs:
path: results.sarif
retention-days: 5
- uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
- uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
sarif_file: results.sarif
+5 -2
View File
@@ -63,7 +63,7 @@ jobs:
fetch-depth: 0 # full history: SonarCloud uses blame to tell new code from old
persist-credentials: false
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
global-json-file: global.json
@@ -102,7 +102,10 @@ jobs:
'/d:sonar.cs.vstest.reportsPaths=TestResults/*.trx',
'/d:sonar.cs.roslyn.ignoreIssues=true',
'/d:sonar.exclusions=**/bin/**,**/obj/**,**/TestResults/**,publish/**,Releases/**',
'/d:sonar.coverage.exclusions=**/*.xaml.cs,**/Program.cs,scripts/**,.github/**'
# Views, and the thin wrappers over the native engines (the WebView2 runtime, libVLC) and over
# Velopack's update manager (an installed copy, GitHub's releases), run only against those,
# which CI does not have; the logic around them is tested on its own.
'/d:sonar.coverage.exclusions=**/*.xaml.cs,**/Program.cs,**/OdWebRuntime.cs,**/OdVlcEngine.cs,**/OdVlcPlayer.cs,**/OdVelopackUpdateService.cs,scripts/**,.github/**'
)
dotnet sonarscanner @scannerArgs
if ($LASTEXITCODE -ne 0) { throw "SonarScanner begin failed with exit code $LASTEXITCODE." }
+307 -1
View File
@@ -6,6 +6,302 @@ All notable changes to OmniDeck are documented here. The format follows
## [Unreleased]
## [0.3.0-alpha.1] — 2026-11-03
First P3 alpha, with all of phase P3 in it: Stocks with your own Twelve Data key, alarms in Timer,
charts drawn by OmniDeck itself, the finished Dynamic and Comfort layouts, an accessibility pass for
screen readers, the keyboard and large text, and OmniDeck in Vietnamese and Japanese. 0.3.0 follows
once this alpha has been tried out.
### Added
- Vietnamese (Tiếng Việt) and Japanese (日本語): Settings → General → Language, or the first-run setup.
- Settings → About: Get pre-release versions. Without a choice of yours it follows the version you run, so the
alphas and betas keep getting alphas and betas, and from 1.0 a stable install gets stable versions only.
- Timer: alarms at a time of day, once, every day, on weekdays or at weekends, each with an optional
label and a switch. They ring as a notification that opens Timer, while OmniDeck runs (in the
notification area too), as the screen says. A one-off alarm turns itself off once it rang; one the PC
slept through still rings on waking within the hour, and not after that.
- Stocks: a watchlist of US stocks and ETFs with Twelve Data, using your own free (or paid) API key, which
stays on this PC encrypted for your Windows account. Add listings by searching for them; each row
shows the price, the day's change and a sparkline of the last month. Prices refresh only while Stocks
is on screen, while the market trades, and within what your key's plan allows; when credits run out
or Twelve Data can't be reached, the last prices stay. Choose a listing for its details: the day's
and the year's range, and a price chart over one month to five years that the arrow keys read out
bar by bar, also as a table. Delayed or indicative data, not investment advice.
- Weather: the next 48 hours also show as a chart, the temperature as a line over the chance of rain.
Screen readers hear the chart sum the hours up; with the chart focused, the arrow keys read the
hours one by one, as the mouse does when it moves over it. The list of hours stays below it.
- First run: each layout card shows its layout's own text sizes and colors, so the three can be
compared side by side before you pick one.
- Command palette (Ctrl+K): each settings tab, Check for updates, Report a bug and Open the data folder.
A module's own window answers Ctrl+K too, and Ctrl+W closes it, which returns the module to the main
window. Whatever the palette or Ctrl+1–9 opens takes the keyboard focus.
- Enter and Delete play or remove the selected file of the media queue, and bring back or forget the
selected calculation of the calculator's history.
- The command palette finds what you type whatever its accents: "thoi tiet" finds "Thời tiết".
### Changed
- Screen readers (Narrator, NVDA, JAWS):
- the sidebar is two lists, the modules then Settings and the library, whose items say which one is
open and can be selected;
- a button that every row of a list has also says its row, as in "Remove, Tokyo";
- the title bar's, the sidebar's, the scroll bars' and the number boxes' buttons have names;
- calendar days give the whole date, and forecast hours and days, laps and calculations read as
sentences;
- Play and Mute say what they will do, Pause and Unmute once playing or muted, and the symbol keys of
the calculator their names, such as "Divide";
- page and section titles are headings, and status messages are read out as they change.
- Accent colors are a list of named swatches you can pick from the keyboard; High Contrast, which uses
Windows' colors, hides them.
- With large text, tiles, number boxes and the weather's columns grow with it, and the buttons of the
library's tiles and of the timers wrap rather than clip.
- A change of language reaches every screen at once, and the lists you pick from keep their choice;
web apps follow at OmniDeck's next start. The language list names each language in itself.
- Calendar: a repeating event's interval reads as one phrase, such as "every 2 weeks".
- The bug report's GitHub issue stays in English, with modules by id, whatever the language of the app.
- Fainter text (descriptions, captions, times) is darker on the light theme, so that it reads at a
contrast of at least 4.5:1 in every layout; in Comfort it reaches 7:1 on both themes. High Contrast
keeps Windows' colors.
- Comfort has larger sidebar icons, and in every layout check boxes, radio buttons, drop-downs,
switches, list and menu items and sidebar items are at least as tall as the layout's touch target.
### Fixed
- Much of the text on the Settings, Library and Memory pages and in the modules, and the sidebar's labels,
stayed small whatever the layout, Settings → Appearance → Text size or Windows' text size said. It
now follows all three.
- The selected layout card's description was hard to read on the accent color.
- Calendar: the days outside the month were too faint to read on the light theme. They stay dimmed,
less so, and not at all in High Contrast.
- Calculator: the keys lost their labels at large text sizes.
- Media: screen readers called the player's controls "LibVLCSharp.WPF"; they are Media's now.
## [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
of its own, and fixes to the media player's controls.
### Added
- Any module can open in a window of its own: choose "Open in new window" in its sidebar menu, or the
window button on its library tile. It runs there beside whatever the main window shows, and OmniDeck
never puts it to sleep while its window is open. Closing the window puts it back in the sidebar;
"Return to main window" shows it there. Web apps and videos keep playing through the move, and the
module's window goes full screen like the main window.
- Web apps: a video, or anything else a page shows full screen, now fills the screen, and Esc goes
back.
- OmniDeck has an icon of its own, a white "O" on blue: on the program, its windows, the taskbar and
the installer.
### Changed
- Media: the Play/Pause button shows Pause while something plays.
- The roadmap is re-baselined: P2 started on 2 November 2026, as soon as P1 was done. The README,
the spec and the architecture notes now describe what P2 built.
### Fixed
- Media: in full screen the picture started a few pixels from the left edge of the screen. It now
fills the screen.
- Media: beside the queue, the seek bar shrank to almost nothing, and at the window's default size
the queue button was cut off. The seek bar now has a row of its own, and the volume slider gets
shorter before anything is cut off.
## [0.2.0-alpha.2] — 2026-11-02
Second P2 alpha: the media player and the bug report join the web apps of alpha.1. Pop-out windows
and the final polish come before 0.2.0.
### Added
- Media: play your own music and videos. Add files, a folder or an .m3u playlist, or drop them on the
player; the queue and where you stopped are kept for next time, and the queue can be saved as an
.m3u. OmniDeck keeps the player running while something plays, and frees its memory once it has
been paused and out of sight for a while. Its More menu picks the audio and subtitle tracks, adds
a subtitle file and sets its encoding, plays from a quarter to four times the speed, sends the
sound to another device, and saves a snapshot of the picture in Pictures\OmniDeck. A double-click
on the video, or its full-screen button, fills the screen, and Esc goes back. While something is
loaded, the tray menu names it and offers play or pause, next and previous.
- Report a bug from Settings → About, or from the dialog that shows an error. OmniDeck shows the
issue text first, then saves a report on this PC: the issue text, the version and Windows build,
the modules and the memory they use, the end of the log and, for a web app, its console. It then
opens a new GitHub issue in your browser with the short fields filled in. Nothing is sent: attach
the report yourself. Addresses keep no query, and tokens, cookies, email addresses, long ids and
your user name are taken out first. The ten newest reports are kept.
### Fixed
- A dialog that opened while a web app was on screen could hide behind the page. The page now steps
aside while a dialog is open.
## [0.2.0-alpha.1] — 2026-11-02
First P2 alpha, for trying the web apps out. The eight apps of the catalog run inside OmniDeck on
Microsoft Edge WebView2, with their notifications, site permissions and memory figures, and Weather
and Calendar join the built-in modules. The bug report, Media, pop-out windows and the final polish
arrive in the next alphas.
### Added
- Weather: forecasts from Open-Meteo for the places you save, found by searching for a city. It
shows the conditions now, the next 48 hours and the next 7 days, in the units your region uses or
the ones you pick. A forecast is fetched again at most every half hour, and only while Weather is
on screen; without a connection it shows the last forecast and says how old it is.
- Calendar: your own events in a month grid, a week list or a 30-day agenda, with repeats (daily,
weekly, monthly or yearly, every so many, until a date) and reminders, which appear while OmniDeck
is running. Import and export .ics files; repeats written by other calendar apps are kept as they
are. One date of a series can be deleted without touching the rest.
- OmniDeck keeps its list of web apps up to date: once a day it checks the list in this repository and,
when there is a newer valid one, uses it from the next start.
- Web apps: Spotify, Discord, YouTube, Gmail, Google Calendar, Google Drive, Google Maps and Facebook
open inside OmniDeck like the built-in modules. The Google apps share one sign-in; every other app
keeps its own. A link to another site opens in your default browser, while sign-in popups stay in
the app. A web app that sleeps or is closed down to save memory comes back on the page it showed;
one whose page crashes reloads by itself. Downloads go to your Downloads folder.
- Web app notifications appear as Windows notifications under the app's name. Clicking one opens the
app on what it was about. Settings → Web apps turns them on or off for each app. An app with
notifications on keeps running while hidden, so it can still notify you; OmniDeck closes it only
when memory runs short, and tells you when it does.
- When a web app asks for your camera, microphone, location, clipboard or a similar permission,
OmniDeck asks you above the app and remembers your answer for that app. Settings → Web apps lists
the answers, lets an app ask again, and clears a group of apps' sign-in data.
### Changed
- Clicking a notification opens the module that raised it: a finished timer opens Timer.
- Settings → Memory shows what each open web app uses, and the browser processes they share in a row
of their own. The memory limits count the web apps' processes too. When OmniDeck must free memory,
it picks the app that uses more among those hidden for as long. When the shared processes alone
keep it over the limit, OmniDeck says so instead of closing apps that would free nothing.
- Quitting closes every open module first, so each one can save its state before OmniDeck exits. With
web apps open, it also waits a moment for the browser to save its cookies, so you stay signed in.
- OmniDeck re-styles its windows only when Windows' dark or light mode, accent color, High Contrast or
animation setting changes, not on every settings broadcast from Windows.
## [0.1.1] — 2026-11-02
A fix release for 0.1.0. Picking accent colors, or Windows changing a theme setting, could make
OmniDeck run out of Windows graphics handles, show "A generic error occurred in GDI+" over and over,
and stop drawing its window. Installed copies find this update in Settings → About, and say so in a
notification within a day.
### Fixed
- Changing the accent color no longer ends in "Something went wrong… A generic error occurred in
GDI+". The notification-area icon leaked a Windows graphics handle every time it was redrawn in a
new color, and each change redrew it more often than the last, so after enough color or theme
changes OmniDeck ran out of handles and could stop drawing its window. The icon is now drawn by
OmniDeck itself and redrawn only when the color actually changes.
- Toggle switches take a newly picked accent color at once. Before, they kept the previous color
until the next change.
- An error that keeps repeating is now reported once a minute, with a count of the repeats, instead
of every time, so a single fault can no longer stack error dialogs or fill the logs.
- Logs are kept for seven days, as the privacy policy says. Before, a burst of errors could push out
the whole week of logs before it.
## [0.1.0] — 2026-10-30
The first installable OmniDeck, closing phase P1. It brings the shell with its sidebar, module
library, command palette and notification-area icon, plus the RAM governor and its panel. It also
has the clock, timer and calculator, the settings, legal documents and onboarding, and updates from
inside the app. The 0.1.0-alpha.1 and 0.1.0-alpha.2 notes list all of it in detail. Web apps,
weather, calendar, stocks and media arrive in P2 and P3.
### Added
- Keyboard shortcuts: Ctrl+1 to Ctrl+9 open the modules in the sidebar, in order, and Ctrl+, opens
Settings; Ctrl+K still opens the command palette.
- Installed copies check for updates a few minutes after starting and then once a day, and say so in
a notification when a new version is out. Opening Settings → About checks too. Nothing downloads
until you choose to.
### Changed
- The sidebar follows the layout preset as you switch: Dynamic shows icons only, with each name in a
tooltip, and Comfort shows at most six modules, always including the one on screen.
### Fixed
- The command palette shrinks to fit a short list of results.
- With High Contrast on, Windows' colors win over a custom accent color.
- Lines and borders in the legal documents follow the theme, High Contrast included.
- Screen readers announce the layout presets and settings choices by their names.
## [0.1.0-alpha.2] — 2026-10-30
Second alpha: the settings pages, the legal gate and onboarding. It is also the first build that can
update itself. 0.1.0-alpha.1 cannot, so install this one over it with its `Setup.exe` and choose to
overwrite; your settings and data stay. From here on, Settings → About → Check for updates finds new
releases.
### Added
- First run: the license agreement, disclaimer, privacy policy and third-party notices, shown from the
app's `legal` folder, to acknowledge before OmniDeck opens (again after each legal update). Then a
short setup picks the language and the layout preset.
- Settings: General (language, keep running in the notification area, start with Windows), Appearance
(theme, layout preset, text size, animations, accent color), Memory (the governor's thresholds and
the running modules), Data (open the data folder, export and import settings) and About (version,
update check, links, the legal documents).
- Starting with Windows opens OmniDeck straight to the notification area.
### Changed
- Running modules moved from the sidebar into Settings → Memory; the command palette opens it too.
## [0.1.0-alpha.1] — 2026-10-30
First alpha, for trying OmniDeck out: the shell, the RAM governor and three built-in modules. Web
apps, weather, calendar, stocks and media arrive in P2–P3, and the settings pages, legal gate and
onboarding in the next alpha.
### Added
- One OmniDeck per Windows session: starting it again brings the running window to the front.
- Settings stored in `%LocalAppData%\OmniDeck.Data\settings.json`, written atomically. A damaged
file is set aside and defaults take over.
- Local log files in `%LocalAppData%\OmniDeck.Data\logs`, kept for seven days, plus crash handling
that shows a support code and keeps OmniDeck running.
- Uninstalling removes `%LocalAppData%\OmniDeck.Data`, as the privacy policy promises.
- A local database, `%LocalAppData%\OmniDeck.Data\omnideck.db`, with a versioned schema that
upgrades itself at startup.
- The window follows Windows: light or dark mode, the accent color, High Contrast and the text size.
- The shell: a sidebar with pinned and open modules, a module library to open and pin them from,
and a command palette (Ctrl+K, or the search box in the title bar) that finds modules and commands.
- Closing the window keeps OmniDeck running in the notification area; its icon's menu opens or quits
it. Modules can raise Windows notifications from there.
- The RAM governor: modules hidden for 5 minutes are suspended and after 30 minutes hibernated.
Above a soft memory limit the least recently used one is hibernated; above a hard limit as many as
it takes, with a notification. The limits default to min(4.5 GB, 35 % of RAM) and min(6 GB, 50 %).
- Running modules (the sidebar's Memory item): every module's state and last use, memory in use
against the limits, and Suspend, Hibernate, Close and Keep running controls.
- Clock: local time and any number of world clocks, in 12- or 24-hour time, with each zone's offset
from here. The zones are remembered.
- Timer: countdowns with presets (1, 5, 10 and 25 minutes) or a custom length and name, and a
stopwatch with laps. A finished countdown raises a Windows notification, also from the
notification area, and the tray menu starts a 5-minute timer. Timers run only while OmniDeck
runs, as the module says.
- Calculator: standard and scientific keypads (degrees or radians), keyboard input, the session's
history, and copying the result.
### Changed
- Stocks: Twelve Data with the user's own API key is now the only provider. Stooq was dropped because
its download endpoints now block scripted clients (P0 spike #7). The free Twelve Data plan covers US
listings; home-market EU listings and indices need a paid plan.
- Legal documents (EULA, disclaimer, privacy policy) are now version 1.1, and the third-party notices
follow: Stooq and Messenger are no longer mentioned.
### Removed
- Messenger from the web app catalog: Meta closed messenger.com on 15 April 2026 and sends web
users to `facebook.com/messages`, which the Facebook entry already covers.
@@ -34,5 +330,15 @@ 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.0.1-alpha.1...HEAD
[Unreleased]: https://github.com/poli0981/OmniDeck/compare/v0.3.0-alpha.1...HEAD
[0.3.0-alpha.1]: https://github.com/poli0981/OmniDeck/compare/v0.2.0...v0.3.0-alpha.1
[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
[0.1.1]: https://github.com/poli0981/OmniDeck/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/poli0981/OmniDeck/compare/v0.1.0-alpha.2...v0.1.0
[0.1.0-alpha.2]: https://github.com/poli0981/OmniDeck/compare/v0.1.0-alpha.1...v0.1.0-alpha.2
[0.1.0-alpha.1]: https://github.com/poli0981/OmniDeck/compare/v0.0.1-alpha.1...v0.1.0-alpha.1
[0.0.1-alpha.1]: https://github.com/poli0981/OmniDeck/releases/tag/v0.0.1-alpha.1
+9 -6
View File
@@ -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 đã merge (#58–#69) và ra 0.3.0-alpha.1 (03/11/2026) để dogfood; Legal 1.2 ở #70 (người dùng merge trước tag v0.3.0), 0.3.0 ra sau đợt dogfood; lịch và các mốc ở `docs/ROADMAP.md`.
## 2. Luật vàng (KHÔNG được vi phạm)
@@ -26,21 +26,22 @@
- **.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
- i18n: `.resx` EN (neutral) / VI / JA; view model dựng chuỗi trong code phải đọc lại khi đổi ngôn ngữ (`OdLocalization.FollowCulture`), danh sách chọn đổi chữ tại chỗ (`OdLocalizedOption`); luật dịch và bảng thuật ngữ ở `docs/TRANSLATING.md`
- Accessibility: tên cho mọi control và mọi hàng (`{res:OdLocRow …}`), dòng trạng thái là `OdStatusText`; kiểm bằng `scripts/od-drive.ps1 -Action audit` (`docs/WPFUI-CONVENTIONS.md` §7)
## 4. Bố cục
```
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 +54,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`).
@@ -85,6 +87,7 @@ Required checks trên `main`: `build`, `package`, `catalog`, `lint`, `Analyze (c
| `docs/UI-MODES.md` | Token `Od.*`, 3 preset |
| `docs/WPFUI-CONVENTIONS.md` | Cách dùng WPF-UI |
| `docs/WEBAPP-CATALOG.md` | Schema + luật review catalog |
| `docs/TRANSLATING.md` | Luật dịch, cách app đổi ngôn ngữ, thuật ngữ VI/JA |
| `docs/ROADMAP.md` | Phase P0–P4, version, rủi ro |
| `docs/legal/*` | EULA, Disclaimer, Privacy, Third-party notices (ship trong app) |
| `README.md`, `CONTRIBUTING.md`, `SECURITY.md`, `RELEASING.md`, `CHANGELOG.md` | Tài liệu công khai |
+13 -4
View File
@@ -19,6 +19,15 @@ dotnet test OmniDeck.slnx
dotnet run --project src/OmniDeck.App
```
To run a development build beside an installed OmniDeck, give it a data root of its own. Only Debug builds read the variable, so the installed copy keeps its settings, sign-ins and database, and the two run side by side:
```powershell
$env:OMNIDECK_DATA_ROOT = "$env:TEMP\OmniDeck.Dev"
dotnet run --project src/OmniDeck.App
```
`scripts/od-drive.ps1` drives such a build through UI Automation, without the mouse or the keyboard: it opens a module through the palette, invokes a button by name, saves a screenshot, or audits a screen for what screen readers would trip on (`-Action audit`). It is a development tool; CI does not run it.
## Code style & quality gates (enforced in CI)
- `.editorconfig` is authoritative. `dotnet format OmniDeck.slnx --verify-no-changes` must pass.
@@ -34,16 +43,16 @@ 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, VI, JA). Never concatenate localized fragments; use format placeholders. Text a view model builds in code reads its strings again on a change of language (`OdLocalization.FollowCulture`). See [TRANSLATING](docs/TRANSLATING.md) for the rules, and for translating.
- 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
Prefer the in-app **About → Report bug** flow (from P2) — it captures the console errors and logs the template asks for. For web app issues, include the console errors it captured; "it doesn't work" without details is triaged last.
Prefer the in-app **Settings → About → Report a bug** flow — it captures the console errors and logs the template asks for. For web app issues, include the console errors it captured; "it doesn't work" without details is triaged last.
## Contact
+2 -2
View File
@@ -47,7 +47,7 @@
<RepositoryUrl>https://github.com/poli0981/OmniDeck</RepositoryUrl>
<PackageProjectUrl>https://github.com/poli0981/OmniDeck</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<Version>0.0.1-alpha.1</Version>
<Version>0.3.0-alpha.1</Version>
</PropertyGroup>
<!-- Build-time analyzers (warnings are errors). They live here rather than in each .csproj:
@@ -63,7 +63,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Meziantou.Analyzer" Version="3.0.317">
<PackageReference Include="Meziantou.Analyzer" Version="3.0.321">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
+2
View File
@@ -2,6 +2,8 @@
<Folder Name="/src/">
<Project Path="src/OmniDeck.App/OmniDeck.App.csproj" />
<Project Path="src/OmniDeck.Core/OmniDeck.Core.csproj" />
<Project Path="src/OmniDeck.Modules/OmniDeck.Modules.csproj" />
<Project Path="src/OmniDeck.Web/OmniDeck.Web.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/OmniDeck.Tests/OmniDeck.Tests.csproj" />
+15 -12
View File
@@ -2,7 +2,7 @@
> One deck for your everyday apps — a Windows 11 host for native mini-apps and curated web apps.
[![Status](https://img.shields.io/badge/status-pre--alpha-red)](docs/ROADMAP.md)
[![Status](https://img.shields.io/badge/status-alpha-orange)](docs/ROADMAP.md)
[![Platform](https://img.shields.io/badge/platform-Windows%2011%20x64-blue)](#install)
[![License](https://img.shields.io/badge/license-GPL--3.0-green)](LICENSE)
[![.NET](https://img.shields.io/badge/.NET-10%20LTS-purple)](https://dotnet.microsoft.com/)
@@ -13,40 +13,42 @@ 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: pre-alpha.** Development starts with phase P0 on 2 November 2026; the 0.9 public beta is planned for April 2027 and v1.0 for May 2027 ([roadmap](docs/ROADMAP.md)). Builds published before then are pipeline and development builds without the features below — follow along, but don't install them expecting a working app yet.
**Project status: alpha.** 0.3.0-alpha.1 (phase P3) adds Stocks with your own Twelve Data key, alarms, charts, the polished Dynamic and Comfort presets, an accessibility pass, and the Vietnamese and Japanese translations to 0.2.0's curated web apps, clock, timer, calculator, weather, calendar and media player. 0.3.0 follows once the alpha has been tried out; 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, stopwatch and alarms, 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)).
- **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)).
- **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. 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, 日本語.
- **Languages** — English, Tiếng Việt, 日本語, switched live from Settings.
- **Accessibility** — screen readers (Narrator, NVDA, JAWS), keyboard throughout, Windows text size and High Contrast.
## 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 requires DRM (Widevine) support in the WebView2 runtime. A P0 spike decides whether the entry ships; if DRM is unavailable, it ships disabled with an explanation (see the [ROADMAP](docs/ROADMAP.md) risk register).
- **Discord** web has no native global push-to-talk and limited screen sharing. OmniDeck provides a host-side global hotkey as partial mitigation.
- **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 (from P1 on), 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
Use **About → Report bug** inside the app (from P2). It pre-fills a GitHub issue with the app version, OS build, active modules, and captured console errors from the affected web app, and saves a `bugreport-*.zip` (logs) to `%LocalAppData%\OmniDeck.Data\reports` that you can attach. Sensitive values (query strings, cookies, tokens) are scrubbed before packaging. You can also file manually with the [bug template](https://github.com/poli0981/OmniDeck/issues/new?template=bug_report.yml).
Use **Settings → About → Report a bug** inside the app, or **Report bug** on an error dialog. OmniDeck shows the report first, then saves a `bugreport-*.zip` to `%LocalAppData%\OmniDeck.Data\reports` (the issue text, the version and Windows build, the modules and their memory, the end of the log and, for a web app, its console), shows it in Explorer, and opens a GitHub issue with the short fields filled in. Nothing is uploaded: attach the zip yourself. Addresses lose their query strings, and tokens, cookies, email addresses, long ids and your user name are taken out first. You can also file manually with the [bug template](https://github.com/poli0981/OmniDeck/issues/new?template=bug_report.yml).
## Documentation
@@ -58,6 +60,7 @@ Use **About → Report bug** inside the app (from P2). It pre-fills a GitHub iss
| [UI-MODES](docs/UI-MODES.md) | Design tokens and the three presets |
| [WPFUI-CONVENTIONS](docs/WPFUI-CONVENTIONS.md) | How the codebase uses WPF-UI: windows, controls, theming, navigation |
| [WEBAPP-CATALOG](docs/WEBAPP-CATALOG.md) | Catalog schema and how to propose new web apps |
| [TRANSLATING](docs/TRANSLATING.md) | How the translations work, and the Vietnamese and Japanese glossaries |
| [ROADMAP](docs/ROADMAP.md) | Phases P0–P4 to v1.0, versioning, risk register |
| [CHANGELOG](CHANGELOG.md) | Release history |
| [CONTRIBUTING](CONTRIBUTING.md) | Dev setup, code style, quality gates |
+1
View File
@@ -22,6 +22,7 @@ Releases are automated by [`release.yml`](.github/workflows/release.yml), trigge
- publishes and packages with Velopack (`scripts/pack.ps1`): self-contained `win-x64`, ReadyToRun, with the legal documents and the runtimes' notices;
- creates **build-provenance attestations** for `Setup.exe`, the portable zip, and this version's `.nupkg` files;
- uploads everything as a **draft** GitHub Release, attaches the **SPDX SBOM** (`sbom.spdx.json`) and **`checksums.txt`** (SHA-256 of every published asset), sets the release notes to this version's section of `CHANGELOG.md`, then **publishes** it — as a pre-release, or as the latest release for stable versions. Installed copies only see the update once every asset is in place;
- Installed copies offer pre-releases while a pre-release runs, or when the user turns on **Get pre-release versions** in Settings → About (`OdUpdateChannel`); a stable install offers stable releases only. Every release stays on Velopack's one `win` channel, so moving from a beta to 1.0 is an ordinary update.
- announces the release on Discord (`DISCORD_RELEASE_WEBHOOK`) with `.github/scripts/discord_notify.py`.
5. Check the release page: the assets are all there, and the attestation verifies:
+2 -2
View File
@@ -20,8 +20,8 @@ These are design requirements from the [SPEC](docs/SPEC.md); each one is enforce
- Per-user install, **no admin elevation anywhere** in the app.
- Web apps run only from the reviewed catalog: per-app navigation allowlists, per-app cookie profiles, SSO popups restricted to listed identity domains, everything else opens in your default browser.
- Release builds disable the WebView2 DevTools UI and browser password autosave/autofill; OmniDeck never sees or stores web credentials.
- The only secret the app stores (optional Twelve Data API key) is encrypted with Windows DPAPI, current-user scope.
- All service calls (Open-Meteo, Stooq, Twelve Data, GitHub) are HTTPS-only.
- The only secret the app stores (optional Twelve Data API key) is encrypted with Windows DPAPI, current-user scope. It travels only to Twelve Data, in a request header rather than in a web address, and never into a log or a bug report.
- All service calls (Open-Meteo, Twelve Data, GitHub) are HTTPS-only.
- Bug reports scrub query strings, cookie values, and token-shaped strings before packaging; nothing is ever uploaded automatically — you attach the zip yourself.
- No telemetry, no analytics, no crash auto-upload (see [PRIVACY](docs/legal/PRIVACY.md)).
+201 -5
View File
@@ -1,14 +1,205 @@
{
"$schema": "./webapps.schema.json",
"schemaVersion": 1,
"updated": "2026-10-30",
"schemaVersion": 2,
"updated": "2026-11-03",
"navAllowSets": {
"google-account-domains": [
"accounts.google.ad",
"accounts.google.ae",
"accounts.google.al",
"accounts.google.am",
"accounts.google.as",
"accounts.google.at",
"accounts.google.az",
"accounts.google.ba",
"accounts.google.be",
"accounts.google.bf",
"accounts.google.bg",
"accounts.google.bi",
"accounts.google.bj",
"accounts.google.bs",
"accounts.google.bt",
"accounts.google.by",
"accounts.google.ca",
"accounts.google.cat",
"accounts.google.cd",
"accounts.google.cf",
"accounts.google.cg",
"accounts.google.ch",
"accounts.google.ci",
"accounts.google.cl",
"accounts.google.cm",
"accounts.google.cn",
"accounts.google.co.ao",
"accounts.google.co.bw",
"accounts.google.co.ck",
"accounts.google.co.cr",
"accounts.google.co.id",
"accounts.google.co.il",
"accounts.google.co.in",
"accounts.google.co.jp",
"accounts.google.co.ke",
"accounts.google.co.kr",
"accounts.google.co.ls",
"accounts.google.co.ma",
"accounts.google.co.mz",
"accounts.google.co.nz",
"accounts.google.co.th",
"accounts.google.co.tz",
"accounts.google.co.ug",
"accounts.google.co.uk",
"accounts.google.co.uz",
"accounts.google.co.ve",
"accounts.google.co.vi",
"accounts.google.co.za",
"accounts.google.co.zm",
"accounts.google.co.zw",
"accounts.google.com.af",
"accounts.google.com.ag",
"accounts.google.com.ar",
"accounts.google.com.au",
"accounts.google.com.bd",
"accounts.google.com.bh",
"accounts.google.com.bn",
"accounts.google.com.bo",
"accounts.google.com.br",
"accounts.google.com.bz",
"accounts.google.com.co",
"accounts.google.com.cu",
"accounts.google.com.cy",
"accounts.google.com.do",
"accounts.google.com.ec",
"accounts.google.com.eg",
"accounts.google.com.et",
"accounts.google.com.fj",
"accounts.google.com.gh",
"accounts.google.com.gi",
"accounts.google.com.gt",
"accounts.google.com.hk",
"accounts.google.com.jm",
"accounts.google.com.kh",
"accounts.google.com.kw",
"accounts.google.com.lb",
"accounts.google.com.ly",
"accounts.google.com.mm",
"accounts.google.com.mt",
"accounts.google.com.mx",
"accounts.google.com.my",
"accounts.google.com.na",
"accounts.google.com.ng",
"accounts.google.com.ni",
"accounts.google.com.np",
"accounts.google.com.om",
"accounts.google.com.pa",
"accounts.google.com.pe",
"accounts.google.com.pg",
"accounts.google.com.ph",
"accounts.google.com.pk",
"accounts.google.com.pr",
"accounts.google.com.py",
"accounts.google.com.qa",
"accounts.google.com.sa",
"accounts.google.com.sb",
"accounts.google.com.sg",
"accounts.google.com.sl",
"accounts.google.com.sv",
"accounts.google.com.tj",
"accounts.google.com.tr",
"accounts.google.com.tw",
"accounts.google.com.ua",
"accounts.google.com.uy",
"accounts.google.com.vc",
"accounts.google.com.vn",
"accounts.google.cv",
"accounts.google.cz",
"accounts.google.de",
"accounts.google.dj",
"accounts.google.dk",
"accounts.google.dm",
"accounts.google.dz",
"accounts.google.ee",
"accounts.google.es",
"accounts.google.fi",
"accounts.google.fm",
"accounts.google.fr",
"accounts.google.ga",
"accounts.google.ge",
"accounts.google.gg",
"accounts.google.gl",
"accounts.google.gm",
"accounts.google.gr",
"accounts.google.gy",
"accounts.google.hn",
"accounts.google.hr",
"accounts.google.ht",
"accounts.google.hu",
"accounts.google.ie",
"accounts.google.im",
"accounts.google.iq",
"accounts.google.is",
"accounts.google.it",
"accounts.google.je",
"accounts.google.jo",
"accounts.google.kg",
"accounts.google.ki",
"accounts.google.kz",
"accounts.google.la",
"accounts.google.li",
"accounts.google.lk",
"accounts.google.lt",
"accounts.google.lu",
"accounts.google.lv",
"accounts.google.md",
"accounts.google.me",
"accounts.google.mg",
"accounts.google.mk",
"accounts.google.ml",
"accounts.google.mn",
"accounts.google.mu",
"accounts.google.mv",
"accounts.google.mw",
"accounts.google.ne",
"accounts.google.nl",
"accounts.google.no",
"accounts.google.nr",
"accounts.google.nu",
"accounts.google.pl",
"accounts.google.pn",
"accounts.google.ps",
"accounts.google.pt",
"accounts.google.ro",
"accounts.google.rs",
"accounts.google.ru",
"accounts.google.rw",
"accounts.google.sc",
"accounts.google.se",
"accounts.google.sh",
"accounts.google.si",
"accounts.google.sk",
"accounts.google.sm",
"accounts.google.sn",
"accounts.google.so",
"accounts.google.sr",
"accounts.google.st",
"accounts.google.td",
"accounts.google.tg",
"accounts.google.tl",
"accounts.google.tm",
"accounts.google.tn",
"accounts.google.to",
"accounts.google.tt",
"accounts.google.vu",
"accounts.google.ws"
]
},
"apps": [
{
"id": "spotify",
"name": "Spotify",
"startUrl": "https://open.spotify.com/",
"profile": "spotify",
"navAllow": ["spotify.com", "spotifycdn.com", "scdn.co"],
"navAllow": ["spotify.com", "spotifycdn.com", "scdn.co", "accounts.google.com", "www.facebook.com", "appleid.apple.com"],
"navAllowSets": ["google-account-domains"],
"popupAllow": ["accounts.spotify.com"],
"notifications": false,
"audioPin": true
@@ -21,7 +212,7 @@
"navAllow": ["discord.com", "discordapp.com", "discord.gg", "discordapp.net"],
"popupAllow": ["discord.com"],
"notifications": true,
"audioPin": false
"audioPin": true
},
{
"id": "youtube",
@@ -29,6 +220,7 @@
"startUrl": "https://www.youtube.com/",
"profile": "google",
"navAllow": ["youtube.com", "google.com", "googlevideo.com", "ytimg.com", "ggpht.com", "gstatic.com"],
"navAllowSets": ["google-account-domains"],
"popupAllow": ["accounts.google.com"],
"notifications": true,
"audioPin": true
@@ -39,6 +231,7 @@
"startUrl": "https://mail.google.com/",
"profile": "google",
"navAllow": ["google.com", "googleusercontent.com", "gstatic.com"],
"navAllowSets": ["google-account-domains"],
"popupAllow": ["accounts.google.com"],
"notifications": true,
"audioPin": false
@@ -49,6 +242,7 @@
"startUrl": "https://calendar.google.com/",
"profile": "google",
"navAllow": ["google.com", "googleusercontent.com", "gstatic.com"],
"navAllowSets": ["google-account-domains"],
"popupAllow": ["accounts.google.com"],
"notifications": true,
"audioPin": false
@@ -59,6 +253,7 @@
"startUrl": "https://drive.google.com/",
"profile": "google",
"navAllow": ["google.com", "googleusercontent.com", "gstatic.com"],
"navAllowSets": ["google-account-domains"],
"popupAllow": ["accounts.google.com"],
"notifications": true,
"audioPin": false
@@ -69,6 +264,7 @@
"startUrl": "https://www.google.com/maps",
"profile": "google",
"navAllow": ["google.com", "googleusercontent.com", "gstatic.com", "googleapis.com"],
"navAllowSets": ["google-account-domains"],
"popupAllow": ["accounts.google.com"],
"notifications": false,
"audioPin": false
@@ -81,7 +277,7 @@
"navAllow": ["facebook.com", "fbcdn.net", "fbsbx.com"],
"popupAllow": ["facebook.com"],
"notifications": true,
"audioPin": false
"audioPin": true
}
]
}
+19 -1
View File
@@ -11,13 +11,24 @@
"description": "Editor hint pointing at this schema; ignored by the app."
},
"schemaVersion": {
"const": 1
"const": 2
},
"updated": {
"type": "string",
"description": "Date of the last content change (yyyy-MM-dd).",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"navAllowSets": {
"type": "object",
"description": "Named lists of domains that entries add to their navAllow by name, for lists too long to repeat in each entry.",
"propertyNames": { "$ref": "#/$defs/slug" },
"additionalProperties": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "$ref": "#/$defs/domain" }
}
},
"apps": {
"type": "array",
"minItems": 1,
@@ -67,6 +78,13 @@
"uniqueItems": true,
"items": { "$ref": "#/$defs/domain" }
},
"navAllowSets": {
"type": "array",
"description": "Names of top-level navAllowSets whose domains the main frame may also navigate to.",
"minItems": 1,
"uniqueItems": true,
"items": { "$ref": "#/$defs/slug" }
},
"popupAllow": {
"type": "array",
"description": "Domains whose popups open in-app on the same profile (SSO flows).",
+98 -24
View File
@@ -10,18 +10,22 @@ Directory.Build.props shared build settings: nullable, warnings as errors, anal
NuGet Audit, product metadata and dev-build version
global.json pinned .NET SDK
.config/ dotnet-tools.json: vpk, dotnet-sonarscanner, XamlStyler
scripts/ pack.ps1 (publish + Velopack), validate-catalog.ps1
scripts/ pack.ps1 (publish + Velopack), validate-catalog.ps1, make-icon.ps1,
od-drive.ps1 (drives and audits a development build; not in CI)
src/
OmniDeck.App/ WPF shell: windows, navigation, tray, command palette,
theme engine, legal gate, settings UI, task-manager panel
OmniDeck.Core/ contracts (IOdModule, IOdQuoteProvider, ...), RAM governor,
storage (SQLite/Dapper, settings), toast service,
bug-report composer, update service (Velopack), i18n helpers
OmniDeck.App/ WPF shell: windows, navigation, tray and notifications, command
palette, theme engine, legal gate, onboarding, settings UI,
task-manager panel, update service (Velopack)
OmniDeck.Core/ contracts (IOdModule, IOdNotifier, IOdSecretStore, ...), module
host, RAM governor, storage (SQLite/Dapper, settings), theme
tokens and contrast, legal acknowledgment, bug-report composer,
i18n (OdLocalization, OdLocRow, OdLanguages), live regions
OmniDeck.Modules/ built-in mini-apps: Clock, Timer, Calculator, Weather,
Calendar, Stocks, Media — one folder per module (P1)
Calendar, Stocks, Media — one folder per module (P1),
and Charts, the charts they draw themselves (P3)
OmniDeck.Web/ web runner: environment/profile management, catalog loader,
navigation policy, notifications bridge, permissions,
downloads, CDP console capture (P2)
sign-in health, CDP console capture (P2)
tests/
OmniDeck.Tests/ xUnit v3; governor state machine, providers, catalog validation,
scrubber, rate limiter
@@ -30,12 +34,14 @@ catalog/
webapps.schema.json its JSON Schema (CI validation, editor completion)
```
State at kickoff: `OmniDeck.App` (Velopack bootstrap + a placeholder `FluentWindow`), `OmniDeck.Core` (`OdVersionInfo`) and `OmniDeck.Tests` exist. `OmniDeck.Modules` and `OmniDeck.Web` are created when their first real code lands (P1/P2), so the build never carries empty projects.
State at kickoff: `OmniDeck.App` (Velopack bootstrap + a placeholder `FluentWindow`), `OmniDeck.Core` (`OdVersionInfo`) and `OmniDeck.Tests` exist. `OmniDeck.Modules` and `OmniDeck.Web` are created when their first real code lands (P1/P2), so the build never carries empty projects. `OmniDeck.Modules` arrived in P1 with Clock, Timer and Calculator: it references Core (and WPF-UI for its views) but never the app, registers its modules with `AddOmniDeckModules()`, and keeps its own string table. `OmniDeck.Web` arrived in P2 the same way: it references Core, the WebView2 SDK and WPF-UI but never the app or `OmniDeck.Modules`, and `AddOmniDeckWeb(catalog, options)` registers the catalog service, the runtime and one module per catalog entry, after the built-in modules. Durable module state lives outside the views, in a service (`OdTimerService`), a view model the module keeps (the calculator's history), or the module's settings document (the clock's zones), so hibernating a view loses nothing.
Naming: namespace `OmniDeck.*`, public type prefix `Od*` (`OdModuleHost`, `OdRamGovernor`, `OdWebRunner`, `OdCatalogEntry`), interfaces `IOd*`. The WPF application class is `OdApp` (`OdApp.xaml`), started from `Program.Main` after Velopack's hooks; the executable is `OmniDeck.exe`.
Patterns: MVVM via CommunityToolkit.Mvvm; constructor DI via `Microsoft.Extensions.DependencyInjection`; no service locator.
Startup, as built in P1: `Program.Main` runs Velopack's hooks first (the uninstall hook deletes the data root), then the single-instance guard: a session-local mutex, and a second launch signals the first to show its window and exits. `OdApp` builds the container (`ServiceCollection` with `ValidateOnBuild`), installs the crash handler and starts the theme engine. It then shows the legal gate when the acknowledged legal version is not the current one, and onboarding on first run. Next it creates the main window, which owns the tray icon and therefore exists even when Windows starts OmniDeck in the tray (`--minimized`). Last come the governor and the daily update check. Shutdown is explicit: closing the window hides it in the tray unless the user turned that off, and otherwise only Quit ends the process. Notifications are tray balloons behind `IOdNotifier`, which Windows 11 shows as toasts, so the app needs no Windows-specific target framework or WinRT projection. The tray icon's image, a bold "O" on the accent color, is drawn in code (`OdTrayIcon`) and loaded from ICO bytes so that it owns its handle. H.NotifyIcon's `GeneratedIconSource` is avoided: in 2.4.1 it leaks an icon handle on every redraw and adds a redraw handler on every brush change, which used up the process's GDI objects after a few accent changes (fixed in 0.1.1). The Velopack update service lives in the app, because Core must not reference Velopack.
## 2. Module contract
```csharp
@@ -44,7 +50,7 @@ public enum OdModuleState { Created, Active, Idle, Suspended, Hibernated, Closed
public interface IOdModule
{
OdModuleInfo Info { get; } // Id, Name, Icon, Category, RamClass
OdModuleInfo Info { get; } // Id, NameKey, Icon, CategoryKey, RamClass
FrameworkElement CreateView(); // called on Activate after hibernation
Task InitializeAsync(IOdModuleContext ctx); // once per process lifetime
Task ActivateAsync(); // became visible
@@ -55,43 +61,111 @@ public interface IOdModule
}
```
`IOdModuleContext` gives modules storage (scoped SQLite access + settings section), the toast service, logger, and the HTTP client factory — modules never construct these themselves.
`IOdModuleContext` gives modules their own settings document (one JSON row per module in the `module_settings` table), the notifier (tray balloons, which Windows 11 shows as toasts; clicking one opens the module that raised it), a logger, the clock, the shared HTTP client and the database for the module's own tables. The HTTP client (`OdHttp`) is one `HttpClient` for OmniDeck's own features: it names OmniDeck in its User-Agent, keeps no cookies and gives up after 15 seconds. Module tables are migrated with Core's migrations, so one schema version covers the database. Modules never construct these themselves. Quitting closes every open module first (`OdModuleHost.CloseAllAsync`), so each one can save its state and let go of what it holds.
`CreateView()` returns a WPF `FrameworkElement`, so wherever `IOdModule` lives must reference WPF. P1 decides between letting `OmniDeck.Core` take that dependency (it already targets `net10.0-windows`) and moving the contract into a small WPF-aware abstractions project.
`CreateView()` returns a WPF `FrameworkElement`, so wherever `IOdModule` lives must reference WPF. P1 decided to let `OmniDeck.Core` take that dependency (`UseWPF`) rather than add an abstractions project. Core holds the contract, `OdModuleHost` and the localization layer (`OdLocalization`, `{res:OdLoc Key}`), so modules depend on Core alone; Core still never references the app, Velopack or WPF-UI (an architecture test checks it), which is why `OdModuleInfo.Icon` is a `SymbolRegular` name rather than a symbol.
`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;
- hides the title bar;
- folds the navigation pane to zero width. Changing its display mode would re-template the navigation view and re-create the stage, and with it any native child window;
- sets `OdFullscreen.IsActive` on the stage, which views inherit.
Esc, hiding to the tray, or showing another module ends it. A module that plays media implements `IOdMediaControls`, which the tray menu uses while something is loaded.
A module can also show in a window of its own (`OdPopOutWindow`), opened from its sidebar menu or its library tile:
- The host keeps the module active there (`OdModuleHost.PopOutAsync`), so the governor leaves it alone. If the main window showed it, the main window shows the library instead. Asking for the module again brings its window to the front.
- The view itself moves, so a web app's browser and a video keep running: WPF re-parents their native windows rather than creating new ones. Spike #6's hand-over to a second video view, with its track re-selection and seek, is not needed.
- Closing the window docks the module back into the main window, hidden (`DockAsync`), and the time ladder applies again. "Return to main window" in the sidebar menu also shows it there.
- Before closing, the window lets go of the view and hands the windows it still owns to the main window. LibVLCSharp's video overlay is owned by the window its video is in and would otherwise close for good with it.
- A pop-out goes full screen as the main window does, and opens where it was last time in the session.
Native modules run in-process. True RAM release for them means honoring `SuspendAsync`/`HibernateAsync`: dispose charts, bitmaps, timers, caches; the governor follows up with a GC. Web modules get real process-level release for free because WebView2 is out-of-process by design.
## 3. Web runner internals
- **Environment:** one `CoreWebView2Environment` for the whole app → browser/GPU processes are shared across web apps. Created lazily on first web app open.
- **Profiles:** `CoreWebView2Profile` per catalog `profile` value. `google` is shared (one sign-in for Gmail/Calendar/Drive/Maps/YouTube); every other app is isolated. Cookies live in the profile, which is what lets **hibernate = full dispose** without losing sessions.
- **Per-app pipeline on creation:** apply settings (`AreDevToolsEnabled=false` in Release, `IsPasswordAutosaveEnabled=false`, `IsGeneralAutofillEnabled=false`) → attach `NavigationStarting` (navAllow suffix check) → `NewWindowRequested` (popupAllow → in-app popup on same profile; else default browser) → `PermissionRequested` → `NotificationReceived` → `DownloadStarting` → start CDP console capture (`Runtime.enable`, `Log.enable`).
- **Suspend path:** hide the control → `TrySuspendAsync()` → set `MemoryUsageTargetLevel = Low`. **Resume:** set target `Normal`, show; WebView2 resumes automatically on visibility.
- **Hibernate path:** persist `{ url }`, `Dispose()` the control and `CoreWebView2`. Reopen = new control on the same profile navigating to the saved URL.
- **Catalog refresh:** at most daily, fetch `catalog/webapps.json` from this repo's raw URL over HTTPS; validate against schema version; on any validation failure keep the bundled copy.
As built in P2 (`OmniDeck.Web`):
- **Environment** (`OdWebRuntime`): one `CoreWebView2Environment` for the whole app, so the browser and GPU processes are shared across web apps. It is created when the first web app opens, with its user data folder in the data root's `WebView2\` folder. The runtime counts open browsers: after the last one closes, the shared browser process exits and writes its cookies out, and a web app opened meanwhile waits for that exit (up to 3 s), because a controller created during it stalls for seconds (docs/spikes/03-memory.md). Quitting closes every module, then waits the same way before the process ends. Without an installed WebView2 Runtime, a web app shows a notice whose button opens Microsoft's download page.
- **Profiles:** one WebView2 profile per catalog `profile` value (`CoreWebView2ControllerOptions.ProfileName`). `google` is shared (one sign-in for Gmail/Calendar/Drive/Maps/YouTube); every other app is isolated. Cookies live in the profile, which is what lets **hibernate = full dispose** without losing sessions.
- **Modules:** each catalog entry is an `OdWebAppModule` (Heavy, titled with the brand name, which is never translated). Its view (`OdWebAppView`) hosts the WPF `WebView2` control; notices sit above the browser rather than over it, because no WPF element can cover the browser's native window.
- **Per-app pipeline on creation:** apply settings (`AreDevToolsEnabled=false` in Release, `IsPasswordAutosaveEnabled=false`, `IsGeneralAutofillEnabled=false`) → attach `NavigationStarting` → `NewWindowRequested` → `ProcessFailed` → `ContainsFullScreenElementChanged` → `NotificationReceived` → `PermissionRequested` → start the CDP console capture → navigate.
- **Navigation policy** (`OdNavPolicy`, a pure function of the entry and the catalog): a main-frame navigation stays in the app when it is HTTPS to a host that `navAllow` or one of the entry's `navAllowSets` covers (whole-label suffix match, case-insensitive), or an `about:`, `data:` or `blob:` page. Other web and `mailto:` links open in the default browser; every other scheme is blocked and only the scheme is logged. Frames inside a page are not filtered. A popup (`NewWindowRequested`) to a `popupAllow` host opens in an in-app window (`OdWebPopupWindow`) on the same profile, so a sign-in popup lands in the app's cookies; any other popup goes to the default browser.
- **Link loop guard** (`OdExternalLinks`): the same link (scheme, host and path) opens in the browser at most 3 times in 30 s; after that it is held back and the app shows a notice, once per 30 s. In P0, Google retried a blocked sign-in hop 15 times in 40 seconds (docs/spikes/02-google-sign-in.md).
- **Suspend path:** set `MemoryUsageTargetLevel = Low` → `TrySuspendAsync()` (WebView2 refuses while the control is visible; that is logged at Debug). **Resume:** set target `Normal`, and `Resume()` if still suspended.
- **Hibernate path:** the module keeps the page on screen in memory, then disposes the control, which releases the app's processes. Reopening creates a new control on the same profile and navigates to that page. Closing the module forgets the page, and so does a restart: the next session opens `startUrl`.
- **Crash recovery:** `ProcessFailed` for the page or the browser reloads the app once, on the page it showed; a second failure within a minute shows a notice with a Reload button instead. Frame, GPU and helper process failures recover on their own and are only logged.
- **Full screen:** when the page shows something full screen (a video, say), the view asks for the window's full screen (§2). When the window leaves it first (Esc, another module), the page is told to leave too (`document.exitFullscreen()`).
- **Console capture:** CDP `Runtime.consoleAPICalled`, `Runtime.exceptionThrown` and `Log.entryAdded` feed two rings kept by the module (`OdConsoleLog`: the last 200 entries and the last 50 errors), so they survive hibernation. They are formatted like DevTools (`%s`, `%d`, `%c`), held only for the session, and are there for the bug report.
- **Notifications:** `NotificationReceived` is always marked handled, so WebView2 never shows its own notification window.
- When the app's notifications are on, the notification becomes a tray notification: "‹App›: ‹title›" with the body below, cut to what a balloon holds. That switch is in Settings → Web apps and defaults to the catalog's `notifications`.
- Then `ReportShown` runs. Clicking the notification opens the app and calls `ReportClicked`, so the page can open the conversation.
- The Notifications permission follows the same switch, without asking.
- An app with notifications on is resident: the governor never suspends it for being hidden (RAM-GOVERNOR.md §3).
- Only non-persistent notifications (`new Notification(...)` from a page) reach WebView2's event. Service-worker push does not.
- **Permissions** (`OdWebPermissions`, `OdWebPreferences`):
- Kinds that reach the user's devices or data are asked about once per app: camera, microphone, location, clipboard reading, motion sensors, several downloads at once, file access, local fonts, MIDI system-exclusive messages and window placement.
- The question shows in a bar above the browser, because a content dialog cannot cover the browser's native window. The page waits on a deferral until the user answers.
- The answer is kept in `settings.json` (`web.apps.<id>.permissions`). `SavesInProfile` is false, so the profile keeps no answers of its own.
- Autoplay and persistent storage are left to the browser. Any other kind is refused.
- Settings → Web apps lists each app's answers; "Ask again" forgets them.
- **Downloads:** WebView2's own download flyout. It saves to the user's Downloads folder and handles SmartScreen verdicts and dangerous-file prompts, which a download row of OmniDeck's own would have to repeat.
- **Clearing data:** Settings → Web apps → Clear data, per profile group:
- It closes the group's apps, then clears the profile's browsing data (`ClearBrowsingDataAsync`) through a hidden browser on that profile, hosted by the main window.
- It also tells sign-in health that an empty profile is expected.
- **Sign-in health** (`OdSignInHealth`): when an app closes or hibernates, and at the first load of each profile in a session, it counts the cookies the profile holds for the app's start page (the number only, never a name or value), keeps the count in `app_meta` (`web.cookies.<profile>`) and logs it. A profile that had cookies at the last close and comes back with none is logged as a warning. Starting OmniDeck with `--wv2-logging` also turns on Chromium's own logging (`--enable-logging --v=0`) in the WebView2 folder, for chasing a lost sign-in while dogfooding.
- **Catalog refresh** (`OdCatalogService`, as built in P2): each build carries the catalog as of its commit (`catalog\webapps.json` next to the executable), and the session uses the newer of that copy and the last one fetched (`%LocalAppData%\OmniDeck.Data\catalog\webapps.json`), by `updated`. A minute after startup, and then at most once a day, it fetches `main`'s copy from the repository's raw URL over HTTPS with `If-None-Match`. It parses strictly (unknown or missing properties are errors) and applies the same rules as `validate-catalog.ps1` (`OdCatalogValidator`, tested against the repository's file). A valid catalog replaces the last fetched one atomically and takes effect at the next start, so the modules on screen never change mid-session; anything else is logged and dropped. Requests are never retried before the next daily check.
## 4. RAM governor (summary — full spec in RAM-GOVERNOR.md)
A single scheduler owns all state transitions. Inputs: per-module visibility + last-interaction time, pin status (`CanSuspendAsync` / `IsDocumentPlayingAudio`), and total footprint = shell `Process.WorkingSet64` + `CoreWebView2Environment.GetProcessInfos()` working sets. Policies: idle timers demote Active→Idle→Suspended→Hibernated; soft cap demotes LRU modules early; hard cap force-hibernates and toasts. The task-manager panel is a read/write view over the same scheduler (manual suspend/kill).
A single scheduler owns all state transitions. Inputs: per-module visibility + last-interaction time, pin status (`CanSuspendAsync` / `IsDocumentPlayingAudio`), and total footprint = private commit (`Process.PrivateMemorySize64`) of the shell plus the WebView2 processes, which the web runner reports per app (`IOdMemoryReporter`, renderers matched to apps through `GetProcessExtendedInfosAsync`) with the browser, GPU and utility processes as one shared figure. Policies: idle timers demote Active→Idle→Suspended→Hibernated; soft cap demotes LRU modules early; hard cap force-hibernates and toasts. The task-manager panel is a read/write view over the same scheduler (manual suspend/kill). In code: `OdRamGovernor` in `OmniDeck.Core/Governor`, polling every 10 s on the UI thread through `OdModuleHost`, behind `IOdMemory` so tests drive it with a fake gauge and `FakeTimeProvider`.
## 5. Storage
All app data lives under the **data root** `%LocalAppData%\OmniDeck.Data`:
- `omnideck.db` — SQLite via Dapper. Tables per module (`calendar_events`, `stocks_watchlist`, `stocks_quotes_cache`, `weather_cache`, `media_playlists`, …) plus `app_meta` (legal acknowledgment, schema version). Migrations = ordered idempotent SQL scripts executed at startup.
- `omnideck.db` — SQLite via Dapper. Tables per module (`calendar_events`, `stocks_quotes_cache`, `stocks_series_cache`, `weather_cache`, `media_playlists`, …; the stocks watchlist lives in the module's settings document) plus `app_meta` (legal acknowledgment, schema version). Migrations = ordered idempotent SQL scripts executed at startup.
- `settings.json` — typed settings tree; import/export from the Data settings page.
- `WebView2\` — the WebView2 user data folder (profiles, cookies, caches).
- `logs\`, `reports\` — Serilog rolling files and bug-report zips.
- Secrets: only the optional Twelve Data key, encrypted with DPAPI (`ProtectedData`, CurrentUser scope).
- Secrets: only the optional Twelve Data key, encrypted with DPAPI (`ProtectedData`, CurrentUser scope, OmniDeck's own entropy) in `secrets\twelvedata.bin` by `IOdSecretStore`. It is not in `settings.json`, so a settings export never carries it, and the scrubber takes `Authorization: apikey` values out of bug reports.
Why not `%LocalAppData%\OmniDeck`: that is Velopack's install folder (packId `OmniDeck`). Velopack deletes it entirely on uninstall and when Setup is run again over an existing install, so nothing the user owns may live there. The data root is a sibling folder that survives updates and reinstalls; the Velopack uninstall hook (`VelopackApp.Build().OnBeforeUninstallFastCallback`, P1) deletes it on uninstall, as PRIVACY promises. It is local, not roaming, because WebView2 caches can reach several GiB.
## 6. Logging & failure handling
Serilog rolling files (7-day retention). Global handlers (`DispatcherUnhandledException`, `AppDomain.UnhandledException`, `TaskScheduler.UnobservedTaskException`) log, show a friendly dialog, and offer the bug-report flow. `CoreWebView2.ProcessFailed` triggers an automatic single reload of that app before surfacing an error tab.
Serilog rolling files, kept for 7 days by age (a burst of errors rolls a new file every 10 MB, so a file count alone could push out the week before it). Global handlers (`DispatcherUnhandledException`, `AppDomain.UnhandledException`, `TaskScheduler.UnobservedTaskException`) log, show a friendly dialog, and offer the bug-report flow. A failure that repeats is reported once a minute, with the number of repeats in between, so one fault in a loop can neither stack dialogs nor flood the logs. When a web app's page or browser process fails, the app reloads once by itself; a second failure within a minute shows a notice with a Reload button (§3).
**Bug reports**, as built in P2. Two buttons open the same dialog: About → Report a bug, and Report bug on the error dialog, which also passes in the error it showed.
- **What the report holds:**
- OmniDeck's version and commit, Windows' version and build, and the UI preset;
- each module's state, how long it has been hidden, and the memory it uses;
- the last 500 lines of the logs;
- the sign-in cookie count of each profile;
- for a web app, its console capture.
- **Scrubbing** (`OdScrubber` in `OmniDeck.Core/Reports`, a pure function) runs over every file before it is written. It replaces the user's profile folder with `%USERPROFILE%`, cuts URLs back to scheme, host and path, and removes:
- cookie values;
- bearer tokens, JWTs, and long hex or base64 runs;
- email addresses;
- numeric ids of 15 digits or more.
- **Preview:** the dialog shows the issue text the report will carry. Picking another subject composes the report again.
- **On Save:**
- `OdBugReports` writes `reports\bugreport-‹stamp›.zip` (issue.md, system.json, logs.txt and console-‹app›.txt for a web app) and keeps the ten newest.
- File Explorer opens with the zip selected.
- The browser opens the bug form with only the short fields (version, Windows, preset, module) in its query.
- Nothing is uploaded (PRIVACY §3).
A content dialog cannot cover a web app's browser, which is a native window. So while any dialog is open, the main window hides the module stage, and with it the browser.
## 7. Updates & packaging
Velopack, per-user, GitHub Releases channel, delta updates; update check on About open and once per day in the background (notify-only, never auto-restart). Builds below 1.0 are GitHub pre-releases, so their update check includes pre-releases.
Velopack, per-user, GitHub Releases channel, delta updates. The package carries libVLC for the media player in `libvlc\win-x64` next to OmniDeck.exe (x64 only, with the plugin set in SPEC §3.6), and LibVLCSharp loads it on the first play. Update check on About open and once per day in the background (notify-only, never auto-restart). Builds below 1.0 are GitHub pre-releases, so their update check includes pre-releases. In code: `OdVelopackUpdateService` behind `IOdUpdateService`; Settings → About checks when opened and offers *Download and restart*, and `OdUpdateWatcher` checks a few minutes after start, then daily, and notifies once per new version. A development build is not installed, so it does neither.
Releases are built by [`release.yml`](../.github/workflows/release.yml), self-contained in this repository: a GPG-signed `vX.Y.Z[-suffix]` tag on `main` runs `scripts/pack.ps1` (self-contained `win-x64` publish + `vpk pack`), build-provenance attestations, a draft GitHub Release with an SPDX SBOM and SHA-256 checksums, release notes from CHANGELOG, publication, and a Discord announcement — see [RELEASING](../RELEASING.md). The WebView2 Runtime ships with Windows 11; if it is ever missing, Velopack's `--framework webview2` bootstrapper can install it (evaluate in P2).
Releases are built by [`release.yml`](../.github/workflows/release.yml), self-contained in this repository: a GPG-signed `vX.Y.Z[-suffix]` tag on `main` runs `scripts/pack.ps1` (self-contained `win-x64` publish + `vpk pack`), build-provenance attestations, a draft GitHub Release with an SPDX SBOM and SHA-256 checksums, release notes from CHANGELOG, publication, and a Discord announcement — see [RELEASING](../RELEASING.md). The WebView2 Runtime ships with Windows 11; if it is ever missing, a web app says so and links to Microsoft's download page (§3). Velopack's `--framework webview2` bootstrapper was considered in P2 and left out for that reason. The executable, its windows and Setup carry `src/OmniDeck.App/Assets/OmniDeck.ico`, drawn by `scripts/make-icon.ps1` until a designed icon replaces it.
+50 -13
View File
@@ -4,15 +4,19 @@ The governor is the feature that makes "many apps in one" viable. It moves every
## 1. State ladder
| State | Entered when | Native module | Web app | Typical web-app RAM |
| State | Entered when | Native module | Web app | Measured web-app cost (committed, P0 spike #3) |
|---|---|---|---|---|
| Active | visible / interacted | full UI | full WebView2 | 300–700 MB |
| Idle | hidden < `IdleAfter` | keep view, stop animations/timers | hidden, still live | unchanged |
| Suspended | hidden ≥ `IdleAfter` | `SuspendAsync`: drop caches, charts, bitmaps; GC follows | `TrySuspendAsync` + `MemoryUsageTargetLevel.Low` | tens of MB |
| Hibernated | hidden ≥ `HibernateAfter`, or cap pressure | `HibernateAsync`: view + everything released, tiny state blob kept | `Dispose()`; only `{url}` kept, session lives in profile cookies | ≈ 0 |
| Active | visible / interacted | full UI | full WebView2 | app 250–450 MB, plus 170–270 MB of shared browser, GPU and utility processes |
| Idle | hidden < `IdleAfter` | keep view, stop animations/timers | hidden, still live | 15–31 % less, as Chromium drops the hidden page's caches |
| Suspended | hidden ≥ `IdleAfter` | `SuspendAsync`: drop caches, charts, bitmaps; GC follows | `TrySuspendAsync` + `MemoryUsageTargetLevel.Low` | 85–95 % of Idle. The working set is trimmed by about 65 %, so this rung saves CPU and power, not memory |
| Hibernated | hidden ≥ `HibernateAfter`, or cap pressure | `HibernateAsync`: view + everything released, tiny state blob kept | `Dispose()`; only `{url}` kept, session lives in profile cookies | 0. Disposing the *last* web app also ends the shared processes |
| Closed | user closes | released | released | 0 |
Reactivation from Suspended is instant; from Hibernated it is a cold open (view rebuild / page reload) — acceptable because the profile keeps the user signed in.
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)
@@ -20,8 +24,8 @@ Reactivation from Suspended is instant; from Hibernated it is a cold open (view
|---|---|
| `IdleAfter` | 5 min hidden |
| `HibernateAfter` | 30 min hidden |
| `SoftCapBytes` | 4.5 GiB |
| `HardCapBytes` | 6.0 GiB |
| `SoftCapBytes` | min(4.5 GiB, 35 % of physical RAM) |
| `HardCapBytes` | min(6.0 GiB, 50 % of physical RAM) |
| `PollInterval` | 10 s |
## 3. Pinning
@@ -32,18 +36,34 @@ A module is **pinned** (governor must not demote it below its current state) whe
- the web app's `IsDocumentPlayingAudio` is true **and** its catalog entry has `audioPin: true` (Spotify, YouTube);
- the user pinned it manually in the task-manager panel.
A module that works while hidden is **resident** (`IOdResidency`): in P2, a web app with notifications on, which would stop notifying once suspended. The time ladder skips it; the caps may still hibernate it, after every other victim, and then OmniDeck shows a notification naming the app, which reopens it when clicked.
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 (`CoreWebView2Environment.GetProcessInfos()` → PID), sampled every `PollInterval`.
Total footprint = shell process + Σ all WebView2 processes, sampled every `PollInterval`.
**Metric — chosen by P0 spike #3.** Summing `Process.WorkingSet64` over-counts: Chromium processes share DLL and shared-memory pages, and each process reports them again. Working set also drops whenever pages are trimmed (for example by `MemoryUsageTargetLevel.Low`), so a working-set cap would reward exactly the page shuffling the honesty note below rejects. The spike compares private commit (`Process.PrivateMemorySize64`) with private working set and fixes one metric; the caps, the toasts, and the task-manager panel all use it.
**Metric: private commit** (`Process.PrivateMemorySize64`), summed over the shell and every WebView2 process. P0 spike #3 ([note](spikes/03-memory.md)) chose it for three reasons:
- Summing `Process.WorkingSet64` over-counts, because Chromium processes share DLL and shared-memory pages and each one reports them again.
- Working sets drop whenever pages are trimmed. Suspend + `Low` cut the private working set by 65–70 % but committed memory by only 5–15 %, so a working-set cap would reward exactly the page shuffling the honesty note below rejects.
- Private commit needs no process handle.
- **> SoftCap:** demote the least-recently-used unpinned module one step down the ladder; repeat next tick if still above.
- **> HardCap:** force-hibernate LRU unpinned modules until below, then raise one toast summarizing what was hibernated.
The caps, the toasts and the task-manager panel all use it. The panel may show the private working set beside it, since that is the figure Task Manager shows. Renderer processes are attributed to apps through `GetProcessExtendedInfosAsync`. The shared browser, GPU and utility processes form one "WebView2 (shared)" row and are never a demotion target.
Ordering hint: `RamClass.Heavy` modules (web apps, media, stocks charts) are preferred victims over `Light` ones at equal recency.
- **> SoftCap:** hibernate the least-recently-used unpinned module, since Suspended frees almost no memory. Repeat on the next tick if still above.
- **> HardCap:** force-hibernate LRU unpinned modules until below, then raise one toast summarizing what was hibernated. If the shared WebView2 processes alone keep the total above the cap (the GPU process grows with video), the toast says so instead of hibernating apps that would free nothing.
Ordering hint: `RamClass.Heavy` modules (web apps, media) are preferred victims over `Light` ones at equal recency. Recency counts in poll intervals, so modules hidden within the same interval are equally recent.
As built in P2:
- **Measuring.** `IOdMemory` measures the shell; every `IOdMemoryReporter` adds the processes it follows. The web runner's `OdWebMemoryReporter` lists the WebView2 processes with `GetProcessExtendedInfosAsync` on each pass. A renderer counts for the app whose page it hosts: matched by main frame id (`CoreWebView2.FrameId`), or by host when only one open app shows that host. A renderer hosting pages of several apps is split evenly between them. The browser, GPU and utility processes, and pages no open app shows, count as shared. A reporter that fails is left out of that pass.
- **Victim order:** resident modules last, then least recently used, then `Heavy` first, then the module that uses more.
- **After a hibernation:** a web app's processes take a moment to exit. The pass therefore counts its figure as gone at once (and the shared processes too, when it was the last web app), and the next pass measures again. This keeps the hard-cap loop from hibernating more apps than needed.
- **Shared processes at the hard cap:** the governor checks whether the shell, the shared processes and the web apps that are not victims (on screen, kept running, or refusing) are above the hard cap on their own. If they are, it hibernates nothing and its one notification for that excursion says why.
Honesty note: for in-process native modules the real win comes from modules *actually releasing* resources in `SuspendAsync`/`HibernateAsync`. The governor performs a `GC.Collect` + LOH compaction after demotions, and deliberately does **not** call `EmptyWorkingSet` tricks — those only shuffle pages to standby and fake the numbers.
@@ -51,6 +71,23 @@ Honesty note: for in-process native modules the real win comes from modules *act
Settings → Memory → "Running modules": live table of every module with state, memory estimate (the governor metric), last-used time, pin toggle, and Suspend / Hibernate / Close buttons. This is both a user feature and the primary debugging tool for the governor itself; the panel reads and writes the same scheduler, no side channel.
As built in P1, the panel sits in Settings → Memory under the threshold fields, and the command palette's "Running modules" opens it. Native modules share the shell process, so the panel shows OmniDeck's total against both caps rather than a per-module figure. Since P2, each open web app's row shows its own figure, and a "Shared web processes" row after the modules shows the shared ones. That row has no buttons, because the governor never demotes it. The pin toggle is labelled "Keep running", so it is not confused with pinning a module to the sidebar, and it is stored in `settings.json` (`memory.keepRunning`) next to the thresholds.
## 6. Testing
The scheduler is pure logic over an injected clock and an injected memory sampler — unit-test every transition, cap scenario, and pinning rule in `OmniDeck.Tests` without touching real WebView2.
**Resource soak, P2** (2 November 2026, Release build, one 2560×1440 monitor at 100 %):
- Idle on the library page, the shell held 103 MB of private commit, 32 GDI and 36 USER objects and 735 handles.
- 21 pop-out round trips (Clock into a window of its own and back) left the GDI and USER objects and handles flat after the first one: 39, 45 and 762.
- 21 page full-screen round trips on Discord's sign-in page also left them flat: 40, 49 and 798.
- With that page open, the seven WebView2 processes held 508 MB. The first full screen raised them to about 725 MB, mostly the GPU process's surfaces for the larger window, and they stayed there.
A signed-in day of use is the P2 exit's dogfooding ([ROADMAP](ROADMAP.md) §1).
**Resource soak, P3** (3 November 2026, Debug build of the P3 branches up to accessibility, c095a59, with its own data root; one 2560×1440 monitor at 100 %; Idle after 1 minute and Hibernate after 2, so that each visit rebuilt a hibernated module):
- For 42 minutes a script opened one page a minute through the command palette, in turn: Weather (one saved place, with its 48-hour chart), Stocks (without a key), Calendar, Clock, Timer, Calculator, the library and Settings. The shell held 106–131 MB of private commit, 30–32 GDI and 37–41 USER objects all along.
- Its handles stayed between 743 and 757 until minute 32, when Weather's cached forecast had turned 30 minutes old and was fetched again, the run's first web request. They peaked at 913 and settled between 793 and 807: most likely the one-time setup of that first request.
- At minute 42, input that did not come from the script switched pages several times within seconds, which took private commit to 163 MB, and left the palette out of the script's reach. For the last 18 minutes nothing was in use: every module went to Suspended, then Hibernated, and the shell held 150 MB, 30 GDI and 37–38 USER objects and 788–804 handles.
+51 -14
View File
@@ -1,8 +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
@@ -10,7 +14,7 @@ Solo-developer plan, ~29 weeks from the start of P0 (2 November 2026). Each phas
Repository foundation: documentation suite; solution skeleton (`OmniDeck.App`, `OmniDeck.Core`, `OmniDeck.Tests`); self-contained CI (build, tests, formatting, analyzers as errors, NuGet Audit, catalog validation, workflow and link linting, CodeQL, SonarCloud, Dependency Review, OpenSSF Scorecard); protected `main` and release tags; the Velopack release pipeline proven end to end with the `0.0.1-alpha.1` pre-release.
### P0 — Spikes (2 – 15 Nov 2026)
### P0 — Spikes (2 – 15 Nov 2026) — done early, 30 Oct 2026
De-risk everything that could invalidate the design, on real hardware:
@@ -24,27 +28,59 @@ De-risk everything that could invalidate the design, on real hardware:
**Exit:** a written go/no-go note per spike in [`docs/spikes/`](spikes/README.md). The proof-of-concept code stays on the unmerged `spike/p0` branch, so spike-only packages never reach `main`'s dependency graph or the release SBOM.
### P1 — Shell & skeleton (16 Nov 2026 – 10 Jan 2027)
**Result:** all seven notes are in. #1, #3 and #4 are GO; #2, #5, #6 and #7 are GO with conditions:
- #1 DRM: Widevine ships with the runtime.
- #2 sign-in: works and persists; Google's country-code hop needs `navAllowSets` in P2.
- #3 memory: the governor metric is private commit; suspend trims, only hibernate frees.
- #4 CDP capture: always on.
- #5 presets: code-built, with `Od` styles over WPF-UI's static keys.
- #6 libVLC: fullscreen in place; pop-out needs a vout restart and a seek.
- #7 providers: Twelve Data with the user's own key; Stooq dropped.
### P1 — Shell & skeleton (16 Nov 2026 – 10 Jan 2027) — done early, 30 Oct 2026
Shell (nav, tray, single-instance, command palette), module contract + host, RAM governor v1 with task-manager panel, theme engine + three presets (Standard polished, others functional), legal gate + About, settings + storage layer (data root, Velopack uninstall hook), and the three trivial modules: clock, timer, calculator.
**Exit (0.1.0):** installable Velopack build; governor demotes/restores the trivial modules correctly; unit tests for governor + storage green.
### P2 — Web runner & core modules (11 Jan – 7 Mar 2027)
As delivered: eight work packages (PRs #20–#25, #27 and #29) and three releases (`0.1.0-alpha.1`, `0.1.0-alpha.2`, `0.1.0`), all three exit criteria met. Settings import/export, planned for P3, shipped with it. Carried forward:
- **P3 presets:** Comfort's AAA body text and Dynamic's gradient accents (docs/UI-MODES.md §2).
- **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 (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.
### P3 — Stocks, presets, i18n (8 Mar – 11 Apr 2027)
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:
Stocks module (Stooq default + Twelve Data BYO key, watchlist, candlesticks); Dynamic and Comfort presets polished to spec (UI-MODES token table); VI + JA translations; settings import/export; accessibility pass (text scaling, contrast themes, keyboard nav).
- 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 came in P3, drawn by OmniDeck itself.
### 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)
As delivered: twelve work packages, written while 0.2.0 was being dogfooded and opened as draft pull requests (#58–#69) that merged in order once 0.2.0 was tagged, and came out together as `0.3.0-alpha.1` on 3 November 2026:
**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**.
- **Charts** drawn by OmniDeck itself rather than ScottPlot: candlesticks with volume, a line over bars, sparklines; each is one control screen readers read (a summary, then the values under the cursor as the arrow keys move it). Weather got its 48-hour chart from them.
- **Stocks** on Twelve Data with the user's own key, kept with DPAPI: a watchlist that refreshes only while on screen and within the key's credits, and a listing's details from one month to five years, as a chart or a table.
- **Alarms** in Timer, at a time of day, once, daily, on weekdays or at weekends.
- **Updates** can include pre-releases or not: the choice follows the running version until the user makes one, so 1.0 installs stay on stable versions.
- **Presets** to the token table: text palettes that reach 4.5:1 everywhere and 7:1 in Comfort, minimum touch targets on every control, larger sidebar icons in Comfort, and live previews in the first-run setup. Text size now reaches pages and modules, which WPF-UI's navigation frame had cut off. Dynamic's gradient accents were cut (text over a gradient changes contrast across it).
- **Accessibility:** the sidebar as lists screen readers can use, names for WPF-UI's unnamed buttons and for every row's buttons, headings and live regions, the palette's settings tabs and commands, keyboard shortcuts in pop-outs, widths that grow with the text, and High Contrast checks.
- **Translations:** live language changes everywhere, Vietnamese and Japanese, and the rules in [TRANSLATING](TRANSLATING.md).
### P4 — Beta & release (mid-Dec 2026 – end of Jan 2027; planned 12 Apr – 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
@@ -65,10 +101,11 @@ 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 | P0 spike gates the catalog entry; fallback: ship Spotify entry disabled with an explanatory note, YouTube covers music for many users |
| Google blocks sign-in in WebView2 | Google group unusable | P0 spike; fallback: session import guidance / treat as upstream limitation, documented |
| LibVLCSharp airspace friction in WPF | Media UX degraded | P0 spike; fallback engine FlyleafLib |
| Free API tiers change (Twelve Data/Stooq) | Stocks degraded | **Materialized for Stooq** (checked 2026-10-30): the CSV endpoint now answers scripted clients with a JavaScript browser check, and community reports say downloads need a per-user API key obtained through a captcha — P0 spike #7 decides the replacement. Provider abstraction; BYO-key model isolates OmniDeck from quota policy; Stocks is first in the cut order (§4) |
| 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) |
| Web sessions lost across restarts | Users signed out of web apps | Seen once in P0 and not reproduced (spike #2). Since P2, quitting closes the web apps cleanly so the browser writes its cookies out; sign-in health logs each profile's cookie count at close and at first load and warns when it drops to none; bug reports carry the counts (never values) |
| User data stored in Velopack's install folder | Uninstall or reinstall wipes data and sign-ins | data root `%LocalAppData%\OmniDeck.Data`, never `%LocalAppData%\OmniDeck` ([ARCHITECTURE](ARCHITECTURE.md) §5) |
| Solo bandwidth vs. other projects | Schedule slip | cut order below; phases sized with buffer |
@@ -82,4 +119,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, multi-point global hotkeys per web app, 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`).
+53 -24
View File
@@ -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
@@ -22,11 +22,11 @@ Status: draft for v1.0 (target May 2027) · Applies to: Windows 11 (24H2 or late
## 2. Shell
- **Navigation:** left sidebar listing pinned modules; full module library behind a "+" view. Sidebar density and item count vary by UI preset.
- **Navigation:** left sidebar listing pinned modules, then the other open ones; the full module library is a page of its own (Library). Sidebar density and item count vary by UI preset.
- **Command palette:** `Ctrl+K` opens a fuzzy launcher for every module, web app, and settings page.
- **Tray:** single-instance app with tray icon; closing the window minimizes to tray (configurable). Tray menu: open, quick timer, media controls when playing, quit.
- **Windowing:** modules open as tabs in the main window; any module can be popped out into its own top-level window.
- **Settings:** general (language EN/VI/JA, startup, tray behavior), appearance (preset + per-token overrides), memory (governor thresholds), per-module settings, data (export/import settings JSON, open data folder), about.
- **Tray:** single-instance app with tray icon; closing the window minimizes to tray (configurable). Tray menu: open, quick timer, media controls while the player has something loaded, quit.
- **Windowing:** modules open in the main window one at a time, and stay in the sidebar while open; any module can move into a top-level window of its own (pop-out) and back ([ARCHITECTURE](ARCHITECTURE.md) §2).
- **Settings:** general (language EN/VI/JA, startup, tray behavior), appearance (preset + per-token overrides), memory (governor thresholds), web apps (each app's notifications and permissions, clearing a group's sign-in data, the catalog in use), data (export/import settings JSON, open data folder), about.
- **Legal gate:** on first run and whenever the acknowledged legal-doc version differs from the shipped version, show EULA, Disclaimer, Privacy Policy, and Third-Party Notices (shipped in the app's `legal\` folder, with links to this repo). The user acknowledges having read them; the acknowledgment (doc version + timestamp) is stored locally and the app stays on the gate until then. It is an acknowledgment, not a condition of the license: GPL-3.0 §9 does not require accepting the license to run the program.
- **About:** app version + commit hash, update check (Velopack), links (GitHub, Discussions, Discord), credits, **Report bug** button (§6).
@@ -38,6 +38,7 @@ All mini-apps implement the module contract in [ARCHITECTURE](ARCHITECTURE.md) a
- World clock: multiple time zones, 12/24 h.
- Countdown timer and stopwatch; finished timers raise a Windows toast (works while minimized to tray).
- Alarms fire only while OmniDeck is running (tray counts as running); this limitation is stated in the UI.
- **As built in P3:** alarms live in Timer: a time of day, once, daily, on weekdays or at weekends, with an optional label and an on/off switch. `OdAlarmService` keeps them in a settings document of their own and outlives the module, like the timers. A one-off alarm turns itself off once it rang; one that came due while OmniDeck was closed is not shown later, and one the PC slept through rings on waking only within the hour. A time that a daylight-saving change skips rings once the clock is past the gap, and one that happens twice rings the first time.
### 3.2 Calculator
- Standard + scientific modes, calculation history (session-scoped), copy result.
@@ -52,44 +53,71 @@ 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.
- **Providers** behind `IOdQuoteProvider`:
- `Stooq` (default, keyless): end-of-day CSV for US and major EU tickers and indices. Zero configuration.
- `TwelveData` (optional, user-supplied free API key): delayed intraday quotes and time series, US + international coverage. Key stored via **DPAPI**, never in plaintext or logs.
- Client-side **sliding-window rate limiting** per provider; on limit or error, keep last cached values and show `N/A` for missing fields (never delete cached data on network failure).
### 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)).
- Client-side **sliding-window rate limiting**: ≤ 8 credits per rolling 60 s and the plan's daily budget, counting failed calls. Watchlist refreshes use batch quotes. On limit or error, keep the last cached values and show `N/A` for missing fields; never delete cached data on network failure.
- Every stocks screen carries the data disclaimer footer ("delayed/indicative data — not investment advice"), mirrored in [DISCLAIMER](legal/DISCLAIMER.md).
- **As built in P3:**
- The first screen explains the key and links to Twelve Data's sign-up page; "Test and save" spends one credit on `api_usage` and keeps the key only if Twelve Data accepts it, along with the plan's limits. The key panel shows the plan and changes or removes the key; removing it keeps the watchlist and its last figures.
- The watchlist (in the module's settings document) shows each listing's price, the day's change with its sign and direction, a sparkline of the last month and the time of the price; screen readers hear each row as one sentence. Delete removes a row, Alt+Up and Alt+Down move it, and its context menu does the same.
- Search costs nothing and labels every listing the key's plan does not reach ("Needs Twelve Data's Grow plan"); those cannot be added, and a listing that fails for its plan or as unknown is not asked for again that session.
- Quotes refresh only while Stocks is on screen: every 15 minutes while the US market trades, once more about 20 minutes after the close for the final price, then not until the next session. A year of daily bars, fetched once per trading day, serves the sparklines. 100 credits a day are kept back for what the user asks for, and when the rest would not last the session the refresh interval grows and the screen says so. A minute or a day without credits, a rejected key or an unreachable service shows in a bar above the list, over the last figures.
- The footer of every Stocks screen reads "Delayed or indicative data — not investment advice." with a link to Twelve Data.
### 3.6 Media player
- Engine: **LibVLCSharp + VideoLAN.LibVLC.Windows (x64)**, plugins trimmed to codecs/demux/audio/video output.
- 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).
- 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 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.
- It has transport controls, a seek bar, volume and mute.
- libVLC ships in `libvlc\win-x64` next to OmniDeck.exe, with these plugin folders: access, audio_filter, audio_mixer, audio_output, codec, demux, misc, packetizer, spu, stream_filter, text_renderer, video_chroma, video_filter and video_output. The network access plugins (http, https, ftp, sftp, smb, rtp, srt) are left out, which comes to about 80 MB raw.
- Only libVLC's errors reach the app log, as warnings, less the three known harmless ones.
- The overlay's More menu has:
- the audio track and the subtitle track;
- a subtitle file (libVLC also picks one up from beside the video, with the same name);
- the subtitles' encoding, from Automatic, UTF-8 and the common code pages. libVLC reads it only when a file opens, so a new choice reopens the file where it stood;
- the speed, from 0.25× to 4×, kept for the files that follow;
- the audio device (Windows' default, or one libVLC lists);
- a snapshot of the picture, saved in Pictures\OmniDeck.
- Speed, encoding and device live in the module's settings document.
- Full screen: the button in the overlay, or a double-click on the picture, makes the main window cover its monitor (chrome hidden, square corners, topmost). Esc, or showing another module, puts it back. The player never moves, so its video window stays the same. The overlay is not fully transparent over a picture (alpha 1), because a click on a fully clear pixel of a layered window falls through to libVLC's window.
- While a player has a file loaded, the tray menu shows the file with Play or Pause, Next and Previous (`IOdMediaControls`). Without a player there is nothing to control: starting one while the view is away could make libVLC open a video window of its own.
## 4. Web runner
- One shared `CoreWebView2Environment` (user data under `%LocalAppData%\OmniDeck.Data\WebView2`); one `CoreWebView2Profile` per catalog `profile` group (the `google` group is shared across Google apps for single sign-on; all others are isolated).
- **Navigation policy:** top-level navigation outside the entry's `navAllow` suffix list opens in the system default browser. `NewWindowRequested` to a `popupAllow` domain opens an in-app popup on the same profile (SSO); everything else goes to the default browser.
- **Notifications:** `NotificationReceived` is intercepted and re-raised as a Windows toast tagged with the app name; per-app opt-out in settings.
- **Permissions:** `PermissionRequested` (mic/camera/clipboard/geolocation) shows a native prompt; the decision is remembered per app and reviewable in settings.
- **Downloads:** routed through `DownloadStarting` to the user's Downloads folder with an in-shell progress row.
- **Media pinning:** while `IsDocumentPlayingAudio` is true, the module is pinned (see RAM-GOVERNOR).
- **Lifecycle:** hidden web apps are suspended via `TrySuspendAsync` + `MemoryUsageTargetLevel.Low`, later disposed entirely (session survives via profile cookies). Full state machine in [RAM-GOVERNOR](RAM-GOVERNOR.md).
- **Notifications:** `NotificationReceived` is intercepted and shown as a Windows notification under the app's name; each app's switch in Settings → Web apps defaults to the catalog's `notifications`. An app with notifications on keeps running while hidden ([RAM-GOVERNOR](RAM-GOVERNOR.md) §3).
- **Permissions:** `PermissionRequested` for the user's devices and data (camera, microphone, location, clipboard reading and the like) asks once per app, in a bar above the page, since no dialog can cover WebView2. The answer is remembered per app and reviewable in Settings → Web apps.
- **Downloads:** WebView2's own download flyout saves to the user's Downloads folder; it already handles SmartScreen verdicts and dangerous-file prompts.
- **Full screen:** a page that goes full screen (a video, say) takes the window full screen with it, as the media player does; Esc or showing another module ends both.
- **Media pinning:** while `IsDocumentPlayingAudio` is true and the entry has `audioPin`, the module is pinned (see RAM-GOVERNOR).
- **Lifecycle:** hidden web apps are suspended via `TrySuspendAsync` + `MemoryUsageTargetLevel.Low`, later disposed entirely (session survives via profile cookies). Disposing the last web app ends the shared browser process. Full state machine in [RAM-GOVERNOR](RAM-GOVERNOR.md).
- **Google account domains:** Google's sign-in sets cookies on country-code domains (for example `accounts.google.com.vn`). The `google` entries allow them through the catalog's `google-account-domains` set (schema v2 `navAllowSets`, decided on 2 November 2026; [WEBAPP-CATALOG](WEBAPP-CATALOG.md) §1, [spike #2](spikes/02-google-sign-in.md)).
- **Catalog:** shipped in `catalog/webapps.json`, refreshed from this repo's raw URL at most once per day; schema and rules in [WEBAPP-CATALOG](WEBAPP-CATALOG.md).
## 5. Cross-cutting requirements
- **i18n:** all shell and mini-app strings in `.resx`, EN (neutral) / VI / JA.
- **Accessibility:** honor Windows text scaling (multiplies the preset font token) and High Contrast (overrides palette tokens); full keyboard navigation of the shell.
- **i18n:** all shell and mini-app strings in `.resx`, EN (neutral) / VI / JA. As built in P3, a change of language reaches every screen at once, web apps at the next start; the rules and the glossaries are in [TRANSLATING](TRANSLATING.md).
- **Accessibility:** honor Windows text scaling (multiplies the preset font token) and High Contrast (overrides palette tokens); full keyboard navigation of the shell. As built in P3: screen readers get the sidebar as lists, names for every control and row, headings and live regions; widths grow with the text; the conventions are in [WPFUI-CONVENTIONS](WPFUI-CONVENTIONS.md) §7.
- **Storage:** everything lives under the data root `%LocalAppData%\OmniDeck.Data`: SQLite (`omnideck.db`, via Dapper) for module data; `settings.json` for configuration; Serilog rolling files under `logs\` (7-day retention). Never inside `%LocalAppData%\OmniDeck`, which is Velopack's install folder and is deleted on uninstall and reinstall ([ARCHITECTURE](ARCHITECTURE.md) §5).
- **Updates:** Velopack against GitHub Releases; per-user install; delta updates.
- **Security:** see [SECURITY](../SECURITY.md) — no admin, DevTools UI off in release builds, password autosave off, DPAPI for the only secret (Twelve Data key), HTTPS-only service calls; in CI, NuGet Audit (restore fails on moderate+ advisories, transitive packages included) and Dependency Review.
## 6. Bug reporting flow
1. A DevTools Protocol session per web app subscribes to `Runtime.consoleAPICalled` and `Log.entryAdded`, keeping a 200-entry ring buffer per app. .NET unhandled exceptions and the Serilog tail are collected shell-side.
2. **Report bug** composes: version, Windows build, UI preset, active modules + RAM snapshot, the relevant console ring buffer, and last log lines.
3. Before packaging, a scrubber strips query strings, cookie values, and bearer-token-shaped strings.
4. The app opens a pre-filled GitHub issue (bug template) and writes `bugreport-<timestamp>.zip` to `%LocalAppData%\OmniDeck.Data\reports` for the user to attach (issue-URL prefill has a length limit, so long logs travel in the zip).
1. A DevTools Protocol session per web app (`Runtime` + `Log`, always on, DevTools UI still disabled) subscribes to `Runtime.consoleAPICalled`, `Runtime.exceptionThrown` and `Log.entryAdded`. It keeps a 200-entry ring buffer per app, plus a 50-entry errors-only ring so chatty apps cannot evict errors ([spike #4](spikes/04-cdp-console.md)). .NET unhandled exceptions and the Serilog tail are collected shell-side.
2. **Report a bug** (Settings → About, or Report bug on the error dialog) composes: version and commit, Windows build, UI preset, the modules with their states and memory, the last 500 log lines, the console rings of the web app picked as the subject, and each web profile's cookie count (never values).
3. Before anything is shown or saved, a scrubber removes query strings and fragments, cookie values, bearer, JWT and other long hex or base64 tokens, email addresses, ids of 15 digits or more, and the user name in profile paths.
4. A dialog previews the issue text. Saving writes `bugreport-<timestamp>.zip` (issue.md, system.json, logs.txt and the console) to `%LocalAppData%\OmniDeck.Data\reports`, keeps the ten newest, shows it in Explorer, and opens a GitHub issue (bug template) with the short fields filled in; long logs travel in the zip, since issue URLs have a length limit. Nothing is uploaded.
## 7. Reference versions (verified 2026-10-28; Dependabot owns bumps from here)
@@ -102,7 +130,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 |
+119
View File
@@ -0,0 +1,119 @@
# Translating OmniDeck
OmniDeck ships in English, Vietnamese and Japanese ([SPEC](SPEC.md) §5). This page is for translators and for anyone who adds a string.
## 1. Where the strings are
Each project that shows text has its own string table, with English as the neutral language:
| Table | English | Translations |
|---|---|---|
| The shell (`OmniDeck.App`, and the few strings `OmniDeck.Core` uses) | `src/OmniDeck.App/Resources/Strings.resx` | `Strings.vi.resx`, `Strings.ja.resx` beside it |
| The built-in modules | `src/OmniDeck.Modules/Resources/Strings.resx` | likewise |
| The web runner | `src/OmniDeck.Web/Resources/Strings.resx` | likewise |
A translation holds only the keys it translates: a key it lacks shows in English. Edit the `.resx` files in an editor that keeps them as they are (Visual Studio or Rider's resource editor, or any text editor). Read a key's `<comment>` before translating it: it says what the placeholders hold and where the text shows.
## 2. Rules
- **Placeholders.** `{0}`, `{1}`… are filled in at run time. A translation keeps every placeholder of the English text (a test checks), in whatever order the sentence needs.
- **Whole sentences.** Each key is a whole sentence or label: OmniDeck never builds a sentence out of pieces, so word order is yours. When a screen needs a sentence around a control (a repeat's interval, for one), the control's items are whole phrases instead, such as "every 2 weeks".
- **Formats.** A few keys are .NET date and time formats rather than words: `Clock_Time12` (`h:mm:ss tt`) and `Weather_DayFormat` (`ddd d`). Reorder their parts as your language writes them; the day and month names, and AM and PM, come from the user's regional format.
- **Numbers and dates.** They follow the user's regional format (Windows → Time & language → Region), not the UI language. A Vietnamese UI on an English (United States) region shows US dates: that is by design.
- **Names.** Language names are written in their own language (English, Tiếng Việt, 日本語) whatever the UI language, and are not in the string tables. Brand names are never translated: OmniDeck, Spotify, Discord, Twelve Data, Open-Meteo.
## 3. What stays in English
- The legal documents (`docs/legal`), as the app shows them: they exist in English only.
- The text of a bug report's GitHub issue, which is for the maintainer: its headings are English and its modules go by id. The bug report dialog itself is translated.
- The logs.
## 4. How the app switches language
`OdLocalization` holds the UI language. XAML binds its strings with `{res:OdLoc Key}`, and a row's buttons with `{res:OdLocRow Key, Path=…}`, so those follow a change of language at once. Text built in code follows through `OdLocalization.FollowCulture(handler)`: each view model that builds text reads it again on a change, and one that is disposed stops with `UnfollowCulture`; a follower that fails is logged and keeps its old text, without stopping the others. Lists the user picks from keep their entries and change only their text (`OdChoice<T>`, `OdLocalizedOption`, `OdPresetOption`), so the selection bound to them stays. WebView2 takes the UI language when it starts: web apps follow on OmniDeck's next start.
## 5. Checks
- `OdResxKeyTests`: every key the sources use exists in English, and every English key is used.
- `OdTranslationTests`: a translation has only English keys, the English placeholders, and no empty text.
- The tests run in US English, so they pass on Vietnamese and Japanese Windows.
## 6. Vietnamese
**Voice.** Short and plain, as Windows says it in Vietnamese: labels and buttons are bare phrases ("Lưu", "Xóa nơi này"), messages are whole sentences. Address the reader as "bạn" only where English says "you", and keep "vui lòng" for the rare request. Tones go on the modern position, as Windows writes them: "hóa", "thủy", "khóa".
**Terms.** Windows' own Vietnamese terms where Windows has one.
| English | Tiếng Việt |
|---|---|
| module | mô-đun |
| web app | ứng dụng web |
| sidebar | thanh bên |
| module library | thư viện mô-đun |
| pin / unpin | ghim / bỏ ghim |
| pop out / return to main window | mở trong cửa sổ riêng / về cửa sổ chính |
| command palette | bảng lệnh |
| Settings / Appearance | Cài đặt / Giao diện |
| layout (preset): Dynamic, Standard, Comfort | bố cục: Năng động, Tiêu chuẩn, Dễ nhìn |
| theme: Light, Dark, Follow Windows | chủ đề: Sáng, Tối, Theo Windows |
| accent color | màu nhấn |
| text size | cỡ chữ |
| animations | hiệu ứng chuyển động |
| High Contrast | độ tương phản cao |
| notification area | khu vực thông báo |
| memory: suspend, hibernate, keep running | bộ nhớ: tạm dừng, ngủ đông, luôn chạy |
| sign in / sign-in data | đăng nhập / dữ liệu đăng nhập |
| permission | quyền |
| pre-release (alpha, beta) | bản thử nghiệm |
| report a bug | báo lỗi |
| check for updates | kiểm tra bản cập nhật |
| data folder | thư mục dữ liệu |
| timer, countdown, stopwatch, lap, alarm | hẹn giờ, đếm ngược, bấm giờ, vòng, báo thức |
| event, reminder, repeat | sự kiện, lời nhắc, lặp lại |
| forecast, chance of rain, feels like | dự báo, khả năng mưa, cảm giác như |
| watchlist, listing, API key, plan, credits | danh sách theo dõi, mã, khóa API, gói, lượt gọi |
| queue, playlist, subtitles | hàng chờ, danh sách phát, phụ đề |
| local time, time zone | giờ địa phương, múi giờ |
**Formats.** `Clock_Time12` stays `h:mm:ss tt` and `Weather_DayFormat` stays `ddd d`: the region gives "SA"/"CH" and "T2"…"CN".
## 7. Japanese
**Voice.** As Windows 11's Japanese UI words things: labels and buttons are short noun phrases or plain verb forms (保存, キャンセル, この場所を削除), messages are sentences in です・ます form. Prefer the kanji terms Windows uses to needless katakana. A half-width space goes between Japanese and Latin letters or numbers, as Windows writes them (Web アプリ, 5 分, API キー), but not next to Japanese punctuation. Japanese has no plurals: "every {0} weeks" is "{0} 週間ごと".
**Terms.** Windows' own Japanese terms where Windows has one.
| English | 日本語 |
|---|---|
| module | モジュール |
| web app | Web アプリ |
| sidebar | サイドバー |
| module library | モジュール ライブラリ |
| pin / unpin | ピン留めする / ピン留めを外す |
| pop out / return to main window | 別ウィンドウで開く / メイン ウィンドウに戻す |
| command palette | コマンド パレット |
| Settings / Appearance | 設定 / 外観 |
| layout (preset): Dynamic, Standard, Comfort | レイアウト: ダイナミック, 標準, ゆったり |
| theme: Light, Dark, Follow Windows | テーマ: ライト, ダーク, Windows の設定に合わせる |
| accent color | アクセント カラー |
| text size | テキストのサイズ |
| animations | アニメーション効果 |
| High Contrast | ハイ コントラスト |
| notification area | 通知領域 |
| memory: suspend, hibernate, keep running | メモリ: 一時停止, 休止, 常に実行 |
| sign in / sign-in data | サインイン / サインイン データ |
| permission | アクセス許可 |
| pre-release (alpha, beta) | プレリリース版 |
| report a bug | バグを報告 |
| check for updates | 更新プログラムを確認 |
| data folder | データ フォルダー |
| timer, countdown, stopwatch, lap, alarm | タイマー, カウントダウン, ストップウォッチ, ラップ, アラーム |
| event, reminder, repeat | 予定, 通知, 繰り返し |
| forecast, chance of rain, feels like | 予報, 降水確率, 体感温度 |
| watchlist, listing, API key, plan, credits | ウォッチリスト, 銘柄, API キー, プラン, クレジット |
| queue, playlist, subtitles | キュー, プレイリスト, 字幕 |
| local time, time zone | 現地時刻, タイム ゾーン |
**Formats.** `Clock_Time12` is `tt h:mm:ss` and `Weather_DayFormat` is `d日(ddd)`; the region gives 午前/午後 and the day names. A row's button names join with an ideographic comma: `A11y_RowAction` is `{0}、{1}`.
**Fonts.** Japanese text falls back to Yu Gothic UI, Windows' Japanese UI font (WPF's fallback for `xml:lang="ja"`); OmniDeck tags its windows with the UI language, so that kanji take their Japanese shapes rather than Chinese ones.
+16 -3
View File
@@ -26,7 +26,16 @@ Presets are named by their character, never by age, both in the UI and in code:
| `Od.Nav.IconLabels` | icons, labels on hover | icons + labels | icons + labels, larger |
| `Od.Chart.LineWeight` | 1.5 px | 2 px | 3 px |
Rules for module authors: never hardcode a font size, padding, radius, or animation duration — consume tokens. CI includes a XAML lint pass (XamlStyler + a grep rule) that flags literal `FontSize=` in module views.
Rules for module authors: never hardcode a font size, padding, margin, radius, or animation duration — consume tokens. CI includes a XAML lint pass (XamlStyler + a grep rule over every view in `src`) that flags a literal `FontSize`, and a literal `Margin`, `Padding` or `CornerRadius` with any value other than zero.
As built (P1, then P3), every token in the table drives the app except `Od.Accent.Saturation`:
- **Sidebar.** Dynamic closes the sidebar to icons, with each name in a tooltip; Comfort shows at most six modules, always including the one on screen, and the rest stay in the library and the palette. `Od.Nav.IconLabels` is two tokens, `Od.Nav.ShowLabels` and `Od.Nav.IconSize` (16 px; 22 px in Comfort); labels are at `Od.Font.Base`, and items at least `Od.HitTarget.Min` tall.
- **Spacing.** It all comes from `Od.Density`: `Od.Padding.Control` and `Od.Padding.Card`, and the margins `Od.Margin.Item` (after a block), `Od.Margin.Tile` (after a tile in a grid), `Od.Margin.Leading` and `Od.Margin.Inline` (before and after an element in a row) and `Od.Margin.Tight` (between the keys of a keypad).
- **Contrast.** `Od.Contrast.Target` picks the preset's text palette (§6). Secondary and tertiary text meet 4.5:1 in Dynamic and Standard, and 7:1 in Comfort, on every WPF-UI surface of the light and dark themes; WPF-UI's own tertiary text is about 3.3:1 on the light theme. A test reads the surfaces from WPF-UI's theme dictionaries, so an update of WPF-UI is checked too.
- **Hit targets.** `Od.HitTarget.Min` is the minimum height of buttons, text boxes, check boxes, radio buttons, combo boxes, toggle switches, list items, menu items and sidebar items.
- **No gradients.** Dynamic's gradient accents were cut in P3: text over a gradient changes contrast across the surface, so no preset draws one and `Od.Accent.Saturation` is not a token. Every preset uses the accent Windows or the user chose.
- **Charts.** `Od.Chart.LineWeight` sets the line width of the charts (Weather, Stocks).
## 3. User overrides
@@ -34,14 +43,18 @@ Appearance settings expose the presets as three cards plus granular overrides on
## 4. Windows accessibility interplay (non-negotiable)
- **Text scaling:** the OS text scale factor multiplies `Od.Font.Base` on top of everything else.
- **High Contrast:** when `SystemParameters.HighContrast` is on, palette tokens defer to system colors entirely; only layout tokens from the preset remain.
- **Text scaling:** the OS text scale factor multiplies `Od.Font.Base` on top of everything else. As built, widths that hold text grow with it too: `Od.Width.Tile`, `Od.Width.TileWide`, `Od.Width.Field` and `Od.Width.Readable` are multiples of `Od.Font.Base`, and rows of buttons in tiles wrap rather than clip.
- **High Contrast:** when `SystemParameters.HighContrast` is on, palette tokens defer to system colors entirely; only layout tokens from the preset remain. As built, the preset layer then carries no text palette, `Od.Opacity.Dim` (0.7 otherwise, for what is dimmed but still in use) is 1, and Settings hides the accent swatches.
- **Reduced motion:** if the OS animation setting is off, `Od.Motion` is forced off regardless of preset.
## 5. Onboarding
Immediately after the legal gate, first-run shows: language (EN/VI/JA) → preset picker (three live preview cards rendered with each preset's actual tokens — no screenshots) → done. Both choices are one click to change later in Settings.
As built, each card gets that preset's own layer, built by the theme engine at the Windows text size, the user's font scale and the current theme (`OdPresetPreview`), so its title and text show the preset's sizes and text palette. Picking a card applies the preset to the whole window at once.
## 6. Dark/light
Independent axis from presets: Light / Dark / Follow Windows (default). Every preset defines both palettes; contrast targets in §2 apply to both.
As built, a preset's palette replaces WPF-UI's secondary and tertiary text brushes (`OdPalette`); primary text and every other color stay WPF-UI's. Dynamic and Standard keep WPF-UI's values where they already pass and darken the light theme's tertiary text; Comfort's are stronger on both themes. In High Contrast the preset layer carries no palette at all.
+12 -9
View File
@@ -26,13 +26,16 @@ OmniDeck deliberately does **not** allow arbitrary user-added URLs in v1: the cu
| `startUrl` | https URL | initial navigation target |
| `profile` | string | cookie/profile group; entries sharing a value share sign-in. Reserved group: `google`. Anything else should be unique per app unless sharing is intentional |
| `navAllow` | string[] | domains the main frame may navigate to; anything else opens in the system default browser |
| `navAllowSets` | string[], optional | names of top-level `navAllowSets` whose domains this entry's main frame may also navigate to; for lists too long to repeat in each entry |
| `popupAllow` | string[] | domains whose `window.open` popups open **in-app on the same profile** (SSO flows); all other popups go to the default browser |
| `notifications` | bool | whether web notifications are bridged to Windows toasts (user can still disable per app) |
| `notifications` | bool | whether web notifications are bridged to Windows toasts by default; the user can switch it per app in Settings → Web apps. An app with notifications on stays running while hidden (RAM-GOVERNOR.md §3) |
| `audioPin` | bool | if true, the governor treats the app as pinned while it is playing audio |
**Domain matching.** `navAllow` and `popupAllow` entries are lowercase domains or subdomains — no scheme, port, path, or wildcard. A host matches an entry when it equals it or ends with `.` + the entry, on whole DNS labels: `google.com` matches `mail.google.com`, never `evilgoogle.com`. `navAllow` governs **top-level (main-frame) navigations only**; subresource requests (scripts, images, media, API calls to CDNs) are never filtered by it, so a CDN belongs in `navAllow` only when the app really navigates the main frame there (a file download or a media viewer, for example). The `startUrl` host and every `popupAllow` entry must be covered by `navAllow`.
**Domain matching.** `navAllow` and `popupAllow` entries are lowercase domains or subdomains — no scheme, port, path, or wildcard. A host matches an entry when it equals it or ends with `.` + the entry, on whole DNS labels: `google.com` matches `mail.google.com`, never `evilgoogle.com`. `navAllow` governs **top-level (main-frame) navigations only**; subresource requests (scripts, images, media, API calls to CDNs) are never filtered by it, so a CDN belongs in `navAllow` only when the app really navigates the main frame there (a file download or a media viewer, for example). The `startUrl` host must be covered by `navAllow`, and every `popupAllow` entry by `navAllow` or the entry's sets.
Top-level file fields: `$schema` (optional editor hint), `schemaVersion` (int), `updated` (ISO date of the last content change), `apps` (array). The JSON Schema is [`catalog/webapps.schema.json`](../catalog/webapps.schema.json); `scripts/validate-catalog.ps1` checks it plus the rules a schema can't express (unique `id` and `name`, the coverage rules above, `updated` not in the future), and CI runs it on every pull request. The app rejects any fetched catalog whose `schemaVersion` it does not understand or that fails validation, and keeps the bundled copy.
Top-level file fields: `$schema` (optional editor hint), `schemaVersion` (int, currently 2), `updated` (ISO date of the last content change), `navAllowSets` (optional: named lists of domains, each name `[a-z0-9-]`), `apps` (array).
**Named domain sets.** `google-account-domains` lists Google's account host on every country-code domain, `accounts.google.<ccTLD>`, taken from `https://www.google.com/supported_domains` (186 domains; `google.com` itself is already in each entry's `navAllow`). Google's sign-in hops there to set its cookies, for example `accounts.google.com.vn/accounts/SetSID`. Every `google` entry uses the set, because they share one sign-in, and so does `spotify`: its "Continue with Google" signs in to Google on Spotify's own profile, and goes through the same hops. The list lives in the catalog rather than in the app, so a change is a catalog pull request, not a release. Schema v2 (2 November 2026) added `navAllowSets`; no released build read v1, and the app reads v2 only. The JSON Schema is [`catalog/webapps.schema.json`](../catalog/webapps.schema.json); `scripts/validate-catalog.ps1` checks it plus the rules a schema can't express (unique `id` and `name`, every set an entry names exists and every set is used, the coverage rules above, `updated` not in the future), and CI runs it on every pull request. The app checks every catalog it loads or fetches against the same rules (`OdCatalogValidator`, whose test runs on this repository's file), rejects any whose `schemaVersion` it does not understand or that fails them, and keeps the copy it has. A fetched catalog takes effect from the next start.
## 2. Review rules for new entries (PR checklist)
@@ -40,7 +43,7 @@ Top-level file fields: `$schema` (optional editor hint), `schemaVersion` (int),
2. `navAllow` is the *minimal* set of domains the app's main frame genuinely navigates to — test sign-in redirects, core flows, and downloads; do not add ad/tracking domains just to silence the default-browser handoff, and do not add CDN/asset domains that are only loaded as subresources.
3. `popupAllow` contains only identity/SSO domains actually used by the sign-in flow.
4. Isolated `profile` unless there is a concrete single-sign-on reason to share.
5. `audioPin: true` only for apps whose primary function is audio/video playback.
5. `audioPin: true` only for apps whose primary function is audio/video playback, or voice and video calls (`discord`, `facebook`): a call must not be suspended while it is in progress.
6. No services that primarily distribute illegal content, and nothing requiring DRM schemes known not to work in WebView2 (see ROADMAP risk register).
7. State in the PR description which flows you manually tested inside OmniDeck (or a WebView2 sample) — sign-in, notifications, a core action.
8. `pwsh scripts/validate-catalog.ps1` passes locally (CI runs it too).
@@ -49,15 +52,15 @@ Top-level file fields: `$schema` (optional editor hint), `schemaVersion` (int),
| id | profile | audioPin | Notes |
|---|---|---|---|
| spotify | spotify | yes | Web Player; requires DRM in the runtime — gated on the P0 spike result; third-party sign-in buttons (Google/Facebook/Apple) untested until then |
| discord | discord | no | no global PTT on web; host hotkey partial mitigation |
| youtube | google | yes | |
| 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 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 | |
| gdrive | google | no | |
| gmaps | google | no | replaces a native map mini-app entirely |
| facebook | meta | no | also Meta's web messaging (`facebook.com/messages`) since messenger.com closed in April 2026; the Messenger entry was removed |
| facebook | meta | yes | pinned while a call or video plays audio; also Meta's web messaging (`facebook.com/messages`) since messenger.com closed in April 2026; the Messenger entry was removed |
## 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.
+20 -5
View File
@@ -89,21 +89,36 @@ Snackbar/dialog services need a presenter host registered from the shell window
## 6. Theming with Od.* tokens
- Module views consume **`Od.*` tokens only** (fonts, spacing, radius, motion — see [UI-MODES](UI-MODES.md)). CI greps for literal `FontSize=` in module views.
- Module views consume **`Od.*` tokens only** (fonts, spacing, radius, motion — see [UI-MODES](UI-MODES.md)). CI greps every view for a literal `FontSize`, and for a literal `Margin`, `Padding` or `CornerRadius` other than zero.
- Text size reaches views through property inheritance, and three things in WPF-UI 4.3 cut it off:
- the navigation view's frame passes neither the text color nor the size into its pages, so each page and the module stage set `Foreground` and `FontSize` themselves;
- `ListBox` is styled at 14 px and `ToolTip` at 12 px, so `OdStyles.xaml` restyles both from the tokens;
- the sidebar item template sets 14 px on its label, so the shell gives its items a label template of its own (`NavLabel`).
- Colors come from WPF-UI theme resources via `DynamicResource` (e.g. `TextFillColorPrimaryBrush`, `ControlFillColorDefaultBrush` — look keys up in the Gallery/theme dictionaries, don't guess). Never hardcode a brush.
- Preset dictionaries may override WPF-UI resource keys **deliberately and documented** — each override gets a comment stating why.
- Accent color (user override in Appearance settings) goes through `ApplicationAccentColorManager` — one call site in the theme engine, nowhere else.
- Dark/light is an axis independent of presets; both palettes must pass the contrast targets in UI-MODES for every preset.
## 7. Icons
## 7. Accessibility
What screen readers and the keyboard need, and what WPF-UI 4.3 leaves out (P3; `scripts/od-drive.ps1 -Action audit` lists what is still missing on a screen):
- **Sidebar.** WPF-UI hosts the items in plain item controls, whose peers wrap each item in a data item that can be neither invoked nor selected. `OdNavigationView`'s peer lists `OdNavItem`s instead, as two lists (the modules, then Settings and the library) of list items with Invoke and SelectionItem. Both are subclasses, so they take WPF-UI's styles by name; a test lays the view out on WPF-UI's own dictionaries to catch a template that changes.
- **Template parts.** `OdAutomationNames` names the buttons WPF-UI leaves unnamed, or named after a glyph such as "CaretUp24": the title bar's (Maximize turns into Restore), the sidebar's pane button (Open or Close navigation), the scroll bar, slider and number box buttons, and the password box's reveal button. An editable combo box's text box, which takes the focus, gets its combo box's name. It names each on its first layout: WPF raises `Loaded` only on elements that handle it themselves.
- **Lists.** Screen readers name a list item after its data's `ToString()`, which for a record lists all its members: every item type overrides it, as a sentence where the row shows several values. A button that every row has is named after its row too, with `{res:OdLocRow Key, Path=…}` ("Remove, Tokyo"; `LabelPath=` when the row provides the label).
- **State.** A button whose job changes is named for what it does now (Play or Pause, Mute or Unmute), and so is its tooltip.
- **Headings and live regions.** Page titles are `AutomationProperties.HeadingLevel="Level1"` and section titles `Level2`. A status line is an `OdStatusText`: WPF knows `LiveSetting`, but makes a change heard only when the element raises the event, which a `TextBlock` never does.
- **Keyboard.** Ctrl+K opens the palette in pop-outs too, where Ctrl+W closes the window; the palette and Ctrl+1–9 move the focus into the page they open. Enter and Delete act on the selected item of the media queue and the calculator's history. In a web app the shell's shortcuts come first: WebView2's WPF control hands Ctrl and Alt keys to WPF before the page sees them, so Ctrl+K opens the palette rather than, say, Discord's quick switcher.
## 8. Icons
WPF-UI ships Fluent System Icons (MIT). **Segoe Fluent Icons cannot be redistributed** (font EULA); it is present on every supported Windows 11 build, but we still stick to `SymbolRegular`/`SymbolFilled` glyphs so the UI never depends on a system font version. We do not bundle the font.
## 8. Hard rules
## 9. Hard rules
- Never mix WPF-UI with Material Design In XAML (or any second UI kit) in this app.
- `ui:` controls subclass their native counterparts — code and tests targeting base types (`ButtonBase`, `TextBoxBase`) keep working; don't duplicate logic per control flavor.
- XamlStyler formats everything, including `ui:` attributes (upstream uses XamlStyler themselves).
- High Contrast: when active, WPF-UI/system colors win over presets ([UI-MODES](UI-MODES.md) §4) — verify in the P3 accessibility pass.
- `FluentWindow` chrome + child-HWND content (LibVLCSharp `VideoView`): fullscreen toggle is part of P0 spike #6; don't ship media pop-out before it passes.
- High Contrast: when active, WPF-UI/system colors win over presets ([UI-MODES](UI-MODES.md) §4). Colors come from theme keys only (the charts included); `Od.Opacity.Dim` is 1 there, and the accent swatches are hidden.
- `FluentWindow` chrome + child-HWND content (LibVLCSharp `VideoView`): fullscreen passed P0 spike #6, and media pop-out passed in P2 by moving the same view, whose overlay must not be owned by a closing window ([ARCHITECTURE](ARCHITECTURE.md) §2).
- Version bumps of `WPF-UI*` packages are Dependabot PRs like any other, but read the release notes first — v3→v4 proved this library will rename APIs between majors.
+3 -3
View File
@@ -1,6 +1,6 @@
# OmniDeck — Disclaimer
Version 1.0 — effective from the first public release (0.0.1-alpha.1).
Version 1.2 — effective from 0.3.0. No changes since 1.1; the legal documents share one version number.
## Pre-release software
@@ -8,7 +8,7 @@ OmniDeck is pre-release (alpha/beta) software provided **as is**, without warran
## Financial data — not investment advice
The stocks module displays market data obtained from third-party providers (Stooq; optionally Twelve Data). This data may be **delayed, incomplete, or inaccurate**, and end-of-day sources are not suitable for time-sensitive decisions. Nothing displayed by OmniDeck constitutes financial, investment, legal, or tax advice, and no fitness for trading purposes is implied. Any decisions you make based on this data are entirely your own responsibility. Verify figures with your broker or an official exchange source before acting.
The stocks module displays market data obtained from a third-party provider (Twelve Data, using your own API key). This data may be **delayed, incomplete, or inaccurate**, and it is not suitable for time-sensitive decisions. Nothing displayed by OmniDeck constitutes financial, investment, legal, or tax advice, and no fitness for trading purposes is implied. Any decisions you make based on this data are entirely your own responsibility. Verify figures with your broker or an official exchange source before acting.
## Weather data
@@ -16,7 +16,7 @@ Weather information comes from Open-Meteo and is provided for general planning o
## Third-party web applications and services
Web apps accessible through OmniDeck (Spotify, Discord, YouTube, Google services, Facebook, Messenger, and others in the catalog) are operated entirely by their respective providers. Their availability, functionality, sign-in behavior, and content may change or cease at any time without notice, and some capabilities differ from those providers' native desktop apps (documented in the README). OmniDeck has no control over, and assumes no responsibility for, those services or their content. Your use of them is subject to their own terms.
Web apps accessible through OmniDeck (Spotify, Discord, YouTube, Google services, Facebook, and others in the catalog) are operated entirely by their respective providers. Their availability, functionality, sign-in behavior, and content may change or cease at any time without notice, and some capabilities differ from those providers' native desktop apps (documented in the README). OmniDeck has no control over, and assumes no responsibility for, those services or their content. Your use of them is subject to their own terms.
## Trademarks
+2 -2
View File
@@ -1,6 +1,6 @@
# OmniDeck — End User License Agreement (EULA)
Version 1.0 — effective from the first public release (0.0.1-alpha.1).
Version 1.2 — effective from 0.3.0. Changes since 1.1: libVLC, bundled since the 0.2.0 pre-releases, is no longer described as coming in a later version.
By installing or using OmniDeck ("the Software"), you acknowledge the terms below. If you do not agree with them, do not install or use the Software.
@@ -10,7 +10,7 @@ The Software is free software licensed under the **GNU General Public License v3
## 2. Third-party components and services
The Software bundles third-party components (such as the .NET runtime, WPF-UI, Velopack and, in later versions, libVLC) that are governed by their own licenses, listed in THIRD-PARTY-NOTICES.md. It relies on the Microsoft Edge WebView2 Runtime that ships with Windows 11; the runtime is not bundled with the Software and is governed by Microsoft's license terms. The Software also loads third-party **web applications and data services** (e.g., Spotify, Discord, Google services, Open-Meteo, Stooq, Twelve Data). Your use of those services is governed solely by their own terms of service and privacy policies; you are responsible for complying with them. OmniDeck is not affiliated with, endorsed by, or sponsored by any of these providers, and their trademarks belong to their respective owners.
The Software bundles third-party components (such as the .NET runtime, WPF-UI, Velopack and libVLC) that are governed by their own licenses, listed in THIRD-PARTY-NOTICES.md. It relies on the Microsoft Edge WebView2 Runtime that ships with Windows 11; the runtime is not bundled with the Software and is governed by Microsoft's license terms. The Software also loads third-party **web applications and data services** (e.g., Spotify, Discord, Google services, Open-Meteo, Twelve Data). Your use of those services is governed solely by their own terms of service and privacy policies; you are responsible for complying with them. OmniDeck is not affiliated with, endorsed by, or sponsored by any of these providers, and their trademarks belong to their respective owners.
## 3. Your responsibilities
+8 -4
View File
@@ -1,6 +1,6 @@
# OmniDeck — Privacy Policy
Version 1.0 — effective from the first public release (0.0.1-alpha.1).
Version 1.2 — effective from 0.3.0. Changes since 1.1: what Open-Meteo and Twelve Data receive is spelled out, requests OmniDeck makes itself name the app and its version, and media snapshots, saved in your Pictures folder, are not removed with the app.
**Short version: OmniDeck collects nothing.** There is no telemetry, no analytics, no account, no crash auto-upload, and no server operated by the OmniDeck project that receives your data.
@@ -14,18 +14,22 @@ All of the following stays in `%LocalAppData%\OmniDeck.Data` (the data root) and
- Logs (7-day rolling) and any bug-report zips you generate.
- Your optional Twelve Data API key, encrypted with Windows DPAPI.
The app itself is installed separately, in `%LocalAppData%\OmniDeck`. Uninstalling OmniDeck removes both folders. To reset the app without uninstalling it, delete the data root (Settings → Data → open data folder).
Snapshots you take in the media player are saved as pictures in `Pictures\OmniDeck`, outside the data root.
The app itself is installed separately, in `%LocalAppData%\OmniDeck`. Uninstalling OmniDeck removes both folders, but not the snapshots in `Pictures\OmniDeck`: those are yours to keep or delete, like any picture. To reset the app without uninstalling it, delete the data root (Settings → Data → open data folder).
## 2. Network connections the app makes
OmniDeck only talks to the internet for the features you use:
- **Open-Meteo** — weather forecasts and geocoding for your saved locations.
- **Stooq** and (only if you configure a key) **Twelve Data** — stock quotes for tickers on your watchlist.
- **Open-Meteo** — weather forecasts and geocoding for your saved locations. It receives the place names you search for, with the UI language for the results, and the coordinates of your saved places, rounded to four decimal places (about 10 m), with the units you chose. No key or identifier is sent.
- **Twelve Data**, only after you enter your own API key: stock quotes, price history and symbol search for the stocks module. It receives your key (in a request header, never in a web address), the symbols on your watchlist and the text you search for, and can link them to your Twelve Data account.
- **GitHub** — update checks/downloads (Velopack) and the daily web-app catalog refresh; opening a pre-filled bug-report issue happens in your browser and only if you choose to.
- **Microsoft Edge WebView2 Runtime** — the Microsoft component that renders the web apps may contact Microsoft services on its own, for example Microsoft Defender SmartScreen reputation checks for the pages you visit and the runtime's own updates and diagnostic data. That traffic is governed by Microsoft's privacy statement and your Windows diagnostic-data settings; OmniDeck does not enable any additional reporting.
- **The third-party web apps you open** (Spotify, Discord, Google services, Facebook, etc.) — these connections go directly from your device to those providers. Their handling of your data is governed by **their** privacy policies, not this one. OmniDeck does not inject analytics into, read the contents of, or proxy these sessions.
Requests OmniDeck makes itself — to Open-Meteo, to Twelve Data and for the web-app catalog — name the app and its version in their User-Agent header (for example `OmniDeck/0.3.0`), as these services ask of apps; they carry nothing else about you or your device.
## 3. Bug reports
Bug reporting is manual and transparent: the app shows you the pre-filled issue text, scrubs query strings/cookies/token-shaped values from captured console output and logs, and writes the log zip locally for you to review and attach yourself. Nothing is uploaded automatically.
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -47,7 +47,7 @@ Spotify's "Continue with Google / Facebook / Apple" buttons were not tried; the
## Consequences
- **Google's account domains on every country-code TLD.** Google lists them at `https://www.google.com/supported_domains`. Enumerating about 190 domains in each `google` entry would be unreadable. The proposal is a catalog schema v2 field, `navAllowSets: ["google-account-domains"]`, which the app resolves from a list it bundles. A narrower rule in code would only allow `accounts.google.<ccTLD>/accounts/SetSID`. Either way this changes the catalog or its schema, so it is decided in P2 with the maintainer's approval.
- **Google's account domains on every country-code TLD.** Google lists them at `https://www.google.com/supported_domains`. Enumerating about 190 domains in each `google` entry would be unreadable. The proposal is a catalog schema v2 field, `navAllowSets: ["google-account-domains"]`, which the app resolves from a list it bundles. A narrower rule in code would only allow `accounts.google.<ccTLD>/accounts/SetSID`. Either way this changes the catalog or its schema, so it is decided in P2 with the maintainer's approval. **Decided on 2 November 2026:** the first option, with the set defined in the catalog itself instead of bundled with the app, so it changes with a catalog pull request ([WEBAPP-CATALOG](../WEBAPP-CATALOG.md) §1).
- **Sessions must be checked, not assumed.** The P2 exit criterion "stays signed in across hibernation" makes the unexplained loss a real risk:
- P2 dogfoods with Chromium logging available;
- the web runner records whether each app comes back signed in after a restart. The `--check-signed-in` probes become a debug-only health check;
+1 -1
View File
@@ -66,7 +66,7 @@ The SPEC set keeps the plugin folders access, audio filter, audio mixer, audio o
## Consequences
- **Engine:** LibVLCSharp with libVLC 3.0.x, as [SPEC](../SPEC.md#36-media-player) §3.6 says. FlyleafLib stays unused.
- **Fullscreen:** the module's own window (main or pop-out) covers the monitor; the player never moves to a separate fullscreen window. This passes the fullscreen part of [WPFUI-CONVENTIONS](../WPFUI-CONVENTIONS.md#8-hard-rules) §8.
- **Fullscreen:** the module's own window (main or pop-out) covers the monitor; the player never moves to a separate fullscreen window. This passes the fullscreen part of [WPFUI-CONVENTIONS](../WPFUI-CONVENTIONS.md#9-hard-rules) §8.
- **Pop-out:** move the player to the new `VideoView`, re-select the video track, and seek to the current time. Pop-out ships only after P2 fixes the overlay's sizing in a newly created window and re-tests it, as §8 requires.
- **Build:**
- set `VlcWindowsX86Enabled` and `VlcWindowsArm64Enabled` to `false` and use the SPEC include list;
+93
View File
@@ -0,0 +1,93 @@
<#
.SYNOPSIS
Draws OmniDeck's application icon: the monogram "O" on a blue rounded square, as the tray icon
draws it (src/OmniDeck.App/Shell/OdTrayIcon.cs), at the sizes Windows asks for.
.DESCRIPTION
Writes src/OmniDeck.App/Assets/OmniDeck.ico, which the executable, its windows and Velopack's
Setup use. It stands in until a designed icon exists: replacing that file is enough, and this
script need not run again. WPF draws the images, so run it in an STA thread, as pwsh does.
.EXAMPLE
pwsh scripts/make-icon.ps1
#>
[CmdletBinding()]
param(
[string]$OutFile = (Join-Path $PSScriptRoot '..\src\OmniDeck.App\Assets\OmniDeck.ico')
)
$ErrorActionPreference = 'Stop'
Add-Type -AssemblyName PresentationCore, PresentationFramework, WindowsBase
# Windows' default accent, which the tray icon also falls back to.
$background = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.Color]::FromRgb(0x00, 0x67, 0xC0))
$foreground = [System.Windows.Media.Brushes]::White
$sizes = @(16, 20, 24, 32, 40, 48, 64, 256)
function New-IconImage([int]$Size) {
$visual = [System.Windows.Media.DrawingVisual]::new()
$context = $visual.RenderOpen()
$corner = $Size / 8.0
$context.DrawRoundedRectangle($background, $null, [System.Windows.Rect]::new(0, 0, $Size, $Size), $corner, $corner)
$typeface = [System.Windows.Media.Typeface]::new(
[System.Windows.SystemFonts]::MessageFontFamily,
[System.Windows.FontStyles]::Normal,
[System.Windows.FontWeights]::Bold,
[System.Windows.FontStretches]::Normal)
$text = [System.Windows.Media.FormattedText]::new(
'O',
[Globalization.CultureInfo]::InvariantCulture,
[System.Windows.FlowDirection]::LeftToRight,
$typeface,
$Size * 0.8,
$foreground,
1.0)
$glyph = $text.BuildGeometry([System.Windows.Point]::new(0, 0))
$bounds = $glyph.Bounds
$context.PushTransform([System.Windows.Media.TranslateTransform]::new((($Size - $bounds.Width) / 2) - $bounds.X, (($Size - $bounds.Height) / 2) - $bounds.Y))
$context.DrawGeometry($foreground, $null, $glyph)
$context.Pop()
$context.Close()
$bitmap = [System.Windows.Media.Imaging.RenderTargetBitmap]::new($Size, $Size, 96, 96, [System.Windows.Media.PixelFormats]::Pbgra32)
$bitmap.Render($visual)
$encoder = [System.Windows.Media.Imaging.PngBitmapEncoder]::new()
$encoder.Frames.Add([System.Windows.Media.Imaging.BitmapFrame]::Create($bitmap))
$png = [IO.MemoryStream]::new()
$encoder.Save($png)
return , $png.ToArray()
}
$images = foreach ($size in $sizes) { , (New-IconImage $size) }
# ICO: the directory, one entry per image, then the images, PNG-compressed (Windows reads those).
$ico = [IO.MemoryStream]::new()
$writer = [IO.BinaryWriter]::new($ico)
$writer.Write([uint16]0)
$writer.Write([uint16]1)
$writer.Write([uint16]$sizes.Count)
$offset = 6 + (16 * $sizes.Count)
for ($i = 0; $i -lt $sizes.Count; $i++) {
# Width and height are one byte each: 0 means 256.
$dimension = [byte]($sizes[$i] % 256)
$writer.Write($dimension)
$writer.Write($dimension)
$writer.Write([byte]0)
$writer.Write([byte]0)
$writer.Write([uint16]1)
$writer.Write([uint16]32)
$writer.Write([uint32]$images[$i].Length)
$writer.Write([uint32]$offset)
$offset += $images[$i].Length
}
foreach ($image in $images) {
$writer.Write([byte[]]$image)
}
$writer.Flush()
$OutFile = [IO.Path]::GetFullPath($OutFile)
New-Item -ItemType Directory -Force -Path (Split-Path $OutFile) | Out-Null
[IO.File]::WriteAllBytes($OutFile, $ico.ToArray())
Write-Host "Wrote $OutFile ($($sizes -join ', ') px)"
+165
View File
@@ -0,0 +1,165 @@
<#
.SYNOPSIS
Drives a development OmniDeck through UI Automation, without the mouse or the keyboard.
.DESCRIPTION
For checking a Debug build by hand, beside an installed OmniDeck: run the Debug build with its own
data root ($env:OMNIDECK_DATA_ROOT, see CONTRIBUTING.md), then point this script at its process.
It never moves the mouse or types: it invokes elements through UI Automation and posts keys to
OmniDeck's own windows. Not part of CI.
Actions:
windows the process's top-level windows
tree the UI Automation tree (control view) down to -Depth
audit what screen readers would trip on: controls without a name, names that are a type's or
a record's, list items that can't be invoked or selected, sibling controls sharing a name
invoke invokes, selects or toggles the element named -Name (within the element named -Within)
open opens -Name through the command palette, as Ctrl+K does
capture saves a PNG of the main window to -Path (PrintWindow: it need not be in front)
minimize, restore, state the main window's state
.EXAMPLE
$env:OMNIDECK_DATA_ROOT = "$env:TEMP\OmniDeck.Dev"
$app = Start-Process src\OmniDeck.App\bin\Debug\net10.0-windows\OmniDeck.exe -PassThru
pwsh scripts/od-drive.ps1 -ProcessId $app.Id -Action open -Name Weather
pwsh scripts/od-drive.ps1 -ProcessId $app.Id -Action audit
#>
param(
[Parameter(Mandatory)] [int] $ProcessId,
[Parameter(Mandatory)] [ValidateSet('windows', 'tree', 'audit', 'invoke', 'open', 'capture', 'minimize', 'restore', 'state')] [string] $Action,
[string] $Name,
[string] $Within,
[string] $Path,
[int] $Depth = 6
)
$ErrorActionPreference = 'Stop'
Add-Type -AssemblyName UIAutomationClient, UIAutomationTypes, System.Drawing
Add-Type -Namespace OdDrive -Name Native -MemberDefinition @'
[StructLayout(LayoutKind.Sequential)] public struct RECT { public int Left, Top, Right, Bottom; }
[DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll")] public static extern bool IsIconic(IntPtr hWnd);
[DllImport("user32.dll")] public static extern bool IsWindowVisible(IntPtr hWnd);
[DllImport("user32.dll")] public static extern bool PostMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr hWnd, out RECT rect);
[DllImport("user32.dll")] public static extern bool PrintWindow(IntPtr hWnd, IntPtr hdc, uint flags);
'@
$ae = [System.Windows.Automation.AutomationElement]
$scope = [System.Windows.Automation.TreeScope]
$walker = [System.Windows.Automation.TreeWalker]::ControlViewWalker
$windows = $ae::RootElement.FindAll($scope::Children, (New-Object System.Windows.Automation.PropertyCondition($ae::ProcessIdProperty, $ProcessId)))
$main = (Get-Process -Id $ProcessId).MainWindowHandle
function Named([string] $text) { New-Object System.Windows.Automation.PropertyCondition($ae::NameProperty, $text) }
function Patterns($element) { ($element.GetSupportedPatterns() | ForEach-Object { $_.ProgrammaticName -replace 'PatternIdentifiers.Pattern', '' }) -join ',' }
function Children($element) {
$child = $walker.GetFirstChild($element)
while ($null -ne $child) {
$child
$child = $walker.GetNextSibling($child)
}
}
function Show-Tree($element, [int] $level) {
if ($level -gt $Depth) { return }
foreach ($child in Children $element) {
$c = $child.Current
'{0}{1} "{2}" [{3}] {4}' -f (' ' * $level), $c.ControlType.ProgrammaticName.Replace('ControlType.', ''), $c.Name, $c.AutomationId, (Patterns $child)
Show-Tree $child ($level + 1)
}
}
$needsName = 'Button', 'CheckBox', 'RadioButton', 'ComboBox', 'Edit', 'Hyperlink', 'ListItem', 'DataItem', 'TabItem', 'MenuItem', 'Slider', 'Spinner', 'TreeItem', 'SplitButton', 'Image'
function Audit($element, [string] $path) {
$kids = @(Children $element)
$kids | Where-Object { $_.Current.Name } |
Group-Object { $_.Current.ControlType.ProgrammaticName + ' "' + $_.Current.Name + '"' } |
Where-Object { $_.Count -gt 1 -and $_.Name -notmatch '^ControlType\.(Text|Separator)' } |
ForEach-Object { 'SHARED {0} x{1} @ {2}' -f $_.Name.Replace('ControlType.', ''), $_.Count, $path }
foreach ($kid in $kids) {
$c = $kid.Current
$type = $c.ControlType.ProgrammaticName.Replace('ControlType.', '')
if ($c.IsOffscreen -and $type -ne 'TabItem') { continue }
$patterns = Patterns $kid
if ($type -in $needsName -and [string]::IsNullOrWhiteSpace($c.Name)) { 'NO NAME {0} [{1}] {2} @ {3}' -f $type, $c.AutomationId, $patterns, $path }
if ($c.Name -match '\{ |^Od[A-Z]|^System\.|^Wpf\.|^OmniDeck\.|\d24$|Regular$') { 'BAD NAME {0} "{1}" @ {2}' -f $type, $c.Name, $path }
if ($type -in 'DataItem', 'ListItem' -and $patterns -notmatch 'Invoke|SelectionItem|Toggle|ExpandCollapse') { 'NO ACTION {0} "{1}" @ {2}' -f $type, $c.Name, $path }
$label = if ($c.Name) { $c.Name.Substring(0, [Math]::Min(30, $c.Name.Length)) } else { $type }
Audit $kid "$path > $label"
}
}
function Press($element) {
$pattern = $null
if ($element.TryGetCurrentPattern([System.Windows.Automation.InvokePattern]::Pattern, [ref] $pattern)) { $pattern.Invoke(); return 'invoked' }
if ($element.TryGetCurrentPattern([System.Windows.Automation.SelectionItemPattern]::Pattern, [ref] $pattern)) { $pattern.Select(); return 'selected' }
if ($element.TryGetCurrentPattern([System.Windows.Automation.TogglePattern]::Pattern, [ref] $pattern)) { $pattern.Toggle(); return 'toggled' }
'found, but it has no Invoke, SelectionItem or Toggle pattern'
}
switch ($Action) {
'windows' {
foreach ($w in $windows) { '"{0}" hwnd={1} class={2}' -f $w.Current.Name, $w.Current.NativeWindowHandle, $w.Current.ClassName }
}
'tree' {
foreach ($w in $windows) { '== "{0}"' -f $w.Current.Name; Show-Tree $w 1 }
}
'audit' {
foreach ($w in $windows) { '== "{0}"' -f $w.Current.Name; Audit $w $w.Current.Name }
}
'invoke' {
foreach ($w in $windows) {
$root = if ($Within) { $w.FindFirst($scope::Descendants, (Named $Within)) } else { $w }
if ($null -eq $root) { continue }
$target = $root.FindFirst($scope::Descendants, (Named $Name))
if ($null -ne $target) { "$(Press $target) '$Name'"; return }
}
"not found: '$Name'"
}
'open' {
# The title bar's search box opens the palette; Enter is posted to the palette's own window.
$shell = $windows | Where-Object { $_.Current.NativeWindowHandle -eq [int] $main } | Select-Object -First 1
# By automation ID, which no language changes.
$search = New-Object System.Windows.Automation.PropertyCondition($ae::AutomationIdProperty, 'PaletteButton')
$shell.FindFirst($scope::Descendants, $search).GetCurrentPattern([System.Windows.Automation.InvokePattern]::Pattern).Invoke()
# The palette is a window the main one owns: UI Automation lists it beside the main window or under it.
$palette = $null
for ($try = 0; $try -lt 20 -and $null -eq $palette; $try++) {
Start-Sleep -Milliseconds 150
$palette = $ae::RootElement.FindAll($scope::Children, (New-Object System.Windows.Automation.PropertyCondition($ae::ProcessIdProperty, $ProcessId))) |
Where-Object { $_.Current.NativeWindowHandle -ne [int] $main } | Select-Object -First 1
if ($null -eq $palette) {
$palette = $shell.FindFirst($scope::Children, (New-Object System.Windows.Automation.PropertyCondition($ae::ControlTypeProperty, [System.Windows.Automation.ControlType]::Window)))
}
}
if ($null -eq $palette) { throw 'The palette did not open.' }
$edit = $palette.FindFirst($scope::Descendants, (New-Object System.Windows.Automation.PropertyCondition($ae::ControlTypeProperty, [System.Windows.Automation.ControlType]::Edit)))
$edit.GetCurrentPattern([System.Windows.Automation.ValuePattern]::Pattern).SetValue($Name)
Start-Sleep -Milliseconds 400
$hwnd = [IntPtr] $palette.Current.NativeWindowHandle
[OdDrive.Native]::PostMessage($hwnd, 0x0100, [IntPtr] 0x0D, [IntPtr] 0x001C0001) | Out-Null
[OdDrive.Native]::PostMessage($hwnd, 0x0101, [IntPtr] 0x0D, [IntPtr] 0xC01C0001) | Out-Null
"opened '$Name' through the palette"
}
'capture' {
if (-not $Path) { throw 'capture needs -Path.' }
$rect = New-Object OdDrive.Native+RECT
[OdDrive.Native]::GetWindowRect($main, [ref] $rect) | Out-Null
$bitmap = New-Object System.Drawing.Bitmap(($rect.Right - $rect.Left), ($rect.Bottom - $rect.Top))
$graphics = [System.Drawing.Graphics]::FromImage($bitmap)
$hdc = $graphics.GetHdc()
[OdDrive.Native]::PrintWindow($main, $hdc, 2) | Out-Null
$graphics.ReleaseHdc($hdc)
$graphics.Dispose()
$bitmap.Save($Path, [System.Drawing.Imaging.ImageFormat]::Png)
$bitmap.Dispose()
"saved $Path"
}
'minimize' { [OdDrive.Native]::ShowWindow($main, 7) | Out-Null; 'minimized' }
'restore' { [OdDrive.Native]::ShowWindow($main, 4) | Out-Null; 'restored' }
'state' { "hwnd=$main iconic=$([OdDrive.Native]::IsIconic($main)) visible=$([OdDrive.Native]::IsWindowVisible($main))" }
}
+2 -1
View File
@@ -94,7 +94,8 @@ try {
--packAuthors poli0981 `
--packVersion $Version `
--packDir $publishDir `
--mainExe OmniDeck.exe
--mainExe OmniDeck.exe `
--icon (Join-Path $repoRoot 'src\OmniDeck.App\Assets\OmniDeck.ico')
if ($LASTEXITCODE -ne 0) { throw "vpk pack failed with exit code $LASTEXITCODE" }
}
finally {
+35 -6
View File
@@ -8,8 +8,9 @@
CI runs this script on every pull request. Checks (docs/WEBAPP-CATALOG.md §1–§2):
- the file matches catalog/webapps.schema.json (types, required fields, formats, HTTPS);
- app ids and names are unique;
- the startUrl host and every popupAllow entry are covered by navAllow, matching whole DNS
labels (google.com covers mail.google.com, never evilgoogle.com);
- every navAllowSets name an app uses exists, and every set is used;
- the startUrl host is covered by navAllow, and every popupAllow entry by navAllow or the app's
sets, matching whole DNS labels (google.com covers mail.google.com, never evilgoogle.com);
- updated is a real date and not in the future.
Exits with code 1 and one line per problem when anything fails.
@@ -84,6 +85,16 @@ else {
$problems.Add("updated: $updatedText is in the future")
}
$sets = @{}
$unusedSets = [System.Collections.Generic.HashSet[string]]::new([StringComparer]::Ordinal)
$setsProperty = [System.Text.Json.JsonElement]::new()
if ($root.TryGetProperty('navAllowSets', [ref] $setsProperty)) {
foreach ($set in $setsProperty.EnumerateObject()) {
$sets[$set.Name] = [string[]] @($set.Value.EnumerateArray() | ForEach-Object { $_.GetString() })
[void] $unusedSets.Add($set.Name)
}
}
$ids = [System.Collections.Generic.HashSet[string]]::new([StringComparer]::Ordinal)
$names = [System.Collections.Generic.HashSet[string]]::new([StringComparer]::OrdinalIgnoreCase)
foreach ($app in $root.GetProperty('apps').EnumerateArray()) {
@@ -98,12 +109,30 @@ else {
if (-not (Test-DomainCover $startHost $navAllow)) {
$problems.Add("apps[$id]: startUrl host '$startHost' is not covered by navAllow")
}
foreach ($popup in $app.GetProperty('popupAllow').EnumerateArray()) {
$popupDomain = $popup.GetString()
if (-not (Test-DomainCover $popupDomain $navAllow)) {
$problems.Add("apps[$id]: popupAllow '$popupDomain' is not covered by navAllow")
$allowed = [System.Collections.Generic.List[string]]::new($navAllow)
$appSets = [System.Text.Json.JsonElement]::new()
if ($app.TryGetProperty('navAllowSets', [ref] $appSets)) {
foreach ($setName in @($appSets.EnumerateArray() | ForEach-Object { $_.GetString() })) {
if ($sets.ContainsKey($setName)) {
$allowed.AddRange($sets[$setName])
[void] $unusedSets.Remove($setName)
}
else {
$problems.Add("apps[$id]: navAllowSets '$setName' is not defined")
}
}
}
foreach ($popup in $app.GetProperty('popupAllow').EnumerateArray()) {
$popupDomain = $popup.GetString()
if (-not (Test-DomainCover $popupDomain $allowed.ToArray())) {
$problems.Add("apps[$id]: popupAllow '$popupDomain' is not covered by navAllow or its navAllowSets")
}
}
}
foreach ($unused in $unusedSets) {
$problems.Add("navAllowSets[$unused]: no app uses this set")
}
}
finally {
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

@@ -0,0 +1,77 @@
using System.Windows;
using System.Windows.Interop;
using Microsoft.Extensions.DependencyInjection;
using OmniDeck.App.Diagnostics;
using OmniDeck.App.Settings;
using OmniDeck.App.Shell;
using OmniDeck.App.Theming;
using OmniDeck.App.Updates;
using OmniDeck.Core.Localization;
using OmniDeck.Core.Modules;
using OmniDeck.Core.Reports;
using OmniDeck.Core.Settings;
using OmniDeck.Core.Storage;
using OmniDeck.Web.Apps;
using OmniDeck.Web.Catalog;
using OmniDeck.Web.Diagnostics;
using OmniDeck.Web.Runtime;
using Serilog;
using Wpf.Ui;
namespace OmniDeck.App.Composition;
/// <summary>Registers the WPF shell's services on top of <c>AddOmniDeckCore</c>.</summary>
internal static class OdAppServiceCollectionExtensions
{
public static IServiceCollection AddOmniDeckApp(this IServiceCollection services)
{
// WPF-UI's dialog and snackbar services; the main window hands them their hosts.
services.AddSingleton<IContentDialogService, ContentDialogService>();
services.AddSingleton<ISnackbarService, SnackbarService>();
services.AddSingleton<OdDialogs>();
services.AddSingleton<OdBugReportRequests>();
services.AddSingleton<OdBugReports>();
services.AddSingleton<OdBugReporter>();
services.AddSingleton<OdBugReportFlow>();
services.AddSingleton<OdMessageBoxErrorPresenter>();
services.AddSingleton<IOdErrorPresenter, OdDialogErrorPresenter>();
services.AddSingleton<OdCrashHandler>();
services.AddSingleton<OdThemeEngine>();
services.AddSingleton<OdTrayNotifier>();
services.AddSingleton<IOdNotifier>(provider => provider.GetRequiredService<OdTrayNotifier>());
services.AddSingleton<IOdAppLifetime, OdAppLifetime>();
services.AddSingleton<OdShellViewModel>();
services.AddSingleton<OdMemoryViewModel>();
services.AddSingleton<IOdUpdateService, OdVelopackUpdateService>();
services.AddSingleton<OdUpdateWatcher>();
services.AddSingleton<IOdStartupRegistration>(_ => new OdRunKeyStartup());
services.AddSingleton(provider => new OdAboutViewModel(provider.GetRequiredService<IOdUpdateService>(), OdExternal.Open));
services.AddSingleton(provider => new OdWebAppsViewModel(
provider.GetRequiredService<OdCatalogService>(),
provider.GetRequiredService<OdWebPreferences>(),
provider.GetRequiredService<IOdSettingsService>(),
provider.GetRequiredService<OdModuleHost>(),
provider.GetRequiredService<OdSignInHealth>(),
profile => provider.GetRequiredService<OdWebRuntime>().ClearProfileAsync(profile, MainWindowHandle()),
apps => provider.GetRequiredService<OdDialogs>().ConfirmAsync(
OdLocalization.Get("WebApps_ClearTitle"),
OdLocalization.Format("WebApps_ClearMessage", apps),
OdLocalization.Get("WebApps_ClearConfirm")),
provider.GetRequiredService<ILogger>()));
services.AddSingleton(provider => new OdSettingsViewModel(
provider.GetRequiredService<IOdSettingsService>(),
provider.GetRequiredService<IOdStartupRegistration>(),
provider.GetRequiredService<OdDataRoot>(),
provider.GetRequiredService<OdMemoryViewModel>(),
provider.GetRequiredService<OdWebAppsViewModel>(),
provider.GetRequiredService<OdAboutViewModel>(),
OdExternal.OpenFolder));
services.AddSingleton<OdMainWindow>();
return services;
}
// The hidden browser that clears a profile needs a window; Settings is in the main one.
private static nint MainWindowHandle() => new WindowInteropHelper(Application.Current.MainWindow).Handle;
}
@@ -0,0 +1,10 @@
namespace OmniDeck.App.Diagnostics;
/// <summary>
/// Shows the user that something failed: an in-window dialog once the main window is up
/// (<see cref="OdDialogErrorPresenter"/>), a message box before that.
/// </summary>
internal interface IOdErrorPresenter
{
void Show(string message);
}
@@ -0,0 +1,72 @@
using System.ComponentModel;
using System.IO;
using OmniDeck.App.Settings;
using OmniDeck.App.Shell;
using OmniDeck.Core.Localization;
using OmniDeck.Core.Modules;
using OmniDeck.Core.Reports;
using Serilog;
using Wpf.Ui.Controls;
namespace OmniDeck.App.Diagnostics;
/// <summary>
/// Reporting a bug (docs/legal/PRIVACY.md §3): the report is previewed in a dialog. On the user's
/// say-so it is saved as a zip, File Explorer shows it, and the browser opens a new GitHub issue with
/// the form's short fields filled in. Nothing is uploaded: the user attaches the zip.
/// </summary>
public sealed class OdBugReportFlow(OdDialogs dialogs, OdBugReporter reporter, OdBugReports reports, OdModuleHost host, ILogger log)
{
/// <summary>Where new issues are filed.</summary>
public const string NewIssue = OdAboutViewModel.Repository + "/issues/new";
private readonly ILogger _log = log.ForContext<OdBugReportFlow>();
/// <summary>The new-issue page with the form's short fields filled in; the long ones are in the zip's issue.md.</summary>
public static Uri IssueUrl(OdBugReport report)
{
ArgumentNullException.ThrowIfNull(report);
return new Uri(NewIssue
+ "?template=bug_report.yml"
+ "&version=" + Uri.EscapeDataString(report.Version)
+ "&os=" + Uri.EscapeDataString(report.Windows)
+ "&preset=" + Uri.EscapeDataString(report.Preset)
+ "&module=" + Uri.EscapeDataString(report.Subject));
}
/// <summary>Shows the dialog; <paramref name="error"/> is the error OmniDeck showed, when the report comes from it.</summary>
public async Task ShowAsync(string? error)
{
if (!dialogs.CanShow)
{
return;
}
var model = new OdBugReportViewModel(reporter, host.Current?.Info.Id ?? "", error);
var answer = await dialogs.ShowAsync(new ContentDialog
{
Title = OdLocalization.Get("Report_Title"),
Content = new OdBugReportView { DataContext = model },
PrimaryButtonText = OdLocalization.Get("Report_Save"),
CloseButtonText = OdLocalization.Get("Dialog_Cancel"),
DefaultButton = ContentDialogButton.Primary,
DialogMaxWidth = 760,
});
if (answer != ContentDialogResult.Primary)
{
return;
}
try
{
var path = reports.Save(model.Report);
_log.Information("Saved a bug report as {File}", Path.GetFileName(path));
OdExternal.ShowFile(path);
OdExternal.Open(IssueUrl(model.Report));
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or Win32Exception)
{
_log.Warning(ex, "The bug report could not be saved or shown");
}
}
}
@@ -0,0 +1,7 @@
namespace OmniDeck.App.Diagnostics;
/// <summary>A bug report was asked for, about <see cref="Error"/> when it came from the error dialog.</summary>
public sealed class OdBugReportRequestedEventArgs(string? error) : EventArgs
{
public string? Error { get; } = error;
}
@@ -0,0 +1,12 @@
namespace OmniDeck.App.Diagnostics;
/// <summary>
/// Where the error dialog asks for a bug report about the error it showed; the main window, which
/// shows the report dialog, answers. It keeps the crash handler free of the report's many services.
/// </summary>
public sealed class OdBugReportRequests
{
public event EventHandler<OdBugReportRequestedEventArgs>? Requested;
public void Request(string? error) => Requested?.Invoke(this, new OdBugReportRequestedEventArgs(error));
}
@@ -0,0 +1,25 @@
<UserControl x:Class="OmniDeck.App.Diagnostics.OdBugReportView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:res="clr-namespace:OmniDeck.Core.Localization;assembly=OmniDeck.Core">
<StackPanel>
<TextBlock Margin="{DynamicResource Od.Margin.Item}"
Text="{res:OdLoc Report_Intro}"
TextWrapping="Wrap" />
<TextBlock Margin="{DynamicResource Od.Padding.Control}" Text="{res:OdLoc Report_Subject}" />
<ComboBox Margin="{DynamicResource Od.Margin.Item}"
AutomationProperties.Name="{res:OdLoc Report_Subject}"
ItemsSource="{Binding Subjects}"
SelectedValue="{Binding Subject}"
SelectedValuePath="Value" />
<TextBlock Margin="{DynamicResource Od.Padding.Control}" Text="{res:OdLoc Report_Preview}" />
<TextBox Height="280"
AutomationProperties.Name="{res:OdLoc Report_Preview}"
FontFamily="Consolas"
HorizontalScrollBarVisibility="Auto"
IsReadOnly="True"
Text="{Binding Preview, Mode=OneWay}"
TextWrapping="NoWrap"
VerticalScrollBarVisibility="Auto" />
</StackPanel>
</UserControl>
@@ -0,0 +1,10 @@
namespace OmniDeck.App.Diagnostics;
/// <summary>The bug-report dialog's content, bound to <see cref="OdBugReportViewModel"/>.</summary>
public partial class OdBugReportView
{
public OdBugReportView()
{
InitializeComponent();
}
}
@@ -0,0 +1,44 @@
using CommunityToolkit.Mvvm.ComponentModel;
using OmniDeck.App.Settings;
using OmniDeck.Core.Reports;
namespace OmniDeck.App.Diagnostics;
/// <summary>The bug-report dialog: what the report is about, and the issue text it will carry.</summary>
public sealed partial class OdBugReportViewModel : ObservableObject
{
private readonly OdBugReporter _reporter;
private readonly string? _error;
[ObservableProperty]
private string _subject;
[ObservableProperty]
private string _preview;
/// <summary>The dialog's model, about <paramref name="subject"/> to begin with.</summary>
/// <param name="reporter">Composes the report.</param>
/// <param name="subject">The module the report starts out about; empty for OmniDeck in general.</param>
/// <param name="error">The error OmniDeck showed, when the report comes from the error dialog.</param>
public OdBugReportViewModel(OdBugReporter reporter, string subject, string? error)
{
ArgumentNullException.ThrowIfNull(reporter);
_reporter = reporter;
_error = error;
Subjects = reporter.Subjects();
_subject = Subjects.Any(choice => string.Equals(choice.Value, subject, StringComparison.Ordinal)) ? subject : "";
Report = reporter.Compose(_subject, error);
_preview = Report.Issue;
}
public IReadOnlyList<OdChoice<string>> Subjects { get; }
/// <summary>The report as it stands, for the subject chosen.</summary>
public OdBugReport Report { get; private set; }
partial void OnSubjectChanged(string value)
{
Report = _reporter.Compose(value, _error);
Preview = Report.Issue;
}
}
@@ -0,0 +1,201 @@
using System.Globalization;
using System.IO;
using System.Text;
using System.Text.Json;
using Microsoft.Win32;
using OmniDeck.App.Settings;
using OmniDeck.Core;
using OmniDeck.Core.Governor;
using OmniDeck.Core.Localization;
using OmniDeck.Core.Modules;
using OmniDeck.Core.Reports;
using OmniDeck.Core.Settings;
using OmniDeck.Core.Storage;
using OmniDeck.Web.Apps;
using OmniDeck.Web.Catalog;
using OmniDeck.Web.Diagnostics;
using OmniDeck.Web.Runtime;
namespace OmniDeck.App.Diagnostics;
/// <summary>
/// Puts a bug report together (docs/legal/PRIVACY.md §3): OmniDeck's version, Windows' build, the UI
/// preset, the modules and what they use, the end of the log and, for a web app, its console, each
/// passed through <see cref="OdScrubber"/>. Used from the UI thread.
/// </summary>
public sealed class OdBugReporter(
IOdSettingsService settings,
OdModuleHost host,
OdRamGovernor governor,
OdDataRoot dataRoot,
OdCatalog catalog,
OdSignInHealth health,
TimeProvider time)
{
/// <summary>How many log lines a report carries.</summary>
public const int LogLines = 500;
private static readonly OdVersionInfo Version = OdVersionInfo.FromAssembly(typeof(OdBugReporter).Assembly);
/// <summary>What a report can be about: OmniDeck in general, then each module.</summary>
public IReadOnlyList<OdChoice<string>> Subjects() =>
[new("", OdLocalization.Get("Report_General")), .. host.Modules.Select(hosted => new OdChoice<string>(hosted.Info.Id, hosted.Info.Title))];
/// <summary>A report about the module <paramref name="subjectId"/> (empty: OmniDeck in general), with the error OmniDeck showed, if any.</summary>
public OdBugReport Compose(string subjectId, string? error)
{
ArgumentNullException.ThrowIfNull(subjectId);
var hosted = subjectId.Length > 0 ? host.Find(subjectId) : null;
var web = hosted?.Module as OdWebAppModule;
var subject = hosted?.Info.Title ?? OdLocalization.Get("Report_General");
var windows = WindowsVersion();
var preset = settings.Current.Preset;
var errors = web is null ? "" : OdConsoleLog.Write(web.Console.Errors);
return new OdBugReport
{
Version = Version.DisplayText,
Windows = windows,
Preset = preset,
Subject = subject,
Issue = OdScrubber.Scrub(Issue(windows, preset, hosted?.Info.Id ?? "OmniDeck in general", errors, error)),
SystemInfo = OdScrubber.Scrub(SystemInfo(windows, preset)),
Logs = OdScrubber.Scrub(LogTail()),
ConsoleLog = web is null ? null : OdScrubber.Scrub(OdConsoleLog.Write(web.Console.All)),
ConsoleOf = web?.Info.Id,
};
}
/// <summary>Windows' version and build, as the bug form asks for them.</summary>
internal static string WindowsVersion()
{
using var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
var display = key?.GetValue("DisplayVersion") as string;
var build = key?.GetValue("CurrentBuild") as string ?? Environment.OSVersion.Version.Build.ToString(CultureInfo.InvariantCulture);
var revision = key?.GetValue("UBR") is int ubr ? "." + ubr.ToString(CultureInfo.InvariantCulture) : "";
return string.IsNullOrEmpty(display) ? $"Windows 11 ({build}{revision})" : $"Windows 11 {display} ({build}{revision})";
}
// The issue is for the maintainer: it stays in English whatever the UI language, so modules go by id.
private string Issue(string windows, string preset, string subject, string consoleErrors, string? error)
{
var issue = new StringBuilder();
Section(issue, "OmniDeck version", Version.DisplayText);
Section(issue, "Windows version / build", windows);
Section(issue, "UI preset", preset);
Section(issue, "Affected module / web app", subject);
Section(issue, "What happened, and what did you expect?", "_What you did, what happened, and what you expected instead._");
Section(issue, "Console errors", consoleErrors.Length == 0 ? "_None captured._" : "```text\n" + consoleErrors + "\n```");
if (error is not null)
{
Section(issue, "The error OmniDeck showed", "```text\n" + error + "\n```");
}
var snapshot = governor.Snapshot;
var now = time.GetUtcNow();
var modules = new StringBuilder("| Module | State | Hidden for | Memory |\n|---|---|---|---|\n");
foreach (var module in host.Modules.Where(module => module.State != OdModuleState.Created))
{
var hidden = module.State == OdModuleState.Active ? "" : ((int)(now - module.LastActive).TotalMinutes).ToString(CultureInfo.InvariantCulture) + " min";
var memory = snapshot?.For(module.Info.Id) is { } bytes ? OdBytes.Format(bytes) : "";
modules.Append(CultureInfo.InvariantCulture, $"| {module.Info.Id} | {module.State} | {hidden} | {memory} |\n");
}
Section(issue, "Modules", modules.ToString().TrimEnd());
return issue.ToString();
}
private static void Section(StringBuilder issue, string heading, string body) =>
issue.Append("### ").Append(heading).Append("\n\n").Append(body).Append("\n\n");
private string SystemInfo(string windows, string preset)
{
using var stream = new MemoryStream();
using (var json = new Utf8JsonWriter(stream, new JsonWriterOptions { Indented = true }))
{
json.WriteStartObject();
json.WriteString("version", Version.Version);
json.WriteString("commit", Version.Commit);
json.WriteString("windows", windows);
json.WriteString("webView2", OdWebRuntime.InstalledVersion());
json.WriteString("preset", preset);
json.WriteString("language", CultureInfo.CurrentUICulture.Name);
json.WriteString("catalog", catalog.Updated);
WriteMemory(json);
json.WriteStartArray("modules");
var now = time.GetUtcNow();
foreach (var module in host.Modules)
{
json.WriteStartObject();
json.WriteString("id", module.Info.Id);
json.WriteString("state", module.State.ToString());
json.WriteNumber("hiddenMinutes", module.State is OdModuleState.Created or OdModuleState.Active ? 0 : (int)(now - module.LastActive).TotalMinutes);
if (governor.Snapshot?.For(module.Info.Id) is { } bytes)
{
json.WriteNumber("memoryBytes", bytes);
}
json.WriteEndObject();
}
json.WriteEndArray();
json.WriteStartObject("signInCookies");
foreach (var profile in catalog.Apps.Select(app => app.Profile).Distinct(StringComparer.Ordinal))
{
if (health.Kept(profile) is { } count)
{
json.WriteNumber(profile, count);
}
}
json.WriteEndObject();
json.WriteEndObject();
}
return Encoding.UTF8.GetString(stream.ToArray());
}
private void WriteMemory(Utf8JsonWriter json)
{
var options = governor.Options;
json.WriteStartObject("memory");
json.WriteNumber("committedBytes", governor.CommittedBytes);
if (governor.Snapshot is { } snapshot)
{
json.WriteNumber("shellBytes", snapshot.ShellBytes);
json.WriteNumber("sharedBytes", snapshot.SharedBytes);
}
json.WriteNumber("softCapBytes", options.SoftCapBytes);
json.WriteNumber("hardCapBytes", options.HardCapBytes);
json.WriteEndObject();
}
/// <summary>The last <see cref="LogLines"/> lines of the logs, newest file last.</summary>
private string LogTail()
{
var lines = new List<string>();
var files = Directory.Exists(dataRoot.LogsDirectory)
? Directory.GetFiles(dataRoot.LogsDirectory, "omnideck-*.log").OrderByDescending(File.GetLastWriteTimeUtc).ToList()
: [];
foreach (var file in files.TakeWhile(_ => lines.Count < LogLines))
{
lines.InsertRange(0, ReadShared(file).TakeLast(LogLines - lines.Count));
}
return string.Join("\n", lines);
}
// The log is open for writing; read it without getting in the way.
private static List<string> ReadShared(string path)
{
using var stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
using var reader = new StreamReader(stream);
var lines = new List<string>();
while (reader.ReadLine() is { } line)
{
lines.Add(line);
}
return lines;
}
}
@@ -0,0 +1,148 @@
using System.Globalization;
using System.Windows;
using OmniDeck.Core.Localization;
using Serilog;
namespace OmniDeck.App.Diagnostics;
/// <summary>
/// Global failure handling (docs/ARCHITECTURE.md §6): every unhandled exception is logged; one on the
/// UI thread is shown with a support code that matches the log entry, and OmniDeck keeps running.
/// A failure that repeats is reported once per <see cref="RepeatWindow"/> and only counted in between:
/// a control stuck in a loop once threw the same exception thousands of times a second, and each one
/// was logged in full and wanted a dialog of its own. The bug-report flow (P2) hangs off the same dialog.
/// </summary>
internal sealed class OdCrashHandler
{
/// <summary>How long a repeat of a reported failure is only counted.</summary>
internal static readonly TimeSpan RepeatWindow = TimeSpan.FromMinutes(1);
private readonly ILogger _log;
private readonly IOdErrorPresenter _presenter;
private readonly TimeProvider _time;
private readonly Lock _gate = new();
private readonly Dictionary<uint, Reported> _reported = [];
private int _showing;
public OdCrashHandler(ILogger log, IOdErrorPresenter presenter, TimeProvider time)
{
_log = log.ForContext<OdCrashHandler>();
_presenter = presenter;
_time = time;
}
public void Hook(Application app)
{
app.DispatcherUnhandledException += (_, e) =>
{
HandleUiException(e.Exception);
e.Handled = true;
};
AppDomain.CurrentDomain.UnhandledException += (_, e) => HandleFatal(e.ExceptionObject as Exception, e.IsTerminating);
TaskScheduler.UnobservedTaskException += (_, e) =>
{
HandleUnobserved(e.Exception);
e.SetObserved();
};
}
/// <summary>A short code the user can quote; it is logged next to the exception.</summary>
internal static string SupportCode(Exception exception, DateTimeOffset when) =>
string.Create(CultureInfo.InvariantCulture, $"{when:yyMMdd-HHmm}-{Fingerprint(exception) % 0x10000:X4}");
/// <summary>A UI-thread failure: logged, shown with its support code; the app keeps running.</summary>
/// <returns>The support code.</returns>
internal string HandleUiException(Exception exception)
{
var now = _time.GetLocalNow();
var code = SupportCode(exception, now);
if (!ShouldReport(exception, now, out var repeats))
{
return code;
}
if (repeats > 0)
{
_log.Error(exception, "Unhandled UI exception, support code {SupportCode}; it repeated {Repeats} times since the last report", code, repeats);
}
else
{
_log.Error(exception, "Unhandled UI exception, support code {SupportCode}", code);
}
// A failure inside the dialog itself must not stack dialogs.
if (Interlocked.Exchange(ref _showing, 1) == 0)
{
try
{
_presenter.Show(OdLocalization.Format("Error_UiMessage", code, exception.Message));
}
finally
{
Volatile.Write(ref _showing, 0);
}
}
return code;
}
internal void HandleFatal(Exception? exception, bool terminating)
{
_log.Fatal(exception, "Unhandled exception (terminating: {Terminating})", terminating);
Log.CloseAndFlush();
}
internal void HandleUnobserved(Exception exception)
{
if (!ShouldReport(exception, _time.GetLocalNow(), out var repeats))
{
return;
}
if (repeats > 0)
{
_log.Error(exception, "Unobserved task exception; it repeated {Repeats} times since the last report", repeats);
}
else
{
_log.Error(exception, "Unobserved task exception");
}
}
// FNV-1a over the exception type and message: stable for the same failure, cheap, and free of
// anything personal.
private static uint Fingerprint(Exception exception)
{
var hash = 2166136261u;
foreach (var c in exception.GetType().FullName + exception.Message)
{
hash = (hash ^ c) * 16777619u;
}
return hash;
}
/// <summary>
/// Whether to report <paramref name="exception"/> now. A repeat within <see cref="RepeatWindow"/> of
/// its last report is only counted; <paramref name="repeats"/> is the count since that report.
/// </summary>
private bool ShouldReport(Exception exception, DateTimeOffset now, out int repeats)
{
var fingerprint = Fingerprint(exception);
lock (_gate)
{
if (_reported.TryGetValue(fingerprint, out var last) && now - last.At < RepeatWindow)
{
_reported[fingerprint] = last with { Repeats = last.Repeats + 1 };
repeats = 0;
return false;
}
repeats = last?.Repeats ?? 0;
_reported[fingerprint] = new Reported(now, 0);
return true;
}
}
private sealed record Reported(DateTimeOffset At, int Repeats);
}
@@ -0,0 +1,36 @@
using OmniDeck.App.Shell;
using OmniDeck.Core.Localization;
using Wpf.Ui.Controls;
namespace OmniDeck.App.Diagnostics;
/// <summary>Shows errors in an in-window dialog, or in a message box while no dialog can show.</summary>
internal sealed class OdDialogErrorPresenter(OdDialogs dialogs, OdMessageBoxErrorPresenter fallback, OdBugReportRequests reports) : IOdErrorPresenter
{
public void Show(string message)
{
if (!dialogs.CanShow)
{
fallback.Show(message);
return;
}
_ = ShowAsync(message);
}
private async Task ShowAsync(string message)
{
var answer = await dialogs.ShowAsync(new ContentDialog
{
Title = OdLocalization.Get("Error_Title"),
Content = message,
SecondaryButtonText = OdLocalization.Get("Error_Report"),
CloseButtonText = OdLocalization.Get("Dialog_OK"),
DefaultButton = ContentDialogButton.Close,
});
if (answer == ContentDialogResult.Secondary)
{
reports.Request(message);
}
}
}
+35
View File
@@ -0,0 +1,35 @@
using OmniDeck.Core.Storage;
using Serilog;
using Serilog.Events;
namespace OmniDeck.App.Diagnostics;
/// <summary>
/// Serilog to rolling files under the data root's <c>logs\</c> folder, kept for seven days
/// (docs/SPEC.md §5). The age limit decides what goes: a count limit alone would let a burst of
/// errors, which rolls a new file every 10 MB, push out the week before it. Nothing leaves the
/// machine; bug reports attach a tail of these files only when the user asks for one.
/// </summary>
internal static class OdLogging
{
private const string Template = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {SourceContext}: {Message:lj}{NewLine}{Exception}";
public static ILogger CreateLogger(OdDataRoot dataRoot) =>
new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("System", LogEventLevel.Warning)
.WriteTo.File(
System.IO.Path.Combine(dataRoot.LogsDirectory, "omnideck-.log"),
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: 31,
retainedFileTimeLimit: TimeSpan.FromDays(7),
fileSizeLimitBytes: 10 * 1024 * 1024,
rollOnFileSizeLimit: true,
outputTemplate: Template,
formatProvider: System.Globalization.CultureInfo.InvariantCulture)
.CreateLogger();
}
@@ -0,0 +1,10 @@
using System.Windows;
namespace OmniDeck.App.Diagnostics;
/// <summary>The fallback presenter: a plain message box, which works before any window exists.</summary>
internal sealed class OdMessageBoxErrorPresenter : IOdErrorPresenter
{
public void Show(string message) =>
MessageBox.Show(message, "OmniDeck", MessageBoxButton.OK, MessageBoxImage.Warning);
}
+8
View File
@@ -0,0 +1,8 @@
namespace OmniDeck.App.Legal;
/// <summary>One legal document as the gate shows it: its title and its Markdown text.</summary>
public sealed record OdLegalPage(string Title, string Markdown)
{
/// <summary>The title: screen readers name a tab after its data, which would otherwise be the whole text.</summary>
public override string ToString() => Title;
}
@@ -0,0 +1,64 @@
using System.IO;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using OmniDeck.Core.Legal;
using OmniDeck.Core.Localization;
namespace OmniDeck.App.Legal;
/// <summary>
/// The legal gate (docs/SPEC.md §2): the shipped documents, a "read them" check, and Continue or
/// Quit. Continue records the acknowledgment; it is not a condition of the GPL. With
/// <c>readOnly</c>, the same documents open from About, with nothing to acknowledge.
/// </summary>
public sealed partial class OdLegalViewModel : ObservableObject
{
private readonly OdLegalGate _gate;
[ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(ContinueCommand))]
private bool _hasRead;
public OdLegalViewModel(OdLegalGate gate, string legalFolder, bool readOnly = false)
{
ArgumentNullException.ThrowIfNull(gate);
ArgumentNullException.ThrowIfNull(legalFolder);
_gate = gate;
IsReadOnly = readOnly;
Pages = [.. OdLegal.Documents.Select(document => new OdLegalPage(OdLocalization.Get(document.TitleKey), Read(Path.Combine(legalFolder, document.FileName))))];
}
/// <summary>Raised when the user continues or quits; <see cref="Accepted"/> says which.</summary>
public event EventHandler? Finished;
public IReadOnlyList<OdLegalPage> Pages { get; }
public bool IsReadOnly { get; }
public bool AsksForAcknowledgment => !IsReadOnly;
/// <summary>"Quit" at the gate; "Close" when the documents were opened to read them again.</summary>
public string QuitText => IsReadOnly ? OdLocalization.Get("Legal_Close") : OdLocalization.Get("Legal_Quit");
/// <summary>True after Continue, false after Quit, null while undecided.</summary>
public bool? Accepted { get; private set; }
private static string Read(string path) =>
File.Exists(path) ? File.ReadAllText(path) : OdLocalization.Format("Legal_Missing", Path.GetFileName(path));
[RelayCommand(CanExecute = nameof(HasRead))]
private void Continue()
{
_gate.Acknowledge();
Finish(accepted: true);
}
[RelayCommand]
private void Quit() => Finish(accepted: false);
private void Finish(bool accepted)
{
Accepted = accepted;
Finished?.Invoke(this, EventArgs.Empty);
}
}
+65
View File
@@ -0,0 +1,65 @@
<ui:FluentWindow x:Class="OmniDeck.App.Legal.OdLegalWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:legal="clr-namespace:OmniDeck.App.Legal"
xmlns:res="clr-namespace:OmniDeck.Core.Localization;assembly=OmniDeck.Core"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="{res:OdLoc Legal_Title}"
Width="860"
Height="680"
MinWidth="560"
MinHeight="420"
ExtendsContentIntoTitleBar="True"
WindowBackdropType="Mica"
WindowStartupLocation="CenterScreen">
<ui:FluentWindow.Resources>
<legal:OdMarkdownConverter x:Key="Markdown" />
<BooleanToVisibilityConverter x:Key="Visible" />
</ui:FluentWindow.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ui:TitleBar Title="{res:OdLoc Legal_Title}" Grid.Row="0" />
<TextBlock Grid.Row="1"
Margin="{DynamicResource Od.Padding.Card}"
Text="{res:OdLoc Legal_Intro}"
TextWrapping="Wrap" />
<TabControl Grid.Row="2"
Margin="{DynamicResource Od.Padding.Control}"
ItemsSource="{Binding Pages}"
SelectedIndex="0">
<TabControl.ItemTemplate>
<DataTemplate DataType="{x:Type legal:OdLegalPage}">
<TextBlock Text="{Binding Title}" />
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate DataType="{x:Type legal:OdLegalPage}">
<FlowDocumentScrollViewer Document="{Binding Markdown, Converter={StaticResource Markdown}}"
IsToolBarVisible="False"
VerticalScrollBarVisibility="Auto" />
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
<DockPanel Grid.Row="3" Margin="{DynamicResource Od.Padding.Card}">
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
Appearance="Primary"
Command="{Binding ContinueCommand}"
Content="{res:OdLoc Legal_Continue}"
Visibility="{Binding AsksForAcknowledgment, Converter={StaticResource Visible}}" />
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
Command="{Binding QuitCommand}"
Content="{Binding QuitText}" />
</StackPanel>
<CheckBox VerticalAlignment="Center"
Content="{res:OdLoc Legal_HaveRead}"
IsChecked="{Binding HasRead}"
Visibility="{Binding AsksForAcknowledgment, Converter={StaticResource Visible}}" />
</DockPanel>
</Grid>
</ui:FluentWindow>
@@ -0,0 +1,35 @@
namespace OmniDeck.App.Legal;
/// <summary>
/// Shows the legal documents: as the gate before the main window (first run, and after each legal
/// update), or opened again from About to read them.
/// </summary>
public partial class OdLegalWindow
{
private bool _isGate;
public OdLegalWindow(OdLegalViewModel viewModel)
{
ArgumentNullException.ThrowIfNull(viewModel);
InitializeComponent();
DataContext = viewModel;
viewModel.Finished += (_, _) =>
{
if (_isGate)
{
DialogResult = viewModel.Accepted;
}
else
{
Close();
}
};
}
/// <summary>Shows the gate and waits: true once the user continued; closing the window counts as Quit.</summary>
public bool ShowGate()
{
_isGate = true;
return ShowDialog() == true;
}
}
@@ -0,0 +1,16 @@
using System.Globalization;
using System.Windows.Data;
using System.Windows.Documents;
using OmniDeck.App.Shell;
namespace OmniDeck.App.Legal;
/// <summary>Binds Markdown text to a <c>FlowDocumentScrollViewer</c>; links open in the default browser.</summary>
[ValueConversion(typeof(string), typeof(FlowDocument))]
public sealed class OdMarkdownConverter : IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) =>
OdMarkdownRenderer.Render(value as string ?? "", OdExternal.Open);
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => Binding.DoNothing;
}
@@ -0,0 +1,245 @@
using System.Windows;
using System.Windows.Documents;
using System.Windows.Markup;
using System.Windows.Media;
using Markdig;
using Markdig.Syntax;
using Markdig.Syntax.Inlines;
using OmniDeck.Core.Theming;
using MdBlock = Markdig.Syntax.Block;
using MdInline = Markdig.Syntax.Inlines.Inline;
using MdTable = Markdig.Extensions.Tables.Table;
using MdTableCell = Markdig.Extensions.Tables.TableCell;
using MdTableRow = Markdig.Extensions.Tables.TableRow;
using WpfBlock = System.Windows.Documents.Block;
using WpfInline = System.Windows.Documents.Inline;
using WpfTable = System.Windows.Documents.Table;
namespace OmniDeck.App.Legal;
/// <summary>
/// Turns the legal documents' Markdown into a <see cref="FlowDocument"/>. It covers what docs/legal
/// uses: headings, paragraphs, emphasis, inline code, links, lists, pipe tables, quotes, code blocks
/// and rules. Text sizes follow the <c>Od.*</c> font tokens; links go to the caller, which opens them.
/// </summary>
internal static class OdMarkdownRenderer
{
private static readonly MarkdownPipeline Pipeline = new MarkdownPipelineBuilder().UsePipeTables().Build();
private static readonly FontFamily Monospace = new("Cascadia Mono, Consolas, Courier New");
// Theme brushes rather than fixed colors, so lines follow light, dark and High Contrast.
private const string DividerBrush = "DividerStrokeColorDefaultBrush";
private const string QuoteBrush = "ControlStrongStrokeColorDefaultBrush";
public static FlowDocument Render(string markdown, Action<Uri> openLink)
{
ArgumentNullException.ThrowIfNull(markdown);
ArgumentNullException.ThrowIfNull(openLink);
// A FlowDocument defaults to a serif reading font and justified text; the app's own font reads better here.
// The documents exist in English only (docs/legal): they say so to screen readers and to WPF's
// text handling, whatever the UI language around them.
var document = new FlowDocument
{
PagePadding = new Thickness(0),
FontFamily = SystemFonts.MessageFontFamily,
TextAlignment = TextAlignment.Left,
Language = XmlLanguage.GetLanguage("en"),
};
document.SetResourceReference(FlowDocument.FontSizeProperty, OdTokenKeys.FontBase);
document.SetResourceReference(FlowDocument.ForegroundProperty, "TextFillColorPrimaryBrush");
foreach (var block in Markdown.Parse(markdown, Pipeline))
{
if (RenderBlock(block, openLink) is { } rendered)
{
document.Blocks.Add(rendered);
}
}
return document;
}
private static WpfBlock? RenderBlock(MdBlock block, Action<Uri> openLink) => block switch
{
HeadingBlock heading => Heading(heading, openLink),
ParagraphBlock paragraph => Paragraph(paragraph.Inline, openLink),
ListBlock list => List(list, openLink),
MdTable table => Table(table, openLink),
QuoteBlock quote => Quote(quote, openLink),
CodeBlock code => Code(code),
ThematicBreakBlock => Bordered(new Paragraph(), new Thickness(0, 0, 0, 1), DividerBrush),
_ => null,
};
private static Paragraph Heading(HeadingBlock heading, Action<Uri> openLink)
{
var paragraph = Paragraph(heading.Inline, openLink);
paragraph.FontWeight = FontWeights.SemiBold;
paragraph.Margin = new Thickness(0, heading.Level == 1 ? 0 : 12, 0, 4);
paragraph.SetResourceReference(
TextElement.FontSizeProperty,
heading.Level switch
{
1 => OdTokenKeys.FontH1,
2 => OdTokenKeys.FontH2,
_ => OdTokenKeys.FontBase,
});
return paragraph;
}
private static Paragraph Paragraph(ContainerInline? inlines, Action<Uri> openLink)
{
var paragraph = new Paragraph { Margin = new Thickness(0, 0, 0, 8) };
AddInlines(paragraph.Inlines, inlines, openLink);
return paragraph;
}
private static List List(ListBlock list, Action<Uri> openLink)
{
var rendered = new List
{
MarkerStyle = list.IsOrdered ? TextMarkerStyle.Decimal : TextMarkerStyle.Disc,
Margin = new Thickness(0, 0, 0, 8),
};
foreach (var item in list.OfType<ListItemBlock>())
{
var listItem = new ListItem();
foreach (var child in item)
{
if (RenderBlock(child, openLink) is { } block)
{
block.Margin = new Thickness(0);
listItem.Blocks.Add(block);
}
}
rendered.ListItems.Add(listItem);
}
return rendered;
}
private static WpfTable Table(MdTable table, Action<Uri> openLink)
{
var rendered = new WpfTable { CellSpacing = 0, Margin = new Thickness(0, 0, 0, 8) };
var rows = new TableRowGroup();
foreach (var row in table.OfType<MdTableRow>())
{
var renderedRow = new TableRow();
foreach (var cell in row.OfType<MdTableCell>())
{
var renderedCell = new TableCell { BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(4, 2, 8, 2) };
renderedCell.SetResourceReference(TableCell.BorderBrushProperty, DividerBrush);
foreach (var block in cell)
{
if (RenderBlock(block, openLink) is { } content)
{
content.Margin = new Thickness(0);
renderedCell.Blocks.Add(content);
}
}
if (row.IsHeader)
{
renderedCell.FontWeight = FontWeights.SemiBold;
}
renderedRow.Cells.Add(renderedCell);
}
rows.Rows.Add(renderedRow);
}
rendered.RowGroups.Add(rows);
return rendered;
}
private static T Bordered<T>(T block, Thickness thickness, string brushKey)
where T : WpfBlock
{
block.BorderThickness = thickness;
block.SetResourceReference(WpfBlock.BorderBrushProperty, brushKey);
return block;
}
private static Section Quote(QuoteBlock quote, Action<Uri> openLink)
{
var section = Bordered(new Section { Padding = new Thickness(8, 0, 0, 0) }, new Thickness(3, 0, 0, 0), QuoteBrush);
foreach (var child in quote)
{
if (RenderBlock(child, openLink) is { } block)
{
section.Blocks.Add(block);
}
}
return section;
}
private static Paragraph Code(CodeBlock code) =>
new(new Run(code.Lines.ToString())) { FontFamily = Monospace, Margin = new Thickness(0, 0, 0, 8) };
private static void AddInlines(InlineCollection target, ContainerInline? container, Action<Uri> openLink)
{
for (var inline = container?.FirstChild; inline is not null; inline = inline.NextSibling)
{
if (RenderInline(inline, openLink) is { } rendered)
{
target.Add(rendered);
}
}
}
private static WpfInline? RenderInline(MdInline inline, Action<Uri> openLink)
{
switch (inline)
{
case LiteralInline literal:
return new Run(literal.Content.ToString());
case CodeInline code:
return new Run(code.Content) { FontFamily = Monospace };
case LineBreakInline lineBreak:
return lineBreak.IsHard ? new LineBreak() : new Run(" ");
case LinkInline { IsImage: false } link:
return Link(link.Url, link, openLink);
case AutolinkInline autolink:
return Link(autolink.Url, null, openLink, autolink.Url);
case EmphasisInline emphasis:
Span span = emphasis.DelimiterCount >= 2 ? new Bold() : new Italic();
AddInlines(span.Inlines, emphasis, openLink);
return span;
case ContainerInline container:
var group = new Span();
AddInlines(group.Inlines, container, openLink);
return group;
default:
return null;
}
}
private static WpfInline Link(string? url, ContainerInline? content, Action<Uri> openLink, string? text = null)
{
var span = new Span();
if (content is not null)
{
AddInlines(span.Inlines, content, openLink);
}
else
{
span.Inlines.Add(new Run(text ?? url ?? ""));
}
// Only absolute web and mail links open; relative links point into the source repository.
if (!Uri.TryCreate(url, UriKind.Absolute, out var uri) || uri.Scheme is not ("https" or "http" or "mailto"))
{
return span;
}
var hyperlink = new Hyperlink(span) { NavigateUri = uri };
hyperlink.RequestNavigate += (_, e) =>
{
openLink(e.Uri);
e.Handled = true;
};
return hyperlink;
}
}
+3 -3
View File
@@ -1,14 +1,14 @@
<Application x:Class="OmniDeck.App.OdApp"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
StartupUri="OdMainWindow.xaml">
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- WPF-UI dictionaries first; the Od.* preset layer goes on top in P1 (docs/UI-MODES.md). -->
<!-- WPF-UI dictionaries first, then our implicit styles; OdThemeEngine adds the Od.* preset layer last (docs/UI-MODES.md). -->
<ui:ThemesDictionary Theme="Dark" />
<ui:ControlsDictionary />
<ResourceDictionary Source="Theming/OdStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
+170
View File
@@ -0,0 +1,170 @@
using System.IO;
using System.Windows;
using Microsoft.Extensions.DependencyInjection;
using OmniDeck.App.Composition;
using OmniDeck.App.Diagnostics;
using OmniDeck.App.Legal;
using OmniDeck.App.Resources;
using OmniDeck.App.Settings;
using OmniDeck.App.Shell;
using OmniDeck.App.Theming;
using OmniDeck.App.Updates;
using OmniDeck.Core;
using OmniDeck.Core.Governor;
using OmniDeck.Core.Legal;
using OmniDeck.Core.Localization;
using OmniDeck.Core.Runtime;
using OmniDeck.Core.Settings;
using OmniDeck.Core.Storage;
using OmniDeck.Modules;
using OmniDeck.Modules.Calendar;
using OmniDeck.Modules.Resources;
using OmniDeck.Modules.Timer;
using OmniDeck.Web;
using OmniDeck.Web.Catalog;
using OmniDeck.Web.Resources;
using OmniDeck.Web.Runtime;
using Serilog;
namespace OmniDeck.App;
/// <summary>
/// The WPF application: builds the data root, the logger and the service container, hooks crash
/// handling, then shows the main window. Shutdown is explicit because the tray keeps OmniDeck
/// running after its window closes.
/// </summary>
public partial class OdApp
{
private readonly OdSingleInstanceGuard _guard;
private readonly OdDataRoot _dataRoot;
private ServiceProvider? _services;
internal OdApp(OdSingleInstanceGuard guard, OdDataRoot dataRoot)
{
_guard = guard;
_dataRoot = dataRoot;
}
/// <summary>The legal documents that ship next to the executable.</summary>
public static string LegalFolder => Path.Combine(AppContext.BaseDirectory, "legal");
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
ShutdownMode = ShutdownMode.OnExplicitShutdown;
OdLocalization.Instance.Register(OdAppStrings.Resources);
OdLocalization.Instance.Register(OdModuleStrings.Resources);
OdLocalization.Instance.Register(OdWebStrings.Resources);
try
{
Start(e.Args);
}
catch (Exception ex)
{
Log.ForContext<OdApp>().Fatal(ex, "OmniDeck could not start");
MessageBox.Show(OdLocalization.Format("Error_StartFailed", ex.Message), OdLocalization.Get("App_Name"), MessageBoxButton.OK, MessageBoxImage.Error);
Shutdown(1);
}
}
protected override void OnExit(ExitEventArgs e)
{
Log.ForContext<OdApp>().Information("OmniDeck exiting with code {ExitCode}", e.ApplicationExitCode);
_services?.Dispose();
OdDatabase.ReleaseAll();
Log.CloseAndFlush();
base.OnExit(e);
}
private void Start(string[] args)
{
var startMinimized = args.Contains(OdRunKeyStartup.MinimizedArgument, StringComparer.OrdinalIgnoreCase);
var dataRoot = _dataRoot;
dataRoot.EnsureCreated();
Log.Logger = OdLogging.CreateLogger(dataRoot);
Log.ForContext<OdApp>().Information("OmniDeck {Version} starting", OdVersionInfo.FromAssembly(typeof(OdApp).Assembly).DisplayText);
if (!dataRoot.IsDefault)
{
Log.ForContext<OdApp>().Warning("Development data root in use: {DataRoot}", dataRoot.Root);
}
// The catalog decides which web-app modules exist, so it loads before the container is built.
var catalog = OdCatalogService.LoadInstalled(dataRoot, TimeProvider.System, Log.Logger);
var webOptions = new OdWebOptions(ChromiumLogging: args.Contains(OdWebOptions.LoggingSwitch, StringComparer.OrdinalIgnoreCase));
_services = new ServiceCollection()
.AddOmniDeckCore(dataRoot, Log.Logger)
.AddOmniDeckModules()
.AddOmniDeckWeb(catalog, webOptions)
.AddOmniDeckApp()
.BuildServiceProvider(new ServiceProviderOptions { ValidateOnBuild = true, ValidateScopes = true });
_services.GetRequiredService<OdCrashHandler>().Hook(this);
var applied = _services.GetRequiredService<OdDatabase>().Migrate(OdCoreMigrations.All);
Log.ForContext<OdApp>().Information("Database ready ({Applied} migrations applied)", applied);
var settings = _services.GetRequiredService<IOdSettingsService>();
FollowLanguage(settings);
OdAutomationNames.Register();
var theme = _services.GetRequiredService<OdThemeEngine>();
theme.Start(this);
// The legal gate comes first, on the first run and after each legal update; Quit ends here.
var legal = _services.GetRequiredService<OdLegalGate>();
if (!legal.IsAcknowledged && !new OdLegalWindow(new OdLegalViewModel(legal, LegalFolder)).ShowGate())
{
Log.ForContext<OdApp>().Information("Legal documents not acknowledged; quitting");
Shutdown(0);
return;
}
var meta = _services.GetRequiredService<IOdAppMeta>();
if (OdOnboardingViewModel.IsNeeded(meta))
{
new OdOnboardingWindow(new OdOnboardingViewModel(settings, meta, theme.Preview)).ShowDialog();
}
// Only now may a second launch bring the window up: never past the gate.
_guard.StartListening(() => _ = Dispatcher.InvokeAsync(() => MainShell().Present()));
var window = MainShell();
if (!startMinimized)
{
window.Present();
}
_services.GetRequiredService<OdRamGovernor>().Start();
_services.GetRequiredService<OdUpdateWatcher>().Start();
_services.GetRequiredService<OdReminderService>().Start();
_services.GetRequiredService<OdAlarmService>().Start();
_services.GetRequiredService<OdCatalogService>().Start();
}
/// <summary>Puts the UI in the language the settings name, now and whenever they change.</summary>
private void FollowLanguage(IOdSettingsService settings)
{
OdLocalization.Instance.SetCulture(OdLocalization.Instance.ResolveCulture(settings.Current.Language));
OdLocalization.Instance.TrackWindowLanguage();
settings.Changed += (_, e) => Dispatcher.Invoke(() => OdLocalization.Instance.SetCulture(OdLocalization.Instance.ResolveCulture(e.Settings.Language)));
}
/// <summary>The main window, created once. It owns the tray icon, so it exists even while hidden.</summary>
private OdMainWindow MainShell()
{
if (MainWindow is not OdMainWindow window)
{
window = _services!.GetRequiredService<OdMainWindow>();
MainWindow = window;
// A real close (tray off, or Quit) ends the app; otherwise closing only hides the window.
var lifetime = _services!.GetRequiredService<IOdAppLifetime>();
window.Closed += (_, _) =>
{
if (!lifetime.IsQuitting)
{
_ = lifetime.QuitAsync();
}
};
}
return window;
}
}
+104 -16
View File
@@ -1,30 +1,118 @@
<ui:FluentWindow x:Class="OmniDeck.App.OdMainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:res="clr-namespace:OmniDeck.Core.Localization;assembly=OmniDeck.Core"
xmlns:shell="clr-namespace:OmniDeck.App.Shell"
xmlns:tb="clr-namespace:H.NotifyIcon;assembly=H.NotifyIcon.Wpf"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="OmniDeck"
Width="960"
Height="600"
Title="{res:OdLoc App_Name}"
Width="1100"
Height="720"
MinWidth="640"
MinHeight="420"
Closing="OnClosing"
ExtendsContentIntoTitleBar="True"
PreviewKeyDown="OnPreviewKeyDown"
WindowBackdropType="Mica"
WindowStartupLocation="CenterScreen">
<ui:FluentWindow.Resources>
<!-- Sidebar labels at the preset's text size: WPF-UI's item template sets 14 px on its content. -->
<DataTemplate x:Key="NavLabel">
<TextBlock FontSize="{DynamicResource Od.Font.Base}"
Text="{Binding}"
TextTrimming="CharacterEllipsis" />
</DataTemplate>
</ui:FluentWindow.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ui:TitleBar Title="OmniDeck" Grid.Row="0" />
<!-- Kickoff placeholder: the real shell (navigation, module host) arrives in P1. -->
<StackPanel Grid.Row="1"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<ui:TextBlock HorizontalAlignment="Center"
FontTypography="Title"
Text="OmniDeck" />
<ui:TextBlock x:Name="VersionText"
Margin="0,8,0,0"
HorizontalAlignment="Center"
Appearance="Secondary" />
</StackPanel>
<ui:TitleBar x:Name="AppTitleBar"
Title="{res:OdLoc App_Name}"
Grid.Row="0">
<!-- Looks like a search box; opens the command palette, as Ctrl+K does. -->
<ui:TitleBar.CenterContent>
<ui:Button Width="360"
Margin="{DynamicResource Od.Margin.Leading}"
HorizontalContentAlignment="Left"
AutomationProperties.AutomationId="PaletteButton"
AutomationProperties.Name="{res:OdLoc Shell_Search}"
Click="OnSearchClick"
ToolTip="{res:OdLoc Shell_SearchShortcut}">
<DockPanel>
<ui:SymbolIcon Margin="{DynamicResource Od.Margin.Inline}"
DockPanel.Dock="Left"
Symbol="Search24" />
<TextBlock VerticalAlignment="Center"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{res:OdLoc Shell_Search}"
TextTrimming="CharacterEllipsis" />
</DockPanel>
</ui:Button>
</ui:TitleBar.CenterContent>
</ui:TitleBar>
<!--
Chrome only: items are built in code from OdShellViewModel.Sidebar and every navigation goes through it.
OdNavigationView gives screen readers the sidebar's items; being a subclass, it takes WPF-UI's style by name.
-->
<shell:OdNavigationView x:Name="RootNavigation"
Grid.Row="1"
FrameMargin="0"
IsBackButtonVisible="Collapsed"
IsPaneToggleVisible="True"
OpenPaneLength="240"
PaneDisplayMode="Left"
Style="{StaticResource {x:Type ui:NavigationView}}"
TitleBar="{Binding ElementName=AppTitleBar, Mode=OneWay}">
<shell:OdNavigationView.ContentOverlay>
<Grid>
<ui:SnackbarPresenter x:Name="RootSnackbar" VerticalAlignment="Bottom" />
</Grid>
</shell:OdNavigationView.ContentOverlay>
</shell:OdNavigationView>
<!-- In-window dialogs cover the whole window, title bar included. -->
<ui:ContentDialogHost x:Name="RootDialogHost"
Grid.Row="0"
Grid.RowSpan="2" />
<!--
The tray icon lives as long as this window, which closing only hides (docs/SPEC.md §2).
Its image is drawn in code (OdTrayIcon), never with GeneratedIconSource.
-->
<tb:TaskbarIcon x:Name="TrayIcon"
Grid.Row="0"
NoLeftClickDelay="True"
ToolTipText="{res:OdLoc App_Name}"
TrayBalloonTipClicked="OnTrayNotificationClicked"
TrayLeftMouseUp="OnTrayOpen">
<tb:TaskbarIcon.ContextMenu>
<ContextMenu Opened="OnTrayMenuOpened">
<MenuItem Click="OnTrayOpen" Header="{res:OdLoc Tray_Open}" />
<MenuItem Click="OnTrayQuickTimer" Header="{res:OdLoc Tray_QuickTimer}" />
<!-- Shown while a media module has something loaded (docs/SPEC.md §2). -->
<Separator x:Name="TrayMediaSeparator" Visibility="Collapsed" />
<MenuItem x:Name="TrayNowPlaying"
IsEnabled="False"
Visibility="Collapsed" />
<MenuItem x:Name="TrayPlayPause"
Click="OnTrayPlayPause"
Visibility="Collapsed" />
<MenuItem x:Name="TrayNext"
Click="OnTrayNext"
Header="{res:OdLoc Tray_Next}"
Visibility="Collapsed" />
<MenuItem x:Name="TrayPrevious"
Click="OnTrayPrevious"
Header="{res:OdLoc Tray_Previous}"
Visibility="Collapsed" />
<Separator />
<MenuItem Click="OnTrayQuit" Header="{res:OdLoc Tray_Quit}" />
</ContextMenu>
</tb:TaskbarIcon.ContextMenu>
</tb:TaskbarIcon>
</Grid>
</ui:FluentWindow>
+658 -5
View File
@@ -1,13 +1,666 @@
using OmniDeck.Core;
using System.ComponentModel;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Threading;
using H.NotifyIcon.Core;
using OmniDeck.App.Diagnostics;
using OmniDeck.App.Legal;
using OmniDeck.App.Settings;
using OmniDeck.App.Shell;
using OmniDeck.App.Theming;
using OmniDeck.Core.Legal;
using OmniDeck.Core.Localization;
using OmniDeck.Core.Modules;
using OmniDeck.Core.Runtime;
using OmniDeck.Core.Settings;
using OmniDeck.Core.Storage;
using OmniDeck.Core.Theming;
using OmniDeck.Modules.Timer;
using Wpf.Ui;
using Wpf.Ui.Abstractions;
using Wpf.Ui.Controls;
using MenuItem = System.Windows.Controls.MenuItem;
namespace OmniDeck.App;
/// <summary>Placeholder shell window of the kickoff build; the real shell arrives in P1.</summary>
public partial class OdMainWindow
/// <summary>
/// The shell window: the title bar with the palette button, the navigation view as sidebar chrome,
/// the module stage, in-window dialogs and snackbars, and the tray icon. Closing hides it into the
/// tray unless the user turned that off or is quitting.
/// </summary>
public partial class OdMainWindow : INavigationViewPageProvider
{
public OdMainWindow()
private const int WmSettingChange = 0x001A;
// How far below and right of this window's corner a module's own window first opens.
private const double PopOutOffset = 48;
private readonly OdShellViewModel _shell;
private readonly OdDialogs _dialogs;
private readonly OdTrayNotifier _notifier;
private readonly IOdSettingsService _settings;
private readonly IOdAppLifetime _lifetime;
private readonly IOdAppMeta _meta;
private readonly IOdQuickTimer _quickTimer;
private readonly OdLibraryPage _library;
private readonly OdSettingsPage _settingsPage;
private readonly OdModuleStage _stage;
private readonly OdModuleHost _host;
private readonly OdWindowCover _cover;
private readonly Dictionary<string, OdPopOutWindow> _popOuts = new(StringComparer.Ordinal);
private readonly Dictionary<string, Rect> _popOutBounds = new(StringComparer.Ordinal);
private OdPanePlacement? _paneBeforeFullscreen;
private readonly Dictionary<string, OdNavItem> _moduleItems = new(StringComparer.Ordinal);
private readonly NavigationViewItemSeparator _pinnedSeparator = new();
private readonly OdTrayIcon _trayIcon = new();
private bool? _navLabels;
private int _navMax = -1;
public OdMainWindow(
OdThemeEngine theme,
OdShellViewModel shell,
OdSettingsViewModel settingsPage,
OdLegalGate legalGate,
OdDialogs dialogs,
ISnackbarService snackbars,
OdTrayNotifier notifier,
IOdSettingsService settings,
IOdAppLifetime lifetime,
IOdAppMeta meta,
IOdQuickTimer quickTimer,
OdBugReportFlow bugReports,
OdBugReportRequests bugReportRequests,
OdModuleHost host)
{
ArgumentNullException.ThrowIfNull(theme);
ArgumentNullException.ThrowIfNull(settingsPage);
ArgumentNullException.ThrowIfNull(snackbars);
InitializeComponent();
VersionText.Text = OdVersionInfo.FromAssembly(typeof(OdMainWindow).Assembly).DisplayText;
_shell = shell;
_dialogs = dialogs;
_notifier = notifier;
_settings = settings;
_lifetime = lifetime;
_meta = meta;
_quickTimer = quickTimer;
DataContext = shell;
_library = new OdLibraryPage { DataContext = shell };
_settingsPage = new OdSettingsPage { DataContext = settingsPage };
ListenForRequests(shell, settingsPage, legalGate, bugReports, bugReportRequests);
_stage = new OdModuleStage { DataContext = shell };
_host = host;
_cover = new OdWindowCover(this);
ListenForFullscreen(shell);
ListenForPopOuts(shell);
// A web app's browser is a native window over the stage that no dialog can cover: hide it meanwhile.
dialogs.OpenChanged += (_, _) => _stage.Visibility = dialogs.IsOpen ? Visibility.Hidden : Visibility.Visible;
dialogs.SetHost(RootDialogHost);
snackbars.SetSnackbarPresenter(RootSnackbar);
// Created now, so the icon exists even if the window never shows; no Efficiency Mode, which
// would throttle the whole process while timers run in the background. The image comes first,
// so the icon never appears blank.
UpdateTrayIcon();
TrayIcon.ForceCreate(enablesEfficiencyMode: false);
notifier.Attach((title, message) => _ = Dispatcher.InvokeAsync(() => TrayIcon.ShowNotification(title, message, NotificationIcon.Info)));
notifier.Clicked += OnNotificationClicked;
Closed += (_, _) =>
{
notifier.Clicked -= OnNotificationClicked;
TrayIcon.Dispose();
};
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();
SourceInitialized += (_, _) => HwndSource.FromHwnd(new WindowInteropHelper(this).Handle)?.AddHook(
(IntPtr _, int msg, IntPtr _, IntPtr _, ref bool _) =>
{
if (msg == WmSettingChange)
{
theme.RefreshTextScale();
}
return IntPtr.Zero;
});
}
/// <summary>Shows the window from the tray or the taskbar, restored and in front.</summary>
public void Present()
{
Show();
if (WindowState == WindowState.Minimized)
{
WindowState = WindowState.Normal;
}
Activate();
}
object? INavigationViewPageProvider.GetPage(Type pageType)
{
if (pageType == typeof(OdLibraryPage))
{
return _library;
}
if (pageType == typeof(OdSettingsPage))
{
return _settingsPage;
}
return pageType == typeof(OdModuleStage) ? _stage : null;
}
private void SetUpNavigation(OdThemeEngine theme)
{
RootNavigation.SetPageProviderService(this);
RootNavigation.FooterMenuItems.Add(ShellItem(OdShellViewModel.SettingsTarget, Localized("Settings_Nav"), SymbolRegular.Settings24, typeof(OdSettingsPage)));
RootNavigation.FooterMenuItems.Add(ShellItem(OdShellViewModel.LibraryTarget, Localized("Shell_Library"), SymbolRegular.Apps24, typeof(OdLibraryPage)));
SyncSidebar();
_shell.Sidebar.CollectionChanged += (_, _) => SyncSidebar();
_shell.PropertyChanged += OnShellPropertyChanged;
RootNavigation.SelectionChanged += OnNavigationSelectionChanged;
RootNavigation.Navigating += (_, _) => RootNavigation.TransitionDuration = (int)OdMotion.DurationFor(this).TotalMilliseconds;
RootNavigation.PaneOpened += (_, _) => UpdateToolTips();
RootNavigation.PaneClosed += (_, _) => UpdateToolTips();
theme.Applied += OnThemeApplied;
Closed += (_, _) => theme.Applied -= OnThemeApplied;
Loaded += (_, _) =>
{
ApplyNavTokens();
UpdateToolTips();
RootNavigation.Navigate(_shell.CurrentTarget);
};
}
private static Binding Localized(string key) => new($"[{key}]") { Source = OdLocalization.Instance, Mode = BindingMode.OneWay };
/// <summary>What the palette, the settings page and a crash ask the window to show.</summary>
private void ListenForRequests(OdShellViewModel shell, OdSettingsViewModel settingsPage, OdLegalGate legalGate, OdBugReportFlow bugReports, OdBugReportRequests bugReportRequests)
{
shell.SettingsSectionRequested += (_, e) => settingsPage.ShowSection(e.Section);
shell.CommandRequested += (_, e) => Run(e.Command, settingsPage, bugReports);
settingsPage.About.LegalRequested += (_, _) =>
new OdLegalWindow(new OdLegalViewModel(legalGate, OdApp.LegalFolder, readOnly: true)) { Owner = this }.Show();
settingsPage.About.BugReportRequested += (sender, args) => _ = bugReports.ShowAsync(error: null);
bugReportRequests.Requested += (sender, args) => _ = bugReports.ShowAsync(args.Error);
}
/// <summary>Carries out a command the palette ran.</summary>
private static void Run(OdShellCommand command, OdSettingsViewModel settingsPage, OdBugReportFlow bugReports)
{
switch (command)
{
case OdShellCommand.CheckForUpdates when settingsPage.About.CheckCommand.CanExecute(null):
_ = settingsPage.About.CheckCommand.ExecuteAsync(null);
break;
case OdShellCommand.ReportBug:
_ = bugReports.ShowAsync(error: null);
break;
case OdShellCommand.OpenDataFolder:
settingsPage.OpenDataFolderCommand.Execute(null);
break;
}
}
/// <summary>A sidebar icon at the preset's size: larger in Comfort (docs/UI-MODES.md §2).</summary>
private static SymbolIcon NavIcon(SymbolRegular symbol)
{
var icon = new SymbolIcon { Symbol = symbol };
icon.SetResourceReference(FontSizeProperty, OdTokenKeys.NavIconSize);
return icon;
}
/// <summary>
/// A sidebar item screen readers can use (<see cref="OdNavItem"/>), at the preset's text size and
/// minimum hit target (docs/UI-MODES.md §2): WPF-UI draws its labels at 14 px and its items 40 px
/// tall whatever the preset. Being a subclass, it takes WPF-UI's style by name.
/// </summary>
private OdNavItem NavItem(SymbolRegular icon, string target, Type pageType)
{
var item = new OdNavItem
{
Style = (Style)FindResource(typeof(NavigationViewItem)),
Icon = NavIcon(icon),
TargetPageTag = target,
TargetPageType = pageType,
ContentTemplate = (DataTemplate)FindResource("NavLabel"),
};
item.SetResourceReference(MinHeightProperty, OdTokenKeys.HitTargetMin);
return item;
}
private OdNavItem ShellItem(string target, Binding title, SymbolRegular icon, Type pageType)
{
var item = NavItem(icon, target, pageType);
item.SetBinding(ContentControl.ContentProperty, title);
item.SetBinding(AutomationProperties.NameProperty, title);
item.SetBinding(ToolTipProperty, title);
return item;
}
/// <summary>
/// Mirrors the sidebar, with a separator between pinned and merely open modules. Each module keeps
/// one item for the window's lifetime: the navigation view never forgets an item's tag, so a
/// re-added module must come back as the same item.
/// </summary>
private void SyncSidebar()
{
RootNavigation.MenuItems.Clear();
var previousPinned = false;
foreach (var module in _shell.VisibleSidebar(NavMaxVisibleItems))
{
if (previousPinned && !module.IsPinned)
{
RootNavigation.MenuItems.Add(_pinnedSeparator);
}
if (!_moduleItems.TryGetValue(module.Id, out var item))
{
item = ModuleItem(module);
_moduleItems[module.Id] = item;
}
RootNavigation.MenuItems.Add(item);
previousPinned = module.IsPinned;
}
UpdateToolTips();
}
private int NavMaxVisibleItems => TryFindResource(OdTokenKeys.NavMaxVisibleItems) is int max ? max : 0;
private void OnThemeApplied(object? sender, EventArgs e)
{
ApplyNavTokens();
UpdateTrayIcon();
}
/// <summary>Redraws the tray icon when the accent changed; the taskbar icon disposes the one it replaces.</summary>
private void UpdateTrayIcon()
{
if (_trayIcon.Update(TryFindResource("AccentFillColorDefaultBrush") as Brush, TryFindResource("TextOnAccentFillColorPrimaryBrush") as Brush) is { } icon)
{
TrayIcon.Icon = icon;
}
}
/// <summary>
/// Follows the preset's sidebar tokens (docs/UI-MODES.md §2): labels or icons only, and how many modules
/// it shows. Only a change of preset opens or closes the pane; otherwise the user's own toggle stands.
/// </summary>
private void ApplyNavTokens()
{
var labels = TryFindResource(OdTokenKeys.NavShowLabels) is not false;
if (_navLabels != labels)
{
_navLabels = labels;
RootNavigation.IsPaneOpen = labels;
}
var max = NavMaxVisibleItems;
if (_navMax != max)
{
_navMax = max;
SyncSidebar();
}
}
/// <summary>With the pane closed the sidebar shows icons only, so each item's label moves into its tooltip.</summary>
private void UpdateToolTips()
{
var show = !RootNavigation.IsPaneOpen;
foreach (var item in RootNavigation.MenuItems.OfType<NavigationViewItem>().Concat(RootNavigation.FooterMenuItems.OfType<NavigationViewItem>()))
{
ToolTipService.SetIsEnabled(item, show);
}
}
private OdNavItem ModuleItem(OdModuleItemViewModel module)
{
var pin = new MenuItem { Command = _shell.TogglePinCommand, CommandParameter = module };
var popOut = new MenuItem { CommandParameter = module };
var close = new MenuItem { Command = _shell.CloseCommand, CommandParameter = module };
close.SetBinding(HeaderedItemsControl.HeaderProperty, Localized("Shell_Close"));
var menu = new ContextMenu { Items = { pin, popOut, close } };
menu.Opened += (_, _) =>
{
pin.Header = OdLocalization.Get(module.IsPinned ? "Shell_Unpin" : "Shell_Pin");
popOut.Header = module.IsPoppedOut ? OdLocalization.Get("Shell_PopIn") : OdLocalization.Get("Shell_PopOut");
popOut.Command = module.IsPoppedOut ? _shell.PopInCommand : _shell.PopOutCommand;
};
var item = NavItem(OdSymbolConverter.Parse(module.Info.Icon), module.Id, typeof(OdModuleStage));
item.ContextMenu = menu;
item.SetBinding(ContentControl.ContentProperty, new Binding(nameof(OdModuleItemViewModel.Title)) { Source = module });
item.SetBinding(AutomationProperties.NameProperty, new Binding(nameof(OdModuleItemViewModel.Title)) { Source = module });
item.SetBinding(ToolTipProperty, new Binding(nameof(OdModuleItemViewModel.Title)) { Source = module });
return item;
}
private async void OnNavigationSelectionChanged(NavigationView sender, RoutedEventArgs args)
{
if (sender.SelectedItem is NavigationViewItem { TargetPageTag: { Length: > 0 } target })
{
await _shell.NavigateAsync(target);
// A module in a window of its own stays there: the selection goes back to what this window shows.
if (!string.Equals(target, _shell.CurrentTarget, StringComparison.Ordinal))
{
RootNavigation.Navigate(_shell.CurrentTarget);
}
}
}
private void OnShellPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (!string.Equals(e.PropertyName, nameof(OdShellViewModel.CurrentTarget), StringComparison.Ordinal))
{
return;
}
// A capped sidebar must make room for the module now on screen before it can be selected.
var max = NavMaxVisibleItems;
if (max > 0 && _shell.Sidebar.Count > max)
{
SyncSidebar();
}
var selected = (RootNavigation.SelectedItem as NavigationViewItem)?.TargetPageTag;
if (!string.Equals(selected, _shell.CurrentTarget, StringComparison.Ordinal))
{
RootNavigation.Navigate(_shell.CurrentTarget);
}
}
private async void OnPreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape && _cover.IsCovering)
{
e.Handled = true;
SetFullscreen(on: false);
return;
}
// Exactly Ctrl: AltGr arrives as Ctrl+Alt, and must type its character rather than run a shortcut.
if (Keyboard.Modifiers != ModifierKeys.Control || _dialogs.IsOpen)
{
return;
}
if (e.Key == Key.K)
{
e.Handled = true;
await OpenPaletteAsync(this);
}
else if (_shell.ShortcutTarget(e.Key, NavMaxVisibleItems) is { } target)
{
e.Handled = true;
await _shell.NavigateAsync(target);
FocusPageSoon();
}
}
private async void OnSearchClick(object sender, RoutedEventArgs e) => await OpenPaletteAsync(this);
/// <summary>
/// The command palette over <paramref name="owner"/>. What it runs happens in the main window, which
/// comes forward first when the palette was opened from a pop-out; a popped-out module brings its own
/// window back to the front.
/// </summary>
private async Task OpenPaletteAsync(Window owner)
{
var palette = new OdCommandPaletteViewModel(_shell.PaletteEntries());
new OdCommandPaletteWindow(palette, owner).ShowDialog();
if (palette.Chosen is { } chosen)
{
if (owner != this)
{
Present();
}
await chosen.RunAsync();
if (!_dialogs.IsOpen)
{
FocusPageSoon();
}
}
}
/// <summary>
/// Moves the keyboard into the page on screen once it is shown, as after a palette choice or a Ctrl+1–9
/// shortcut: the keyboard otherwise stays where the palette left it, outside the page.
/// </summary>
private void FocusPageSoon() => _ = Dispatcher.InvokeAsync(
() =>
{
FrameworkElement page = _shell.CurrentTarget switch
{
OdShellViewModel.LibraryTarget => _library,
OdShellViewModel.SettingsTarget => _settingsPage,
_ => _stage,
};
if (IsActive && !page.IsKeyboardFocusWithin)
{
page.MoveFocus(new TraversalRequest(FocusNavigationDirection.First));
}
},
DispatcherPriority.Input);
private void OnClosing(object? sender, CancelEventArgs e)
{
if (_lifetime.IsQuitting || !_settings.Current.CloseToTray)
{
return;
}
e.Cancel = true;
SetFullscreen(on: false);
Hide();
// Say once, ever, where the window went.
if (_meta.Get(OdAppMetaKeys.TrayHintShown) is null)
{
_meta.Set(OdAppMetaKeys.TrayHintShown, "1");
_notifier.Notify(OdLocalization.Get("Tray_StillRunningTitle"), OdLocalization.Get("Tray_StillRunningMessage"));
}
}
private void OnTrayOpen(object sender, RoutedEventArgs e) => Present();
private void OnTrayNotificationClicked(object sender, RoutedEventArgs e) => _notifier.OnClicked();
/// <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)
{
try
{
if (e.Target is { } target)
{
await _shell.NavigateAsync(target);
}
}
finally
{
Present();
}
}
private async void OnTrayQuit(object sender, RoutedEventArgs e) => await _lifetime.QuitAsync();
private void OnTrayQuickTimer(object sender, RoutedEventArgs e) => _quickTimer.StartQuick(TimeSpan.FromMinutes(5));
private IOdMediaControls? LoadedMedia() =>
_host.Modules.Select(hosted => hosted.Module).OfType<IOdMediaControls>().FirstOrDefault(media => media.NowPlaying is not null);
/// <summary>The media items show only while a media module has something loaded.</summary>
private void OnTrayMenuOpened(object sender, RoutedEventArgs e)
{
var media = LoadedMedia();
var visibility = media is null ? Visibility.Collapsed : Visibility.Visible;
foreach (var item in new FrameworkElement[] { TrayMediaSeparator, TrayNowPlaying, TrayPlayPause, TrayNext, TrayPrevious })
{
item.Visibility = visibility;
}
if (media is not null)
{
TrayNowPlaying.Header = media.NowPlaying;
TrayPlayPause.Header = media.IsPlaying ? OdLocalization.Get("Tray_Pause") : OdLocalization.Get("Tray_Play");
}
}
private void OnTrayPlayPause(object sender, RoutedEventArgs e) => LoadedMedia()?.PlayPause();
private void OnTrayNext(object sender, RoutedEventArgs e) => LoadedMedia()?.Next();
private void OnTrayPrevious(object sender, RoutedEventArgs e) => LoadedMedia()?.Previous();
private void ListenForFullscreen(OdShellViewModel shell)
{
AddHandler(OdFullscreen.RequestedEvent, new EventHandler<OdFullscreenRequestedEventArgs>(OnFullscreenRequested));
shell.PropertyChanged += (_, e) =>
{
// Full screen belongs to the module on screen: showing another one ends it.
if (string.Equals(e.PropertyName, nameof(OdShellViewModel.CurrentView), StringComparison.Ordinal))
{
SetFullscreen(on: false);
}
};
}
private void ListenForPopOuts(OdShellViewModel shell)
{
shell.PopOutOpened += (_, e) => OpenPopOut(e.Item, e.View!);
shell.PopOutActivationRequested += (_, e) => _popOuts.GetValueOrDefault(e.Item.Id)?.Present();
shell.PopOutCloseRequested += (_, e) =>
{
if (_popOuts.Remove(e.Item.Id, out var window))
{
window.Release();
_popOutBounds[e.Item.Id] = window.LastBounds;
}
};
}
/// <summary>Opens a module's own window where it was last in this session, or beside this window.</summary>
private void OpenPopOut(OdModuleItemViewModel item, FrameworkElement view)
{
var window = new OdPopOutWindow(item, view, this);
window.PaletteRequested += async (_, _) => await OpenPaletteAsync(window);
if (_popOutBounds.TryGetValue(item.Id, out var bounds))
{
window.Left = bounds.Left;
window.Top = bounds.Top;
window.Width = bounds.Width;
window.Height = bounds.Height;
}
else if (IsVisible && WindowState == WindowState.Normal)
{
window.Left = Left + PopOutOffset;
window.Top = Top + PopOutOffset;
}
else
{
window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
}
window.Returned += async (_, _) =>
{
_popOuts.Remove(item.Id);
_popOutBounds[item.Id] = window.LastBounds;
await _shell.DockAsync(item);
};
_popOuts[item.Id] = window;
window.Show();
}
private void OnFullscreenRequested(object? sender, OdFullscreenRequestedEventArgs e)
{
e.Handled = true;
SetFullscreen(e.On);
}
/// <summary>Covers the monitor the window is on, chrome hidden, or puts the window back where it was.</summary>
private void SetFullscreen(bool on)
{
if (on == _cover.IsCovering)
{
return;
}
if (on)
{
if (!_cover.Cover(OdMonitors.BoundsOf(new WindowInteropHelper(this).Handle)))
{
return;
}
FoldChrome();
}
else
{
_cover.Uncover();
UnfoldChrome();
}
OdFullscreen.SetIsActive(_stage, on);
}
private void FoldChrome()
{
_paneBeforeFullscreen = new OdPanePlacement(RootNavigation.OpenPaneLength, RootNavigation.CompactPaneLength, RootNavigation.IsPaneToggleVisible, RootNavigation.FrameMargin);
AppTitleBar.Visibility = Visibility.Collapsed;
RootNavigation.TitleBar = null;
// The pane folds to nothing: changing its display mode would re-template the navigation view and
// re-create the stage, and with it a player's video window.
RootNavigation.IsPaneToggleVisible = false;
RootNavigation.OpenPaneLength = 0;
RootNavigation.CompactPaneLength = 0;
// The folded pane's template still keeps a few pixels (its margins, the frame's border): the frame
// overlaps them. Clearing the title bar has just reset the frame's margin, so it is read only now.
UpdateLayout();
var offset = _stage.TranslatePoint(default, this);
var frame = RootNavigation.FrameMargin;
RootNavigation.FrameMargin = new Thickness(frame.Left - offset.X, frame.Top - offset.Y, frame.Right, frame.Bottom);
}
private void UnfoldChrome()
{
AppTitleBar.Visibility = Visibility.Visible;
RootNavigation.TitleBar = AppTitleBar;
if (_paneBeforeFullscreen is { } pane)
{
_paneBeforeFullscreen = null;
RootNavigation.OpenPaneLength = pane.OpenLength;
RootNavigation.CompactPaneLength = pane.CompactLength;
RootNavigation.IsPaneToggleVisible = pane.ToggleVisible;
RootNavigation.FrameMargin = pane.FrameMargin;
}
}
}
+43 -6
View File
@@ -8,28 +8,60 @@
<AssemblyName>OmniDeck</AssemblyName>
<RootNamespace>OmniDeck.App</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<!-- The executable's icon, which its windows, shortcuts and Explorer show (scripts/make-icon.ps1). -->
<ApplicationIcon>Assets\OmniDeck.ico</ApplicationIcon>
<!-- Custom entry point: Velopack's hooks must run before WPF loads OdApp.xaml resources. -->
<StartupObject>OmniDeck.App.Program</StartupObject>
<!-- Ship only the UI languages OmniDeck supports (EN neutral, VI, JA). -->
<SatelliteResourceLanguages>en;vi;ja</SatelliteResourceLanguages>
<!-- Resources/Strings.resx is English; the resource manager never probes for an "en" satellite. -->
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>
<ItemGroup>
<!-- The application class is OdApp, not App: types carry the Od prefix, and Meziantou MA0049
rejects a type named like its namespace. -->
<Page Remove="OdApp.xaml" />
<ApplicationDefinition Include="OdApp.xaml" />
</ItemGroup>
<!-- The application class is OdApp, not App: types carry the Od prefix, and Meziantou MA0049
rejects a type named like its namespace. OdApp.xaml stays a plain Page (no ApplicationDefinition),
so WPF generates no Main of its own: Program.Main creates OdApp with the single-instance guard. -->
<ItemGroup>
<ProjectReference Include="..\OmniDeck.Core\OmniDeck.Core.csproj" />
<ProjectReference Include="..\OmniDeck.Modules\OmniDeck.Modules.csproj" />
<ProjectReference Include="..\OmniDeck.Web\OmniDeck.Web.csproj" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="OmniDeck.Tests" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.2" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.4.1" />
<PackageReference Include="Markdig" Version="1.6.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.14" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="Velopack" Version="1.2.161" />
<PackageReference Include="WPF-UI" Version="4.3.0" />
</ItemGroup>
<!-- libVLC for the media player (docs/SPEC.md §3.6), copied to libvlc\win-x64 next to OmniDeck.exe:
x64 only, and only the plugins the player needs (docs/spikes/06-libvlcsharp.md). -->
<PropertyGroup>
<VlcWindowsX86Enabled>false</VlcWindowsX86Enabled>
<VlcWindowsArm64Enabled>false</VlcWindowsArm64Enabled>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="VideoLAN.LibVLC.Windows" Version="3.0.24" />
</ItemGroup>
<ItemGroup>
<VlcWindowsX64IncludeFiles Include="libvlc.dll;libvlccore.dll" />
<VlcWindowsX64IncludeFiles Include="plugins\access\%2A;plugins\audio_filter\%2A;plugins\audio_mixer\%2A;plugins\audio_output\%2A" />
<VlcWindowsX64IncludeFiles Include="plugins\codec\%2A;plugins\demux\%2A;plugins\packetizer\%2A;plugins\stream_filter\%2A" />
<VlcWindowsX64IncludeFiles Include="plugins\text_renderer\%2A;plugins\spu\%2A;plugins\video_chroma\%2A;plugins\video_filter\%2A;plugins\video_output\%2A;plugins\misc\%2A" />
<!-- The player opens local files: no network streaming. -->
<VlcWindowsX64ExcludeFiles Include="plugins\access\libaccess_srt_plugin.dll;plugins\access\libftp_plugin.dll;plugins\access\libhttp_plugin.dll;plugins\access\libhttps_plugin.dll;plugins\access\librtp_plugin.dll;plugins\access\libsftp_plugin.dll;plugins\access\libsmb_plugin.dll" />
</ItemGroup>
<!-- The license and legal documents travel with every build: the self-contained app
redistributes MIT/BSD code whose notices must ship with it, and the P1 legal gate shows them. -->
<ItemGroup>
@@ -37,6 +69,11 @@
<None Include="..\..\docs\legal\*.md" Link="legal\%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>
<!-- The web-app catalog as of this build; a newer one fetched from main replaces it (docs/WEBAPP-CATALOG.md). -->
<ItemGroup>
<None Include="..\..\catalog\webapps.json" Link="catalog\webapps.json" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>
<!-- A self-contained publish redistributes the .NET and Windows Desktop runtimes: their license
and third-party notices ship too, under legal\<framework>\ (THIRD-PARTY-NOTICES.md points there). -->
<Target Name="OdCopyRuntimeNotices" AfterTargets="Publish" Condition="'$(SelfContained)' == 'true'">
+31 -4
View File
@@ -1,21 +1,48 @@
using OmniDeck.Core.Runtime;
using OmniDeck.Core.Storage;
using Velopack;
namespace OmniDeck.App;
/// <summary>
/// Process entry point. Velopack's install/update/uninstall hooks run first (they may exit the
/// process and must not wait for WPF to load OdApp.xaml resources); only then is the WPF
/// <see cref="OdApp"/> created.
/// process and must not wait for WPF to load OdApp.xaml resources); then a second OmniDeck hands off
/// to the first one and exits; only then is the WPF <see cref="OdApp"/> created.
/// </summary>
internal static class Program
{
[STAThread]
private static int Main()
{
VelopackApp.Build().Run();
VelopackApp.Build()
// The privacy policy promises that uninstalling removes everything OmniDeck stored.
.OnBeforeUninstallFastCallback(_ => OdDataRoot.Default.TryDelete())
.Run();
var app = new OdApp();
var dataRoot = DataRoot();
using var guard = new OdSingleInstanceGuard(dataRoot.InstanceSuffix);
if (!guard.IsPrimaryInstance)
{
guard.SignalPrimaryInstance();
return 0;
}
var app = new OdApp(guard, dataRoot);
app.InitializeComponent();
return app.Run();
}
/// <summary>
/// The signed-in user's data root. A Debug build can be pointed elsewhere with
/// <see cref="OdDataRoot.OverrideVariable"/>, so it runs beside an installed OmniDeck without
/// touching its data; a Release build never reads the variable.
/// </summary>
private static OdDataRoot DataRoot()
{
#if DEBUG
return OdDataRoot.Choose(Environment.GetEnvironmentVariable(OdDataRoot.OverrideVariable));
#else
return OdDataRoot.Default;
#endif
}
}
@@ -0,0 +1,9 @@
using System.Resources;
namespace OmniDeck.App.Resources;
/// <summary>The shell's string table, <c>Resources/Strings.resx</c>; <c>OdApp</c> registers it with <c>OdLocalization</c>.</summary>
internal static class OdAppStrings
{
public static ResourceManager Resources { get; } = new("OmniDeck.App.Resources.Strings", typeof(OdAppStrings).Assembly);
}
+568
View File
@@ -0,0 +1,568 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!-- The shell's UI strings, Japanese. A key missing here shows in English (Strings.resx). -->
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="App_Name" xml:space="preserve">
<value>OmniDeck</value>
</data>
<data name="Shell_Search" xml:space="preserve">
<value>モジュールとコマンドを検索</value>
</data>
<data name="Shell_Library" xml:space="preserve">
<value>ライブラリ</value>
</data>
<data name="Shell_LibraryTitle" xml:space="preserve">
<value>モジュール ライブラリ</value>
</data>
<data name="Shell_LibraryIntro" xml:space="preserve">
<value>モジュールを開くか、ピン留めしてサイドバーに表示したままにします。</value>
</data>
<data name="Shell_LibraryEmpty" xml:space="preserve">
<value>利用できるモジュールはまだありません。</value>
</data>
<data name="Shell_Open" xml:space="preserve">
<value>開く</value>
</data>
<data name="Shell_Pin" xml:space="preserve">
<value>サイドバーにピン留めする</value>
</data>
<data name="Shell_Unpin" xml:space="preserve">
<value>サイドバーからピン留めを外す</value>
</data>
<data name="Shell_Close" xml:space="preserve">
<value>閉じる</value>
</data>
<data name="Shell_PopOut" xml:space="preserve">
<value>別ウィンドウで開く</value>
</data>
<data name="Shell_PopIn" xml:space="preserve">
<value>メイン ウィンドウに戻す</value>
</data>
<data name="Shell_PaletteCommand" xml:space="preserve">
<value>コマンド</value>
</data>
<data name="Shell_Quit" xml:space="preserve">
<value>OmniDeck を終了</value>
</data>
<data name="Tray_Open" xml:space="preserve">
<value>OmniDeck を開く</value>
</data>
<data name="Tray_QuickTimer" xml:space="preserve">
<value>5 分のタイマーを開始</value>
</data>
<data name="Tray_Quit" xml:space="preserve">
<value>終了</value>
</data>
<data name="Tray_StillRunningTitle" xml:space="preserve">
<value>OmniDeck は引き続き実行中です</value>
</data>
<data name="Tray_StillRunningMessage" xml:space="preserve">
<value>通知領域で実行を続けます。終了するには、アイコンのメニューから [終了] を選択してください。</value>
</data>
<data name="Error_Title" xml:space="preserve">
<value>問題が発生しました</value>
</data>
<data name="Error_UiMessage" xml:space="preserve">
<value>問題が発生しましたが、OmniDeck は引き続き実行中です。
サポート コード: {0}
{1}</value>
</data>
<data name="Error_StartFailed" xml:space="preserve">
<value>OmniDeck を起動できませんでした。
{0}</value>
</data>
<data name="Memory_Title" xml:space="preserve">
<value>実行中のモジュール</value>
</data>
<data name="Memory_Intro" xml:space="preserve">
<value>非表示のモジュールは、メモリを節約するため、時間の経過とともにアイドル、一時停止、休止の順に移行します。対象外にするには、モジュールの [常に実行] をオンにします。</value>
</data>
<data name="Memory_InUse" xml:space="preserve">
<value>使用中: {0}</value>
</data>
<data name="Memory_Limits" xml:space="preserve">
<value>ソフト上限 {0} · ハード上限 {1}</value>
</data>
<data name="Memory_SharedNote" xml:space="preserve">
<value>組み込みモジュールは OmniDeck 本体のプロセスを共有するため、個別の数値が表示されるのは Web アプリだけです。</value>
</data>
<data name="Memory_SharedTitle" xml:space="preserve">
<value>共有の Web プロセス</value>
</data>
<data name="Memory_SharedDescription" xml:space="preserve">
<value>すべての Web アプリが使用するブラウザー、グラフィックス、ヘルパーのプロセスです。最後の Web アプリを閉じると終了します。</value>
</data>
<data name="Memory_KeepRunning" xml:space="preserve">
<value>常に実行</value>
</data>
<data name="Memory_Suspend" xml:space="preserve">
<value>一時停止</value>
</data>
<data name="Memory_Hibernate" xml:space="preserve">
<value>休止</value>
</data>
<data name="Memory_UsedNow" xml:space="preserve">
<value>表示中</value>
</data>
<data name="Memory_UsedJustNow" xml:space="preserve">
<value>たった今使用</value>
</data>
<data name="Memory_UsedMinutesAgo" xml:space="preserve">
<value>{0} 分前に使用</value>
</data>
<data name="Memory_UsedHoursAgo" xml:space="preserve">
<value>{0} 時間前に使用</value>
</data>
<data name="State_Created" xml:space="preserve">
<value>未起動</value>
</data>
<data name="State_Active" xml:space="preserve">
<value>アクティブ</value>
</data>
<data name="State_Idle" xml:space="preserve">
<value>アイドル</value>
</data>
<data name="State_Suspended" xml:space="preserve">
<value>一時停止中</value>
</data>
<data name="State_Hibernated" xml:space="preserve">
<value>休止中</value>
</data>
<data name="State_Closed" xml:space="preserve">
<value>終了済み</value>
</data>
<data name="Governor_HardCapTitle" xml:space="preserve">
<value>OmniDeck のメモリ使用量が多くなっています</value>
</data>
<data name="Governor_HardCapHibernatedOne" xml:space="preserve">
<value>上限の {0} を超えないように、モジュールを 1 つ休止しました。</value>
</data>
<data name="Governor_HardCapHibernated" xml:space="preserve">
<value>上限の {1} を超えないように、モジュールを {0} 個休止しました。</value>
</data>
<data name="Governor_HardCapKept" xml:space="preserve">
<value>上限の {0} を超えていますが、これ以上休止できるモジュールはありません。開いているモジュールは使用中か、[常に実行] がオンになっています。</value>
</data>
<data name="Governor_HardCapShared" xml:space="preserve">
<value>開いている Web アプリが共有するプロセスが主にグラフィックスのために {1} を使用しているため、上限の {0} を超えています。他のモジュールを休止しても、この使用量は減りません。</value>
</data>
<data name="Governor_ResidentHibernatedTitle" xml:space="preserve">
<value>メモリを節約するため、{0} を休止しました</value>
</data>
<data name="Governor_ResidentHibernated" xml:space="preserve">
<value>もう一度開くまで、通知は表示されません。ここをクリックすると開きます。</value>
</data>
<data name="Settings_Nav" xml:space="preserve">
<value>設定</value>
</data>
<data name="Settings_Title" xml:space="preserve">
<value>設定</value>
</data>
<data name="Settings_General" xml:space="preserve">
<value>全般</value>
</data>
<data name="Settings_Appearance" xml:space="preserve">
<value>外観</value>
</data>
<data name="Settings_Memory" xml:space="preserve">
<value>メモリ</value>
</data>
<data name="Settings_Data" xml:space="preserve">
<value>データ</value>
</data>
<data name="Settings_About" xml:space="preserve">
<value>バージョン情報</value>
</data>
<data name="Settings_Language" xml:space="preserve">
<value>言語</value>
</data>
<data name="Settings_CloseToTray" xml:space="preserve">
<value>ウィンドウを閉じても通知領域で実行を続ける</value>
</data>
<data name="Settings_StartWithWindows" xml:space="preserve">
<value>Windows にサインインしたときに OmniDeck を起動する</value>
</data>
<data name="Settings_Theme" xml:space="preserve">
<value>テーマ</value>
</data>
<data name="Settings_Preset" xml:space="preserve">
<value>レイアウト</value>
</data>
<data name="Settings_FontScale" xml:space="preserve">
<value>テキストのサイズ</value>
</data>
<data name="Settings_Motion" xml:space="preserve">
<value>アニメーション効果</value>
</data>
<data name="Settings_AccentSystem" xml:space="preserve">
<value>Windows のアクセント カラーを使用する</value>
</data>
<data name="Settings_IdleAfter" xml:space="preserve">
<value>非表示のモジュールを一時停止するまでの時間 (分)</value>
</data>
<data name="Settings_HibernateAfter" xml:space="preserve">
<value>非表示のモジュールを休止するまでの時間 (分)</value>
</data>
<data name="Settings_SoftCap" xml:space="preserve">
<value>メモリのソフト上限 (MB、0 で自動)</value>
</data>
<data name="Settings_HardCap" xml:space="preserve">
<value>メモリのハード上限 (MB、0 で自動)</value>
</data>
<data name="Settings_DataFolder" xml:space="preserve">
<value>データ フォルダー</value>
</data>
<data name="Settings_OpenDataFolder" xml:space="preserve">
<value>開く</value>
</data>
<data name="Settings_Export" xml:space="preserve">
<value>設定をエクスポート…</value>
</data>
<data name="Settings_Import" xml:space="preserve">
<value>設定をインポート…</value>
</data>
<data name="Settings_FileFilter" xml:space="preserve">
<value>OmniDeck の設定 (*.json)|*.json</value>
</data>
<data name="Settings_Exported" xml:space="preserve">
<value>設定をエクスポートしました。</value>
</data>
<data name="Settings_Imported" xml:space="preserve">
<value>設定をインポートしました。</value>
</data>
<data name="Settings_ImportFailed" xml:space="preserve">
<value>このファイルは OmniDeck の設定ファイルではありません。</value>
</data>
<data name="Language_System" xml:space="preserve">
<value>Windows の設定に合わせる</value>
</data>
<data name="Theme_System" xml:space="preserve">
<value>Windows の設定に合わせる</value>
</data>
<data name="Theme_Light" xml:space="preserve">
<value>ライト</value>
</data>
<data name="Theme_Dark" xml:space="preserve">
<value>ダーク</value>
</data>
<data name="Preset_Dynamic" xml:space="preserve">
<value>ダイナミック</value>
</data>
<data name="Preset_DynamicHint" xml:space="preserve">
<value>コンパクトで軽快。文字は小さめ、動きは多めです。</value>
</data>
<data name="Preset_Standard" xml:space="preserve">
<value>標準</value>
</data>
<data name="Preset_StandardHint" xml:space="preserve">
<value>バランスがよく、ほとんどの人に適しています。</value>
</data>
<data name="Preset_Comfort" xml:space="preserve">
<value>ゆったり</value>
</data>
<data name="Preset_ComfortHint" xml:space="preserve">
<value>文字とボタンが大きめで、動きはありません。</value>
</data>
<data name="Onboarding_Title" xml:space="preserve">
<value>OmniDeck へようこそ</value>
</data>
<data name="Onboarding_Intro" xml:space="preserve">
<value>言語とレイアウトを選んでください。レイアウトは選ぶとすぐに適用されます。</value>
</data>
<data name="Onboarding_Later" xml:space="preserve">
<value>どちらも後で [設定] から変更できます。</value>
</data>
<data name="Onboarding_Done" xml:space="preserve">
<value>始める</value>
</data>
<data name="Legal_Title" xml:space="preserve">
<value>始める前に</value>
</data>
<data name="Legal_Intro" xml:space="preserve">
<value>OmniDeck は GNU General Public License v3 に基づくフリー ソフトウェアです。これらの文書をお読みください。続行すると、これらを読んだことが記録されます。これはライセンスの条件ではありません。</value>
</data>
<data name="Legal_Eula" xml:space="preserve">
<value>使用許諾契約</value>
</data>
<data name="Legal_Disclaimer" xml:space="preserve">
<value>免責事項</value>
</data>
<data name="Legal_Privacy" xml:space="preserve">
<value>プライバシー ポリシー</value>
</data>
<data name="Legal_Notices" xml:space="preserve">
<value>サードパーティ通知</value>
</data>
<data name="Legal_HaveRead" xml:space="preserve">
<value>これらの文書を読みました</value>
</data>
<data name="Legal_Continue" xml:space="preserve">
<value>続行</value>
</data>
<data name="Legal_Quit" xml:space="preserve">
<value>終了</value>
</data>
<data name="Legal_Close" xml:space="preserve">
<value>閉じる</value>
</data>
<data name="Legal_Missing" xml:space="preserve">
<value>この OmniDeck には {0} が含まれていません。</value>
</data>
<data name="About_Version" xml:space="preserve">
<value>バージョン {0}</value>
</data>
<data name="About_CheckUpdates" xml:space="preserve">
<value>更新プログラムを確認</value>
</data>
<data name="About_Checking" xml:space="preserve">
<value>更新プログラムを確認しています…</value>
</data>
<data name="About_UpToDate" xml:space="preserve">
<value>OmniDeck は最新の状態です。</value>
</data>
<data name="About_Available" xml:space="preserve">
<value>バージョン {0} を利用できます。</value>
</data>
<data name="About_Download" xml:space="preserve">
<value>ダウンロードして再起動</value>
</data>
<data name="About_Downloading" xml:space="preserve">
<value>更新プログラムをダウンロードしています: {0}%</value>
</data>
<data name="About_Failed" xml:space="preserve">
<value>更新できませんでした: {0}</value>
</data>
<data name="About_NotInstalled" xml:space="preserve">
<value>更新を利用できるのは、インストールされた OmniDeck だけです。開発ビルドでは利用できません。</value>
</data>
<data name="About_Links" xml:space="preserve">
<value>リンク</value>
</data>
<data name="About_GitHub" xml:space="preserve">
<value>GitHub のソース コード</value>
</data>
<data name="About_Discussions" xml:space="preserve">
<value>ディスカッション</value>
</data>
<data name="About_Discord" xml:space="preserve">
<value>Discord</value>
</data>
<data name="About_Legal" xml:space="preserve">
<value>ライセンスと法的文書</value>
</data>
<data name="About_Credits" xml:space="preserve">
<value>OmniDeck は .NET、WPF-UI、Velopack、CommunityToolkit.Mvvm、H.NotifyIcon、Serilog、Dapper、SQLite、Markdig で構築されています。すべてサードパーティ通知に記載されています。</value>
</data>
<data name="Update_AvailableTitle" xml:space="preserve">
<value>OmniDeck {0} を利用できます</value>
</data>
<data name="Update_AvailableMessage" xml:space="preserve">
<value>インストールするには、[設定] → [バージョン情報] を開いてください。</value>
</data>
<data name="Dialog_OK" xml:space="preserve">
<value>OK</value>
</data>
<data name="Dialog_Cancel" xml:space="preserve">
<value>キャンセル</value>
</data>
<data name="Settings_WebApps" xml:space="preserve">
<value>Web アプリ</value>
</data>
<data name="WebApps_Intro" xml:space="preserve">
<value>通知を表示できる Web アプリを選択します。通知がオンのアプリは、通知を届けられるよう非表示の間も実行を続け、OmniDeck のメモリが不足したときにだけ閉じられます。</value>
</data>
<data name="WebApps_Notifications" xml:space="preserve">
<value>通知</value>
</data>
<data name="WebApps_NoPermissions" xml:space="preserve">
<value>アクセス許可の要求はまだありません</value>
</data>
<data name="WebApps_Allowed" xml:space="preserve">
<value>{0}: 許可</value>
</data>
<data name="WebApps_Blocked" xml:space="preserve">
<value>{0}: ブロック</value>
</data>
<data name="WebApps_ResetPermissions" xml:space="preserve">
<value>もう一度確認する</value>
</data>
<data name="WebApps_DataTitle" xml:space="preserve">
<value>サインイン データ</value>
</data>
<data name="WebApps_DataIntro" xml:space="preserve">
<value>グループ内のアプリは 1 つのサインインを共有します。グループのデータを消去すると、そのすべてのアプリからサインアウトされ、アプリは閉じられます。</value>
</data>
<data name="WebApps_ClearData" xml:space="preserve">
<value>データを消去</value>
</data>
<data name="WebApps_ClearTitle" xml:space="preserve">
<value>サインイン データを消去しますか?</value>
</data>
<data name="WebApps_ClearMessage" xml:space="preserve">
<value>{0} からサインアウトされます。Cookie、サイト データ、キャッシュされたページは削除されます。</value>
</data>
<data name="WebApps_ClearConfirm" xml:space="preserve">
<value>データを消去</value>
</data>
<data name="WebApps_Cleared" xml:space="preserve">
<value>{0} のデータを消去しました。</value>
</data>
<data name="WebApps_ClearFailed" xml:space="preserve">
<value>データを消去できませんでした。OmniDeck を再起動してから、もう一度お試しください。</value>
</data>
<data name="WebApps_Catalog" xml:space="preserve">
<value>Web アプリ カタログ ({0} 版) には {1} 個のアプリがあります。</value>
</data>
<data name="WebApps_Checked" xml:space="preserve">
<value>新しいカタログを最後に確認したのは {0} です。</value>
</data>
<data name="WebApps_NotChecked" xml:space="preserve">
<value>新しいカタログはまだ確認していません。</value>
</data>
<data name="About_ReportBug" xml:space="preserve">
<value>バグを報告</value>
</data>
<data name="Error_Report" xml:space="preserve">
<value>バグを報告</value>
</data>
<data name="Report_Title" xml:space="preserve">
<value>バグを報告</value>
</data>
<data name="Report_Intro" xml:space="preserve">
<value>OmniDeck はこの PC にレポートを保存し、短い項目を入力した状態で GitHub の新しい Issue をブラウザーで開きます。何も送信されないため、レポートはご自身で Issue に添付してください。Web アドレスからはクエリが除かれ、トークン、Cookie、メール アドレス、長い ID、ユーザー名もあらかじめ取り除かれます。</value>
</data>
<data name="Report_Subject" xml:space="preserve">
<value>何についての報告ですか?</value>
</data>
<data name="Report_General" xml:space="preserve">
<value>OmniDeck 全般</value>
</data>
<data name="Report_Preview" xml:space="preserve">
<value>Issue の本文 (レポートにも issue.md として含まれます)</value>
</data>
<data name="Report_Save" xml:space="preserve">
<value>保存して GitHub を開く</value>
</data>
<data name="Tray_Play" xml:space="preserve">
<value>再生</value>
</data>
<data name="Tray_Pause" xml:space="preserve">
<value>一時停止</value>
</data>
<data name="Tray_Next" xml:space="preserve">
<value>次へ</value>
</data>
<data name="Tray_Previous" xml:space="preserve">
<value>前へ</value>
</data>
<data name="About_Prereleases" xml:space="preserve">
<value>プレリリース版 (アルファ版とベータ版) を入手する</value>
</data>
<data name="About_PrereleasesNote" xml:space="preserve">
<value>1.0 より前のバージョンはすべてプレリリース版です。1.0 以降は、これをオフのままにすると安定版のみを入手します。</value>
</data>
<data name="Shell_NavModules" xml:space="preserve">
<value>モジュール</value>
</data>
<data name="Shell_NavFooter" xml:space="preserve">
<value>設定とライブラリ</value>
</data>
<data name="A11y_RowAction" xml:space="preserve">
<value>{0}、{1}</value>
</data>
<data name="A11y_Minimize" xml:space="preserve">
<value>最小化</value>
</data>
<data name="A11y_Maximize" xml:space="preserve">
<value>最大化</value>
</data>
<data name="A11y_Restore" xml:space="preserve">
<value>元に戻す (縮小)</value>
</data>
<data name="A11y_Close" xml:space="preserve">
<value>閉じる</value>
</data>
<data name="A11y_OpenNavigation" xml:space="preserve">
<value>ナビゲーションを開く</value>
</data>
<data name="A11y_CloseNavigation" xml:space="preserve">
<value>ナビゲーションを閉じる</value>
</data>
<data name="A11y_Increase" xml:space="preserve">
<value>増やす</value>
</data>
<data name="A11y_Decrease" xml:space="preserve">
<value>減らす</value>
</data>
<data name="A11y_ShowPassword" xml:space="preserve">
<value>パスワードを表示</value>
</data>
<data name="A11y_ScrollUp" xml:space="preserve">
<value>上へスクロール</value>
</data>
<data name="A11y_ScrollDown" xml:space="preserve">
<value>下へスクロール</value>
</data>
<data name="A11y_ScrollLeft" xml:space="preserve">
<value>左へスクロール</value>
</data>
<data name="A11y_ScrollRight" xml:space="preserve">
<value>右へスクロール</value>
</data>
<data name="A11y_PageUp" xml:space="preserve">
<value>1 ページ上へ</value>
</data>
<data name="A11y_PageDown" xml:space="preserve">
<value>1 ページ下へ</value>
</data>
<data name="A11y_PageLeft" xml:space="preserve">
<value>1 ページ左へ</value>
</data>
<data name="A11y_PageRight" xml:space="preserve">
<value>1 ページ右へ</value>
</data>
<data name="Settings_AccentColors" xml:space="preserve">
<value>アクセント カラー</value>
</data>
<data name="Accent_Blue" xml:space="preserve">
<value>青</value>
</data>
<data name="Accent_Purple" xml:space="preserve">
<value>紫</value>
</data>
<data name="Accent_Pink" xml:space="preserve">
<value>ピンク</value>
</data>
<data name="Accent_Red" xml:space="preserve">
<value>赤</value>
</data>
<data name="Accent_Orange" xml:space="preserve">
<value>オレンジ</value>
</data>
<data name="Accent_Green" xml:space="preserve">
<value>緑</value>
</data>
<data name="Shell_OpenDataFolder" xml:space="preserve">
<value>データ フォルダーを開く</value>
</data>
<data name="Shell_SearchShortcut" xml:space="preserve">
<value>Ctrl+K</value>
</data>
<data name="A11y_Clear" xml:space="preserve">
<value>クリア</value>
</data>
</root>
+570
View File
@@ -0,0 +1,570 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!-- The shell's UI strings, English (neutral). Translations sit beside it: Strings.vi.resx and Strings.ja.resx (docs/TRANSLATING.md). -->
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="App_Name" xml:space="preserve">
<value>OmniDeck</value>
</data>
<data name="Shell_Search" xml:space="preserve">
<value>Search modules and commands</value>
</data>
<data name="Shell_Library" xml:space="preserve">
<value>Library</value>
</data>
<data name="Shell_LibraryTitle" xml:space="preserve">
<value>Module library</value>
</data>
<data name="Shell_LibraryIntro" xml:space="preserve">
<value>Open a module, or pin it to keep it in the sidebar.</value>
</data>
<data name="Shell_LibraryEmpty" xml:space="preserve">
<value>No modules are available yet.</value>
</data>
<data name="Shell_Open" xml:space="preserve">
<value>Open</value>
</data>
<data name="Shell_Pin" xml:space="preserve">
<value>Pin to sidebar</value>
</data>
<data name="Shell_Unpin" xml:space="preserve">
<value>Unpin from sidebar</value>
</data>
<data name="Shell_Close" xml:space="preserve">
<value>Close</value>
</data>
<data name="Shell_PopOut" xml:space="preserve">
<value>Open in new window</value>
</data>
<data name="Shell_PopIn" xml:space="preserve">
<value>Return to main window</value>
</data>
<data name="Shell_PaletteCommand" xml:space="preserve">
<value>Command</value>
</data>
<data name="Shell_Quit" xml:space="preserve">
<value>Quit OmniDeck</value>
</data>
<data name="Tray_Open" xml:space="preserve">
<value>Open OmniDeck</value>
</data>
<data name="Tray_QuickTimer" xml:space="preserve">
<value>Start a 5-minute timer</value>
</data>
<data name="Tray_Quit" xml:space="preserve">
<value>Quit</value>
</data>
<data name="Tray_StillRunningTitle" xml:space="preserve">
<value>OmniDeck is still running</value>
</data>
<data name="Tray_StillRunningMessage" xml:space="preserve">
<value>It keeps running in the notification area. To exit, choose Quit from its icon's menu.</value>
</data>
<data name="Error_Title" xml:space="preserve">
<value>Something went wrong</value>
</data>
<data name="Error_UiMessage" xml:space="preserve">
<value>Something went wrong, but OmniDeck is still running.
Support code: {0}
{1}</value>
</data>
<data name="Error_StartFailed" xml:space="preserve">
<value>OmniDeck could not start.
{0}</value>
</data>
<data name="Memory_Title" xml:space="preserve">
<value>Running modules</value>
</data>
<data name="Memory_Intro" xml:space="preserve">
<value>Hidden modules step down over time to save memory: idle, then suspended, then hibernated. Keep a module running to exempt it.</value>
</data>
<data name="Memory_InUse" xml:space="preserve">
<value>In use: {0}</value>
</data>
<data name="Memory_Limits" xml:space="preserve">
<value>Soft limit {0} · hard limit {1}</value>
</data>
<data name="Memory_SharedNote" xml:space="preserve">
<value>Built-in modules share OmniDeck's own process, so only web apps have a figure of their own.</value>
</data>
<data name="Memory_SharedTitle" xml:space="preserve">
<value>Shared web processes</value>
</data>
<data name="Memory_SharedDescription" xml:space="preserve">
<value>The browser, graphics and helper processes every web app uses. They close with the last web app.</value>
</data>
<data name="Memory_KeepRunning" xml:space="preserve">
<value>Keep running</value>
</data>
<data name="Memory_Suspend" xml:space="preserve">
<value>Suspend</value>
</data>
<data name="Memory_Hibernate" xml:space="preserve">
<value>Hibernate</value>
</data>
<data name="Memory_UsedNow" xml:space="preserve">
<value>On screen</value>
</data>
<data name="Memory_UsedJustNow" xml:space="preserve">
<value>Used just now</value>
</data>
<data name="Memory_UsedMinutesAgo" xml:space="preserve">
<value>Used {0} min ago</value>
</data>
<data name="Memory_UsedHoursAgo" xml:space="preserve">
<value>Used {0} h ago</value>
</data>
<data name="State_Created" xml:space="preserve">
<value>Not started</value>
</data>
<data name="State_Active" xml:space="preserve">
<value>Active</value>
</data>
<data name="State_Idle" xml:space="preserve">
<value>Idle</value>
</data>
<data name="State_Suspended" xml:space="preserve">
<value>Suspended</value>
</data>
<data name="State_Hibernated" xml:space="preserve">
<value>Hibernated</value>
</data>
<data name="State_Closed" xml:space="preserve">
<value>Closed</value>
</data>
<data name="Governor_HardCapTitle" xml:space="preserve">
<value>OmniDeck is using a lot of memory</value>
</data>
<data name="Governor_HardCapHibernatedOne" xml:space="preserve">
<value>It hibernated a module to stay under its {0} limit.</value>
</data>
<data name="Governor_HardCapHibernated" xml:space="preserve">
<value>It hibernated {0} modules to stay under its {1} limit.</value>
</data>
<data name="Governor_HardCapKept" xml:space="preserve">
<value>It is above its {0} limit, and nothing more can be hibernated: the open modules are in use or kept running.</value>
</data>
<data name="Governor_HardCapShared" xml:space="preserve">
<value>It is above its {0} limit because the processes the open web apps share use {1}, mostly for graphics. Hibernating other modules would not bring that down.</value>
</data>
<data name="Governor_ResidentHibernatedTitle" xml:space="preserve">
<value>{0} was hibernated to save memory</value>
</data>
<data name="Governor_ResidentHibernated" xml:space="preserve">
<value>It shows no notifications until you open it again. Click here to open it.</value>
</data>
<data name="Settings_Nav" xml:space="preserve">
<value>Settings</value>
</data>
<data name="Settings_Title" xml:space="preserve">
<value>Settings</value>
</data>
<data name="Settings_General" xml:space="preserve">
<value>General</value>
</data>
<data name="Settings_Appearance" xml:space="preserve">
<value>Appearance</value>
</data>
<data name="Settings_Memory" xml:space="preserve">
<value>Memory</value>
</data>
<data name="Settings_Data" xml:space="preserve">
<value>Data</value>
</data>
<data name="Settings_About" xml:space="preserve">
<value>About</value>
</data>
<data name="Settings_Language" xml:space="preserve">
<value>Language</value>
</data>
<data name="Settings_CloseToTray" xml:space="preserve">
<value>Keep running in the notification area when the window closes</value>
</data>
<data name="Settings_StartWithWindows" xml:space="preserve">
<value>Start OmniDeck when I sign in to Windows</value>
</data>
<data name="Settings_Theme" xml:space="preserve">
<value>Theme</value>
</data>
<data name="Settings_Preset" xml:space="preserve">
<value>Layout</value>
</data>
<data name="Settings_FontScale" xml:space="preserve">
<value>Text size</value>
</data>
<data name="Settings_Motion" xml:space="preserve">
<value>Animations</value>
</data>
<data name="Settings_AccentSystem" xml:space="preserve">
<value>Use the Windows accent color</value>
</data>
<data name="Settings_IdleAfter" xml:space="preserve">
<value>Suspend hidden modules after (minutes)</value>
</data>
<data name="Settings_HibernateAfter" xml:space="preserve">
<value>Hibernate hidden modules after (minutes)</value>
</data>
<data name="Settings_SoftCap" xml:space="preserve">
<value>Soft memory limit in MB (0: automatic)</value>
</data>
<data name="Settings_HardCap" xml:space="preserve">
<value>Hard memory limit in MB (0: automatic)</value>
</data>
<data name="Settings_DataFolder" xml:space="preserve">
<value>Data folder</value>
</data>
<data name="Settings_OpenDataFolder" xml:space="preserve">
<value>Open</value>
</data>
<data name="Settings_Export" xml:space="preserve">
<value>Export settings…</value>
</data>
<data name="Settings_Import" xml:space="preserve">
<value>Import settings…</value>
</data>
<data name="Settings_FileFilter" xml:space="preserve">
<value>OmniDeck settings (*.json)|*.json</value>
</data>
<data name="Settings_Exported" xml:space="preserve">
<value>Settings exported.</value>
</data>
<data name="Settings_Imported" xml:space="preserve">
<value>Settings imported.</value>
</data>
<data name="Settings_ImportFailed" xml:space="preserve">
<value>That file is not an OmniDeck settings file.</value>
</data>
<data name="Language_System" xml:space="preserve">
<value>Follow Windows</value>
</data>
<data name="Theme_System" xml:space="preserve">
<value>Follow Windows</value>
</data>
<data name="Theme_Light" xml:space="preserve">
<value>Light</value>
</data>
<data name="Theme_Dark" xml:space="preserve">
<value>Dark</value>
</data>
<data name="Preset_Dynamic" xml:space="preserve">
<value>Dynamic</value>
</data>
<data name="Preset_DynamicHint" xml:space="preserve">
<value>Compact and lively: smaller text, more motion.</value>
</data>
<data name="Preset_Standard" xml:space="preserve">
<value>Standard</value>
</data>
<data name="Preset_StandardHint" xml:space="preserve">
<value>Balanced, for most people.</value>
</data>
<data name="Preset_Comfort" xml:space="preserve">
<value>Comfort</value>
</data>
<data name="Preset_ComfortHint" xml:space="preserve">
<value>Larger text and targets, no motion.</value>
</data>
<data name="Onboarding_Title" xml:space="preserve">
<value>Welcome to OmniDeck</value>
</data>
<data name="Onboarding_Intro" xml:space="preserve">
<value>Pick a language and a layout. The layout applies as you choose it.</value>
</data>
<data name="Onboarding_Later" xml:space="preserve">
<value>You can change both later in Settings.</value>
</data>
<data name="Onboarding_Done" xml:space="preserve">
<value>Get started</value>
</data>
<data name="Legal_Title" xml:space="preserve">
<value>Before you start</value>
</data>
<data name="Legal_Intro" xml:space="preserve">
<value>OmniDeck is free software under the GNU General Public License v3. Please read these documents: continuing records that you have read them. It is not a condition of the license.</value>
</data>
<data name="Legal_Eula" xml:space="preserve">
<value>License agreement</value>
</data>
<data name="Legal_Disclaimer" xml:space="preserve">
<value>Disclaimer</value>
</data>
<data name="Legal_Privacy" xml:space="preserve">
<value>Privacy policy</value>
</data>
<data name="Legal_Notices" xml:space="preserve">
<value>Third-party notices</value>
</data>
<data name="Legal_HaveRead" xml:space="preserve">
<value>I have read these documents</value>
</data>
<data name="Legal_Continue" xml:space="preserve">
<value>Continue</value>
</data>
<data name="Legal_Quit" xml:space="preserve">
<value>Quit</value>
</data>
<data name="Legal_Close" xml:space="preserve">
<value>Close</value>
</data>
<data name="Legal_Missing" xml:space="preserve">
<value>{0} is missing from this copy of OmniDeck.</value>
</data>
<data name="About_Version" xml:space="preserve">
<value>Version {0}</value>
</data>
<data name="About_CheckUpdates" xml:space="preserve">
<value>Check for updates</value>
</data>
<data name="About_Checking" xml:space="preserve">
<value>Checking for updates…</value>
</data>
<data name="About_UpToDate" xml:space="preserve">
<value>OmniDeck is up to date.</value>
</data>
<data name="About_Available" xml:space="preserve">
<value>Version {0} is available.</value>
</data>
<data name="About_Download" xml:space="preserve">
<value>Download and restart</value>
</data>
<data name="About_Downloading" xml:space="preserve">
<value>Downloading the update: {0} %</value>
</data>
<data name="About_Failed" xml:space="preserve">
<value>Could not update: {0}</value>
</data>
<data name="About_NotInstalled" xml:space="preserve">
<value>Updates work in installed copies of OmniDeck, not in development builds.</value>
</data>
<data name="About_Links" xml:space="preserve">
<value>Links</value>
</data>
<data name="About_GitHub" xml:space="preserve">
<value>Source code on GitHub</value>
</data>
<data name="About_Discussions" xml:space="preserve">
<value>Discussions</value>
</data>
<data name="About_Discord" xml:space="preserve">
<value>Discord</value>
</data>
<data name="About_Legal" xml:space="preserve">
<value>License and legal documents</value>
</data>
<data name="About_Credits" xml:space="preserve">
<value>OmniDeck is built with .NET, WPF-UI, Velopack, CommunityToolkit.Mvvm, H.NotifyIcon, Serilog, Dapper, SQLite and Markdig. The third-party notices list them all.</value>
</data>
<data name="Update_AvailableTitle" xml:space="preserve">
<value>OmniDeck {0} is available</value>
</data>
<data name="Update_AvailableMessage" xml:space="preserve">
<value>Open Settings → About to install it.</value>
</data>
<data name="Dialog_OK" xml:space="preserve">
<value>OK</value>
</data>
<data name="Dialog_Cancel" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="Settings_WebApps" xml:space="preserve">
<value>Web apps</value>
</data>
<data name="WebApps_Intro" xml:space="preserve">
<value>Choose which web apps may show notifications. An app with notifications on keeps running while hidden, so that it can notify you; it is closed only when OmniDeck runs short of memory.</value>
</data>
<data name="WebApps_Notifications" xml:space="preserve">
<value>Notifications</value>
</data>
<data name="WebApps_NoPermissions" xml:space="preserve">
<value>No permissions asked yet</value>
</data>
<data name="WebApps_Allowed" xml:space="preserve">
<value>{0} allowed</value>
</data>
<data name="WebApps_Blocked" xml:space="preserve">
<value>{0} blocked</value>
</data>
<data name="WebApps_ResetPermissions" xml:space="preserve">
<value>Ask again</value>
</data>
<data name="WebApps_DataTitle" xml:space="preserve">
<value>Sign-in data</value>
</data>
<data name="WebApps_DataIntro" xml:space="preserve">
<value>The apps in a group share one sign-in. Clearing a group's data signs you out of all of them and closes them.</value>
</data>
<data name="WebApps_ClearData" xml:space="preserve">
<value>Clear data</value>
</data>
<data name="WebApps_ClearTitle" xml:space="preserve">
<value>Clear sign-in data?</value>
</data>
<data name="WebApps_ClearMessage" xml:space="preserve">
<value>You will be signed out of {0}. Their cookies, site data and cached pages are deleted.</value>
</data>
<data name="WebApps_ClearConfirm" xml:space="preserve">
<value>Clear data</value>
</data>
<data name="WebApps_Cleared" xml:space="preserve">
<value>Cleared the data of {0}.</value>
</data>
<data name="WebApps_ClearFailed" xml:space="preserve">
<value>The data could not be cleared. Try again after restarting OmniDeck.</value>
</data>
<data name="WebApps_Catalog" xml:space="preserve">
<value>Web app catalog of {0}, with {1} apps.</value>
</data>
<data name="WebApps_Checked" xml:space="preserve">
<value>Last checked for a newer catalog on {0}.</value>
</data>
<data name="WebApps_NotChecked" xml:space="preserve">
<value>Not checked for a newer catalog yet.</value>
</data>
<data name="About_ReportBug" xml:space="preserve">
<value>Report a bug</value>
</data>
<data name="Error_Report" xml:space="preserve">
<value>Report bug</value>
</data>
<data name="Report_Title" xml:space="preserve">
<value>Report a bug</value>
</data>
<data name="Report_Intro" xml:space="preserve">
<value>OmniDeck saves a report on this PC and opens a new GitHub issue in your browser, with the short fields filled in. Nothing is sent: attach the report to the issue yourself. Web addresses keep no query, and tokens, cookies, email addresses, long ids and your user name are taken out first.</value>
</data>
<data name="Report_Subject" xml:space="preserve">
<value>What is it about?</value>
</data>
<data name="Report_General" xml:space="preserve">
<value>OmniDeck in general</value>
</data>
<data name="Report_Preview" xml:space="preserve">
<value>The issue text, also in the report as issue.md</value>
</data>
<data name="Report_Save" xml:space="preserve">
<value>Save and open GitHub</value>
</data>
<data name="Tray_Play" xml:space="preserve">
<value>Play</value>
</data>
<data name="Tray_Pause" xml:space="preserve">
<value>Pause</value>
</data>
<data name="Tray_Next" xml:space="preserve">
<value>Next</value>
</data>
<data name="Tray_Previous" xml:space="preserve">
<value>Previous</value>
</data>
<data name="About_Prereleases" xml:space="preserve">
<value>Get pre-release versions (alphas and betas)</value>
</data>
<data name="About_PrereleasesNote" xml:space="preserve">
<value>Every version before 1.0 is a pre-release. From 1.0 on, leave this off to get stable versions only.</value>
</data>
<data name="Shell_NavModules" xml:space="preserve">
<value>Modules</value>
</data>
<data name="Shell_NavFooter" xml:space="preserve">
<value>Settings and library</value>
</data>
<data name="A11y_RowAction" xml:space="preserve">
<value>{0}, {1}</value>
<comment>What screen readers hear for a button on a row of a list: {0} is the button&apos;s label, {1} the row&apos;s name, as in &quot;Remove, Tokyo&quot;.</comment>
</data>
<data name="A11y_Minimize" xml:space="preserve">
<value>Minimize</value>
</data>
<data name="A11y_Maximize" xml:space="preserve">
<value>Maximize</value>
</data>
<data name="A11y_Restore" xml:space="preserve">
<value>Restore</value>
</data>
<data name="A11y_Close" xml:space="preserve">
<value>Close</value>
</data>
<data name="A11y_OpenNavigation" xml:space="preserve">
<value>Open navigation</value>
</data>
<data name="A11y_CloseNavigation" xml:space="preserve">
<value>Close navigation</value>
</data>
<data name="A11y_Increase" xml:space="preserve">
<value>Increase</value>
</data>
<data name="A11y_Decrease" xml:space="preserve">
<value>Decrease</value>
</data>
<data name="A11y_ShowPassword" xml:space="preserve">
<value>Show password</value>
</data>
<data name="A11y_ScrollUp" xml:space="preserve">
<value>Scroll up</value>
</data>
<data name="A11y_ScrollDown" xml:space="preserve">
<value>Scroll down</value>
</data>
<data name="A11y_ScrollLeft" xml:space="preserve">
<value>Scroll left</value>
</data>
<data name="A11y_ScrollRight" xml:space="preserve">
<value>Scroll right</value>
</data>
<data name="A11y_PageUp" xml:space="preserve">
<value>Page up</value>
</data>
<data name="A11y_PageDown" xml:space="preserve">
<value>Page down</value>
</data>
<data name="A11y_PageLeft" xml:space="preserve">
<value>Page left</value>
</data>
<data name="A11y_PageRight" xml:space="preserve">
<value>Page right</value>
</data>
<data name="Settings_AccentColors" xml:space="preserve">
<value>Accent colors</value>
</data>
<data name="Accent_Blue" xml:space="preserve">
<value>Blue</value>
</data>
<data name="Accent_Purple" xml:space="preserve">
<value>Purple</value>
</data>
<data name="Accent_Pink" xml:space="preserve">
<value>Pink</value>
</data>
<data name="Accent_Red" xml:space="preserve">
<value>Red</value>
</data>
<data name="Accent_Orange" xml:space="preserve">
<value>Orange</value>
</data>
<data name="Accent_Green" xml:space="preserve">
<value>Green</value>
</data>
<data name="Shell_OpenDataFolder" xml:space="preserve">
<value>Open the data folder</value>
</data>
<data name="Shell_SearchShortcut" xml:space="preserve">
<value>Ctrl+K</value>
<comment>The search box&apos;s tooltip: the shortcut that opens it, with the key names your keyboards show.</comment>
</data>
<data name="A11y_Clear" xml:space="preserve">
<value>Clear</value>
</data>
</root>
+568
View File
@@ -0,0 +1,568 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!-- The shell's UI strings, Vietnamese. A key missing here shows in English (Strings.resx). -->
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="App_Name" xml:space="preserve">
<value>OmniDeck</value>
</data>
<data name="Shell_Search" xml:space="preserve">
<value>Tìm kiếm mô-đun và lệnh</value>
</data>
<data name="Shell_Library" xml:space="preserve">
<value>Thư viện</value>
</data>
<data name="Shell_LibraryTitle" xml:space="preserve">
<value>Thư viện mô-đun</value>
</data>
<data name="Shell_LibraryIntro" xml:space="preserve">
<value>Mở một mô-đun, hoặc ghim để giữ mô-đun đó trên thanh bên.</value>
</data>
<data name="Shell_LibraryEmpty" xml:space="preserve">
<value>Chưa có mô-đun nào.</value>
</data>
<data name="Shell_Open" xml:space="preserve">
<value>Mở</value>
</data>
<data name="Shell_Pin" xml:space="preserve">
<value>Ghim vào thanh bên</value>
</data>
<data name="Shell_Unpin" xml:space="preserve">
<value>Bỏ ghim khỏi thanh bên</value>
</data>
<data name="Shell_Close" xml:space="preserve">
<value>Đóng</value>
</data>
<data name="Shell_PopOut" xml:space="preserve">
<value>Mở trong cửa sổ riêng</value>
</data>
<data name="Shell_PopIn" xml:space="preserve">
<value>Về cửa sổ chính</value>
</data>
<data name="Shell_PaletteCommand" xml:space="preserve">
<value>Lệnh</value>
</data>
<data name="Shell_Quit" xml:space="preserve">
<value>Thoát OmniDeck</value>
</data>
<data name="Tray_Open" xml:space="preserve">
<value>Mở OmniDeck</value>
</data>
<data name="Tray_QuickTimer" xml:space="preserve">
<value>Bắt đầu hẹn giờ 5 phút</value>
</data>
<data name="Tray_Quit" xml:space="preserve">
<value>Thoát</value>
</data>
<data name="Tray_StillRunningTitle" xml:space="preserve">
<value>OmniDeck vẫn đang chạy</value>
</data>
<data name="Tray_StillRunningMessage" xml:space="preserve">
<value>OmniDeck tiếp tục chạy trong khu vực thông báo. Để thoát, chọn Thoát trong menu của biểu tượng.</value>
</data>
<data name="Error_Title" xml:space="preserve">
<value>Đã xảy ra lỗi</value>
</data>
<data name="Error_UiMessage" xml:space="preserve">
<value>Đã xảy ra lỗi, nhưng OmniDeck vẫn đang chạy.
Mã hỗ trợ: {0}
{1}</value>
</data>
<data name="Error_StartFailed" xml:space="preserve">
<value>Không thể khởi động OmniDeck.
{0}</value>
</data>
<data name="Memory_Title" xml:space="preserve">
<value>Mô-đun đang chạy</value>
</data>
<data name="Memory_Intro" xml:space="preserve">
<value>Theo thời gian, mô-đun bị ẩn sẽ lần lượt chuyển sang nhàn rỗi, tạm dừng rồi ngủ đông để tiết kiệm bộ nhớ. Bật Luôn chạy để một mô-đun không bị chuyển.</value>
</data>
<data name="Memory_InUse" xml:space="preserve">
<value>Đang dùng: {0}</value>
</data>
<data name="Memory_Limits" xml:space="preserve">
<value>Giới hạn mềm {0} · giới hạn cứng {1}</value>
</data>
<data name="Memory_SharedNote" xml:space="preserve">
<value>Mô-đun tích hợp dùng chung tiến trình của OmniDeck, nên chỉ ứng dụng web mới có số liệu riêng.</value>
</data>
<data name="Memory_SharedTitle" xml:space="preserve">
<value>Tiến trình web dùng chung</value>
</data>
<data name="Memory_SharedDescription" xml:space="preserve">
<value>Các tiến trình trình duyệt, đồ họa và trợ giúp mà mọi ứng dụng web đều dùng. Chúng đóng cùng ứng dụng web cuối cùng.</value>
</data>
<data name="Memory_KeepRunning" xml:space="preserve">
<value>Luôn chạy</value>
</data>
<data name="Memory_Suspend" xml:space="preserve">
<value>Tạm dừng</value>
</data>
<data name="Memory_Hibernate" xml:space="preserve">
<value>Ngủ đông</value>
</data>
<data name="Memory_UsedNow" xml:space="preserve">
<value>Đang hiển thị</value>
</data>
<data name="Memory_UsedJustNow" xml:space="preserve">
<value>Vừa dùng</value>
</data>
<data name="Memory_UsedMinutesAgo" xml:space="preserve">
<value>Dùng {0} phút trước</value>
</data>
<data name="Memory_UsedHoursAgo" xml:space="preserve">
<value>Dùng {0} giờ trước</value>
</data>
<data name="State_Created" xml:space="preserve">
<value>Chưa chạy</value>
</data>
<data name="State_Active" xml:space="preserve">
<value>Đang hoạt động</value>
</data>
<data name="State_Idle" xml:space="preserve">
<value>Nhàn rỗi</value>
</data>
<data name="State_Suspended" xml:space="preserve">
<value>Đã tạm dừng</value>
</data>
<data name="State_Hibernated" xml:space="preserve">
<value>Đã ngủ đông</value>
</data>
<data name="State_Closed" xml:space="preserve">
<value>Đã đóng</value>
</data>
<data name="Governor_HardCapTitle" xml:space="preserve">
<value>OmniDeck đang dùng nhiều bộ nhớ</value>
</data>
<data name="Governor_HardCapHibernatedOne" xml:space="preserve">
<value>Đã cho một mô-đun ngủ đông để không vượt quá giới hạn {0}.</value>
</data>
<data name="Governor_HardCapHibernated" xml:space="preserve">
<value>Đã cho {0} mô-đun ngủ đông để không vượt quá giới hạn {1}.</value>
</data>
<data name="Governor_HardCapKept" xml:space="preserve">
<value>Đã vượt giới hạn {0} nhưng không thể cho thêm mô-đun nào ngủ đông: các mô-đun đang mở đều đang được dùng hoặc đang bật Luôn chạy.</value>
</data>
<data name="Governor_HardCapShared" xml:space="preserve">
<value>Đã vượt giới hạn {0} vì các tiến trình dùng chung của những ứng dụng web đang mở chiếm {1}, chủ yếu cho đồ họa. Cho các mô-đun khác ngủ đông cũng không giảm được mức này.</value>
</data>
<data name="Governor_ResidentHibernatedTitle" xml:space="preserve">
<value>Đã cho {0} ngủ đông để tiết kiệm bộ nhớ</value>
</data>
<data name="Governor_ResidentHibernated" xml:space="preserve">
<value>Sẽ không có thông báo cho đến khi bạn mở lại. Bấm vào đây để mở.</value>
</data>
<data name="Settings_Nav" xml:space="preserve">
<value>Cài đặt</value>
</data>
<data name="Settings_Title" xml:space="preserve">
<value>Cài đặt</value>
</data>
<data name="Settings_General" xml:space="preserve">
<value>Chung</value>
</data>
<data name="Settings_Appearance" xml:space="preserve">
<value>Giao diện</value>
</data>
<data name="Settings_Memory" xml:space="preserve">
<value>Bộ nhớ</value>
</data>
<data name="Settings_Data" xml:space="preserve">
<value>Dữ liệu</value>
</data>
<data name="Settings_About" xml:space="preserve">
<value>Giới thiệu</value>
</data>
<data name="Settings_Language" xml:space="preserve">
<value>Ngôn ngữ</value>
</data>
<data name="Settings_CloseToTray" xml:space="preserve">
<value>Tiếp tục chạy trong khu vực thông báo khi đóng cửa sổ</value>
</data>
<data name="Settings_StartWithWindows" xml:space="preserve">
<value>Khởi động OmniDeck khi tôi đăng nhập vào Windows</value>
</data>
<data name="Settings_Theme" xml:space="preserve">
<value>Chủ đề</value>
</data>
<data name="Settings_Preset" xml:space="preserve">
<value>Bố cục</value>
</data>
<data name="Settings_FontScale" xml:space="preserve">
<value>Cỡ chữ</value>
</data>
<data name="Settings_Motion" xml:space="preserve">
<value>Hiệu ứng chuyển động</value>
</data>
<data name="Settings_AccentSystem" xml:space="preserve">
<value>Dùng màu nhấn của Windows</value>
</data>
<data name="Settings_IdleAfter" xml:space="preserve">
<value>Tạm dừng mô-đun bị ẩn sau (phút)</value>
</data>
<data name="Settings_HibernateAfter" xml:space="preserve">
<value>Cho mô-đun bị ẩn ngủ đông sau (phút)</value>
</data>
<data name="Settings_SoftCap" xml:space="preserve">
<value>Giới hạn bộ nhớ mềm (MB, 0: tự động)</value>
</data>
<data name="Settings_HardCap" xml:space="preserve">
<value>Giới hạn bộ nhớ cứng (MB, 0: tự động)</value>
</data>
<data name="Settings_DataFolder" xml:space="preserve">
<value>Thư mục dữ liệu</value>
</data>
<data name="Settings_OpenDataFolder" xml:space="preserve">
<value>Mở</value>
</data>
<data name="Settings_Export" xml:space="preserve">
<value>Xuất cài đặt…</value>
</data>
<data name="Settings_Import" xml:space="preserve">
<value>Nhập cài đặt…</value>
</data>
<data name="Settings_FileFilter" xml:space="preserve">
<value>Cài đặt OmniDeck (*.json)|*.json</value>
</data>
<data name="Settings_Exported" xml:space="preserve">
<value>Đã xuất cài đặt.</value>
</data>
<data name="Settings_Imported" xml:space="preserve">
<value>Đã nhập cài đặt.</value>
</data>
<data name="Settings_ImportFailed" xml:space="preserve">
<value>Tệp đó không phải là tệp cài đặt OmniDeck.</value>
</data>
<data name="Language_System" xml:space="preserve">
<value>Theo Windows</value>
</data>
<data name="Theme_System" xml:space="preserve">
<value>Theo Windows</value>
</data>
<data name="Theme_Light" xml:space="preserve">
<value>Sáng</value>
</data>
<data name="Theme_Dark" xml:space="preserve">
<value>Tối</value>
</data>
<data name="Preset_Dynamic" xml:space="preserve">
<value>Năng động</value>
</data>
<data name="Preset_DynamicHint" xml:space="preserve">
<value>Gọn và sinh động: chữ nhỏ hơn, nhiều chuyển động hơn.</value>
</data>
<data name="Preset_Standard" xml:space="preserve">
<value>Tiêu chuẩn</value>
</data>
<data name="Preset_StandardHint" xml:space="preserve">
<value>Cân bằng, phù hợp với hầu hết mọi người.</value>
</data>
<data name="Preset_Comfort" xml:space="preserve">
<value>Dễ nhìn</value>
</data>
<data name="Preset_ComfortHint" xml:space="preserve">
<value>Chữ và vùng bấm lớn hơn, không có chuyển động.</value>
</data>
<data name="Onboarding_Title" xml:space="preserve">
<value>Chào mừng đến với OmniDeck</value>
</data>
<data name="Onboarding_Intro" xml:space="preserve">
<value>Chọn ngôn ngữ và bố cục. Bố cục được áp dụng ngay khi bạn chọn.</value>
</data>
<data name="Onboarding_Later" xml:space="preserve">
<value>Bạn có thể đổi cả hai sau trong Cài đặt.</value>
</data>
<data name="Onboarding_Done" xml:space="preserve">
<value>Bắt đầu</value>
</data>
<data name="Legal_Title" xml:space="preserve">
<value>Trước khi bạn bắt đầu</value>
</data>
<data name="Legal_Intro" xml:space="preserve">
<value>OmniDeck là phần mềm tự do theo giấy phép GNU General Public License v3. Vui lòng đọc các tài liệu này: khi bạn tiếp tục, OmniDeck ghi nhận rằng bạn đã đọc chúng. Điều này không phải là điều kiện của giấy phép.</value>
</data>
<data name="Legal_Eula" xml:space="preserve">
<value>Thỏa thuận cấp phép</value>
</data>
<data name="Legal_Disclaimer" xml:space="preserve">
<value>Miễn trừ trách nhiệm</value>
</data>
<data name="Legal_Privacy" xml:space="preserve">
<value>Chính sách quyền riêng tư</value>
</data>
<data name="Legal_Notices" xml:space="preserve">
<value>Thông báo của bên thứ ba</value>
</data>
<data name="Legal_HaveRead" xml:space="preserve">
<value>Tôi đã đọc các tài liệu này</value>
</data>
<data name="Legal_Continue" xml:space="preserve">
<value>Tiếp tục</value>
</data>
<data name="Legal_Quit" xml:space="preserve">
<value>Thoát</value>
</data>
<data name="Legal_Close" xml:space="preserve">
<value>Đóng</value>
</data>
<data name="Legal_Missing" xml:space="preserve">
<value>Bản OmniDeck này thiếu {0}.</value>
</data>
<data name="About_Version" xml:space="preserve">
<value>Phiên bản {0}</value>
</data>
<data name="About_CheckUpdates" xml:space="preserve">
<value>Kiểm tra bản cập nhật</value>
</data>
<data name="About_Checking" xml:space="preserve">
<value>Đang kiểm tra bản cập nhật…</value>
</data>
<data name="About_UpToDate" xml:space="preserve">
<value>OmniDeck đã là phiên bản mới nhất.</value>
</data>
<data name="About_Available" xml:space="preserve">
<value>Đã có phiên bản {0}.</value>
</data>
<data name="About_Download" xml:space="preserve">
<value>Tải xuống và khởi động lại</value>
</data>
<data name="About_Downloading" xml:space="preserve">
<value>Đang tải xuống bản cập nhật: {0}%</value>
</data>
<data name="About_Failed" xml:space="preserve">
<value>Không thể cập nhật: {0}</value>
</data>
<data name="About_NotInstalled" xml:space="preserve">
<value>Cập nhật hoạt động trên bản OmniDeck đã cài đặt, không phải trên bản dựng phát triển.</value>
</data>
<data name="About_Links" xml:space="preserve">
<value>Liên kết</value>
</data>
<data name="About_GitHub" xml:space="preserve">
<value>Mã nguồn trên GitHub</value>
</data>
<data name="About_Discussions" xml:space="preserve">
<value>Thảo luận</value>
</data>
<data name="About_Discord" xml:space="preserve">
<value>Discord</value>
</data>
<data name="About_Legal" xml:space="preserve">
<value>Giấy phép và tài liệu pháp lý</value>
</data>
<data name="About_Credits" xml:space="preserve">
<value>OmniDeck được xây dựng bằng .NET, WPF-UI, Velopack, CommunityToolkit.Mvvm, H.NotifyIcon, Serilog, Dapper, SQLite và Markdig. Danh sách đầy đủ có trong Thông báo của bên thứ ba.</value>
</data>
<data name="Update_AvailableTitle" xml:space="preserve">
<value>Đã có OmniDeck {0}</value>
</data>
<data name="Update_AvailableMessage" xml:space="preserve">
<value>Mở Cài đặt → Giới thiệu để cài đặt.</value>
</data>
<data name="Dialog_OK" xml:space="preserve">
<value>OK</value>
</data>
<data name="Dialog_Cancel" xml:space="preserve">
<value>Hủy</value>
</data>
<data name="Settings_WebApps" xml:space="preserve">
<value>Ứng dụng web</value>
</data>
<data name="WebApps_Intro" xml:space="preserve">
<value>Chọn những ứng dụng web được hiện thông báo. Ứng dụng đã bật thông báo sẽ tiếp tục chạy khi bị ẩn để có thể thông báo cho bạn; ứng dụng chỉ bị đóng khi OmniDeck thiếu bộ nhớ.</value>
</data>
<data name="WebApps_Notifications" xml:space="preserve">
<value>Thông báo</value>
</data>
<data name="WebApps_NoPermissions" xml:space="preserve">
<value>Chưa có yêu cầu quyền nào</value>
</data>
<data name="WebApps_Allowed" xml:space="preserve">
<value>{0}: đã cho phép</value>
</data>
<data name="WebApps_Blocked" xml:space="preserve">
<value>{0}: đã chặn</value>
</data>
<data name="WebApps_ResetPermissions" xml:space="preserve">
<value>Hỏi lại</value>
</data>
<data name="WebApps_DataTitle" xml:space="preserve">
<value>Dữ liệu đăng nhập</value>
</data>
<data name="WebApps_DataIntro" xml:space="preserve">
<value>Các ứng dụng trong cùng một nhóm dùng chung một lần đăng nhập. Xóa dữ liệu của một nhóm sẽ đăng xuất bạn khỏi tất cả ứng dụng trong nhóm và đóng chúng.</value>
</data>
<data name="WebApps_ClearData" xml:space="preserve">
<value>Xóa dữ liệu</value>
</data>
<data name="WebApps_ClearTitle" xml:space="preserve">
<value>Xóa dữ liệu đăng nhập?</value>
</data>
<data name="WebApps_ClearMessage" xml:space="preserve">
<value>Bạn sẽ bị đăng xuất khỏi {0}. Cookie, dữ liệu trang web và các trang đã lưu trong bộ nhớ đệm của các ứng dụng này sẽ bị xóa.</value>
</data>
<data name="WebApps_ClearConfirm" xml:space="preserve">
<value>Xóa dữ liệu</value>
</data>
<data name="WebApps_Cleared" xml:space="preserve">
<value>Đã xóa dữ liệu của {0}.</value>
</data>
<data name="WebApps_ClearFailed" xml:space="preserve">
<value>Không thể xóa dữ liệu. Khởi động lại OmniDeck rồi thử lại.</value>
</data>
<data name="WebApps_Catalog" xml:space="preserve">
<value>Danh mục ứng dụng web ngày {0}, gồm {1} ứng dụng.</value>
</data>
<data name="WebApps_Checked" xml:space="preserve">
<value>Đã kiểm tra danh mục mới lần cuối vào {0}.</value>
</data>
<data name="WebApps_NotChecked" xml:space="preserve">
<value>Chưa kiểm tra danh mục mới.</value>
</data>
<data name="About_ReportBug" xml:space="preserve">
<value>Báo lỗi</value>
</data>
<data name="Error_Report" xml:space="preserve">
<value>Báo lỗi</value>
</data>
<data name="Report_Title" xml:space="preserve">
<value>Báo lỗi</value>
</data>
<data name="Report_Intro" xml:space="preserve">
<value>OmniDeck lưu một báo cáo trên PC này và mở một issue mới trên GitHub trong trình duyệt của bạn, với các trường ngắn đã điền sẵn. Không có gì được gửi đi: bạn tự đính kèm báo cáo vào issue. Địa chỉ web được bỏ phần truy vấn; token, cookie, địa chỉ email, ID dài và tên người dùng của bạn được lược bỏ trước.</value>
</data>
<data name="Report_Subject" xml:space="preserve">
<value>Lỗi liên quan đến phần nào?</value>
</data>
<data name="Report_General" xml:space="preserve">
<value>OmniDeck nói chung</value>
</data>
<data name="Report_Preview" xml:space="preserve">
<value>Nội dung issue, cũng có trong báo cáo dưới tên issue.md</value>
</data>
<data name="Report_Save" xml:space="preserve">
<value>Lưu và mở GitHub</value>
</data>
<data name="Tray_Play" xml:space="preserve">
<value>Phát</value>
</data>
<data name="Tray_Pause" xml:space="preserve">
<value>Tạm dừng</value>
</data>
<data name="Tray_Next" xml:space="preserve">
<value>Tiếp theo</value>
</data>
<data name="Tray_Previous" xml:space="preserve">
<value>Trước đó</value>
</data>
<data name="About_Prereleases" xml:space="preserve">
<value>Nhận bản thử nghiệm (alpha và beta)</value>
</data>
<data name="About_PrereleasesNote" xml:space="preserve">
<value>Mọi phiên bản trước 1.0 đều là bản thử nghiệm. Từ 1.0 trở đi, tắt tùy chọn này để chỉ nhận bản ổn định.</value>
</data>
<data name="Shell_NavModules" xml:space="preserve">
<value>Mô-đun</value>
</data>
<data name="Shell_NavFooter" xml:space="preserve">
<value>Cài đặt và thư viện</value>
</data>
<data name="A11y_RowAction" xml:space="preserve">
<value>{0}, {1}</value>
</data>
<data name="A11y_Minimize" xml:space="preserve">
<value>Thu nhỏ</value>
</data>
<data name="A11y_Maximize" xml:space="preserve">
<value>Phóng to</value>
</data>
<data name="A11y_Restore" xml:space="preserve">
<value>Khôi phục</value>
</data>
<data name="A11y_Close" xml:space="preserve">
<value>Đóng</value>
</data>
<data name="A11y_OpenNavigation" xml:space="preserve">
<value>Mở ngăn dẫn hướng</value>
</data>
<data name="A11y_CloseNavigation" xml:space="preserve">
<value>Đóng ngăn dẫn hướng</value>
</data>
<data name="A11y_Increase" xml:space="preserve">
<value>Tăng</value>
</data>
<data name="A11y_Decrease" xml:space="preserve">
<value>Giảm</value>
</data>
<data name="A11y_ShowPassword" xml:space="preserve">
<value>Hiện mật khẩu</value>
</data>
<data name="A11y_ScrollUp" xml:space="preserve">
<value>Cuộn lên</value>
</data>
<data name="A11y_ScrollDown" xml:space="preserve">
<value>Cuộn xuống</value>
</data>
<data name="A11y_ScrollLeft" xml:space="preserve">
<value>Cuộn sang trái</value>
</data>
<data name="A11y_ScrollRight" xml:space="preserve">
<value>Cuộn sang phải</value>
</data>
<data name="A11y_PageUp" xml:space="preserve">
<value>Lên một trang</value>
</data>
<data name="A11y_PageDown" xml:space="preserve">
<value>Xuống một trang</value>
</data>
<data name="A11y_PageLeft" xml:space="preserve">
<value>Sang trái một trang</value>
</data>
<data name="A11y_PageRight" xml:space="preserve">
<value>Sang phải một trang</value>
</data>
<data name="Settings_AccentColors" xml:space="preserve">
<value>Màu nhấn</value>
</data>
<data name="Accent_Blue" xml:space="preserve">
<value>Xanh lam</value>
</data>
<data name="Accent_Purple" xml:space="preserve">
<value>Tím</value>
</data>
<data name="Accent_Pink" xml:space="preserve">
<value>Hồng</value>
</data>
<data name="Accent_Red" xml:space="preserve">
<value>Đỏ</value>
</data>
<data name="Accent_Orange" xml:space="preserve">
<value>Cam</value>
</data>
<data name="Accent_Green" xml:space="preserve">
<value>Xanh lục</value>
</data>
<data name="Shell_OpenDataFolder" xml:space="preserve">
<value>Mở thư mục dữ liệu</value>
</data>
<data name="Shell_SearchShortcut" xml:space="preserve">
<value>Ctrl+K</value>
</data>
<data name="A11y_Clear" xml:space="preserve">
<value>Xóa</value>
</data>
</root>
@@ -0,0 +1,9 @@
namespace OmniDeck.App.Settings;
/// <summary>Starting OmniDeck when the user signs in to Windows, quietly in the tray.</summary>
public interface IOdStartupRegistration
{
bool IsEnabled { get; }
void Set(bool enabled);
}
@@ -0,0 +1,110 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using OmniDeck.App.Updates;
using OmniDeck.Core;
using OmniDeck.Core.Localization;
namespace OmniDeck.App.Settings;
/// <summary>
/// Settings → About (docs/SPEC.md §2): version and commit, the update check (Velopack against GitHub
/// releases), and the project's links. Used from the UI thread.
/// </summary>
public sealed partial class OdAboutViewModel(IOdUpdateService updates, Action<Uri> open) : ObservableObject
{
public const string Repository = "https://github.com/poli0981/OmniDeck";
public const string Discussions = Repository + "/discussions";
public const string Discord = "https://discord.gg/u8tn3YypyX";
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(CanDownload))]
private OdUpdateState _state = OdUpdateState.Idle;
[ObservableProperty]
private string _statusText = "";
private readonly string _version = OdVersionInfo.FromAssembly(typeof(OdAboutViewModel).Assembly).DisplayText;
// The status as a sentence to read again after a change of language.
private Func<string> _status = () => "";
public string VersionText => OdLocalization.Format("About_Version", _version);
public bool CanDownload => State == OdUpdateState.Available;
/// <summary>Raised when the user asks to report a bug.</summary>
public event EventHandler? BugReportRequested;
/// <summary>Raised when the user asks to read the legal documents again.</summary>
public event EventHandler? LegalRequested;
/// <summary>Reads the version and the status again, after a change of language.</summary>
public void RefreshTexts()
{
OnPropertyChanged(nameof(VersionText));
StatusText = _status();
}
/// <summary>Opening About checks for updates (docs/ARCHITECTURE.md §7), unless a check already ran.</summary>
public Task CheckOnOpenAsync() => State == OdUpdateState.Idle ? CheckCommand.ExecuteAsync(null) : Task.CompletedTask;
[RelayCommand]
private async Task CheckAsync()
{
if (!updates.IsInstalled)
{
Show(OdUpdateState.NotInstalled, () => OdLocalization.Get("About_NotInstalled"));
return;
}
Show(OdUpdateState.Checking, () => OdLocalization.Get("About_Checking"));
try
{
var version = await updates.CheckAsync(CancellationToken.None);
if (version is null)
{
Show(OdUpdateState.UpToDate, () => OdLocalization.Get("About_UpToDate"));
}
else
{
Show(OdUpdateState.Available, () => OdLocalization.Format("About_Available", version));
}
}
catch (Exception ex) when (ex is not OperationCanceledException)
{
// Offline, rate-limited or a broken release: say so and let the user try again.
Show(OdUpdateState.Failed, () => OdLocalization.Format("About_Failed", ex.Message));
}
}
[RelayCommand]
private async Task DownloadAsync()
{
Show(OdUpdateState.Downloading, () => OdLocalization.Format("About_Downloading", 0));
try
{
await updates.DownloadAsync(new Progress<int>(percent => Show(OdUpdateState.Downloading, () => OdLocalization.Format("About_Downloading", percent))), CancellationToken.None);
updates.ApplyAndRestart();
}
catch (Exception ex) when (ex is not OperationCanceledException)
{
Show(OdUpdateState.Failed, () => OdLocalization.Format("About_Failed", ex.Message));
}
}
[RelayCommand]
private void OpenLink(string link) => open(new Uri(link, UriKind.Absolute));
[RelayCommand]
private void ShowLegal() => LegalRequested?.Invoke(this, EventArgs.Empty);
[RelayCommand]
private void ReportBug() => BugReportRequested?.Invoke(this, EventArgs.Empty);
private void Show(OdUpdateState state, Func<string> status)
{
State = state;
_status = status;
StatusText = status();
}
}
@@ -0,0 +1,43 @@
using CommunityToolkit.Mvvm.ComponentModel;
using OmniDeck.Core.Localization;
namespace OmniDeck.App.Settings;
/// <summary>An accent color to pick in Settings → Appearance, with the name screen readers say for it.</summary>
public sealed class OdAccentSwatch : ObservableObject
{
private readonly Func<string> _name;
public OdAccentSwatch(string color, Func<string> name)
{
ArgumentNullException.ThrowIfNull(name);
Color = color;
_name = name;
Name = name();
}
public string Color { get; }
public string Name { get; private set; }
/// <summary>The swatches, in the order Settings shows them.</summary>
public static IReadOnlyList<OdAccentSwatch> All() =>
[
new("#0067C0", () => OdLocalization.Get("Accent_Blue")),
new("#8764B8", () => OdLocalization.Get("Accent_Purple")),
new("#C239B3", () => OdLocalization.Get("Accent_Pink")),
new("#E74856", () => OdLocalization.Get("Accent_Red")),
new("#CA5010", () => OdLocalization.Get("Accent_Orange")),
new("#10893E", () => OdLocalization.Get("Accent_Green")),
];
/// <summary>Reads the name again, after a change of language.</summary>
public void RefreshName()
{
Name = _name();
OnPropertyChanged(nameof(Name));
}
/// <summary>The color's name: screen readers name a list item after its data.</summary>
public override string ToString() => Name;
}
+40
View File
@@ -0,0 +1,40 @@
using CommunityToolkit.Mvvm.ComponentModel;
namespace OmniDeck.App.Settings;
/// <summary>
/// One entry of a settings choice: the value stored and the text shown. The text follows the UI language
/// in place (<see cref="RefreshTitle"/>): a list rebuilt instead would clear the selection bound to it.
/// </summary>
public sealed class OdChoice<T> : ObservableObject
{
private readonly Func<string> _title;
public OdChoice(T value, Func<string> title)
{
ArgumentNullException.ThrowIfNull(title);
Value = value;
_title = title;
Title = title();
}
/// <summary>A choice whose text is not localized, such as a module's name.</summary>
public OdChoice(T value, string title)
: this(value, () => title)
{
}
public T Value { get; }
public string Title { get; private set; }
/// <summary>Reads the text again, after a change of language.</summary>
public void RefreshTitle()
{
Title = _title();
OnPropertyChanged(nameof(Title));
}
/// <summary>The text shown: screen readers name a list item after its data.</summary>
public override string ToString() => Title;
}
@@ -0,0 +1,76 @@
using System.Windows;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using OmniDeck.Core.Localization;
using OmniDeck.Core.Settings;
using OmniDeck.Core.Storage;
using OmniDeck.Core.Theming;
namespace OmniDeck.App.Settings;
/// <summary>
/// First-run setup, right after the legal gate: the language and the UI preset. Each preset card
/// previews its preset with the layer the theme engine builds for it, and a preset applies to the
/// whole window as soon as it is picked. Get started records that setup is done.
/// </summary>
public sealed partial class OdOnboardingViewModel : ObservableObject
{
private readonly IOdSettingsService _settings;
private readonly IOdAppMeta _meta;
[ObservableProperty]
private string _language;
[ObservableProperty]
private string _preset;
public OdOnboardingViewModel(IOdSettingsService settings, IOdAppMeta meta, Func<OdPreset, ResourceDictionary>? preview = null)
{
ArgumentNullException.ThrowIfNull(settings);
_settings = settings;
_meta = meta;
_language = settings.Current.Language;
_preset = settings.Current.Preset;
Presets = OdPresetOption.All(preview);
OdLocalization.FollowCulture(OnCultureChanged);
}
/// <summary>Raised once the user is done.</summary>
public event EventHandler? Finished;
public IReadOnlyList<OdChoice<string>> Languages { get; } = OdSettingsViewModel.LanguageChoices();
public IReadOnlyList<OdPresetOption> Presets { get; }
/// <summary>Whether this is the first run, so setup still has to happen.</summary>
public static bool IsNeeded(IOdAppMeta meta)
{
ArgumentNullException.ThrowIfNull(meta);
return meta.Get(OdAppMetaKeys.OnboardingDone) is null;
}
[RelayCommand]
private void Finish()
{
_meta.Set(OdAppMetaKeys.OnboardingDone, "1");
Finished?.Invoke(this, EventArgs.Empty);
}
partial void OnLanguageChanged(string value) => _settings.Update(s => s with { Language = value });
// Picking a language here switches it at once: the lists' texts follow, in place.
private void OnCultureChanged(object? sender, EventArgs e)
{
foreach (var choice in Languages)
{
choice.RefreshTitle();
}
foreach (var option in Presets)
{
option.RefreshTexts();
}
}
partial void OnPresetChanged(string value) => _settings.Update(s => s with { Preset = value });
}
@@ -0,0 +1,84 @@
<ui:FluentWindow x:Class="OmniDeck.App.Settings.OdOnboardingWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:res="clr-namespace:OmniDeck.Core.Localization;assembly=OmniDeck.Core"
xmlns:settings="clr-namespace:OmniDeck.App.Settings"
xmlns:theming="clr-namespace:OmniDeck.App.Theming"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="{res:OdLoc Onboarding_Title}"
Width="760"
Height="560"
MinWidth="520"
MinHeight="420"
ExtendsContentIntoTitleBar="True"
WindowBackdropType="Mica"
WindowStartupLocation="CenterScreen">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ui:TitleBar Title="{res:OdLoc Onboarding_Title}" Grid.Row="0" />
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="{DynamicResource Od.Padding.Card}">
<TextBlock AutomationProperties.HeadingLevel="Level1"
FontSize="{DynamicResource Od.Font.H1}"
FontWeight="SemiBold"
Text="{res:OdLoc Onboarding_Title}" />
<TextBlock Margin="{DynamicResource Od.Margin.Item}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{res:OdLoc Onboarding_Intro}"
TextWrapping="Wrap" />
<TextBlock FontWeight="SemiBold" Text="{res:OdLoc Settings_Language}" />
<ComboBox Width="{DynamicResource Od.Width.Tile}"
Margin="{DynamicResource Od.Margin.Item}"
HorizontalAlignment="Left"
AutomationProperties.Name="{res:OdLoc Settings_Language}"
DisplayMemberPath="Title"
ItemsSource="{Binding Languages}"
SelectedValue="{Binding Language}"
SelectedValuePath="Value" />
<TextBlock FontWeight="SemiBold" Text="{res:OdLoc Settings_Preset}" />
<ListBox Margin="{DynamicResource Od.Margin.Item}"
AutomationProperties.Name="{res:OdLoc Settings_Preset}"
Background="Transparent"
BorderThickness="0"
ItemsSource="{Binding Presets}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectedValue="{Binding Preset}"
SelectedValuePath="Name">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type settings:OdPresetOption}">
<!-- The card's text has its preset's own layer: each card shows that preset's sizes and text colors. -->
<Border Width="200" Padding="{DynamicResource Od.Padding.Control}">
<StackPanel theming:OdPresetPreview.Layer="{Binding Preview}">
<TextBlock FontSize="{DynamicResource Od.Font.H2}"
FontWeight="SemiBold"
Text="{Binding Title}" />
<TextBlock FontSize="{DynamicResource Od.Font.Base}"
Style="{StaticResource PresetHint}"
Text="{Binding Hint}" />
</StackPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Foreground="{DynamicResource TextFillColorTertiaryBrush}"
Text="{res:OdLoc Onboarding_Later}"
TextWrapping="Wrap" />
</StackPanel>
</ScrollViewer>
<ui:Button Grid.Row="2"
Margin="{DynamicResource Od.Padding.Card}"
HorizontalAlignment="Right"
Appearance="Primary"
Command="{Binding FinishCommand}"
Content="{res:OdLoc Onboarding_Done}" />
</Grid>
</ui:FluentWindow>
@@ -0,0 +1,13 @@
namespace OmniDeck.App.Settings;
/// <summary>First-run setup, between the legal gate and the main window; closing it keeps the defaults.</summary>
public partial class OdOnboardingWindow
{
public OdOnboardingWindow(OdOnboardingViewModel viewModel)
{
ArgumentNullException.ThrowIfNull(viewModel);
InitializeComponent();
DataContext = viewModel;
viewModel.Finished += (_, _) => Close();
}
}
@@ -0,0 +1,43 @@
using System.Windows;
using CommunityToolkit.Mvvm.ComponentModel;
using OmniDeck.Core.Localization;
using OmniDeck.Core.Theming;
namespace OmniDeck.App.Settings;
/// <summary>A UI preset as the preset cards show it (docs/UI-MODES.md); its texts follow the UI language in place.</summary>
public sealed class OdPresetOption : ObservableObject
{
public OdPresetOption(string name, ResourceDictionary? preview = null)
{
Name = name;
Preview = preview;
Title = OdLocalization.Get("Preset_" + name);
Hint = OdLocalization.Get("Preset_" + name + "Hint");
}
public string Name { get; }
public string Title { get; private set; }
public string Hint { get; private set; }
/// <summary>The preset's own layer, when the card previews it (<see cref="Theming.OdPresetPreview"/>).</summary>
public ResourceDictionary? Preview { get; }
/// <summary>The three presets, in the order the cards show them, each with its preview when <paramref name="preview"/> builds one.</summary>
public static IReadOnlyList<OdPresetOption> All(Func<OdPreset, ResourceDictionary>? preview = null) =>
[.. OdPreset.All.Select(preset => new OdPresetOption(preset.Name, preview?.Invoke(preset)))];
/// <summary>Reads the texts again, after a change of language.</summary>
public void RefreshTexts()
{
Title = OdLocalization.Get("Preset_" + Name);
Hint = OdLocalization.Get("Preset_" + Name + "Hint");
OnPropertyChanged(nameof(Title));
OnPropertyChanged(nameof(Hint));
}
/// <summary>The card's title: screen readers name a list item after its data.</summary>
public override string ToString() => Title;
}
@@ -0,0 +1,44 @@
using Microsoft.Win32;
namespace OmniDeck.App.Settings;
/// <summary>
/// <see cref="IOdStartupRegistration"/> through the per-user Run key: no admin rights, and removed
/// with the value. The command starts OmniDeck with <see cref="MinimizedArgument"/>, straight to the tray.
/// </summary>
public sealed class OdRunKeyStartup(string keyPath, string valueName, string executable) : IOdStartupRegistration
{
public const string MinimizedArgument = "--minimized";
public const string RunKey = @"Software\Microsoft\Windows\CurrentVersion\Run";
/// <summary>The registration for this process's executable under the real Run key.</summary>
public OdRunKeyStartup()
: this(RunKey, "OmniDeck", Environment.ProcessPath ?? "OmniDeck.exe")
{
}
public string Command => $"\"{executable}\" {MinimizedArgument}";
public bool IsEnabled
{
get
{
using var key = Registry.CurrentUser.OpenSubKey(keyPath);
return string.Equals(key?.GetValue(valueName) as string, Command, StringComparison.OrdinalIgnoreCase);
}
}
public void Set(bool enabled)
{
using var key = Registry.CurrentUser.CreateSubKey(keyPath, writable: true);
if (enabled)
{
key.SetValue(valueName, Command, RegistryValueKind.String);
}
else
{
key.DeleteValue(valueName, throwOnMissingValue: false);
}
}
}
@@ -0,0 +1,355 @@
<UserControl x:Class="OmniDeck.App.Settings.OdSettingsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:a11y="clr-namespace:OmniDeck.Core.Accessibility;assembly=OmniDeck.Core"
xmlns:res="clr-namespace:OmniDeck.Core.Localization;assembly=OmniDeck.Core"
xmlns:settings="clr-namespace:OmniDeck.App.Settings"
xmlns:shell="clr-namespace:OmniDeck.App.Shell"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
FontSize="{DynamicResource Od.Font.Base}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}">
<!-- The navigation view's frame does not pass the window's text color and size down: pages set their own. -->
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="Visible" />
</UserControl.Resources>
<DockPanel Margin="{DynamicResource Od.Padding.Card}">
<TextBlock Margin="{DynamicResource Od.Margin.Item}"
AutomationProperties.HeadingLevel="Level1"
DockPanel.Dock="Top"
FontSize="{DynamicResource Od.Font.H1}"
FontWeight="SemiBold"
Text="{res:OdLoc Settings_Title}" />
<TabControl AutomationProperties.Name="{res:OdLoc Settings_Title}" SelectedIndex="{Binding SectionIndex}">
<TabItem Header="{res:OdLoc Settings_General}">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Margin="{DynamicResource Od.Padding.Control}">
<ui:CardControl Margin="{DynamicResource Od.Margin.Item}" Header="{res:OdLoc Settings_Language}">
<ComboBox MinWidth="{DynamicResource Od.Width.Field}"
AutomationProperties.Name="{res:OdLoc Settings_Language}"
DisplayMemberPath="Title"
ItemsSource="{Binding Languages}"
SelectedValue="{Binding Language}"
SelectedValuePath="Value" />
</ui:CardControl>
<ui:CardControl Margin="{DynamicResource Od.Margin.Item}" Header="{res:OdLoc Settings_CloseToTray}">
<ui:ToggleSwitch AutomationProperties.Name="{res:OdLoc Settings_CloseToTray}" IsChecked="{Binding CloseToTray}" />
</ui:CardControl>
<ui:CardControl Margin="{DynamicResource Od.Margin.Item}" Header="{res:OdLoc Settings_StartWithWindows}">
<ui:ToggleSwitch AutomationProperties.Name="{res:OdLoc Settings_StartWithWindows}" IsChecked="{Binding StartWithWindows}" />
</ui:CardControl>
</StackPanel>
</ScrollViewer>
</TabItem>
<TabItem Header="{res:OdLoc Settings_Appearance}">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Margin="{DynamicResource Od.Padding.Control}">
<ui:CardControl Margin="{DynamicResource Od.Margin.Item}" Header="{res:OdLoc Settings_Theme}">
<ComboBox MinWidth="{DynamicResource Od.Width.Field}"
AutomationProperties.Name="{res:OdLoc Settings_Theme}"
DisplayMemberPath="Title"
ItemsSource="{Binding Themes}"
SelectedValue="{Binding Theme}"
SelectedValuePath="Value" />
</ui:CardControl>
<TextBlock Margin="{DynamicResource Od.Padding.Control}"
FontWeight="SemiBold"
Text="{res:OdLoc Settings_Preset}" />
<ListBox Margin="{DynamicResource Od.Margin.Item}"
AutomationProperties.Name="{res:OdLoc Settings_Preset}"
Background="Transparent"
BorderThickness="0"
ItemsSource="{Binding Presets}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectedValue="{Binding Preset}"
SelectedValuePath="Name">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type settings:OdPresetOption}">
<StackPanel Width="220" Margin="{DynamicResource Od.Padding.Control}">
<TextBlock FontSize="{DynamicResource Od.Font.H2}"
FontWeight="SemiBold"
Text="{Binding Title}" />
<TextBlock Style="{StaticResource PresetHint}" Text="{Binding Hint}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<ui:CardControl Margin="{DynamicResource Od.Margin.Item}" Header="{res:OdLoc Settings_FontScale}">
<StackPanel Orientation="Horizontal">
<Slider Width="220"
VerticalAlignment="Center"
AutomationProperties.Name="{res:OdLoc Settings_FontScale}"
IsSnapToTickEnabled="True"
Maximum="1.4"
Minimum="0.85"
TickFrequency="0.05"
Value="{Binding FontScale}" />
<TextBlock Margin="{DynamicResource Od.Padding.Control}"
VerticalAlignment="Center"
Text="{Binding FontScale, StringFormat={}{0:P0}}" />
</StackPanel>
</ui:CardControl>
<ui:CardControl Margin="{DynamicResource Od.Margin.Item}" Header="{res:OdLoc Settings_Motion}">
<ui:ToggleSwitch AutomationProperties.Name="{res:OdLoc Settings_Motion}" IsChecked="{Binding MotionEnabled}" />
</ui:CardControl>
<!-- High Contrast uses Windows' colors, the accent included (docs/UI-MODES.md §4): no accent to pick there. -->
<StackPanel>
<StackPanel.Style>
<Style TargetType="StackPanel">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=(SystemParameters.HighContrast)}" Value="True">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<ui:CardControl Margin="{DynamicResource Od.Margin.Item}" Header="{res:OdLoc Settings_AccentSystem}">
<ui:ToggleSwitch AutomationProperties.Name="{res:OdLoc Settings_AccentSystem}" IsChecked="{Binding UseSystemAccent}" />
</ui:CardControl>
<ListBox Margin="{DynamicResource Od.Margin.Item}"
AutomationProperties.Name="{res:OdLoc Settings_AccentColors}"
Background="Transparent"
BorderThickness="0"
ItemsSource="{Binding AccentSwatches}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectedItem="{Binding SelectedSwatch}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type settings:OdAccentSwatch}">
<Border Width="{DynamicResource Od.HitTarget.Min}"
Height="{DynamicResource Od.HitTarget.Min}"
Background="{Binding Color}"
CornerRadius="{DynamicResource Od.Corner.Radius}"
ToolTip="{Binding Name}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</StackPanel>
</ScrollViewer>
</TabItem>
<TabItem Header="{res:OdLoc Settings_Memory}">
<DockPanel>
<WrapPanel Margin="{DynamicResource Od.Padding.Control}" DockPanel.Dock="Top">
<StackPanel Margin="{DynamicResource Od.Padding.Control}">
<TextBlock Text="{res:OdLoc Settings_IdleAfter}" />
<ui:NumberBox Width="{DynamicResource Od.Width.Field}"
AutomationProperties.Name="{res:OdLoc Settings_IdleAfter}"
MaxDecimalPlaces="0"
Maximum="10080"
Minimum="1"
Value="{Binding IdleAfterMinutes}" />
</StackPanel>
<StackPanel Margin="{DynamicResource Od.Padding.Control}">
<TextBlock Text="{res:OdLoc Settings_HibernateAfter}" />
<ui:NumberBox Width="{DynamicResource Od.Width.Field}"
AutomationProperties.Name="{res:OdLoc Settings_HibernateAfter}"
MaxDecimalPlaces="0"
Maximum="10080"
Minimum="1"
Value="{Binding HibernateAfterMinutes}" />
</StackPanel>
<StackPanel Margin="{DynamicResource Od.Padding.Control}">
<TextBlock Text="{res:OdLoc Settings_SoftCap}" />
<ui:NumberBox Width="{DynamicResource Od.Width.Field}"
AutomationProperties.Name="{res:OdLoc Settings_SoftCap}"
MaxDecimalPlaces="0"
Minimum="0"
Value="{Binding SoftCapMegabytes}" />
</StackPanel>
<StackPanel Margin="{DynamicResource Od.Padding.Control}">
<TextBlock Text="{res:OdLoc Settings_HardCap}" />
<ui:NumberBox Width="{DynamicResource Od.Width.Field}"
AutomationProperties.Name="{res:OdLoc Settings_HardCap}"
MaxDecimalPlaces="0"
Minimum="0"
Value="{Binding HardCapMegabytes}" />
</StackPanel>
</WrapPanel>
<shell:OdMemoryPage DataContext="{Binding Memory}" />
</DockPanel>
</TabItem>
<TabItem Header="{res:OdLoc Settings_WebApps}">
<ScrollViewer DataContext="{Binding WebApps}" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="{DynamicResource Od.Padding.Control}">
<TextBlock Margin="{DynamicResource Od.Margin.Item}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{res:OdLoc WebApps_Intro}"
TextWrapping="Wrap" />
<ItemsControl Focusable="False"
Grid.IsSharedSizeScope="True"
ItemsSource="{Binding Apps}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type settings:OdWebAppRowViewModel}">
<ui:Card Margin="{DynamicResource Od.Margin.Item}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" SharedSizeGroup="Reset" />
<ColumnDefinition Width="Auto" SharedSizeGroup="Notify" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center">
<TextBlock FontWeight="SemiBold"
Text="{Binding Name}"
TextTrimming="CharacterEllipsis" />
<TextBlock Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{Binding PermissionsText}"
TextWrapping="Wrap" />
</StackPanel>
<ui:Button Grid.Column="1"
Margin="{DynamicResource Od.Padding.Control}"
VerticalAlignment="Center"
AutomationProperties.Name="{res:OdLocRow WebApps_ResetPermissions,
Path=Name}"
Command="{Binding DataContext.ResetPermissionsCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Content="{res:OdLoc WebApps_ResetPermissions}"
IsEnabled="{Binding HasPermissions}" />
<ui:ToggleSwitch Grid.Column="2"
Margin="{DynamicResource Od.Padding.Control}"
VerticalAlignment="Center"
AutomationProperties.Name="{res:OdLocRow WebApps_Notifications,
Path=Name}"
Command="{Binding DataContext.ToggleNotificationsCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Content="{res:OdLoc WebApps_Notifications}"
IsChecked="{Binding Notifications, Mode=OneWay}" />
</Grid>
</ui:Card>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Margin="{DynamicResource Od.Margin.Item}"
AutomationProperties.HeadingLevel="Level2"
FontSize="{DynamicResource Od.Font.H2}"
FontWeight="SemiBold"
Text="{res:OdLoc WebApps_DataTitle}" />
<TextBlock Margin="{DynamicResource Od.Margin.Item}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{res:OdLoc WebApps_DataIntro}"
TextWrapping="Wrap" />
<ItemsControl Focusable="False" ItemsSource="{Binding Profiles}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type settings:OdWebProfileGroup}">
<ui:Card Margin="{DynamicResource Od.Margin.Item}">
<DockPanel>
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
VerticalAlignment="Center"
AutomationProperties.Name="{res:OdLocRow WebApps_ClearData,
Path=AppNames}"
Command="{Binding DataContext.ClearDataCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Content="{res:OdLoc WebApps_ClearData}"
DockPanel.Dock="Right" />
<TextBlock VerticalAlignment="Center"
Text="{Binding AppNames}"
TextWrapping="Wrap" />
</DockPanel>
</ui:Card>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<a11y:OdStatusText Margin="{DynamicResource Od.Padding.Control}"
Text="{Binding Message}"
TextWrapping="Wrap" />
<TextBlock Margin="{DynamicResource Od.Padding.Control}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{Binding CatalogText}" />
<TextBlock Margin="{DynamicResource Od.Padding.Control}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{Binding CheckedText}" />
</StackPanel>
</ScrollViewer>
</TabItem>
<TabItem Header="{res:OdLoc Settings_Data}">
<StackPanel Margin="{DynamicResource Od.Padding.Control}">
<ui:CardControl Margin="{DynamicResource Od.Margin.Item}" Header="{res:OdLoc Settings_DataFolder}">
<ui:Button Command="{Binding OpenDataFolderCommand}" Content="{res:OdLoc Settings_OpenDataFolder}" />
</ui:CardControl>
<TextBlock Margin="{DynamicResource Od.Padding.Control}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{Binding DataFolder}" />
<StackPanel Margin="{DynamicResource Od.Margin.Item}" Orientation="Horizontal">
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
Click="OnExportClick"
Content="{res:OdLoc Settings_Export}" />
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
Click="OnImportClick"
Content="{res:OdLoc Settings_Import}" />
</StackPanel>
<a11y:OdStatusText Margin="{DynamicResource Od.Padding.Control}" Text="{Binding DataMessage}" />
</StackPanel>
</TabItem>
<TabItem Header="{res:OdLoc Settings_About}">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Margin="{DynamicResource Od.Padding.Control}" DataContext="{Binding About}">
<TextBlock AutomationProperties.HeadingLevel="Level2"
FontSize="{DynamicResource Od.Font.H2}"
FontWeight="SemiBold"
Text="{res:OdLoc App_Name}" />
<TextBlock Margin="{DynamicResource Od.Margin.Item}" Text="{Binding VersionText}" />
<StackPanel Margin="{DynamicResource Od.Margin.Item}" Orientation="Horizontal">
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
Command="{Binding CheckCommand}"
Content="{res:OdLoc About_CheckUpdates}" />
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
Appearance="Primary"
Command="{Binding DownloadCommand}"
Content="{res:OdLoc About_Download}"
Visibility="{Binding CanDownload, Converter={StaticResource Visible}}" />
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
Command="{Binding ReportBugCommand}"
Content="{res:OdLoc About_ReportBug}" />
</StackPanel>
<a11y:OdStatusText Margin="{DynamicResource Od.Margin.Item}"
AutomationProperties.LiveSetting="Polite"
Text="{Binding StatusText}"
TextWrapping="Wrap" />
<ui:CardControl Margin="{DynamicResource Od.Margin.Item}" Header="{res:OdLoc About_Prereleases}">
<ui:CardControl.Content>
<ui:ToggleSwitch AutomationProperties.Name="{res:OdLoc About_Prereleases}" IsChecked="{Binding DataContext.ReceivePrereleases, RelativeSource={RelativeSource AncestorType=TabItem}}" />
</ui:CardControl.Content>
</ui:CardControl>
<TextBlock Margin="{DynamicResource Od.Margin.Item}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{res:OdLoc About_PrereleasesNote}"
TextWrapping="Wrap" />
<TextBlock Margin="{DynamicResource Od.Padding.Control}"
FontWeight="SemiBold"
Text="{res:OdLoc About_Links}" />
<WrapPanel Margin="{DynamicResource Od.Margin.Item}">
<ui:HyperlinkButton Command="{Binding OpenLinkCommand}"
CommandParameter="{x:Static settings:OdAboutViewModel.Repository}"
Content="{res:OdLoc About_GitHub}" />
<ui:HyperlinkButton Command="{Binding OpenLinkCommand}"
CommandParameter="{x:Static settings:OdAboutViewModel.Discussions}"
Content="{res:OdLoc About_Discussions}" />
<ui:HyperlinkButton Command="{Binding OpenLinkCommand}"
CommandParameter="{x:Static settings:OdAboutViewModel.Discord}"
Content="{res:OdLoc About_Discord}" />
<ui:HyperlinkButton Command="{Binding ShowLegalCommand}" Content="{res:OdLoc About_Legal}" />
</WrapPanel>
<TextBlock Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{res:OdLoc About_Credits}"
TextWrapping="Wrap" />
</StackPanel>
</ScrollViewer>
</TabItem>
</TabControl>
</DockPanel>
</UserControl>
@@ -0,0 +1,34 @@
using System.Windows;
using Microsoft.Win32;
using OmniDeck.Core.Localization;
namespace OmniDeck.App.Settings;
/// <summary>The settings page, bound to <see cref="OdSettingsViewModel"/>; the file dialogs live here.</summary>
public partial class OdSettingsPage
{
public OdSettingsPage()
{
InitializeComponent();
}
private OdSettingsViewModel? ViewModel => DataContext as OdSettingsViewModel;
private void OnExportClick(object sender, RoutedEventArgs e)
{
var dialog = new SaveFileDialog { FileName = "omnideck-settings.json", Filter = OdLocalization.Get("Settings_FileFilter") };
if (dialog.ShowDialog(Window.GetWindow(this)) == true)
{
ViewModel?.ExportTo(dialog.FileName);
}
}
private void OnImportClick(object sender, RoutedEventArgs e)
{
var dialog = new OpenFileDialog { Filter = OdLocalization.Get("Settings_FileFilter") };
if (dialog.ShowDialog(Window.GetWindow(this)) == true)
{
ViewModel?.ImportFrom(dialog.FileName);
}
}
}
@@ -0,0 +1,12 @@
namespace OmniDeck.App.Settings;
/// <summary>The tabs of the settings page (docs/SPEC.md §2), in order.</summary>
public enum OdSettingsSection
{
General,
Appearance,
Memory,
WebApps,
Data,
About,
}
@@ -0,0 +1,7 @@
namespace OmniDeck.App.Settings;
/// <summary>Something asked for a settings tab, such as the palette's "Running modules".</summary>
public sealed class OdSettingsSectionEventArgs(OdSettingsSection section) : EventArgs
{
public OdSettingsSection Section { get; } = section;
}
@@ -0,0 +1,290 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using OmniDeck.App.Shell;
using OmniDeck.Core;
using OmniDeck.Core.Localization;
using OmniDeck.Core.Settings;
using OmniDeck.Core.Storage;
namespace OmniDeck.App.Settings;
/// <summary>
/// The settings page (docs/SPEC.md §2): General, Appearance, Memory, Web apps, Data and About. Every change is
/// saved at once through <see cref="IOdSettingsService"/>, and the page follows changes made
/// elsewhere (the tray, an import). Used from the UI thread.
/// </summary>
public sealed partial class OdSettingsViewModel : ObservableObject, IDisposable
{
private readonly IOdSettingsService _settings;
private readonly IOdStartupRegistration _startup;
private readonly Action<string> _openFolder;
private bool _loading;
/// <summary>The selected tab, as an <see cref="OdSettingsSection"/> index.</summary>
[ObservableProperty]
private int _sectionIndex;
[ObservableProperty]
private string _language = "";
[ObservableProperty]
private bool _closeToTray;
[ObservableProperty]
private bool _startWithWindows;
/// <summary>Whether updates include alphas and betas: the user's choice, or what the running build is.</summary>
[ObservableProperty]
private bool _receivePrereleases;
[ObservableProperty]
private OdThemeMode _theme;
[ObservableProperty]
private string _preset = "";
[ObservableProperty]
private double _fontScale = 1;
[ObservableProperty]
private bool _motionEnabled;
[ObservableProperty]
private bool _useSystemAccent;
[ObservableProperty]
private string _accentColor = "";
// Doubles because WPF-UI's NumberBox edits a double?.
[ObservableProperty]
private double? _idleAfterMinutes;
[ObservableProperty]
private double? _hibernateAfterMinutes;
[ObservableProperty]
private double? _softCapMegabytes;
[ObservableProperty]
private double? _hardCapMegabytes;
[ObservableProperty]
private string _dataMessage = "";
public OdSettingsViewModel(
IOdSettingsService settings,
IOdStartupRegistration startup,
OdDataRoot dataRoot,
OdMemoryViewModel memory,
OdWebAppsViewModel webApps,
OdAboutViewModel about,
Action<string> openFolder)
{
ArgumentNullException.ThrowIfNull(settings);
ArgumentNullException.ThrowIfNull(dataRoot);
_settings = settings;
_startup = startup;
_openFolder = openFolder;
Memory = memory;
WebApps = webApps;
About = about;
DataFolder = dataRoot.Root;
Load(settings.Current);
settings.Changed += OnSettingsChanged;
OdLocalization.FollowCulture(OnCultureChanged);
}
public IReadOnlyList<OdChoice<string>> Languages { get; } = LanguageChoices();
public IReadOnlyList<OdChoice<OdThemeMode>> Themes { get; } =
[
new(OdThemeMode.System, () => OdLocalization.Get("Theme_System")),
new(OdThemeMode.Light, () => OdLocalization.Get("Theme_Light")),
new(OdThemeMode.Dark, () => OdLocalization.Get("Theme_Dark")),
];
public IReadOnlyList<OdPresetOption> Presets { get; } = OdPresetOption.All();
/// <summary>Accent colors to pick from when the Windows accent is not used.</summary>
public IReadOnlyList<OdAccentSwatch> AccentSwatches { get; } = OdAccentSwatch.All();
/// <summary>The swatch in use, or null with the Windows accent; picking one leaves the Windows accent.</summary>
public OdAccentSwatch? SelectedSwatch
{
get => UseSystemAccent ? null : AccentSwatches.FirstOrDefault(swatch => string.Equals(swatch.Color, AccentColor, StringComparison.OrdinalIgnoreCase));
set
{
if (value is not null)
{
AccentColor = value.Color;
UseSystemAccent = false;
}
}
}
public OdMemoryViewModel Memory { get; }
public OdWebAppsViewModel WebApps { get; }
public OdAboutViewModel About { get; }
public string DataFolder { get; }
/// <summary>
/// The language choices: Windows' display language, then the languages OmniDeck ships, each named in
/// itself, so that whoever reads the list finds their own language whatever the UI's.
/// </summary>
public static IReadOnlyList<OdChoice<string>> LanguageChoices() =>
[
new("", () => OdLocalization.Get("Language_System")),
.. OdLanguages.Shipped.Select(name => new OdChoice<string>(name, OdLanguages.NativeName(name))),
];
public void ShowSection(OdSettingsSection section) => SectionIndex = (int)section;
public void ExportTo(string path)
{
_settings.Export(path);
DataMessage = OdLocalization.Get("Settings_Exported");
}
public void ImportFrom(string path) =>
DataMessage = _settings.Import(path) ? OdLocalization.Get("Settings_Imported") : OdLocalization.Get("Settings_ImportFailed");
public void Dispose()
{
OdLocalization.UnfollowCulture(OnCultureChanged);
_settings.Changed -= OnSettingsChanged;
}
[RelayCommand]
private void OpenDataFolder() => _openFolder(DataFolder);
partial void OnSectionIndexChanged(int value)
{
if (value == (int)OdSettingsSection.About)
{
_ = About.CheckOnOpenAsync();
}
else if (value == (int)OdSettingsSection.WebApps)
{
WebApps.Refresh();
}
}
partial void OnLanguageChanged(string value) => Apply(s => s with { Language = value });
partial void OnCloseToTrayChanged(bool value) => Apply(s => s with { CloseToTray = value });
partial void OnReceivePrereleasesChanged(bool value) => Apply(s => s with { Prereleases = value });
partial void OnStartWithWindowsChanged(bool value)
{
if (!_loading)
{
_startup.Set(value);
Apply(s => s with { StartWithWindows = value });
}
}
partial void OnThemeChanged(OdThemeMode value) => Apply(s => s with { Theme = value });
partial void OnPresetChanged(string value) => Apply(s => s with { Preset = value });
partial void OnFontScaleChanged(double value) => Apply(s => s with { FontScale = value });
partial void OnMotionEnabledChanged(bool value) => Apply(s => s with { MotionEnabled = value });
partial void OnUseSystemAccentChanged(bool value)
{
// Leaving the Windows accent keeps the color already picked, or starts from the first swatch.
var custom = AccentColor.Length > 0 ? AccentColor : AccentSwatches[0].Color;
Apply(s => s with { AccentColor = value ? "" : custom });
OnPropertyChanged(nameof(SelectedSwatch));
}
partial void OnAccentColorChanged(string value)
{
Apply(s => s with { AccentColor = UseSystemAccent ? "" : value });
OnPropertyChanged(nameof(SelectedSwatch));
}
partial void OnIdleAfterMinutesChanged(double? value) =>
Apply(s => s with { Memory = s.Memory with { IdleAfterMinutes = WholeNumber(value, s.Memory.IdleAfterMinutes) } });
partial void OnHibernateAfterMinutesChanged(double? value) =>
Apply(s => s with { Memory = s.Memory with { HibernateAfterMinutes = WholeNumber(value, s.Memory.HibernateAfterMinutes) } });
partial void OnSoftCapMegabytesChanged(double? value) =>
Apply(s => s with { Memory = s.Memory with { SoftCapMegabytes = WholeNumber(value, 0) } });
partial void OnHardCapMegabytesChanged(double? value) =>
Apply(s => s with { Memory = s.Memory with { HardCapMegabytes = WholeNumber(value, 0) } });
private static int WholeNumber(double? value, int fallback) =>
value is { } number && double.IsFinite(number) ? (int)Math.Clamp(Math.Floor(number), 0, int.MaxValue) : fallback;
private void Apply(Func<OdSettings, OdSettings> change)
{
if (!_loading)
{
_settings.Update(change);
}
}
private void OnSettingsChanged(object? sender, OdSettingsChangedEventArgs e) => Load(e.Settings);
// The lists keep their items, whose texts change in place: the selections bound to them stay.
private void OnCultureChanged(object? sender, EventArgs e)
{
foreach (var choice in Languages)
{
choice.RefreshTitle();
}
foreach (var choice in Themes)
{
choice.RefreshTitle();
}
foreach (var option in Presets)
{
option.RefreshTexts();
}
foreach (var swatch in AccentSwatches)
{
swatch.RefreshName();
}
About.RefreshTexts();
WebApps.Refresh();
}
/// <summary>Shows <paramref name="settings"/> without writing anything back.</summary>
private void Load(OdSettings settings)
{
_loading = true;
try
{
Language = settings.Language;
CloseToTray = settings.CloseToTray;
ReceivePrereleases = OdUpdateChannel.IncludesPrereleases(settings.Prereleases, OdVersionInfo.FromAssembly(typeof(OdSettingsViewModel).Assembly).Version);
StartWithWindows = _startup.IsEnabled;
Theme = settings.Theme;
Preset = settings.Preset;
FontScale = settings.FontScale;
MotionEnabled = settings.MotionEnabled;
UseSystemAccent = settings.AccentColor.Length == 0;
AccentColor = settings.AccentColor;
IdleAfterMinutes = settings.Memory.IdleAfterMinutes;
HibernateAfterMinutes = settings.Memory.HibernateAfterMinutes;
SoftCapMegabytes = settings.Memory.SoftCapMegabytes;
HardCapMegabytes = settings.Memory.HardCapMegabytes;
}
finally
{
_loading = false;
}
}
}
@@ -0,0 +1,39 @@
using CommunityToolkit.Mvvm.ComponentModel;
using OmniDeck.Core.Localization;
using OmniDeck.Web.Apps;
using OmniDeck.Web.Catalog;
namespace OmniDeck.App.Settings;
/// <summary>One web app in Settings → Web apps: its notifications switch and the permissions it was answered.</summary>
public sealed partial class OdWebAppRowViewModel(OdCatalogEntry entry) : ObservableObject
{
[ObservableProperty]
private bool _notifications;
[ObservableProperty]
private bool _hasPermissions;
[ObservableProperty]
private string _permissionsText = "";
public OdCatalogEntry Entry => entry;
public string Name => entry.Name;
public void Refresh(bool notifications, IReadOnlyDictionary<string, bool> permissions)
{
ArgumentNullException.ThrowIfNull(permissions);
Notifications = notifications;
HasPermissions = permissions.Count > 0;
PermissionsText = permissions.Count == 0
? OdLocalization.Get("WebApps_NoPermissions")
: string.Join(" · ", permissions.OrderBy(pair => pair.Key, StringComparer.Ordinal).Select(pair => Answer(pair.Key, pair.Value)));
}
public override string ToString() => Name;
private static string Answer(string kind, bool allowed) => allowed
? OdLocalization.Format("WebApps_Allowed", OdWebPermissions.Name(kind))
: OdLocalization.Format("WebApps_Blocked", OdWebPermissions.Name(kind));
}
@@ -0,0 +1,136 @@
using System.Globalization;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using OmniDeck.Core.Localization;
using OmniDeck.Core.Modules;
using OmniDeck.Core.Settings;
using OmniDeck.Web.Apps;
using OmniDeck.Web.Catalog;
using OmniDeck.Web.Diagnostics;
using Serilog;
namespace OmniDeck.App.Settings;
/// <summary>
/// Settings → Web apps: each catalog app's notifications switch and the permissions it was answered,
/// the sign-in data each profile group keeps, and the catalog this session runs. Used from the UI thread.
/// </summary>
public sealed partial class OdWebAppsViewModel : ObservableObject, IDisposable
{
private readonly OdCatalogService _catalog;
private readonly OdWebPreferences _preferences;
private readonly IOdSettingsService _settings;
private readonly OdModuleHost _host;
private readonly OdSignInHealth _health;
private readonly Func<string, Task> _clearProfile;
private readonly Func<string, Task<bool>> _confirmClear;
private readonly ILogger _log;
[ObservableProperty]
private string _catalogText = "";
[ObservableProperty]
private string _checkedText = "";
[ObservableProperty]
private string _message = "";
/// <summary>The page over the session's catalog.</summary>
/// <param name="catalog">The session's catalog, and when main's copy was last checked.</param>
/// <param name="preferences">The user's choices for each app.</param>
/// <param name="settings">Where those choices are kept, to follow changes made in the apps.</param>
/// <param name="host">Closes a group's apps before their data is cleared.</param>
/// <param name="health">Told that a cleared profile comes back empty on purpose.</param>
/// <param name="clearProfile">Deletes a catalog profile's data.</param>
/// <param name="confirmClear">Asks before clearing, with the group's app names; false to stop.</param>
/// <param name="log">The app log.</param>
public OdWebAppsViewModel(
OdCatalogService catalog,
OdWebPreferences preferences,
IOdSettingsService settings,
OdModuleHost host,
OdSignInHealth health,
Func<string, Task> clearProfile,
Func<string, Task<bool>> confirmClear,
ILogger log)
{
ArgumentNullException.ThrowIfNull(catalog);
ArgumentNullException.ThrowIfNull(settings);
ArgumentNullException.ThrowIfNull(log);
_catalog = catalog;
_preferences = preferences;
_settings = settings;
_host = host;
_health = health;
_clearProfile = clearProfile;
_confirmClear = confirmClear;
_log = log.ForContext<OdWebAppsViewModel>();
var apps = catalog.Current.Apps;
Apps = [.. apps.Select(entry => new OdWebAppRowViewModel(entry))];
Profiles =
[
.. apps.GroupBy(entry => entry.Profile, StringComparer.Ordinal)
.Select(group => new OdWebProfileGroup(group.Key, [.. group.Select(entry => entry.Id)], string.Join(", ", group.Select(entry => entry.Name)))),
];
settings.Changed += OnSettingsChanged;
Refresh();
}
public IReadOnlyList<OdWebAppRowViewModel> Apps { get; }
public IReadOnlyList<OdWebProfileGroup> Profiles { get; }
public bool HasApps => Apps.Count > 0;
/// <summary>Reads the choices and the catalog check again; the settings page calls it whenever the tab opens.</summary>
public void Refresh()
{
foreach (var row in Apps)
{
row.Refresh(_preferences.NotificationsOn(row.Entry), _preferences.Permissions(row.Entry.Id));
}
CatalogText = OdLocalization.Format("WebApps_Catalog", _catalog.Current.Updated, Apps.Count);
CheckedText = _catalog.LastChecked is { } checkedAt
? OdLocalization.Format("WebApps_Checked", checkedAt.ToLocalTime().ToString("g", CultureInfo.CurrentCulture))
: OdLocalization.Get("WebApps_NotChecked");
}
public void Dispose() => _settings.Changed -= OnSettingsChanged;
[RelayCommand]
private void ToggleNotifications(OdWebAppRowViewModel row) => _preferences.SetNotifications(row.Entry, !_preferences.NotificationsOn(row.Entry));
[RelayCommand]
private void ResetPermissions(OdWebAppRowViewModel row) => _preferences.ResetPermissions(row.Entry.Id);
/// <summary>Signs out of every app in the group: closes them, then deletes the profile's data.</summary>
[RelayCommand]
private async Task ClearDataAsync(OdWebProfileGroup group)
{
Message = "";
if (!await _confirmClear(group.AppNames))
{
return;
}
try
{
foreach (var id in group.AppIds)
{
await _host.CloseAsync(id);
}
await _clearProfile(group.Profile);
_health.Forget(group.Profile);
Message = OdLocalization.Format("WebApps_Cleared", group.AppNames);
}
catch (Exception ex) when (ex is not OutOfMemoryException)
{
_log.Warning(ex, "Web profile {Profile} could not be cleared", group.Profile);
Message = OdLocalization.Get("WebApps_ClearFailed");
}
}
private void OnSettingsChanged(object? sender, OdSettingsChangedEventArgs e) => Refresh();
}
@@ -0,0 +1,11 @@
namespace OmniDeck.App.Settings;
/// <summary>The web apps that share one catalog profile, and with it their sign-in data.</summary>
/// <param name="Profile">The catalog profile.</param>
/// <param name="AppIds">The apps' ids, in catalog order.</param>
/// <param name="AppNames">The apps' names, as one list to show.</param>
public sealed record OdWebProfileGroup(string Profile, IReadOnlyList<string> AppIds, string AppNames)
{
/// <summary>The apps' names: screen readers name a list item after its data.</summary>
public override string ToString() => AppNames;
}
+11
View File
@@ -0,0 +1,11 @@
namespace OmniDeck.App.Shell;
/// <summary>Ends the app on purpose, as opposed to closing its window into the tray.</summary>
public interface IOdAppLifetime
{
/// <summary>Set once <see cref="QuitAsync"/> starts: window closing must not turn into hiding.</summary>
bool IsQuitting { get; }
/// <summary>Closes the open modules, then ends the app. Calls after the first do nothing.</summary>
Task QuitAsync();
}
+28
View File
@@ -0,0 +1,28 @@
using System.Windows;
using OmniDeck.Core.Modules;
using OmniDeck.Web.Runtime;
namespace OmniDeck.App.Shell;
/// <summary>
/// <see cref="IOdAppLifetime"/> over the WPF application, whose shutdown mode is explicit. The modules
/// close before the dispatcher stops, while they can still save their state and release what they hold,
/// and the shared WebView2 browser process gets a moment to exit and write its cookies out.
/// </summary>
internal sealed class OdAppLifetime(OdModuleHost host, OdWebRuntime web) : IOdAppLifetime
{
public bool IsQuitting { get; private set; }
public async Task QuitAsync()
{
if (IsQuitting)
{
return;
}
IsQuitting = true;
await host.CloseAllAsync();
await web.WaitForExitAsync();
Application.Current?.Shutdown();
}
}
+139
View File
@@ -0,0 +1,139 @@
using System.Globalization;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
using OmniDeck.Core.Localization;
using Wpf.Ui.Controls;
namespace OmniDeck.App.Shell;
/// <summary>
/// Names the buttons inside WPF-UI's templates that screen readers reach with no name, or with a
/// glyph's name such as "CaretUp24": the title bar's buttons, the sidebar's pane button, the scroll bar,
/// slider and number box buttons, a text box's clear button and the password box's reveal button. An
/// editable combo box's text box, which takes the focus, gets its combo box's name. Registered once,
/// for every window, on the first layout of each such button: WPF raises Loaded only on elements that
/// handle it themselves.
/// </summary>
internal static class OdAutomationNames
{
private static readonly IMultiValueConverter Choose = new ChooseConverter();
// By automation ID, which WPF-UI's templates set (or x:Name, which stands in for it).
private static readonly Dictionary<string, Binding> ByPart = new(StringComparer.Ordinal)
{
["TitleBarMinimizeButton"] = Localized("A11y_Minimize"),
["TitleBarCloseButton"] = Localized("A11y_Close"),
["PART_InlineIncrementButton"] = Localized("A11y_Increase"),
["PART_InlineDecrementButton"] = Localized("A11y_Decrease"),
["RevealButton"] = Localized("A11y_ShowPassword"),
["PART_ClearButton"] = Localized("A11y_Clear"),
["PageUp"] = Localized("A11y_PageUp"),
["PageDown"] = Localized("A11y_PageDown"),
["PageLeft"] = Localized("A11y_PageLeft"),
["PageRight"] = Localized("A11y_PageRight"),
["DecreaseLarge"] = Localized("A11y_Decrease"),
["IncreaseLarge"] = Localized("A11y_Increase"),
};
public static void Register()
{
EventManager.RegisterClassHandler(typeof(ButtonBase), FrameworkElement.SizeChangedEvent, new SizeChangedEventHandler(OnButtonSized));
EventManager.RegisterClassHandler(typeof(System.Windows.Controls.TextBox), FrameworkElement.SizeChangedEvent, new SizeChangedEventHandler(OnTextBoxSized));
}
/// <summary>The name <paramref name="button"/> gets, as a binding to its string, or null when it is not one of these.</summary>
internal static Binding? NameFor(ButtonBase button)
{
ArgumentNullException.ThrowIfNull(button);
return (button.Command is { } command ? ByCommand(command) : null) ?? ByPart.GetValueOrDefault(PartOf(button));
}
/// <summary>The automation ID WPF-UI gave the button, or else its x:Name, which UI Automation reports in its place.</summary>
private static string PartOf(ButtonBase button) =>
AutomationProperties.GetAutomationId(button) is { Length: > 0 } id ? id : button.Name;
private static Binding? ByCommand(ICommand command) => command switch
{
_ when command == ScrollBar.LineUpCommand => Localized("A11y_ScrollUp"),
_ when command == ScrollBar.LineDownCommand => Localized("A11y_ScrollDown"),
_ when command == ScrollBar.LineLeftCommand => Localized("A11y_ScrollLeft"),
_ when command == ScrollBar.LineRightCommand => Localized("A11y_ScrollRight"),
_ when command == ScrollBar.PageUpCommand => Localized("A11y_PageUp"),
_ when command == ScrollBar.PageDownCommand => Localized("A11y_PageDown"),
_ when command == ScrollBar.PageLeftCommand => Localized("A11y_PageLeft"),
_ when command == ScrollBar.PageRightCommand => Localized("A11y_PageRight"),
_ when command == Slider.DecreaseLarge => Localized("A11y_Decrease"),
_ when command == Slider.IncreaseLarge => Localized("A11y_Increase"),
_ => null,
};
private static void OnButtonSized(object sender, SizeChangedEventArgs e)
{
if (sender is not ButtonBase button || !string.IsNullOrEmpty(AutomationProperties.GetName(button)))
{
return;
}
var part = PartOf(button);
if (string.Equals(part, "TitleBarMaximizeButton", StringComparison.Ordinal))
{
// Maximize, or Restore once the window is maximized, as Windows' own title bars say.
NameAfter(button, new Binding(nameof(Window.WindowState)) { RelativeSource = Ancestor(typeof(Window)), Converter = IsMaximized.Instance }, Localized("A11y_Maximize"), Localized("A11y_Restore"));
}
else if (string.Equals(part, "NavigationToggleButton", StringComparison.Ordinal))
{
NameAfter(button, new Binding(nameof(NavigationView.IsPaneOpen)) { RelativeSource = Ancestor(typeof(NavigationView)) }, Localized("A11y_OpenNavigation"), Localized("A11y_CloseNavigation"));
}
else if (NameFor(button) is { } name)
{
button.SetBinding(AutomationProperties.NameProperty, name);
}
}
private static void OnTextBoxSized(object sender, SizeChangedEventArgs e)
{
if (sender is System.Windows.Controls.TextBox { TemplatedParent: ComboBox combo } box && string.IsNullOrEmpty(AutomationProperties.GetName(box)))
{
box.SetBinding(AutomationProperties.NameProperty, new Binding { Path = new PropertyPath(AutomationProperties.NameProperty), Source = combo, Mode = BindingMode.OneWay });
}
}
/// <summary>Names <paramref name="button"/> <paramref name="whenFalse"/> or <paramref name="whenTrue"/>, following <paramref name="condition"/>.</summary>
private static void NameAfter(ButtonBase button, Binding condition, Binding whenFalse, Binding whenTrue)
{
var name = new MultiBinding { Converter = Choose, Mode = BindingMode.OneWay };
name.Bindings.Add(condition);
name.Bindings.Add(whenFalse);
name.Bindings.Add(whenTrue);
button.SetBinding(AutomationProperties.NameProperty, name);
}
private static RelativeSource Ancestor(Type type) => new(RelativeSourceMode.FindAncestor, type, 1);
private static Binding Localized(string key) => new($"[{key}]") { Source = OdLocalization.Instance, Mode = BindingMode.OneWay };
private sealed class ChooseConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) => values switch
{
[true, string, string whenTrue] => whenTrue,
[_, string whenFalse, string] => whenFalse,
_ => DependencyProperty.UnsetValue,
};
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotSupportedException();
}
private sealed class IsMaximized : IValueConverter
{
public static readonly IsMaximized Instance = new();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => value is WindowState.Maximized;
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotSupportedException();
}
}
@@ -0,0 +1,70 @@
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using OmniDeck.Core.Search;
namespace OmniDeck.App.Shell;
/// <summary>The command palette (Ctrl+K, docs/SPEC.md §2): fuzzy search over modules and shell commands.</summary>
public sealed partial class OdCommandPaletteViewModel : ObservableObject
{
private readonly IReadOnlyList<OdPaletteEntry> _entries;
[ObservableProperty]
private string _query = "";
[ObservableProperty]
private OdPaletteEntry? _selected;
public OdCommandPaletteViewModel(IReadOnlyList<OdPaletteEntry> entries)
{
ArgumentNullException.ThrowIfNull(entries);
_entries = entries;
Filter();
}
/// <summary>Raised when the user accepts <see cref="Chosen"/>.</summary>
public event EventHandler? Accepted;
public ObservableCollection<OdPaletteEntry> Results { get; } = [];
/// <summary>The accepted entry; <see langword="null"/> while the palette is open or after it was dismissed.</summary>
public OdPaletteEntry? Chosen { get; private set; }
/// <summary>Moves the selection by <paramref name="delta"/> rows, stopping at either end.</summary>
public void MoveSelection(int delta)
{
if (Results.Count == 0)
{
return;
}
var current = Selected is null ? -1 : Results.IndexOf(Selected);
Selected = Results[Math.Clamp(current + delta, 0, Results.Count - 1)];
}
partial void OnQueryChanged(string value) => Filter();
[RelayCommand]
private void Accept()
{
if (Selected is null)
{
return;
}
Chosen = Selected;
Accepted?.Invoke(this, EventArgs.Empty);
}
private void Filter()
{
Results.Clear();
foreach (var entry in OdFuzzyMatcher.Rank(Query, _entries, entry => entry.Title))
{
Results.Add(entry);
}
Selected = Results.Count > 0 ? Results[0] : null;
}
}
@@ -0,0 +1,73 @@
<ui:FluentWindow x:Class="OmniDeck.App.Shell.OdCommandPaletteWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:res="clr-namespace:OmniDeck.Core.Localization;assembly=OmniDeck.Core"
xmlns:shell="clr-namespace:OmniDeck.App.Shell"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="{res:OdLoc Shell_Search}"
Width="600"
MinHeight="0"
ExtendsContentIntoTitleBar="True"
PreviewKeyDown="OnPreviewKeyDown"
ResizeMode="NoResize"
ShowInTaskbar="False"
SizeToContent="Height"
WindowBackdropType="Acrylic"
WindowCornerPreference="Round"
WindowStartupLocation="Manual">
<!--
A borderless overlay without a title bar: type, arrow keys, Enter; Esc or clicking away closes it.
MinHeight 0 undoes FluentWindow's 320, so the window fits a short list of results.
-->
<ui:FluentWindow.Resources>
<shell:OdSymbolConverter x:Key="Symbol" />
</ui:FluentWindow.Resources>
<DockPanel Margin="{DynamicResource Od.Padding.Card}">
<ui:TextBox x:Name="SearchBox"
AutomationProperties.Name="{res:OdLoc Shell_Search}"
ClearButtonEnabled="True"
DockPanel.Dock="Top"
FontSize="{DynamicResource Od.Font.H2}"
PlaceholderText="{res:OdLoc Shell_Search}"
Text="{Binding Query, UpdateSourceTrigger=PropertyChanged}">
<ui:TextBox.Icon>
<ui:SymbolIcon Symbol="Search24" />
</ui:TextBox.Icon>
</ui:TextBox>
<ListBox x:Name="ResultsList"
MaxHeight="420"
Margin="{DynamicResource Od.Margin.Item}"
HorizontalContentAlignment="Stretch"
AutomationProperties.Name="{res:OdLoc Shell_Search}"
Background="Transparent"
BorderThickness="0"
ItemsSource="{Binding Results}"
MouseDoubleClick="OnResultDoubleClick"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectedItem="{Binding Selected}">
<ListBox.ItemContainerStyle>
<Style BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="ListBoxItem">
<Setter Property="AutomationProperties.Name" Value="{Binding Title}" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type shell:OdPaletteEntry}">
<DockPanel>
<ui:SymbolIcon Margin="{DynamicResource Od.Padding.Control}"
VerticalAlignment="Center"
DockPanel.Dock="Left"
FontSize="{DynamicResource Od.Font.H2}"
Symbol="{Binding Icon, Converter={StaticResource Symbol}}" />
<StackPanel VerticalAlignment="Center">
<TextBlock Text="{Binding Title}" TextTrimming="CharacterEllipsis" />
<TextBlock FontSize="{DynamicResource Od.Font.Caption}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{Binding Detail}"
TextTrimming="CharacterEllipsis" />
</StackPanel>
</DockPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DockPanel>
</ui:FluentWindow>
@@ -0,0 +1,82 @@
using System.Windows;
using System.Windows.Input;
namespace OmniDeck.App.Shell;
/// <summary>The command palette overlay (Ctrl+K). After it closes, <see cref="OdCommandPaletteViewModel.Chosen"/> holds the pick.</summary>
public partial class OdCommandPaletteWindow
{
// Sits near the top of its owner, where a search box is expected.
private const double TopOffset = 72;
private readonly OdCommandPaletteViewModel _viewModel;
private bool _closing;
public OdCommandPaletteWindow(OdCommandPaletteViewModel viewModel, Window owner)
{
ArgumentNullException.ThrowIfNull(viewModel);
ArgumentNullException.ThrowIfNull(owner);
InitializeComponent();
_viewModel = viewModel;
DataContext = viewModel;
Owner = owner;
viewModel.Accepted += (_, _) => RequestClose();
Loaded += (_, _) =>
{
var bounds = owner.WindowState == WindowState.Maximized ? owner.RestoreBounds : new Rect(owner.Left, owner.Top, owner.ActualWidth, owner.ActualHeight);
Left = bounds.Left + ((bounds.Width - ActualWidth) / 2);
Top = bounds.Top + TopOffset;
SearchBox.Focus();
};
// Clicking away closes it. Closing deactivates the window too, whoever closes it (Esc, Alt+F4,
// the owner), so a close already under way must not be started again.
Closing += (_, _) => _closing = true;
Deactivated += (_, _) => RequestClose();
}
private void RequestClose()
{
if (_closing)
{
return;
}
_closing = true;
Close();
}
private void OnResultDoubleClick(object sender, MouseButtonEventArgs e) => _viewModel.AcceptCommand.Execute(null);
private void OnPreviewKeyDown(object sender, KeyEventArgs e)
{
switch (e.Key)
{
case Key.Escape:
RequestClose();
break;
case Key.Enter:
_viewModel.AcceptCommand.Execute(null);
break;
case Key.Down:
MoveSelection(1);
break;
case Key.Up:
MoveSelection(-1);
break;
default:
return;
}
e.Handled = true;
}
private void MoveSelection(int delta)
{
_viewModel.MoveSelection(delta);
if (_viewModel.Selected is { } selected)
{
ResultsList.ScrollIntoView(selected);
}
}
}
+73
View File
@@ -0,0 +1,73 @@
using System.Windows;
using OmniDeck.Core.Localization;
using Wpf.Ui;
using Wpf.Ui.Controls;
namespace OmniDeck.App.Shell;
/// <summary>
/// In-window content dialogs, one at a time. Callers check <see cref="CanShow"/> and fall back (a
/// message box, or a safe default) before the main window is up or while another dialog is open.
/// </summary>
public sealed class OdDialogs(IContentDialogService service)
{
private bool _hostReady;
private int _open;
/// <summary>Raised when the first dialog opens and when the last one closes.</summary>
public event EventHandler? OpenChanged;
/// <summary>Whether a dialog is showing.</summary>
public bool IsOpen => _open > 0;
/// <summary>Whether a dialog can show now: the main window is visible and no other dialog is open.</summary>
public bool CanShow => _hostReady && !IsOpen && Application.Current?.MainWindow is { IsVisible: true };
/// <summary>Called once by the main window with its dialog host.</summary>
public void SetHost(ContentDialogHost host)
{
ArgumentNullException.ThrowIfNull(host);
service.SetDialogHost(host);
_hostReady = true;
}
/// <summary>Asks before something that cannot be undone; false when declined, or when no dialog can show.</summary>
public async Task<bool> ConfirmAsync(string title, string message, string confirm)
{
if (!CanShow)
{
return false;
}
var result = await ShowAsync(new ContentDialog
{
Title = title,
Content = message,
PrimaryButtonText = confirm,
CloseButtonText = OdLocalization.Get("Dialog_Cancel"),
DefaultButton = ContentDialogButton.Close,
});
return result == ContentDialogResult.Primary;
}
public async Task<ContentDialogResult> ShowAsync(ContentDialog dialog)
{
ArgumentNullException.ThrowIfNull(dialog);
if (++_open == 1)
{
OpenChanged?.Invoke(this, EventArgs.Empty);
}
try
{
return await service.ShowAsync(dialog, CancellationToken.None);
}
finally
{
if (--_open == 0)
{
OpenChanged?.Invoke(this, EventArgs.Empty);
}
}
}
}
+27
View File
@@ -0,0 +1,27 @@
using System.Diagnostics;
namespace OmniDeck.App.Shell;
/// <summary>Opens links and folders the user asked for, with the default browser or File Explorer.</summary>
internal static class OdExternal
{
public static void Open(Uri uri)
{
ArgumentNullException.ThrowIfNull(uri);
Start(uri.AbsoluteUri);
}
public static void OpenFolder(string path) => Start(path);
/// <summary>Opens File Explorer on the folder holding <paramref name="path"/>, with the file selected.</summary>
public static void ShowFile(string path)
{
var explorer = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "explorer.exe");
using var process = Process.Start(new ProcessStartInfo(explorer) { ArgumentList = { "/select," + path } });
}
private static void Start(string target)
{
using var process = Process.Start(new ProcessStartInfo(target) { UseShellExecute = true });
}
}
+120
View File
@@ -0,0 +1,120 @@
<UserControl x:Class="OmniDeck.App.Shell.OdLibraryPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:res="clr-namespace:OmniDeck.Core.Localization;assembly=OmniDeck.Core"
xmlns:shell="clr-namespace:OmniDeck.App.Shell"
xmlns:theme="clr-namespace:OmniDeck.App.Theming"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
FontSize="{DynamicResource Od.Font.Base}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}">
<!-- The navigation view's frame does not pass the window's text color and size down: pages set their own. -->
<UserControl.Resources>
<shell:OdSymbolConverter x:Key="Symbol" />
</UserControl.Resources>
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="{DynamicResource Od.Padding.Card}">
<TextBlock AutomationProperties.HeadingLevel="Level1"
FontSize="{DynamicResource Od.Font.H1}"
FontWeight="SemiBold"
Text="{res:OdLoc Shell_LibraryTitle}" />
<TextBlock Margin="{DynamicResource Od.Margin.Item}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{res:OdLoc Shell_LibraryIntro}"
TextWrapping="Wrap" />
<TextBlock Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{res:OdLoc Shell_LibraryEmpty}">
<TextBlock.Style>
<Style BasedOn="{StaticResource {x:Type TextBlock}}" TargetType="TextBlock">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding HasModules}" Value="False">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<ItemsControl Focusable="False" ItemsSource="{Binding Library}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type shell:OdModuleItemViewModel}">
<ui:Card Width="{DynamicResource Od.Width.Tile}"
Margin="{DynamicResource Od.Margin.Tile}"
VerticalAlignment="Stretch"
theme:OdMotion.HoverScale="True">
<DockPanel LastChildFill="False">
<DockPanel DockPanel.Dock="Top">
<ui:SymbolIcon Margin="{DynamicResource Od.Padding.Control}"
VerticalAlignment="Center"
DockPanel.Dock="Left"
FontSize="{DynamicResource Od.Font.H1}"
Symbol="{Binding Info.Icon, Converter={StaticResource Symbol}}" />
<StackPanel VerticalAlignment="Center">
<TextBlock FontSize="{DynamicResource Od.Font.H2}"
FontWeight="SemiBold"
Text="{Binding Title}"
TextTrimming="CharacterEllipsis" />
<TextBlock FontSize="{DynamicResource Od.Font.Caption}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{Binding Category}"
TextTrimming="CharacterEllipsis" />
</StackPanel>
</DockPanel>
<!-- Wraps rather than clips once large text makes the buttons wider than the tile. -->
<WrapPanel Margin="{DynamicResource Od.Padding.Control}" DockPanel.Dock="Bottom">
<ui:Button Appearance="Primary"
AutomationProperties.Name="{res:OdLocRow Shell_Open,
Path=Title}"
Command="{Binding DataContext.OpenCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Content="{res:OdLoc Shell_Open}" />
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
Appearance="Transparent"
AutomationProperties.Name="{res:OdLocRow Shell_PopOut,
Path=Title}"
Command="{Binding DataContext.PopOutCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
ToolTip="{res:OdLoc Shell_PopOut}">
<ui:SymbolIcon Symbol="WindowNew24" />
</ui:Button>
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
Appearance="Transparent"
Command="{Binding DataContext.TogglePinCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}">
<ui:Button.Style>
<Style BasedOn="{StaticResource {x:Type ui:Button}}" TargetType="ui:Button">
<Setter Property="ToolTip" Value="{res:OdLoc Shell_Pin}" />
<Setter Property="AutomationProperties.Name" Value="{res:OdLocRow Shell_Pin, Path=Title}" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsPinned}" Value="True">
<Setter Property="ToolTip" Value="{res:OdLoc Shell_Unpin}" />
<Setter Property="AutomationProperties.Name" Value="{res:OdLocRow Shell_Unpin, Path=Title}" />
</DataTrigger>
</Style.Triggers>
</Style>
</ui:Button.Style>
<ui:SymbolIcon>
<ui:SymbolIcon.Style>
<Style TargetType="ui:SymbolIcon">
<Setter Property="Symbol" Value="Pin24" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsPinned}" Value="True">
<Setter Property="Symbol" Value="PinOff24" />
</DataTrigger>
</Style.Triggers>
</Style>
</ui:SymbolIcon.Style>
</ui:SymbolIcon>
</ui:Button>
</WrapPanel>
</DockPanel>
</ui:Card>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -0,0 +1,10 @@
namespace OmniDeck.App.Shell;
/// <summary>The "+" page: every module, with Open and pin buttons. Bound to <see cref="OdShellViewModel"/>.</summary>
public partial class OdLibraryPage
{
public OdLibraryPage()
{
InitializeComponent();
}
}
+128
View File
@@ -0,0 +1,128 @@
<UserControl x:Class="OmniDeck.App.Shell.OdMemoryPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:res="clr-namespace:OmniDeck.Core.Localization;assembly=OmniDeck.Core"
xmlns:shell="clr-namespace:OmniDeck.App.Shell"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
FontSize="{DynamicResource Od.Font.Base}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}">
<!-- The navigation view's frame does not pass the window's text color and size down: pages set their own. -->
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="Visible" />
<shell:OdSymbolConverter x:Key="Symbol" />
</UserControl.Resources>
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="{DynamicResource Od.Padding.Card}">
<TextBlock AutomationProperties.HeadingLevel="Level2"
FontSize="{DynamicResource Od.Font.H1}"
FontWeight="SemiBold"
Text="{res:OdLoc Memory_Title}" />
<TextBlock Margin="{DynamicResource Od.Margin.Item}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{res:OdLoc Memory_Intro}"
TextWrapping="Wrap" />
<ui:Card Margin="{DynamicResource Od.Margin.Item}">
<StackPanel>
<TextBlock FontSize="{DynamicResource Od.Font.H2}"
FontWeight="SemiBold"
Text="{Binding InUseText}" />
<TextBlock Foreground="{DynamicResource TextFillColorSecondaryBrush}" Text="{Binding LimitsText}" />
<TextBlock FontSize="{DynamicResource Od.Font.Caption}"
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
Text="{res:OdLoc Memory_SharedNote}"
TextWrapping="Wrap" />
</StackPanel>
</ui:Card>
<ItemsControl Focusable="False"
Grid.IsSharedSizeScope="True"
ItemsSource="{Binding Rows}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type shell:OdMemoryRowViewModel}">
<ui:Card Margin="{DynamicResource Od.Margin.Item}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" SharedSizeGroup="Keep" />
<ColumnDefinition Width="Auto" SharedSizeGroup="Actions" />
</Grid.ColumnDefinitions>
<DockPanel Grid.Column="0" VerticalAlignment="Center">
<ui:SymbolIcon Margin="{DynamicResource Od.Padding.Control}"
DockPanel.Dock="Left"
FontSize="{DynamicResource Od.Font.H2}"
Symbol="{Binding Info.Icon, Converter={StaticResource Symbol}}" />
<StackPanel VerticalAlignment="Center">
<TextBlock FontWeight="SemiBold"
Text="{Binding Title}"
TextTrimming="CharacterEllipsis" />
<WrapPanel>
<TextBlock Margin="{DynamicResource Od.Margin.Inline}" Text="{Binding StateText}" />
<TextBlock Margin="{DynamicResource Od.Margin.Inline}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{Binding LastUsedText}" />
<TextBlock Foreground="{DynamicResource TextFillColorSecondaryBrush}" Text="{Binding MemoryText}" />
</WrapPanel>
</StackPanel>
</DockPanel>
<ui:ToggleSwitch Grid.Column="1"
Margin="{DynamicResource Od.Padding.Control}"
VerticalAlignment="Center"
AutomationProperties.Name="{res:OdLocRow Memory_KeepRunning,
Path=Title}"
Command="{Binding DataContext.ToggleKeepRunningCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Content="{res:OdLoc Memory_KeepRunning}"
IsChecked="{Binding KeepRunning, Mode=OneWay}" />
<StackPanel Grid.Column="2"
VerticalAlignment="Center"
Orientation="Horizontal">
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
AutomationProperties.Name="{res:OdLocRow Memory_Suspend,
Path=Title}"
Command="{Binding DataContext.SuspendCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Content="{res:OdLoc Memory_Suspend}"
IsEnabled="{Binding CanSuspend}" />
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
AutomationProperties.Name="{res:OdLocRow Memory_Hibernate,
Path=Title}"
Command="{Binding DataContext.HibernateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Content="{res:OdLoc Memory_Hibernate}"
IsEnabled="{Binding CanHibernate}" />
<ui:Button Margin="{DynamicResource Od.Padding.Control}"
AutomationProperties.Name="{res:OdLocRow Shell_Close,
Path=Title}"
Command="{Binding DataContext.CloseCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Content="{res:OdLoc Shell_Close}"
IsEnabled="{Binding CanClose}" />
</StackPanel>
</Grid>
</ui:Card>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ui:Card Margin="{DynamicResource Od.Margin.Item}" Visibility="{Binding HasShared, Converter={StaticResource Visible}}">
<DockPanel>
<TextBlock Margin="{DynamicResource Od.Padding.Control}"
VerticalAlignment="Center"
DockPanel.Dock="Right"
FontWeight="SemiBold"
Text="{Binding SharedText}" />
<ui:SymbolIcon Margin="{DynamicResource Od.Padding.Control}"
DockPanel.Dock="Left"
FontSize="{DynamicResource Od.Font.H2}"
Symbol="Globe24" />
<StackPanel VerticalAlignment="Center">
<TextBlock AutomationProperties.HeadingLevel="Level3"
FontWeight="SemiBold"
Text="{res:OdLoc Memory_SharedTitle}" />
<TextBlock Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{res:OdLoc Memory_SharedDescription}"
TextWrapping="Wrap" />
</StackPanel>
</DockPanel>
</ui:Card>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -0,0 +1,13 @@
namespace OmniDeck.App.Shell;
/// <summary>
/// The task-manager panel, bound to <see cref="OdMemoryViewModel"/>, shown in Settings → Memory
/// (docs/RAM-GOVERNOR.md §5).
/// </summary>
public partial class OdMemoryPage
{
public OdMemoryPage()
{
InitializeComponent();
}
}
@@ -0,0 +1,65 @@
using CommunityToolkit.Mvvm.ComponentModel;
using OmniDeck.Core.Governor;
using OmniDeck.Core.Localization;
using OmniDeck.Core.Modules;
namespace OmniDeck.App.Shell;
/// <summary>One module in the task-manager panel (docs/RAM-GOVERNOR.md §5).</summary>
public sealed partial class OdMemoryRowViewModel(OdHostedModule hosted) : ObservableObject
{
[ObservableProperty]
private string _stateText = "";
[ObservableProperty]
private string _lastUsedText = "";
[ObservableProperty]
private string _memoryText = "";
[ObservableProperty]
private bool _keepRunning;
[ObservableProperty]
private bool _canSuspend;
[ObservableProperty]
private bool _canHibernate;
[ObservableProperty]
private bool _canClose;
public OdModuleInfo Info => hosted.Info;
public string Id => hosted.Info.Id;
public string Title => hosted.Info.Title;
/// <summary>
/// Re-reads the module's state; <paramref name="now"/> dates the last-used text, and
/// <paramref name="bytes"/> is the module's own memory, for one that runs processes of its own.
/// </summary>
public void Refresh(DateTimeOffset now, bool keepRunning, long? bytes = null)
{
var state = hosted.State;
StateText = OdLocalization.Get("State_" + state);
LastUsedText = LastUsed(state, now - hosted.LastActive);
MemoryText = bytes is { } own ? OdBytes.Format(own) : "";
KeepRunning = keepRunning;
CanSuspend = state == OdModuleState.Idle;
CanHibernate = state is OdModuleState.Idle or OdModuleState.Suspended;
CanClose = state is not (OdModuleState.Created or OdModuleState.Closed);
OnPropertyChanged(nameof(Title));
}
public override string ToString() => Title;
private static string LastUsed(OdModuleState state, TimeSpan hiddenFor) => state switch
{
OdModuleState.Created => "",
OdModuleState.Active => OdLocalization.Get("Memory_UsedNow"),
_ when hiddenFor < TimeSpan.FromMinutes(1) => OdLocalization.Get("Memory_UsedJustNow"),
_ when hiddenFor < TimeSpan.FromHours(1) => OdLocalization.Format("Memory_UsedMinutesAgo", (int)hiddenFor.TotalMinutes),
_ => OdLocalization.Format("Memory_UsedHoursAgo", (int)hiddenFor.TotalHours),
};
}
@@ -0,0 +1,99 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using OmniDeck.Core.Governor;
using OmniDeck.Core.Localization;
using OmniDeck.Core.Modules;
using OmniDeck.Core.Settings;
namespace OmniDeck.App.Shell;
/// <summary>
/// The task-manager panel (docs/RAM-GOVERNOR.md §5): every module with its state and last use, the
/// memory OmniDeck uses against its limits, and the governor's own Suspend, Hibernate, Close and
/// keep-running controls. It acts through the governor, never around it. Used from the UI thread.
/// </summary>
public sealed partial class OdMemoryViewModel : ObservableObject, IDisposable
{
private readonly OdModuleHost _host;
private readonly OdRamGovernor _governor;
private readonly IOdSettingsService _settings;
private readonly TimeProvider _time;
[ObservableProperty]
private string _inUseText = "";
[ObservableProperty]
private string _limitsText = "";
[ObservableProperty]
private string _sharedText = "";
[ObservableProperty]
private bool _hasShared;
public OdMemoryViewModel(OdModuleHost host, OdRamGovernor governor, IOdSettingsService settings, TimeProvider time)
{
ArgumentNullException.ThrowIfNull(host);
ArgumentNullException.ThrowIfNull(governor);
ArgumentNullException.ThrowIfNull(settings);
_host = host;
_governor = governor;
_settings = settings;
_time = time;
Rows = [.. host.Modules.Select(hosted => new OdMemoryRowViewModel(hosted))];
host.StateChanged += OnModuleStateChanged;
governor.Sampled += OnSampled;
settings.Changed += OnSettingsChanged;
OdLocalization.Instance.CultureChanged += OnCultureChanged;
Refresh();
}
public IReadOnlyList<OdMemoryRowViewModel> Rows { get; }
public bool HasModules => Rows.Count > 0;
public void Refresh()
{
var now = _time.GetUtcNow();
var snapshot = _governor.Snapshot;
foreach (var row in Rows)
{
row.Refresh(now, _governor.IsKeptRunning(row.Id), snapshot?.For(row.Id));
}
HasShared = snapshot is { SharedBytes: > 0 };
SharedText = snapshot is { SharedBytes: > 0 and var shared } ? OdBytes.Format(shared) : "";
var options = _governor.Options;
InUseText = OdLocalization.Format("Memory_InUse", OdBytes.Format(_governor.CommittedBytes));
LimitsText = OdLocalization.Format("Memory_Limits", OdBytes.Format(options.SoftCapBytes), OdBytes.Format(options.HardCapBytes));
}
public void Dispose()
{
_host.StateChanged -= OnModuleStateChanged;
_governor.Sampled -= OnSampled;
_settings.Changed -= OnSettingsChanged;
OdLocalization.Instance.CultureChanged -= OnCultureChanged;
}
[RelayCommand]
private Task SuspendAsync(OdMemoryRowViewModel row) => _governor.SuspendAsync(row.Id);
[RelayCommand]
private Task HibernateAsync(OdMemoryRowViewModel row) => _governor.HibernateAsync(row.Id);
[RelayCommand]
private Task CloseAsync(OdMemoryRowViewModel row) => _governor.CloseAsync(row.Id);
[RelayCommand]
private void ToggleKeepRunning(OdMemoryRowViewModel row) => _governor.SetKeptRunning(row.Id, !_governor.IsKeptRunning(row.Id));
private void OnModuleStateChanged(object? sender, OdModuleStateChangedEventArgs e) => Refresh();
private void OnSampled(object? sender, OdGovernorSampledEventArgs e) => Refresh();
private void OnSettingsChanged(object? sender, OdSettingsChangedEventArgs e) => Refresh();
private void OnCultureChanged(object? sender, EventArgs e) => Refresh();
}
@@ -0,0 +1,41 @@
using CommunityToolkit.Mvvm.ComponentModel;
using OmniDeck.Core.Localization;
using OmniDeck.Core.Modules;
namespace OmniDeck.App.Shell;
/// <summary>A module as the sidebar, the library and the palette show it.</summary>
public sealed partial class OdModuleItemViewModel(OdModuleInfo info) : ObservableObject
{
[ObservableProperty]
private bool _isPinned;
/// <summary>Shown in a window of its own rather than in the main window.</summary>
[ObservableProperty]
private bool _isPoppedOut;
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsOpen))]
private OdModuleState _state = OdModuleState.Created;
public OdModuleInfo Info { get; } = info;
public string Id => Info.Id;
public string Title => Info.Title;
public string Category => OdLocalization.Get(Info.CategoryKey);
/// <summary>Opened and not closed since: it keeps a sidebar entry even when unpinned, like a tab.</summary>
public bool IsOpen => State is not (OdModuleState.Created or OdModuleState.Closed);
/// <summary>The name screen readers announce for the module's library tile and palette row.</summary>
public override string ToString() => Title;
/// <summary>Re-reads the localized texts after a language change.</summary>
public void RefreshTexts()
{
OnPropertyChanged(nameof(Title));
OnPropertyChanged(nameof(Category));
}
}
@@ -0,0 +1,9 @@
<ContentControl x:Class="OmniDeck.App.Shell.OdModuleStage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
Content="{Binding CurrentView}"
Focusable="False"
FontSize="{DynamicResource Od.Font.Base}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
@@ -0,0 +1,13 @@
namespace OmniDeck.App.Shell;
/// <summary>
/// The one page every module item navigates to: it shows <see cref="OdShellViewModel.CurrentView"/>,
/// so the navigation view never creates, caches or keeps a module view (docs/WPFUI-CONVENTIONS.md §5).
/// </summary>
public partial class OdModuleStage
{
public OdModuleStage()
{
InitializeComponent();
}
}
Loaded 100 of 477 files, more files were not shown because too many files have changed in this diff. Show more