긴 이름과 경로가 화면을 밀어내지 않도록 제한함
- 작성자
- 호시노 히나타
- 작성 시각
- 커밋
8ce724306fa9cadc13967f6db37be304325cb81b- 부모
- 0c1b0da
변경된 파일 11개
+371-22| @@ -489,7 +489,15 @@ impl ArchiveApp { | ||
| 489 | 489 | format!("{} — Zipelo", full.display()) |
| 490 | 490 | }) |
| 491 | 491 | .unwrap_or_else(|| "Zipelo".into()); |
| 492 | 삭제: ctx.send_viewport_cmd(egui::ViewportCommand::Title(title)); | |
| 492 | 추가: let short_title = if let Some(path) = title.strip_suffix(" — Zipelo") { | |
| 493 | 추가: format!( | |
| 494 | 추가: "{} — Zipelo", | |
| 495 | 추가: theme::window_title(root, path, ctx.content_rect().width() - 300.0) | |
| 496 | 추가: ) | |
| 497 | 추가: } else { | |
| 498 | 추가: title.clone() | |
| 499 | 추가: }; | |
| 500 | 추가: ctx.send_viewport_cmd(egui::ViewportCommand::Title(short_title)); | |
| 493 | 501 | egui::Panel::top("archive-actions") |
| 494 | 502 | .frame( |
| 495 | 503 | theme::panel(theme::PANEL) |
| @@ -499,7 +507,10 @@ impl ArchiveApp { | ||
| 499 | 507 | .show(root, |ui| { |
| 500 | 508 | ui.horizontal(|ui| { |
| 501 | 509 | let idle = !self.model.busy() && self.model.close == Close::Open; |
| 502 | 삭제: if theme::tool(ui, "열기", theme::OPEN, idle, false).clicked() { | |
| 510 | 추가: if theme::tool(ui, "열기", theme::OPEN, idle, false) | |
| 511 | 추가: .on_hover_text(&title) | |
| 512 | 추가: .clicked() | |
| 513 | 추가: { | |
| 503 | 514 | self.open_picker(Purpose::Open); |
| 504 | 515 | } |
| 505 | 516 | if theme::tool(ui, "압축하기", theme::CREATE, idle, false).clicked() { |
| @@ -526,12 +537,21 @@ impl ArchiveApp { | ||
| 526 | 537 | ) |
| 527 | 538 | .show(root, |ui| { |
| 528 | 539 | ui.horizontal(|ui| { |
| 529 | 삭제: ui.label(format!( | |
| 530 | 삭제: "{}개 항목", | |
| 531 | 삭제: browser::rows(&self.model.entries, &self.folder, &self.search).len() | |
| 532 | 삭제: )); | |
| 540 | 추가: let width = (ui.available_width() - ui.spacing().item_spacing.x) / 2.0; | |
| 541 | 추가: theme::bounded_text( | |
| 542 | 추가: ui, | |
| 543 | 추가: &format!( | |
| 544 | 추가: "{}개 항목", | |
| 545 | 추가: browser::rows(&self.model.entries, &self.folder, &self.search).len() | |
| 546 | 추가: ), | |
| 547 | 추가: width, | |
| 548 | 추가: ); | |
| 533 | 549 | ui.with_layout(Layout::right_to_left(Align::Center), |ui| { |
| 534 | 삭제: ui.label(format!("선택 {}개", self.model.selected.len())); | |
| 550 | 추가: theme::bounded_text( | |
| 551 | 추가: ui, | |
| 552 | 추가: &format!("선택 {}개", self.model.selected.len()), | |
| 553 | 추가: width, | |
| 554 | 추가: ); | |
| 535 | 555 | }); |
| 536 | 556 | }); |
| 537 | 557 | }); |
| @@ -657,11 +677,16 @@ impl ArchiveApp { | ||
| 657 | 677 | self.browse_folder(&parent); |
| 658 | 678 | } |
| 659 | 679 | ui.label("현재 경로"); |
| 660 | 삭제: let mut path = format!("/{}", self.folder); | |
| 661 | 삭제: ui.add_sized( | |
| 662 | 삭제: [ui.available_width() - 270.0, 36.0], | |
| 663 | 삭제: egui::TextEdit::singleline(&mut path).interactive(false), | |
| 664 | 삭제: ); | |
| 680 | 추가: let path = format!("/{}", self.folder); | |
| 681 | 추가: let width = (ui.available_width() - 270.0).max(0.0); | |
| 682 | 추가: egui::Frame::new() | |
| 683 | 추가: .fill(theme::PANEL) | |
| 684 | 추가: .stroke(egui::Stroke::new(1.0, theme::BORDER)) | |
| 685 | 추가: .corner_radius(6) | |
| 686 | 추가: .inner_margin(egui::Margin::symmetric(8, 7)) | |
| 687 | 추가: .show(ui, |ui| { | |
| 688 | 추가: theme::bounded_text(ui, &path, (width - 18.0).max(0.0)); | |
| 689 | 추가: }); | |
| 665 | 690 | let (rect, _) = |
| 666 | 691 | ui.allocate_exact_size(egui::vec2(20.0, 20.0), egui::Sense::hover()); |
| 667 | 692 | theme::svg_icon(ui.painter(), rect, theme::SEARCH, theme::MUTED); |
| @@ -753,20 +778,23 @@ impl ArchiveApp { | ||
| 753 | 778 | ); |
| 754 | 779 | let label = ui |
| 755 | 780 | .allocate_ui_with_layout( |
| 756 | 삭제: egui::vec2(name_width - 28.0, 34.0), | |
| 781 | 추가: egui::vec2((name_width - 28.0).max(0.0), 34.0), | |
| 757 | 782 | Layout::left_to_right(Align::Center), |
| 758 | 783 | |ui| { |
| 759 | 삭제: ui.set_min_width(name_width - 28.0); | |
| 784 | 추가: ui.set_min_width((name_width - 28.0).max(0.0)); | |
| 785 | 추가: ui.set_max_width((name_width - 28.0).max(0.0)); | |
| 760 | 786 | ui.add_enabled( |
| 761 | 787 | !self.model.busy(), |
| 762 | 788 | egui::Button::new(&row.name) |
| 789 | 추가: .truncate() | |
| 763 | 790 | .selected(selected) |
| 764 | 791 | .frame(false) |
| 765 | 792 | .min_size(egui::vec2(0.0, 34.0)), |
| 766 | 793 | ) |
| 767 | 794 | }, |
| 768 | 795 | ) |
| 769 | 삭제: .inner; | |
| 796 | 추가: .inner | |
| 797 | 추가: .on_hover_text(&row.name); | |
| 770 | 798 | theme::focus(&label); |
| 771 | 799 | let enter = |
| 772 | 800 | label.has_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter)); |
| @@ -996,12 +1024,13 @@ impl ArchiveApp { | ||
| 996 | 1024 | .max_height(max_height) |
| 997 | 1025 | .show(ui, |ui| { |
| 998 | 1026 | if success { |
| 999 | 삭제: ui.label(match self.last_request.as_ref() { | |
| 1027 | 추가: let path = match self.last_request.as_ref() { | |
| 1000 | 1028 | Some(Start::CreateZip { output_file, .. }) => { |
| 1001 | 1029 | output_file.display().to_string() |
| 1002 | 1030 | } |
| 1003 | 1031 | _ => format!("{} 폴더에 저장했습니다.", self.destination.display()), |
| 1004 | 삭제: }); | |
| 1032 | 추가: }; | |
| 1033 | 추가: theme::bounded_text(ui, &path, ui.available_width()); | |
| 1005 | 1034 | } else if let Some(code) = t.as_ref().and_then(|t| t.error) { |
| 1006 | 1035 | ui.label(if creating && code == ErrorCode::SourceChanged { |
| 1007 | 1036 | "묶을 파일이 바뀌었습니다. 파일을 확인한 뒤 다시 만드세요" |
| @@ -1047,7 +1076,11 @@ impl ArchiveApp { | ||
| 1047 | 1076 | ui.label(error); |
| 1048 | 1077 | } |
| 1049 | 1078 | for (name, state) in &self.model.outputs { |
| 1050 | 삭제: ui.label(format!("{name}: {}", disposition_label(*state))); | |
| 1079 | 추가: theme::bounded_text( | |
| 1080 | 추가: ui, | |
| 1081 | 추가: &format!("{name}: {}", disposition_label(*state)), | |
| 1082 | 추가: ui.available_width(), | |
| 1083 | 추가: ); | |
| 1051 | 1084 | } |
| 1052 | 1085 | }); |
| 1053 | 1086 | } |
| @@ -1235,10 +1268,13 @@ impl ArchiveApp { | ||
| 1235 | 1268 | }, |
| 1236 | 1269 | 20.0, |
| 1237 | 1270 | ); |
| 1238 | 삭제: ui.label(present::middle_text( | |
| 1239 | 삭제: &path.file_name().unwrap_or_default().to_string_lossy(), | |
| 1240 | 삭제: 36, | |
| 1241 | 삭제: )) | |
| 1271 | 추가: let name = | |
| 1272 | 추가: path.file_name().unwrap_or_default().to_string_lossy(); | |
| 1273 | 추가: theme::bounded_text( | |
| 1274 | 추가: ui, | |
| 1275 | 추가: &name, | |
| 1276 | 추가: (ui.available_width() - 72.0).max(0.0), | |
| 1277 | 추가: ) | |
| 1242 | 1278 | .on_hover_text(path.display().to_string()); |
| 1243 | 1279 | if ui.button("빼기").clicked() { |
| 1244 | 1280 | remove = Some(index); |
| @@ -199,6 +199,37 @@ pub fn icon(ui: &mut egui::Ui, kind: Icon, size: f32) { | ||
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 추가: pub fn bounded_text(ui: &mut egui::Ui, text: &str, width: f32) -> egui::Response { | |
| 203 | 추가: let width = width.max(0.0); | |
| 204 | 추가: ui.allocate_ui_with_layout( | |
| 205 | 추가: egui::vec2(width, ui.text_style_height(&TextStyle::Body)), | |
| 206 | 추가: ui.layout().clone(), | |
| 207 | 추가: |ui| { | |
| 208 | 추가: ui.set_min_width(width); | |
| 209 | 추가: ui.set_max_width(width); | |
| 210 | 추가: ui.add(egui::Label::new(text).truncate()) | |
| 211 | 추가: }, | |
| 212 | 추가: ) | |
| 213 | 추가: .inner | |
| 214 | 추가: .on_hover_text(text) | |
| 215 | 추가: } | |
| 216 | 추가: | |
| 217 | 추가: pub fn window_title(ui: &egui::Ui, text: &str, width: f32) -> String { | |
| 218 | 추가: let mut job = | |
| 219 | 추가: egui::text::LayoutJob::simple_singleline(text.into(), FontId::proportional(BODY), TEXT); | |
| 220 | 추가: job.wrap = egui::text::TextWrapping { | |
| 221 | 추가: max_width: width.max(0.0), | |
| 222 | 추가: max_rows: 1, | |
| 223 | 추가: break_anywhere: true, | |
| 224 | 추가: ..Default::default() | |
| 225 | 추가: }; | |
| 226 | 추가: ui.fonts_mut(|fonts| fonts.layout_job(job)) | |
| 227 | 추가: .rows | |
| 228 | 추가: .iter() | |
| 229 | 추가: .flat_map(|row| row.glyphs.iter().map(|glyph| glyph.chr)) | |
| 230 | 추가: .collect() | |
| 231 | 추가: } | |
| 232 | 추가: | |
| 202 | 233 | pub fn column_label( |
| 203 | 234 | ui: &mut egui::Ui, |
| 204 | 235 | text: impl Into<egui::WidgetText>, |
| @@ -289,6 +289,48 @@ impl eframe::App for Capture { | ||
| 289 | 289 | } |
| 290 | 290 | if !self.triggered && self.app.model.list_id.is_some() { |
| 291 | 291 | self.triggered = true; |
| 292 | 추가: if self.mode.starts_with("long-") { | |
| 293 | 추가: let name = format!("{}.txt", "W".repeat(220)); | |
| 294 | 추가: let folder = "deep-folder/".repeat(30); | |
| 295 | 추가: let base = std::env::current_dir() | |
| 296 | 추가: .unwrap() | |
| 297 | 추가: .join("tests/ui-redesign/runs/fixtures"); | |
| 298 | 추가: self.app.model.archive = Some(base.join(&folder).join(format!("{name}.zip"))); | |
| 299 | 추가: if self.mode == "long-list" || self.mode == "long-folder" { | |
| 300 | 추가: self.app.model.entries = (0..5000) | |
| 301 | 추가: .map(|id| Entry { | |
| 302 | 추가: id, | |
| 303 | 추가: name: format!( | |
| 304 | 추가: "{}{id:04}-{name}", | |
| 305 | 추가: if self.mode == "long-folder" { | |
| 306 | 추가: folder.as_str() | |
| 307 | 추가: } else { | |
| 308 | 추가: "" | |
| 309 | 추가: } | |
| 310 | 추가: ), | |
| 311 | 추가: kind: Kind::File, | |
| 312 | 추가: bytes: Some(31), | |
| 313 | 추가: packed: None, | |
| 314 | 추가: encrypted: true, | |
| 315 | 추가: }) | |
| 316 | 추가: .collect(); | |
| 317 | 추가: if self.mode == "long-folder" { | |
| 318 | 추가: self.app.browse_folder(folder.trim_end_matches('/')); | |
| 319 | 추가: } | |
| 320 | 추가: } | |
| 321 | 추가: if self.mode == "long-create" { | |
| 322 | 추가: let source = base.join(&name); | |
| 323 | 추가: std::fs::write(&source, b"capture source").unwrap(); | |
| 324 | 추가: self.app.add_sources(vec![source]); | |
| 325 | 추가: self.app.show_create(false); | |
| 326 | 추가: } | |
| 327 | 추가: if self.mode == "long-result" { | |
| 328 | 추가: let destination = base.join(&folder); | |
| 329 | 추가: std::fs::create_dir_all(&destination).unwrap(); | |
| 330 | 추가: self.app.choose_destination(destination); | |
| 331 | 추가: self.app.begin_extract(); | |
| 332 | 추가: } | |
| 333 | 추가: } | |
| 292 | 334 | if self.mode == "toolbar-folder" { |
| 293 | 335 | self.app.browse_folder("Install"); |
| 294 | 336 | } |
| @@ -0,0 +1,211 @@ | ||
| 1 | 추가: fn narrow_frame( | |
| 2 | 추가: ctx: &egui::Context, | |
| 3 | 추가: app: &mut ArchiveApp, | |
| 4 | 추가: time: f64, | |
| 5 | 추가: events: Vec<egui::Event>, | |
| 6 | 추가: ) -> egui::FullOutput { | |
| 7 | 추가: let mut output = ctx.run_ui( | |
| 8 | 추가: egui::RawInput { | |
| 9 | 추가: screen_rect: Some(egui::Rect::from_min_size( | |
| 10 | 추가: egui::Pos2::ZERO, | |
| 11 | 추가: egui::vec2(760.0, 540.0), | |
| 12 | 추가: )), | |
| 13 | 추가: time: Some(time), | |
| 14 | 추가: events, | |
| 15 | 추가: ..Default::default() | |
| 16 | 추가: }, | |
| 17 | 추가: |ui| app.show(ui), | |
| 18 | 추가: ); | |
| 19 | 추가: output.textures_delta.clear(); | |
| 20 | 추가: output | |
| 21 | 추가: } | |
| 22 | 추가: | |
| 23 | 추가: fn layout_text(output: &egui::FullOutput) -> Vec<(String, egui::Rect, bool)> { | |
| 24 | 추가: fn walk(shape: &Shape, result: &mut Vec<(String, egui::Rect, bool)>) { | |
| 25 | 추가: match shape { | |
| 26 | 추가: Shape::Text(text) => result.push(( | |
| 27 | 추가: text.galley.job.text.clone(), | |
| 28 | 추가: text.galley.rect.translate(text.pos.to_vec2()), | |
| 29 | 추가: text.galley.elided, | |
| 30 | 추가: )), | |
| 31 | 추가: Shape::Vec(shapes) => { | |
| 32 | 추가: for shape in shapes { | |
| 33 | 추가: walk(shape, result); | |
| 34 | 추가: } | |
| 35 | 추가: } | |
| 36 | 추가: _ => {} | |
| 37 | 추가: } | |
| 38 | 추가: } | |
| 39 | 추가: let mut result = Vec::new(); | |
| 40 | 추가: for shape in &output.shapes { | |
| 41 | 추가: walk(&shape.shape, &mut result); | |
| 42 | 추가: } | |
| 43 | 추가: result | |
| 44 | 추가: } | |
| 45 | 추가: | |
| 46 | 추가: fn assert_narrow_text(output: &egui::FullOutput) { | |
| 47 | 추가: for (text, rect, _) in layout_text(output) { | |
| 48 | 추가: assert!( | |
| 49 | 추가: rect.left() >= -1.0 && rect.right() <= 761.0, | |
| 50 | 추가: "{text:?}: {rect:?}" | |
| 51 | 추가: ); | |
| 52 | 추가: } | |
| 53 | 추가: } | |
| 54 | 추가: | |
| 55 | 추가: fn assert_full_tooltip(ctx: &egui::Context, app: &mut ArchiveApp, point: egui::Pos2, full: &str) { | |
| 56 | 추가: ctx.style_mut_of(egui::Theme::Light, |style| { | |
| 57 | 추가: style.interaction.tooltip_delay = 0.0 | |
| 58 | 추가: }); | |
| 59 | 추가: let mut output = narrow_frame(ctx, app, 10.0, vec![egui::Event::PointerMoved(point)]); | |
| 60 | 추가: for time in [11.0, 12.0, 13.0] { | |
| 61 | 추가: output = narrow_frame(ctx, app, time, vec![]); | |
| 62 | 추가: } | |
| 63 | 추가: assert!( | |
| 64 | 추가: layout_text(&output) | |
| 65 | 추가: .iter() | |
| 66 | 추가: .any(|(text, _, elided)| text == full && !elided), | |
| 67 | 추가: "전체 툴팁 없음: {full} point={point:?} shown={:?}", | |
| 68 | 추가: layout_text(&output) | |
| 69 | 추가: ); | |
| 70 | 추가: assert_narrow_text(&output); | |
| 71 | 추가: } | |
| 72 | 추가: | |
| 73 | 추가: #[test] | |
| 74 | 추가: fn narrow_archive_keeps_columns_and_virtualizes_thousands_of_long_names() { | |
| 75 | 추가: let scratch = Folder::new(); | |
| 76 | 추가: let factory = FakeFactory::default(); | |
| 77 | 추가: let mut app = loaded(&scratch, &factory); | |
| 78 | 추가: let name = format!("{}.txt", "W".repeat(220)); | |
| 79 | 추가: app.model.entries = (0..5000) | |
| 80 | 추가: .map(|id| Entry { | |
| 81 | 추가: id, | |
| 82 | 추가: name: format!("{id:04}-{name}"), | |
| 83 | 추가: kind: Kind::File, | |
| 84 | 추가: bytes: Some(31), | |
| 85 | 추가: packed: None, | |
| 86 | 추가: encrypted: true, | |
| 87 | 추가: }) | |
| 88 | 추가: .collect(); | |
| 89 | 추가: app.model.selected = (0..5000).collect(); | |
| 90 | 추가: app.model.archive = Some( | |
| 91 | 추가: scratch | |
| 92 | 추가: .0 | |
| 93 | 추가: .join("deep-folder/".repeat(30)) | |
| 94 | 추가: .join(format!("{name}.zip")), | |
| 95 | 추가: ); | |
| 96 | 추가: let full_title = format!("{} — Zipelo", app.model.archive.as_ref().unwrap().display()); | |
| 97 | 추가: let ctx = egui::Context::default(); | |
| 98 | 추가: narrow_frame(&ctx, &mut app, 0.0, vec![]); | |
| 99 | 추가: let output = narrow_frame(&ctx, &mut app, 1.0, vec![]); | |
| 100 | 추가: assert_narrow_text(&output); | |
| 101 | 추가: let text = layout_text(&output); | |
| 102 | 추가: assert!(text.len() < 100); | |
| 103 | 추가: let first = text | |
| 104 | 추가: .iter() | |
| 105 | 추가: .find(|(text, _, _)| text == &format!("0000-{name}")) | |
| 106 | 추가: .unwrap(); | |
| 107 | 추가: assert!(first.2); | |
| 108 | 추가: assert!( | |
| 109 | 추가: text.iter() | |
| 110 | 추가: .any(|(text, rect, _)| text == "31 B" && rect.right() < 720.0) | |
| 111 | 추가: ); | |
| 112 | 추가: for expected in ["크기", "암호", "5000개 항목", "선택 5000개"] { | |
| 113 | 추가: assert!(text.iter().any(|(text, _, _)| text == expected)); | |
| 114 | 추가: } | |
| 115 | 추가: let title = output | |
| 116 | 추가: .viewport_output | |
| 117 | 추가: .values() | |
| 118 | 추가: .flat_map(|v| &v.commands) | |
| 119 | 추가: .find_map(|cmd| match cmd { | |
| 120 | 추가: egui::ViewportCommand::Title(title) => Some(title), | |
| 121 | 추가: _ => None, | |
| 122 | 추가: }) | |
| 123 | 추가: .unwrap(); | |
| 124 | 추가: assert!(title.contains('…') && title.ends_with(" — Zipelo")); | |
| 125 | 추가: assert!(title.chars().count() < full_title.chars().count()); | |
| 126 | 추가: assert_full_tooltip(&ctx, &mut app, first.1.center(), &first.0); | |
| 127 | 추가: let output = narrow_frame(&ctx, &mut app, 14.0, vec![egui::Event::PointerGone]); | |
| 128 | 추가: let point = layout_text(&output) | |
| 129 | 추가: .into_iter() | |
| 130 | 추가: .find(|(text, _, _)| text == "열기") | |
| 131 | 추가: .unwrap() | |
| 132 | 추가: .1 | |
| 133 | 추가: .center(); | |
| 134 | 추가: assert_full_tooltip(&ctx, &mut app, point, &full_title); | |
| 135 | 추가: } | |
| 136 | 추가: | |
| 137 | 추가: #[test] | |
| 138 | 추가: fn narrow_deep_folder_path_is_elided_without_displacing_search() { | |
| 139 | 추가: let scratch = Folder::new(); | |
| 140 | 추가: let factory = FakeFactory::default(); | |
| 141 | 추가: let mut app = loaded(&scratch, &factory); | |
| 142 | 추가: let folder = "deep-folder/".repeat(40).trim_end_matches('/').to_owned(); | |
| 143 | 추가: app.model.entries[0].name = format!("{folder}/file.txt"); | |
| 144 | 추가: app.browse_folder(&folder); | |
| 145 | 추가: let ctx = egui::Context::default(); | |
| 146 | 추가: narrow_frame(&ctx, &mut app, 0.0, vec![]); | |
| 147 | 추가: let output = narrow_frame(&ctx, &mut app, 1.0, vec![]); | |
| 148 | 추가: assert_narrow_text(&output); | |
| 149 | 추가: let text = layout_text(&output); | |
| 150 | 추가: let full = format!("/{folder}"); | |
| 151 | 추가: let path = text.iter().find(|(text, _, _)| text == &full).unwrap(); | |
| 152 | 추가: assert!(path.2); | |
| 153 | 추가: assert!( | |
| 154 | 추가: text.iter() | |
| 155 | 추가: .any(|(text, rect, _)| text == "파일 찾기" && rect.right() < 760.0) | |
| 156 | 추가: ); | |
| 157 | 추가: assert_full_tooltip(&ctx, &mut app, path.1.center(), &full); | |
| 158 | 추가: } | |
| 159 | 추가: | |
| 160 | 추가: #[test] | |
| 161 | 추가: fn narrow_create_sources_keep_remove_and_footer_actions_visible() { | |
| 162 | 추가: let scratch = Folder::new(); | |
| 163 | 추가: let factory = FakeFactory::default(); | |
| 164 | 추가: let mut app = loaded(&scratch, &factory); | |
| 165 | 추가: let name = format!("{}.txt", "W".repeat(220)); | |
| 166 | 추가: let path = scratch.0.join(&name); | |
| 167 | 추가: fs::write(&path, b"source").unwrap(); | |
| 168 | 추가: app.add_sources(vec![path]); | |
| 169 | 추가: app.show_create(false); | |
| 170 | 추가: let ctx = egui::Context::default(); | |
| 171 | 추가: narrow_frame(&ctx, &mut app, 0.0, vec![]); | |
| 172 | 추가: let output = narrow_frame(&ctx, &mut app, 1.0, vec![]); | |
| 173 | 추가: assert_narrow_text(&output); | |
| 174 | 추가: let text = layout_text(&output); | |
| 175 | 추가: assert!( | |
| 176 | 추가: text.iter() | |
| 177 | 추가: .any(|(text, _, elided)| text == &name && *elided) | |
| 178 | 추가: ); | |
| 179 | 추가: for expected in ["빼기", "취소", "압축하기"] { | |
| 180 | 추가: assert!( | |
| 181 | 추가: text.iter() | |
| 182 | 추가: .any(|(text, rect, _)| text == expected && rect.bottom() <= 540.0) | |
| 183 | 추가: ); | |
| 184 | 추가: } | |
| 185 | 추가: } | |
| 186 | 추가: | |
| 187 | 추가: #[test] | |
| 188 | 추가: fn narrow_result_path_is_elided_and_full_path_remains_in_tooltip() { | |
| 189 | 추가: let scratch = Folder::new(); | |
| 190 | 추가: let factory = FakeFactory::default(); | |
| 191 | 추가: let mut app = loaded(&scratch, &factory); | |
| 192 | 추가: let output_path = scratch.0.join("nested-output/".repeat(30)); | |
| 193 | 추가: fs::create_dir_all(&output_path).unwrap(); | |
| 194 | 추가: app.choose_destination(output_path.clone()); | |
| 195 | 추가: assert!(app.begin_extract()); | |
| 196 | 추가: pump(&mut app.model); | |
| 197 | 추가: let ctx = egui::Context::default(); | |
| 198 | 추가: for frame in 0..8 { | |
| 199 | 추가: narrow_frame(&ctx, &mut app, frame as f64 / 10.0, vec![]); | |
| 200 | 추가: } | |
| 201 | 추가: let output = narrow_frame(&ctx, &mut app, 1.0, vec![]); | |
| 202 | 추가: assert_narrow_text(&output); | |
| 203 | 추가: let text = layout_text(&output); | |
| 204 | 추가: let full = format!("{} 폴더에 저장했습니다.", output_path.display()); | |
| 205 | 추가: let path = text.iter().find(|(text, _, _)| text == &full).unwrap(); | |
| 206 | 추가: assert!(path.2); | |
| 207 | 추가: for expected in ["확인", "폴더 열기"] { | |
| 208 | 추가: assert!(text.iter().any(|(text, _, _)| text == expected)); | |
| 209 | 추가: } | |
| 210 | 추가: assert_full_tooltip(&ctx, &mut app, path.1.center(), &full); | |
| 211 | 추가: } |
| @@ -902,6 +902,7 @@ mod widgets { | ||
| 902 | 902 | } |
| 903 | 903 | } |
| 904 | 904 | include!("toolbar.rs"); |
| 905 | 추가: include!("long_layout.rs"); | |
| 905 | 906 | } |
| 906 | 907 | |
| 907 | 908 | #[cfg(feature = "ui")] |
| @@ -20,6 +20,8 @@ Enter는 초점이 있는 버튼만 활성화하며 암호 입력란 제출만 | ||
| 20 | 20 | |
| 21 | 21 | Linux는 rfd가 사용하는 기존 ashpd backend의 오류 응답을 직접 받아 사용자 취소와 구분함. portal_response_distinguishes_cancellation_from_backend_failure는 취소 코드, backend 실패와 잘못된 성공 응답을 구분함. missing_portal_returns_errors_for_every_dialog는 별도 자식 프로세스의 연결 불가 bus로 실제 native backend 8개 경로를 확인하며 부모의 세션 환경은 바꾸지 않음. dialog_failures_show_alerts_while_cancelled_dialogs_remain_silent는 열기, 파일 추가, 폴더 추가, 풀 위치, ZIP 저장과 GZ 저장에서 실패 안내와 취소 무작업을 대조함. |
| 22 | 22 | |
| 23 | 추가: 760px 화면의 긴 텍스트는 long_layout.rs에서 확인함. 220자 이름과 깊은 경로, 5,000개 항목에서도 크기와 암호 열, 검색, 상태 줄과 모달 버튼이 화면 안에 유지되는지 실제 글자 배치로 검증함. 이름과 현재 경로 및 결과 경로는 말줄임과 전체 텍스트 툴팁을 확인함. 창 제목은 폭에 맞춰 줄이고 전체 압축파일 경로는 열기 버튼의 툴팁에서 확인함. screenshots/long-layout에 목록, 깊은 폴더, ZIP 만들기와 결과 화면을 기록함. | |
| 24 | 추가: | |
| 23 | 25 | ## 화면 재현 |
| 24 | 26 | |
| 25 | 27 | Xvfb, xdotool, ImageMagick import와 시스템 CJK 글꼴이 필요함. 촬영 실행 파일은 실제 eframe 컴포넌트에 합성 목록을 전달하며 압축파일을 읽거나 결과물을 저장하지 않음. |
| @@ -0,0 +1,26 @@ | ||
| 1 | 추가: [ | |
| 2 | 추가: { | |
| 3 | 추가: "state": "long-list", | |
| 4 | 추가: "path": "tests/ui-redesign/screenshots/long-layout/long-list.png", | |
| 5 | 추가: "width": 760, | |
| 6 | 추가: "height": 540 | |
| 7 | 추가: }, | |
| 8 | 추가: { | |
| 9 | 추가: "state": "long-folder", | |
| 10 | 추가: "path": "tests/ui-redesign/screenshots/long-layout/long-folder.png", | |
| 11 | 추가: "width": 760, | |
| 12 | 추가: "height": 540 | |
| 13 | 추가: }, | |
| 14 | 추가: { | |
| 15 | 추가: "state": "long-create", | |
| 16 | 추가: "path": "tests/ui-redesign/screenshots/long-layout/long-create.png", | |
| 17 | 추가: "width": 760, | |
| 18 | 추가: "height": 540 | |
| 19 | 추가: }, | |
| 20 | 추가: { | |
| 21 | 추가: "state": "long-result", | |
| 22 | 추가: "path": "tests/ui-redesign/screenshots/long-layout/long-result.png", | |
| 23 | 추가: "width": 760, | |
| 24 | 추가: "height": 540 | |
| 25 | 추가: } | |
| 26 | 추가: ] |
바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기