feat: hide LA promo banner on authentication screens - #3558
Open
dcschreiber wants to merge 5 commits into
Open
Conversation
The Library Assistant opens automatically after login/registration, so promoting it on the auth screens is redundant. The banner gate now excludes /login and /register (tolerating trailing slashes and query strings) via an SSR-safe path check. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dcschreiber
marked this pull request as ready for review
July 29, 2026 15:32
📊 Code Quality Score: 7/100
Was this score accurate? 👍 Yes · 👎 No Scored by GitVelocity · How are scores calculated? |
getModuleURL returns false when it cannot construct a URL, and during server-side rendering apiHost is empty, so new URL(path, false) would throw inside the component render and crash SSR for the page. Fall back to a static base (only the pathname is used) and fail open on unparseable input. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Claude and Codex writing on Daniel's behalf)
What
Hides the Library Assistant promo banner (
ChatbotExperimentBanner) on authentication and password-recovery screens:/login/register/password/reset/...route familyShortcut story: https://app.shortcut.com/sefaria/story/46176
Why
These screens should remain focused on authentication or account recovery. The Library Assistant already opens automatically after successful login or registration, so promoting it there is redundant.
How
The banner keeps a small, product-specific path policy local to
SiteWideBanner.jsx. It gets the path from the existing SSR-safeSefaria.util.currentPath(), resolves it with the nativeURLparser againstSefaria.getModuleURL()(the configured active-module/interface-language domain), and checks one array of excluded route roots with a segment boundary. This covers the password-reset family while leaving unrelated paths such as/password/resettingeligible.There is no existing reusable frontend auth-path classifier. The broader
headerModeabstraction was deliberately not used because it also covers ordinary static/about pages where sitewide banners remain valid.How tested
Focused Jest coverage verifies:
npx jest static/js/tests/siteWideBanner.test.js --runInBand --no-watchman --roots static/js __mocks__passes: 23 tests.