BlueGit

ict rusty-teams

Files

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

mod.rs

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