From d73c0bb1f347223c33e5787c175b171bfa5dac04 Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Thu, 26 Feb 2026 16:33:14 +1100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- website/public/styles/global.css | 2 +- .../before-after-customization-examples.md | 2 -- .../copilot-configuration-basics.md | 4 +-- .../github-copilot-terminology-glossary.md | 2 -- .../understanding-copilot-context.md | 2 +- website/src/layouts/ArticleLayout.astro | 25 ++++++++++++++++--- website/src/pages/learning-hub/index.astro | 14 +++++++++-- 7 files changed, 37 insertions(+), 14 deletions(-) diff --git a/website/public/styles/global.css b/website/public/styles/global.css index c34da0d4..3029280b 100644 --- a/website/public/styles/global.css +++ b/website/public/styles/global.css @@ -1598,7 +1598,7 @@ a:hover { .learning-hub-sidebar { position: sticky; - top: 24px; + top: calc(var(--header-height) + 24px); max-height: calc(100vh - 48px); overflow-y: auto; } diff --git a/website/src/content/learning-hub/before-after-customization-examples.md b/website/src/content/learning-hub/before-after-customization-examples.md index 2c4f534d..e514b524 100644 --- a/website/src/content/learning-hub/before-after-customization-examples.md +++ b/website/src/content/learning-hub/before-after-customization-examples.md @@ -16,8 +16,6 @@ relatedArticles: - ./defining-custom-instructions.md --- -# Before/After Customization Examples - The power of GitHub Copilot customization becomes clear when you see concrete examples of how agents, skills, and instructions transform everyday development workflows. This article presents real-world scenarios showing the dramatic difference between default Copilot behavior and customized experiences that align with your team's standards, tools, and practices. > Note: The following examples illustrate typical before-and-after scenarios. The actual before and after code may vary depending on the model used and any other context present at generation time. diff --git a/website/src/content/learning-hub/copilot-configuration-basics.md b/website/src/content/learning-hub/copilot-configuration-basics.md index a870a902..6b15ac1c 100644 --- a/website/src/content/learning-hub/copilot-configuration-basics.md +++ b/website/src/content/learning-hub/copilot-configuration-basics.md @@ -364,11 +364,11 @@ A: Use the `excludedFiles` setting in your IDE configuration or create a workspa **Q: Can I have different settings per project?** -A: Yes! Use workspace settings (`.vscode/settings.json`) for project-specific preferences that don't need to be shared, or use repository settings (`.github/copilot/`) for team-wide customizations that should be version-controlled. +A: Yes! Use workspace settings (`.vscode/settings.json`) for project-specific preferences that don't need to be shared, or use repository settings (for example, files in `.github/agents/`, `.github/skills/`, `.github/instructions/`, and `.github/copilot-instructions.md`) for team-wide customizations that should be version-controlled. **Q: How do team settings override personal settings?** -A: Repository settings in `.github/copilot/` have the highest precedence, followed by workspace settings, then user settings. This means team-defined instructions and agents will apply even if your personal settings differ, ensuring consistency across the team. +A: Repository-level Copilot configuration (such as `.github/agents/`, `.github/skills/`, `.github/instructions/`, and `.github/copilot-instructions.md`) has the highest precedence, followed by workspace settings, then user settings. This means team-defined instructions and agents will apply even if your personal settings differ, ensuring consistency across the team. **Q: Where should I put customizations that apply to all my projects?** diff --git a/website/src/content/learning-hub/github-copilot-terminology-glossary.md b/website/src/content/learning-hub/github-copilot-terminology-glossary.md index d6b542ef..0caa5722 100644 --- a/website/src/content/learning-hub/github-copilot-terminology-glossary.md +++ b/website/src/content/learning-hub/github-copilot-terminology-glossary.md @@ -14,8 +14,6 @@ relatedArticles: - ./copilot-configuration-basics.md --- -# GitHub Copilot Terminology Glossary - New to GitHub Copilot customization? This glossary defines common terms you'll encounter while exploring agents, skills, instructions, and related concepts in the Awesome GitHub Copilot ecosystem. Use this page as a quick reference when reading articles in the Learning Hub or browsing the repository. diff --git a/website/src/content/learning-hub/understanding-copilot-context.md b/website/src/content/learning-hub/understanding-copilot-context.md index 4f4cfb76..067bee56 100644 --- a/website/src/content/learning-hub/understanding-copilot-context.md +++ b/website/src/content/learning-hub/understanding-copilot-context.md @@ -118,7 +118,7 @@ Using `#` to reference specific files gives Copilot precise context about which GitHub Copilot has a maximum token limit for how much context it can process at once. When you have many files open or a long chat history, Copilot prioritizes: 1. **Closest proximity**: Code immediately surrounding your cursor -2. **Explicitly referenced files**: Files you @-mention in chat for CLI, and #-mention for IDE's (VS Code, Visual Studio, JetBrains, etc.) +2. **Explicitly referenced files**: Files you @-mention in chat for CLI, and #-mention for IDEs (VS Code, Visual Studio, JetBrains, etc.) 3. **Recently modified files**: Files you've edited recently 4. **Direct dependencies**: Files imported by your current file diff --git a/website/src/layouts/ArticleLayout.astro b/website/src/layouts/ArticleLayout.astro index 76867646..cb073bcf 100644 --- a/website/src/layouts/ArticleLayout.astro +++ b/website/src/layouts/ArticleLayout.astro @@ -14,15 +14,32 @@ interface Props { const { title, description, estimatedReadingTime, lastUpdated, tags } = Astro.props; const base = import.meta.env.BASE_URL; +const createOrderIndexMap = (order: string[]) => { + const map = new Map(); + for (let i = 0; i < order.length; i += 1) { + map.set(order[i], i); + } + return map; +}; + const articles = await getCollection('learning-hub'); +const fundamentalsOrderIndex = createOrderIndexMap(fundamentalsOrder); +const referenceOrderIndex = createOrderIndexMap(referenceOrder); + const fundamentals = articles - .filter((a) => fundamentalsOrder.includes(a.id)) - .sort((a, b) => fundamentalsOrder.indexOf(a.id) - fundamentalsOrder.indexOf(b.id)); + .filter((a) => fundamentalsOrderIndex.has(a.id)) + .sort( + (a, b) => + (fundamentalsOrderIndex.get(a.id) ?? 0) - (fundamentalsOrderIndex.get(b.id) ?? 0), + ); const reference = articles - .filter((a) => referenceOrder.includes(a.id)) - .sort((a, b) => referenceOrder.indexOf(a.id) - referenceOrder.indexOf(b.id)); + .filter((a) => referenceOrderIndex.has(a.id)) + .sort( + (a, b) => + (referenceOrderIndex.get(a.id) ?? 0) - (referenceOrderIndex.get(b.id) ?? 0), + ); const currentSlug = Astro.url.pathname.replace(/\/$/, '').split('/').pop(); --- diff --git a/website/src/pages/learning-hub/index.astro b/website/src/pages/learning-hub/index.astro index f3e278a8..3a10ed19 100644 --- a/website/src/pages/learning-hub/index.astro +++ b/website/src/pages/learning-hub/index.astro @@ -6,13 +6,23 @@ import { fundamentalsOrder, referenceOrder } from '../../config/learning-hub'; const base = import.meta.env.BASE_URL; const articles = await getCollection('learning-hub'); +const fundamentalsOrderIndex = {}; +fundamentalsOrder.forEach((id, index) => { + fundamentalsOrderIndex[id] = index; +}); + +const referenceOrderIndex = {}; +referenceOrder.forEach((id, index) => { + referenceOrderIndex[id] = index; +}); + const fundamentals = articles .filter((a) => fundamentalsOrder.includes(a.id)) - .sort((a, b) => fundamentalsOrder.indexOf(a.id) - fundamentalsOrder.indexOf(b.id)); + .sort((a, b) => fundamentalsOrderIndex[a.id] - fundamentalsOrderIndex[b.id]); const reference = articles .filter((a) => referenceOrder.includes(a.id)) - .sort((a, b) => referenceOrder.indexOf(a.id) - referenceOrder.indexOf(b.id)); + .sort((a, b) => referenceOrderIndex[a.id] - referenceOrderIndex[b.id]); ---