Commit Graph
119 Commits
Author SHA1 Message Date
phranck 106eb5b1cd Feat: UNIX System V boot sequence, Joshua easter egg, CRT effects and theme fixes
- Replace Swift/TUIKit boot content with authentic System V Release 3.2 boot sequence
- Rewrite all ~53 terminal interactions as classic UNIX commands
- Add complete WarGames/Joshua easter egg with film-accurate screenplay dialog
- Add CRT power-on sound (degauss thump, mains hum, flyback whine)
- Add scanline sweep animation and random scanline glitch effect
- Restructure CRT layers: black backing, terminal content, inner glow, frame mask
- Update logo to frame-only PNG with transparent center
- Fix theme hydration flash (null initial state, localStorage-first reading)
- Add cursor-pointer and null-safe active indicator to ThemeSwitcher
2026-02-01 01:26:40 +01:00
phranck 3e959d8026 Refactor: Split Palette into Palette (13) + BlockPalette (3) protocol hierarchy
- Reduce Palette protocol from 18 to 13 essential properties
- Add BlockPalette protocol with surfaceBackground, surfaceHeaderBackground, elevatedBackground
- BlockPalette defaults compute via lighter(by:) from background
- Add Color.rgbComponents for universal ANSI/256/RGB conversion
- Make lighter(by:), darker(by:), opacity() work on all color types
- Migrate views to use BlockPalette accessors
- Remove NCursesPalette (to be reworked later)
- Update all 6 palette structs to BlockPalette conformance
- Update DocC articles, topic index, and palette-preview.html
- All 492 tests in 83 suites passing
2026-01-31 21:35:17 +01:00
phranck e1f702c921 Refactor: Remove derived Palette properties, views use essentials directly
Remove borderFocused, separator, selection, selectionBackground, disabled,
statusBarForeground, statusBarHighlight from Palette protocol and all
consumers. Views now use palette essentials directly (e.g. palette.accent
instead of palette.borderFocused, palette.foregroundTertiary instead of
palette.disabled). Update tests and DocC articles accordingly.
2026-01-31 20:19:09 +01:00
phranck e835c0f57f Refactor: Reduce Palette to essentials, add foregroundPlaceholder
Remove explicit borderFocused, selection, selectionBackground,
statusBarForeground, statusBarHighlight from all palette implementations.
These remain as default-derived properties on the protocol extension.

Add foregroundPlaceholder as 4th foreground level for input field
placeholder text, dimmer than foregroundTertiary.

Fix SwiftLint force_try violations in luminance tests.
2026-01-31 20:10:05 +01:00
phranck 142221627d Refactor: Restructure Palette background properties for semantic clarity
Replace generic backgroundSecondary/backgroundTertiary with purpose-specific
background properties (containerBodyBackground, containerCapBackground,
buttonBackground, appHeaderBackground, overlayBackground).

