한도 초과 결과를 주 창 모달로 표시한다
- 작성자
- 호시노 히나타
- 작성 시각
- 커밋
f2d6db3b62609b66c891576e711f6e88ceb345a8- 부모
- fe316c7
변경된 파일 4개
+54-33| @@ -102,8 +102,8 @@ TAR.BZ2와 TAR.XZ의 자동 해제 폴더 이름은 미리보기에 표시되지 | ||
| 102 | 102 | |
| 103 | 103 | - resource-approval: 목록에서 큰 작업임을 확인한 뒤 처리 전 승인을 묻는 화면 |
| 104 | 104 | - resource-ratio: 압축률 경고와 미확인 예상값을 표시하는 화면 |
| 105 | 삭제: - resource-retry: 출력 없이 한도에 걸린 뒤 "한도를 늘려 다시 시도"를 고르는 화면 | |
| 106 | 삭제: - resource-partial: 일부 파일을 저장한 뒤 한도에 걸려 저장 위치를 안내하는 화면 | |
| 105 | 추가: - resource-retry: 출력 없이 한도에 걸린 뒤 주 창 안의 모달에서 "한도를 늘려 다시 시도"를 고르는 화면 | |
| 106 | 추가: - resource-partial: 일부 파일을 저장한 뒤 한도에 걸려 주 창 안의 모달에서 저장 위치를 안내하는 화면 | |
| 107 | 107 | |
| 108 | 108 | 일반 작업은 16 GiB와 10,000개 한도를 유지하며 압축률을 감시합니다. |
| 109 | 109 | 목록이나 선택한 일반 파일의 크기로 한도 초과를 알면 처리 전에 작업자가 확대 승인을 묻습니다. |
| @@ -121,3 +121,5 @@ Enter만으로 허용하지 않습니다. 기존 작업자로 자동 재시도 | ||
| 121 | 121 | 승인된 작업의 목록 한도는 200,000개입니다. 출력 기록에는 압축파일에 따로 적혀 있지 않은 |
| 122 | 122 | 상위 폴더도 포함되므로 작업자 메타데이터 정책과 같은 262,144개 노드까지 보관합니다. |
| 123 | 123 | 기본 작업의 출력 기록 한도는 100,000개를 유지합니다. 이 기록 정책 수정은 화면 요소를 바꾸지 않습니다. |
| 124 | 추가: | |
| 125 | 추가: 한도 초과 결과는 별도 운영체제 창 대신 주 창 안의 모달로 표시합니다. Wayland에서도 파일 경로로 실행한 직후 Alt+Tab 없이 결과와 재시도 버튼이 보여야 합니다. "확인"으로 닫으며, 일부 출력이 남은 경우 확대 재시도는 제공하지 않습니다. |
| @@ -987,7 +987,7 @@ impl ArchiveApp { | ||
| 987 | 987 | ); |
| 988 | 988 | theme::status_text(ui, rect, &format!("선택 {selected}개"), half, Align::Max); |
| 989 | 989 | }); |
| 990 | 삭제: if ctx.embed_viewports() && self.work_visible() { | |
| 990 | 추가: if ctx.embed_viewports() && self.work_visible() && !self.limit_result_visible() { | |
| 991 | 991 | // 별도 창을 만들 수 없을 때만 쓰는 대체 배치. 목록을 가리지 않도록 하단에 둠. |
| 992 | 992 | egui::Panel::bottom("archive-work") |
| 993 | 993 | .frame(theme::panel(theme::PANEL).corner_radius(0)) |
| @@ -1008,6 +1008,7 @@ impl ArchiveApp { | ||
| 1008 | 1008 | }); |
| 1009 | 1009 | self.forget_password_history(&ctx); |
| 1010 | 1010 | self.work_window(&ctx); |
| 1011 | 추가: self.limit_result_dialog(&ctx); | |
| 1011 | 1012 | self.create_window(&ctx); |
| 1012 | 1013 | if self.model.challenge.is_some() { |
| 1013 | 1014 | self.password_dialog(&ctx, new_challenge); |
| @@ -1571,6 +1572,26 @@ impl ArchiveApp { | ||
| 1571 | 1572 | }) |
| 1572 | 1573 | } |
| 1573 | 1574 | |
| 1575 | 추가: fn limit_result_visible(&self) -> bool { | |
| 1576 | 추가: self.result_visible() | |
| 1577 | 추가: && self | |
| 1578 | 추가: .model | |
| 1579 | 추가: .terminal | |
| 1580 | 추가: .as_ref() | |
| 1581 | 추가: .is_some_and(|terminal| terminal.error == Some(ErrorCode::Limit)) | |
| 1582 | 추가: } | |
| 1583 | 추가: | |
| 1584 | 추가: fn limit_result_dialog(&mut self, ctx: &egui::Context) { | |
| 1585 | 추가: if !self.limit_result_visible() || self.main_modal_open() { | |
| 1586 | 추가: return; | |
| 1587 | 추가: } | |
| 1588 | 추가: egui::Modal::new(egui::Id::new("archive-limit-result")).show(ctx, |ui| { | |
| 1589 | 추가: ui.set_width((ctx.content_rect().width() - 64.0).min(WORK_WIDTH)); | |
| 1590 | 추가: ui.heading("작업 결과"); | |
| 1591 | 추가: self.work_area(ui); | |
| 1592 | 추가: }); | |
| 1593 | 추가: } | |
| 1594 | 추가: | |
| 1574 | 1595 | fn error_notice(ui: &mut egui::Ui, error: &str) { |
| 1575 | 1596 | let response = theme::panel(theme::ERROR_BG) |
| 1576 | 1597 | .show(ui, |ui| { |
| @@ -1603,6 +1624,10 @@ impl ArchiveApp { | ||
| 1603 | 1624 | self.work = WorkWindow::default(); |
| 1604 | 1625 | return; |
| 1605 | 1626 | } |
| 1627 | 추가: if self.limit_result_visible() { | |
| 1628 | 추가: self.work.open = false; | |
| 1629 | 추가: return; | |
| 1630 | 추가: } | |
| 1606 | 1631 | if ctx.embed_viewports() { |
| 1607 | 1632 | // 별도 창을 만들 수 없는 환경(시험 등)은 show()에서 하단에 그림. |
| 1608 | 1633 | return; |
| @@ -23,8 +23,8 @@ macro_rules! catalog { | ||
| 23 | 23 | catalog! { |
| 24 | 24 | "resource-approval" => "처리 전 큰 작업 승인", |
| 25 | 25 | "resource-ratio" => "고압축 작업 경고와 미확인 값", |
| 26 | 삭제: "resource-retry" => "출력 없는 한도 실패 후 확대 재시도", | |
| 27 | 삭제: "resource-partial" => "일부 출력 후 한도 중단", | |
| 26 | 추가: "resource-retry" => "주 창 모달에서 출력 없는 한도 실패 후 확대 재시도", | |
| 27 | 추가: "resource-partial" => "주 창 모달에서 일부 출력 후 한도 중단", | |
| 28 | 28 | "empty" => "빈 첫 화면", |
| 29 | 29 | "archive" => "폴더와 파일이 있는 압축파일", |
| 30 | 30 | "tar-bz2" => "TAR.BZ2 목록과 자동 해제 폴더", |
| @@ -639,7 +639,7 @@ fn resource_prompt_is_not_covered_by_separate_work_window() { | ||
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | #[test] |
| 642 | 삭제: fn expanded_retry_action_fits_native_work_window_and_starts_a_new_job() { | |
| 642 | 추가: fn limit_result_uses_main_modal_and_retry_starts_a_new_job() { | |
| 643 | 643 | let factory = FakeFactory::manual(); |
| 644 | 644 | let mut app = ArchiveApp::new(Box::new(factory.clone()), None, false); |
| 645 | 645 | app.open_path(std::env::current_dir().unwrap().join("large.zip")); |
| @@ -669,34 +669,28 @@ fn expanded_retry_action_fits_native_work_window_and_starts_a_new_job() { | ||
| 669 | 669 | policy_render(&ctx, &mut app, vec![]); |
| 670 | 670 | } |
| 671 | 671 | assert!(app.model.can_retry_expanded()); |
| 672 | 삭제: let point = work_child_label("한도를 늘려 다시 시도").unwrap(); | |
| 673 | 삭제: let width = WORK_CHILD.with(|child| { | |
| 674 | 삭제: child | |
| 675 | 삭제: .borrow() | |
| 676 | 삭제: .builders | |
| 677 | 삭제: .last() | |
| 678 | 삭제: .unwrap() | |
| 679 | 삭제: .1 | |
| 680 | 삭제: .inner_size | |
| 681 | 삭제: .unwrap() | |
| 682 | 삭제: .x | |
| 683 | 삭제: }); | |
| 684 | 삭제: let text_width = ctx.fonts_mut(|fonts| { | |
| 685 | 삭제: fonts | |
| 686 | 삭제: .layout_no_wrap( | |
| 687 | 삭제: "한도를 늘려 다시 시도".into(), | |
| 688 | 삭제: egui::FontId::proportional(16.0), | |
| 689 | 삭제: egui::Color32::BLACK, | |
| 690 | 삭제: ) | |
| 691 | 삭제: .size() | |
| 692 | 삭제: .x | |
| 693 | 삭제: }); | |
| 694 | 삭제: assert!( | |
| 695 | 삭제: point.x + text_width / 2.0 <= width - 16.0, | |
| 696 | 삭제: "버튼 글자가 창을 벗어남: {point:?} / {text_width} / {width}" | |
| 697 | 삭제: ); | |
| 698 | 삭제: work_child_click(&ctx, &mut app, point); | |
| 672 | 추가: let rendered = WORK_CHILD.with(|child| child.borrow().rendered); | |
| 673 | 추가: let shown = policy_render(&ctx, &mut app, vec![]); | |
| 674 | 추가: assert!(shown.iter().any(|(text, _)| text == "한도를 늘려 다시 시도")); | |
| 675 | 추가: assert_eq!(WORK_CHILD.with(|child| child.borrow().rendered), rendered); | |
| 676 | 추가: policy_click(&ctx, &mut app, "한도를 늘려 다시 시도"); | |
| 699 | 677 | assert!(app.model.busy()); |
| 700 | 678 | assert_ne!(app.model.job_id(), Some(old_job)); |
| 701 | 679 | assert!(factory.state.borrow().expanded); |
| 702 | 680 | } |
| 681 | 추가: | |
| 682 | 추가: | |
| 683 | 추가: #[test] | |
| 684 | 추가: fn partial_limit_result_is_visible_in_main_modal_without_native_child() { | |
| 685 | 추가: let ctx = egui::Context::default(); | |
| 686 | 추가: ctx.set_embed_viewports(false); | |
| 687 | 추가: install_work_child_renderer(); | |
| 688 | 추가: let mut app = zipelo_ui_memory_app::archive_screen::scenarios::parse("resource-partial").unwrap().build(); | |
| 689 | 추가: let mut shown = Vec::new(); | |
| 690 | 추가: for _ in 0..3 { | |
| 691 | 추가: shown = policy_render(&ctx, &mut app, vec![]); | |
| 692 | 추가: } | |
| 693 | 추가: assert!(shown.iter().any(|(text, _)| text.contains("저장 위치를 확인하세요"))); | |
| 694 | 추가: assert!(!shown.iter().any(|(text, _)| text == "한도를 늘려 다시 시도")); | |
| 695 | 추가: assert_eq!(WORK_CHILD.with(|child| child.borrow().rendered), 0); | |
| 696 | 추가: } |