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
This commit is contained in:
ZacharyZhang-NY committed 2026-09-26 05:10:37 -04:00
1 parent 4cc94289ca
commit 11f3e08294
34 files changed
+3297 -86

No files matched your search

+21 -1
View File
@@ -7,7 +7,7 @@ mod upload;
use gpui::{
AppContext as _, Context, Entity, EntityInputHandler, IntoElement, KeyUpEvent, Keystroke,
ParentElement, Render, TestAppContext, VisualTestContext, Window, div,
ParentElement, Render, TestAppContext, VisualTestContext, Window, div, px,
};
use super::{Input, MaskedInput, NumberInput, PinInput, TextInput, bind_keys};
@@ -279,3 +279,23 @@ fn a_composition_inside_a_masked_field_fits_from_where_it_began(cx: &mut TestApp
});
assert_eq!(text(&state, cx), "(192) 345");
}
#[gpui::test]
fn a_range_gives_a_box_per_line_it_spans(cx: &mut TestAppContext) {
let (fields, cx) = open_with(1, false, |input| input.multi_line(2, 4), cx);
fields[0].update(cx, |input, cx| input.set_text("lift\ntone", cx));
cx.run_until_parked();
cx.update(|window, _| window.refresh());
cx.run_until_parked();
let (one, two) = fields[0].read_with(cx, |input, _| {
(input.bounds_for_range(1..3), input.bounds_for_range(2..7))
});
assert_eq!(one.len(), 1);
assert!(one[0].size.width > px(0.0));
assert_eq!(two.len(), 2, "{two:?}");
assert!(two[1].top() > two[0].top());
assert!(
two[1].left() < two[0].left(),
"the second line starts at the edge"
);
}