GitHub Copilot 客户端入门:同屏整合 Diff、终端与浏览器
原标题:GitHub Copilot app for Beginners: Using the diff, terminal, and browser
Translation Summary
Alright, here’s the gist of my translation process. First, I carefully analyzed the request. The task was to translate text about the GitHub Copilot app, focusing on how different panels (diff, terminal, browser) work together, into Simplified Chinese. Crucially, I had to maintain the original formatting, including paragraph breaks and any inline URLs, and only output the translation.
I tackled this segment by segment, starting with the first sentence: "When an agent makes a change to your code, you want to review it, run it, and see what changed." I had to think carefully about the best way to render the word "agent" in this specific context (I settled on "智能体" or "agent" depending on the context). I needed to preserve the tone and register of the original text, which is aimed at technical users. Each sentence was translated carefully, paying close attention to technical terminology, like "diff panel," "terminal panel," "browser panel," "pull request," and "AI coding loop." For example, I translated "diff panel" directly as "diff 面板."
I made sure to keep the translation natural and fluent. I considered the nuances of Chinese phrasing for technical explanations. For example, the sentence "Reading code is good, but running it is even better" was translated carefully to "仅阅读代码固然不错,但实际运行起来更胜一筹" to better reflect the intent. I also thought about how to render inline commands, like npm run dev and made sure there were no errors in the copy.
I meticulously checked for consistency in terminology, ensuring each term was translated in the most appropriate manner and always the same. As the source text came across as a single paragraph, I ensured the output also became a single, solid paragraph in Simplified Chinese, adhering to the "Preserve paragraph breaks" instruction.
Finally, I did a final review to ensure accuracy and naturalness in the translation. The goal was to provide a professional, accurate, and easily understandable translation of this blog post. I have produced no commentary, following the instructions.
当智能体对你的代码做出更改时,你会想要审查代码、运行代码并查看具体改动了什么。好消息是:现在无需离开 GitHub Copilot 应用,你就可以同时完成这三件事。此前,完成这三项工作意味着你必须在编辑器、终端窗口和 Web 浏览器之间来回切换。但当这些步骤作为内置面板并排呈现在 Copilot 应用中时,检查智能体的工作就变得十分简单了。接下来,让我们逐一了解该应用中的各个面板,以及如何利用它们来完成 AI 编码闭环。使用 diff 面板审查更改 diff 面板(diff 即修改前后的对比)能够精确显示添加、删除或更改了哪些代码行,其中新增内容以绿色高亮显示,删除内容以红色高亮显示。这能让你一目了然,从而自主决定下一步操作。你可以接受更改、留下评论,或让 Copilot 进行修改。你拥有完全的控制权,并做出最终决定。在终端面板中运行命令 仅阅读代码固然不错,但实际运行起来更胜一筹。你可以直接在 Copilot 应用的终端面板中,于当前会话内运行命令。如果这看起来有些让人望而生畏,别担心。大部分情况下,你只是在运行项目自带的命令并查看结果。你可以手动运行代码,也可以将其配置为脚本(可通过“Run”按钮直接使用)。假设你正在开发一个网站,以下是具体操作示例:添加用于打开 client 文件夹并执行 npm run dev 的开发服务器脚本。点击 Run 启动该网站的服务器。你可以同时打开多个终端窗口,以便在它们之间自由切换并持续运行命令。在浏览器面板中使用 Pick & Polish 工具 对于任何具有用户界面的项目,浏览器面板都能实现闭环。拿我们的网站示例来说:该面板意味着你可以直接打开网页,如同实际使用网站一样测试你的新功能。如果你想继续迭代,可以使用 Pick & Polish 工具选中某个元素,并配合智能体对其进行调整。若想查看修复效果,在完成修改后只需重新运行开发服务器脚本即可。形成审查 AI 代码的完整闭环 现在,你已经审查了 diff、在终端中启动了项目、在浏览器中进行了预览,并通过不断迭代实现了一个功能完备的特性。一旦达到满意效果,你就可以直接在 Copilot 应用中接受更改并创建 Pull Request。在同一个地方完成这一闭环,意味着无需频繁切换标签页、应用,也不会迷失操作进度。将审查、运行和预览并排整合,消除了对智能体修改代码的顾虑,带来了安全感,因为你可以切实验证即将合并的代码能够正常运行。要点总结 这些内置面板解答了在接受智能体的工作成果之前,你应当始终追问的三个关键问题:改动了什么?能运行吗?真的有效吗?在接受智能体生成的代码之前逐一确认这些问题,将有助于你了解具体的更改内容以及它是否按你的预期运行,让你始终掌控大局。✨ 体验 GitHub Copilot 应用 > 文章《初学者 GitHub Copilot 应用指南:使用 diff、终端和浏览器》最初发布于 The GitHub Blog。
为什么值得读
梳理了在单一窗口内闭环验证 Agent 生成代码的交互设计,展示出辅助编程工具从单纯补全转向完整工作区的演进轨迹。