Files
Ely-GPUI-Components/examples/gallery/pages/collab/mod.rs
T
ZacharyZhang-NY 11f3e08294 T22: Collaboration
- presence: avatars ringed in each peer's color with where they are, press to
  follow; a breathing live dot; follow mode frames the view and stops on Escape
- remote cursors and selections painted over a field from its own layout
- comment threads with replies, reactions and resolve; a marker that opens a
  thread in a bubble; a sidebar of open and resolved threads
- annotations washed in their authors' colors, notes on hover
- suggestion mode: edits become suggestions word by word; track changes shows
  them struck and underlined, to accept or reject
- sharing: invite by email with checked chips, roles, the access list and who
  the link lets in, in one dialog
- primitives::hold_focus gives a mode its own focus, shared with ZenMode
- AvatarGroup's tuck and count shared; Avatar::ring_color; TagInput::check;
  TextInput::bounds_for_range; Popover::size
- icons: smile-plus, user-plus, message-square-diff
- gallery: the Collaboration page with scripted states
2026-09-26 05:10:37 -04:00

58 lines
1.7 KiB
Rust

mod people;
mod sharing;
mod talk;
use gpui::{AnyElement, App, IntoElement, ParentElement, Window, div};
use super::Page;
use crate::script::Step;
pub const PAGE: Page = Page {
number: 22,
slug: "collab",
title: "Collaboration",
summary: "People in the same document: who is here and where, comments and reactions, suggested changes, and sharing.",
render,
script: SCRIPT,
};
const SCRIPT: &[Step] = &[
Step::HoverAt("collab-peers", 35.0, 13.0),
Step::Wait(700),
Step::Shot("presence"),
Step::DownAt("collab-peers", 35.0, 13.0),
Step::UpAt("collab-peers", 35.0, 13.0),
Step::Wait(300),
Step::Shot("follow"),
Step::DownAt("collab-peers", 35.0, 13.0),
Step::UpAt("collab-peers", 35.0, 13.0),
Step::DownAt("collab-marker", 12.0, 12.0),
Step::UpAt("collab-marker", 12.0, 12.0),
Step::Wait(300),
Step::Shot("bubble"),
Step::Key("escape"),
Step::DownAt("collab-sidebar", 238.0, 24.0),
Step::UpAt("collab-sidebar", 238.0, 24.0),
Step::Wait(300),
Step::Shot("resolved"),
Step::DownAt("collab-sidebar", 90.0, 24.0),
Step::UpAt("collab-sidebar", 90.0, 24.0),
Step::DownAt("collab-share", 30.0, 14.0),
Step::UpAt("collab-share", 30.0, 14.0),
Step::Wait(400),
Step::Shot("share"),
Step::Key("escape"),
Step::Wait(300),
];
fn render(window: &mut Window, cx: &mut App) -> AnyElement {
div()
.child(people::presence(window, cx))
.child(talk::comments(window, cx))
.child(talk::annotations(window, cx))
.child(talk::changes(window, cx))
.child(sharing::sharing(window, cx))
.child(sharing::activity(cx))
.into_any_element()
}