Repository navigation
Redesign the first-run onboarding wizard (simple + advanced, host-derived name) - #67
Merged
Merged
Conversation
Lead with the url and show a simple three-field screen (url / name / token); the niche knobs (token_env, auth_scheme, verify_tls) tuck behind a Ctrl+A "advanced" toggle. Tab walks only the visible fields, so a hidden token_env is skipped; collapsing the advanced section pulls focus back if it sat on a now- hidden field. The profile name is no longer hardcoded to `default`. It's derived from the url host (netbox.acme.com -> acme; a leading www./netbox. label is dropped; an IP or empty host falls back to prod), shown live as a placeholder and committed on save only if the user left it blank. This stops onboarding from planting a stray `default` profile that duplicates one the user adds later on the CLI. The wizard now renders its fields individually (it reorders/hides them), so add small TextInput::render_value / set_placeholder and FormInput::set_focus helpers in cheese.rs; the shared add/edit form (config editor) is untouched. Covered by unit tests (name derivation, advanced toggle, focus-skip, blank-name fill + revert-on-failure) and TestBackend render smoke tests for both modes.
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.
What
Redesigns the first-run onboarding wizard to the "simple + advanced collapsed" shape, and fixes the root cause of the duplicate-profile gotcha from #66: the wizard hardcoded the profile name to
default, so a user who onboarded in the TUI and thennbox profile added a real profile ended up with two.The wizard now
Press Ctrl+A to reveal
token_env/auth_scheme/verify_tls.Ctrl+A.https://netbox.acme.com→acme(a leadingwww./netbox.label is dropped; an IP or empty host falls back toprod). Shown live as a placeholder, committed on save only if you left it blank — so no more straydefaultprofile. Type your own name and it's kept verbatim.token_envis skipped); collapsing pulls focus back off a now-hidden field.How
The wizard renders its fields individually now (it reorders and hides them), so this adds three small helpers in
cheese.rs—TextInput::render_value/TextInput::set_placeholder/FormInput::set_focus. The shared add/editProfileFormused by the config editor is untouched — all the new behavior lives inonboarding.rs.Tests
suggest_name_from_url): host-label strip + IP/empty →prod.Ctrl+Atoggles the visible field set; Tab skips the hiddentoken_env; collapsing re-anchors focus.TestBackendrender smoke tests for both simple and advanced modes (assert content + no panic).Gate
cargo fmt --check,clippy --all-targets --all-features -D warnings,clippy --no-default-features, andcargo testin both feature modes — all green. Visual confirmed via aTestBackendframe dump.