Skip to content

[Site] Increase depth of in-page table of contents on LFX programs page - #7901

Open
Sathwik-parimi-07 wants to merge 4 commits into
layer5io:masterfrom
Sathwik-parimi-07:fix/lfx-toc-depth
Open

[Site] Increase depth of in-page table of contents on LFX programs page#7901
Sathwik-parimi-07 wants to merge 4 commits into
layer5io:masterfrom
Sathwik-parimi-07:fix/lfx-toc-depth

Conversation

@Sathwik-parimi-07

@Sathwik-parimi-07 Sathwik-parimi-07 commented Jul 28, 2026

Copy link
Copy Markdown

Description

This PR increases the depth of the "On this page" navigation card on the LFX programs page,

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Summary by CodeRabbit

  • New Features

    • Added nested navigation for the Spring and Summer project sections, with direct links to individual subsections.
  • Improvements

    • Enhanced navigation accessibility by marking both active parent and active child links with the correct aria-current state.
  • Documentation

    • Updated project subsection headings to support stable direct linking through explicit URL anchors.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

LFX 2026 project subsections now expose explicit anchors. LfxPageNav renders nested Spring and Summer child links, initializes active state on mount, tracks active sections while scrolling, and marks active links with aria-current="location".

Changes

LFX nested project navigation

Layer / File(s) Summary
Section anchors and navigation data
src/collections/programs/lfx-2026/lfx-2026.mdx
Spring and Summer subsection headings now use explicit id attributes, and navigation entries include corresponding nested child links.
Nested navigation behavior
src/collections/programs/lfx-2026/LfxPageNav.js
Nested links receive indented styling, active-section detection includes children, active state initializes on mount, and active parent and child links receive aria-current="location".

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant LfxPageNav
  participant Lfx2026Document
  Browser->>LfxPageNav: Scroll event
  LfxPageNav->>Lfx2026Document: Check section offsets
  Lfx2026Document-->>LfxPageNav: Active section position
  LfxPageNav-->>Browser: Update active parent and child links
Loading

Possibly related PRs

  • layer5io/layer5#7922: It extends the same LFX page navigation flow and changes the same page-level navigation surface.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: increasing the depth of the in-page table of contents on the LFX programs page by adding nested project-level navigation links.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: dependency version conflict. Check your lock file or package.json.


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.

@Sathwik-parimi-07
Sathwik-parimi-07 marked this pull request as ready for review July 28, 2026 21:26
@Sathwik-parimi-07

Copy link
Copy Markdown
Author

Hii @KhushamBansal, Could you please review it?

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 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 `@src/collections/programs/lfx-2026/LfxPageNav.js`:
- Around line 101-102: Update the effect that registers the scroll handler in
LfxPageNav so it invokes the handler once immediately after registration,
initializing the active navigation state on mount while preserving subsequent
scroll updates.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e73f546d-f9f2-4372-997d-ce849b952cd9

📥 Commits

Reviewing files that changed from the base of the PR and between c443dee and def6f51.

📒 Files selected for processing (2)
  • src/collections/programs/lfx-2026/LfxPageNav.js
  • src/collections/programs/lfx-2026/lfx-2026.mdx

Comment thread src/collections/programs/lfx-2026/LfxPageNav.js Outdated

@KhushamBansal KhushamBansal 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.

@Sathwik-parimi-07 Could you please add before and after screenshots to the PR description and also address coderabbit's feedback?

const [showTop, setShowTop] = useState(false);
const [activeHref, setActiveHref] = useState("");

