Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the AI chat drawer into a mode-aware assistant that can propose structured edits to the Component/Styles editors and lets users apply (and undo) those proposals, while also updating the GitHub Models chat API wrapper to support tool calls.
Changes:
- Adds editor-proposal tooling + apply/undo workflow to the AI chat drawer, including mode-aware system prompting and conversation compaction.
- Extends
github-apichat completion helpers to send/receivetools+tool_choice(including streaming tool-call deltas). - Updates render-runtime auto-render behavior for
export defaultcases and adds Playwright coverage for the new behaviors.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/styles/ai-controls.css | Adds styles for new chat title/icon, message label icons, proposal action buttons, and undo actions UI. |
| src/modules/render-runtime.js | Skips implicit App wrapping when export default is present (supports default-export entry patterns). |
| src/modules/github-pr-drawer.js | Dedupes/serializes PR context verification requests to avoid repeated network work. |
| src/modules/github-chat-drawer/chat-utils.js | Extracts shared chat-related normalization/utilities into a dedicated module. |
| src/modules/github-chat-drawer/payload.js | Builds outbound chat payload with mode-aware policy prompt + conversation summarization/byte-budget trimming. |
| src/modules/github-chat-drawer/proposals.js | Adds tool schema + extraction of editor proposals from tool calls or markdown code fences. |
| src/modules/github-chat-drawer/drawer.js | Rebuilds chat drawer controller with tool-call proposals, apply-to-editor + undo, and improved message rendering. |
| src/modules/github-chat-drawer.js | Removes the previous monolithic chat drawer implementation. |
| src/modules/github-api.js | Adds tool definitions/tool_choice support and tool-call extraction for both streaming and non-stream responses. |
| src/index.html | Updates AI chat header markup (title + icon) and removes rate-limit display node. |
| src/app.js | Rewires chat drawer import and passes editor setters + render scheduling hook for apply/undo integration. |
| playwright/rendering-modes.spec.ts | Adds E2E coverage for auto-render handling of default-exported named components. |
| playwright/helpers/app-test-helpers.ts | Extends chat request body typing and adds editor-source helper setters used by new E2E tests. |
| playwright/github-byot-ai.spec.ts | Updates AI chat tests for tools/tool_choice and adds E2E coverage for apply/undo proposal flow. |
| docs/next-steps.md | Removes completed roadmap section for prior AI assistant phases. |
| AGENTS.md | Adds guidance to avoid index/barrel files and prefer explicit import paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Uh oh!
There was an error while loading. Please reload this page.