apps/train with halkyon_train_server, _client and _flutter, as Todo's: halkyon_base configured by trainBase(), its own register alone and a member of the instance's where the operator names one, the app on halkyon_app's gates with Train's frame, account sheet and About, texts in British English and German that speak of workouts, app.halkyon.train on Android, iOS, Linux, macOS and Windows. Where it differs from Todo: development ports of its own (8180 to 8190), so it runs beside Learn's server; one initial migration with the schema Todo's migrations end at (the same tables, compared line by line), not Todo's seventeen; and Todo's icon as a placeholder until the icon tool of ADR 0031 draws Train's bike. The workspace, the licences, the READMEs and AGENTS.md name it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
49 lines
1.5 KiB
Swift
49 lines
1.5 KiB
Swift
import Cocoa
|
|
import FlutterMacOS
|
|
|
|
class MainFlutterWindow: NSWindow {
|
|
/// The channel halkyon_app's SecretScreen asks to keep the window out of
|
|
/// screenshots and screen recordings while something secret shows (the
|
|
/// recovery phrase, recovery codes, an authenticator's key), and how many
|
|
/// show: counted, as several may at once.
|
|
private var screenGuard: FlutterMethodChannel?
|
|
private var secretsShown = 0
|
|
|
|
override func awakeFromNib() {
|
|
let flutterViewController = FlutterViewController()
|
|
let windowFrame = self.frame
|
|
self.contentViewController = flutterViewController
|
|
self.setFrame(windowFrame, display: true)
|
|
|
|
RegisterGeneratedPlugins(registry: flutterViewController)
|
|
guardScreen(messenger: flutterViewController.engine.binaryMessenger)
|
|
|
|
super.awakeFromNib()
|
|
}
|
|
|
|
private func guardScreen(messenger: FlutterBinaryMessenger) {
|
|
let channel = FlutterMethodChannel(
|
|
name: "app.halkyon/screen_guard", binaryMessenger: messenger)
|
|
channel.setMethodCallHandler { [weak self] call, result in
|
|
guard let self = self else {
|
|
result(nil)
|
|
return
|
|
}
|
|
switch call.method {
|
|
case "hold":
|
|
self.secretsShown += 1
|
|
self.sharingType = .none
|
|
result(nil)
|
|
case "release":
|
|
self.secretsShown = max(0, self.secretsShown - 1)
|
|
if self.secretsShown == 0 {
|
|
self.sharingType = .readOnly
|
|
}
|
|
result(nil)
|
|
default:
|
|
result(FlutterMethodNotImplemented)
|
|
}
|
|
}
|
|
screenGuard = channel
|
|
}
|
|
}
|