-
Notifications
You must be signed in to change notification settings - Fork 52
Move Warehouse Native to top navigation bar #2896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-Authored-By: tore@statsig.com <tore@statsig.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
…tch interception Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-Authored-By: tore@statsig.com <tore@statsig.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
…thub.com/statsig-io/docs into devin/1744934342-warehouse-native-topbar
function getCurrentSection() { | ||
const currentPageLink = document.querySelector('nav a[aria-current="page"]').id || "docs"; | ||
console.log('[Statsig Search] Current section:', currentPageLink); | ||
return currentPageLink; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getCurrentSection()
function may throw an error on pages where no element with aria-current="page"
exists (such as 404 pages). Consider using optional chaining to safely access the id
property:
const currentPageLink = document.querySelector('nav a[aria-current="page"]')?.id || "docs";
This ensures the function gracefully handles cases where the selector doesn't match any elements.
function getCurrentSection() { | |
const currentPageLink = document.querySelector('nav a[aria-current="page"]').id || "docs"; | |
console.log('[Statsig Search] Current section:', currentPageLink); | |
return currentPageLink; | |
} | |
function getCurrentSection() { | |
const currentPageLink = document.querySelector('nav a[aria-current="page"]')?.id || "docs"; | |
console.log('[Statsig Search] Current section:', currentPageLink); | |
return currentPageLink; | |
} |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
…thub.com/statsig-io/docs into devin/1744934342-warehouse-native-topbar
Move Warehouse Native to top navigation bar and implement dynamic search filtering
This PR:
Dynamic Search Filtering
Added a custom JavaScript solution to dynamically scope Algolia search results based on the active navigation section:
The implementation:
Cross-section links
The following links from Warehouse Native docs point to sections outside of Warehouse Native:
Testing
Link to Devin run: https://app.devin.ai/sessions/9d8c8e8e999947b0b292f4ecad6a956f
Requested by: tore@statsig.com