Files
phranck 5ad97132b8 Feat: Add @Observable support with Observation framework
- Replace custom Observable protocol and @Published with Apple's @Observable macro
- Add withObservationTracking in renderToBuffer for automatic per-property dependency tracking
- Add type-based @Environment(Type.self) and .environment(object) for observable objects
- Add ObjectEnvironmentModifier for injecting observable objects into the environment
- Add needsCacheClear flag to AppState for thread-safe cache invalidation
- Add cross-platform test script (scripts/test-linux.sh) for Docker-based Linux verification
- Add DemoAppHeader with system info display (OS, version, architecture)
- Consolidate Example App: extract ImageDemoHelpers, KeyboardHelpSection, ValueDisplayRow
- Add pre-push verification rule to CLAUDE.md
- Verified on both macOS and Linux (swift:6.0 container), 1155 tests passing
2026-02-15 23:49:34 +01:00

40 lines
898 B
Swift
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 🖥 TUIKit Terminal UI Kit for Swift
// KeyboardHelpSection.swift
//
// Created by LAYERED.work
// License: MIT
import TUIkit
/// A DemoSection showing keyboard shortcut help lines.
///
/// Each string in the array is rendered as a dimmed text line.
///
/// # Example
///
/// ```swift
/// KeyboardHelpSection([
/// "[Tab] Move focus",
/// "[Enter] Confirm",
/// ])
/// ```
struct KeyboardHelpSection: View {
let title: String
let shortcuts: [String]
init(_ title: String = "Keyboard Controls", shortcuts: [String]) {
self.title = title
self.shortcuts = shortcuts
}
var body: some View {
DemoSection(title) {
VStack(alignment: .leading) {
ForEach(Array(shortcuts.enumerated()), id: \.offset) { _, shortcut in
Text(shortcut).dim()
}
}
}
}
}