import Foundation /// Renders the static error page the dashboard window shows when the Control /// UI cannot load. Presentation-only; kept out of `DashboardWindowController` /// so the controller stays focused on window/navigation behavior. enum DashboardFailurePage { static func html(title: String, message: String, detail: String?, url: URL?) -> String { let detailHTML = detail.map { "

\(self.htmlEscape($0))

" } ?? "" let urlHTML = url.map { "\(self.htmlEscape($0.absoluteString))" } ?? "" return """
!

\(self.htmlEscape(title))

\(self.htmlEscape(message))

\(detailHTML) \(urlHTML)
""" } private static func htmlEscape(_ value: String) -> String { value .replacingOccurrences(of: "&", with: "&") .replacingOccurrences(of: "<", with: "<") .replacingOccurrences(of: ">", with: ">") .replacingOccurrences(of: "\"", with: """) .replacingOccurrences(of: "'", with: "'") } }