feat(tour): add NBI_TOUR_DISABLED to stop the first-run tour from opening - #495
Merged
Merged
Conversation
…ning The tour could only be silenced by writing an override file that disabled every step id, which breaks whenever a step is added. Add a real switch: the NBI_TOUR_DISABLED env var (or tour_disabled traitlet, env wins) is published in the capabilities response and the sidebar skips its first-run auto-show. The "Show NBI tour" command still replays the tour on demand. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
A cosmetic switch should not be able to stop the extension from loading, so an unrecognized NBI_TOUR_DISABLED value now warns and falls back to the tour_disabled traitlet instead of raising. The strict resolver stays in place for the security gates. Add tests that _setup_handlers publishes the resolved value, that the capabilities response carries it, and that the lenient fallback warns, and document that the switch does not mark the tour completed. Co-Authored-By: Claude Sonnet 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.
Summary
Adds
NBI_TOUR_DISABLEDso a deployment can turn the first-run tour off without maintaining an override file.Closes #494
Problem
The tour had no on/off switch.
NBI_TOUR_CONFIG_PATHonly points at an override file whose schema can drop individual steps, so suppressing the tour meant a file withenabled: falsefor every step id. That breaks silently when a release adds a step.Solution
NBI_TOUR_DISABLED=1(env) orNotebookIntelligence.tour_disabled(traitlet). The env var wins.tour_disabledin the capabilities response and the sidebar skips its first-run auto-show when it is set. The decision lives in a smallshouldAutoShowTourhelper so it is unit-testable._resolve_bool_with_envfails loudly on purpose for security gates, but this is a cosmetic switch, so a typo must not stop the extension from loading. The strict resolver is unchanged.The switch does not mark the tour completed, so removing it later shows the tour again to users who never finished it. This is documented in
docs/admin-tour-config.md, and the new settings are in thedocs/admin-guide.mdtable.Testing
tests/test_tour_disabled.py: env vs traitlet precedence, the typo fallback and its warning, that_setup_handlerspublishes the resolved value, and that the capabilities response carriestour_disabled. Removing either the response line or the wiring makes these fail. The_setup_handlerstest restores the class state it touches so it cannot leak into other tests (an earlier version opened a security gate another test expects closed).tests/ts/tour-state.test.ts:shouldAutoShowTouron first run, after completion, and when disabled.tour_disabledfalse when unset or0, and true withNBI_TOUR_DISABLED=1. With an invalid value the extension previously failed to load; it now falls back.pytest tests/(2233 passed),jlpm jest(579 passed),jlpm tsc --noEmitandjlpm lint:checkare clean.Not checked in a browser: that the tour stays closed on a fresh profile with the switch on. The logic is covered by unit tests and the capabilities check above.
🤖 Generated with Claude Code