         window?.tab.toolTip = tabToolTip
     }
 }
+
+private extension MainWindowController.TitleAttribute {
+    static var initial: MainWindowController.TitleAttribute {
+        .init(title: "", community: "", isConnected: false, detectedKusa: false)
+    }
+
+    func copyWith(isConnected: Bool? = nil, detectedKusa: Bool? = nil) -> MainWindowController.TitleAttribute {
+        return MainWindowController.TitleAttribute(
+            title: title,
+            community: community,
+            isConnected: isConnected ?? self.isConnected,
+            detectedKusa: detectedKusa ?? self.detectedKusa
+        )
+    }
+}


extension MainWindowController: MainViewControllerDelegate {
    func mainViewControllerDidPrepareLive(_ mainViewController: MainViewController, title: String, community: String) {
        setLiveTitle(title: title, community: community, isConnected: true, isKusa: false)
    }

    func mainViewControllerDidDisconnect(_ mainViewController: MainViewController, title: String, community: String) {
        invalidateKusaTimer()
        setLiveTitle(title: title, community: community, isConnected: false, isKusa: false)
    }

    func mainViewControllerSpeechEnabledChanged(_ mainViewController: MainViewController, isEnabled: Bool) {


    func mainViewControllerDidDetectKusa(_ mainViewController: MainViewController, title: String, community: String) {
        invalidateKusaTimer()
        titleAttribute = titleAttribute.copyWith(detectedKusa: true)
        updateLiveTitle(titleAttribute)
        kusaTimer = Timer.scheduledTimer(
            withTimeInterval: 10,
            repeats: false,
            block: { [weak self] _ in
                guard let me = self else { return }
                me.titleAttribute = me.titleAttribute.copyWith(detectedKusa: false)
                me.updateLiveTitle(me.titleAttribute)
            })
    }

    private func updateLiveTitle(_ titleAttribute: TitleAttribute) {
        let _title = "\(titleAttribute.title) - \(titleAttribute.community)"
        let _tabTitle = [
            titleAttribute.isConnected ? "⚡️" : nil,
            titleAttribute.detectedKusa ? "☘️" : nil,
            titleAttribute.title
        ].compactMap({ $0 }).joined(separator: " ")
        setWindowTitle(_title, tabTitle: _tabTitle, tabToolTip: _title)
    }
