BlueGit

ict rusty-teams

Files

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

mod.rs

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