Conversation
📝 WalkthroughWalkthroughReplaced a local book image import with a hardcoded S3 URL and added eager loading in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/LeftNav.jsx`:
- 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.
🪄 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
Run ID: 20c60a49-0aac-425a-8ed8-6a2bbedb09f1
📒 Files selected for processing (2)
src/components/LeftNav.jsxtailwind.config.js
| <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' /> |
There was a problem hiding this comment.
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.
| <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.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@gatsby-config.js`:
- Line 25: The allowList array in the gatsby-plugin-env-variables configuration
currently includes the admin key string 'TYPESENSE_API_KEY' which exposes the
server-side admin key to the frontend; remove 'TYPESENSE_API_KEY' from the
allowList (leaving 'TYPESENSE_SEARCH_API_KEY' plus
host/port/protocol/collection) so only the search key and non-sensitive vars are
exposed via the allowList in the plugin configuration.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| { | ||
| resolve: 'gatsby-plugin-env-variables', | ||
| options: { | ||
| allowList: ['TYPESENSE_HOST', 'TYPESENSE_PORT', 'TYPESENSE_PROTOCOL', 'TYPESENSE_API_KEY', "TYPESENSE_SEARCH_API_KEY", "TYPESENSE_COLLECTION"], |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify whether TYPESENSE_API_KEY is actually consumed anywhere besides gatsby-config.js.
# Expected: client code should only reference TYPESENSE_SEARCH_API_KEY.
rg -n -C2 'TYPESENSE_API_KEY|TYPESENSE_SEARCH_API_KEY|TYPESENSE_COLLECTION|TYPESENSE_HOST|TYPESENSE_PORT|TYPESENSE_PROTOCOL'Repository: testsigmahq/testsigma-tutorials
Length of output: 3835
Remove TYPESENSE_API_KEY from the client allow-list.
The client-side code in src/components/SearchInputBox.jsx only consumes TYPESENSE_SEARCH_API_KEY (plus host/port/protocol/collection). The gatsby-plugin-env-variables plugin exposes every allowList entry to the frontend bundle, making them visible to client-side scripts. TYPESENSE_API_KEY is the admin key used by scripts/indexr.js (a server-side build script) and should never be exposed to the browser.
Suggested change
- allowList: ['TYPESENSE_HOST', 'TYPESENSE_PORT', 'TYPESENSE_PROTOCOL', 'TYPESENSE_API_KEY', "TYPESENSE_SEARCH_API_KEY", "TYPESENSE_COLLECTION"],
+ allowList: ['TYPESENSE_HOST', 'TYPESENSE_PORT', 'TYPESENSE_PROTOCOL', 'TYPESENSE_SEARCH_API_KEY', 'TYPESENSE_COLLECTION'],📝 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.
| allowList: ['TYPESENSE_HOST', 'TYPESENSE_PORT', 'TYPESENSE_PROTOCOL', 'TYPESENSE_API_KEY', "TYPESENSE_SEARCH_API_KEY", "TYPESENSE_COLLECTION"], | |
| allowList: ['TYPESENSE_HOST', 'TYPESENSE_PORT', 'TYPESENSE_PROTOCOL', 'TYPESENSE_SEARCH_API_KEY', 'TYPESENSE_COLLECTION'], |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@gatsby-config.js` at line 25, The allowList array in the
gatsby-plugin-env-variables configuration currently includes the admin key
string 'TYPESENSE_API_KEY' which exposes the server-side admin key to the
frontend; remove 'TYPESENSE_API_KEY' from the allowList (leaving
'TYPESENSE_SEARCH_API_KEY' plus host/port/protocol/collection) so only the
search key and non-sensitive vars are exposed via the allowList in the plugin
configuration.
Summary by CodeRabbit
Bug Fixes
Chores