끌어 놓기가 두 번 풀린 것처럼 보이던 문제를 고침
- egui는 오래 누르기만 해도 끌기로 보므로, 실제로 8px 이상 움직였을 때만 창 밖 끌기를 시작함 - 열기·끌어 놓기용 임시 폴더를 Unix에서 숨김 이름으로 만들어 압축파일 옆에 풀린 것처럼 보이지 않게 함 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- 작성자
- LeeJunyoung
- 작성 시각
- 커밋
288e1a4256f0e54ee5b08b33c02e75c35d7a3c7a- 부모
- aa29f8a
변경된 파일 6개
+78-13| @@ -64,7 +64,7 @@ main `3a77cfd`는 Windows 11 Pro build 26300과 Ubuntu 26.04.1 Wayland/X11에서 | ||
| 64 | 64 | |
| 65 | 65 | - **찾기:** 압축파일을 연 뒤 Ctrl+F를 누르면 지금 보고 있는 폴더 아래의 모든 하위 폴더에서 이름으로 찾고, Ctrl+Shift+F를 누르면 압축파일 전체 경로에서 찾습니다. 찾기 창의 결과를 두 번 누르거나 Enter를 누르면 그 위치로 이동합니다. |
| 66 | 66 | - **Esc:** 찾기 창, 작업 결과 창, 압축 파일 만들기 창 등 자식 창이 떠 있으면 그 창을 닫고, 아무 창도 없으면 프로그램을 종료합니다. 진행 중인 작업 창은 [취소] 버튼을 사용합니다. |
| 67 | 삭제: - **끌어서 풀기:** 목록에서 고른 파일과 폴더를 누른 채 창 밖으로 끌어 파일 관리자나 브라우저의 파일 올리기 영역에 놓으면, 압축파일 옆 Zipelo 임시 폴더에 풀린 뒤 받는 프로그램으로 넘어갑니다. 파일 관리자의 폴더 위에 놓으면 그 폴더 안에, 빈 곳에 놓으면 열린 폴더에 복사되며 이름이 겹칠 때의 처리(바꾸기, 건너뛰기, 이름 바꾸기)는 받는 프로그램이 정합니다. 스냅·Flatpak 앱에는 문서 포털로 넘깁니다. 임시 폴더는 Zipelo를 닫을 때 지웁니다. Ubuntu(Wayland, X11)와 Windows에서 동작하며, Windows는 다 푼 뒤에 끌기를 시작하므로 큰 항목은 풀리는 동안 버튼을 누르고 있어야 합니다. | |
| 67 | 추가: - **끌어서 풀기:** 목록에서 고른 파일과 폴더를 누른 채 창 밖으로 끌어 파일 관리자나 브라우저의 파일 올리기 영역에 놓으면, 압축파일 옆 숨김 임시 폴더(`.이름.zip (Zipelo 임시)`)에 풀린 뒤 받는 프로그램으로 넘어갑니다. 실제로 8px 이상 끌었을 때만 시작하므로 길게 누르기만 해서는 풀지 않습니다. 파일 관리자의 폴더 위에 놓으면 그 폴더 안에, 빈 곳에 놓으면 열린 폴더에 복사되며 이름이 겹칠 때의 처리(바꾸기, 건너뛰기, 이름 바꾸기)는 받는 프로그램이 정합니다. 스냅·Flatpak 앱에는 문서 포털로 넘깁니다. 임시 폴더는 Zipelo를 닫을 때 지웁니다. Ubuntu(Wayland, X11)와 Windows에서 동작하며, Windows는 다 푼 뒤에 끌기를 시작하므로 큰 항목은 풀리는 동안 버튼을 누르고 있어야 합니다. | |
| 68 | 68 | - **폴더 크기:** 목록의 폴더 크기를 0 B가 아닌, 안에 든 모든 파일 크기의 합으로 표시합니다. |
| 69 | 69 | - **로그:** 배포 빌드는 오류만 표준 오류에 남깁니다. 디버그 빌드는 작업 요청과 작업자 응답까지 자세히 남깁니다. 문제를 조사할 때는 `ZIPELO_LOG=debug zipelo`처럼 `ZIPELO_LOG`(off, error, warn, info, debug, trace)로 단계를 바꿀 수 있습니다. 암호는 어느 단계에서도 남기지 않습니다. |
| 70 | 70 |
| @@ -688,9 +688,15 @@ pub fn create_open_root_with( | ||
| 688 | 688 | }) |
| 689 | 689 | } |
| 690 | 690 | |
| 691 | 삭제: /// 열기용 임시 폴더 이름. 예: `자료.zip (Zipelo 임시)`. | |
| 691 | 추가: /// 열기와 끌어 놓기용 임시 폴더 이름. 예: `.자료.zip (Zipelo 임시)`. | |
| 692 | 추가: /// 파일 관리자에서 압축파일 옆에 풀린 것처럼 보이지 않도록 Unix 계열에서는 숨김 | |
| 693 | 추가: /// 이름(앞에 '.')을 씀. Windows는 점으로 숨겨지지 않으므로 원래 이름을 씀. | |
| 692 | 694 | pub fn open_root_name(archive_name: &str) -> String { |
| 693 | 삭제: format!("{archive_name} (Zipelo 임시)") | |
| 695 | 추가: if cfg!(windows) { | |
| 696 | 추가: format!("{archive_name} (Zipelo 임시)") | |
| 697 | 추가: } else { | |
| 698 | 추가: format!(".{archive_name} (Zipelo 임시)") | |
| 699 | 추가: } | |
| 694 | 700 | } |
| 695 | 701 | |
| 696 | 702 | /// 이 앱이 만든 열기용 폴더를 지움. 다른 프로그램이 파일을 쓰고 있으면 남을 수 있음. |
| @@ -191,6 +191,9 @@ struct Marquee { | ||
| 191 | 191 | moved: bool, |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 추가: /// 창 밖 끌기를 시작하려면 누른 곳에서 이만큼(px) 움직여야 함. | |
| 195 | 추가: const DRAG_OUT_DISTANCE: f32 = 8.0; | |
| 196 | 추가: | |
| 194 | 197 | /// 파일 목록 한 행의 높이. 행 안의 크기 칸(theme::ROW)이 위아래 2px 여백으로 들어감. |
| 195 | 198 | const LIST_ROW: f32 = 36.0; |
| 196 | 199 | |
| @@ -321,6 +324,8 @@ pub struct ArchiveApp { | ||
| 321 | 324 | drag_out: Option<Box<dyn crate::drag_out::DragOut>>, |
| 322 | 325 | /// 끌기를 놓지 않고 취소해 풀던 작업을 취소했는지. 결과 창을 띄우지 않음. |
| 323 | 326 | drag_cancelled: bool, |
| 327 | 추가: /// 이번 버튼 누름에서 이미 창 밖 끌기를 시작했는지. 한 번 누름에 한 번만 시작함. | |
| 328 | 추가: drag_out_fired: bool, | |
| 324 | 329 | find: FindState, |
| 325 | 330 | /// 이번 화면에서 목록 선택 해제 등 다른 곳이 Esc를 이미 처리했는지. |
| 326 | 331 | escape_handled: bool, |
| @@ -406,6 +411,7 @@ impl ArchiveApp { | ||
| 406 | 411 | opener: Box::new(present::open_with_default), |
| 407 | 412 | drag_out: None, |
| 408 | 413 | drag_cancelled: false, |
| 414 | 추가: drag_out_fired: false, | |
| 409 | 415 | find: FindState::default(), |
| 410 | 416 | escape_handled: false, |
| 411 | 417 | focus_list: false, |
| @@ -2467,7 +2473,19 @@ impl ArchiveApp { | ||
| 2467 | 2473 | modifiers.shift, |
| 2468 | 2474 | ); |
| 2469 | 2475 | } |
| 2470 | 삭제: if active && self.drag_out.is_some() && response.drag_started() { | |
| 2476 | 추가: // 오래 누르기만 해도 egui는 끌기로 보므로, 실제로 움직였을 때만 시작함. | |
| 2477 | 추가: if active | |
| 2478 | 추가: && self.drag_out.is_some() | |
| 2479 | 추가: && !self.drag_out_fired | |
| 2480 | 추가: && response.dragged() | |
| 2481 | 추가: && ui.input(|i| { | |
| 2482 | 추가: i.pointer | |
| 2483 | 추가: .press_origin() | |
| 2484 | 추가: .zip(i.pointer.interact_pos()) | |
| 2485 | 추가: .is_some_and(|(from, to)| from.distance(to) >= DRAG_OUT_DISTANCE) | |
| 2486 | 추가: }) | |
| 2487 | 추가: { | |
| 2488 | 추가: self.drag_out_fired = true; | |
| 2471 | 2489 | if !selected { |
| 2472 | 2490 | // 선택하지 않은 행을 끌면 그 행만 선택한 뒤 끎. |
| 2473 | 2491 | self.select_row(&rows, index, false, false); |
| @@ -2571,6 +2589,7 @@ impl ArchiveApp { | ||
| 2571 | 2589 | self.list_offset = next_offset.unwrap_or(output.state.clamped_offset().y); |
| 2572 | 2590 | if ui.input(|i| i.pointer.primary_released() || !i.pointer.primary_down()) { |
| 2573 | 2591 | self.marquee = None; |
| 2592 | 추가: self.drag_out_fired = false; | |
| 2574 | 2593 | } |
| 2575 | 2594 | let escape_from_list = self.list_focused |
| 2576 | 2595 | && ui.ctx().memory(|memory| memory.focused()).is_none() |
| @@ -323,7 +323,7 @@ fn double_click_open_extracts_nested_file_and_opens_that_file() { | ||
| 323 | 323 | screen.settle(); |
| 324 | 324 | screen.render(vec![]); |
| 325 | 325 | } |
| 326 | 삭제: let root = scratch.path("site.zip (Zipelo 임시)"); | |
| 326 | 추가: let root = scratch.path(&zipelo_ui_memory_app::archive_present::open_root_name("site.zip")); | |
| 327 | 327 | assert_eq!( |
| 328 | 328 | *opened.borrow(), |
| 329 | 329 | vec![ |
| @@ -91,7 +91,7 @@ fn dragging_selected_rows_out_extracts_them_and_hands_over_their_paths() { | ||
| 91 | 91 | assert_eq!(log.borrow().starts, 1); |
| 92 | 92 | // 선택이 유지되고(끌기는 범위 선택이 아님), 하위 항목을 포함해 임시 폴더에 풂. |
| 93 | 93 | s.selected(&[0, 1, 5]); |
| 94 | 삭제: let folder = scratch.0.join("sample.zip (Zipelo 임시)").join("1"); | |
| 94 | 추가: let folder = scratch.0.join(zipelo_ui_memory_app::archive_present::open_root_name("sample.zip")).join("1"); | |
| 95 | 95 | { |
| 96 | 96 | let state = s.factory.state.borrow(); |
| 97 | 97 | let Some(Start::Extract { |
| @@ -122,7 +122,7 @@ fn dragging_selected_rows_out_extracts_them_and_hands_over_their_paths() { | ||
| 122 | 122 | assert!(s.app.begin_extract()); |
| 123 | 123 | assert!(matches!( |
| 124 | 124 | s.factory.state.borrow().starts.last(), |
| 125 | 삭제: Some(Start::Extract { destination, .. }) if !destination.starts_with(scratch.0.join("sample.zip (Zipelo 임시)")) | |
| 125 | 추가: Some(Start::Extract { destination, .. }) if !destination.starts_with(scratch.0.join(zipelo_ui_memory_app::archive_present::open_root_name("sample.zip"))) | |
| 126 | 126 | )); |
| 127 | 127 | } |
| 128 | 128 | |
| @@ -195,7 +195,7 @@ fn after_extract_platforms_start_the_drag_once_files_exist_and_the_button_is_hel | ||
| 195 | 195 | // 먼저 풀기만 시작하고 운영체제 끌기는 아직 시작하지 않음. |
| 196 | 196 | assert_eq!(log.borrow().starts, 0); |
| 197 | 197 | assert!(s.app.model.busy()); |
| 198 | 삭제: let folder = scratch.0.join("sample.zip (Zipelo 임시)").join("1"); | |
| 198 | 추가: let folder = scratch.0.join(zipelo_ui_memory_app::archive_present::open_root_name("sample.zip")).join("1"); | |
| 199 | 199 | fs::create_dir_all(&folder).unwrap(); |
| 200 | 200 | fs::write(folder.join("alpha.txt"), "x").unwrap(); |
| 201 | 201 | finish_worker(&mut s); |
| @@ -238,3 +238,43 @@ fn after_extract_platforms_stop_when_the_button_is_released_early() { | ||
| 238 | 238 | "{labels:?}" |
| 239 | 239 | ); |
| 240 | 240 | } |
| 241 | 추가: | |
| 242 | 추가: #[test] | |
| 243 | 추가: fn long_press_without_moving_does_not_extract_and_one_drag_extracts_once() { | |
| 244 | 추가: let scratch = Folder::new(); | |
| 245 | 추가: let mut s = Explorer::new(&scratch); | |
| 246 | 추가: let log = with_drag(&mut s); | |
| 247 | 추가: s.click("docs", egui::Modifiers::NONE); | |
| 248 | 추가: let before = s.factory.state.borrow().starts.len(); | |
| 249 | 추가: s.time += 1.0; | |
| 250 | 추가: let start = s.row("docs").center(); | |
| 251 | 추가: s.pointer(start, true, egui::Modifiers::NONE); | |
| 252 | 추가: // 움직이지 않고 1.5초 동안 누르고 있어도 끌기와 풀기를 시작하지 않음. | |
| 253 | 추가: for _ in 0..30 { | |
| 254 | 추가: s.frame(egui::Modifiers::NONE, vec![]); | |
| 255 | 추가: } | |
| 256 | 추가: assert_eq!(log.borrow().starts, 0); | |
| 257 | 추가: assert_eq!(s.factory.state.borrow().starts.len(), before); | |
| 258 | 추가: // 움직이면 한 번만 시작하고, 계속 끌고 놓아도 다시 풀지 않음. | |
| 259 | 추가: for step in 1..=20 { | |
| 260 | 추가: s.frame( | |
| 261 | 추가: egui::Modifiers::NONE, | |
| 262 | 추가: vec![egui::Event::PointerMoved(start + egui::vec2(0.0, 6.0 * step as f32))], | |
| 263 | 추가: ); | |
| 264 | 추가: } | |
| 265 | 추가: s.pointer(start + egui::vec2(0.0, 120.0), false, egui::Modifiers::NONE); | |
| 266 | 추가: for _ in 0..10 { | |
| 267 | 추가: s.frame(egui::Modifiers::NONE, vec![]); | |
| 268 | 추가: } | |
| 269 | 추가: assert_eq!(log.borrow().starts, 1); | |
| 270 | 추가: assert_eq!(s.factory.state.borrow().starts.len(), before + 1); | |
| 271 | 추가: } | |
| 272 | 추가: | |
| 273 | 추가: #[cfg(unix)] | |
| 274 | 추가: #[test] | |
| 275 | 추가: fn drag_temp_folder_is_hidden_next_to_the_archive() { | |
| 276 | 추가: assert_eq!( | |
| 277 | 추가: zipelo_ui_memory_app::archive_present::open_root_name("자료.zip"), | |
| 278 | 추가: ".자료.zip (Zipelo 임시)" | |
| 279 | 추가: ); | |
| 280 | 추가: } |
| @@ -278,7 +278,7 @@ fn explorer_double_click_opens_files_with_default_app_and_folders_in_place() { | ||
| 278 | 278 | s.double_click("docs/child.txt"); |
| 279 | 279 | s.selected(&[0]); |
| 280 | 280 | // 파일은 압축파일 옆 숨김 임시 폴더에 그 파일만 풀고 기본 프로그램으로 엶. |
| 281 | 삭제: let root = scratch.0.join("sample.zip (Zipelo 임시)"); | |
| 281 | 추가: let root = scratch.0.join(zipelo_ui_memory_app::archive_present::open_root_name("sample.zip")); | |
| 282 | 282 | { |
| 283 | 283 | let state = s.factory.state.borrow(); |
| 284 | 284 | assert_eq!(state.starts.len(), 2); |
| @@ -371,7 +371,7 @@ fn finish_limit(s: &mut Explorer) { | ||
| 371 | 371 | fn explorer_open_keeps_pending_open_when_limit_retry_succeeds() { |
| 372 | 372 | let scratch = Folder::new(); |
| 373 | 373 | let mut s = Explorer::new(&scratch); |
| 374 | 삭제: let root = scratch.0.join("sample.zip (Zipelo 임시)"); | |
| 374 | 추가: let root = scratch.0.join(zipelo_ui_memory_app::archive_present::open_root_name("sample.zip")); | |
| 375 | 375 | let ctx = double_click_open_hits_limit(&mut s); |
| 376 | 376 | policy_click(&ctx, &mut s.app, "한도를 늘려 다시 시도"); |
| 377 | 377 | assert!(s.app.model.busy()); |
| @@ -408,7 +408,7 @@ fn explorer_open_keeps_pending_open_when_limit_retry_succeeds() { | ||
| 408 | 408 | fn explorer_open_restores_destination_when_limit_result_is_dismissed() { |
| 409 | 409 | let scratch = Folder::new(); |
| 410 | 410 | let mut s = Explorer::new(&scratch); |
| 411 | 삭제: let root = scratch.0.join("sample.zip (Zipelo 임시)"); | |
| 411 | 추가: let root = scratch.0.join(zipelo_ui_memory_app::archive_present::open_root_name("sample.zip")); | |
| 412 | 412 | let ctx = double_click_open_hits_limit(&mut s); |
| 413 | 413 | policy_click(&ctx, &mut s.app, "확인"); |
| 414 | 414 | for _ in 0..3 { |
| @@ -447,7 +447,7 @@ fn explorer_open_restores_destination_when_expanded_retry_fails_again() { | ||
| 447 | 447 | fn explorer_open_pending_after_limit_is_dropped_when_zip_creation_starts() { |
| 448 | 448 | let scratch = Folder::new(); |
| 449 | 449 | let mut s = Explorer::new(&scratch); |
| 450 | 삭제: let root = scratch.0.join("sample.zip (Zipelo 임시)"); | |
| 450 | 추가: let root = scratch.0.join(zipelo_ui_memory_app::archive_present::open_root_name("sample.zip")); | |
| 451 | 451 | let _limit_ctx = double_click_open_hits_limit(&mut s); |
| 452 | 452 | // 한도 초과 결과를 닫지 않고 폴더를 끌어 놓아 ZIP 만들기를 시작함. |
| 453 | 453 | let folder = scratch.0.join("photos"); |
| @@ -510,7 +510,7 @@ fn explorer_double_click_does_not_open_executables() { | ||
| 510 | 510 | .any(|(text, _, _)| text == "실행 파일(.EXE)은 안전을 위해 바로 열 수 없습니다") |
| 511 | 511 | ); |
| 512 | 512 | // 실행 파일은 압축을 풀지 않으므로 임시 폴더도 만들지 않음. |
| 513 | 삭제: assert!(!scratch.0.join("sample.zip (Zipelo 임시)").exists()); | |
| 513 | 추가: assert!(!scratch.0.join(zipelo_ui_memory_app::archive_present::open_root_name("sample.zip")).exists()); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | #[test] |