BlueGit

ict rusty-teams

Files

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

mod.rs

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