BlueGit

ict rusty-teams

Files

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

mod.rs

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