Skip to content

Extension edit tutorial - #2806

Open
jhauga wants to merge 42 commits into
github:mainfrom
jhauga:extension-edit-tutorial
Open

Extension edit tutorial#2806
jhauga wants to merge 42 commits into
github:mainfrom
jhauga:extension-edit-tutorial

Conversation

@jhauga

@jhauga jhauga commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have read and followed the Guidance for submissions involving paid services.
  • My contribution adds a new instruction, prompt, agent, skill, workflow, or canvas extension file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, agent, skill, workflow, or canvas extension with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.
  • I am targeting the main branch for this pull request.

Description

Canvas extension where Copilot tutors the user on code changes so that they can
understand the updates applied to the codebase.

Test Conditions

Evaluation Context

  • Session Target: GitHub Copilot
  • Agent: Default Agent
  • Model: Claude Sonnet 4.6
  • Number of Prompts: 1
  • Post Edits: None

Copilot Pro+ Plan Credit Usage

  • Start Credits: 77%
  • End Credits: 83%

Prompt

Make a patch update for the "Runway Landing" game mode. The runway is not
rendering. Start first level off with runway within a reasonable view of the 
ircraft. Start an edit tutorial for the update.

Results

Good. The patch to the repo pilot-matter worked. It got creative with the test, making math variations.

Below are screenshots of the tutorial it gave me.

Note

The images were resized, so slightly distorted; in order for each screenshot
to fit on the same composition.

test results demo


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New agent file.
  • New plugin.
  • New skill file.
  • New agentic workflow.
  • New canvas extension.
  • Update to existing instruction, prompt, agent, plugin, skill, workflow, or canvas extension.
  • Other (please specify):

By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

Copilot AI balanced review requested due to automatic review settings August 26, 2026 00:35
@jhauga
jhauga requested a review from aaronpowell as a code owner August 26, 2026 00:35
@github-actions github-actions Bot added canvas-extension PR touches canvas extensions new-submission PR adds at least one new contribution plugin PR touches plugins labels Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔒 PR Risk Scan Results

Scanned 7 changed file(s).

Severity Count
🔴 High 0
🟠 Medium 1
ℹ️ Info 0
Severity Rule File Line Match
🟠 unpinned-version-indicator extensions/edit-tutorial/package.json 8 "@​​github/copilot-sdk": "latest"
Skipped non-text or missing files
  • extensions/edit-tutorial/assets/icon.png
  • extensions/edit-tutorial/assets/preview.png

This is an automated soft-gate report. Findings indicate review targets and do not block merge by themselves.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an installable canvas extension that turns Copilot code edits into interactive tutorials.

Changes:

  • Implements walkthroughs, quizzes, exercises, progress persistence, and agent review.
  • Registers and documents the new plugin.
  • Adds marketplace metadata and visual assets.

Reviewed changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
extensions/edit-tutorial/extension.mjs Implements the canvas and local server.
extensions/edit-tutorial/package.json Defines extension dependencies.
extensions/edit-tutorial/copilot-extension.json Declares extension metadata.
extensions/edit-tutorial/README.md Documents setup and usage.
extensions/edit-tutorial/assets/icon.png Provides extension iconography.
extensions/edit-tutorial/assets/preview.png Provides the plugin preview.
plugins/edit-tutorial/plugin.json Registers the installable plugin.
plugins/edit-tutorial/README.md Documents plugin installation.
docs/README.plugins.md Adds the plugin to documentation.
.github/plugin/marketplace.json Adds the marketplace entry.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread extensions/edit-tutorial/extension.mjs Outdated
Comment on lines +843 to +845
const server = createServer(async (req, res) => {
const url = new URL(req.url, "http://localhost");
const state = getState(instanceId);
Comment thread extensions/edit-tutorial/extension.mjs Outdated
Comment on lines +491 to +493
var bset = {}, aset = {};
b.forEach(function (l) { if (l.trim()) bset[l.trim()] = true; });
a.forEach(function (l) { if (l.trim()) aset[l.trim()] = true; });
Comment thread extensions/edit-tutorial/extension.mjs Outdated
Comment thread extensions/edit-tutorial/extension.mjs Outdated
Comment thread extensions/edit-tutorial/extension.mjs Outdated
Comment thread extensions/edit-tutorial/extension.mjs Outdated

if (url.pathname === "/request-tutorial" && req.method === "POST") {
if (sessionRef) {
try { await sessionRef.send(buildTutorialRequestPrompt()); } catch {}
Comment thread extensions/edit-tutorial/extension.mjs Outdated
@jhauga
jhauga marked this pull request as draft August 26, 2026 00:41
jhauga and others added 3 commits August 25, 2026 21:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jhauga
jhauga marked this pull request as ready for review August 26, 2026 01:55
Copilot AI review requested due to automatic review settings August 26, 2026 01:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated 4 comments.

Suppressed comments (1)

extensions/edit-tutorial/extension.mjs:603

  • When the exercise is active, that state is represented only by CSS, so assistive technology cannot determine which step is current. Expose the active state with aria-current="step" here as well.
  if (view.kind === "exercise") exCls += " active";
  if (S.progress.exercise.completed) exCls += " done";
  html += '<button class="' + exCls + '" onclick="gotoExercise()">' +
    (S.progress.exercise.completed ? "&#10003; " : "") + "Exercise</button>";

Comment thread extensions/edit-tutorial/extension.mjs Outdated
Comment thread extensions/edit-tutorial/extension.mjs
Comment thread extensions/edit-tutorial/extension.mjs Outdated
var allPass = true;
lastCheckResults = ex.checks.map(function (c) {
var pass = false;
try { pass = new RegExp(c.pattern, c.flags || "m").test(codeText); } catch (err) { pass = false; }
Comment thread extensions/edit-tutorial/extension.mjs
@jhauga
jhauga marked this pull request as draft August 26, 2026 02:02
jhauga and others added 2 commits August 25, 2026 22:05
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jhauga
jhauga marked this pull request as ready for review August 26, 2026 02:31
Copilot AI review requested due to automatic review settings August 26, 2026 02:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.

Suppressed comments (3)

extensions/edit-tutorial/extension.mjs:978

  • The synchronous fallback defeats the hard time budget. screenPattern accepts catastrophic bounded alternations such as ^(a|aa){50}$, so when Blob workers are unavailable this loop can freeze the canvas on learner input. Treat unfinished checks as stalled rather than evaluating them on the UI thread, including the equivalent worker.onerror fallback.
  var inline = function () {
    var out = [], k;
    for (k = 0; k < checks.length; k++) {
      try { out.push(new RegExp(checks[k].pattern, checks[k].flags || "m").test(codeText)); }
      catch (err) { out.push(false); }

extensions/edit-tutorial/extension.mjs:1058

  • A timeout produces null results and is presented as “could not be run,” but it still increments failedAttempts. Three infrastructure stalls therefore unlock the reference solution even though the learner has not failed a check. Increment this counter only when at least one check actually returned false.
    } else {
      pe.failedAttempts++;
    }

extensions/edit-tutorial/extension.mjs:1039

  • A learner can keep editing while the worker runs, but this guard only detects tutorial replacement/reset. If the captured codeText passes and the editor has since changed to failing code, the callback still marks the current attempt complete. Also compare the current exercise code with codeText and discard stale results.
    if (!S.tutorial || !S.progress || S.tutorial.exercise.checks !== ex.checks) {

Comment thread extensions/edit-tutorial/extension.mjs Outdated
@jhauga
jhauga marked this pull request as draft August 26, 2026 02:37
jhauga and others added 2 commits August 25, 2026 22:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jhauga and others added 2 commits August 26, 2026 17:59
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jhauga
jhauga marked this pull request as ready for review August 26, 2026 22:11
Copilot AI review requested due to automatic review settings August 26, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 10 changed files in this pull request and generated 2 comments.

Comment thread extensions/edit-tutorial/extension.mjs Outdated
if (index < 0 || index >= info.count || index === info.index) return;
var forward = index > (info.index || 0);
lessonSwitching = true;
api("/lesson", { method: "POST", body: JSON.stringify({ index: index }) })
Comment thread extensions/edit-tutorial/extension.mjs Outdated
@jhauga
jhauga marked this pull request as draft August 26, 2026 22:17
jhauga and others added 2 commits August 26, 2026 18:17
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jhauga
jhauga marked this pull request as ready for review August 26, 2026 22:21
Copilot AI review requested due to automatic review settings August 26, 2026 22:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 10 changed files in this pull request and generated 1 comment.

Comment thread extensions/edit-tutorial/extension.mjs Outdated
Comment on lines +1621 to +1624
postProgress()
.catch(function () {})
.then(function () {
return api("/lesson", { method: "POST", body: JSON.stringify({ index: index }) });
Copilot AI review requested due to automatic review settings August 26, 2026 22:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 10 changed files in this pull request and generated 2 comments.

Comment thread extensions/edit-tutorial/extension.mjs
Comment thread extensions/edit-tutorial/extension.mjs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 10 changed files in this pull request and generated 1 comment.

Comment thread extensions/edit-tutorial/extension.mjs
@aaronpowell

Copy link
Copy Markdown
Contributor

There's still some HIGH flagged comments from CCR, can you review those and action any that are relevant still

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 10 changed files in this pull request and generated 3 comments.

Comment thread extensions/edit-tutorial/extension.mjs Outdated
Comment thread extensions/edit-tutorial/extension.mjs
Comment thread extensions/edit-tutorial/extension.mjs
jhauga and others added 2 commits August 26, 2026 23:01
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 10 changed files in this pull request and generated no new comments.

@jhauga

jhauga commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Tested and found bug. Resolving.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 10 changed files in this pull request and generated 1 comment.

Comment thread extensions/edit-tutorial/extension.mjs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 10 changed files in this pull request and generated no new comments.

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

Labels

canvas-extension PR touches canvas extensions new-submission PR adds at least one new contribution plugin PR touches plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants