feat(apps): formalize dual-mode App framework with tier-based auto re…#18
Merged
Conversation
…solution Replace the builtin: string-prefix hack with a LaunchKind-based dual-mode framework so the same App runs either as a detached process or as an in-process builtin panel, decided by hardware tier (Low -> in-process to save RAM on i.MX6ULL, Mid/High -> detached for isolation). - LaunchKind enum (Auto/DetachedProcess/BuiltinPanel) on AppEntry - IBuiltinPanel interface (IPanel style) + BuiltinPanelRegistry (map-based, non-owning; aex has no named-factory variant to reuse) - AboutPanel implements IBuiltinPanel; wire the missing grid entry (builtin:about was unreachable before) - Drop the if(id=="about") chain; dispatch by entry.launch_kind - loadAppsConfig merges builtin registry + discovered manifests; Auto resolves to BuiltinPanel only when prefer_inprocess && a builtin impl exists, otherwise DetachedProcess (no silent builtin fallback) - CalculatorBuiltinPanel adapter: same CalculatorPanel source compiled two ways (standalone exe + in-process builtin) -> dual-mode verified - HardwareTierCapabilities::prefer_inprocess_apps (Low/Unknown = true) - manifest launch_kind (auto/detached/builtin) parsed by AppDiscoverer - Tests: BuiltinPanelRegistry (5), launch_kind parsing (3), full green - Docs: milestone_04 sec 6, new milestone_07 (third-party plan) Architecture exception: desktop compiles apps/calculator/calculator_panel.cpp and links cfdesktop_calculator_parser (desktop->apps reverse dep, violates layering spirit). Top-level CMake reorders apps before desktop to resolve the target. Debt tracked in milestone_07 for migration to a neutral lib.
…ng pointers The registry is a process-wide singleton holding non-owning pointers; each test registered stack-local FakePanels that dangled after the test ended. AllIncludesRegistered then iterated all() across the accumulated dangling pointers, calling through freed vtables — SegFault on Clang, access violation (0xc0000005) on MSVC. GCC survived by UB luck. Switch to a TEST_F fixture that clears the registry in SetUp, so each test starts empty and all() only sees live panels. Tightens AllIncludesRegistered to assert size==1 (deterministic across compilers). Adds BuiltinPanelRegistry::clear() (test/reset only; production registers once at startup and never clears).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…solution
Replace the builtin: string-prefix hack with a LaunchKind-based dual-mode framework so the same App runs either as a detached process or as an in-process builtin panel, decided by hardware tier (Low -> in-process to save RAM on i.MX6ULL, Mid/High -> detached for isolation).
Architecture exception: desktop compiles apps/calculator/calculator_panel.cpp and links cfdesktop_calculator_parser (desktop->apps reverse dep, violates layering spirit). Top-level CMake reorders apps before desktop to resolve the target. Debt tracked in milestone_07 for migration to a neutral lib.