Skip to content

Chore todo optimization#69

Merged
ColinMichaels merged 4 commits into
devfrom
chore-todo-optimization
Feb 28, 2026
Merged

Chore todo optimization#69
ColinMichaels merged 4 commits into
devfrom
chore-todo-optimization

Conversation

@ColinMichaels
Copy link
Copy Markdown
Owner

No description provided.

…ndling

- **Introduced `ApplicationStatePersistenceService`**:
  - Added `loadOpenApplicationIds` and `saveOpenApplicationIds` methods to manage open app states using `localStorage` with error handling and type validation.
  - Integrated logging via the `LogService` for persistence issues.
- **Refactored `SettingsService`**:
  - Optimized persistence of individual and grouped settings with enhanced type-safety.
  - Modernized lifecycle management using `take`, `FormControl`, and `BehaviorSubject`.
  - Improved error notifications and streamlined `settings.service.ts`.
- **Added `application-catalog.ts`**:
  - Centralized app definitions, default parameters, and icons for better reusability.
  - Included metadata (`version`, `author`, `website`) and status tracking (`development`, etc.) for apps.
- **Created `application-manager.models.ts`**:
  - Consolidated enums (`AppType`, `APP_ID`) and types (`AppWindowSize`, `AppEntry`) for app-related configurations.
  - Standardized app properties like `memory`, `icon`, and `autofit`.
- **Updated Markdown Reader and Desktop Components**:
  - Improved `MarkdownReaderComponent`’s `params` type safety and file handling logic.
  - Enhanced `DesktopComponent` by validating `params` type in `openApp`.

These updates unify app management, improve state persistence and type safety, and declutter codebases by introducing shared models and centralized metadata.

Signed-off-by: Colin Michaels <colin@colinmichaels.com>
…l Development Logic**

- **Created `ApplicationRegistryService`**:
  - Centralized app storage, query, and management logic.
  - Extracted registry behavior and storage from `ApplicationManagerService` for modularity.
  - Added methods for querying installed apps, unregistration, and filtering by type.

- **Optimized `AuthGuard` for Local Development**:
  - Added `isLocalDevelopmentHost()` to allow bypass for localhost (`localhost`, `127.0.0.1`, `::1`) and non-browser environments.
  - Updated `canActivate` logic to skip guards in local development mode.

- **Updated Routing and Guard Logic**:
  - Removed unused Firebase-specific `authGuardPipe` logic from `app.routes.ts`.

- **Refactored Application Manager**:
  - Delegated app query and registration methods (`getApps`, `registerApp`, `unregisterApp`, etc.) to `ApplicationRegistryService`.

- **Enhanced Login Workflow for Local Development**:
  - Integrated local host detection in `LoginScreenComponent` to bypass login on localhost environments.
  - Adjusted automatic redirects to CLI app (`/os/cli`) for localhost scenarios.

- **Updated Documentation**:
  - Added progress tracking for `ApplicationRegistryService` refactor in `TECH_DEBT.md`.

These updates improve modularity (by isolating app registry logic), streamline development workflows for local environments, and enhance readability across multiple components/services.

Signed-off-by: Colin Michaels <colin@colinmichaels.com>
…cleService`, and Refactor File System Initialization

- **Enhanced `TypewriterService`**:
  - Improved timer and callback semantics with clear lifecycle management.
  - Added explicit timeout and interval clearing via `clearTypingTimers()` for robustness.
  - Extended test coverage to validate queue behavior, speed overrides, and event emissions.

- **Refactored Application Management**:
  - **Introduced `ApplicationLifecycleService`**:
    - Centralized application instance lifecycle (e.g., opening, focusing, closing).
    - Separated lifecycle logic from `ApplicationManagerService` to improve modularity.
    - Enhanced error handling for instance limits and out-of-memory scenarios.
  - Streamlined `ApplicationManagerService` by delegating lifecycle methods (`openApplication`, `closeApplication`, etc.) to `ApplicationLifecycleService`.

- **Optimized `FileSystemService` Initialization**:
  - Replaced random folder generation with deterministic favoritism using `createFavoriteFolderChildren()`.
  - Added folder-specific hashing (`hashPath`) for seeded file/subfolder creation.
  - Centralized logic for file extensions in `GENERATED_FILE_EXTENSIONS`.

- **Improved Tests and Mocks**:
  - Added `typewriter.service.spec.ts` with tests for typing flow and lifecycle callbacks.
  - Updated `login-screen.component.spec.ts` to mock `ActivatedRoute.snapshot` for enhanced compatibility.

- **Documentation Updates**:
  - Marked `TypewriterService` stabilization task as complete in `TECH_DEBT.md`.
  - Added progress tracking for `ApplicationLifecycleService` lifecycle extraction.

This update improves modularity in application management, ensures deterministic behavior in file system operations, and strengthens unit test coverage for critical services.

Signed-off-by: Colin Michaels <colin@colinmichaels.com>
- **Enhanced Application Lifecycle Management**:
  - Introduced deterministic instance reopening via normalized IDs in `ApplicationManagerService`.
  - Centralized restoration logic using `normalizeSavedAppId` in `ApplicationLifecycleService`, improving safety for multi-instance management.

- **Strengthened Unit Test Coverage**:
  - Added focused specs for logic validation:
    - `application-lifecycle.service.spec.ts` for lifecycle and persistence checks.
    - `application-manager.service.spec.ts` for restoration and instance normalization behaviors.
    - `file-system.service.spec.ts` for deterministic folder generation and navigation.

- **Improved Workflow and Compatibility**:
  - Updated `.nvmrc` to Node 20 and enhanced CI workflows with `actions/setup-node@v4` for better version alignment and caching.
  - Enhanced Firebase PR workflow to ensure environment parity with production deployment processes.

- **Documentation Updates**:
  - Marked progress for lifecycle-related improvements and normalized app restoration in `TECH_DEBT.md`.

These updates ensure more predictable application lifecycle behaviors, improve test reliability, and streamline build workflows for better consistency.

Signed-off-by: Colin Michaels <colin@colinmichaels.com>
@ColinMichaels ColinMichaels self-assigned this Feb 28, 2026
@ColinMichaels ColinMichaels merged commit 85dcd76 into dev Feb 28, 2026
1 check passed
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@github-actions
Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 5cda5df):

https://colinmichaels--pr69-chore-todo-optimizat-zl7ukwq1.web.app

(expires Sat, 07 Mar 2026 22:57:00 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 825a61d1eb4d817c6dec41f3afc8f4be6955b0e3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant