Skip to content

feat(website): Phosphor icon system + mobile nav fix#843

Merged
ashleyshaw merged 6 commits into
developfrom
feat/website-phosphor-icons-mobile-nav
Jun 5, 2026
Merged

feat(website): Phosphor icon system + mobile nav fix#843
ashleyshaw merged 6 commits into
developfrom
feat/website-phosphor-icons-mobile-nav

Conversation

@ashleyshaw

@ashleyshaw ashleyshaw commented Jun 5, 2026

Copy link
Copy Markdown
Member

Linked issues

Relates to #841 (Astro rebuild — follow-up icon and mobile nav fixes)

Changelog

Added

  • Icon.astro component: reads Phosphor SVG files at build time via fs.readFileSync, embeds inline via set:html — zero runtime JS, pure SSG output.
  • @phosphor-icons/core dependency for SVG asset files.

Fixed

  • Replaced all emoji icons (🤖 📖 💬 ✨ 🛡️ ⚙️ 🧩 🔧 🗺️ ✅ 📚 🍳 ☀️ 🌙) with named Phosphor SVG icons across catalogue pages, learn tracks, getting-started cards, cookbook, learning-hub, and the theme toggle buttons.
  • Mobile nav menu (AwesomeGithubNav.astro): added z-index: 99 so the fixed-position menu renders above page content instead of behind it.
  • Mobile nav menu: added document.body.style.overflow = "hidden" scroll-lock on open, cleared on close — prevents background scroll while menu is open (matches homepage nav behaviour).

Risk Assessment

Risk Level: Low

Potential Impact: Incorrect SVG path would render a blank icon rather than crashing; icon CSS changes are isolated to .ph-icon wrapper and existing container selectors. Mobile nav z-index change only affects viewports ≤768px.

Mitigation Steps:

  • npm run build in website/ completes with 244 pages, zero errors.
  • Icon component reads SVG at build time — any missing icon name produces an empty SVG fallback rather than a build error.
  • All icon containers updated from font-size to display: flex; color: var(--accent) to correctly size and colour SVGs.

How to Test

Prerequisites

  • Node ≥ 20, npm ci in website/

Test Steps

  1. Build: npm run build — confirm 244 pages, no errors.
  2. Phosphor icons: Visit /c/agents/ — resource type icons render as crisp SVGs (robot, book-open, etc.), not emoji.
  3. Theme toggle: Sun/moon SVG icons appear in nav; clicking toggles light/dark correctly.
  4. Learn tracks: /learn/ — compass, shield-star, check-circle, robot icons on track cards.
  5. Getting Started: /getting-started/ — "What next?" cards show robot, books, cooking-pot, book-open icons.
  6. Mobile menu (≤768px): Tap hamburger → menu slides in, background scroll is locked. Tap a link or press Escape → menu closes, scroll restored.
  7. Mobile menu z-index: Scroll down on a long page, open menu — menu appears above all content, not hidden behind cards.

Edge Cases to Verify

  • Dark mode: sun icon hidden, moon icon shown; icons inherit currentColor correctly
  • Light mode: moon icon hidden, sun icon shown
  • Private browsing: branch toggle degrades gracefully (no crash)
  • Keyboard: Escape closes mobile menu and returns focus to hamburger

Checklist (Global DoD / PR)

  • All AC met and demonstrated
  • Tests added/updated — N/A: no testable logic; SVG embed and CSS fixes
  • Accessibility checklist completed:
    • Semantic HTML and heading order verified
    • Keyboard navigation verified (Escape closes mobile menu, focus restored)
    • ARIA used only where needed (aria-hidden on icon wrappers)
    • Contrast reviewed — SVGs inherit currentColor, same contrast as before
  • Docs/readme/changelog updated
  • Frontmatter updated where applicable — N/A
  • I have reviewed and applied the downstream override policy (or linked an approved exception)
  • Security checklist completed — no user input, no output escaping concerns, no secrets introduced; SVG embedded via set:html from package assets (not user input)
  • Code/design reviews approved — awaiting peer review
  • CI green — pending
  • Risk assessment completed above
  • Testing instructions provided above

https://claude.ai/code/session_01VaY86RbnELdWvFyBdEMwLH

- Add Icon.astro component that reads Phosphor SVG files at build time
  via fs.readFileSync — zero runtime cost, pure SSG output
- Install @phosphor-icons/core for SVG assets
- Replace all emoji icons (🤖📖💬✨🛡️⚙️🧩🔧🗺️✅📚🍳☀️🌙) with
  named Phosphor icons: robot, book-open, chat-text, sparkle, shield-check,
  gear, puzzle-piece, wrench, compass, shield-star, check-circle, books,
  cooking-pot, sun, moon
- Fix mobile nav menu: add z-index:99 so menu renders above page content
- Fix mobile nav scroll-lock: add/remove document.body.overflow=hidden
  when menu opens/closes (matches homepage nav behaviour)

https://claude.ai/code/session_01VaY86RbnELdWvFyBdEMwLH
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@ashleyshaw, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 20 minutes and 28 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 8427ac4f-4ce4-48e5-97d8-9a5a33a0d9b7

📥 Commits

Reviewing files that changed from the base of the PR and between 1789915 and e021698.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • website/src/components/AwesomeGithub/AwesomeGithubNav.astro
  • website/src/components/AwesomeGithub/Icon.astro
  • website/src/lib/learn.ts
  • website/src/pages/c/[type]/index.astro
  • website/src/pages/learn/[track]/index.astro
  • website/src/pages/learn/index.astro
📝 Walkthrough

Walkthrough

This PR swaps emoji icons for Phosphor SVG icons site-wide via a new build-time Icon.astro component. The nav component gets mobile menu scroll-lock plus accessibility fixes. Eight pages are updated to use the Icon component with consistent flex-based styling. Changelog and dependency management included.

Changes

Icon System Migration

Layer / File(s) Summary
Icon System Foundation
website/package.json, website/src/components/AwesomeGithub/Icon.astro, website/src/lib/resources.ts
New Icon.astro component dynamically loads Phosphor SVG files at build time, injects size attributes, and provides fallback SVG. Dependency @phosphor-icons/core (v2.1.1) added. Resource type icon data converted from emoji to icon name identifiers.
Navigation Component & Mobile Menu A11y
website/src/components/AwesomeGithub/AwesomeGithubNav.astro
Nav imports Icon component and uses it for theme toggle light/dark icons. Mobile menu refactored with shared closeMenu() helper that centralises ARIA attribute updates, class removal, and document.body.style.overflow restoration. Menu receives explicit z-index value; theme icon styled as inline-flex.
Content & Catalogue Pages Integration
website/src/pages/getting-started.astro, website/src/pages/cookbook/[slug].astro, website/src/pages/c/[type]/index.astro
Three pages import Icon component and replace emoji-based icon markup with <Icon name={...} size={...} /> calls. CSS updated from font-size-only to flex-based layout with color: var(--accent) for consistent alignment and colouring.
Learning Track Pages Integration
website/src/pages/learn/index.astro, website/src/pages/learn/[track]/index.astro, website/src/pages/learning-hub/index.astro
Track icon metadata converted from emoji to icon name strings (e.g., compass, shield-star, gear). All three pages import Icon component and render track icons via Icon markup with fallback names and explicit sizes. Track icon CSS transitioned from font-size/line-height to flex layout with explicit text/icon colours.
Changelog
CHANGELOG.md
Documents Phosphor SVG icon system implementation and mobile menu scroll-lock fix in "Unreleased" section.

Sequence Diagram(s)

