BlueGit

ict rusty-teams

fix(ui): settings lines run edge to edge, even insets, soft surfaces

- Settings nav: the divider above the Rusty group spans the full nav width (was inset by the 12 px nav padding)
- Settings nav: bottom inset under About is 12 like the sides (was 24)
- Connection banner, Demo/Read-only pill, pin banner: no hard outline, soft fill only
- Meeting options and transfer cards use the dialog surface instead of an outlined card
- MCP conversation picker: raised fill instead of an outline
- layout_guard: tagged dividers must span their panel edge to edge, tagged panels keep equal side and bottom insets (settings nav, header close, scrolled settings body; Agents named exception), members popup divider checked
- layout_guard: surfaces_are_soft flags full borders outside state rings, with a named allowlist (inputs, buttons, state signals, Teams content, OS toasts)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-10-17 · 6 weeks ago

Hash
363e7c279302a242dd7f3cccbb3508b0713c54f2
Parent
cc61e5c4
11 files changed +533 −43
crates/app/src/layout_guard.rs +489 −13
@@ -158,8 +158,8 @@ mod frames {
158 158
159 159 use gpui_kit::test::TestWindowExt as _;
160 160 use gpui_kit::{
161 AppContext as _, Bounds, Pixels, TestAppContext, VisualTestContext, WindowOptions, point,
162 px, size,
161 AppContext as _, Bounds, Pixels, ScrollDelta, ScrollWheelEvent, TestAppContext,
162 VisualTestContext, WindowOptions, point, px, size,
163 163 };
164 164 use store::Store;
165 165
@@ -169,19 +169,24 @@ mod frames {
169 169 use gpui_kit::Entity;
170 170
171 171 use crate::app_state::{AppHandle, AppState, Mode, Selection};
172 use crate::settings::metrics;
173 use crate::settings_section::SettingsSection;
174 172 use crate::call::{ActiveCall, CallModel, ConsultCall};
175 173 use crate::demo;
174 use crate::settings::metrics;
175 use crate::settings_section::SettingsSection;
176 176 use crate::user_activity::UserInput;
177 177 use crate::views::call_transcript::TranscriptPanel;
178 178 use crate::views::call_view::CHAT_PANEL_TAG;
179 use crate::views::conversation::MEMBERS_BUTTON;
179 180 use crate::views::message_row::BUBBLE_TAGS;
180 181 use crate::views::proposal_card::{PROPOSAL_BUTTONS, PROPOSAL_CARD, PROPOSAL_THUMBNAILS};
181 182 use crate::views::reaction_proposal_pill::REACTION_PILL;
182 183 use crate::views::recap_tab::RECAP_REGION;
183 use crate::views::shell::{AppShell, Startup, bind_keys, install_globals, sidebar_hidden_in_call};
184 use crate::views::shortcuts::{OpenActivity, OpenAgents, OpenCallsTab, OpenChannelsTab, OpenSaved};
184 use crate::views::shell::{
185 AppShell, Startup, bind_keys, install_globals, sidebar_hidden_in_call,
186 };
187 use crate::views::shortcuts::{
188 OpenActivity, OpenAgents, OpenCallsTab, OpenChannelsTab, OpenSaved,
189 };
185 190
186 191 const GUARDED: &[&str] = &[
187 192 "shell",
@@ -249,10 +254,41 @@ mod frames {
249 254 const SETTINGS_TAGS: &[&str] = &[
250 255 "settings",
251 256 "settings/nav",
257 "settings/nav/divider",
258 "settings/nav/about",
252 259 "settings/main",
253 260 "settings/main/header",
261 "settings/main/header/close",
254 262 "settings/main/body",
255 263 ];
264 const SETTINGS_BODY: &str = "settings/main/body";
265 const SETTINGS_CONTENT: &str = "settings/main/body/content";
266 const MEMBERS_TAGS: &[&str] = &["chat-members-popup", "chat-members-popup/divider"];
267 const MEMBERS_CHAT: &str = "demo-chat-release";
268 const DIVIDER_SEGMENT: &str = "divider";
269 const DIVIDER_THICKNESS: f32 = 1.;
270 const INSET_TOLERANCE: f32 = 1.;
271 const INSET_RULES: &[InsetRule] = &[
272 InsetRule {
273 panel: "settings/nav",
274 content: "settings/nav/about",
275 edges: &[Edge::Left, Edge::Right, Edge::Bottom],
276 },
277 InsetRule {
278 panel: "settings/main",
279 content: "settings/main/header/close",
280 edges: &[Edge::Top, Edge::Right],
281 },
282 ];
283 const SCROLLED_INSET_RULE: InsetRule = InsetRule {
284 panel: SETTINGS_BODY,
285 content: SETTINGS_CONTENT,
286 edges: &[Edge::Left, Edge::Bottom],
287 };
288 const SCROLLED_INSET_ALLOWLIST: &[(SettingsSection, &str)] = &[(
289 SettingsSection::Agents,
290 "Agents pages carry their own PAGE_PADDING side inset, the body narrows its side padding to keep the text edge",
291 )];
256 292 const SETTINGS_SECTIONS: [SettingsSection; 8] = [
257 293 SettingsSection::General,
258 294 SettingsSection::Notifications,
@@ -269,6 +305,108 @@ mod frames {
269 305
270 306 type Tag = (&'static str, Bounds<Pixels>);
271 307
308 #[derive(Clone, Copy, Debug)]
309 enum Edge {
310 Top,
311 Right,
312 Bottom,
313 Left,
314 }
315
316 struct InsetRule {
317 panel: &'static str,
318 content: &'static str,
319 edges: &'static [Edge],
320 }
321
322 fn inset(panel: Bounds<Pixels>, content: Bounds<Pixels>, edge: Edge) -> f32 {
323 f32::from(match edge {
324 Edge::Top => content.top() - panel.top(),
325 Edge::Right => panel.right() - content.right(),
326 Edge::Bottom => panel.bottom() - content.bottom(),
327 Edge::Left => content.left() - panel.left(),
328 })
329 }
330
331 fn inset_violation(
332 rule: &InsetRule,
333 panel: Bounds<Pixels>,
334 content: Bounds<Pixels>,
335 ) -> Option<(String, String)> {
336 let insets: Vec<(Edge, f32)> = rule
337 .edges
338 .iter()
339 .map(|edge| (*edge, inset(panel, content, *edge)))
340 .collect();
341 let values = insets.iter().map(|(_, value)| *value);
342 let spread = values.clone().fold(f32::MIN, f32::max) - values.fold(f32::MAX, f32::min);
343 (spread > INSET_TOLERANCE).then(|| {
344 (
345 format!("{}:uneven-inset", rule.panel),
346 format!(
347 "{} insets {} by {insets:?}, they must match",
348 rule.panel, rule.content
349 ),
350 )
351 })
352 }
353
354 fn inset_violations(tags: &[Tag], rules: &[InsetRule]) -> Vec<(String, String)> {
355 let bounds_of = |path: &str| {
356 tags.iter()
357 .find(|(tag, _)| *tag == path)
358 .map(|(_, bounds)| *bounds)
359 };
360 rules
361 .iter()
362 .filter_map(
363 |rule| match (bounds_of(rule.panel), bounds_of(rule.content)) {
364 (Some(panel), Some(content)) => inset_violation(rule, panel, content),
365 _ => None,
366 },
367 )
368 .collect()
369 }
370
371 fn divider_violations(tags: &[Tag]) -> Vec<(String, String)> {
372 let mut found = Vec::new();
373 for (path, bounds) in tags {
374 let Some((parent, segment)) = path.rsplit_once('/') else {
375 continue;
376 };
377 if !segment.starts_with(DIVIDER_SEGMENT) {
378 continue;
379 }
380 let Some((_, panel)) = tags.iter().find(|(tag, _)| *tag == parent) else {
381 found.push((
382 format!("{path}:no-panel"),
383 format!("{path} needs its panel {parent} tagged"),
384 ));
385 continue;
386 };
387 let thin = |length: Pixels| f32::from(length) <= DIVIDER_THICKNESS + TOLERANCE;
388 let near = |first: Pixels, second: Pixels| f32::from(first - second).abs() <= TOLERANCE;
389 let spans = if thin(bounds.size.height) {
390 near(bounds.left(), panel.left()) && near(bounds.right(), panel.right())
391 } else if thin(bounds.size.width) {
392 near(bounds.top(), panel.top()) && near(bounds.bottom(), panel.bottom())
393 } else {
394 false
395 };
396 if !spans {
397 found.push((
398 format!("{path}:short-divider"),
399 format!(
400 "{path} {} must be a {DIVIDER_THICKNESS} px line from edge to edge of {parent} {}",
401 describe(*bounds),
402 describe(*panel)
403 ),
404 ));
405 }
406 }
407 found
408 }
409
272 410 enum Screen {
273 411 Tab(&'static str, Option<fn(&mut VisualTestContext)>),
274 412 StatusMenu,
@@ -376,6 +514,7 @@ mod frames {
376 514 }
377 515 }
378 516 }
517 found.extend(divider_violations(tags));
379 518 found
380 519 }
381 520
@@ -412,13 +551,15 @@ mod frames {
412 551 ])
413 552 .chain(&AGENT_TAGS)
414 553 .chain(SETTINGS_TAGS)
554 .chain(MEMBERS_TAGS)
415 555 .filter_map(|path| visual.debug_bounds(path).map(|bounds| (*path, bounds)))
416 556 .collect()
417 557 }
418 558
419 559 fn sharing_call() -> ActiveCall {
420 560 let mut call = gallery_call();
421 call.model.apply(CallUpdate::ScreenShare(Some("8:orgid:guard-1".to_owned())));
561 call.model
562 .apply(CallUpdate::ScreenShare(Some("8:orgid:guard-1".to_owned())));
422 563 call.share_stage.view.step_in((800., 450.));
423 564 call
424 565 }
@@ -460,7 +601,10 @@ mod frames {
460 601 let held = connected(1, "Christopher Montgomery-Lindqvist", "8:orgid:guard-held");
461 602 let mut consult = connected(2, "Jonas Ortega", "8:orgid:guard-consult");
462 603 consult.consult = Some(ConsultCall::new(
463 ("8:orgid:guard-consult".to_owned(), "Jonas Ortega".to_owned()),
604 (
605 "8:orgid:guard-consult".to_owned(),
606 "Jonas Ortega".to_owned(),
607 ),
464 608 held.model.peer_name.clone(),
465 609 ));
466 610 (consult, held)
@@ -528,6 +672,37 @@ mod frames {
528 672 .into_iter()
529 673 .map(|(key, _)| key)
530 674 .collect();
675 let line_tags: Vec<Tag> = vec![
676 ("panel", rectangle(0., 0., 100., 100.)),
677 ("panel/divider", rectangle(0., 50., 100., 1.)),
678 ("panel/divider-inset", rectangle(12., 60., 76., 1.)),
679 ("panel/divider-side", rectangle(40., 0., 1., 100.)),
680 ("panel/about", rectangle(12., 76., 76., 12.)),
681 ("panel/footer", rectangle(12., 64., 76., 12.)),
682 ];
683 let line_keys: Vec<String> = divider_violations(&line_tags)
684 .into_iter()
685 .chain(inset_violations(
686 &line_tags,
687 &[
688 InsetRule {
689 panel: "panel",
690 content: "panel/about",
691 edges: &[Edge::Left, Edge::Right, Edge::Bottom],
692 },
693 InsetRule {
694 panel: "panel",
695 content: "panel/footer",
696 edges: &[Edge::Left, Edge::Bottom],
697 },
698 ],
699 ))
700 .map(|(key, _)| key)
701 .collect();
702 assert_eq!(
703 line_keys,
704 ["panel/divider-inset:short-divider", "panel:uneven-inset"]
705 );
531 706 assert_eq!(
532 707 keys,
533 708 [
@@ -840,17 +1015,28 @@ mod frames {
840 1015 };
841 1016 let inset = metrics(width, height).inset;
842 1017 for section in SETTINGS_SECTIONS {
843 visual.update(|_, cx| {
844 state.update(cx, |state, cx| state.open_settings(section, cx))
845 });
1018 visual
1019 .update(|_, cx| state.update(cx, |state, cx| state.open_settings(section, cx)));
846 1020 let tags = collect(&mut visual, Some(SETTINGS_TAGS[0]));
847 let found: Vec<String> = violations(&tags, window, SETTINGS_TAGS)
1021 let mut found: Vec<(String, String)> = violations(&tags, window, SETTINGS_TAGS)
848 1022 .into_iter()
849 1023 .filter(|(key, _)| key.starts_with("settings"))
1024 .chain(inset_violations(&tags, INSET_RULES))
1025 .collect();
1026 let scrolled_exempt = SCROLLED_INSET_ALLOWLIST
1027 .iter()
1028 .any(|(exempt, _)| *exempt == section);
1029 if !scrolled_exempt {
1030 found.extend(scrolled_inset_violation(&mut visual));
1031 }
1032 let found: Vec<String> = found
1033 .into_iter()
850 1034 .map(|(key, message)| format!("{section:?}@{width}x{height}:{key}: {message}"))
851 1035 .collect();
852 1036 assert!(found.is_empty(), "{}", found.join("\n"));
853 let dialog = visual.debug_bounds(SETTINGS_TAGS[0]).expect("settings dialog");
1037 let dialog = visual
1038 .debug_bounds(SETTINGS_TAGS[0])
1039 .expect("settings dialog");
854 1040 let edges = [
855 1041 f32::from(dialog.left()),
856 1042 f32::from(dialog.top()),
@@ -865,6 +1051,55 @@ mod frames {
865 1051 }
866 1052 }
867 1053
1054 fn scrolled_inset_violation(visual: &mut VisualTestContext) -> Option<(String, String)> {
1055 let body = visual.debug_bounds(SETTINGS_BODY)?;
1056 let content = visual.debug_bounds(SETTINGS_CONTENT)?;
1057 if content.bottom() <= body.bottom() {
1058 return None;
1059 }
1060 visual.simulate_event(ScrollWheelEvent {
1061 position: body.center(),
1062 delta: ScrollDelta::Pixels(point(px(0.), px(-100_000.))),
1063 ..Default::default()
1064 });
1065 collect(visual, None);
1066 let body = visual.debug_bounds(SETTINGS_BODY)?;
1067 let content = visual.debug_bounds(SETTINGS_CONTENT)?;
1068 inset_violation(&SCROLLED_INSET_RULE, body, content)
1069 }
1070
1071 #[gpui_kit::test]
1072 fn members_popup_lines_reach_the_edges(cx: &mut TestAppContext) {
1073 let (handle, state) = mount(cx);
1074 let mut visual = VisualTestContext::from_window(handle, cx);
1075 for (width, height) in SIZES {
1076 visual.simulate_resize(size(px(width), px(height)));
1077 let window = Bounds {
1078 origin: point(px(0.), px(0.)),
1079 size: size(px(width), px(height)),
1080 };
1081 visual.update(|_, cx| {
1082 state.update(cx, |state, cx| {
1083 state.select(Selection::Chat(MEMBERS_CHAT.to_owned()), cx)
1084 })
1085 });
1086 collect(&mut visual, Some(MEMBERS_BUTTON));
1087 let button = visual
1088 .debug_bounds(MEMBERS_BUTTON)
1089 .expect("members button rendered");
1090 visual.simulate_click(button.center(), Default::default());
1091 let tags = collect(&mut visual, Some(MEMBERS_TAGS[0]));
1092 let found: Vec<String> = violations(&tags, window, MEMBERS_TAGS)
1093 .into_iter()
1094 .filter(|(key, _)| key.starts_with("chat-members"))
1095 .map(|(key, message)| format!("members@{width}x{height}:{key}: {message}"))
1096 .collect();
1097 visual.simulate_keystrokes("escape");
1098 visual.run_until_parked();
1099 assert!(found.is_empty(), "{}", found.join("\n"));
1100 }
1101 }
1102
868 1103 #[gpui_kit::test]
869 1104 fn agent_proposals_stay_inside_the_main_island(cx: &mut TestAppContext) {
870 1105 let (handle, state) = mount_with(cx, true);
@@ -927,3 +1162,244 @@ fn lines_are_solid() {
927 1162 .collect();
928 1163 assert!(violations.is_empty(), "{}", violations.join("\n"));
929 1164 }
1165
1166 const STATE_RING_COLORS: &[&str] = &[
1167 "if focused",
1168 "if selected",
1169 "if speaking",
1170 "if current",
1171 "if open",
1172 "if state.failed",
1173 ];
1174 const OUTLINE_ALLOWLIST: &[(&str, &str, &str)] = &[
1175 (
1176 "notify/ring_view.rs",
1177 "theme::green()",
1178 "OS toast window: no compositor shadow, the edge separates it from the desktop; accent = Teams state",
1179 ),
1180 (
1181 "notify/meeting_view.rs",
1182 "theme::accent()",
1183 "OS toast window: no compositor shadow, the edge separates it from the desktop; accent = Teams state",
1184 ),
1185 (
1186 "notify/meeting_view.rs",
1187 "theme::border_strong()",
1188 "outlined button, not a surface",
1189 ),
1190 (
1191 "notify/toast.rs",
1192 "border)",
1193 "OS toast window: no compositor shadow, the edge separates it from the desktop; accent = Teams state",
1194 ),
1195 (
1196 "notify/toast.rs",
1197 "theme::border_strong()",
1198 "OS toast window: no compositor shadow, the edge separates it from the desktop; accent = Teams state",
1199 ),
1200 (
1201 "settings/mcp.rs",
1202 "theme::border_strong()",
1203 "outlined button, not a surface",
1204 ),
1205 (
1206 "settings/rows.rs",
1207 "theme::border_strong()",
1208 "outlined button, not a surface",
1209 ),
1210 (
1211 "views/card_widgets.rs",
1212 "border)",
1213 "message content drawn as Teams renders it",
1214 ),
1215 (
1216 "views/card_widgets.rs",
1217 "theme::border_strong()",
1218 "message content drawn as Teams renders it",
1219 ),
1220 ("views/shared_tab.rs", "theme::accent()", "input field"),
1221 ("views/card_input.rs", "if error.is_some()", "input field"),
1222 ("views/format_toolbar.rs", "if refused", "input field"),
1223 (
1224 "views/card_code_block.rs",
1225 "theme::code_header_border()",
1226 "message content drawn as Teams renders it",
1227 ),
1228 ("views/call_transcript.rs", "theme::border()", "input field"),
1229 (
1230 "views/conversation.rs",
1231 "theme::accent()",
1232 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1233 ),
1234 (
1235 "views/attachment_tray.rs",
1236 "theme::accent()",
1237 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1238 ),
1239 (
1240 "views/card_carousel.rs",
1241 "theme::border_strong()",
1242 "message content drawn as Teams renders it",
1243 ),
1244 (
1245 "views/card_table.rs",
1246 "grid_color",
1247 "message content drawn as Teams renders it",
1248 ),
1249 (
1250 "views/activity_panel.rs",
1251 "theme::surface()",
1252 "cutout ring in the background color, invisible against its surface",
1253 ),
1254 (
1255 "views/avatar.rs",
1256 "theme::surface()",
1257 "cutout ring in the background color, invisible against its surface",
1258 ),
1259 (
1260 "views/avatar.rs",
1261 "theme::text_muted()",
1262 "offline presence glyph, Teams icon",
1263 ),
1264 (
1265 "views/message_row.rs",
1266 "theme::border_strong()",
1267 "deleted message placeholder, Teams look",
1268 ),
1269 (
1270 "views/message_row.rs",
1271 "theme::red()",
1272 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1273 ),
1274 (
1275 "views/message_row.rs",
1276 "if row.delivery",
1277 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1278 ),
1279 (
1280 "views/new_meeting_dialog.rs",
1281 "theme::border()",
1282 "input field",
1283 ),
1284 (
1285 "views/call_mini_window.rs",
1286 "theme::border_strong()",
1287 "self view over live video, needs an edge on any picture",
1288 ),
1289 ("views/transfer_picker.rs", "theme::border()", "input field"),
1290 (
1291 "views/call_notice.rs",
1292 "theme::border_strong()",
1293 "outlined button, not a surface",
1294 ),
1295 (
1296 "views/composer/schedule.rs",
1297 "theme::accent()",
1298 "input field",
1299 ),
1300 (
1301 "views/call_mini.rs",
1302 "border)",
1303 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1304 ),
1305 (
1306 "views/sidebar.rs",
1307 "theme::accent()",
1308 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1309 ),
1310 (
1311 "views/adaptive_card.rs",
1312 "theme::border()",
1313 "message content drawn as Teams renders it",
1314 ),
1315 (
1316 "views/adaptive_card.rs",
1317 "border)",
1318 "message content drawn as Teams renders it",
1319 ),
1320 (
1321 "views/share_bar.rs",
1322 "theme::red()",
1323 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1324 ),
1325 ("settings_controls.rs", "if invalid", "input field"),
1326 ];
1327
1328 fn outlines(source: &str) -> Vec<(usize, String)> {
1329 let pattern = Regex::new(r"\.border(_1\(\)|_2\(\)|\(px)").expect("pattern");
1330 pattern
1331 .find_iter(source)
1332 .map(|found| {
1333 let line_number = source[..found.start()].matches('\n').count() + 1;
1334 let after = &source[found.end()..];
1335 let color = after
1336 .find(".border_color(")
1337 .filter(|position| *position < 120)
1338 .map(|position| {
1339 let start = &after[position + ".border_color(".len()..];
1340 start
1341 .lines()
1342 .map(str::trim)
1343 .find(|line| !line.is_empty())
1344 .unwrap_or_default()
1345 .to_owned()
1346 })
1347 .unwrap_or_default();
1348 (line_number, color)
1349 })
1350 .collect()
1351 }
1352
1353 #[test]
1354 fn outline_matcher_reads_the_border_color() {
1355 let source = "div()\n .border_1()\n .border_color(theme::amber())\n .border_t_1()\n";
1356 assert_eq!(outlines(source), [(2, "theme::amber())".to_owned())]);
1357 }
1358
1359 #[test]
1360 fn surfaces_are_soft() {
1361 let mut matched_allowlist = HashSet::new();
1362 let mut violations = Vec::new();
1363 for root in source_roots() {
1364 let mut files = Vec::new();
1365 source_files(&root, &mut files);
1366 for file in files {
1367 let relative = file
1368 .strip_prefix(&root)
1369 .expect("inside src")
1370 .to_string_lossy()
1371 .replace('\\', "/");
1372 if relative == "layout_guard.rs" {
1373 continue;
1374 }
1375 let source = fs::read_to_string(&file).expect("read source file");
1376 for (line_number, color) in outlines(&source) {
1377 if STATE_RING_COLORS
1378 .iter()
1379 .any(|prefix| color.starts_with(prefix))
1380 {
1381 continue;
1382 }
1383 match OUTLINE_ALLOWLIST.iter().position(|(allowed_file, prefix, _)| {
1384 *allowed_file == relative && color.starts_with(prefix)
1385 }) {
1386 Some(position) => {
1387 matched_allowlist.insert(position);
1388 }
1389 None => violations.push(format!(
1390 "{relative}:{line_number}: hard outline on a surface, use a soft fill or shadow (border_color {color})"
1391 )),
1392 }
1393 }
1394 }
1395 }
1396 let stale = OUTLINE_ALLOWLIST
1397 .iter()
1398 .enumerate()
1399 .filter(|(position, _)| !matched_allowlist.contains(position))
1400 .map(|(_, (file, prefix, _))| {
1401 format!("stale outline allowlist entry, remove it: {file} {prefix}")
1402 });
1403 let report: Vec<String> = violations.into_iter().chain(stale).collect();
1404 assert!(report.is_empty(), "{}", report.join("\n"));
1405 }
@@ -158,8 +158,8 @@ mod frames {
158
158
159 use gpui_kit::test::TestWindowExt as _;
159 use gpui_kit::test::TestWindowExt as _;
160 use gpui_kit::{
160 use gpui_kit::{
161 AppContext as _, Bounds, Pixels, TestAppContext, VisualTestContext, WindowOptions, point,
161 AppContext as _, Bounds, Pixels, ScrollDelta, ScrollWheelEvent, TestAppContext,
162 px, size,
162 VisualTestContext, WindowOptions, point, px, size,
163 };
163 };
164 use store::Store;
164 use store::Store;
165
165
@@ -169,19 +169,24 @@ mod frames {
169 use gpui_kit::Entity;
169 use gpui_kit::Entity;
170
170
171 use crate::app_state::{AppHandle, AppState, Mode, Selection};
171 use crate::app_state::{AppHandle, AppState, Mode, Selection};
172 use crate::settings::metrics;
173 use crate::settings_section::SettingsSection;
174 use crate::call::{ActiveCall, CallModel, ConsultCall};
172 use crate::call::{ActiveCall, CallModel, ConsultCall};
175 use crate::demo;
173 use crate::demo;
174 use crate::settings::metrics;
175 use crate::settings_section::SettingsSection;
176 use crate::user_activity::UserInput;
176 use crate::user_activity::UserInput;
177 use crate::views::call_transcript::TranscriptPanel;
177 use crate::views::call_transcript::TranscriptPanel;
178 use crate::views::call_view::CHAT_PANEL_TAG;
178 use crate::views::call_view::CHAT_PANEL_TAG;
179 use crate::views::conversation::MEMBERS_BUTTON;
179 use crate::views::message_row::BUBBLE_TAGS;
180 use crate::views::message_row::BUBBLE_TAGS;
180 use crate::views::proposal_card::{PROPOSAL_BUTTONS, PROPOSAL_CARD, PROPOSAL_THUMBNAILS};
181 use crate::views::proposal_card::{PROPOSAL_BUTTONS, PROPOSAL_CARD, PROPOSAL_THUMBNAILS};
181 use crate::views::reaction_proposal_pill::REACTION_PILL;
182 use crate::views::reaction_proposal_pill::REACTION_PILL;
182 use crate::views::recap_tab::RECAP_REGION;
183 use crate::views::recap_tab::RECAP_REGION;
183 use crate::views::shell::{AppShell, Startup, bind_keys, install_globals, sidebar_hidden_in_call};
184 use crate::views::shell::{
184 use crate::views::shortcuts::{OpenActivity, OpenAgents, OpenCallsTab, OpenChannelsTab, OpenSaved};
185 AppShell, Startup, bind_keys, install_globals, sidebar_hidden_in_call,
186 };
187 use crate::views::shortcuts::{
188 OpenActivity, OpenAgents, OpenCallsTab, OpenChannelsTab, OpenSaved,
189 };
185
190
186 const GUARDED: &[&str] = &[
191 const GUARDED: &[&str] = &[
187 "shell",
192 "shell",
@@ -249,10 +254,41 @@ mod frames {
249 const SETTINGS_TAGS: &[&str] = &[
254 const SETTINGS_TAGS: &[&str] = &[
250 "settings",
255 "settings",
251 "settings/nav",
256 "settings/nav",
257 "settings/nav/divider",
258 "settings/nav/about",
252 "settings/main",
259 "settings/main",
253 "settings/main/header",
260 "settings/main/header",
261 "settings/main/header/close",
254 "settings/main/body",
262 "settings/main/body",
255 ];
263 ];
264 const SETTINGS_BODY: &str = "settings/main/body";
265 const SETTINGS_CONTENT: &str = "settings/main/body/content";
266 const MEMBERS_TAGS: &[&str] = &["chat-members-popup", "chat-members-popup/divider"];
267 const MEMBERS_CHAT: &str = "demo-chat-release";
268 const DIVIDER_SEGMENT: &str = "divider";
269 const DIVIDER_THICKNESS: f32 = 1.;
270 const INSET_TOLERANCE: f32 = 1.;
271 const INSET_RULES: &[InsetRule] = &[
272 InsetRule {
273 panel: "settings/nav",
274 content: "settings/nav/about",
275 edges: &[Edge::Left, Edge::Right, Edge::Bottom],
276 },
277 InsetRule {
278 panel: "settings/main",
279 content: "settings/main/header/close",
280 edges: &[Edge::Top, Edge::Right],
281 },
282 ];
283 const SCROLLED_INSET_RULE: InsetRule = InsetRule {
284 panel: SETTINGS_BODY,
285 content: SETTINGS_CONTENT,
286 edges: &[Edge::Left, Edge::Bottom],
287 };
288 const SCROLLED_INSET_ALLOWLIST: &[(SettingsSection, &str)] = &[(
289 SettingsSection::Agents,
290 "Agents pages carry their own PAGE_PADDING side inset, the body narrows its side padding to keep the text edge",
291 )];
256 const SETTINGS_SECTIONS: [SettingsSection; 8] = [
292 const SETTINGS_SECTIONS: [SettingsSection; 8] = [
257 SettingsSection::General,
293 SettingsSection::General,
258 SettingsSection::Notifications,
294 SettingsSection::Notifications,
@@ -269,6 +305,108 @@ mod frames {
269
305
270 type Tag = (&'static str, Bounds<Pixels>);
306 type Tag = (&'static str, Bounds<Pixels>);
271
307
308 #[derive(Clone, Copy, Debug)]
309 enum Edge {
310 Top,
311 Right,
312 Bottom,
313 Left,
314 }
315
316 struct InsetRule {
317 panel: &'static str,
318 content: &'static str,
319 edges: &'static [Edge],
320 }
321
322 fn inset(panel: Bounds<Pixels>, content: Bounds<Pixels>, edge: Edge) -> f32 {
323 f32::from(match edge {
324 Edge::Top => content.top() - panel.top(),
325 Edge::Right => panel.right() - content.right(),
326 Edge::Bottom => panel.bottom() - content.bottom(),
327 Edge::Left => content.left() - panel.left(),
328 })
329 }
330
331 fn inset_violation(
332 rule: &InsetRule,
333 panel: Bounds<Pixels>,
334 content: Bounds<Pixels>,
335 ) -> Option<(String, String)> {
336 let insets: Vec<(Edge, f32)> = rule
337 .edges
338 .iter()
339 .map(|edge| (*edge, inset(panel, content, *edge)))
340 .collect();
341 let values = insets.iter().map(|(_, value)| *value);
342 let spread = values.clone().fold(f32::MIN, f32::max) - values.fold(f32::MAX, f32::min);
343 (spread > INSET_TOLERANCE).then(|| {
344 (
345 format!("{}:uneven-inset", rule.panel),
346 format!(
347 "{} insets {} by {insets:?}, they must match",
348 rule.panel, rule.content
349 ),
350 )
351 })
352 }
353
354 fn inset_violations(tags: &[Tag], rules: &[InsetRule]) -> Vec<(String, String)> {
355 let bounds_of = |path: &str| {
356 tags.iter()
357 .find(|(tag, _)| *tag == path)
358 .map(|(_, bounds)| *bounds)
359 };
360 rules
361 .iter()
362 .filter_map(
363 |rule| match (bounds_of(rule.panel), bounds_of(rule.content)) {
364 (Some(panel), Some(content)) => inset_violation(rule, panel, content),
365 _ => None,
366 },
367 )
368 .collect()
369 }
370
371 fn divider_violations(tags: &[Tag]) -> Vec<(String, String)> {
372 let mut found = Vec::new();
373 for (path, bounds) in tags {
374 let Some((parent, segment)) = path.rsplit_once('/') else {
375 continue;
376 };
377 if !segment.starts_with(DIVIDER_SEGMENT) {
378 continue;
379 }
380 let Some((_, panel)) = tags.iter().find(|(tag, _)| *tag == parent) else {
381 found.push((
382 format!("{path}:no-panel"),
383 format!("{path} needs its panel {parent} tagged"),
384 ));
385 continue;
386 };
387 let thin = |length: Pixels| f32::from(length) <= DIVIDER_THICKNESS + TOLERANCE;
388 let near = |first: Pixels, second: Pixels| f32::from(first - second).abs() <= TOLERANCE;
389 let spans = if thin(bounds.size.height) {
390 near(bounds.left(), panel.left()) && near(bounds.right(), panel.right())
391 } else if thin(bounds.size.width) {
392 near(bounds.top(), panel.top()) && near(bounds.bottom(), panel.bottom())
393 } else {
394 false
395 };
396 if !spans {
397 found.push((
398 format!("{path}:short-divider"),
399 format!(
400 "{path} {} must be a {DIVIDER_THICKNESS} px line from edge to edge of {parent} {}",
401 describe(*bounds),
402 describe(*panel)
403 ),
404 ));
405 }
406 }
407 found
408 }
409
272 enum Screen {
410 enum Screen {
273 Tab(&'static str, Option<fn(&mut VisualTestContext)>),
411 Tab(&'static str, Option<fn(&mut VisualTestContext)>),
274 StatusMenu,
412 StatusMenu,
@@ -376,6 +514,7 @@ mod frames {
376 }
514 }
377 }
515 }
378 }
516 }
517 found.extend(divider_violations(tags));
379 found
518 found
380 }
519 }
381
520
@@ -412,13 +551,15 @@ mod frames {
412 ])
551 ])
413 .chain(&AGENT_TAGS)
552 .chain(&AGENT_TAGS)
414 .chain(SETTINGS_TAGS)
553 .chain(SETTINGS_TAGS)
554 .chain(MEMBERS_TAGS)
415 .filter_map(|path| visual.debug_bounds(path).map(|bounds| (*path, bounds)))
555 .filter_map(|path| visual.debug_bounds(path).map(|bounds| (*path, bounds)))
416 .collect()
556 .collect()
417 }
557 }
418
558
419 fn sharing_call() -> ActiveCall {
559 fn sharing_call() -> ActiveCall {
420 let mut call = gallery_call();
560 let mut call = gallery_call();
421 call.model.apply(CallUpdate::ScreenShare(Some("8:orgid:guard-1".to_owned())));
561 call.model
562 .apply(CallUpdate::ScreenShare(Some("8:orgid:guard-1".to_owned())));
422 call.share_stage.view.step_in((800., 450.));
563 call.share_stage.view.step_in((800., 450.));
423 call
564 call
424 }
565 }
@@ -460,7 +601,10 @@ mod frames {
460 let held = connected(1, "Christopher Montgomery-Lindqvist", "8:orgid:guard-held");
601 let held = connected(1, "Christopher Montgomery-Lindqvist", "8:orgid:guard-held");
461 let mut consult = connected(2, "Jonas Ortega", "8:orgid:guard-consult");
602 let mut consult = connected(2, "Jonas Ortega", "8:orgid:guard-consult");
462 consult.consult = Some(ConsultCall::new(
603 consult.consult = Some(ConsultCall::new(
463 ("8:orgid:guard-consult".to_owned(), "Jonas Ortega".to_owned()),
604 (
605 "8:orgid:guard-consult".to_owned(),
606 "Jonas Ortega".to_owned(),
607 ),
464 held.model.peer_name.clone(),
608 held.model.peer_name.clone(),
465 ));
609 ));
466 (consult, held)
610 (consult, held)
@@ -528,6 +672,37 @@ mod frames {
528 .into_iter()
672 .into_iter()
529 .map(|(key, _)| key)
673 .map(|(key, _)| key)
530 .collect();
674 .collect();
675 let line_tags: Vec<Tag> = vec![
676 ("panel", rectangle(0., 0., 100., 100.)),
677 ("panel/divider", rectangle(0., 50., 100., 1.)),
678 ("panel/divider-inset", rectangle(12., 60., 76., 1.)),
679 ("panel/divider-side", rectangle(40., 0., 1., 100.)),
680 ("panel/about", rectangle(12., 76., 76., 12.)),
681 ("panel/footer", rectangle(12., 64., 76., 12.)),
682 ];
683 let line_keys: Vec<String> = divider_violations(&line_tags)
684 .into_iter()
685 .chain(inset_violations(
686 &line_tags,
687 &[
688 InsetRule {
689 panel: "panel",
690 content: "panel/about",
691 edges: &[Edge::Left, Edge::Right, Edge::Bottom],
692 },
693 InsetRule {
694 panel: "panel",
695 content: "panel/footer",
696 edges: &[Edge::Left, Edge::Bottom],
697 },
698 ],
699 ))
700 .map(|(key, _)| key)
701 .collect();
702 assert_eq!(
703 line_keys,
704 ["panel/divider-inset:short-divider", "panel:uneven-inset"]
705 );
531 assert_eq!(
706 assert_eq!(
532 keys,
707 keys,
533 [
708 [
@@ -840,17 +1015,28 @@ mod frames {
840 };
1015 };
841 let inset = metrics(width, height).inset;
1016 let inset = metrics(width, height).inset;
842 for section in SETTINGS_SECTIONS {
1017 for section in SETTINGS_SECTIONS {
843 visual.update(|_, cx| {
1018 visual
844 state.update(cx, |state, cx| state.open_settings(section, cx))
1019 .update(|_, cx| state.update(cx, |state, cx| state.open_settings(section, cx)));
845 });
846 let tags = collect(&mut visual, Some(SETTINGS_TAGS[0]));
1020 let tags = collect(&mut visual, Some(SETTINGS_TAGS[0]));
847 let found: Vec<String> = violations(&tags, window, SETTINGS_TAGS)
1021 let mut found: Vec<(String, String)> = violations(&tags, window, SETTINGS_TAGS)
848 .into_iter()
1022 .into_iter()
849 .filter(|(key, _)| key.starts_with("settings"))
1023 .filter(|(key, _)| key.starts_with("settings"))
1024 .chain(inset_violations(&tags, INSET_RULES))
1025 .collect();
1026 let scrolled_exempt = SCROLLED_INSET_ALLOWLIST
1027 .iter()
1028 .any(|(exempt, _)| *exempt == section);
1029 if !scrolled_exempt {
1030 found.extend(scrolled_inset_violation(&mut visual));
1031 }
1032 let found: Vec<String> = found
1033 .into_iter()
850 .map(|(key, message)| format!("{section:?}@{width}x{height}:{key}: {message}"))
1034 .map(|(key, message)| format!("{section:?}@{width}x{height}:{key}: {message}"))
851 .collect();
1035 .collect();
852 assert!(found.is_empty(), "{}", found.join("\n"));
1036 assert!(found.is_empty(), "{}", found.join("\n"));
853 let dialog = visual.debug_bounds(SETTINGS_TAGS[0]).expect("settings dialog");
1037 let dialog = visual
1038 .debug_bounds(SETTINGS_TAGS[0])
1039 .expect("settings dialog");
854 let edges = [
1040 let edges = [
855 f32::from(dialog.left()),
1041 f32::from(dialog.left()),
856 f32::from(dialog.top()),
1042 f32::from(dialog.top()),
@@ -865,6 +1051,55 @@ mod frames {
865 }
1051 }
866 }
1052 }
867
1053
1054 fn scrolled_inset_violation(visual: &mut VisualTestContext) -> Option<(String, String)> {
1055 let body = visual.debug_bounds(SETTINGS_BODY)?;
1056 let content = visual.debug_bounds(SETTINGS_CONTENT)?;
1057 if content.bottom() <= body.bottom() {
1058 return None;
1059 }
1060 visual.simulate_event(ScrollWheelEvent {
1061 position: body.center(),
1062 delta: ScrollDelta::Pixels(point(px(0.), px(-100_000.))),
1063 ..Default::default()
1064 });
1065 collect(visual, None);
1066 let body = visual.debug_bounds(SETTINGS_BODY)?;
1067 let content = visual.debug_bounds(SETTINGS_CONTENT)?;
1068 inset_violation(&SCROLLED_INSET_RULE, body, content)
1069 }
1070
1071 #[gpui_kit::test]
1072 fn members_popup_lines_reach_the_edges(cx: &mut TestAppContext) {
1073 let (handle, state) = mount(cx);
1074 let mut visual = VisualTestContext::from_window(handle, cx);
1075 for (width, height) in SIZES {
1076 visual.simulate_resize(size(px(width), px(height)));
1077 let window = Bounds {
1078 origin: point(px(0.), px(0.)),
1079 size: size(px(width), px(height)),
1080 };
1081 visual.update(|_, cx| {
1082 state.update(cx, |state, cx| {
1083 state.select(Selection::Chat(MEMBERS_CHAT.to_owned()), cx)
1084 })
1085 });
1086 collect(&mut visual, Some(MEMBERS_BUTTON));
1087 let button = visual
1088 .debug_bounds(MEMBERS_BUTTON)
1089 .expect("members button rendered");
1090 visual.simulate_click(button.center(), Default::default());
1091 let tags = collect(&mut visual, Some(MEMBERS_TAGS[0]));
1092 let found: Vec<String> = violations(&tags, window, MEMBERS_TAGS)
1093 .into_iter()
1094 .filter(|(key, _)| key.starts_with("chat-members"))
1095 .map(|(key, message)| format!("members@{width}x{height}:{key}: {message}"))
1096 .collect();
1097 visual.simulate_keystrokes("escape");
1098 visual.run_until_parked();
1099 assert!(found.is_empty(), "{}", found.join("\n"));
1100 }
1101 }
1102
868 #[gpui_kit::test]
1103 #[gpui_kit::test]
869 fn agent_proposals_stay_inside_the_main_island(cx: &mut TestAppContext) {
1104 fn agent_proposals_stay_inside_the_main_island(cx: &mut TestAppContext) {
870 let (handle, state) = mount_with(cx, true);
1105 let (handle, state) = mount_with(cx, true);
@@ -927,3 +1162,244 @@ fn lines_are_solid() {
927 .collect();
1162 .collect();
928 assert!(violations.is_empty(), "{}", violations.join("\n"));
1163 assert!(violations.is_empty(), "{}", violations.join("\n"));
929}
1164}
1165
1166const STATE_RING_COLORS: &[&str] = &[
1167 "if focused",
1168 "if selected",
1169 "if speaking",
1170 "if current",
1171 "if open",
1172 "if state.failed",
1173];
1174const OUTLINE_ALLOWLIST: &[(&str, &str, &str)] = &[
1175 (
1176 "notify/ring_view.rs",
1177 "theme::green()",
1178 "OS toast window: no compositor shadow, the edge separates it from the desktop; accent = Teams state",
1179 ),
1180 (
1181 "notify/meeting_view.rs",
1182 "theme::accent()",
1183 "OS toast window: no compositor shadow, the edge separates it from the desktop; accent = Teams state",
1184 ),
1185 (
1186 "notify/meeting_view.rs",
1187 "theme::border_strong()",
1188 "outlined button, not a surface",
1189 ),
1190 (
1191 "notify/toast.rs",
1192 "border)",
1193 "OS toast window: no compositor shadow, the edge separates it from the desktop; accent = Teams state",
1194 ),
1195 (
1196 "notify/toast.rs",
1197 "theme::border_strong()",
1198 "OS toast window: no compositor shadow, the edge separates it from the desktop; accent = Teams state",
1199 ),
1200 (
1201 "settings/mcp.rs",
1202 "theme::border_strong()",
1203 "outlined button, not a surface",
1204 ),
1205 (
1206 "settings/rows.rs",
1207 "theme::border_strong()",
1208 "outlined button, not a surface",
1209 ),
1210 (
1211 "views/card_widgets.rs",
1212 "border)",
1213 "message content drawn as Teams renders it",
1214 ),
1215 (
1216 "views/card_widgets.rs",
1217 "theme::border_strong()",
1218 "message content drawn as Teams renders it",
1219 ),
1220 ("views/shared_tab.rs", "theme::accent()", "input field"),
1221 ("views/card_input.rs", "if error.is_some()", "input field"),
1222 ("views/format_toolbar.rs", "if refused", "input field"),
1223 (
1224 "views/card_code_block.rs",
1225 "theme::code_header_border()",
1226 "message content drawn as Teams renders it",
1227 ),
1228 ("views/call_transcript.rs", "theme::border()", "input field"),
1229 (
1230 "views/conversation.rs",
1231 "theme::accent()",
1232 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1233 ),
1234 (
1235 "views/attachment_tray.rs",
1236 "theme::accent()",
1237 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1238 ),
1239 (
1240 "views/card_carousel.rs",
1241 "theme::border_strong()",
1242 "message content drawn as Teams renders it",
1243 ),
1244 (
1245 "views/card_table.rs",
1246 "grid_color",
1247 "message content drawn as Teams renders it",
1248 ),
1249 (
1250 "views/activity_panel.rs",
1251 "theme::surface()",
1252 "cutout ring in the background color, invisible against its surface",
1253 ),
1254 (
1255 "views/avatar.rs",
1256 "theme::surface()",
1257 "cutout ring in the background color, invisible against its surface",
1258 ),
1259 (
1260 "views/avatar.rs",
1261 "theme::text_muted()",
1262 "offline presence glyph, Teams icon",
1263 ),
1264 (
1265 "views/message_row.rs",
1266 "theme::border_strong()",
1267 "deleted message placeholder, Teams look",
1268 ),
1269 (
1270 "views/message_row.rs",
1271 "theme::red()",
1272 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1273 ),
1274 (
1275 "views/message_row.rs",
1276 "if row.delivery",
1277 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1278 ),
1279 (
1280 "views/new_meeting_dialog.rs",
1281 "theme::border()",
1282 "input field",
1283 ),
1284 (
1285 "views/call_mini_window.rs",
1286 "theme::border_strong()",
1287 "self view over live video, needs an edge on any picture",
1288 ),
1289 ("views/transfer_picker.rs", "theme::border()", "input field"),
1290 (
1291 "views/call_notice.rs",
1292 "theme::border_strong()",
1293 "outlined button, not a surface",
1294 ),
1295 (
1296 "views/composer/schedule.rs",
1297 "theme::accent()",
1298 "input field",
1299 ),
1300 (
1301 "views/call_mini.rs",
1302 "border)",
1303 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1304 ),
1305 (
1306 "views/sidebar.rs",
1307 "theme::accent()",
1308 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1309 ),
1310 (
1311 "views/adaptive_card.rs",
1312 "theme::border()",
1313 "message content drawn as Teams renders it",
1314 ),
1315 (
1316 "views/adaptive_card.rs",
1317 "border)",
1318 "message content drawn as Teams renders it",
1319 ),
1320 (
1321 "views/share_bar.rs",
1322 "theme::red()",
1323 "state signal (speaking, sharing, drag, drop, failed), not a resting outline",
1324 ),
1325 ("settings_controls.rs", "if invalid", "input field"),
1326];
1327
1328fn outlines(source: &str) -> Vec<(usize, String)> {
1329 let pattern = Regex::new(r"\.border(_1\(\)|_2\(\)|\(px)").expect("pattern");
1330 pattern
1331 .find_iter(source)
1332 .map(|found| {
1333 let line_number = source[..found.start()].matches('\n').count() + 1;
1334 let after = &source[found.end()..];
1335 let color = after
1336 .find(".border_color(")
1337 .filter(|position| *position < 120)
1338 .map(|position| {
1339 let start = &after[position + ".border_color(".len()..];
1340 start
1341 .lines()
1342 .map(str::trim)
1343 .find(|line| !line.is_empty())
1344 .unwrap_or_default()
1345 .to_owned()
1346 })
1347 .unwrap_or_default();
1348 (line_number, color)
1349 })
1350 .collect()
1351}
1352
1353#[test]
1354fn outline_matcher_reads_the_border_color() {
1355 let source = "div()\n .border_1()\n .border_color(theme::amber())\n .border_t_1()\n";
1356 assert_eq!(outlines(source), [(2, "theme::amber())".to_owned())]);
1357}
1358
1359#[test]
1360fn surfaces_are_soft() {
1361 let mut matched_allowlist = HashSet::new();
1362 let mut violations = Vec::new();
1363 for root in source_roots() {
1364 let mut files = Vec::new();
1365 source_files(&root, &mut files);
1366 for file in files {
1367 let relative = file
1368 .strip_prefix(&root)
1369 .expect("inside src")
1370 .to_string_lossy()
1371 .replace('\\', "/");
1372 if relative == "layout_guard.rs" {
1373 continue;
1374 }
1375 let source = fs::read_to_string(&file).expect("read source file");
1376 for (line_number, color) in outlines(&source) {
1377 if STATE_RING_COLORS
1378 .iter()
1379 .any(|prefix| color.starts_with(prefix))
1380 {
1381 continue;
1382 }
1383 match OUTLINE_ALLOWLIST.iter().position(|(allowed_file, prefix, _)| {
1384 *allowed_file == relative && color.starts_with(prefix)
1385 }) {
1386 Some(position) => {
1387 matched_allowlist.insert(position);
1388 }
1389 None => violations.push(format!(
1390 "{relative}:{line_number}: hard outline on a surface, use a soft fill or shadow (border_color {color})"
1391 )),
1392 }
1393 }
1394 }
1395 }
1396 let stale = OUTLINE_ALLOWLIST
1397 .iter()
1398 .enumerate()
1399 .filter(|(position, _)| !matched_allowlist.contains(position))
1400 .map(|(_, (file, prefix, _))| {
1401 format!("stale outline allowlist entry, remove it: {file} {prefix}")
1402 });
1403 let report: Vec<String> = violations.into_iter().chain(stale).collect();
1404 assert!(report.is_empty(), "{}", report.join("\n"));
1405}
crates/app/src/settings/dialog.rs +2 −0
@@ -177,6 +177,7 @@ impl SettingsDialog {
177 177 .child(
178 178 div()
179 179 .id("settings-close")
180 .debug_selector(|| "settings/main/header/close".into())
180 181 .size(px(CLOSE_SIZE))
181 182 .flex_none()
182 183 .flex()
@@ -226,6 +227,7 @@ impl Render for SettingsDialog {
226 227 .pb(px(metrics.padding))
227 228 .child(
228 229 div()
230 .debug_selector(|| "settings/main/body/content".into())
229 231 .w_full()
230 232 .max_w(px(CONTENT_MAX_WIDTH))
231 233 .child(self.content(cx)),
@@ -177,6 +177,7 @@ impl SettingsDialog {
177 .child(
177 .child(
178 div()
178 div()
179 .id("settings-close")
179 .id("settings-close")
180 .debug_selector(|| "settings/main/header/close".into())
180 .size(px(CLOSE_SIZE))
181 .size(px(CLOSE_SIZE))
181 .flex_none()
182 .flex_none()
182 .flex()
183 .flex()
@@ -226,6 +227,7 @@ impl Render for SettingsDialog {
226 .pb(px(metrics.padding))
227 .pb(px(metrics.padding))
227 .child(
228 .child(
228 div()
229 div()
230 .debug_selector(|| "settings/main/body/content".into())
229 .w_full()
231 .w_full()
230 .max_w(px(CONTENT_MAX_WIDTH))
232 .max_w(px(CONTENT_MAX_WIDTH))
231 .child(self.content(cx)),
233 .child(self.content(cx)),
crates/app/src/settings/mcp.rs +1 −3
@@ -833,9 +833,7 @@ impl McpView {
833 833 .p(px(6.))
834 834 .gap(px(4.))
835 835 .rounded(px(8.))
836 .bg(theme::popup())
837 .border_1()
838 .border_color(theme::border())
836 .bg(theme::surface_raised())
839 837 .child(
840 838 h_flex()
841 839 .h(px(30.))
@@ -833,9 +833,7 @@ impl McpView {
833 .p(px(6.))
833 .p(px(6.))
834 .gap(px(4.))
834 .gap(px(4.))
835 .rounded(px(8.))
835 .rounded(px(8.))
836 .bg(theme::popup())
836 .bg(theme::surface_raised())
837 .border_1()
838 .border_color(theme::border())
839 .child(
837 .child(
840 h_flex()
838 h_flex()
841 .h(px(30.))
839 .h(px(30.))
crates/app/src/settings/nav.rs +27 −9
@@ -77,19 +77,26 @@ pub fn render_nav(
77 77 .filter(|section| agents_available || *section != SettingsSection::Agents)
78 78 .map(item)
79 79 .collect();
80 let group = |items: Vec<Stateful<Div>>| {
81 v_flex()
82 .w_full()
83 .px(px(NAV_PADDING_X))
84 .gap(px(ITEM_GAP))
85 .children(items)
86 };
80 87 v_flex()
81 88 .debug_selector(|| "settings/nav".into())
82 89 .w(px(layout.width))
83 90 .h_full()
84 91 .flex_none()
85 .px(px(NAV_PADDING_X))
86 .py(px(layout.padding_y))
92 .pt(px(layout.padding_y))
93 .pb(px(NAV_PADDING_X))
87 94 .gap(px(ITEM_GAP))
88 95 .rounded_l(px(super::dialog::PANEL_RADIUS))
89 96 .bg(theme::surface_raised())
90 97 .child(
91 98 div()
92 .mx(px(12.))
99 .mx(px(2. * NAV_PADDING_X))
93 100 .mb(px(18.))
94 101 .text_size(px(20.))
95 102 .line_height(px(26.))
@@ -97,23 +104,34 @@ pub fn render_nav(
97 104 .text_color(theme::text())
98 105 .child("Settings"),
99 106 )
100 .children(TEAMS_GROUP.map(item))
107 .child(group(TEAMS_GROUP.into_iter().map(item).collect()))
101 108 .child(
102 109 div()
110 .debug_selector(|| "settings/nav/divider".into())
111 .w_full()
112 .h(px(1.))
113 .flex_none()
103 114 .mt(px(10.))
104 .px(px(12.))
115 .bg(theme::border_strong()),
116 )
117 .child(
118 div()
119 .px(px(2. * NAV_PADDING_X))
105 120 .pt(px(12.))
106 121 .pb(px(6.))
107 .border_t_1()
108 .border_color(theme::border_strong())
109 122 .text_size(px(12.))
110 123 .font_weight(FontWeight::SEMIBOLD)
111 124 .text_color(theme::text_muted())
112 125 .child("RUSTY TEAMS"),
113 126 )
114 .children(rusty)
127 .child(group(rusty))
115 128 .child(div().flex_1().min_h(px(0.)))
116 .child(item(SettingsSection::About))
129 .child(
130 div()
131 .w_full()
132 .px(px(NAV_PADDING_X))
133 .child(item(SettingsSection::About).debug_selector(|| "settings/nav/about".into())),
134 )
117 135 }
118 136
119 137 fn nav_item(
@@ -77,19 +77,26 @@ pub fn render_nav(
77 .filter(|section| agents_available || *section != SettingsSection::Agents)
77 .filter(|section| agents_available || *section != SettingsSection::Agents)
78 .map(item)
78 .map(item)
79 .collect();
79 .collect();
80 let group = |items: Vec<Stateful<Div>>| {
81 v_flex()
82 .w_full()
83 .px(px(NAV_PADDING_X))
84 .gap(px(ITEM_GAP))
85 .children(items)
86 };
80 v_flex()
87 v_flex()
81 .debug_selector(|| "settings/nav".into())
88 .debug_selector(|| "settings/nav".into())
82 .w(px(layout.width))
89 .w(px(layout.width))
83 .h_full()
90 .h_full()
84 .flex_none()
91 .flex_none()
85 .px(px(NAV_PADDING_X))
92 .pt(px(layout.padding_y))
86 .py(px(layout.padding_y))
93 .pb(px(NAV_PADDING_X))
87 .gap(px(ITEM_GAP))
94 .gap(px(ITEM_GAP))
88 .rounded_l(px(super::dialog::PANEL_RADIUS))
95 .rounded_l(px(super::dialog::PANEL_RADIUS))
89 .bg(theme::surface_raised())
96 .bg(theme::surface_raised())
90 .child(
97 .child(
91 div()
98 div()
92 .mx(px(12.))
99 .mx(px(2. * NAV_PADDING_X))
93 .mb(px(18.))
100 .mb(px(18.))
94 .text_size(px(20.))
101 .text_size(px(20.))
95 .line_height(px(26.))
102 .line_height(px(26.))
@@ -97,23 +104,34 @@ pub fn render_nav(
97 .text_color(theme::text())
104 .text_color(theme::text())
98 .child("Settings"),
105 .child("Settings"),
99 )
106 )
100 .children(TEAMS_GROUP.map(item))
107 .child(group(TEAMS_GROUP.into_iter().map(item).collect()))
101 .child(
108 .child(
102 div()
109 div()
110 .debug_selector(|| "settings/nav/divider".into())
111 .w_full()
112 .h(px(1.))
113 .flex_none()
103 .mt(px(10.))
114 .mt(px(10.))
104 .px(px(12.))
115 .bg(theme::border_strong()),
116 )
117 .child(
118 div()
119 .px(px(2. * NAV_PADDING_X))
105 .pt(px(12.))
120 .pt(px(12.))
106 .pb(px(6.))
121 .pb(px(6.))
107 .border_t_1()
108 .border_color(theme::border_strong())
109 .text_size(px(12.))
122 .text_size(px(12.))
110 .font_weight(FontWeight::SEMIBOLD)
123 .font_weight(FontWeight::SEMIBOLD)
111 .text_color(theme::text_muted())
124 .text_color(theme::text_muted())
112 .child("RUSTY TEAMS"),
125 .child("RUSTY TEAMS"),
113 )
126 )
114 .children(rusty)
127 .child(group(rusty))
115 .child(div().flex_1().min_h(px(0.)))
128 .child(div().flex_1().min_h(px(0.)))
116 .child(item(SettingsSection::About))
129 .child(
130 div()
131 .w_full()
132 .px(px(NAV_PADDING_X))
133 .child(item(SettingsSection::About).debug_selector(|| "settings/nav/about".into())),
134 )
117}
135}
118
136
119fn nav_item(
137fn nav_item(
crates/app/src/views/call_people.rs +2 −5
@@ -21,7 +21,7 @@ use crate::call::{
21 21 ActiveCall, CallModel, OptionsDialog, PeopleSections, PersonRow, people_sections,
22 22 };
23 23 use crate::notice::truncated;
24 use crate::theme;
24 use crate::theme::{self, ElevatedSurface as _};
25 25 use calling::MeetingOptions;
26 26
27 27 const HEADER_HEIGHT: f32 = 48.;
@@ -652,11 +652,8 @@ pub fn options_dialog(app: &Entity<AppState>, call: &ActiveCall) -> Option<AnyEl
652 652 .p(px(16.))
653 653 .gap(px(12.))
654 654 .rounded(px(12.))
655 .bg(theme::background())
656 .border_1()
657 .border_color(theme::border_strong())
655 .dialog_surface()
658 656 .text_color(theme::text())
659 .shadow(theme::dialog_shadow())
660 657 .occlude()
661 658 .child(
662 659 div()
@@ -21,7 +21,7 @@ use crate::call::{
21 ActiveCall, CallModel, OptionsDialog, PeopleSections, PersonRow, people_sections,
21 ActiveCall, CallModel, OptionsDialog, PeopleSections, PersonRow, people_sections,
22};
22};
23use crate::notice::truncated;
23use crate::notice::truncated;
24use crate::theme;
24use crate::theme::{self, ElevatedSurface as _};
25use calling::MeetingOptions;
25use calling::MeetingOptions;
26
26
27const HEADER_HEIGHT: f32 = 48.;
27const HEADER_HEIGHT: f32 = 48.;
@@ -652,11 +652,8 @@ pub fn options_dialog(app: &Entity<AppState>, call: &ActiveCall) -> Option<AnyEl
652 .p(px(16.))
652 .p(px(16.))
653 .gap(px(12.))
653 .gap(px(12.))
654 .rounded(px(12.))
654 .rounded(px(12.))
655 .bg(theme::background())
655 .dialog_surface()
656 .border_1()
657 .border_color(theme::border_strong())
658 .text_color(theme::text())
656 .text_color(theme::text())
659 .shadow(theme::dialog_shadow())
660 .occlude()
657 .occlude()
661 .child(
658 .child(
662 div()
659 div()
crates/app/src/views/chat_members.rs +7 −1
@@ -92,7 +92,13 @@ fn members_panel(
92 92 .child(list)
93 93 .when(is_member, |panel| {
94 94 panel
95 .child(div().h(px(1.)).w_full().bg(theme::border()))
95 .child(
96 div()
97 .debug_selector(|| "chat-members-popup/divider".into())
98 .h(px(1.))
99 .w_full()
100 .bg(theme::border()),
101 )
96 102 .child(
97 103 v_flex()
98 104 .py(px(4.))
@@ -92,7 +92,13 @@ fn members_panel(
92 .child(list)
92 .child(list)
93 .when(is_member, |panel| {
93 .when(is_member, |panel| {
94 panel
94 panel
95 .child(div().h(px(1.)).w_full().bg(theme::border()))
95 .child(
96 div()
97 .debug_selector(|| "chat-members-popup/divider".into())
98 .h(px(1.))
99 .w_full()
100 .bg(theme::border()),
101 )
96 .child(
102 .child(
97 v_flex()
103 v_flex()
98 .py(px(4.))
104 .py(px(4.))
crates/app/src/views/connection_banner.rs +0 −2
@@ -27,8 +27,6 @@ pub fn render_connection_banner(
27 27 .gap(px(8.))
28 28 .items_center()
29 29 .rounded(px(8.))
30 .border_1()
31 .border_color(theme::amber().opacity(0.45))
32 30 .bg(theme::amber().opacity(0.14))
33 31 .text_size(px(BANNER_TEXT_SIZE))
34 32 .text_color(theme::text())
@@ -27,8 +27,6 @@ pub fn render_connection_banner(
27 .gap(px(8.))
27 .gap(px(8.))
28 .items_center()
28 .items_center()
29 .rounded(px(8.))
29 .rounded(px(8.))
30 .border_1()
31 .border_color(theme::amber().opacity(0.45))
32 .bg(theme::amber().opacity(0.14))
30 .bg(theme::amber().opacity(0.14))
33 .text_size(px(BANNER_TEXT_SIZE))
31 .text_size(px(BANNER_TEXT_SIZE))
34 .text_color(theme::text())
32 .text_color(theme::text())
crates/app/src/views/conversation.rs +3 −1
@@ -86,6 +86,7 @@ use mcp::ReactionProposal;
86 86 use render_env::RenderEnv;
87 87 use shared::SharedState;
88 88
89 pub const MEMBERS_BUTTON: &str = "shell/islands/main/members-button";
89 90 const CHAT_OPEN_LIMIT: usize = 60;
90 91 const CHANNEL_OPEN_LIMIT: usize = 300;
91 92 const GROWTH_HEADROOM: usize = 20;
@@ -3271,7 +3272,8 @@ impl ConversationView {
3271 3272 stack = Some(members_popover(
3272 3273 &self.app,
3273 3274 chat_id,
3274 member_stack(directory, &shown, shown.len(), false),
3275 member_stack(directory, &shown, shown.len(), false)
3276 .debug_selector(|| MEMBERS_BUTTON.into()),
3275 3277 ));
3276 3278 }
3277 3279 }
@@ -86,6 +86,7 @@ use mcp::ReactionProposal;
86use render_env::RenderEnv;
86use render_env::RenderEnv;
87use shared::SharedState;
87use shared::SharedState;
88
88
89pub const MEMBERS_BUTTON: &str = "shell/islands/main/members-button";
89const CHAT_OPEN_LIMIT: usize = 60;
90const CHAT_OPEN_LIMIT: usize = 60;
90const CHANNEL_OPEN_LIMIT: usize = 300;
91const CHANNEL_OPEN_LIMIT: usize = 300;
91const GROWTH_HEADROOM: usize = 20;
92const GROWTH_HEADROOM: usize = 20;
@@ -3271,7 +3272,8 @@ impl ConversationView {
3271 stack = Some(members_popover(
3272 stack = Some(members_popover(
3272 &self.app,
3273 &self.app,
3273 chat_id,
3274 chat_id,
3274 member_stack(directory, &shown, shown.len(), false),
3275 member_stack(directory, &shown, shown.len(), false)
3276 .debug_selector(|| MEMBERS_BUTTON.into()),
3275 ));
3277 ));
3276 }
3278 }
3277 }
3279 }
crates/app/src/views/pin_banner.rs +0 −2
@@ -95,8 +95,6 @@ pub fn render_pin_banner(data: PinBannerData, actions: PinBannerActions) -> AnyE
95 95 .gap(px(8.))
96 96 .items_center()
97 97 .rounded(px(8.))
98 .border_1()
99 .border_color(theme::border())
100 98 .bg(theme::row_hover())
101 99 .shadow(theme::toast_shadow())
102 100 .cursor_pointer()
@@ -95,8 +95,6 @@ pub fn render_pin_banner(data: PinBannerData, actions: PinBannerActions) -> AnyE
95 .gap(px(8.))
95 .gap(px(8.))
96 .items_center()
96 .items_center()
97 .rounded(px(8.))
97 .rounded(px(8.))
98 .border_1()
99 .border_color(theme::border())
100 .bg(theme::row_hover())
98 .bg(theme::row_hover())
101 .shadow(theme::toast_shadow())
99 .shadow(theme::toast_shadow())
102 .cursor_pointer()
100 .cursor_pointer()
crates/app/src/views/title_bar.rs +0 −2
@@ -32,8 +32,6 @@ fn mode_pill(label: &'static str) -> Div {
32 32 .flex()
33 33 .items_center()
34 34 .rounded_full()
35 .border_1()
36 .border_color(theme::amber().opacity(0.5))
37 35 .bg(theme::amber().opacity(0.14))
38 36 .text_size(px(11.))
39 37 .font_weight(FontWeight::SEMIBOLD)
@@ -32,8 +32,6 @@ fn mode_pill(label: &'static str) -> Div {
32 .flex()
32 .flex()
33 .items_center()
33 .items_center()
34 .rounded_full()
34 .rounded_full()
35 .border_1()
36 .border_color(theme::amber().opacity(0.5))
37 .bg(theme::amber().opacity(0.14))
35 .bg(theme::amber().opacity(0.14))
38 .text_size(px(11.))
36 .text_size(px(11.))
39 .font_weight(FontWeight::SEMIBOLD)
37 .font_weight(FontWeight::SEMIBOLD)
crates/app/src/views/transfer_picker.rs +2 −5
@@ -14,7 +14,7 @@ use super::widgets::icon;
14 14 use crate::app_state::AppState;
15 15 use crate::call::TransferCandidate;
16 16 use crate::fuzzy;
17 use crate::theme;
17 use crate::theme::{self, ElevatedSurface as _};
18 18
19 19 const MAX_RESULTS: usize = 6;
20 20 const CARD_WIDTH: f32 = 440.;
@@ -267,11 +267,8 @@ impl Render for TransferPicker {
267 267 .p(px(CARD_PADDING))
268 268 .gap(px(SECTION_GAP))
269 269 .rounded(px(CARD_RADIUS))
270 .bg(theme::background())
271 .border_1()
272 .border_color(theme::border_strong())
270 .dialog_surface()
273 271 .text_color(theme::text())
274 .shadow(theme::dialog_shadow())
275 272 .occlude()
276 273 .on_key_down(cx.listener(Self::on_key_down))
277 274 .child(
@@ -14,7 +14,7 @@ use super::widgets::icon;
14use crate::app_state::AppState;
14use crate::app_state::AppState;
15use crate::call::TransferCandidate;
15use crate::call::TransferCandidate;
16use crate::fuzzy;
16use crate::fuzzy;
17use crate::theme;
17use crate::theme::{self, ElevatedSurface as _};
18
18
19const MAX_RESULTS: usize = 6;
19const MAX_RESULTS: usize = 6;
20const CARD_WIDTH: f32 = 440.;
20const CARD_WIDTH: f32 = 440.;
@@ -267,11 +267,8 @@ impl Render for TransferPicker {
267 .p(px(CARD_PADDING))
267 .p(px(CARD_PADDING))
268 .gap(px(SECTION_GAP))
268 .gap(px(SECTION_GAP))
269 .rounded(px(CARD_RADIUS))
269 .rounded(px(CARD_RADIUS))
270 .bg(theme::background())
270 .dialog_surface()
271 .border_1()
272 .border_color(theme::border_strong())
273 .text_color(theme::text())
271 .text_color(theme::text())
274 .shadow(theme::dialog_shadow())
275 .occlude()
272 .occlude()
276 .on_key_down(cx.listener(Self::on_key_down))
273 .on_key_down(cx.listener(Self::on_key_down))
277 .child(
274 .child(