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