- Update Palette protocol and all 7 palette implementations
- Update SemanticColor, Color.Semantic namespace, and view consumers
- Rewrite background hierarchy tests with luminance assertions
- Update DocC articles (PaletteReference, ThemingGuide, AppearanceAndColors)
- Sync landing page CSS variables and components to new naming
- Update palette-preview.html with new property names
- Replace landing page logo with tuikit-logo-blank.png
2026-01-31 19:44:46 +01:00
phranck 2c4e6cc8dc Feat: Add Blue/Violet palettes, sync landing page colors with Swift, fix theme switcher FOUC
- Add BluePalette (VFD-style, #00AAFF base) and VioletPalette (HSL-generated from hue 270°)
- Remove GeneratedPalette entirely (replaced by dedicated VioletPalette)
- Reorder palette cycling: Green → Amber → Red → Violet → Blue → White → NCurses
- Sync all landing page CSS theme colors with exact Swift palette values
- Add blue theme to landing page with matching VFD colors
- Fix theme switcher FOUC: useEffect syncs React state after hydrate
- Update default theme to Green (was Amber)
- Update landing page logo to latest DocC version
2026-01-31 19:01:48 +01:00
phranck 10f8419d9e Chore: Update DocC logo to latest version 2026-01-31 16:48:28 +01:00
phranck 2d213cd0b1 Docs: Add Palette Reference guide with visual color tables
New DocC article documenting all 7 built-in palettes with exact color values:
- Green (P1 phosphor, default palette)
- Amber (P3 phosphor)
- White (P4 phosphor)
- Red (military/night-vision)
- ncurses (classic 16-color ANSI)
- Violet (GeneratedPalette, hue 270°)
- GeneratedPalette algorithm explained (HSL derivation, hue offsets)
- Color token categories (24 tokens across 6 categories)
- Palette cycling order
- Color resolution flow from semantic token to ANSI output
2026-01-31 14:46:18 +01:00
phranck b35fc0aa60 Docs: Add Keyboard Shortcuts reference guide
New DocC article covering the complete keyboard input system:
- 3-layer event dispatch (StatusBar → View handlers → Default bindings)
- Key enum reference (special keys, arrows, navigation)
- KeyEvent modifiers (Ctrl, Alt, Shift)
- onKeyPress API (all 3 overloads, handler priority)
- Focus navigation (Tab/Shift+Tab)
- Default bindings (q/t/a) and QuitBehavior
- Shortcut display symbols table
- StatusBar context stack for modal overrides
- System items configuration
2026-01-31 14:38:42 +01:00
phranck 68fcf47637 Refactor: Restrict access levels to minimize public API surface
Systematically audit and restrict public declarations across the entire
framework. Internal plumbing (rendering, registries, framework services)
is now internal/private while the user-facing API remains public.

Categories changed:
- Rendering infrastructure (Renderable, ANSIRenderer, BorderRenderer,
  Terminal, ViewRenderer) → internal
- Framework services (PreferenceStorage, LifecycleManager, TUIContext,
  KeyEventDispatcher) → internal
- Implementation modifier types (OnAppearModifier, OnDisappearModifier,
  TaskModifier, StatusBarItemsModifier, etc.) → internal
- View properties (Text.content, Button.label, Menu.items, etc.) → internal
- Registries (PaletteRegistry, AppearanceRegistry) → internal
- Styling internals (ANSIColor, SemanticColor, GeneratedPalette.Hue,
  BorderStyle block-styles) → internal
- ContainerView/ContainerConfig/ContainerStyle → fully internal
- ThemeManager.items/init → internal
- ViewBuilder glue types properties/inits → internal

Also includes:
- Doc warnings (/// - Important:) on types public only for technical reasons
- DocC landing page and CustomViews article updated for internal types
- All DocC symbol links to internal types converted to code text (0 warnings)
- README test badge updated to 498
- Example app ContainerView usage replaced with Panel

498 tests passing, 0 DocC warnings.
2026-01-31 14:29:39 +01:00
phranck 6d9930b8cf Docs: Fix all DocC warnings — replace internal symbol links with code text, fix duplicate param 2026-01-31 13:47:17 +01:00
phranck f89ff20530 Docs: Add 5 new DocC guide articles and expand landing page topic index 2026-01-31 13:15:31 +01:00
phranck 8dffb81802 Docs: Clarify Box vs Card vs Panel differences in doc comments
- Added comparison table (border, padding, background, title, footer, rendering) to all three
- Documented typical use cases for each container type
- Box: minimal border wrapper, no padding/background/title
- Card: padded container with optional title, footer, and background
- Panel: always-titled container, less padding, no background
2026-01-31 11:45:54 +01:00
phranck bae15660c8 Docs: Replace ASCII diagrams with Mermaid-rendered PNGs
- Split dependency graph into two LR diagrams (Ownership + Runtime References)
- Replace ASCII event loop in Architecture article with Mermaid diagram
- All diagrams with Light/Dark variants, transparent background, rounded nodes
- Remove old lifecycle-dependency-graph PNGs (replaced by dep-graph-ownership + dep-graph-references)
2026-01-31 11:37:28 +01:00
phranck 13f5d74549 Docs: Add Render Cycle DocC article
- 8-step render pipeline with Mermaid-rendered diagram (Light/Dark)
- Dual rendering system (Renderable vs body) with dispatch diagram
- FrameBuffer creation, combination, and terminal output
- Environment flow, preference collection, and lifecycle tracking
- ViewModifier pipeline (buffer modifiers vs view-level modifiers)
2026-01-31 02:45:28 +01:00
phranck 3b58eb0a24 Docs: Re-render lifecycle diagrams with transparent background, rounded nodes, and high-contrast edges 2026-01-31 02:28:02 +01:00
phranck 1832741323 Docs: Add Light/Dark variants for all lifecycle diagrams (DocC auto-switching via ~dark suffix) 2026-01-31 02:13:15 +01:00
phranck dc1001cdc4 Docs: Replace ASCII diagrams with Mermaid-rendered PNG images (rounded rects, dark theme) 2026-01-31 02:04:19 +01:00
phranck 0872f2704c Docs: Add App Lifecycle DocC article and clean up landing page references 2026-01-31 01:54:13 +01:00
phranck 1c90349b23 Refactor: Remove deprecated @Environment property wrapper and update doc comments to context.environment 2026-01-31 01:43:39 +01:00
phranck 9f7092d4c8 Refactor: Replace EnvironmentStorage singleton with semantic colors and deprecate @Environment (Phase 6) 2026-01-31 01:13:31 +01:00
phranck 0c598bb734 Refactor: Remove EnvironmentStorage singleton reads from FocusState (Phase 5) 2026-01-31 00:58:57 +01:00
phranck 3584c75a98 Refactor: Remove EnvironmentStorage singleton writes from RenderLoop and AppRunner (Phase 4) 2026-01-31 00:58:08 +01:00
phranck c442edbf73 Refactor: Remove EnvironmentStorage.withEnvironment from EnvironmentModifier (Phase 3) 2026-01-31 00:57:24 +01:00
phranck 8a7198c121 Refactor: Remove applyToEnvironment closures from ThemeManager (Phase 2) 2026-01-31 00:56:57 +01:00
phranck 0908d83dab Refactor: Replace all Color.theme.* reads with context.environment.palette (Phase 1) 2026-01-31 00:55:50 +01:00
phranck 1ab4b697a2 Refactor: Restructure source tree with palette rename, file splits, and Renderable co-location
- Move files into Environment/, Focus/, State/, Styling/, StatusBar/ directories
- Split Theme.swift into Palette protocol + 6 individual palette files in Styling/Palettes/
- Rename Phosphor palettes: GreenPhosphorPalette → GreenPalette, etc. (types and IDs)
- Remove deprecated .greenPhosphor/.amberPhosphor/.whitePhosphor/.redPhosphor accessors
- Split StatusBar.swift (983 LOC) → StatusBar.swift + StatusBarItem.swift
- Extract ButtonRow and ButtonRowBuilder from Button.swift → ButtonRow.swift
- Dissolve ViewRenderer.swift: move Renderable conformances to each type's own file
- Move AnyView from Menu.swift to Core/PrimitiveViews.swift
- Update DocC articles, README, and all test files
- 506 tests passing, build verified
2026-01-31 00:38:01 +01:00
phranck 6ed66026dd Refactor: Eliminate EnvironmentStorage singleton
- Replace EnvironmentStorage.shared with EnvironmentStorage.active
  (settable static property)
- Make EnvironmentStorage.init() public instead of private
- Update all 12 source references across Environment.swift, App.swift,
  RenderLoop.swift, Focus.swift, Theme.swift, Appearance.swift,
  ThemeManager.swift
- Update all 17 test references across EnvironmentTests, FocusTests,
  StatusBarTests, ButtonTests

This is the last singleton in the TUIkit framework.
2026-01-30 23:11:47 +01:00
phranck 282d1662c1 Refactor: Eliminate AppState singleton
- Replace AppState.shared with AppState.active (settable static property)
- Make AppState.init() public instead of private
- Update all 15 source references across State.swift, App.swift,
  StatusBarState.swift, ThemeManager.swift, AppStorage.swift
- Update all 28 test references in AppStateTests and StatePropertyTests
- Serialize Environment Property Wrapper tests (shared-state race fix)
2026-01-30 23:08:22 +01:00
phranck 3d75a2c67e Refactor: Eliminate Terminal singleton
- Remove Terminal.shared static property
- Make Terminal.init() public instead of private
- Update default parameters in ViewRenderer and RenderContext to use Terminal()
- WindowGroup.renderScene now uses context.terminal instead of Terminal.shared
2026-01-30 23:04:42 +01:00
phranck 088df975a7 Refactor: Eliminate JSONFileStorage and StorageManager singletons
- Remove JSONFileStorage.shared static property
- Delete StorageManager class entirely (was only a singleton wrapper)
- Add StorageDefaults enum with settable backend property
- @AppStorage inits now use StorageDefaults.backend instead of
  StorageManager.shared.backend
2026-01-30 23:02:54 +01:00
phranck 9192e833a0 Fix: Add NSLock to EnvironmentStorage to prevent SEGFAULT in parallel tests 2026-01-30 22:56:25 +01:00
phranck bbd3542d10 Refactor: Remove 5 deprecated singletons (LifecycleTracker, DisappearCallbackStorage, TaskStorage, KeyEventDispatcher.shared, PreferenceStorage.shared)
Delete dead code classes that were fully replaced by LifecycleManager
in TUIContext. Remove deprecated .shared properties from
KeyEventDispatcher and PreferenceStorage (zero live call-sites).
2026-01-30 22:53:06 +01:00
phranck 242d305801 update Github banner 2026-01-30 22:37:27 +01:00
phranck 1aa6f80a90 Docs: Add card purpose for TUIkit logo in DocC landing page
- Icon for sidebar navigation, card for grid-style Links directives
2026-01-30 21:47:36 +01:00
phranck 5d04faf995 Fix: Pad logo 36px bottom to fix DocC banner clipping
- DocC banner container clips icon image from below
- Added 36px black padding at bottom to shift motif into visible area
2026-01-30 21:46:50 +01:00
phranck a001c3d47c Fix: Correct technology icon path in theme-settings.json
- Update icon path to /images/TUIkit/tuikit-logo.png (DocC output location)
- Fixes 404 for /icon.png on deployed documentation site
2026-01-30 21:34:18 +01:00
phranck bd07286076 Docs: Add TUIkit logo and adjust DocC theme color
- Add tuikit-logo.png to DocC Resources
- Add @PageImage icon reference to DocC landing page
- Adjust intro accent color to #1f821b (darker phosphor green)
2026-01-30 21:11:54 +01:00
phranck b7a91220f9 Chore: Move theme-settings.json into DocC catalog
- Add theme-settings.json to TUIkit.docc (recognized by DocC automatically)
- Remove inline generation step from CI workflow
2026-01-30 21:03:47 +01:00
phranck 95029184e7 Chore: Rename TUIKit to TUIkit
- Rename module, targets and products in Package.swift
- Rename directories: Sources/TUIkit, TUIkitExample, Tests/TUIkitTests
- Rename files: TUIkit.swift, TUIkit.docc/TUIkit.md
- Update all import statements, module-qualified calls, file headers
- Update doc comments, string literals and DocC articles
- Update CI workflow, README, .swiftlint.yml and markdown docs
- Merge platform badges into single combined badge in README
- Add "Example App auslagern" task to to-dos.md
2026-01-30 20:29:29 +01:00
phranck d55e28147d Merge pull request #17 from phranck/feature/linux-compatibility
fix: Linux compatibility for Terminal, SignalManager, and AppStorage
2026-01-30 17:13:50 +01:00
phranck 17f5be065e fix: Satisfy SwiftLint empty_count rule in write() guard 2026-01-30 17:10:50 +01:00
phranck cb491f231d fix: Replace fflush(stdout) with POSIX write syscall for Linux concurrency
@preconcurrency import Glibc does not suppress the Swift 6 strict
concurrency error for stdout (shared mutable global). Instead of
fighting the type system, bypass stdout entirely by writing directly
to STDOUT_FILENO via the POSIX write() syscall. This is concurrency-
safe, avoids buffering issues, and works on all platforms.
2026-01-30 17:08:08 +01:00
phranck 4f02fb601e fix: Use @preconcurrency import for Glibc/Musl to resolve stdout concurrency error
The previous nonisolated(unsafe) approach failed because the concurrency
check triggers on the read of stdout itself, not on the local binding.
@preconcurrency import suppresses all concurrency diagnostics for the
imported module, which is the correct fix for C library globals that
Swift 6 cannot reason about.
2026-01-30 17:04:43 +01:00
phranck 357c20c315 fix: Resolve stdout concurrency error on Linux and unify CI matrix
- Wrap fflush(stdout) in nonisolated(unsafe) to satisfy Swift 6 strict
  concurrency on Linux where stdout is a shared mutable global
- Replace separate lint + linux-build jobs with a single build matrix
  (macOS + Linux) that runs SwiftLint, swift build, and swift test
  on both platforms
- Install SwiftLint on Linux via release binary (no Homebrew available)
- DocC build-docs job now depends on the matrix build job
2026-01-30 17:00:00 +01:00
phranck 2e59acc6e7 docs: Document dual rendering system contract (H.2)
Document the View/Renderable dual rendering system across 9 files:
- Renderable.swift: Full protocol doc with conformance catalog and decision order
- renderToBuffer(): Dispatch logic with example flow and priority comments
- View.swift: Dual system overview with composite vs primitive examples
- ViewRenderer.swift: Clarify wrapper role, explain centralized Renderable extensions
- RenderLoop.swift: Full pipeline diagram (8 steps per frame)
- App.swift: SceneRenderable bridge from Scene to View rendering
- ViewModifier.swift: ModifiedView body:Never contract explanation
- Box.swift: Only composite view (no Renderable, delegates via body)
- ForEach.swift: No standalone rendering, depends on ViewBuilder flattening
- Environment.swift: EnvironmentModifier.body is dead code (Renderable wins)
2026-01-30 16:56:47 +01:00
phranck 3ec23004b9 fix: Linux compatibility for Terminal, SignalManager, and AppStorage
- Replace #if os(Linux) with #if canImport(Glibc/Musl/Darwin) import guards
- Add TermFlag typealias to fix termios flag width mismatch (UInt vs UInt32)
- Add platform import guard to SignalManager for POSIX signal visibility
- Replace DispatchQueue.global with Task.detached in AppStorage
- Add XDG_CONFIG_HOME fallback for config directory resolution
- Add Linux Build & Test CI job (swift:6.0 container on ubuntu-latest)
2026-01-30 16:40:45 +01:00
phranck c51de4bc03 docs: Add inline comments to complex logic in KeyEvent, FrameBuffer, ViewRenderer (E.2)
- KeyEvent: Document CSI sequence format, explain final-byte role,
  add VT key identifier table to parseExtendedKey
- FrameBuffer: Explain why ANSI stripping is needed in insertOverlay
  (escape sequences shift column positions)
- ViewRenderer: Clarify spacer distribution algorithm in VStack/HStack
  (remaining space divided equally among spacers)
2026-01-30 15:46:10 +01:00
phranck 41797da955 docs: Add missing doc comments to all public declarations (E.1)
Add /// doc comments to 26 public declarations across 5 files:
- StatusBar.swift: StatusBarItemOrder properties/init/operator,
  StatusBarItem 5 stored properties, StatusBarItemProtocol.matches(),
  StatusBarItemBuilder 6 result builder methods
- Button.swift: ButtonRowBuilder 5 result builder methods
- Appearance.swift: Appearance.ID rawValue and init
- PaddingModifier.swift: Edge rawValue and init
- Preferences.swift: NavigationTitleKey.defaultValue

All public API is now fully documented for DocC generation.
2026-01-30 15:43:15 +01:00
phranck c920a28a3f refactor: Remove unused TabBadgeKey and AnchorPreferenceKey (C.4)
Both preference keys were speculative code — no Tab or Scroll system
exists in TUIKit. NavigationTitleKey is kept (used by .navigationTitle()
convenience modifier). Keys can be re-added when the features are built.
2026-01-30 15:38:06 +01:00