생성 보고가 없는 이름 변경의 완료 안내를 막음
- 작성자
- 호시노 히나타
- 작성 시각
- 커밋
a175bb319e4421abe7022f31be92410ab97e82a6- 부모
- bfb8ad9
변경된 파일 4개
+121-14| @@ -100,5 +100,6 @@ python3 tests/ci/run_rust.py local | ||
| 100 | 100 | - conflict-apply: "나머지 파일에도 같게 적용"이 켜진 상태입니다. 현재 작업의 남은 일반 파일 충돌에만 적용하며 이름 바꿔 저장은 같은 폴더에 번호를 붙입니다. |
| 101 | 101 | - extract-skipped: 모든 파일을 건너뛴 정상 완료입니다. 생성된 파일이 없으며 저장 실패 경고가 없어야 합니다. |
| 102 | 102 | - extract-renamed: 실제 저장된 새 이름을 표시합니다. 이름 변경 결과만으로 저장 성공을 판정하지 않고 별도의 생성 보고와 완료 집계가 일치해야 합니다. |
| 103 | 추가: - extract-rename-failed: 새 이름을 정한 뒤 실제 생성 보고 없이 I/O 오류가 난 결과입니다. 실패 원인과 "아무 파일도 풀지 않았습니다"를 표시하고 "이름 바꿔 저장" 완료 안내는 표시하지 않아야 합니다. 일부 파일이 저장된 뒤 실패한 경우에도 생성 보고가 있는 이름만 저장 완료로 표시합니다. | |
| 103 | 104 | |
| 104 | 105 | 현재 충돌 화면과 클라이언트 연동은 준비 단계입니다. 작업자 런타임이 완성되기 전에는 실제 추출 요청을 기존 Start로 유지하며 StartInteractive를 보내지 않습니다. 위 명령은 실제 파일을 쓰지 않는 개발용 화면 미리보기입니다. |
| @@ -1803,6 +1803,13 @@ impl ArchiveApp { | ||
| 1803 | 1803 | .iter() |
| 1804 | 1804 | .filter(|r| r.choice == ConflictChoice::Skip) |
| 1805 | 1805 | .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<_>>(); | |
| 1806 | 1813 | let warnings = if listing { |
| 1807 | 1814 | Vec::new() |
| 1808 | 1815 | } else { |
| @@ -1898,12 +1905,10 @@ impl ArchiveApp { | ||
| 1898 | 1905 | if skipped > 0 { |
| 1899 | 1906 | ui.label(format!("건너뛴 파일 {skipped}개")); |
| 1900 | 1907 | } |
| 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 | 추가: }) { | |
| 1907 | 1912 | theme::bounded_text( |
| 1908 | 1913 | ui, |
| 1909 | 1914 | &format!("이름 바꿔 저장: {}", resolution.relative_name), |
| @@ -98,6 +98,7 @@ fn every_listed_scenario_draws_and_keeps_its_expected_screen() { | ||
| 98 | 98 | let expected = match scenario.name { |
| 99 | 99 | "conflict-choice" | "conflict-apply" => "나머지 파일에도 같게 적용", |
| 100 | 100 | "extract-skipped" => "모든 파일을 건너뛰었습니다", |
| 101 | 추가: "extract-rename-failed" => "아무 파일도 풀지 않았습니다", | |
| 101 | 102 | "extract-renamed" => "이름 바꿔 저장: 읽어주세요 (1).txt", |
| 102 | 103 | "empty" => "압축파일", |
| 103 | 104 | "folder-empty" => "이 폴더는 비어 있습니다", |
| @@ -122,6 +123,10 @@ fn every_listed_scenario_draws_and_keeps_its_expected_screen() { | ||
| 122 | 123 | _ => "읽어주세요.txt", |
| 123 | 124 | }; |
| 124 | 125 | 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 | 추가: } | |
| 125 | 130 | if scenario.name == "many-items" { |
| 126 | 131 | assert_eq!(app.model.entries.len(), 505); |
| 127 | 132 | } |
| @@ -192,3 +197,90 @@ fn preview_ignores_password_submission() { | ||
| 192 | 197 | assert_eq!(preview.0.model.challenge, Some((17, 1, false))); |
| 193 | 198 | assert!(preview.0.model.busy()); |
| 194 | 199 | } |
| 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 | 추가: } |
| @@ -25,6 +25,7 @@ catalog! { | ||
| 25 | 25 | "conflict-apply" => "남은 충돌에 같은 선택 적용", |
| 26 | 26 | "extract-skipped" => "모든 파일을 건너뛴 정상 완료", |
| 27 | 27 | "extract-renamed" => "이름을 바꿔 저장한 완료 결과", |
| 28 | 추가: "extract-rename-failed" => "새 이름을 정한 뒤 저장 전 I/O 실패", | |
| 28 | 29 | "empty" => "빈 첫 화면", |
| 29 | 30 | "archive" => "폴더와 파일이 있는 압축파일", |
| 30 | 31 | "folder" => "사진 하위 폴더", |
| @@ -277,7 +278,10 @@ impl Scenario { | ||
| 277 | 278 | "사진/풍경.jpg".into(), |
| 278 | 279 | ]) |
| 279 | 280 | }); |
| 280 | 삭제: if matches!(self.name, "extract-skipped" | "extract-renamed") { | |
| 281 | 추가: if matches!( | |
| 282 | 추가: self.name, | |
| 283 | 추가: "extract-skipped" | "extract-renamed" | "extract-rename-failed" | |
| 284 | 추가: ) { | |
| 281 | 285 | app.targets = Some(["읽어주세요.txt".into()].into_iter().collect()); |
| 282 | 286 | app.directories.clear(); |
| 283 | 287 | } |
| @@ -295,7 +299,8 @@ impl Scenario { | ||
| 295 | 299 | existing_size: 2048, |
| 296 | 300 | })); |
| 297 | 301 | } |
| 298 | 삭제: "extract-skipped" | "extract-renamed" => { | |
| 302 | 추가: "extract-skipped" | "extract-renamed" | "extract-rename-failed" => { | |
| 303 | 추가: let failed = self.name == "extract-rename-failed"; | |
| 299 | 304 | let skip = self.name == "extract-skipped"; |
| 300 | 305 | let name = if skip { |
| 301 | 306 | "읽어주세요.txt" |
| @@ -311,7 +316,7 @@ impl Scenario { | ||
| 311 | 316 | ConflictChoice::Rename |
| 312 | 317 | }, |
| 313 | 318 | })); |
| 314 | 삭제: if !skip { | |
| 319 | 추가: if !skip && !failed { | |
| 315 | 320 | state.frame(Event::Output { |
| 316 | 321 | entry_id: Some(1), |
| 317 | 322 | relative_name: name.into(), |
| @@ -319,16 +324,20 @@ impl Scenario { | ||
| 319 | 324 | }); |
| 320 | 325 | } |
| 321 | 326 | 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 { | |
| 325 | 334 | Publication::None |
| 326 | 335 | } else { |
| 327 | 336 | Publication::Complete |
| 328 | 337 | }, |
| 329 | 삭제: created_count: u64::from(!skip), | |
| 338 | 추가: created_count: u64::from(!skip && !failed), | |
| 330 | 339 | retained_partial_count: 0, |
| 331 | 삭제: durability: if skip { | |
| 340 | 추가: durability: if skip || failed { | |
| 332 | 341 | Durability::NotApplicable |
| 333 | 342 | } else { |
| 334 | 343 | Durability::Synced |