- messages: yours in a quiet bubble, the assistant's as prose beside its mark, system notes, errors; avatars, headers with model and time, footers - MessageList over gpui's bottom-aligned list: drawn near the view, held at the newest, counting arrivals while away; a way back down; day separators - streaming text and markdown reveal toward the text as it grows, with a caret; a blinking cursor before the first words - CodeBlock with language, copy, run, apply, download and folding; MarkdownRenderer::code lets messages draw fences with it - pictures, grids, files, voice notes, video over host frames, link previews - quotes, actions, an editor that takes focus, versions, regenerate, stop and continue - errors with retry, a rate limit counting down, feedback, thinking blocks - gallery: the AI Chat page with scripted states
72 lines
1.2 KiB
Rust
72 lines
1.2 KiB
Rust
mod buttons;
|
|
mod charts;
|
|
mod chat;
|
|
mod collab;
|
|
mod data;
|
|
mod debug;
|
|
mod documents;
|
|
mod editor;
|
|
mod feedback;
|
|
mod finance;
|
|
mod forms;
|
|
mod git;
|
|
mod layout;
|
|
mod lists;
|
|
mod menus;
|
|
mod motion;
|
|
mod navigation;
|
|
mod overlays;
|
|
mod primitives;
|
|
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,
|
|
theme::PAGE,
|
|
];
|
|
|
|
pub use shell::{open_about, open_managed};
|
|
|
|
pub fn find(slug: &str) -> Option<usize> {
|
|
ALL.iter().position(|page| page.slug == slug)
|
|
}
|