OnboardingWizard runs a first run on navigation::Wizard without its numbered steps: "Step 2 of 4" over a bar in as many parts, the step's title, line and content, Back and Next once ready, Finish last, and Skip for now. Hotspot pulses on a dot that opens a tip on a press or Enter, with Got it. FeatureHighlight names something new under a New badge, with Try it and Not now, and rises in. SetupChecklist counts first things to do in words and a bar, offers Start on each left, eases a check in as one gets done, and offers Hide once all are. navigation::Wizard now keys its buttons, steps and motion by its own id and takes on_step and on_finish at render, failing loud without them.
100 lines
1.7 KiB
Rust
100 lines
1.7 KiB
Rust
mod account;
|
|
mod agent;
|
|
mod buttons;
|
|
mod calendar;
|
|
mod canvas;
|
|
mod charts;
|
|
mod chat;
|
|
mod collab;
|
|
mod dashboard;
|
|
mod data;
|
|
mod debug;
|
|
mod devtools;
|
|
mod documents;
|
|
mod editor;
|
|
mod feedback;
|
|
mod files;
|
|
mod finance;
|
|
mod forms;
|
|
mod generative;
|
|
mod git;
|
|
mod layout;
|
|
mod lists;
|
|
mod mail;
|
|
mod media;
|
|
mod menus;
|
|
mod messaging;
|
|
mod motion;
|
|
mod navigation;
|
|
mod onboarding;
|
|
mod overlays;
|
|
mod primitives;
|
|
mod project;
|
|
mod settings;
|
|
mod shell;
|
|
mod tables;
|
|
mod terminal;
|
|
mod theme;
|
|
mod typography;
|
|
|
|
use gpui::{AnyElement, App, Window};
|
|
|
|
use crate::script::Step;
|
|
|
|
pub struct Page {
|
|
pub number: u8,
|
|
pub slug: &'static str,
|
|
pub title: &'static str,
|
|
pub summary: &'static str,
|
|
pub render: fn(&mut Window, &mut App) -> AnyElement,
|
|
/// Interactions shot after the static pages.
|
|
pub script: &'static [Step],
|
|
}
|
|
|
|
pub const ALL: &[Page] = &[
|
|
primitives::PAGE,
|
|
typography::PAGE,
|
|
layout::PAGE,
|
|
shell::PAGE,
|
|
buttons::PAGE,
|
|
forms::PAGE,
|
|
navigation::PAGE,
|
|
menus::PAGE,
|
|
overlays::PAGE,
|
|
feedback::PAGE,
|
|
motion::PAGE,
|
|
data::PAGE,
|
|
lists::PAGE,
|
|
tables::PAGE,
|
|
charts::PAGE,
|
|
finance::PAGE,
|
|
editor::PAGE,
|
|
terminal::PAGE,
|
|
git::PAGE,
|
|
debug::PAGE,
|
|
documents::PAGE,
|
|
collab::PAGE,
|
|
chat::PAGE,
|
|
agent::PAGE,
|
|
generative::PAGE,
|
|
media::PAGE,
|
|
files::PAGE,
|
|
messaging::PAGE,
|
|
mail::PAGE,
|
|
calendar::PAGE,
|
|
project::PAGE,
|
|
canvas::PAGE,
|
|
devtools::PAGE,
|
|
dashboard::PAGE,
|
|
settings::PAGE,
|
|
account::PAGE,
|
|
onboarding::PAGE,
|
|
theme::PAGE,
|
|
];
|
|
|
|
pub use shell::{open_about, open_managed};
|
|
|
|
pub fn find(slug: &str) -> Option<usize> {
|
|
ALL.iter().position(|page| page.slug == slug)
|
|
}
|