Skip to content

feat(code-tutor): wire canvas-kit deep links into code-review fixes#19

Merged
jongio merged 1 commit into
mainfrom
jongio-expert-happiness
Jul 5, 2026
Merged

feat(code-tutor): wire canvas-kit deep links into code-review fixes#19
jongio merged 1 commit into
mainfrom
jongio-expert-happiness

Conversation

@jongio

@jongio jongio commented Jul 5, 2026

Copy link
Copy Markdown
Owner

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 describes fixPrompt as "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_codebase gains an optional repo (owner/repo), validated with the kit's own isRepoFullName and stored with the same lenient fallback as its sibling fields, so a bogus value never reaches buildSessionDeepLink and yields a dead link.
  • web/app.mjs: findings render a real "Fix in a new session" anchor (ghapp://session/new?...&mode=autopilot) built with buildSessionDeepLink when the board knows its repo; repo is threaded through ReviewTab into FindingCard. 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 stale canvas-kit 2026-06-27.1 version comments.
  • test/smoke.test.mjs: cover repo capture (valid stored, invalid ignored).
  • README.md: document the CTA and the optional repo.

The ai() (silent host model) and askAgent() paths were reviewed and left as-is; they are already well-used (fast locked-down model runtime for explanations/Q&A, and askAgent for 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=autopilot anchor with zero console errors.

Type

  • New extension
  • Fix / improvement to an existing extension
  • Tooling / CI / docs

Checklist

  • node scripts/lint.mjs passes
  • node scripts/validate-extensions.mjs passes
  • node scripts/run-tests.mjs passes
  • New/changed extension has a smoke test under extensions/<name>/test/
  • README extensions table updated (when adding or removing an extension) - N/A (no extension added or removed)

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>

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 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) via set_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

@jongio jongio merged commit 1e9bce0 into main Jul 5, 2026
4 checks passed
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