useEffect(() => {

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.

Hi @Sathwik-parimi-07, thanks for the PR! 🙌

One small fix: window.addEventListener("scroll", onScroll) is currently inside the flatItems.forEach loop, so it registers multiple listeners and causes scroll lag. Please move it outside the loop and call onScroll() once on mount to set the initial state.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks @AnkitRewar11, one small clarification that window.addEventListener("scroll", onScroll) is already written outside the loop items.forEach I think the hunk boundary makes it look nested. your point below about the initial state is spot on, working on it. once ill check everything on local and commit again

setActiveHref(current);
};
window.addEventListener("scroll", onScroll);
return () => window.removeEventListener("scroll", onScroll);

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.

one more small improvement. The active sidebar link is not highlighted until the user scrolls when the page with a hash URL is opened or the page is refreshed. After the scroll listener is registered, call onScroll() once so that the correct link is highlighted when the page loads.

@AnkitRewar11

Copy link
Copy Markdown
Contributor

Also, please add before & after screenshots to the PR description, as @KhushamBansal requested.

@Sathwik-parimi-07

Copy link
Copy Markdown
Author

Okk thanks @AnkitRewar11, I'm working on it. will update the PR soon

Signed-off-by: Sathwik_parimi <sathwikparimi777@gmail.com>
Signed-off-by: Sathwik_parimi <sathwikparimi777@gmail.com>

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/collections/programs/lfx-2026/LfxPageNav.js (1)

125-144: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Expose the active section to assistive technologies.

The current location is communicated only visually through className="active". Add aria-current="location" to the active parent and child links.

Suggested fix
<a
  href={item.href}
  className={activeHref === item.href ? "active" : ""}
+ aria-current={activeHref === item.href ? "location" : undefined}
>
...
<a
  href={child.href}
  className={activeHref === child.href ? "active" : ""}
+ aria-current={activeHref === child.href ? "location" : undefined}
>

As per coding guidelines, JSX changes must meet WCAG 2.1 Level AA accessibility requirements.

🤖 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 `@src/collections/programs/lfx-2026/LfxPageNav.js` around lines 125 - 144, Add
aria-current="location" to the parent and child link elements in LfxPageNav,
setting it only when each link matches activeHref and leaving it unset for
inactive links. Preserve the existing active class behavior.

Source: Coding guidelines

🧹 Nitpick comments (1)
src/collections/programs/lfx-2026/LfxPageNav.js (1)

101-105: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Throttle the scroll-driven navigation scan.

This now rebuilds and scans every parent and child item synchronously for every scroll event. Use a passive listener with requestAnimationFrame or throttling, and cancel any pending frame during cleanup.

As per coding guidelines, expensive event handlers must be debounced or throttled.

🤖 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 `@src/collections/programs/lfx-2026/LfxPageNav.js` around lines 101 - 105,
Throttle the scroll handler around the flatItems scan so it does not rebuild and
iterate synchronously on every scroll event. Register the listener as passive,
schedule the navigation work through requestAnimationFrame (or the existing
throttle utility), and cancel any pending frame during the effect/component
cleanup while preserving the current scan behavior.

Source: Coding guidelines

🤖 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.

Outside diff comments:
In `@src/collections/programs/lfx-2026/LfxPageNav.js`:
- Around line 125-144: Add aria-current="location" to the parent and child link
elements in LfxPageNav, setting it only when each link matches activeHref and
leaving it unset for inactive links. Preserve the existing active class
behavior.

---

Nitpick comments:
In `@src/collections/programs/lfx-2026/LfxPageNav.js`:
- Around line 101-105: Throttle the scroll handler around the flatItems scan so
it does not rebuild and iterate synchronously on every scroll event. Register
the listener as passive, schedule the navigation work through
requestAnimationFrame (or the existing throttle utility), and cancel any pending
frame during the effect/component cleanup while preserving the current scan
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d4155128-0ce0-45eb-93ec-9801eda6078a

📥 Commits

Reviewing files that changed from the base of the PR and between def6f51 and 4357e3a.

📒 Files selected for processing (1)
  • src/collections/programs/lfx-2026/LfxPageNav.js

@Sathwik-parimi-07

Copy link
Copy Markdown
Author

Before this PR:

Screenshot 2026-07-31 013934

After this PR:

Screenshot 2026-07-31 013916

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 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 `@src/collections/programs/lfx-2026/LfxPageNav.js`:
- Around line 125-140: Update the parent and child anchors rendered by
LfxPageNav to set aria-current="location" when activeHref matches the anchor’s
href, and omit the attribute otherwise. Keep the existing active class behavior
unchanged for both navigation levels.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: be85f860-ee9b-4f3c-aff5-9bb3b69e7672

📥 Commits

Reviewing files that changed from the base of the PR and between 4357e3a and ddd459a.

📒 Files selected for processing (2)
  • src/collections/programs/lfx-2026/LfxPageNav.js
  • src/collections/programs/lfx-2026/lfx-2026.mdx

Comment thread src/collections/programs/lfx-2026/LfxPageNav.js
Signed-off-by: Sathwik_parimi <sathwikparimi777@gmail.com>
@Sathwik-parimi-07

Copy link
Copy Markdown
Author

Hii @KhushamBansal, @AnkitRewar11

I've addressed coderabbit's review and Added Before and After screenshots. Please review it
Thank you :)

@coderabbitai coderabbitai Bot mentioned this pull request Aug 4, 2026
7 tasks

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/collections/programs/lfx-2026/lfx-2026.mdx (1)

281-281: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Tighten the documentation wording.

Use “to generate” at Line 281 and “cloud-native infrastructure” at Line 307.

Proposed wording fix
-... needs in order to generate a design Meshery will accept, ...
+... needs to generate a design Meshery will accept, ...

-Meshery manages cloud and cloud native infrastructure through Designs, ...
+Meshery manages cloud and cloud-native infrastructure through Designs, ...

As per coding guidelines, MDX content must use clear, professional American English.

Also applies to: 307-307

🤖 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 `@src/collections/programs/lfx-2026/lfx-2026.mdx` at line 281, Update the
documentation wording at the referenced passages: use “to generate” in the
sentence describing the knowledge needed by a language model, and replace the
corresponding wording at the later passage with “cloud-native infrastructure.”
Preserve the surrounding meaning and use clear professional American English.

Sources: Coding guidelines, Linters/SAST tools

🤖 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.

Outside diff comments:
In `@src/collections/programs/lfx-2026/lfx-2026.mdx`:
- Line 281: Update the documentation wording at the referenced passages: use “to
generate” in the sentence describing the knowledge needed by a language model,
and replace the corresponding wording at the later passage with “cloud-native
infrastructure.” Preserve the surrounding meaning and use clear professional
American English.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ba8687bc-405a-4324-bc0a-2ccbf7061ca2

📥 Commits

Reviewing files that changed from the base of the PR and between 52a347e and 584e704.

📒 Files selected for processing (1)
  • src/collections/programs/lfx-2026/lfx-2026.mdx

`;

const SubNavList = styled.ul`
list-style: none !important;

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.

Could we avoid using !important here? It makes styles harder to override and maintain.

padding-left: 0.85rem;
border-left: 1px solid ${(props) => props.theme.grey1D1817ToGreyE6E6E6};
li {
list-style: none !important;

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.

Same here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants