Skip to content

Split DiffEngineTray into a portable core and a Windows head - #984

Merged
SimonCropp merged 1 commit into
mainfrom
tray-core
Oct 28, 2026
Merged

SimonCropp merged 1 commit into
mainfrom
tray-core

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

This is the first step to a DiffEngineTray on macOS and Linux (phase 2a of the plan): the tray splits into a portable core and a Windows head. Nothing on Windows changes.

DiffEngineTray.Core (net10.0, no WinForms, built on every platform) is everything that isn't WinForms:

  • Tracker, OwnedInlineHost, RemoteInlineHost and PiperServer.
  • The settings, DebugReport, IssueLauncher, Logging and the payloads.
  • The Windows API helpers ProcessEx and FileLockKiller. They compile anywhere and run only on Windows until they get Unix paths, which is a later phase.

The 35 files moved with git mv, so their history follows.

DiffEngineTray stays the Windows head: Program, the menu, the forms, the hot keys (KeyRegister, and KeyName, which parses into WinForms' Keys), the icons and the Run key.

Two things crossed the line, and each now goes through a seam:

  • AlwaysKill was a static beside the locked-file form. It is now LockedFilesPolicy in the core, and the form stays in the head.
  • IssueLauncher asked through a MessageBox. In the core it declines, since it has no toolkit to ask with, and the head hands it IssueQuestion's box first thing in Main.

Tests:

  • All 369 tray tests pass.
  • ProgramEntryPointTest found the tray's entry point through Tracker, which is now the core's: a library with no entry point. It now asks the head's own assembly.
  • The tray package gains DiffEngineTray.Core.dll and nothing else.

Still to come in phase 2: the core's tests move to a project that runs on every platform (2b), and the menu becomes a model snapshot tested as text (2c).

The first step to a tray on macOS and Linux. DiffEngineTray.Core is everything that is not
WinForms: Tracker, both inline hosts, PiperServer, the settings, DebugReport, IssueLauncher and
Logging, with the Windows API helpers ProcessEx and FileLockKiller, which compile anywhere and run
only on Windows until they have Unix paths. It builds on every platform. DiffEngineTray keeps
Program, the menu, the forms, the hot keys, the icons and the Run key, and nothing on Windows
changes.

Two things crossed between the halves and now go through a seam. AlwaysKill was a static beside the
locked file form, and is LockedFilesPolicy's in the core. IssueLauncher asked through a MessageBox;
in the core it declines, having no toolkit to ask with, and the head hands it IssueQuestion's box
first thing in Main.

ProgramEntryPointTest found the tray's entry point through Tracker, which is the core's now, a
library with none, so it asks the head's own assembly. The tray package gains
DiffEngineTray.Core.dll and nothing else.
@SimonCropp
SimonCropp merged commit 01b0e8d into main Oct 28, 2026
12 checks passed
@SimonCropp
SimonCropp deleted the tray-core branch October 28, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant