team-ljyzipelo

공개

끌어 놓기가 두 번 풀린 것처럼 보이던 문제를 고침

- egui는 오래 누르기만 해도 끌기로 보므로, 실제로 8px 이상 움직였을 때만 창 밖 끌기를 시작함
- 열기·끌어 놓기용 임시 폴더를 Unix에서 숨김 이름으로 만들어 압축파일 옆에 풀린 것처럼 보이지 않게 함

Co-Authored-By: Claude Opus 5.5 <[email protected]>
작성자
LeeJunyoung
작성 시각
커밋
288e1a4256f0e54ee5b08b33c02e75c35d7a3c7a
부모
aa29f8a
이 시점의 파일 보기

변경된 파일 6개

+78-13
수정README.md+1-1
@@ -64,7 +64,7 @@ main `3a77cfd`는 Windows 11 Pro build 26300과 Ubuntu 26.04.1 Wayland/X11에서
6464
6565- **찾기:** 압축파일을 연 뒤 Ctrl+F를 누르면 지금 보고 있는 폴더 아래의 모든 하위 폴더에서 이름으로 찾고, Ctrl+Shift+F를 누르면 압축파일 전체 경로에서 찾습니다. 찾기 창의 결과를 두 번 누르거나 Enter를 누르면 그 위치로 이동합니다.
6666- **Esc:** 찾기 창, 작업 결과 창, 압축 파일 만들기 창 등 자식 창이 떠 있으면 그 창을 닫고, 아무 창도 없으면 프로그램을 종료합니다. 진행 중인 작업 창은 [취소] 버튼을 사용합니다.
67삭제: - **끌어서 풀기:** 목록에서 고른 파일과 폴더를 누른 채 창 밖으로 끌어 파일 관리자나 브라우저의 파일 올리기 영역에 놓으면, 압축파일 옆 Zipelo 임시 폴더에 풀린 뒤 받는 프로그램으로 넘어갑니다. 파일 관리자의 폴더 위에 놓으면 그 폴더 안에, 빈 곳에 놓으면 열린 폴더에 복사되며 이름이 겹칠 때의 처리(바꾸기, 건너뛰기, 이름 바꾸기)는 받는 프로그램이 정합니다. 스냅·Flatpak 앱에는 문서 포털로 넘깁니다. 임시 폴더는 Zipelo를 닫을 때 지웁니다. Ubuntu(Wayland, X11)와 Windows에서 동작하며, Windows는 다 푼 뒤에 끌기를 시작하므로 큰 항목은 풀리는 동안 버튼을 누르고 있어야 합니다.
67추가: - **끌어서 풀기:** 목록에서 고른 파일과 폴더를 누른 채 창 밖으로 끌어 파일 관리자나 브라우저의 파일 올리기 영역에 놓으면, 압축파일 옆 숨김 임시 폴더(`.이름.zip (Zipelo 임시)`)에 풀린 뒤 받는 프로그램으로 넘어갑니다. 실제로 8px 이상 끌었을 때만 시작하므로 길게 누르기만 해서는 풀지 않습니다. 파일 관리자의 폴더 위에 놓으면 그 폴더 안에, 빈 곳에 놓으면 열린 폴더에 복사되며 이름이 겹칠 때의 처리(바꾸기, 건너뛰기, 이름 바꾸기)는 받는 프로그램이 정합니다. 스냅·Flatpak 앱에는 문서 포털로 넘깁니다. 임시 폴더는 Zipelo를 닫을 때 지웁니다. Ubuntu(Wayland, X11)와 Windows에서 동작하며, Windows는 다 푼 뒤에 끌기를 시작하므로 큰 항목은 풀리는 동안 버튼을 누르고 있어야 합니다.
6868- **폴더 크기:** 목록의 폴더 크기를 0 B가 아닌, 안에 든 모든 파일 크기의 합으로 표시합니다.
6969- **로그:** 배포 빌드는 오류만 표준 오류에 남깁니다. 디버그 빌드는 작업 요청과 작업자 응답까지 자세히 남깁니다. 문제를 조사할 때는 `ZIPELO_LOG=debug zipelo`처럼 `ZIPELO_LOG`(off, error, warn, info, debug, trace)로 단계를 바꿀 수 있습니다. 암호는 어느 단계에서도 남기지 않습니다.
7070
수정experiments/rust-ui-memory-app/src/archive_present.rs+8-2
@@ -688,9 +688,15 @@ pub fn create_open_root_with(
688688 })
689689}
690690
691삭제: /// 열기용 임시 폴더 이름. 예: `자료.zip (Zipelo 임시)`.
691추가: /// 열기와 끌어 놓기용 임시 폴더 이름. 예: `.자료.zip (Zipelo 임시)`.
692추가: /// 파일 관리자에서 압축파일 옆에 풀린 것처럼 보이지 않도록 Unix 계열에서는 숨김
693추가: /// 이름(앞에 '.')을 씀. Windows는 점으로 숨겨지지 않으므로 원래 이름을 씀.
692694pub 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추가: }
694700}
695701
696702/// 이 앱이 만든 열기용 폴더를 지움. 다른 프로그램이 파일을 쓰고 있으면 남을 수 있음.
수정experiments/rust-ui-memory-app/src/archive_screen.rs+20-1
@@ -191,6 +191,9 @@ struct Marquee {
191191 moved: bool,
192192}
193193
194추가: /// 창 밖 끌기를 시작하려면 누른 곳에서 이만큼(px) 움직여야 함.
195추가: const DRAG_OUT_DISTANCE: f32 = 8.0;
196추가:
194197/// 파일 목록 한 행의 높이. 행 안의 크기 칸(theme::ROW)이 위아래 2px 여백으로 들어감.
195198const LIST_ROW: f32 = 36.0;
196199
@@ -321,6 +324,8 @@ pub struct ArchiveApp {
321324 drag_out: Option<Box<dyn crate::drag_out::DragOut>>,
322325 /// 끌기를 놓지 않고 취소해 풀던 작업을 취소했는지. 결과 창을 띄우지 않음.
323326 drag_cancelled: bool,
327추가: /// 이번 버튼 누름에서 이미 창 밖 끌기를 시작했는지. 한 번 누름에 한 번만 시작함.
328추가: drag_out_fired: bool,
324329 find: FindState,
325330 /// 이번 화면에서 목록 선택 해제 등 다른 곳이 Esc를 이미 처리했는지.
326331 escape_handled: bool,
@@ -406,6 +411,7 @@ impl ArchiveApp {
406411 opener: Box::new(present::open_with_default),
407412 drag_out: None,
408413 drag_cancelled: false,
414추가: drag_out_fired: false,
409415 find: FindState::default(),
410416 escape_handled: false,
411417 focus_list: false,
@@ -2467,7 +2473,19 @@ impl ArchiveApp {
24672473 modifiers.shift,
24682474 );
24692475 }
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;
24712489 if !selected {
24722490 // 선택하지 않은 행을 끌면 그 행만 선택한 뒤 끎.
24732491 self.select_row(&rows, index, false, false);
@@ -2571,6 +2589,7 @@ impl ArchiveApp {
25712589 self.list_offset = next_offset.unwrap_or(output.state.clamped_offset().y);
25722590 if ui.input(|i| i.pointer.primary_released() || !i.pointer.primary_down()) {
25732591 self.marquee = None;
2592추가: self.drag_out_fired = false;
25742593 }
25752594 let escape_from_list = self.list_focused
25762595 && ui.ctx().memory(|memory| memory.focused()).is_none()
수정tests/rust-app-real-worker/selection_flows.rs+1-1
@@ -323,7 +323,7 @@ fn double_click_open_extracts_nested_file_and_opens_that_file() {
323323 screen.settle();
324324 screen.render(vec![]);
325325 }
326삭제: let root = scratch.path("site.zip (Zipelo 임시)");
326추가: let root = scratch.path(&zipelo_ui_memory_app::archive_present::open_root_name("site.zip"));
327327 assert_eq!(
328328 *opened.borrow(),
329329 vec![
수정tests/rust-app-ui/drag_out_flow.rs+43-3
@@ -91,7 +91,7 @@ fn dragging_selected_rows_out_extracts_them_and_hands_over_their_paths() {
9191 assert_eq!(log.borrow().starts, 1);
9292 // 선택이 유지되고(끌기는 범위 선택이 아님), 하위 항목을 포함해 임시 폴더에 풂.
9393 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");
9595 {
9696 let state = s.factory.state.borrow();
9797 let Some(Start::Extract {
@@ -122,7 +122,7 @@ fn dragging_selected_rows_out_extracts_them_and_hands_over_their_paths() {
122122 assert!(s.app.begin_extract());
123123 assert!(matches!(
124124 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")))
126126 ));
127127}
128128
@@ -195,7 +195,7 @@ fn after_extract_platforms_start_the_drag_once_files_exist_and_the_button_is_hel
195195 // 먼저 풀기만 시작하고 운영체제 끌기는 아직 시작하지 않음.
196196 assert_eq!(log.borrow().starts, 0);
197197 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");
199199 fs::create_dir_all(&folder).unwrap();
200200 fs::write(folder.join("alpha.txt"), "x").unwrap();
201201 finish_worker(&mut s);
@@ -238,3 +238,43 @@ fn after_extract_platforms_stop_when_the_button_is_released_early() {
238238 "{labels:?}"
239239 );
240240}
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추가: }
수정tests/rust-app-ui/explorer_selection.rs+5-5
@@ -278,7 +278,7 @@ fn explorer_double_click_opens_files_with_default_app_and_folders_in_place() {
278278 s.double_click("docs/child.txt");
279279 s.selected(&[0]);
280280 // 파일은 압축파일 옆 숨김 임시 폴더에 그 파일만 풀고 기본 프로그램으로 엶.
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"));
282282 {
283283 let state = s.factory.state.borrow();
284284 assert_eq!(state.starts.len(), 2);
@@ -371,7 +371,7 @@ fn finish_limit(s: &mut Explorer) {
371371fn explorer_open_keeps_pending_open_when_limit_retry_succeeds() {
372372 let scratch = Folder::new();
373373 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"));
375375 let ctx = double_click_open_hits_limit(&mut s);
376376 policy_click(&ctx, &mut s.app, "한도를 늘려 다시 시도");
377377 assert!(s.app.model.busy());
@@ -408,7 +408,7 @@ fn explorer_open_keeps_pending_open_when_limit_retry_succeeds() {
408408fn explorer_open_restores_destination_when_limit_result_is_dismissed() {
409409 let scratch = Folder::new();
410410 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"));
412412 let ctx = double_click_open_hits_limit(&mut s);
413413 policy_click(&ctx, &mut s.app, "확인");
414414 for _ in 0..3 {
@@ -447,7 +447,7 @@ fn explorer_open_restores_destination_when_expanded_retry_fails_again() {
447447fn explorer_open_pending_after_limit_is_dropped_when_zip_creation_starts() {
448448 let scratch = Folder::new();
449449 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"));
451451 let _limit_ctx = double_click_open_hits_limit(&mut s);
452452 // 한도 초과 결과를 닫지 않고 폴더를 끌어 놓아 ZIP 만들기를 시작함.
453453 let folder = scratch.0.join("photos");
@@ -510,7 +510,7 @@ fn explorer_double_click_does_not_open_executables() {
510510 .any(|(text, _, _)| text == "실행 파일(.EXE)은 안전을 위해 바로 열 수 없습니다")
511511 );
512512 // 실행 파일은 압축을 풀지 않으므로 임시 폴더도 만들지 않음.
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());
514514}
515515
516516#[test]