Skip to content

Feature/feature migration#77

Merged
manix84 merged 3 commits into
mainfrom
feature/feature-migration
Jun 8, 2026
Merged

Feature/feature migration#77
manix84 merged 3 commits into
mainfrom
feature/feature-migration

Conversation

@manix84

@manix84 manix84 commented Jun 8, 2026

Copy link
Copy Markdown
Owner

This pull request introduces several significant refactorings and dependency updates to improve maintainability, modularity, and to leverage new features from the arcade-engine package. The most important changes include updating dependencies, refactoring the high score server to use new receipt and validation mechanisms, migrating event names and utility functions to arcade-engine, and replacing the local achievement notification renderer with the one provided by arcade-engine.

Dependency and API Updates:

  • Upgraded the arcade-engine dependency from ^2.34.1 to ^2.41.1 and bumped the project version to 32.0.0 in package.json to access new APIs and features. [1] [2]

High Score Server Refactor:

  • Refactored server/high-score-server.mjs to use the new high score run receipt and validation APIs from arcade-engine/high-scores, replacing custom token signing and validation logic with createHighScoreServerRunReceipt and validateHighScoreServerRunReceipt. This improves security and maintainability. [1] [2] [3] [4] [5] [6] [7] [8]

Event and Utility Function Migration:

  • Replaced local event name constants and utility functions (such as appExitBlockedEvent, exitInstalledApp, and screen wake lock utilities) with the corresponding exports from arcade-engine throughout the codebase, including src/components/TimePilotGame.tsx, its tests, and other modules. [1] [2] [3] [4] [5] [6] [7]

Achievement Notification Refactor:

  • Refactored src/game/achievement-notifications.ts to use the AchievementNotificationRenderer from arcade-engine, removing the local implementation of notification rendering, animation, and layout logic. This reduces code duplication and ensures consistent notification appearance. [1] [2] [3] [4] [5]

Cleanup and Removal of Redundant Code:

  • Removed the now-unnecessary local implementation of app exit event handling and notification rendering logic, as these are now provided by arcade-engine. [1] [2] [3]

These changes collectively modernize the codebase, reduce technical debt, and make it easier to maintain by relying on well-tested, centralized utilities from arcade-engine.

manix84 added 2 commits June 8, 2026 17:00
… code maintainability

- Updated high scores management to include synchronization with remote API.
- Simplified immersive mode entry by utilizing arcade-engine's immersive mode function.
- Replaced hardcoded event names with constants from arcade-engine for user options changes.
- Migrated logging functionality to use arcade-engine's runtime logger, enhancing logging capabilities.
- Refactored screen wake lock management to leverage arcade-engine's implementation.
- Streamlined storage reset functions to utilize arcade-engine's storage management utilities.
- Enhanced UI scaling functions by incorporating arcade-engine's zoom and viewport scaling methods.
- Updated user options management to utilize arcade-engine's user options store, improving persistence and normalization.
- Improved test assertions for rendering functions to ensure accurate behavior.
Copilot AI review requested due to automatic review settings June 8, 2026 20:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 89ed6e966d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/game/achievement-notifications.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the project to rely more heavily on arcade-engine by upgrading the dependency and migrating several locally-owned utilities (user options persistence/normalization, filter settings, wake lock, immersive mode, exit handling, achievement notifications, and logging) to engine-provided implementations. It also refactors the high score server to use the engine’s newer run receipt + validation APIs.

Changes:

  • Bump arcade-engine to ^2.41.1 and project version to 32.0.0.
  • Replace local implementations (filter settings, log levels/logger, wake lock, app exit event, achievement notification rendering, scaling helpers) with arcade-engine equivalents.
  • Refactor server/high-score-server.mjs to use new run receipt issuance + validation utilities from arcade-engine/high-scores.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/game/user-options.ts Migrates user option persistence/normalization to arcade-engine’s user options store.
src/game/ui-scale.ts Uses arcade-engine viewport/zoom scaling helpers instead of local clamp/math.
src/game/types.ts Re-exports filter/log-level-related types from arcade-engine instead of local modules.
src/game/systems/tests/systems.test.ts Updates rendering assertions to follow the new achievement notification rendering path.
src/game/storage-reset.ts Uses arcade-engine storage namespace/key removal helpers with error callbacks.
src/game/screen-wake-lock.ts Removes local Screen Wake Lock implementation (now sourced from arcade-engine).
src/game/menus/tests/menus.test.ts Switches filter preset source to arcade-engine.
src/game/menus.ts Switches filter + log-level menu data/helpers to arcade-engine exports.
src/game/logger.ts Replaces local logger implementation with arcade-engine runtime logger factory.
src/game/log-levels.ts Removes local log level definitions/helpers (now sourced from arcade-engine).
src/game/index.ts Updates event name usage to userOptionsChangedEventName from arcade-engine.
src/game/immersive-mode.ts Delegates fullscreen/orientation behavior to arcade-engine immersive mode helper.
src/game/high-scores.ts Adjusts high score saving flow (including optional sync) around the engine manager.
src/game/filter-settings.ts Removes local filter preset/settings definitions (now sourced from arcade-engine).
src/game/app-exit.ts Removes local app-exit event/utility (now sourced from arcade-engine).
src/game/achievement-notifications.ts Replaces local popup rendering/animation with AchievementNotificationRenderer from arcade-engine.
src/game/tests/screen-wake-lock.test.ts Updates tests to import wake lock helpers from arcade-engine.
src/components/TimePilotGame.tsx Updates app-exit, filter settings, wake lock, and options-changed event wiring to engine exports.
src/components/tests/TimePilotGame.test.tsx Updates app-exit event name import to engine export.
server/high-score-server.mjs Refactors server run issuance/validation to engine receipt APIs; removes custom HMAC token logic.
package.json Bumps app version + arcade-engine dependency version.
package-lock.json Locks updated package versions (app + arcade-engine).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/game/user-options.ts Outdated
Comment thread src/game/user-options.ts
@manix84 manix84 merged commit d2909ec into main Jun 8, 2026
4 checks passed
@manix84 manix84 deleted the feature/feature-migration branch June 8, 2026 21:22
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.

2 participants