(Diagram provided in the hidden review stack artifact above.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

The PR involves moderate complexity across multiple files with consistent patterns: Icon component implementation logic, dependency management, straightforward page-level icon swaps, and CSS alignment updates. The mobile menu scroll-lock refactor adds a touch of extra logic, but the overall changes follow a repeatable pattern throughout the site.

Suggested labels

priority:normal, status:needs-review, type:feature, type:bug, area:dependencies, area:assets, lang:js, lang:css, lang:md, lang:json, meta:needs-changelog

Suggested reviewers

  • krugazul
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the two main changes: introduction of a Phosphor icon system and a mobile navigation fix, directly matching the changeset's core objectives.
Description check ✅ Passed The description comprehensively covers all required template sections: linked issues, detailed changelog with Added/Fixed entries, thorough risk assessment with Low rating and mitigation steps, clear testing instructions with prerequisites and edge cases, and a complete checklist with accessibility and security considerations addressed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/website-phosphor-icons-mobile-nav

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

✅ Template check passed after update. Thanks for fixing the PR description.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #843

CI Status:success
Files changed: 13
Risk Distribution: 0 critical, 1 high, 10 medium, 2 low

Recommendations

  • Ready to proceed pending human review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces emoji-based icons with SVG icons from the @phosphor-icons/core package across the website, introducing a reusable Icon.astro component to dynamically load and render the SVGs. It also refactors the mobile navigation menu in AwesomeGithubNav.astro to manage body overflow and centralize menu-closing logic. Feedback on these changes suggests using import.meta.resolve in Icon.astro to dynamically resolve package paths instead of hardcoding relative paths to node_modules, and moving the closeMenu helper inside the guard block in AwesomeGithubNav.astro to eliminate unsafe non-null assertions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +14 to +21
const svgUrl = new URL(
`../../../node_modules/@phosphor-icons/core/assets/${weight}/${name}.svg`,
import.meta.url,
);

let svgContent = "";
try {
const raw = readFileSync(fileURLToPath(svgUrl), "utf-8");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding the relative path ../../../node_modules to resolve packages is fragile and can break in monorepos, environments with package hoisting, or when using strict package managers like pnpm. Use import.meta.resolve to dynamically and robustly resolve the path to @phosphor-icons/core.

const svgPath = fileURLToPath(
  import.meta.resolve("@phosphor-icons/core/assets/" + weight + "/" + name + ".svg")
);

let svgContent = "";
try {
  const raw = readFileSync(svgPath, "utf-8");

Comment on lines 86 to 93
function closeMenu() {
hamburger!.setAttribute("aria-expanded", "false");
hamburger!.setAttribute("aria-label", "Open navigation menu");
menu!.classList.remove("ag-nav-menu--open");
document.body.style.overflow = "";
}

if (hamburger && menu) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Defining closeMenu outside of the if (hamburger && menu) block forces the use of non-null assertions (!), which can lead to runtime errors if the elements are not found. Moving closeMenu inside the guard block eliminates the need for non-null assertions and ensures type safety.

  if (hamburger && menu) {
    const closeMenu = () => {
      hamburger.setAttribute("aria-expanded", "false");
      hamburger.setAttribute("aria-label", "Open navigation menu");
      menu.classList.remove("ag-nav-menu--open");
      document.body.style.overflow = "";
    };

- Use import.meta.resolve() in Icon.astro instead of hardcoded
  ../../../node_modules path (robust across monorepos/hoisting)
- Move closeMenu() inside if (hamburger && menu) guard in
  AwesomeGithubNav.astro to eliminate non-null assertions
- Add CHANGELOG.md entries for Phosphor icon system and mobile nav fix

https://claude.ai/code/session_01VaY86RbnELdWvFyBdEMwLH
@ashleyshaw ashleyshaw marked this pull request as ready for review June 5, 2026 12:58
@ashleyshaw ashleyshaw requested a review from Copilot June 5, 2026 12:58
@github-actions github-actions Bot added status:needs-review Awaiting code review type:feature Feature or enhancement priority:normal Default priority area:documentation Docs & guides lang:js JavaScript/TypeScript lang:md Markdown content/docs lang:json JSON config/content type:chore Chore / small hygiene change type:bug Bug or defect meta:needs-changelog Requires a changelog entry before merge labels Jun 5, 2026
@coderabbitai coderabbitai Bot requested a review from krugazul June 5, 2026 13:01

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1789915e06

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

hamburger.setAttribute("aria-expanded", "true");
hamburger.setAttribute("aria-label", "Close navigation menu");
menu.classList.add("ag-nav-menu--open");
document.body.style.overflow = "hidden";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear scroll-lock when leaving mobile width

If a visitor opens the drawer at ≤768px and then rotates/resizes to desktop, this inline overflow: hidden remains on body while the hamburger is hidden by the media query, so the desktop page can become unscrollable until the user happens to press Escape or follows a nav link. Please add a resize/media-query cleanup path, or only apply the lock while the mobile query still matches.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot added area:dependencies Composer/npm dependency work lang:css Stylesheets (CSS/Sass/etc.) area:assets Assets (images, fonts, static files) labels Jun 5, 2026
@github-actions github-actions Bot removed type:feature Feature or enhancement type:chore Chore / small hygiene change labels Jun 5, 2026
Adds a matchMedia change listener so that if the mobile nav is open
and the viewport widens past 768 px (e.g. device rotation, browser
resize), closeMenu() fires and removes the body overflow lock,
preventing the desktop page from becoming unscrollable.

Addresses Codex P2 review comment on #843.

https://claude.ai/code/session_01VaY86RbnELdWvFyBdEMwLH
@github-actions github-actions Bot added the type:feature Feature or enhancement label Jun 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the Awesome GitHub Astro site to use Phosphor SVG icons (built-time inline SVGs) instead of emoji, and applies a couple of mobile navigation usability fixes (stacking context + scroll lock).

Changes:

  • Added a new Icon.astro component that inlines Phosphor SVG assets at build time, and updated multiple pages to use named icons.
  • Fixed mobile nav overlay behaviour by adding a z-index and locking page scroll while the menu is open.
  • Added @phosphor-icons/core as a dependency and documented the change in CHANGELOG.md.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
website/src/pages/learning-hub/index.astro Replaces track emoji with <Icon /> and updates icon wrapper styling.
website/src/pages/learn/index.astro Replaces track emoji with <Icon /> and updates icon wrapper styling.
website/src/pages/learn/[track]/index.astro Replaces track emoji with <Icon /> and adjusts hero icon styling.
website/src/pages/getting-started.astro Replaces “What next?” card emoji with <Icon /> and updates icon wrapper styling.
website/src/pages/cookbook/[slug].astro Replaces placeholder emoji with <Icon /> and updates icon wrapper styling.
website/src/pages/c/[type]/index.astro Updates resource type icons to render via <Icon />.
website/src/lib/resources.ts Switches resource type icon values from emoji to Phosphor icon names.
website/src/components/AwesomeGithub/Icon.astro New build-time SVG inliner component for Phosphor icons.
website/src/components/AwesomeGithub/AwesomeGithubNav.astro Updates theme toggle icons to SVG and adds mobile menu z-index + scroll lock.
website/package.json Adds @phosphor-icons/core dependency.
website/package-lock.json Locks @phosphor-icons/core dependency.
CHANGELOG.md Documents the icon system and mobile nav fixes.
Files not reviewed (1)
  • website/package-lock.json: Language not supported

Comment on lines +19 to +20
const raw = readFileSync(svgPath, "utf-8");
svgContent = raw.replace("<svg ", `<svg width="${size}" height="${size}" `);
Comment on lines +21 to +23
} catch {
svgContent = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="${size}" height="${size}" fill="currentColor"></svg>`;
}
Replace existing width/height attributes in the Phosphor SVG root element
instead of prepending new ones (which produced duplicate attributes and
unpredictable sizing). Also log a console.warn with the icon name when a
file cannot be resolved so typos surface during the build rather than
silently rendering an empty SVG.

Addresses Copilot review comments on #843.

https://claude.ai/code/session_01VaY86RbnELdWvFyBdEMwLH
@github-actions github-actions Bot removed the type:feature Feature or enhancement label Jun 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
website/src/pages/learn/[track]/index.astro (1)

17-22: ⚡ Quick win

Consider extracting shared trackIcons mapping to avoid duplication.

The trackIcons object is identical to the one in learn/index.astro (lines 9-14). If these mappings need to stay in sync, consider extracting them to a shared constant in lib/learn.ts.

♻️ Suggested refactor

In website/src/lib/learn.ts:

export const TRACK_ICONS: Record<string, string> = {
  oriented: "compass",
  governance: "shield-star",
  quality: "check-circle",
  agents: "robot",
};

Then import in both files:

+import { LEARN_TRACKS, getTrack, TRACK_ICONS } from "../../../lib/learn";
-const trackIcons: Record<string, string> = {
-  oriented: "compass",
-  governance: "shield-star",
-  quality: "check-circle",
-  agents: "robot",
-};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@website/src/pages/learn/`[track]/index.astro around lines 17 - 22, Extract
the duplicated trackIcons mapping into a shared exported constant (e.g.,
TRACK_ICONS) in lib/learn.ts and replace the local const trackIcons in
website/src/pages/learn/[track]/index.astro (and the other file that has the
same mapping) with an import of that constant; update any references to use the
imported TRACK_ICONS to keep mappings in one place and avoid drift between
files.
website/src/pages/c/[type]/index.astro (1)

338-340: 💤 Low value

Consider updating .ag-type-icon styling for consistency.

The other icon containers in this PR migration (.gs-next-icon, .recipe-placeholder-icon, etc.) were updated to use display: flex with explicit colour, but .ag-type-icon retains the old font-size: 32px approach. Since it now renders SVG via the Icon component, consider switching to flex layout for visual consistency.

♻️ Suggested styling update
  .ag-type-icon {
-   font-size: 32px;
+   display: flex;
+   color: var(--accent);
  }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@website/src/pages/c/`[type]/index.astro around lines 338 - 340, The
.ag-type-icon CSS still uses font-size: 32px but now renders an SVG via the Icon
component; change its styling to match the other migrated icon containers by
replacing the font-size rule with a flex-based layout and explicit color
handling (e.g., use display: flex; align-items: center; justify-content: center;
width/height or padding to control size, and set color or fill as appropriate)
so that .ag-type-icon behaves like .gs-next-icon and .recipe-placeholder-icon
and the SVG Icon inherits the intended color and sizing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Around line 34-35: The changelog entry for "Awesome GitHub Site: Mobile Nav
Menu" currently only includes the PR link ([`#843`]) and is missing the required
issue link; update the [Unreleased] entry in CHANGELOG.md for that item (the
line containing "Awesome GitHub Site: Mobile Nav Menu" and PR `#843`) to include
the corresponding issue reference (e.g., add "and issue [`#XXX`](...)" or append "
([`#XXX`](...))" next to the PR link) so the entry contains both a PR link and an
issue link following the repository's Keep a Changelog format.
- Around line 30-31: Update the CHANGELOG.md Unreleased entry that currently
references PR [`#843`] by adding the corresponding issue link (replace `#XXX` with
the actual issue number) so the line includes both PR and issue links (e.g.,
"([`#843`](...) ; [`#XXX`](...))"); then reflow/wrap the long bullet for the
Icon.astro/Phosphor change into multiple shorter lines under ~120 characters at
natural sentence boundaries while preserving the exact descriptive text and the
PR/issue metadata format.

In `@website/src/components/AwesomeGithub/AwesomeGithubNav.astro`:
- Around line 87-103: The mobile menu can leave document.body.style.overflow set
to "hidden" after a mobile→desktop resize because the hamburger is hidden and
can't be toggled; update the menu logic to (1) save and restore the previous
document.body.style.overflow value when opening/closing (modify closeMenu and
the click handler that sets overflow to "hidden") and (2) add a
resize/breakpoint handler that detects crossing the mobile breakpoint (e.g.,
window.innerWidth >= 768) and force-closes the menu by calling closeMenu(),
removing the ag-nav-menu--open class, and updating hamburger
aria-expanded/aria-label accordingly to ensure the overflow is always restored.

---

Nitpick comments:
In `@website/src/pages/c/`[type]/index.astro:
- Around line 338-340: The .ag-type-icon CSS still uses font-size: 32px but now
renders an SVG via the Icon component; change its styling to match the other
migrated icon containers by replacing the font-size rule with a flex-based
layout and explicit color handling (e.g., use display: flex; align-items:
center; justify-content: center; width/height or padding to control size, and
set color or fill as appropriate) so that .ag-type-icon behaves like
.gs-next-icon and .recipe-placeholder-icon and the SVG Icon inherits the
intended color and sizing.

In `@website/src/pages/learn/`[track]/index.astro:
- Around line 17-22: Extract the duplicated trackIcons mapping into a shared
exported constant (e.g., TRACK_ICONS) in lib/learn.ts and replace the local
const trackIcons in website/src/pages/learn/[track]/index.astro (and the other
file that has the same mapping) with an import of that constant; update any
references to use the imported TRACK_ICONS to keep mappings in one place and
avoid drift between files.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 2330b256-2a10-4e4e-8a1f-39dbafbd21e7

📥 Commits

Reviewing files that changed from the base of the PR and between bddb898 and 1789915.

⛔ Files ignored due to path filters (1)
  • website/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (11)
  • CHANGELOG.md
  • website/package.json
  • website/src/components/AwesomeGithub/AwesomeGithubNav.astro
  • website/src/components/AwesomeGithub/Icon.astro
  • website/src/lib/resources.ts
  • website/src/pages/c/[type]/index.astro
  • website/src/pages/cookbook/[slug].astro
  • website/src/pages/getting-started.astro
  • website/src/pages/learn/[track]/index.astro
  • website/src/pages/learn/index.astro
  • website/src/pages/learning-hub/index.astro
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: copilot-pull-request-reviewer
  • GitHub Check: coderabbit-gate
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{php,js,jsx,ts,tsx,css,scss,html}

📄 CodeRabbit inference engine (AGENTS.md)

Follow WordPress Coding Standards (CSS, HTML, JavaScript, PHP) and inline-documentation standards at all times

Files:

  • website/src/lib/resources.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{js,ts,jsx,tsx}: Follow ESLint/Prettier standards for JavaScript and TypeScript files
Avoid unnecessary JavaScript, defer/lazy-load where possible, and prefer native blocks

Files:

  • website/src/lib/resources.ts
**/*.{js,ts}

⚙️ CodeRabbit configuration file

**/*.{js,ts}: Review JavaScript/TypeScript:

  • Ensure code is linted and follows project style guides.
  • Check for dead code, unused variables, and clear function naming.
  • Validate accessibility and performance optimisations.
  • Ensure tests are isolated and do not depend on external state.
  • Check for descriptive test names and clear test structure.

Files:

  • website/src/lib/resources.ts
**/*.md

📄 CodeRabbit inference engine (.github/instructions/markdown.instructions.md)

**/*.md: Use one H1 (#) per file; keep heading levels sequential (never skip from H2 to H4)
Use fenced code blocks with explicit language tags (bash, yaml, markdown, etc.)
Keep links relative for in-repo files; verify they resolve before merging
Use 1. for ordered lists and - for unordered lists
Keep all wording in UK English (optimise, organisation, colour, behaviour, analyse)
Do not add a references: frontmatter field — use inline links or a footer section instead
Blank lines before and after headings, code blocks, and block-level elements
Maximum line length: 120 characters (soft limit; prefer wrapping at natural sentence boundaries)
All .md files in this repository should include YAML frontmatter with required fields: file_type, title, description, version, last_updated, owners, tags, status, stability, domain
Every image (![]()) must have descriptive alt text explaining the image's purpose, not its appearance. Empty alt (![ ]()) is valid only for purely decorative images
Link text must describe the destination — never use 'click here', 'read more', or bare URLs as visible text
Every table must have a header row (| Header |). Avoid merged cells
Use headings to communicate document structure, not for visual styling
Do not rely on colour alone to convey information in diagrams or callout blocks
Mermaid diagrams must include accTitle and accDescr attributes for accessibility
Specify language in frontmatter; use plain language, avoid jargon where possible

Files:

  • CHANGELOG.md
CHANGELOG.md

⚙️ CodeRabbit configuration file

CHANGELOG.md: Review CHANGELOG.md:

  • Confirm entries follow Keep a Changelog 1.1.0 format.
  • Each entry under [Unreleased] must include a PR link and issue link.
  • Verify entries use the correct section headings (Added, Changed, Fixed, Deprecated, Removed, Security, Documentation, Performance).
  • Check UK English spelling throughout.

Files:

  • CHANGELOG.md
**/package.json

⚙️ CodeRabbit configuration file

**/package.json: Review package.json:

  • Check for security vulnerabilities and outdated packages.
  • Ensure scripts are documented with clear, descriptive names.
  • Validate semantic versioning and proper version pinning.
  • Confirm devDependencies vs dependencies separation.
  • Ensure scripts follow org standards (lint, test, build, format).

Files:

  • website/package.json
🔇 Additional comments (13)
website/package.json (1)

24-24: LGTM!

website/src/components/AwesomeGithub/Icon.astro (1)

1-40: LGTM!

website/src/lib/resources.ts (1)

50-57: LGTM!

website/src/components/AwesomeGithub/AwesomeGithubNav.astro (1)

64-66: LGTM!

Also applies to: 258-261, 329-329

website/src/pages/getting-started.astro (2)

345-347: LGTM!


112-127: Phosphor icon assets: re-check the lookup path (looks like node_modules isn’t present here).

The script run against node_modules/@phosphor-icons/core/assets/regular/*.svg reported all four icons (robot, books, cooking-pot, book-open) as missing—but that’s a property of the environment’s filesystem layout rather than (necessarily) icon-name correctness. In this repo snapshot, the node_modules-based assets path may not exist, so “NOT FOUND” doesn’t reliably indicate misspellings.

Please adjust verification to locate the actual installed Phosphor asset directory (or confirm Icon maps these names to existing glyphs during the build).

website/src/pages/cookbook/[slug].astro (1)

51-51: LGTM!

Also applies to: 178-178

website/src/pages/learning-hub/index.astro (2)

283-285: LGTM!


12-12: Re-check Phosphor regular icon assets for Learning Hub slugs (gear, shield-star, check-circle, robot).
The provided file-based script reports all four SVGs as missing (✗ ... NOT FOUND), but that check depends on node_modules/... being present in the environment; re-run after installing dependencies to ensure website/src/pages/learning-hub/index.astro (lines 12/35/65/95) actually resolves to real @phosphor-icons/core/assets/regular/{name}.svg files.

website/src/pages/learn/index.astro (2)

169-171: LGTM!


10-13: Looks good: all Learn track icon names exist in Phosphor “regular” (incl. fallback)

website/src/components/AwesomeGithub/Icon.astro defaults to weight="regular", so the Learn page’s compass, shield-star, check-circle, robot, and fallback book-open all correctly map to existing files under @phosphor-icons/core/assets/regular/*.svg — no icon-name surprises.

Also applies to: 44-44

website/src/pages/learn/[track]/index.astro (1)

150-150: Note: Icon colour differs from other pages.

This page uses color: var(--c-light-blue) for the track icon, whilst most other migrated icon containers use color: var(--accent). This may be intentional for design consistency with the hero gradient, but worth confirming.

website/src/pages/c/[type]/index.astro (1)

53-53: ✅ Resource type icons are already valid Phosphor icon names (no emoji hiding in resources.ts).

  • website/src/lib/resources.ts defines icon as: robot, book-open, chat-text, sparkle, shield-check, gear, puzzle-piece, wrench.
  • No non-ASCII/emoji-like characters were found in those icon values, and the names match Phosphor’s icon catalogue—so currentType.icon should render correctly.

Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread website/src/components/AwesomeGithub/AwesomeGithubNav.astro
…con CSS

Extract the duplicated trackIcons mapping from learn/index.astro and
learn/[track]/index.astro into a shared TRACK_ICONS constant in lib/learn.ts
so both pages stay in sync from a single source of truth.

Also update .ag-type-icon CSS from font-size: 32px to display: flex +
color: var(--accent), consistent with all other migrated icon containers
in this PR.

Addresses CodeRabbit review comments on #843.

https://claude.ai/code/session_01VaY86RbnELdWvFyBdEMwLH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:assets Assets (images, fonts, static files) area:dependencies Composer/npm dependency work area:documentation Docs & guides lang:css Stylesheets (CSS/Sass/etc.) lang:js JavaScript/TypeScript lang:json JSON config/content lang:md Markdown content/docs meta:needs-changelog Requires a changelog entry before merge priority:normal Default priority status:needs-review Awaiting code review type:bug Bug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants