BlueGit

ict rusty-teams

Files

rusty-teams / crates / app / src / views / mod.rs

mod.rs

mod.rs 3.0 KiB Download Raw
1pub mod activity_panel;
2pub mod adaptive_card;
3pub mod attachment_tray;
4pub mod attachments;
5pub mod avatar;
6pub mod call_control_fold;
7pub mod call_controls;
8pub mod call_extras;
9pub mod call_health;
10pub mod call_layouts;
11pub mod call_mini;
12pub mod call_mini_window;
13pub mod call_organizer;
14pub mod call_people;
15pub mod call_pop_out;
16pub mod call_record;
17pub mod call_stage;
18pub mod call_transcript;
19pub mod call_view;
20pub mod call_view_menu;
21pub mod calls_tab;
22pub mod card_carousel;
23pub mod card_chart;
24pub mod card_code_block;
25pub mod card_icon;
26pub mod card_input;
27pub mod card_media;
28pub mod card_table;
29pub mod card_widgets;
30pub mod channel_tabs;
31pub mod composer;
32pub mod conversation;
33pub mod dialog_overlay;
34pub mod draft_style;
35pub mod emoji_popup;
36pub mod format_toolbar;
37pub mod forward_dialog;
38pub mod fun_picker;
39pub mod image_viewer;
40pub mod join_dialog;
41pub mod link_preview;
42pub mod message_actions;
43pub mod message_row;
44pub mod new_chat;
45pub mod new_meeting_dialog;
46pub mod pin_banner;
47pub mod post_card;
48pub mod prejoin_view;
49pub mod profile_card;
50pub mod proposal_card;
51pub mod rail;
52pub mod reaction_picker;
53pub mod reaction_pills;
54pub mod recap_tab;
55pub mod saved_panel;
56pub mod scheduled_toolbar;
57pub mod section_dialog;
58pub mod share_bar;
59pub mod shared_tab;
60pub mod shell;
61pub mod shortcuts;
62pub mod shortcuts_dialog;
63pub mod sidebar;
64pub mod status_bar;
65pub mod status_menu;
66pub mod status_message_dialog;
67pub mod switcher;
68pub mod title_bar;
69pub mod toolbar_placement;
70pub mod transfer_picker;
71pub mod translation_line;
72pub mod widgets;
73
74#[cfg(test)]
75mod tests {
76 use std::path::Path;
77
78 fn rust_files(directory: &Path, files: &mut Vec<std::path::PathBuf>) {
79 for entry in std::fs::read_dir(directory).unwrap() {
80 let path = entry.unwrap().path();
81 if path.is_dir() {
82 rust_files(&path, files);
83 } else if path.extension().is_some_and(|extension| extension == "rs") {
84 files.push(path);
85 }
86 }
87 }
88
89 #[test]
90 fn hover_styles_never_toggle_display() {
91 let toggle =
92 regex::Regex::new(r"hover\([^|]*\|\w+\|\s*\w+\s*\.\s*(hidden|flex|block|grid)\(\)")
93 .unwrap();
94 let mut files = Vec::new();
95 rust_files(
96 &Path::new(env!("CARGO_MANIFEST_DIR")).join("src"),
97 &mut files,
98 );
99 let offenders: Vec<String> = files
100 .iter()
101 .flat_map(|path| {
102 let source = std::fs::read_to_string(path).unwrap();
103 source
104 .lines()
105 .enumerate()
106 .filter(|(_, line)| toggle.is_match(line))
107 .map(|(index, _)| format!("{}:{}", path.display(), index + 1))
108 .collect::<Vec<_>>()
109 })
110 .collect();
111 assert!(
112 offenders.is_empty(),
113 "hover styles must toggle visible()/invisible(), not display (gpui panics \"must call prepaint before paint\"): {offenders:?}"
114 );
115 }
116}