BlueGit

ict rusty-teams

Files

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

mod.rs

mod.rs 2.7 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 pin_banner;
38pub mod post_card;
39pub mod profile_card;
40pub mod proposal_card;
41pub mod rail;
42pub mod reaction_picker;
43pub mod reaction_pills;
44pub mod saved_panel;
45pub mod scheduled_toolbar;
46pub mod section_dialog;
47pub mod share_bar;
48pub mod shared_tab;
49pub mod shell;
50pub mod shortcuts;
51pub mod shortcuts_dialog;
52pub mod sidebar;
53pub mod status_bar;
54pub mod status_menu;
55pub mod status_message_dialog;
56pub mod switcher;
57pub mod title_bar;
58pub mod toolbar_placement;
59pub mod transfer_picker;
60pub mod translation_line;
61pub mod widgets;
62
63#[cfg(test)]
64mod tests {
65 use std::path::Path;
66
67 fn rust_files(directory: &Path, files: &mut Vec<std::path::PathBuf>) {
68 for entry in std::fs::read_dir(directory).unwrap() {
69 let path = entry.unwrap().path();
70 if path.is_dir() {
71 rust_files(&path, files);
72 } else if path.extension().is_some_and(|extension| extension == "rs") {
73 files.push(path);
74 }
75 }
76 }
77
78 #[test]
79 fn hover_styles_never_toggle_display() {
80 let toggle =
81 regex::Regex::new(r"hover\([^|]*\|\w+\|\s*\w+\s*\.\s*(hidden|flex|block|grid)\(\)")
82 .unwrap();
83 let mut files = Vec::new();
84 rust_files(
85 &Path::new(env!("CARGO_MANIFEST_DIR")).join("src"),
86 &mut files,
87 );
88 let offenders: Vec<String> = files
89 .iter()
90 .flat_map(|path| {
91 let source = std::fs::read_to_string(path).unwrap();
92 source
93 .lines()
94 .enumerate()
95 .filter(|(_, line)| toggle.is_match(line))
96 .map(|(index, _)| format!("{}:{}", path.display(), index + 1))
97 .collect::<Vec<_>>()
98 })
99 .collect();
100 assert!(
101 offenders.is_empty(),
102 "hover styles must toggle visible()/invisible(), not display (gpui panics \"must call prepaint before paint\"): {offenders:?}"
103 );
104 }
105}