Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/components/LeftNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import { useStaticQuery, graphql, Link } from 'gatsby';
import React from 'react';
import './LeftNav.scss';
import book from './images/book.png';


const { v4: uuidv4 } = require('uuid');
Expand Down Expand Up @@ -86,7 +85,7 @@ class ListItem extends React.Component {
return ( url.indexOf("/overview/") === -1 &&
<li key={`${data.leftNavTitle || title}-${uuidv4()}`} className={`child${this.inUrl(url) ? ' currentUrl text_green' : ''}`}>
<div className="activeIndicator" />
<img src={book} alt="book"/>
<img src='https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/book.png' loading='eager' alt='book' />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid eager-loading nav icons.

Line 88 sets loading='eager' for each child-row icon; this can over-prioritize non-critical images. Prefer lazy loading here.

Suggested change
-                <img src='https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/book.png' loading='eager' alt='book' />
+                <img src='https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/book.png' loading='lazy' decoding='async' alt='book' />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<img src='https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/book.png' loading='eager' alt='book' />
<img src='https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/Updated_Doc_Images/book.png' loading='lazy' decoding='async' alt='book' />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/LeftNav.jsx` at line 88, The nav icon image in LeftNav.jsx is
set to loading='eager', which over-prioritizes non-critical images; update the
<img> in the LeftNav component (the child-row/book icon) to use lazy loading by
removing or replacing loading='eager' with loading='lazy' so icons are deferred
until needed.

<Link to={url}>{data.leftNavTitle || title}</Link>
</li>
);
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
purge: [],
purge: ['./src/**/*.{js,jsx,ts,tsx,md}'],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {
Expand Down
Loading