feat(code-tutor): wire canvas-kit deep links into code-review fixes#19
Merged
Conversation
The vendored canvas-kit (2026-07-04.1) shipped deep-link builders that no extension used. Code Tutor's "Request fix session" button only copied the prompt to the clipboard and set a flag, leaving the user to ask Copilot manually, even though a finding's fixPrompt is described as a ready-to-run prompt for a new session. Findings now render a real "Fix in a new session" deep-link anchor (ghapp://session/new, mode=autopilot) when the board knows its GitHub owner/repo, with a graceful fallback to the original copy-prompt button when it does not. - canvas.mjs: set_codebase gains an optional repo (owner/repo), validated with the kit's isRepoFullName and stored with the same lenient fallback as its sibling fields so a bogus value never yields a dead link. - web/app.mjs: build the link with buildSessionDeepLink and thread repo through ReviewTab into FindingCard; anchor uses target=_blank. - web/styles.css: one rule so the anchor reads as a button. - extension.mjs: refresh stale kit-version comments. - test/smoke.test.mjs: valid repo stored, invalid repo ignored. - README.md: document the CTA and the optional repo. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR wires Code Tutor’s code-review “fix prompt” workflow into Canvas Kit’s ghapp://session/new deep links, allowing users to open a dedicated Copilot session to run a finding’s fixPrompt with one click when the codebase’s GitHub owner/repo is known.
Changes:
- Capture and persist an optional validated
codebase.repo(owner/repo) viaset_codebase, preserving the prior valid value when input is invalid. - Render a “Fix in a new session” deep-link CTA for findings (fallback to the existing copy-prompt flow when repo is unknown).
- Add smoke coverage for repo capture/validation and minor doc/style updates to reflect the new CTA.
Show a summary per file
| File | Description |
|---|---|
| extensions/code-tutor/canvas.mjs | Adds optional validated repo handling to set_codebase state so the UI can safely form session deep links. |
| extensions/code-tutor/web/app.mjs | Builds and renders buildSessionDeepLink(...) for findings with fixPrompt when codebase.repo is present; otherwise keeps the copy-prompt button. |
| extensions/code-tutor/web/styles.css | Styles the deep-link anchor as a button by removing default underline in the findings action area. |
| extensions/code-tutor/test/smoke.test.mjs | Adds a smoke test ensuring valid owner/repo is stored and invalid input is ignored (lenient fallback). |
| extensions/code-tutor/README.md | Documents the new deep-link CTA behavior and the optional repo field on set_codebase. |
| extensions/code-tutor/extension.mjs | Refreshes comments around the host model capability wording (no functional changes). |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Low
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.
What & why
The vendored canvas-kit (
2026-07-04.1) shipped deep-link builders (buildSessionDeepLink, etc.) that no extension actually used. Code Tutor's code-review "Request fix session" button only copied the finding's prompt to the clipboard and set a flag, leaving the user to ask Copilot manually, even though the finding schema describesfixPromptas "a ready-to-run prompt for a new session that would fix this." That is the textbook deep-link case.This closes the loop: a code-review finding can now open a dedicated Copilot session that runs its fix, with one click.
Approach
canvas.mjs:set_codebasegains an optionalrepo(owner/repo), validated with the kit's ownisRepoFullNameand stored with the same lenient fallback as its sibling fields, so a bogus value never reachesbuildSessionDeepLinkand yields a dead link.web/app.mjs: findings render a real "Fix in a new session" anchor (ghapp://session/new?...&mode=autopilot) built withbuildSessionDeepLinkwhen the board knows its repo;repois threaded throughReviewTabintoFindingCard. When the repo is unknown it gracefully falls back to the original copy-prompt button, so nothing regresses.web/styles.css: one rule so the anchor reads as a button (the first anchor-as-button in this canvas).extension.mjs: refresh stalecanvas-kit 2026-06-27.1version comments.test/smoke.test.mjs: cover repo capture (valid stored, invalid ignored).README.md: document the CTA and the optionalrepo.The
ai()(silent host model) andaskAgent()paths were reviewed and left as-is; they are already well-used (fast locked-down model runtime for explanations/Q&A, andaskAgentfor refresh). Deep links were the missing piece.Verified in a browser: the Review tab renders a valid, URL-encoded
ghapp://session/new?repo=jongio%2Fcopilot-extensions&prompt=...&mode=autopilotanchor with zero console errors.Type
Checklist
node scripts/lint.mjspassesnode scripts/validate-extensions.mjspassesnode scripts/run-tests.mjspassesextensions/<name>/test/