Repository navigation
Add 2048 canvas extension - #6369
geniodelmale wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🚦 Submission status: ⏳ Awaiting automationRisk tier: Why this tier
Automated checks
Review
Commands
Updated for |
🔒 PR Risk Scan ResultsScanned 11 changed file(s).
✅ No matching risk patterns were detected in changed files. Skipped non-text or missing files
|
🧩 Canvas smoke test✅ Passed · 0 error(s), 2 warning(s)
Plugin
|
| Field | Value |
|---|---|
| Description | Play 2048 in a Copilot canvas with keyboard and touch controls, undo, and session saves. |
| Author | geniodelmale — https://github.com/geniodelmale |
| License | MIT |
| Keywords | 2048, copilot-canvas, game, keyboard, puzzle, undo |
| Extensions | keyboard-2048 |
| Materialize | ✅ |
| Install | ✅ |
Changed plugin files
plugins/keyboard-2048/README.mdplugins/keyboard-2048/plugin.json
Extension keyboard-2048
| Field | Value |
|---|---|
| Registered by | keyboard-2048 |
| Package | — |
| Preview | 1546×1496, 160.2 KB |
| Modules | 6 (3 reachable from extension.mjs) |
| Files | 9 |
Permissions and capabilities (static analysis of modules reachable from extension.mjs)
- File system access (node:fs)
- Network sockets / local server (node:http, node:net, ...)
Warnings
- game.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
- server.test.mjs: import "node:test" is not a Node.js builtin, host-provided package, or declared dependency (module is not reachable from extension.mjs)
Changed extension files
extensions/keyboard-2048/app.mjsextensions/keyboard-2048/assets/preview.pngextensions/keyboard-2048/extension.mjsextensions/keyboard-2048/game.mjsextensions/keyboard-2048/game.test.mjsextensions/keyboard-2048/index.htmlextensions/keyboard-2048/server.mjsextensions/keyboard-2048/server.test.mjsextensions/keyboard-2048/style.css
Static checks compile modules without executing them. Minimum preview size is configurable with CANVAS_PREVIEW_MIN_WIDTH/CANVAS_PREVIEW_MIN_HEIGHT. Workflow run
There was a problem hiding this comment.
🟡 Changes recommended
Uncaught URL-parsing errors can terminate the extension before authentication, while inaccessible tile labels and insufficient dark-mode text contrast also remain unresolved.
3 open issues
What changed in this PR
Adds Keyboard 2048 as a standalone Copilot canvas plugin, with source attribution and registration in the repository’s plugin catalog.
Changes:
- Implements the game, keyboard and touch controls, animations, undo, and session saves.
- Adds canvas actions, an authenticated local server, and focused game/server tests.
- Provides plugin metadata, installation instructions, and catalog entries.
| File | Description |
|---|---|
plugins/keyboard-2048/README.md |
Documents installation, source attribution, and license. |
plugins/keyboard-2048/plugin.json |
Defines plugin metadata and extension composition. |
extensions/keyboard-2048/style.css |
Styles the board, themes, controls, and animations. |
extensions/keyboard-2048/server.test.mjs |
Tests persistence, command ordering, and HTTP behavior. |
extensions/keyboard-2048/server.mjs |
Provides saved state, authenticated endpoints, and live updates. |
extensions/keyboard-2048/index.html |
Defines the game interface and restart dialog. |
extensions/keyboard-2048/game.test.mjs |
Tests movement, merging, undo, spawning, and save validation. |
extensions/keyboard-2048/game.mjs |
Implements game rules and state validation. |
extensions/keyboard-2048/extension.mjs |
Registers canvas actions and manages panel lifecycles. |
extensions/keyboard-2048/app.mjs |
Handles rendering, animation, input, and server communication. |
docs/README.plugins.md |
Adds the plugin to the documentation catalog. |
.github/plugin/marketplace.json |
Registers the plugin for marketplace discovery. |
Review effort: Balanced (auto)
| motionLayer.setAttribute("aria-hidden", "true"); | ||
| board.parentElement.append(motionLayer); | ||
| const cells = Array.from({ length: 16 }, () => { | ||
| const cell = document.createElement("div"); |
| --cp-border: #474747; | ||
| --cp-border-strong: #5f5f5f; | ||
| --cp-text: #dedede; | ||
| --cp-text-muted: #919191; |
Add error handling for invalid request URLs. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.



Pull Request Checklist
npm startand verified thatREADME.mdis up to date.mainbranch for this pull request.Description
Adds the keyboard-2048 canvas as a standalone plugin, preserving the current source implementation and attributing it to its canonical repository. The plugin includes its preview image, runtime modules, and focused game/server tests. The gist-only preview save and legacy extension metadata are excluded.
Type of Contribution
Additional Notes
Validation passed:
npm run plugin:validate,npm start,npm run website:data, andnode --test extensions/keyboard-2048/game.test.mjs extensions/keyboard-2048/server.test.mjs(22/22 tests). In-app testing with GitHub Copilot was not available. The source project has no standalone license file; this contribution is licensed under MIT per the repository's submission terms.By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.