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