team-ljyzipelo

공개

생성 보고가 없는 이름 변경의 완료 안내를 막음

작성자
호시노 히나타
작성 시각
커밋
a175bb319e4421abe7022f31be92410ab97e82a6
부모
bfb8ad9
이 시점의 파일 보기

변경된 파일 4개

+121-14
수정docs/ui-scenario-guide.md+1-0
@@ -100,5 +100,6 @@ python3 tests/ci/run_rust.py local
100100- conflict-apply: "나머지 파일에도 같게 적용"이 켜진 상태입니다. 현재 작업의 남은 일반 파일 충돌에만 적용하며 이름 바꿔 저장은 같은 폴더에 번호를 붙입니다.
101101- extract-skipped: 모든 파일을 건너뛴 정상 완료입니다. 생성된 파일이 없으며 저장 실패 경고가 없어야 합니다.
102102- extract-renamed: 실제 저장된 새 이름을 표시합니다. 이름 변경 결과만으로 저장 성공을 판정하지 않고 별도의 생성 보고와 완료 집계가 일치해야 합니다.
103추가: - extract-rename-failed: 새 이름을 정한 뒤 실제 생성 보고 없이 I/O 오류가 난 결과입니다. 실패 원인과 "아무 파일도 풀지 않았습니다"를 표시하고 "이름 바꿔 저장" 완료 안내는 표시하지 않아야 합니다. 일부 파일이 저장된 뒤 실패한 경우에도 생성 보고가 있는 이름만 저장 완료로 표시합니다.
103104
104105현재 충돌 화면과 클라이언트 연동은 준비 단계입니다. 작업자 런타임이 완성되기 전에는 실제 추출 요청을 기존 Start로 유지하며 StartInteractive를 보내지 않습니다. 위 명령은 실제 파일을 쓰지 않는 개발용 화면 미리보기입니다.
수정experiments/rust-ui-memory-app/src/archive_screen.rs+11-6
@@ -1803,6 +1803,13 @@ impl ArchiveApp {
18031803 .iter()
18041804 .filter(|r| r.choice == ConflictChoice::Skip)
18051805 .count();
1806추가: let created_names = self
1807추가: .model
1808추가: .outputs
1809추가: .iter()
1810추가: .filter(|(_, disposition)| *disposition == Disposition::Created)
1811추가: .map(|(name, _)| name.replace('\\', "/"))
1812추가: .collect::<BTreeSet<_>>();
18061813 let warnings = if listing {
18071814 Vec::new()
18081815 } else {
@@ -1898,12 +1905,10 @@ impl ArchiveApp {
18981905 if skipped > 0 {
18991906 ui.label(format!("건너뛴 파일 {skipped}개"));
19001907 }
1901삭제: for resolution in self
1902삭제: .model
1903삭제: .resolutions
1904삭제: .iter()
1905삭제: .filter(|r| r.choice == ConflictChoice::Rename)
1906삭제: {
1908추가: for resolution in self.model.resolutions.iter().filter(|r| {
1909추가: r.choice == ConflictChoice::Rename
1910추가: && created_names.contains(&r.relative_name.replace('\\', "/"))
1911추가: }) {
19071912 theme::bounded_text(
19081913 ui,
19091914 &format!("이름 바꿔 저장: {}", resolution.relative_name),
수정tests/rust-app-ui/scenario_tests.rs+92-0
@@ -98,6 +98,7 @@ fn every_listed_scenario_draws_and_keeps_its_expected_screen() {
9898 let expected = match scenario.name {
9999 "conflict-choice" | "conflict-apply" => "나머지 파일에도 같게 적용",
100100 "extract-skipped" => "모든 파일을 건너뛰었습니다",
101추가: "extract-rename-failed" => "아무 파일도 풀지 않았습니다",
101102 "extract-renamed" => "이름 바꿔 저장: 읽어주세요 (1).txt",
102103 "empty" => "압축파일",
103104 "folder-empty" => "이 폴더는 비어 있습니다",
@@ -122,6 +123,10 @@ fn every_listed_scenario_draws_and_keeps_its_expected_screen() {
122123 _ => "읽어주세요.txt",
123124 };
124125 assert!(labels.contains(expected), "{}: {labels}", scenario.name);
126추가: if scenario.name == "extract-rename-failed" {
127추가: assert!(labels.contains("파일을 읽거나 쓰지 못했습니다"), "{labels}");
128추가: assert!(!labels.contains("이름 바꿔 저장:"), "{labels}");
129추가: }
125130 if scenario.name == "many-items" {
126131 assert_eq!(app.model.entries.len(), 505);
127132 }
@@ -192,3 +197,90 @@ fn preview_ignores_password_submission() {
192197 assert_eq!(preview.0.model.challenge, Some((17, 1, false)));
193198 assert!(preview.0.model.busy());
194199}
200추가:
201추가: fn result_labels(
202추가: app: &mut zipelo_ui_memory_app::archive_screen::ArchiveApp,
203추가: size: egui::Vec2,
204추가: ) -> String {
205추가: let ctx = egui::Context::default();
206추가: let mut labels = String::new();
207추가: for _ in 0..3 {
208추가: let mut output = ctx.run_ui(
209추가: egui::RawInput {
210추가: screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, size)),
211추가: ..Default::default()
212추가: },
213추가: |ui| app.show(ui),
214추가: );
215추가: labels = text(&output.shapes);
216추가: output.textures_delta.clear();
217추가: }
218추가: labels
219추가: }
220추가:
221추가: #[test]
222추가: fn rename_without_created_output_never_claims_saved_name() {
223추가: use zipelo_ui_memory_app::archive_ui::*;
224추가: for size in [egui::vec2(1060.0, 720.0), egui::vec2(760.0, 540.0)] {
225추가: for disposition in [
226추가: None,
227추가: Some(Disposition::PartialRetained),
228추가: Some(Disposition::Removed),
229추가: Some(Disposition::CommitUncertain),
230추가: ] {
231추가: let mut app = scenarios::parse("extract-renamed").unwrap().build();
232추가: app.model.outputs = disposition
233추가: .into_iter()
234추가: .map(|d| ("읽어주세요 (1).txt".into(), d))
235추가: .collect();
236추가: app.model.terminal = Some(Terminal {
237추가: outcome: Outcome::Failed,
238추가: error: Some(ErrorCode::Io),
239추가: publication: if disposition.is_none() {
240추가: Publication::None
241추가: } else {
242추가: Publication::Uncertain
243추가: },
244추가: created_count: 0,
245추가: retained_partial_count: 0,
246추가: durability: Durability::NotApplicable,
247추가: cleanup: Cleanup::Complete,
248추가: });
249추가: let labels = result_labels(&mut app, size);
250추가: assert!(labels.contains("파일을 읽거나 쓰지 못했습니다"), "{labels}");
251추가: if disposition.is_none() {
252추가: assert!(labels.contains("아무 파일도 풀지 않았습니다"), "{labels}");
253추가: }
254추가: assert!(
255추가: !labels.contains("이름 바꿔 저장: 읽어주세요 (1).txt"),
256추가: "{labels}"
257추가: );
258추가: }
259추가: }
260추가: }
261추가:
262추가: #[test]
263추가: fn rename_saved_before_later_failure_remains_reported() {
264추가: use zipelo_ui_memory_app::archive_ui::*;
265추가: for size in [egui::vec2(1060.0, 720.0), egui::vec2(760.0, 540.0)] {
266추가: let mut app = scenarios::parse("extract-renamed").unwrap().build();
267추가: app.model.resolutions.push(Resolution {
268추가: entry_id: 2,
269추가: relative_name: "여행 일정 (1).pdf".into(),
270추가: choice: ConflictChoice::Rename,
271추가: });
272추가: app.model.terminal.as_mut().unwrap().outcome = Outcome::Failed;
273추가: app.model.terminal.as_mut().unwrap().error = Some(ErrorCode::Io);
274추가: app.model.terminal.as_mut().unwrap().publication = Publication::Partial;
275추가: let labels = result_labels(&mut app, size);
276추가: assert!(
277추가: labels.contains("이름 바꿔 저장: 읽어주세요 (1).txt"),
278추가: "{labels}"
279추가: );
280추가: assert!(
281추가: !labels.contains("이름 바꿔 저장: 여행 일정 (1).pdf"),
282추가: "{labels}"
283추가: );
284추가: assert!(labels.contains("파일을 읽거나 쓰지 못했습니다"), "{labels}");
285추가: }
286추가: }
수정tests/rust-app-ui/scenarios.rs+17-8
@@ -25,6 +25,7 @@ catalog! {
2525 "conflict-apply" => "남은 충돌에 같은 선택 적용",
2626 "extract-skipped" => "모든 파일을 건너뛴 정상 완료",
2727 "extract-renamed" => "이름을 바꿔 저장한 완료 결과",
28추가: "extract-rename-failed" => "새 이름을 정한 뒤 저장 전 I/O 실패",
2829 "empty" => "빈 첫 화면",
2930 "archive" => "폴더와 파일이 있는 압축파일",
3031 "folder" => "사진 하위 폴더",
@@ -277,7 +278,10 @@ impl Scenario {
277278 "사진/풍경.jpg".into(),
278279 ])
279280 });
280삭제: if matches!(self.name, "extract-skipped" | "extract-renamed") {
281추가: if matches!(
282추가: self.name,
283추가: "extract-skipped" | "extract-renamed" | "extract-rename-failed"
284추가: ) {
281285 app.targets = Some(["읽어주세요.txt".into()].into_iter().collect());
282286 app.directories.clear();
283287 }
@@ -295,7 +299,8 @@ impl Scenario {
295299 existing_size: 2048,
296300 }));
297301 }
298삭제: "extract-skipped" | "extract-renamed" => {
302추가: "extract-skipped" | "extract-renamed" | "extract-rename-failed" => {
303추가: let failed = self.name == "extract-rename-failed";
299304 let skip = self.name == "extract-skipped";
300305 let name = if skip {
301306 "읽어주세요.txt"
@@ -311,7 +316,7 @@ impl Scenario {
311316 ConflictChoice::Rename
312317 },
313318 }));
314삭제: if !skip {
319추가: if !skip && !failed {
315320 state.frame(Event::Output {
316321 entry_id: Some(1),
317322 relative_name: name.into(),
@@ -319,16 +324,20 @@ impl Scenario {
319324 });
320325 }
321326 state.frame(Event::Terminal(Terminal {
322삭제: outcome: Outcome::Completed,
323삭제: error: None,
324삭제: publication: if skip {
327추가: outcome: if failed {
328추가: Outcome::Failed
329추가: } else {
330추가: Outcome::Completed
331추가: },
332추가: error: failed.then_some(ErrorCode::Io),
333추가: publication: if skip || failed {
325334 Publication::None
326335 } else {
327336 Publication::Complete
328337 },
329삭제: created_count: u64::from(!skip),
338추가: created_count: u64::from(!skip && !failed),
330339 retained_partial_count: 0,
331삭제: durability: if skip {
340추가: durability: if skip || failed {
332341 Durability::NotApplicable
333342 } else {
334343 Durability::Synced