pub struct OnboardingWizard { /* private fields */ }Implementations§
Source§impl OnboardingWizard
impl OnboardingWizard
Sourcepub fn new() -> Self
pub fn new() -> Self
Standard constructor — /welcome with empty body. The historic
3-step (Intro → Language → Setup) flow stays here intact for
/welcome re-runs; first-launch onboarding now goes through
Self::new_qr_fast_path instead.
Sourcepub fn new_with_confirm() -> Self
pub fn new_with_confirm() -> Self
Constructor for /welcome mid-session when body is non-empty.
Wizard opens at the synthetic Confirm step; user must press y
before any clear or further drawing happens.
Sourcepub fn new_qr_fast_path() -> Self
pub fn new_qr_fast_path() -> Self
First-launch fast path. Skips the old 3-step Intro / Language /
Setup flow and goes straight to a single QR screen for the
AtomGit OAuth short link — scan, log in, the background poll
thread auto-closes the modal and hands off to /codingplan
for the claim. Language defaults to auto-detect from $LC_ALL
/ $LANG (i18n step gone); user can switch later via
/language.
Synchronously calls atomcode_core::auth::oauth::start_login
up front so the QR is paintable the moment the modal opens.
On network failure the error is stashed on the wizard and
rendered in place of the QR — Esc bails, Enter retries via
handle_key_pure’s RetryQrLogin outcome.
The successful LoginSession is held on pending_session so
the event loop can pull it out (see take_pending_session)
and hand it to a background poll thread. The wizard itself
doesn’t know about polling — that plumbing stays in the event
loop.
Sourcepub fn take_pending_session(&mut self) -> Option<LoginSession>
pub fn take_pending_session(&mut self) -> Option<LoginSession>
Pull the freshly-constructed LoginSession out so the event
loop can spawn a background poll thread against it. Returns
None if there is no session to take (Esc was hit, or
start_login errored at construction, or another caller
already took it). Called exactly once per QR session by
event_loop::run_loop’s first-launch setup; subsequent calls
return None and are harmless.
Sourcepub fn with_initial_language(self, config_lang: Option<Locale>) -> Self
pub fn with_initial_language(self, config_lang: Option<Locale>) -> Self
Pre-select the language idx based on existing config. Used by
/welcome so a user who already picked ZhCn lands on row 3 of
step 2 instead of Auto-detect.
Trait Implementations§
Source§impl Default for OnboardingWizard
impl Default for OnboardingWizard
Source§impl Modal for OnboardingWizard
impl Modal for OnboardingWizard
Source§fn handle_key(
&mut self,
code: KeyCode,
mods: KeyModifiers,
buf: &mut Buffer,
state: &mut UiState,
ctx: &mut LoopCtx,
renderer: &mut dyn Renderer,
) -> Result<ModalAction>
fn handle_key( &mut self, code: KeyCode, mods: KeyModifiers, buf: &mut Buffer, state: &mut UiState, ctx: &mut LoopCtx, renderer: &mut dyn Renderer, ) -> Result<ModalAction>
Source§fn draw(
&self,
_buf: &Buffer,
state: &UiState,
ctx: &LoopCtx,
renderer: &mut dyn Renderer,
)
fn draw( &self, _buf: &Buffer, state: &UiState, ctx: &LoopCtx, renderer: &mut dyn Renderer, )
active_modal; handle_key
is expected to handle subsequent repaints after each key.Source§fn handle_paste(
&mut self,
text: &str,
buf: &mut Buffer,
state: &mut UiState,
ctx: &mut LoopCtx,
renderer: &mut dyn Renderer,
) -> Result<ModalAction>
fn handle_paste( &mut self, text: &str, buf: &mut Buffer, state: &mut UiState, ctx: &mut LoopCtx, renderer: &mut dyn Renderer, ) -> Result<ModalAction>
buf (so text-input wizard steps
naturally accept URL / API-key paste) and redraw. Modals that
only present pickers (no text input) can leave the default —
buf updates are harmless when the modal isn’t displaying it.Auto Trait Implementations§
impl Freeze for OnboardingWizard
impl !RefUnwindSafe for OnboardingWizard
impl Send for OnboardingWizard
impl Sync for OnboardingWizard
impl Unpin for OnboardingWizard
impl UnsafeUnpin for OnboardingWizard
impl !UnwindSafe for OnboardingWizard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more