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