Merge pull request #85 from Team-LJY/features/ui-redesign
압축 파일 열기와 만들기 UI를 재설계
- 작성자
- LeeJunyoung
- 작성 시각
- 커밋
eca9a733cc3e7519ce9cce554dbaee5515a52c34
변경된 파일 67개
+2,180-90변경 내용이 커서 일부 파일의 Diff를 생략했어요. 생략한 파일은 파일 보기나 Raw로 확인할 수 있어요.
| @@ -51,3 +51,8 @@ eframe = { version = "=0.37.0", optional = true, default-features = false, featu | ||
| 51 | 51 | name = "renderer_fallback" |
| 52 | 52 | path = "../../tests/rust-app-ui/renderer_fallback.rs" |
| 53 | 53 | required-features = ["ui"] |
| 54 | 추가: | |
| 55 | 추가: [[bin]] | |
| 56 | 추가: name = "zipelo-ui-capture" | |
| 57 | 추가: path = "../../tests/rust-app-ui/capture.rs" | |
| 58 | 추가: required-features = ["ui-fixture"] |
| @@ -0,0 +1,263 @@ | ||
| 1 | 추가: use crate::{archive_present as present, archive_theme as theme}; | |
| 2 | 추가: use eframe::egui::{self, Align, Layout}; | |
| 3 | 추가: use std::path::{Path, PathBuf}; | |
| 4 | 추가: | |
| 5 | 추가: #[derive(Clone, Copy, PartialEq)] | |
| 6 | 추가: pub enum Purpose { | |
| 7 | 추가: Open, | |
| 8 | 추가: Destination, | |
| 9 | 추가: Retry, | |
| 10 | 추가: Files, | |
| 11 | 추가: Folder, | |
| 12 | 추가: ZipFolder, | |
| 13 | 추가: } | |
| 14 | 추가: | |
| 15 | 추가: pub enum Choice { | |
| 16 | 추가: Cancel, | |
| 17 | 추가: Paths(Vec<PathBuf>), | |
| 18 | 추가: } | |
| 19 | 추가: | |
| 20 | 추가: pub struct Picker { | |
| 21 | 추가: pub purpose: Purpose, | |
| 22 | 추가: current: PathBuf, | |
| 23 | 추가: entries: Vec<present::BrowserEntry>, | |
| 24 | 추가: selected: Vec<PathBuf>, | |
| 25 | 추가: error: bool, | |
| 26 | 추가: } | |
| 27 | 추가: | |
| 28 | 추가: impl Picker { | |
| 29 | 추가: pub fn new(purpose: Purpose, start: &Path) -> Self { | |
| 30 | 추가: let current = if start.is_dir() { | |
| 31 | 추가: start.to_path_buf() | |
| 32 | 추가: } else { | |
| 33 | 추가: start | |
| 34 | 추가: .parent() | |
| 35 | 추가: .filter(|p| p.is_dir()) | |
| 36 | 추가: .map(Path::to_path_buf) | |
| 37 | 추가: .unwrap_or_else(present::home_directory) | |
| 38 | 추가: }; | |
| 39 | 추가: let mut picker = Self { | |
| 40 | 추가: purpose, | |
| 41 | 추가: current, | |
| 42 | 추가: entries: Vec::new(), | |
| 43 | 추가: selected: Vec::new(), | |
| 44 | 추가: error: false, | |
| 45 | 추가: }; | |
| 46 | 추가: picker.reload(); | |
| 47 | 추가: picker | |
| 48 | 추가: } | |
| 49 | 추가: | |
| 50 | 추가: fn reload(&mut self) { | |
| 51 | 추가: self.selected.clear(); | |
| 52 | 추가: match present::directory_entries(&self.current) { | |
| 53 | 추가: Ok(entries) => { | |
| 54 | 추가: self.entries = entries; | |
| 55 | 추가: self.error = false; | |
| 56 | 추가: } | |
| 57 | 추가: Err(_) => { | |
| 58 | 추가: self.entries.clear(); | |
| 59 | 추가: self.error = true; | |
| 60 | 추가: } | |
| 61 | 추가: } | |
| 62 | 추가: } | |
| 63 | 추가: | |
| 64 | 추가: fn directory_mode(&self) -> bool { | |
| 65 | 추가: matches!( | |
| 66 | 추가: self.purpose, | |
| 67 | 추가: Purpose::Destination | Purpose::Retry | Purpose::Folder | Purpose::ZipFolder | |
| 68 | 추가: ) | |
| 69 | 추가: } | |
| 70 | 추가: | |
| 71 | 추가: pub fn show(&mut self, ctx: &egui::Context) -> Option<Choice> { | |
| 72 | 추가: let mut choice = None; | |
| 73 | 추가: let mut navigate = None; | |
| 74 | 추가: let width = (ctx.content_rect().width() - 64.0).min(720.0); | |
| 75 | 추가: let height = (ctx.content_rect().height() - 280.0).clamp(160.0, 340.0); | |
| 76 | 추가: let title = match self.purpose { | |
| 77 | 추가: Purpose::Open => "파일 열기", | |
| 78 | 추가: Purpose::Destination | Purpose::Retry => "풀 위치 선택", | |
| 79 | 추가: Purpose::Files => "묶을 파일 선택", | |
| 80 | 추가: Purpose::Folder => "묶을 폴더 선택", | |
| 81 | 추가: Purpose::ZipFolder => "ZIP 저장 폴더 선택", | |
| 82 | 추가: }; | |
| 83 | 추가: let title = if self.purpose == Purpose::Open { | |
| 84 | 추가: "파일 열기" | |
| 85 | 추가: } else { | |
| 86 | 추가: title | |
| 87 | 추가: }; | |
| 88 | 추가: let modal = egui::Modal::new(egui::Id::unique("archive-picker")).show(ctx, |ui| { | |
| 89 | 추가: ui.set_width(width); | |
| 90 | 추가: ui.heading(title); | |
| 91 | 추가: egui::ScrollArea::horizontal() | |
| 92 | 추가: .id_salt("breadcrumbs") | |
| 93 | 추가: .show(ui, |ui| { | |
| 94 | 추가: ui.horizontal(|ui| { | |
| 95 | 추가: let mut ancestors = self.current.ancestors().collect::<Vec<_>>(); | |
| 96 | 추가: ancestors.reverse(); | |
| 97 | 추가: for path in ancestors { | |
| 98 | 추가: let label = path | |
| 99 | 추가: .file_name() | |
| 100 | 추가: .unwrap_or(path.as_os_str()) | |
| 101 | 추가: .to_string_lossy(); | |
| 102 | 추가: if ui | |
| 103 | 추가: .button(label.as_ref()) | |
| 104 | 추가: .on_hover_text(path.display().to_string()) | |
| 105 | 추가: .clicked() | |
| 106 | 추가: { | |
| 107 | 추가: navigate = Some(path.to_path_buf()); | |
| 108 | 추가: } | |
| 109 | 추가: } | |
| 110 | 추가: }); | |
| 111 | 추가: }); | |
| 112 | 추가: ui.separator(); | |
| 113 | 추가: ui.horizontal_top(|ui| { | |
| 114 | 추가: ui.allocate_ui_with_layout( | |
| 115 | 추가: egui::vec2(128.0, height), | |
| 116 | 추가: Layout::top_down(Align::Min), | |
| 117 | 추가: |ui| { | |
| 118 | 추가: ui.set_min_size(egui::vec2(128.0, height)); | |
| 119 | 추가: for (label, path) in present::shortcuts() { | |
| 120 | 추가: if theme::action(ui, &label, false, true).clicked() { | |
| 121 | 추가: navigate = Some(path); | |
| 122 | 추가: } | |
| 123 | 추가: } | |
| 124 | 추가: if let Some(parent) = self.current.parent() { | |
| 125 | 추가: if theme::action(ui, "상위 폴더", false, true).clicked() { | |
| 126 | 추가: navigate = Some(parent.to_path_buf()); | |
| 127 | 추가: } | |
| 128 | 추가: } | |
| 129 | 추가: }, | |
| 130 | 추가: ); | |
| 131 | 추가: ui.add_space(theme::SPACE); | |
| 132 | 추가: ui.allocate_ui_with_layout( | |
| 133 | 추가: egui::vec2((width - 160.0).max(240.0), height), | |
| 134 | 추가: Layout::top_down(Align::Min), | |
| 135 | 추가: |ui| { | |
| 136 | 추가: ui.set_min_size(egui::vec2((width - 160.0).max(240.0), height)); | |
| 137 | 추가: if self.error { | |
| 138 | 추가: ui.colored_label( | |
| 139 | 추가: theme::ERROR, | |
| 140 | 추가: "이 폴더를 열 수 없습니다. 접근 권한을 확인하세요", | |
| 141 | 추가: ); | |
| 142 | 추가: } else if self.entries.is_empty() { | |
| 143 | 추가: ui.label("이 폴더는 비어 있습니다"); | |
| 144 | 추가: } | |
| 145 | 추가: egui::ScrollArea::vertical() | |
| 146 | 추가: .id_salt("picker-entries") | |
| 147 | 추가: .max_height(height) | |
| 148 | 추가: .show_rows(ui, theme::ROW, self.entries.len(), |ui, rows| { | |
| 149 | 추가: for index in rows { | |
| 150 | 추가: let entry = &self.entries[index]; | |
| 151 | 추가: let selected = self.selected.contains(&entry.path); | |
| 152 | 추가: let response = ui | |
| 153 | 추가: .horizontal(|ui| { | |
| 154 | 추가: theme::icon( | |
| 155 | 추가: ui, | |
| 156 | 추가: if entry.directory { | |
| 157 | 추가: theme::Icon::Folder | |
| 158 | 추가: } else { | |
| 159 | 추가: theme::Icon::File | |
| 160 | 추가: }, | |
| 161 | 추가: 20.0, | |
| 162 | 추가: ); | |
| 163 | 추가: let name = if entry.link { | |
| 164 | 추가: format!("{} (링크)", entry.name) | |
| 165 | 추가: } else { | |
| 166 | 추가: entry.name.clone() | |
| 167 | 추가: }; | |
| 168 | 추가: ui.add_sized( | |
| 169 | 추가: [ui.available_width(), theme::ROW], | |
| 170 | 추가: egui::Button::new("") | |
| 171 | 추가: .left_text(present::middle_text(&name, 38)) | |
| 172 | 추가: .selected(selected), | |
| 173 | 추가: ) | |
| 174 | 추가: .on_hover_text(entry.path.display().to_string()) | |
| 175 | 추가: }) | |
| 176 | 추가: .inner; | |
| 177 | 추가: theme::focus(&response); | |
| 178 | 추가: if response.clicked() { | |
| 179 | 추가: if self.purpose == Purpose::Files | |
| 180 | 추가: && ui.input(|i| i.modifiers.command || i.modifiers.ctrl) | |
| 181 | 추가: { | |
| 182 | 추가: if selected { | |
| 183 | 추가: self.selected.retain(|p| p != &entry.path); | |
| 184 | 추가: } else if !entry.directory { | |
| 185 | 추가: self.selected.push(entry.path.clone()); | |
| 186 | 추가: } | |
| 187 | 추가: } else { | |
| 188 | 추가: self.selected = vec![entry.path.clone()]; | |
| 189 | 추가: } | |
| 190 | 추가: } | |
| 191 | 추가: let keyboard_activation = response.has_focus() | |
| 192 | 추가: && ui.input(|i| { | |
| 193 | 추가: i.key_pressed(egui::Key::Enter) | |
| 194 | 추가: || i.key_pressed(egui::Key::Space) | |
| 195 | 추가: }); | |
| 196 | 추가: if response.double_clicked() || keyboard_activation { | |
| 197 | 추가: if entry.directory && !entry.link { | |
| 198 | 추가: navigate = Some(entry.path.clone()); | |
| 199 | 추가: } else if !self.directory_mode() { | |
| 200 | 추가: choice = Some(Choice::Paths(vec![entry.path.clone()])); | |
| 201 | 추가: } | |
| 202 | 추가: } | |
| 203 | 추가: } | |
| 204 | 추가: }); | |
| 205 | 추가: }, | |
| 206 | 추가: ); | |
| 207 | 추가: }); | |
| 208 | 추가: ui.separator(); | |
| 209 | 추가: ui.horizontal(|ui| { | |
| 210 | 추가: if self.purpose == Purpose::Files { | |
| 211 | 추가: ui.label("Ctrl을 누르면 여러 파일을 고를 수 있습니다"); | |
| 212 | 추가: } | |
| 213 | 추가: ui.with_layout(Layout::right_to_left(Align::Center), |ui| { | |
| 214 | 추가: let selected_directory = self.selected.first().filter(|path| { | |
| 215 | 추가: self.entries | |
| 216 | 추가: .iter() | |
| 217 | 추가: .any(|e| &e.path == *path && (e.directory || e.link)) | |
| 218 | 추가: }); | |
| 219 | 추가: let paths = if self.directory_mode() { | |
| 220 | 추가: vec![ | |
| 221 | 추가: selected_directory | |
| 222 | 추가: .cloned() | |
| 223 | 추가: .unwrap_or_else(|| self.current.clone()), | |
| 224 | 추가: ] | |
| 225 | 추가: } else { | |
| 226 | 추가: self.selected | |
| 227 | 추가: .iter() | |
| 228 | 추가: .filter(|path| { | |
| 229 | 추가: self.entries | |
| 230 | 추가: .iter() | |
| 231 | 추가: .any(|e| &e.path == *path && !e.directory) | |
| 232 | 추가: }) | |
| 233 | 추가: .cloned() | |
| 234 | 추가: .collect() | |
| 235 | 추가: }; | |
| 236 | 추가: let label = if self.directory_mode() { | |
| 237 | 추가: "이 폴더 선택" | |
| 238 | 추가: } else if self.purpose == Purpose::Files { | |
| 239 | 추가: "추가" | |
| 240 | 추가: } else { | |
| 241 | 추가: "열기" | |
| 242 | 추가: }; | |
| 243 | 추가: let enabled = !paths.is_empty() && !self.error; | |
| 244 | 추가: let (cancel, confirm) = theme::action_pair(ui, "취소", Some((label, enabled))); | |
| 245 | 추가: if navigate.is_none() && confirm { | |
| 246 | 추가: choice = Some(Choice::Paths(paths)); | |
| 247 | 추가: } | |
| 248 | 추가: if cancel { | |
| 249 | 추가: choice = Some(Choice::Cancel); | |
| 250 | 추가: } | |
| 251 | 추가: }); | |
| 252 | 추가: }); | |
| 253 | 추가: }); | |
| 254 | 추가: if modal.should_close() { | |
| 255 | 추가: choice = Some(Choice::Cancel); | |
| 256 | 추가: } | |
| 257 | 추가: if let Some(path) = navigate { | |
| 258 | 추가: self.current = path; | |
| 259 | 추가: self.reload(); | |
| 260 | 추가: } | |
| 261 | 추가: choice | |
| 262 | 추가: } | |
| 263 | 추가: } |
| @@ -0,0 +1,364 @@ | ||
| 1 | 추가: use crate::archive_ui::*; | |
| 2 | 추가: use std::{ | |
| 3 | 추가: collections::BTreeSet, | |
| 4 | 추가: fs, io, | |
| 5 | 추가: path::{Path, PathBuf}, | |
| 6 | 추가: }; | |
| 7 | 추가: | |
| 8 | 추가: pub const UNCERTAIN: &str = "저장이 끝났는지 확인하지 못했습니다. 풀 위치 폴더를 확인하세요."; | |
| 9 | 추가: pub const PARTIAL: &str = "일부 파일만 풀렸습니다. 풀린 파일은 풀 위치 폴더에 남아 있습니다."; | |
| 10 | 추가: pub const LEFTOVERS: &str = | |
| 11 | 추가: "선택한 파일은 모두 저장했지만 임시 파일을 지우지 못했습니다. 풀 위치 폴더를 확인하세요."; | |
| 12 | 추가: pub const SYNC_FAILED: &str = | |
| 13 | 추가: "파일을 디스크에 완전히 저장하지 못했습니다. 풀 위치 폴더를 확인하세요."; | |
| 14 | 추가: pub const SYNC_WARNING: &str = "파일을 디스크에 완전히 저장했는지 확인하지 못했습니다."; | |
| 15 | 추가: pub const CLEANUP_WARNING: &str = | |
| 16 | 추가: "임시 파일을 지우지 못했습니다. 풀 위치 폴더에 남은 임시 파일이 있을 수 있습니다."; | |
| 17 | 추가: pub const INTERNAL: &str = "내부 오류가 발생했습니다. 프로그램을 다시 시작해 주세요"; | |
| 18 | 추가: pub const FOLDER_ERROR: &str = "풀 위치 폴더를 만들 수 없습니다. 접근 권한을 확인하세요"; | |
| 19 | 추가: | |
| 20 | 추가: pub fn error_text(code: ErrorCode) -> &'static str { | |
| 21 | 추가: match code { | |
| 22 | 추가: ErrorCode::Integrity => "압축파일이 손상됐습니다", | |
| 23 | 추가: ErrorCode::UnsupportedFormat => "지원하지 않는 압축 형식입니다", | |
| 24 | 추가: ErrorCode::UnsupportedFeature => "아직 지원하지 않는 기능입니다", | |
| 25 | 추가: ErrorCode::WrongPassword => "암호가 올바르지 않습니다", | |
| 26 | 추가: ErrorCode::UnsafePath => "파일 경로의 안전성을 확인할 수 없어 중단했습니다", | |
| 27 | 추가: ErrorCode::Conflict => "같은 이름의 파일이 이미 있습니다. 다른 폴더를 선택하세요", | |
| 28 | 추가: ErrorCode::Limit => "처리 한도를 초과했습니다", | |
| 29 | 추가: ErrorCode::Io => "파일을 읽거나 쓰지 못했습니다. 파일과 폴더의 접근 권한을 확인하세요", | |
| 30 | 추가: ErrorCode::DiskFull => "디스크 여유 공간이 부족합니다. 공간을 확보한 뒤 다시 시도하세요", | |
| 31 | 추가: ErrorCode::SourceChanged => "원본 파일이 바뀌었습니다. 압축파일을 다시 여세요", | |
| 32 | 추가: ErrorCode::InvalidRequest => "풀 위치와 선택한 항목을 확인하세요", | |
| 33 | 추가: ErrorCode::Protocol | ErrorCode::Internal => INTERNAL, | |
| 34 | 추가: } | |
| 35 | 추가: } | |
| 36 | 추가: | |
| 37 | 추가: pub fn progress_text(stage: Stage, creating: bool) -> &'static str { | |
| 38 | 추가: match stage { | |
| 39 | 추가: Stage::Scan | Stage::Read => "압축파일을 읽는 중", | |
| 40 | 추가: Stage::Decode if creating => "압축하는 중", | |
| 41 | 추가: Stage::Decode => "압축을 푸는 중", | |
| 42 | 추가: Stage::Write => "파일을 저장하는 중", | |
| 43 | 추가: Stage::Verify => "확인하는 중", | |
| 44 | 추가: Stage::Commit => "마무리하는 중", | |
| 45 | 추가: } | |
| 46 | 추가: } | |
| 47 | 추가: | |
| 48 | 추가: pub fn bytes_text(bytes: u64) -> String { | |
| 49 | 추가: for (unit, size) in [("GB", 1_u64 << 30), ("MB", 1 << 20), ("KB", 1 << 10)] { | |
| 50 | 추가: if bytes >= size { | |
| 51 | 추가: return format!("{:.1} {unit}", bytes as f64 / size as f64); | |
| 52 | 추가: } | |
| 53 | 추가: } | |
| 54 | 추가: format!("{bytes} B") | |
| 55 | 추가: } | |
| 56 | 추가: | |
| 57 | 추가: pub fn middle_text(text: &str, max_chars: usize) -> String { | |
| 58 | 추가: let chars = text.chars().collect::<Vec<_>>(); | |
| 59 | 추가: if chars.len() <= max_chars || max_chars < 5 { | |
| 60 | 추가: return text.into(); | |
| 61 | 추가: } | |
| 62 | 추가: let left = (max_chars - 1) / 2; | |
| 63 | 추가: chars[..left] | |
| 64 | 추가: .iter() | |
| 65 | 추가: .chain(std::iter::once(&'…')) | |
| 66 | 추가: .chain(chars[chars.len() - (max_chars - left - 1)..].iter()) | |
| 67 | 추가: .collect() | |
| 68 | 추가: } | |
| 69 | 추가: | |
| 70 | 추가: pub fn default_destination(archive: &Path) -> PathBuf { | |
| 71 | 추가: let name = archive.file_name().unwrap_or_default().to_string_lossy(); | |
| 72 | 추가: let lower = name.to_ascii_lowercase(); | |
| 73 | 추가: let stem = if lower.ends_with(".tar.gz") { | |
| 74 | 추가: &name[..name.len() - 7] | |
| 75 | 추가: } else { | |
| 76 | 추가: name.rsplit_once('.') | |
| 77 | 추가: .map_or(name.as_ref(), |(stem, _)| stem) | |
| 78 | 추가: }; | |
| 79 | 추가: archive.with_file_name(if stem.is_empty() { | |
| 80 | 추가: "압축 해제" | |
| 81 | 추가: } else { | |
| 82 | 추가: stem | |
| 83 | 추가: }) | |
| 84 | 추가: } | |
| 85 | 추가: | |
| 86 | 추가: pub fn prepare_destination(path: &Path, automatic: bool) -> io::Result<bool> { | |
| 87 | 추가: match fs::symlink_metadata(path) { | |
| 88 | 추가: Ok(metadata) if metadata.is_dir() && !metadata.file_type().is_symlink() => Ok(false), | |
| 89 | 추가: Ok(_) => Err(io::Error::other(FOLDER_ERROR)), | |
| 90 | 추가: Err(error) if error.kind() == io::ErrorKind::NotFound && automatic => { | |
| 91 | 추가: let mut builder = fs::DirBuilder::new(); | |
| 92 | 추가: #[cfg(unix)] | |
| 93 | 추가: { | |
| 94 | 추가: use std::os::unix::fs::DirBuilderExt; | |
| 95 | 추가: builder.mode(0o700); | |
| 96 | 추가: } | |
| 97 | 추가: builder.create(path)?; | |
| 98 | 추가: Ok(true) | |
| 99 | 추가: } | |
| 100 | 추가: Err(error) => Err(error), | |
| 101 | 추가: } | |
| 102 | 추가: } | |
| 103 | 추가: | |
| 104 | 추가: pub fn remove_owned_empty(path: &Path) { | |
| 105 | 추가: // 이번 요청에서 만든 폴더만 호출하며 비어 있지 않으면 보존함. | |
| 106 | 추가: let _ = fs::remove_dir(path); | |
| 107 | 추가: } | |
| 108 | 추가: | |
| 109 | 추가: fn requested(entry: &Entry, selection: &Selection) -> bool { | |
| 110 | 추가: match selection { | |
| 111 | 추가: Selection::All => true, | |
| 112 | 추가: Selection::EntryIds(ids) => ids.contains(&entry.id), | |
| 113 | 추가: } | |
| 114 | 추가: } | |
| 115 | 추가: | |
| 116 | 추가: pub fn target_files( | |
| 117 | 추가: entries: &[Entry], | |
| 118 | 추가: selection: &Selection, | |
| 119 | 추가: gzip: Option<&str>, | |
| 120 | 추가: ) -> Option<BTreeSet<String>> { | |
| 121 | 추가: let mut names = BTreeSet::new(); | |
| 122 | 추가: for entry in entries | |
| 123 | 추가: .iter() | |
| 124 | 추가: .filter(|entry| entry.kind == Kind::File && requested(entry, selection)) | |
| 125 | 추가: { | |
| 126 | 추가: if !names.insert(gzip.unwrap_or(&entry.name).replace('\\', "/")) { | |
| 127 | 추가: return None; | |
| 128 | 추가: } | |
| 129 | 추가: } | |
| 130 | 추가: Some(names) | |
| 131 | 추가: } | |
| 132 | 추가: | |
| 133 | 추가: pub fn target_directories(entries: &[Entry], selection: &Selection) -> BTreeSet<String> { | |
| 134 | 추가: let mut directories = BTreeSet::new(); | |
| 135 | 추가: for entry in entries.iter().filter(|entry| { | |
| 136 | 추가: matches!(entry.kind, Kind::File | Kind::Directory) && requested(entry, selection) | |
| 137 | 추가: }) { | |
| 138 | 추가: let normalized = entry.name.replace('\\', "/"); | |
| 139 | 추가: let name = normalized.trim_end_matches('/'); | |
| 140 | 추가: if entry.kind == Kind::Directory { | |
| 141 | 추가: directories.insert(name.to_owned()); | |
| 142 | 추가: } | |
| 143 | 추가: let mut parent = name; | |
| 144 | 추가: while let Some((directory, _)) = parent.rsplit_once('/') { | |
| 145 | 추가: directories.insert(directory.to_owned()); | |
| 146 | 추가: parent = directory; | |
| 147 | 추가: } | |
| 148 | 추가: } | |
| 149 | 추가: directories | |
| 150 | 추가: } | |
| 151 | 추가: | |
| 152 | 추가: pub fn durability_warning(durability: Durability) -> Option<&'static str> { | |
| 153 | 추가: match durability { | |
| 154 | 추가: Durability::Failed => Some(SYNC_FAILED), | |
| 155 | 추가: Durability::Unconfirmed => Some(SYNC_WARNING), | |
| 156 | 추가: _ => None, | |
| 157 | 추가: } | |
| 158 | 추가: } | |
| 159 | 추가: | |
| 160 | 추가: pub fn warnings( | |
| 161 | 추가: terminal: Option<&Terminal>, | |
| 162 | 추가: confirmed: bool, | |
| 163 | 추가: targets: Option<&BTreeSet<String>>, | |
| 164 | 추가: directories: &BTreeSet<String>, | |
| 165 | 추가: outputs: &[(String, Disposition)], | |
| 166 | 추가: ) -> Vec<&'static str> { | |
| 167 | 추가: let mut result = publication_warnings(terminal, confirmed, targets, directories, outputs); | |
| 168 | 추가: if let Some(warning) = terminal | |
| 169 | 추가: .filter(|_| confirmed) | |
| 170 | 추가: .and_then(|t| durability_warning(t.durability)) | |
| 171 | 추가: { | |
| 172 | 추가: result.push(warning); | |
| 173 | 추가: } | |
| 174 | 추가: result | |
| 175 | 추가: } | |
| 176 | 추가: | |
| 177 | 추가: pub fn publication_warnings( | |
| 178 | 추가: terminal: Option<&Terminal>, | |
| 179 | 추가: confirmed: bool, | |
| 180 | 추가: targets: Option<&BTreeSet<String>>, | |
| 181 | 추가: directories: &BTreeSet<String>, | |
| 182 | 추가: outputs: &[(String, Disposition)], | |
| 183 | 추가: ) -> Vec<&'static str> { | |
| 184 | 추가: let Some(t) = terminal.filter(|_| confirmed) else { | |
| 185 | 추가: return vec![UNCERTAIN]; | |
| 186 | 추가: }; | |
| 187 | 추가: let created = outputs | |
| 188 | 추가: .iter() | |
| 189 | 추가: .filter(|(_, state)| *state == Disposition::Created) | |
| 190 | 추가: .map(|(name, _)| name.replace('\\', "/")) | |
| 191 | 추가: .collect::<BTreeSet<_>>(); | |
| 192 | 추가: let created_reports = outputs | |
| 193 | 추가: .iter() | |
| 194 | 추가: .filter(|(_, state)| *state == Disposition::Created) | |
| 195 | 추가: .count(); | |
| 196 | 추가: let uncertain = t.publication == Publication::Uncertain | |
| 197 | 추가: || outputs | |
| 198 | 추가: .iter() | |
| 199 | 추가: .any(|(_, state)| *state == Disposition::CommitUncertain) | |
| 200 | 추가: || created.len() != created_reports | |
| 201 | 추가: || created_reports as u64 != t.created_count | |
| 202 | 추가: || (t.publication == Publication::None && !created.is_empty()); | |
| 203 | 추가: let retained = t.retained_partial_count > 0 | |
| 204 | 추가: || outputs | |
| 205 | 추가: .iter() | |
| 206 | 추가: .any(|(_, state)| *state == Disposition::PartialRetained); | |
| 207 | 추가: let mut result = Vec::new(); | |
| 208 | 추가: let mut all_saved_with_leftovers = false; | |
| 209 | 추가: if uncertain { | |
| 210 | 추가: result.push(UNCERTAIN); | |
| 211 | 추가: } else if let Some(targets) = targets { | |
| 212 | 추가: let files = created | |
| 213 | 추가: .difference(directories) | |
| 214 | 추가: .cloned() | |
| 215 | 추가: .collect::<BTreeSet<_>>(); | |
| 216 | 추가: let saved = targets.intersection(&files).count(); | |
| 217 | 추가: let unknown = !targets.is_disjoint(directories) | |
| 218 | 추가: || created | |
| 219 | 추가: .iter() | |
| 220 | 추가: .any(|name| !targets.contains(name) && !directories.contains(name)); | |
| 221 | 추가: if unknown { | |
| 222 | 추가: result.push(UNCERTAIN); | |
| 223 | 추가: } else if !targets.is_empty() && saved == targets.len() && retained { | |
| 224 | 추가: result.push(LEFTOVERS); | |
| 225 | 추가: all_saved_with_leftovers = true; | |
| 226 | 추가: } else if saved > 0 && saved < targets.len() && t.outcome != Outcome::Completed { | |
| 227 | 추가: result.push(PARTIAL); | |
| 228 | 추가: } else if (saved == 0 && !files.is_empty()) | |
| 229 | 추가: || (retained && saved == 0) | |
| 230 | 추가: || (t.outcome == Outcome::Completed && saved != targets.len()) | |
| 231 | 추가: { | |
| 232 | 추가: result.push(UNCERTAIN); | |
| 233 | 추가: } | |
| 234 | 추가: } else { | |
| 235 | 추가: result.push(UNCERTAIN); | |
| 236 | 추가: } | |
| 237 | 추가: if (retained || t.cleanup != Cleanup::Complete) && !all_saved_with_leftovers { | |
| 238 | 추가: result.push(CLEANUP_WARNING); | |
| 239 | 추가: } | |
| 240 | 추가: result | |
| 241 | 추가: } | |
| 242 | 추가: | |
| 243 | 추가: pub fn definitely_unsaved( | |
| 244 | 추가: t: Option<&Terminal>, | |
| 245 | 추가: confirmed: bool, | |
| 246 | 추가: outputs: &[(String, Disposition)], | |
| 247 | 추가: ) -> bool { | |
| 248 | 추가: t.is_some_and(|t| { | |
| 249 | 추가: confirmed | |
| 250 | 추가: && t.publication == Publication::None | |
| 251 | 추가: && t.created_count == 0 | |
| 252 | 추가: && t.retained_partial_count == 0 | |
| 253 | 추가: && t.cleanup == Cleanup::Complete | |
| 254 | 추가: && outputs | |
| 255 | 추가: .iter() | |
| 256 | 추가: .all(|(_, state)| *state == Disposition::Removed) | |
| 257 | 추가: }) | |
| 258 | 추가: } | |
| 259 | 추가: | |
| 260 | 추가: #[derive(Clone)] | |
| 261 | 추가: pub struct BrowserEntry { | |
| 262 | 추가: pub path: PathBuf, | |
| 263 | 추가: pub name: String, | |
| 264 | 추가: pub directory: bool, | |
| 265 | 추가: pub link: bool, | |
| 266 | 추가: } | |
| 267 | 추가: | |
| 268 | 추가: pub fn directory_entries(path: &Path) -> io::Result<Vec<BrowserEntry>> { | |
| 269 | 추가: if fs::symlink_metadata(path)?.file_type().is_symlink() { | |
| 270 | 추가: return Err(io::Error::other("링크 폴더는 탐색하지 않음")); | |
| 271 | 추가: } | |
| 272 | 추가: let mut entries = Vec::new(); | |
| 273 | 추가: for item in fs::read_dir(path)? { | |
| 274 | 추가: let item = item?; | |
| 275 | 추가: let kind = item.file_type()?; | |
| 276 | 추가: entries.push(BrowserEntry { | |
| 277 | 추가: path: item.path(), | |
| 278 | 추가: name: item.file_name().to_string_lossy().into(), | |
| 279 | 추가: directory: kind.is_dir(), | |
| 280 | 추가: link: kind.is_symlink(), | |
| 281 | 추가: }); | |
| 282 | 추가: } | |
| 283 | 추가: entries.sort_by(|a, b| { | |
| 284 | 추가: b.directory | |
| 285 | 추가: .cmp(&a.directory) | |
| 286 | 추가: .then_with(|| a.name.to_lowercase().cmp(&b.name.to_lowercase())) | |
| 287 | 추가: }); | |
| 288 | 추가: Ok(entries) | |
| 289 | 추가: } | |
| 290 | 추가: | |
| 291 | 추가: pub fn home_directory() -> PathBuf { | |
| 292 | 추가: std::env::var_os(if cfg!(windows) { "USERPROFILE" } else { "HOME" }) | |
| 293 | 추가: .map(PathBuf::from) | |
| 294 | 추가: .filter(|p| p.is_absolute()) | |
| 295 | 추가: .unwrap_or_else(|| std::env::current_dir().unwrap_or_else(|_| PathBuf::from("/"))) | |
| 296 | 추가: } | |
| 297 | 추가: | |
| 298 | 추가: pub fn shortcuts() -> Vec<(String, PathBuf)> { | |
| 299 | 추가: let home = home_directory(); | |
| 300 | 추가: let mut paths = vec![("홈".into(), home.clone())]; | |
| 301 | 추가: for (label, candidates) in [ | |
| 302 | 추가: ("바탕 화면", ["Desktop", "바탕화면"]), | |
| 303 | 추가: ("문서", ["Documents", "문서"]), | |
| 304 | 추가: ("다운로드", ["Downloads", "다운로드"]), | |
| 305 | 추가: ] { | |
| 306 | 추가: if let Some(path) = candidates | |
| 307 | 추가: .iter() | |
| 308 | 추가: .map(|name| home.join(name)) | |
| 309 | 추가: .find(|p| p.is_dir()) | |
| 310 | 추가: { | |
| 311 | 추가: paths.push((label.into(), path)); | |
| 312 | 추가: } | |
| 313 | 추가: } | |
| 314 | 추가: #[cfg(windows)] | |
| 315 | 추가: for drive in b'A'..=b'Z' { | |
| 316 | 추가: let path = PathBuf::from(format!("{}:\\", drive as char)); | |
| 317 | 추가: if path.is_dir() { | |
| 318 | 추가: paths.push((format!("{}:", drive as char), path)); | |
| 319 | 추가: } | |
| 320 | 추가: } | |
| 321 | 추가: paths | |
| 322 | 추가: } | |
| 323 | 추가: | |
| 324 | 추가: pub fn folder_command(path: &Path) -> std::process::Command { | |
| 325 | 추가: let mut command = std::process::Command::new(if cfg!(windows) { | |
| 326 | 추가: "explorer" | |
| 327 | 추가: } else { | |
| 328 | 추가: "xdg-open" | |
| 329 | 추가: }); | |
| 330 | 추가: command.arg(path); | |
| 331 | 추가: command | |
| 332 | 추가: } | |
| 333 | 추가: | |
| 334 | 추가: pub const UNCONFIRMED_FINISH: &str = | |
| 335 | 추가: "작업이 정상적으로 끝났는지 확인하지 못했습니다. 풀 위치 폴더를 확인하세요"; | |
| 336 | 추가: | |
| 337 | 추가: pub fn client_error_text(error: &str) -> &'static str { | |
| 338 | 추가: if error.starts_with("작업자 종료 결과를 확인할 수 없습니다") { | |
| 339 | 추가: UNCONFIRMED_FINISH | |
| 340 | 추가: } else { | |
| 341 | 추가: INTERNAL | |
| 342 | 추가: } | |
| 343 | 추가: } | |
| 344 | 추가: | |
| 345 | 추가: pub fn activity_text(model: &Model, creating: bool) -> &'static str { | |
| 346 | 추가: if model.terminal.is_some() | |
| 347 | 추가: || matches!( | |
| 348 | 추가: model.cancel, | |
| 349 | 추가: Some(CancelStatus::TooLate | CancelStatus::Finished) | |
| 350 | 추가: ) | |
| 351 | 추가: { | |
| 352 | 추가: "마무리하는 중" | |
| 353 | 추가: } else if model.cancellation_requested() || model.cancel.is_some() { | |
| 354 | 추가: "취소하는 중..." | |
| 355 | 추가: } else if model.challenge.is_some() { | |
| 356 | 추가: "암호를 입력하세요" | |
| 357 | 추가: } else { | |
| 358 | 추가: model | |
| 359 | 추가: .progress | |
| 360 | 추가: .map_or("압축파일을 읽는 중", |(stage, _, _, _)| { | |
| 361 | 추가: progress_text(stage, creating) | |
| 362 | 추가: }) | |
| 363 | 추가: } | |
| 364 | 추가: } |
Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기| @@ -0,0 +1,281 @@ | ||
| 1 | 추가: use eframe::egui::{self, Color32, FontId, Stroke, TextStyle}; | |
| 2 | 추가: | |
| 3 | 추가: pub const BACKGROUND: Color32 = Color32::from_rgb(247, 248, 250); | |
| 4 | 추가: pub const PANEL: Color32 = Color32::WHITE; | |
| 5 | 추가: pub const STRIPE: Color32 = Color32::from_rgb(243, 245, 248); | |
| 6 | 추가: pub const BORDER: Color32 = Color32::from_rgb(217, 222, 229); | |
| 7 | 추가: pub const TEXT: Color32 = Color32::from_rgb(31, 41, 51); | |
| 8 | 추가: pub const MUTED: Color32 = Color32::from_rgb(91, 102, 115); | |
| 9 | 추가: pub const BLUE: Color32 = Color32::from_rgb(37, 99, 235); | |
| 10 | 추가: pub const BLUE_HOVER: Color32 = Color32::from_rgb(29, 78, 216); | |
| 11 | 추가: pub const BLUE_ACTIVE: Color32 = Color32::from_rgb(30, 64, 175); | |
| 12 | 추가: pub const SELECTED: Color32 = Color32::from_rgb(232, 240, 254); | |
| 13 | 추가: pub const DROP: Color32 = Color32::from_rgb(238, 244, 255); | |
| 14 | 추가: pub const DASH: Color32 = Color32::from_rgb(170, 180, 192); | |
| 15 | 추가: pub const SUCCESS: Color32 = Color32::from_rgb(21, 128, 61); | |
| 16 | 추가: pub const SUCCESS_BG: Color32 = Color32::from_rgb(232, 245, 236); | |
| 17 | 추가: pub const WARNING: Color32 = Color32::from_rgb(180, 83, 9); | |
| 18 | 추가: pub const WARNING_BG: Color32 = Color32::from_rgb(255, 247, 232); | |
| 19 | 추가: pub const ERROR: Color32 = Color32::from_rgb(185, 28, 28); | |
| 20 | 추가: pub const ERROR_BG: Color32 = Color32::from_rgb(253, 237, 237); | |
| 21 | 추가: pub const FOLDER: Color32 = Color32::from_rgb(224, 165, 38); | |
| 22 | 추가: pub const FILE: Color32 = Color32::from_rgb(123, 135, 148); | |
| 23 | 추가: pub const SPACE: f32 = 8.0; | |
| 24 | 추가: pub const PAD: i8 = 16; | |
| 25 | 추가: pub const DROP_PAD: i8 = 24; | |
| 26 | 추가: pub const DROP_HEIGHT: f32 = 280.0; | |
| 27 | 추가: pub const DROP_RADIUS: u8 = 12; | |
| 28 | 추가: pub const ROW: f32 = 32.0; | |
| 29 | 추가: pub const BUTTON: f32 = 40.0; | |
| 30 | 추가: pub const BODY: f32 = 15.0; | |
| 31 | 추가: pub const TITLE: f32 = 22.0; | |
| 32 | 추가: | |
| 33 | 추가: pub fn apply(ctx: &egui::Context) { | |
| 34 | 추가: ctx.set_theme(egui::Theme::Light); | |
| 35 | 추가: ctx.set_visuals(egui::Visuals::light()); | |
| 36 | 추가: ctx.style_mut_of(egui::Theme::Light, |style| { | |
| 37 | 추가: style | |
| 38 | 추가: .text_styles | |
| 39 | 추가: .insert(TextStyle::Body, FontId::proportional(BODY)); | |
| 40 | 추가: style | |
| 41 | 추가: .text_styles | |
| 42 | 추가: .insert(TextStyle::Button, FontId::proportional(BODY)); | |
| 43 | 추가: style | |
| 44 | 추가: .text_styles | |
| 45 | 추가: .insert(TextStyle::Small, FontId::proportional(BODY)); | |
| 46 | 추가: style | |
| 47 | 추가: .text_styles | |
| 48 | 추가: .insert(TextStyle::Heading, FontId::proportional(TITLE)); | |
| 49 | 추가: style.visuals.override_text_color = Some(TEXT); | |
| 50 | 추가: style.visuals.panel_fill = BACKGROUND; | |
| 51 | 추가: style.visuals.window_fill = PANEL; | |
| 52 | 추가: style.visuals.extreme_bg_color = PANEL; | |
| 53 | 추가: style.visuals.faint_bg_color = STRIPE; | |
| 54 | 추가: style.visuals.selection.bg_fill = SELECTED; | |
| 55 | 추가: style.visuals.selection.stroke = Stroke::new(2.0, BLUE); | |
| 56 | 추가: style.visuals.widgets.inactive.bg_fill = PANEL; | |
| 57 | 추가: style.visuals.widgets.inactive.weak_bg_fill = PANEL; | |
| 58 | 추가: style.visuals.widgets.inactive.bg_stroke = Stroke::new(1.0, BORDER); | |
| 59 | 추가: style.visuals.widgets.hovered.bg_fill = DROP; | |
| 60 | 추가: style.visuals.widgets.hovered.weak_bg_fill = DROP; | |
| 61 | 추가: style.visuals.widgets.hovered.bg_stroke = Stroke::new(1.0, BLUE); | |
| 62 | 추가: style.visuals.widgets.active.bg_stroke = Stroke::new(2.0, BLUE); | |
| 63 | 추가: for widget in [ | |
| 64 | 추가: &mut style.visuals.widgets.inactive, | |
| 65 | 추가: &mut style.visuals.widgets.hovered, | |
| 66 | 추가: &mut style.visuals.widgets.active, | |
| 67 | 추가: &mut style.visuals.widgets.noninteractive, | |
| 68 | 추가: ] { | |
| 69 | 추가: widget.corner_radius = egui::CornerRadius::same(6); | |
| 70 | 추가: widget.fg_stroke = Stroke::new(1.5, TEXT); | |
| 71 | 추가: } | |
| 72 | 추가: style.visuals.window_corner_radius = egui::CornerRadius::same(8); | |
| 73 | 추가: style.spacing.item_spacing = egui::vec2(SPACE, SPACE); | |
| 74 | 추가: style.spacing.button_padding = egui::vec2(16.0, SPACE); | |
| 75 | 추가: style.spacing.interact_size.y = ROW; | |
| 76 | 추가: style.spacing.window_margin = egui::Margin::same(PAD); | |
| 77 | 추가: style.visuals.disabled_alpha = 0.4; | |
| 78 | 추가: }); | |
| 79 | 추가: } | |
| 80 | 추가: | |
| 81 | 추가: pub fn focus(response: &egui::Response) { | |
| 82 | 추가: if response.has_focus() { | |
| 83 | 추가: response.ctx.layer_painter(response.layer_id).rect_stroke( | |
| 84 | 추가: response.rect.expand(2.0), | |
| 85 | 추가: 6, | |
| 86 | 추가: Stroke::new(2.0, BLUE), | |
| 87 | 추가: egui::StrokeKind::Outside, | |
| 88 | 추가: ); | |
| 89 | 추가: } | |
| 90 | 추가: } | |
| 91 | 추가: | |
| 92 | 추가: pub fn action(ui: &mut egui::Ui, text: &str, primary: bool, enabled: bool) -> egui::Response { | |
| 93 | 추가: let response = ui | |
| 94 | 추가: .scope(|ui| { | |
| 95 | 추가: if primary { | |
| 96 | 추가: let style = ui.style_mut(); | |
| 97 | 추가: style.visuals.widgets.inactive.bg_fill = BLUE; | |
| 98 | 추가: style.visuals.widgets.inactive.weak_bg_fill = BLUE; | |
| 99 | 추가: style.visuals.widgets.hovered.bg_fill = BLUE_HOVER; | |
| 100 | 추가: style.visuals.widgets.hovered.weak_bg_fill = BLUE_HOVER; | |
| 101 | 추가: style.visuals.widgets.active.bg_fill = BLUE_ACTIVE; | |
| 102 | 추가: style.visuals.widgets.active.weak_bg_fill = BLUE_ACTIVE; | |
| 103 | 추가: } | |
| 104 | 추가: ui.add_enabled( | |
| 105 | 추가: enabled, | |
| 106 | 추가: egui::Button::new(egui::RichText::new(text).strong().color(if primary { | |
| 107 | 추가: PANEL | |
| 108 | 추가: } else if text == "취소" { | |
| 109 | 추가: ERROR | |
| 110 | 추가: } else { | |
| 111 | 추가: TEXT | |
| 112 | 추가: })) | |
| 113 | 추가: .min_size(egui::vec2( | |
| 114 | 추가: if primary { 112.0 } else { 0.0 }, | |
| 115 | 추가: if primary { BUTTON } else { 36.0 }, | |
| 116 | 추가: )) | |
| 117 | 추가: .stroke(Stroke::new(1.0, if primary { BLUE } else { BORDER })), | |
| 118 | 추가: ) | |
| 119 | 추가: }) | |
| 120 | 추가: .inner; | |
| 121 | 추가: focus(&response); | |
| 122 | 추가: response | |
| 123 | 추가: } | |
| 124 | 추가: | |
| 125 | 추가: pub fn panel(fill: Color32) -> egui::Frame { | |
| 126 | 추가: egui::Frame::new() | |
| 127 | 추가: .fill(fill) | |
| 128 | 추가: .inner_margin(egui::Margin::same(PAD)) | |
| 129 | 추가: .corner_radius(8) | |
| 130 | 추가: } | |
| 131 | 추가: | |
| 132 | 추가: #[derive(Clone, Copy)] | |
| 133 | 추가: pub enum Icon { | |
| 134 | 추가: File, | |
| 135 | 추가: Folder, | |
| 136 | 추가: Archive, | |
| 137 | 추가: Lock, | |
| 138 | 추가: Success, | |
| 139 | 추가: Warning, | |
| 140 | 추가: Error, | |
| 141 | 추가: } | |
| 142 | 추가: | |
| 143 | 추가: pub fn icon(ui: &mut egui::Ui, kind: Icon, size: f32) { | |
| 144 | 추가: let (rect, _) = ui.allocate_exact_size(egui::vec2(size, size), egui::Sense::hover()); | |
| 145 | 추가: let p = ui.painter(); | |
| 146 | 추가: let color = match kind { | |
| 147 | 추가: Icon::Folder => FOLDER, | |
| 148 | 추가: Icon::Archive => BLUE, | |
| 149 | 추가: Icon::Lock | Icon::Warning => WARNING, | |
| 150 | 추가: Icon::Success => SUCCESS, | |
| 151 | 추가: Icon::Error => ERROR, | |
| 152 | 추가: Icon::File => FILE, | |
| 153 | 추가: }; | |
| 154 | 추가: let s = Stroke::new(if size > 32.0 { 2.5 } else { 1.5 }, color); | |
| 155 | 추가: let point = |x, y| rect.min + egui::vec2(x * size, y * size); | |
| 156 | 추가: let box_at = |x, y, w, h| egui::Rect::from_min_max(point(x, y), point(x + w, y + h)); | |
| 157 | 추가: match kind { | |
| 158 | 추가: Icon::Folder => { | |
| 159 | 추가: p.rect_filled(box_at(0.08, 0.22, 0.42, 0.22), 2, color); | |
| 160 | 추가: p.rect_filled(box_at(0.08, 0.34, 0.84, 0.50), 2, color); | |
| 161 | 추가: } | |
| 162 | 추가: Icon::File | Icon::Archive => { | |
| 163 | 추가: p.rect_stroke( | |
| 164 | 추가: box_at(0.19, 0.08, 0.62, 0.84), | |
| 165 | 추가: 2, | |
| 166 | 추가: s, | |
| 167 | 추가: egui::StrokeKind::Inside, | |
| 168 | 추가: ); | |
| 169 | 추가: p.line_segment([point(0.60, 0.08), point(0.60, 0.30)], s); | |
| 170 | 추가: p.line_segment([point(0.60, 0.30), point(0.81, 0.30)], s); | |
| 171 | 추가: if matches!(kind, Icon::Archive) { | |
| 172 | 추가: for y in [0.42, 0.57, 0.72] { | |
| 173 | 추가: p.line_segment([point(0.39, y), point(0.59, y)], s); | |
| 174 | 추가: } | |
| 175 | 추가: } | |
| 176 | 추가: } | |
| 177 | 추가: Icon::Lock => { | |
| 178 | 추가: p.circle_stroke(point(0.50, 0.35), size * 0.23, s); | |
| 179 | 추가: p.rect_filled(box_at(0.18, 0.39, 0.64, 0.47), 2, color); | |
| 180 | 추가: } | |
| 181 | 추가: Icon::Success | Icon::Error => { | |
| 182 | 추가: p.circle_stroke(rect.center(), size * 0.40, s); | |
| 183 | 추가: if matches!(kind, Icon::Success) { | |
| 184 | 추가: p.line_segment([point(0.28, 0.50), point(0.44, 0.66)], s); | |
| 185 | 추가: p.line_segment([point(0.44, 0.66), point(0.74, 0.33)], s); | |
| 186 | 추가: } else { | |
| 187 | 추가: p.line_segment([point(0.34, 0.34), point(0.66, 0.66)], s); | |
| 188 | 추가: p.line_segment([point(0.66, 0.34), point(0.34, 0.66)], s); | |
| 189 | 추가: } | |
| 190 | 추가: } | |
| 191 | 추가: Icon::Warning => { | |
| 192 | 추가: p.add(egui::Shape::closed_line( | |
| 193 | 추가: vec![point(0.50, 0.08), point(0.94, 0.86), point(0.06, 0.86)], | |
| 194 | 추가: s, | |
| 195 | 추가: )); | |
| 196 | 추가: p.line_segment([point(0.50, 0.32), point(0.50, 0.57)], s); | |
| 197 | 추가: p.circle_filled(point(0.50, 0.73), size * 0.035, color); | |
| 198 | 추가: } | |
| 199 | 추가: } | |
| 200 | 추가: } | |
| 201 | 추가: | |
| 202 | 추가: pub fn column_label( | |
| 203 | 추가: ui: &mut egui::Ui, | |
| 204 | 추가: text: impl Into<egui::WidgetText>, | |
| 205 | 추가: width: f32, | |
| 206 | 추가: align: egui::Align, | |
| 207 | 추가: ) -> egui::Response { | |
| 208 | 추가: let layout = if align == egui::Align::Max { | |
| 209 | 추가: egui::Layout::right_to_left(egui::Align::Center) | |
| 210 | 추가: } else { | |
| 211 | 추가: egui::Layout::left_to_right(egui::Align::Center) | |
| 212 | 추가: }; | |
| 213 | 추가: ui.allocate_ui_with_layout(egui::vec2(width, ROW), layout, |ui| { | |
| 214 | 추가: ui.set_min_width(width); | |
| 215 | 추가: ui.set_max_width(width); | |
| 216 | 추가: ui.add(egui::Label::new(text).truncate()) | |
| 217 | 추가: }) | |
| 218 | 추가: .inner | |
| 219 | 추가: } | |
| 220 | 추가: | |
| 221 | 추가: pub fn action_pair( | |
| 222 | 추가: ui: &mut egui::Ui, | |
| 223 | 추가: secondary: &str, | |
| 224 | 추가: primary: Option<(&str, bool)>, | |
| 225 | 추가: ) -> (bool, bool) { | |
| 226 | 추가: let text_width = |text: &str| { | |
| 227 | 추가: ui.painter() | |
| 228 | 추가: .layout_no_wrap(text.into(), FontId::proportional(BODY), TEXT) | |
| 229 | 추가: .size() | |
| 230 | 추가: .x | |
| 231 | 추가: }; | |
| 232 | 추가: let width = text_width(secondary) | |
| 233 | 추가: + 32.0 | |
| 234 | 추가: + primary.map_or(0.0, |(label, _)| { | |
| 235 | 추가: SPACE + (text_width(label) + 32.0).max(112.0) | |
| 236 | 추가: }); | |
| 237 | 추가: ui.horizontal(|ui| { | |
| 238 | 추가: ui.with_layout(egui::Layout::left_to_right(egui::Align::Center), |ui| { | |
| 239 | 추가: ui.add_space((ui.available_width() - width).max(0.0)); | |
| 240 | 추가: let secondary = action(ui, secondary, false, true).clicked(); | |
| 241 | 추가: let primary = primary.is_some_and(|(label, enabled)| { | |
| 242 | 추가: action(ui, label, true, enabled) | |
| 243 | 추가: .on_disabled_hover_text(match label { | |
| 244 | 추가: "만들기" => "묶을 파일이나 폴더를 추가하세요", | |
| 245 | 추가: "다른 폴더에 풀기" => "기존 풀 위치 폴더를 먼저 확인하세요", | |
| 246 | 추가: _ => "입력한 내용을 확인하세요", | |
| 247 | 추가: }) | |
| 248 | 추가: .clicked() | |
| 249 | 추가: }); | |
| 250 | 추가: (secondary, primary) | |
| 251 | 추가: }) | |
| 252 | 추가: .inner | |
| 253 | 추가: }) | |
| 254 | 추가: .inner | |
| 255 | 추가: } | |
| 256 | 추가: | |
| 257 | 추가: pub fn indeterminate(ui: &mut egui::Ui) { | |
| 258 | 추가: let (rect, response) = ui.allocate_exact_size( | |
| 259 | 추가: egui::vec2(ui.available_width(), SPACE * 2.0), | |
| 260 | 추가: egui::Sense::hover(), | |
| 261 | 추가: ); | |
| 262 | 추가: ui.painter().rect_filled(rect, 8, BORDER); | |
| 263 | 추가: let phase = if ui.style().animation_time > 0.0 { | |
| 264 | 추가: ui.input(|i| (i.time * 0.6).fract()) as f32 | |
| 265 | 추가: } else { | |
| 266 | 추가: 0.5 | |
| 267 | 추가: }; | |
| 268 | 추가: let width = (SPACE * 8.0).min(rect.width()); | |
| 269 | 추가: let pulse = egui::Rect::from_min_size( | |
| 270 | 추가: rect.min + egui::vec2((rect.width() - width) * phase, 0.0), | |
| 271 | 추가: egui::vec2(width, rect.height()), | |
| 272 | 추가: ); | |
| 273 | 추가: ui.painter().rect_filled(pulse, 8, BLUE); | |
| 274 | 추가: response.widget_info(|| { | |
| 275 | 추가: egui::WidgetInfo::labeled( | |
| 276 | 추가: egui::Role::ProgressIndicator, | |
| 277 | 추가: ui.is_enabled(), | |
| 278 | 추가: "전체 크기를 알 수 없는 작업 진행 중", | |
| 279 | 추가: ) | |
| 280 | 추가: }); | |
| 281 | 추가: } |
| @@ -280,6 +280,11 @@ impl Model { | ||
| 280 | 280 | pub fn busy(&self) -> bool { |
| 281 | 281 | self.running.is_some() |
| 282 | 282 | } |
| 283 | 추가: pub fn cancellation_requested(&self) -> bool { | |
| 284 | 추가: self.running | |
| 285 | 추가: .as_ref() | |
| 286 | 추가: .is_some_and(|run| run.cancel_sequence.is_some()) | |
| 287 | 추가: } | |
| 283 | 288 | pub fn job_id(&self) -> Option<u64> { |
| 284 | 289 | self.running.as_ref().map(|r| r.id) |
| 285 | 290 | } |
| @@ -7,7 +7,7 @@ mod fake; | ||
| 7 | 7 | mod renderer; |
| 8 | 8 | #[path = "system_font.rs"] |
| 9 | 9 | mod system_font; |
| 10 | 삭제: use eframe::egui::{self, Color32, FontData, FontDefinitions, FontFamily, FontId, TextStyle}; | |
| 10 | 추가: use eframe::egui::{self, FontData, FontDefinitions, FontFamily}; | |
| 11 | 11 | fn main() -> eframe::Result { |
| 12 | 12 | let result = run(); |
| 13 | 13 | #[cfg(target_os = "windows")] |
| @@ -63,23 +63,7 @@ fn run() -> eframe::Result { | ||
| 63 | 63 | .families |
| 64 | 64 | .insert(FontFamily::Proportional, vec!["noto-kr".into()]); |
| 65 | 65 | cc.egui_ctx.set_fonts(fonts); |
| 66 | 삭제: cc.egui_ctx.set_visuals(egui::Visuals::light()); | |
| 67 | 삭제: cc.egui_ctx.style_mut_of(egui::Theme::Light, |style| { | |
| 68 | 삭제: style | |
| 69 | 삭제: .text_styles | |
| 70 | 삭제: .insert(TextStyle::Body, FontId::proportional(18.0)); | |
| 71 | 삭제: style | |
| 72 | 삭제: .text_styles | |
| 73 | 삭제: .insert(TextStyle::Button, FontId::proportional(18.0)); | |
| 74 | 삭제: style | |
| 75 | 삭제: .text_styles | |
| 76 | 삭제: .insert(TextStyle::Heading, FontId::proportional(26.0)); | |
| 77 | 삭제: style.visuals.panel_fill = Color32::WHITE; | |
| 78 | 삭제: style.visuals.override_text_color = Some(Color32::from_rgb(24, 39, 57)); | |
| 79 | 삭제: style.visuals.selection.bg_fill = Color32::from_rgb(211, 230, 246); | |
| 80 | 삭제: style.spacing.item_spacing = egui::vec2(12.0, 10.0); | |
| 81 | 삭제: style.spacing.button_padding = egui::vec2(14.0, 10.0); | |
| 82 | 삭제: }); | |
| 66 | 추가: zipelo_ui_memory_app::archive_theme::apply(&cc.egui_ctx); | |
| 83 | 67 | let (fixture, startup) = zipelo_ui_memory_app::archive_ui::launch_args( |
| 84 | 68 | std::env::args_os().skip(1).collect(), |
| 85 | 69 | std::env::current_dir()?, |
| @@ -11,3 +11,10 @@ pub mod archive_ui; | ||
| 11 | 11 | pub mod archive_screen; |
| 12 | 12 | |
| 13 | 13 | pub mod archive_process; |
| 14 | 추가: | |
| 15 | 추가: pub mod archive_present; | |
| 16 | 추가: | |
| 17 | 추가: #[cfg(feature = "ui")] | |
| 18 | 추가: pub mod archive_picker; | |
| 19 | 추가: #[cfg(feature = "ui")] | |
| 20 | 추가: pub mod archive_theme; |
| @@ -58,6 +58,7 @@ fn binary(name: &str) -> PathBuf { | ||
| 58 | 58 | #[derive(Default)] |
| 59 | 59 | struct Observation { |
| 60 | 60 | jobs: Vec<Vec<&'static str>>, |
| 61 | 추가: starts: Vec<Start>, | |
| 61 | 62 | } |
| 62 | 63 | struct ObservedFactory { |
| 63 | 64 | process: ProcessFactory, |
| @@ -82,6 +83,9 @@ impl Factory for ObservedFactory { | ||
| 82 | 83 | } |
| 83 | 84 | impl Connection for ObservedConnection { |
| 84 | 85 | fn send(&mut self, request: Request) -> Result<(), String> { |
| 86 | 추가: if let Command::Start(start) = &request.command { | |
| 87 | 추가: self.observed.borrow_mut().starts.push(start.clone()); | |
| 88 | 추가: } | |
| 85 | 89 | self.connection.send(request) |
| 86 | 90 | } |
| 87 | 91 | fn poll(&mut self) -> Option<HostEvent> { |
| @@ -230,9 +234,17 @@ mod screen { | ||
| 230 | 234 | let point = self.locate(label); |
| 231 | 235 | self.click_at(point); |
| 232 | 236 | } |
| 233 | 삭제: fn fill(&mut self, label: &str, offset: egui::Vec2, value: &Path) { | |
| 234 | 삭제: let point = self.locate(label) + offset; | |
| 237 | 추가: fn set_text(&mut self, id: &str, value: &str) { | |
| 238 | 추가: self.render(vec![]); | |
| 239 | 추가: let point = self | |
| 240 | 추가: .context | |
| 241 | 추가: .read_response(egui::Id::unique(id)) | |
| 242 | 추가: .unwrap() | |
| 243 | 추가: .rect | |
| 244 | 추가: .center(); | |
| 235 | 245 | self.click_at(point); |
| 246 | 추가: self.context | |
| 247 | 추가: .memory_mut(|memory| memory.request_focus(egui::Id::unique(id))); | |
| 236 | 248 | self.render(vec![ |
| 237 | 249 | egui::Event::Key { |
| 238 | 250 | key: egui::Key::A, |
| @@ -241,9 +253,18 @@ mod screen { | ||
| 241 | 253 | repeat: false, |
| 242 | 254 | modifiers: egui::Modifiers::COMMAND, |
| 243 | 255 | }, |
| 244 | 삭제: egui::Event::Text(value.to_str().unwrap().to_string()), | |
| 256 | 추가: egui::Event::Text(value.into()), | |
| 245 | 257 | ]); |
| 246 | 258 | } |
| 259 | 추가: fn escape(&mut self) { | |
| 260 | 추가: self.render(vec![egui::Event::Key { | |
| 261 | 추가: key: egui::Key::Escape, | |
| 262 | 추가: physical_key: None, | |
| 263 | 추가: pressed: true, | |
| 264 | 추가: repeat: false, | |
| 265 | 추가: modifiers: egui::Modifiers::NONE, | |
| 266 | 추가: }]); | |
| 267 | 추가: } | |
| 247 | 268 | fn settle(&mut self) { |
| 248 | 269 | let deadline = Instant::now() + Duration::from_secs(10); |
| 249 | 270 | while self.app.model.busy() { |
| @@ -254,14 +275,12 @@ mod screen { | ||
| 254 | 275 | completed(&self.app.model); |
| 255 | 276 | } |
| 256 | 277 | fn open(&mut self, archive: &Path) { |
| 257 | 삭제: self.click("파일 열기"); | |
| 258 | 삭제: self.fill("압축파일 절대 경로", egui::vec2(0.0, 22.0), archive); | |
| 259 | 삭제: self.click("열기"); | |
| 278 | 추가: self.app.open_path(archive.to_path_buf()); | |
| 260 | 279 | assert!(self.app.model.busy()); |
| 261 | 280 | self.settle(); |
| 262 | 281 | } |
| 263 | 282 | fn extract(&mut self, destination: &Path) { |
| 264 | 삭제: self.fill("출력 폴더", egui::vec2(100.0, 0.0), destination); | |
| 283 | 추가: self.app.choose_destination(destination.to_path_buf()); | |
| 265 | 284 | self.click("풀기"); |
| 266 | 285 | assert!(self.app.model.busy()); |
| 267 | 286 | self.settle(); |
| @@ -272,6 +291,7 @@ mod screen { | ||
| 272 | 291 | } |
| 273 | 292 | } |
| 274 | 293 | include!("password_flows.rs"); |
| 294 | 추가: include!("selection_flows.rs"); | |
| 275 | 295 | |
| 276 | 296 | fn archive_flow(name: &str, format: Format) { |
| 277 | 297 | let scratch = Scratch::new(); |
| @@ -336,6 +356,49 @@ mod screen { | ||
| 336 | 356 | fn targz_open_and_extract_via_actual_widgets_and_worker() { |
| 337 | 357 | archive_flow("sample.tar.gz", Format::TarGzip); |
| 338 | 358 | } |
| 359 | 추가: | |
| 360 | 추가: #[test] | |
| 361 | 추가: fn empty_directory_zip_extracts_successfully_with_existing_directory_reuse() { | |
| 362 | 추가: let scratch = Scratch::new(); | |
| 363 | 추가: let source = make_directory(&scratch.path("empty-source")); | |
| 364 | 추가: fs::create_dir(source.join("child")).unwrap(); | |
| 365 | 추가: let archive = scratch.path("empty-source.zip"); | |
| 366 | 추가: let output = make_directory(&scratch.path("output")); | |
| 367 | 추가: let (factory, observed) = observed_factory(); | |
| 368 | 추가: let mut screen = Screen::new(factory); | |
| 369 | 추가: screen.app.add_sources(vec![source]); | |
| 370 | 추가: screen.render(vec![]); | |
| 371 | 추가: screen.click("만들기"); | |
| 372 | 추가: screen.settle(); | |
| 373 | 추가: assert!(archive.is_file()); | |
| 374 | 추가: screen.open(&archive); | |
| 375 | 추가: assert!( | |
| 376 | 추가: screen | |
| 377 | 추가: .app | |
| 378 | 추가: .model | |
| 379 | 추가: .entries | |
| 380 | 추가: .iter() | |
| 381 | 추가: .all(|entry| entry.kind == Kind::Directory) | |
| 382 | 추가: ); | |
| 383 | 추가: for expected in [2, 0] { | |
| 384 | 추가: screen.extract(&output); | |
| 385 | 추가: assert!(output.join("empty-source/child").is_dir()); | |
| 386 | 추가: assert_eq!( | |
| 387 | 추가: screen.app.model.terminal.as_ref().unwrap().created_count, | |
| 388 | 추가: expected | |
| 389 | 추가: ); | |
| 390 | 추가: let shown = screen.render(vec![]); | |
| 391 | 추가: assert!(shown.iter().any(|(text, _)| text == "압축을 풀었습니다")); | |
| 392 | 추가: assert!( | |
| 393 | 추가: !shown | |
| 394 | 추가: .iter() | |
| 395 | 추가: .any(|(text, _)| text.contains("저장이 끝났는지")) | |
| 396 | 추가: ); | |
| 397 | 추가: screen.click("확인"); | |
| 398 | 추가: } | |
| 399 | 추가: assert_reaped(&observed); | |
| 400 | 추가: } | |
| 401 | 추가: | |
| 339 | 402 | #[test] |
| 340 | 403 | fn create_zip_reopen_and_extract_via_actual_widgets_and_worker() { |
| 341 | 404 | let scratch = Scratch::new(); |
| @@ -345,14 +408,10 @@ mod screen { | ||
| 345 | 408 | let output = make_directory(&scratch.path("output")); |
| 346 | 409 | let (factory, observed) = observed_factory(); |
| 347 | 410 | let mut screen = Screen::new(factory); |
| 348 | 삭제: screen.click("ZIP 만들기"); | |
| 349 | 삭제: screen.fill( | |
| 350 | 삭제: "원본 파일 절대 경로 / 한 줄에 하나", | |
| 351 | 삭제: egui::vec2(0.0, 25.0), | |
| 352 | 삭제: &source, | |
| 353 | 삭제: ); | |
| 354 | 삭제: screen.fill("저장할 ZIP 절대 경로", egui::vec2(0.0, 22.0), &archive); | |
| 355 | 삭제: screen.click("ZIP 만들기"); | |
| 411 | 추가: screen.app.add_sources(vec![source.clone()]); | |
| 412 | 추가: screen.render(vec![]); | |
| 413 | 추가: screen.set_text("zip-name", archive.file_name().unwrap().to_str().unwrap()); | |
| 414 | 추가: screen.click("만들기"); | |
| 356 | 415 | assert!(screen.app.model.busy()); |
| 357 | 416 | screen.settle(); |
| 358 | 417 | assert!(archive.is_file()); |
| @@ -30,7 +30,7 @@ impl Screen { | ||
| 30 | 30 | self.render(vec![]); |
| 31 | 31 | let input = self |
| 32 | 32 | .context |
| 33 | 삭제: .read_response(egui::Id::new("archive-password-input")) | |
| 33 | 추가: .read_response(egui::Id::unique("archive-password-input")) | |
| 34 | 34 | .expect("암호 입력란이 없음") |
| 35 | 35 | .rect |
| 36 | 36 | .center(); |
| @@ -48,10 +48,13 @@ impl Screen { | ||
| 48 | 48 | if !text.is_empty() { |
| 49 | 49 | assert!(!rendered.iter().any(|(value, _)| value.contains(text))); |
| 50 | 50 | } |
| 51 | 삭제: self.click("암호 전달"); | |
| 51 | 추가: if self.app.model.challenge.is_some_and(|(_, _, encrypt)| encrypt) { | |
| 52 | 추가: self.set_text("archive-password-confirm", text); | |
| 53 | 추가: } | |
| 54 | 추가: self.click("확인"); | |
| 52 | 55 | } |
| 53 | 56 | fn start_password_extract(&mut self, output: &Path) { |
| 54 | 삭제: self.fill("출력 폴더", egui::vec2(100.0, 0.0), output); | |
| 57 | 추가: self.app.choose_destination(output.to_path_buf()); | |
| 55 | 58 | self.click("풀기"); |
| 56 | 59 | assert!(self.app.model.busy()); |
| 57 | 60 | } |
| @@ -67,15 +70,11 @@ impl Screen { | ||
| 67 | 70 | assert!(self.app.model.challenge.is_none()); |
| 68 | 71 | } |
| 69 | 72 | fn start_encrypted_zip(&mut self, source: &Path, archive: &Path) { |
| 70 | 삭제: self.click("ZIP 만들기"); | |
| 71 | 삭제: self.fill( | |
| 72 | 삭제: "원본 파일 절대 경로 / 한 줄에 하나", | |
| 73 | 삭제: egui::vec2(0.0, 25.0), | |
| 74 | 삭제: source, | |
| 75 | 삭제: ); | |
| 76 | 삭제: self.fill("저장할 ZIP 절대 경로", egui::vec2(0.0, 22.0), archive); | |
| 77 | 삭제: self.click("암호로 보호"); | |
| 78 | 삭제: self.click("ZIP 만들기"); | |
| 73 | 추가: self.app.add_sources(vec![source.to_path_buf()]); | |
| 74 | 추가: self.render(vec![]); | |
| 75 | 추가: self.set_text("zip-name", archive.file_name().unwrap().to_str().unwrap()); | |
| 76 | 추가: self.click("암호로 보호하기"); | |
| 77 | 추가: self.click("만들기"); | |
| 79 | 78 | assert!(self.app.model.busy(), "{}", self.app.model.status()); |
| 80 | 79 | } |
| 81 | 80 | } |
| @@ -131,17 +130,9 @@ fn wrong_password_retry_clears_input_and_succeeds_without_partial_output() { | ||
| 131 | 130 | .iter() |
| 132 | 131 | .any(|(value, _)| value == "암호가 맞지 않습니다. 다시 입력하세요") |
| 133 | 132 | ); |
| 134 | 삭제: screen.click("암호 전달"); | |
| 133 | 추가: screen.click("확인"); | |
| 135 | 134 | assert_eq!(screen.app.model.challenge, Some((second, 2, false))); |
| 136 | 삭제: assert!( | |
| 137 | 삭제: screen | |
| 138 | 삭제: .app | |
| 139 | 삭제: .model | |
| 140 | 삭제: .input_error | |
| 141 | 삭제: .as_ref() | |
| 142 | 삭제: .unwrap() | |
| 143 | 삭제: .contains("1~1024바이트") | |
| 144 | 삭제: ); | |
| 135 | 추가: assert!(screen.app.model.input_error.is_none()); | |
| 145 | 136 | screen.render(vec![]); |
| 146 | 137 | screen.password_answer(FIXTURE_PASSWORD); |
| 147 | 138 | screen.finish_password_job(Outcome::Completed); |
| @@ -181,7 +172,7 @@ fn cancel_password_extraction_waits_for_cleanup_without_writes() { | ||
| 181 | 172 | screen.open(&archive); |
| 182 | 173 | screen.start_password_extract(&output); |
| 183 | 174 | screen.password_request(1, false); |
| 184 | 삭제: screen.click("작업 취소"); | |
| 175 | 추가: screen.escape(); | |
| 185 | 176 | screen.app.model.request_close(); |
| 186 | 177 | screen.app.model.confirm_close(); |
| 187 | 178 | assert!(matches!( |
| @@ -234,7 +225,7 @@ fn cancel_password_creation_does_not_create_an_archive() { | ||
| 234 | 225 | let mut screen = Screen::new(factory); |
| 235 | 226 | screen.start_encrypted_zip(&source, &archive); |
| 236 | 227 | screen.password_request(1, true); |
| 237 | 삭제: screen.click("작업 취소"); | |
| 228 | 추가: screen.escape(); | |
| 238 | 229 | screen.finish_password_job(Outcome::Cancelled); |
| 239 | 230 | assert!(!archive.exists()); |
| 240 | 231 | assert_eq!(fs::read(source).unwrap(), b"preserve"); |
| @@ -254,15 +245,7 @@ fn oversized_utf8_password_stays_in_dialog_then_accepts_valid_input() { | ||
| 254 | 245 | let id = screen.password_request(1, false); |
| 255 | 246 | screen.password_answer(&"가".repeat(342)); |
| 256 | 247 | assert_eq!(screen.app.model.challenge, Some((id, 1, false))); |
| 257 | 삭제: assert!( | |
| 258 | 삭제: screen | |
| 259 | 삭제: .app | |
| 260 | 삭제: .model | |
| 261 | 삭제: .input_error | |
| 262 | 삭제: .as_ref() | |
| 263 | 삭제: .unwrap() | |
| 264 | 삭제: .contains("1~1024바이트") | |
| 265 | 삭제: ); | |
| 248 | 추가: assert!(screen.render(vec![]).iter().any(|(text, _)| text.contains("1~1024바이트"))); | |
| 266 | 249 | assert_eq!(fs::read_dir(&output).unwrap().count(), 0); |
| 267 | 250 | screen.password_answer(FIXTURE_PASSWORD); |
| 268 | 251 | screen.finish_password_job(Outcome::Completed); |
| @@ -280,14 +263,18 @@ fn invalid_password_then_cancel(invalid: &str, close: bool) { | ||
| 280 | 263 | let challenge = screen.password_request(1, true); |
| 281 | 264 | screen.password_answer(invalid); |
| 282 | 265 | assert_eq!(screen.app.model.challenge, Some((challenge, 1, true))); |
| 283 | 삭제: assert!(screen.app.model.status().contains("1~1024바이트")); | |
| 266 | 추가: if invalid.is_empty() { | |
| 267 | 추가: assert!(screen.app.model.input_error.is_none()); | |
| 268 | 추가: } else { | |
| 269 | 추가: assert!(screen.render(vec![]).iter().any(|(text, _)| text.contains("1~1024바이트"))); | |
| 270 | 추가: } | |
| 284 | 271 | if close { |
| 285 | 272 | screen.app.model.request_close(); |
| 286 | 273 | screen.app.model.confirm_close(); |
| 287 | 274 | assert_eq!(screen.app.model.close, Close::Waiting); |
| 288 | 275 | assert!(!screen.app.model.confirmed); |
| 289 | 276 | } else { |
| 290 | 삭제: screen.click("작업 취소"); | |
| 277 | 추가: screen.escape(); | |
| 291 | 278 | } |
| 292 | 279 | screen.finish_password_job(Outcome::Cancelled); |
| 293 | 280 | assert_eq!(screen.app.model.status(), "작업 취소됨"); |
| @@ -0,0 +1,218 @@ | ||
| 1 | 추가: #[test] | |
| 2 | 추가: fn extraction_completion_matches_actual_worker_selection_matrix() { | |
| 3 | 추가: use std::collections::BTreeSet; | |
| 4 | 추가: | |
| 5 | 추가: fn contents(root: &Path) -> BTreeSet<String> { | |
| 6 | 추가: fn visit(root: &Path, current: &Path, found: &mut BTreeSet<String>) { | |
| 7 | 추가: for entry in fs::read_dir(current).unwrap() { | |
| 8 | 추가: let path = entry.unwrap().path(); | |
| 9 | 추가: found.insert( | |
| 10 | 추가: path.strip_prefix(root) | |
| 11 | 추가: .unwrap() | |
| 12 | 추가: .to_str() | |
| 13 | 추가: .unwrap() | |
| 14 | 추가: .replace('\\', "/"), | |
| 15 | 추가: ); | |
| 16 | 추가: if path.is_dir() { | |
| 17 | 추가: visit(root, &path, found); | |
| 18 | 추가: } | |
| 19 | 추가: } | |
| 20 | 추가: } | |
| 21 | 추가: let mut found = BTreeSet::new(); | |
| 22 | 추가: visit(root, root, &mut found); | |
| 23 | 추가: found | |
| 24 | 추가: } | |
| 25 | 추가: | |
| 26 | 추가: let scratch = Scratch::new(); | |
| 27 | 추가: let docs = make_directory(&scratch.path("docs")); | |
| 28 | 추가: fs::create_dir(docs.join("empty")).unwrap(); | |
| 29 | 추가: fs::create_dir(docs.join("nested")).unwrap(); | |
| 30 | 추가: fs::write(docs.join("nested/one.txt"), b"nested content").unwrap(); | |
| 31 | 추가: let root_file = scratch.path("root.txt"); | |
| 32 | 추가: fs::write(&root_file, b"root content").unwrap(); | |
| 33 | 추가: let archive = scratch.path("selection.zip"); | |
| 34 | 추가: let (factory, observed) = observed_factory(); | |
| 35 | 추가: let mut screen = Screen::new(factory); | |
| 36 | 추가: screen.app.add_sources(vec![docs, root_file]); | |
| 37 | 추가: screen.render(vec![]); | |
| 38 | 추가: screen.set_text("zip-name", "selection.zip"); | |
| 39 | 추가: screen.click("만들기"); | |
| 40 | 추가: screen.settle(); | |
| 41 | 추가: | |
| 42 | 추가: let cases: [(&str, Option<&[&str]>, &[&str]); 6] = [ | |
| 43 | 추가: ( | |
| 44 | 추가: "all", | |
| 45 | 추가: None, | |
| 46 | 추가: &[ | |
| 47 | 추가: "docs", | |
| 48 | 추가: "docs/empty", | |
| 49 | 추가: "docs/nested", | |
| 50 | 추가: "docs/nested/one.txt", | |
| 51 | 추가: "root.txt", | |
| 52 | 추가: ], | |
| 53 | 추가: ), | |
| 54 | 추가: ( | |
| 55 | 추가: "files", | |
| 56 | 추가: Some(&["docs/nested/one.txt", "root.txt"]), | |
| 57 | 추가: &["docs", "docs/nested", "docs/nested/one.txt", "root.txt"], | |
| 58 | 추가: ), | |
| 59 | 추가: ("directory", Some(&["docs"]), &["docs"]), | |
| 60 | 추가: ( | |
| 61 | 추가: "mixed", | |
| 62 | 추가: Some(&["docs", "docs/nested/one.txt"]), | |
| 63 | 추가: &["docs", "docs/nested", "docs/nested/one.txt"], | |
| 64 | 추가: ), | |
| 65 | 추가: ("empty", Some(&["docs/empty"]), &["docs", "docs/empty"]), | |
| 66 | 추가: ( | |
| 67 | 추가: "nested-directory", | |
| 68 | 추가: Some(&["docs/nested"]), | |
| 69 | 추가: &["docs", "docs/nested"], | |
| 70 | 추가: ), | |
| 71 | 추가: ]; | |
| 72 | 추가: for (name, selected, expected) in cases { | |
| 73 | 추가: screen.open(&archive); | |
| 74 | 추가: let ids = selected.map(|names| { | |
| 75 | 추가: names | |
| 76 | 추가: .iter() | |
| 77 | 추가: .map(|name| { | |
| 78 | 추가: screen | |
| 79 | 추가: .app | |
| 80 | 추가: .model | |
| 81 | 추가: .entries | |
| 82 | 추가: .iter() | |
| 83 | 추가: .find(|entry| entry.name.trim_end_matches('/') == *name) | |
| 84 | 추가: .unwrap_or_else(|| panic!("목록 항목 누락: {name}")) | |
| 85 | 추가: .id | |
| 86 | 추가: }) | |
| 87 | 추가: .collect::<BTreeSet<_>>() | |
| 88 | 추가: }); | |
| 89 | 추가: if let Some(ids) = &ids { | |
| 90 | 추가: screen.app.model.selected = ids.clone(); | |
| 91 | 추가: screen.click("선택한 항목만 풀기"); | |
| 92 | 추가: } | |
| 93 | 추가: let output = make_directory(&scratch.path(name)); | |
| 94 | 추가: screen.extract(&output); | |
| 95 | 추가: let terminal = screen.app.model.terminal.as_ref().unwrap(); | |
| 96 | 추가: assert_eq!(terminal.outcome, Outcome::Completed, "{name}"); | |
| 97 | 추가: assert!(screen.app.model.confirmed, "{name}"); | |
| 98 | 추가: assert!(terminal.error.is_none(), "{name}"); | |
| 99 | 추가: let expected = expected | |
| 100 | 추가: .iter() | |
| 101 | 추가: .map(|name| name.to_string()) | |
| 102 | 추가: .collect::<BTreeSet<_>>(); | |
| 103 | 추가: assert_eq!(contents(&output), expected, "{name}"); | |
| 104 | 추가: let reports = screen | |
| 105 | 추가: .app | |
| 106 | 추가: .model | |
| 107 | 추가: .outputs | |
| 108 | 추가: .iter() | |
| 109 | 추가: .map(|(name, disposition)| { | |
| 110 | 추가: assert_eq!(*disposition, Disposition::Created); | |
| 111 | 추가: name.clone() | |
| 112 | 추가: }) | |
| 113 | 추가: .collect::<BTreeSet<_>>(); | |
| 114 | 추가: assert_eq!(reports, expected, "{name}"); | |
| 115 | 추가: assert_eq!(terminal.created_count as usize, expected.len(), "{name}"); | |
| 116 | 추가: for (path, bytes) in [ | |
| 117 | 추가: ("docs/nested/one.txt", b"nested content".as_slice()), | |
| 118 | 추가: ("root.txt", b"root content".as_slice()), | |
| 119 | 추가: ] { | |
| 120 | 추가: if expected.contains(path) { | |
| 121 | 추가: assert_eq!(fs::read(output.join(path)).unwrap(), bytes, "{name}"); | |
| 122 | 추가: } | |
| 123 | 추가: } | |
| 124 | 추가: match observed.borrow().starts.last().unwrap() { | |
| 125 | 추가: Start::Extract { selection, .. } => match (selection, &ids) { | |
| 126 | 추가: (Selection::All, None) => {} | |
| 127 | 추가: (Selection::EntryIds(actual), Some(ids)) => { | |
| 128 | 추가: assert_eq!(actual, &ids.iter().copied().collect::<Vec<_>>(), "{name}"); | |
| 129 | 추가: } | |
| 130 | 추가: _ => panic!("요청 선택 범위 불일치: {name}"), | |
| 131 | 추가: }, | |
| 132 | 추가: _ => panic!("추출 요청 누락: {name}"), | |
| 133 | 추가: } | |
| 134 | 추가: let shown = screen.render(vec![]); | |
| 135 | 추가: assert!( | |
| 136 | 추가: shown.iter().any(|(text, _)| text == "압축을 풀었습니다"), | |
| 137 | 추가: "{name}: {shown:?}" | |
| 138 | 추가: ); | |
| 139 | 추가: assert!( | |
| 140 | 추가: !shown | |
| 141 | 추가: .iter() | |
| 142 | 추가: .any(|(text, _)| text.contains("저장이 끝났는지") || text.contains("일부 파일만")), | |
| 143 | 추가: "{name}" | |
| 144 | 추가: ); | |
| 145 | 추가: screen.click("확인"); | |
| 146 | 추가: } | |
| 147 | 추가: assert_reaped(&observed); | |
| 148 | 추가: } | |
| 149 | 추가: | |
| 150 | 추가: #[cfg(unix)] | |
| 151 | 추가: #[test] | |
| 152 | 추가: fn auto_destination_is_private_under_desktop_umask() { | |
| 153 | 추가: use std::{os::unix::fs::PermissionsExt, process::Command}; | |
| 154 | 추가: | |
| 155 | 추가: const CHILD: &str = "ZIPELO_PRIVATE_DESTINATION_CHILD"; | |
| 156 | 추가: if std::env::var_os(CHILD).is_none() { | |
| 157 | 추가: let output = Command::new("sh") | |
| 158 | 추가: .args([ | |
| 159 | 추가: "-c", | |
| 160 | 추가: "umask 0002; exec \"$@\"", | |
| 161 | 추가: "zipelo-private-destination", | |
| 162 | 추가: ]) | |
| 163 | 추가: .arg(std::env::current_exe().unwrap()) | |
| 164 | 추가: .args([ | |
| 165 | 추가: "--exact", | |
| 166 | 추가: "screen::auto_destination_is_private_under_desktop_umask", | |
| 167 | 추가: "--nocapture", | |
| 168 | 추가: ]) | |
| 169 | 추가: .env(CHILD, "1") | |
| 170 | 추가: .output() | |
| 171 | 추가: .unwrap(); | |
| 172 | 추가: assert!( | |
| 173 | 추가: output.status.success(), | |
| 174 | 추가: "umask 0002 추출 회귀 실패: {}{}", | |
| 175 | 추가: String::from_utf8_lossy(&output.stdout), | |
| 176 | 추가: String::from_utf8_lossy(&output.stderr) | |
| 177 | 추가: ); | |
| 178 | 추가: return; | |
| 179 | 추가: } | |
| 180 | 추가: | |
| 181 | 추가: let mask = Command::new("sh").args(["-c", "umask"]).output().unwrap(); | |
| 182 | 추가: assert_eq!(String::from_utf8(mask.stdout).unwrap().trim(), "0002"); | |
| 183 | 추가: let scratch = Scratch::new(); | |
| 184 | 추가: let archive = scratch.path("sample.zip"); | |
| 185 | 추가: fs::copy( | |
| 186 | 추가: Path::new(env!("CARGO_MANIFEST_DIR")) | |
| 187 | 추가: .join("../../tests/rust-app-real-worker/fixtures/sample.zip"), | |
| 188 | 추가: &archive, | |
| 189 | 추가: ) | |
| 190 | 추가: .unwrap(); | |
| 191 | 추가: let output = scratch.path("sample"); | |
| 192 | 추가: assert!(!output.exists()); | |
| 193 | 추가: let (factory, observed) = observed_factory(); | |
| 194 | 추가: let mut screen = Screen::new(factory); | |
| 195 | 추가: screen.open(&archive); | |
| 196 | 추가: screen.click("풀기"); | |
| 197 | 추가: assert!(screen.app.model.busy()); | |
| 198 | 추가: screen.settle(); | |
| 199 | 추가: assert_eq!( | |
| 200 | 추가: fs::metadata(&output).unwrap().permissions().mode() & 0o777, | |
| 201 | 추가: 0o700 | |
| 202 | 추가: ); | |
| 203 | 추가: assert_eq!( | |
| 204 | 추가: fs::read(output.join("content.txt")).unwrap(), | |
| 205 | 추가: b"Zipelo real worker flow\n" | |
| 206 | 추가: ); | |
| 207 | 추가: assert_eq!( | |
| 208 | 추가: screen.app.model.terminal.as_ref().unwrap().publication, | |
| 209 | 추가: Publication::Complete | |
| 210 | 추가: ); | |
| 211 | 추가: assert!( | |
| 212 | 추가: screen | |
| 213 | 추가: .render(vec![]) | |
| 214 | 추가: .iter() | |
| 215 | 추가: .any(|(text, _)| text == "압축을 풀었습니다") | |
| 216 | 추가: ); | |
| 217 | 추가: assert_reaped(&observed); | |
| 218 | 추가: } |
| @@ -0,0 +1,335 @@ | ||
| 1 | 추가: use eframe::egui::{self, FontData, FontDefinitions, FontFamily, FontId, TextStyle}; | |
| 2 | 추가: use std::{collections::VecDeque, path::PathBuf}; | |
| 3 | 추가: use zipelo_ui_memory_app::{archive_screen::ArchiveApp, archive_ui::*}; | |
| 4 | 추가: #[path = "../../experiments/rust-ui-memory-app/src/renderer.rs"] | |
| 5 | 추가: mod renderer; | |
| 6 | 추가: #[path = "../../experiments/rust-ui-memory-app/src/system_font.rs"] | |
| 7 | 추가: mod system_font; | |
| 8 | 추가: | |
| 9 | 추가: #[derive(Clone)] | |
| 10 | 추가: struct CaptureFactory { | |
| 11 | 추가: mode: String, | |
| 12 | 추가: } | |
| 13 | 추가: struct CaptureConnection { | |
| 14 | 추가: job: u64, | |
| 15 | 추가: sequence: u64, | |
| 16 | 추가: mode: String, | |
| 17 | 추가: queue: VecDeque<HostEvent>, | |
| 18 | 추가: create_name: Option<String>, | |
| 19 | 추가: } | |
| 20 | 추가: impl CaptureConnection { | |
| 21 | 추가: fn event(&mut self, event: Event) { | |
| 22 | 추가: self.queue.push_back(HostEvent::Frame { | |
| 23 | 추가: job_id: self.job, | |
| 24 | 추가: sequence: self.sequence, | |
| 25 | 추가: event, | |
| 26 | 추가: }); | |
| 27 | 추가: self.sequence += 1; | |
| 28 | 추가: } | |
| 29 | 추가: fn terminal(&mut self, terminal: Terminal) { | |
| 30 | 추가: self.event(Event::Terminal(terminal)); | |
| 31 | 추가: self.queue.extend([ | |
| 32 | 추가: HostEvent::StdoutEof, | |
| 33 | 추가: HostEvent::StderrEof, | |
| 34 | 추가: HostEvent::Exited { success: true }, | |
| 35 | 추가: ]); | |
| 36 | 추가: } | |
| 37 | 추가: fn finish(&mut self, listing: bool) { | |
| 38 | 추가: let error = !listing && self.mode == "error"; | |
| 39 | 추가: let cancelled = !listing && self.mode == "cancelled"; | |
| 40 | 추가: let mut count = 0; | |
| 41 | 추가: if !listing && !error && !cancelled { | |
| 42 | 추가: let names = self | |
| 43 | 추가: .create_name | |
| 44 | 추가: .clone() | |
| 45 | 추가: .map(|name| vec![name]) | |
| 46 | 추가: .unwrap_or_else(|| { | |
| 47 | 추가: vec![ | |
| 48 | 추가: "읽어주세요.txt".into(), | |
| 49 | 추가: "여행 일정.pdf".into(), | |
| 50 | 추가: "사진".into(), | |
| 51 | 추가: ] | |
| 52 | 추가: }); | |
| 53 | 추가: for name in names { | |
| 54 | 추가: self.event(Event::Output { | |
| 55 | 추가: entry_id: None, | |
| 56 | 추가: relative_name: name, | |
| 57 | 추가: disposition: Disposition::Created, | |
| 58 | 추가: }); | |
| 59 | 추가: count += 1; | |
| 60 | 추가: } | |
| 61 | 추가: } | |
| 62 | 추가: self.terminal(Terminal { | |
| 63 | 추가: outcome: if error { | |
| 64 | 추가: Outcome::Failed | |
| 65 | 추가: } else if cancelled { | |
| 66 | 추가: Outcome::Cancelled | |
| 67 | 추가: } else { | |
| 68 | 추가: Outcome::Completed | |
| 69 | 추가: }, | |
| 70 | 추가: error: error.then_some(ErrorCode::DiskFull), | |
| 71 | 추가: publication: if listing || error || cancelled { | |
| 72 | 추가: Publication::None | |
| 73 | 추가: } else { | |
| 74 | 추가: Publication::Complete | |
| 75 | 추가: }, | |
| 76 | 추가: created_count: count, | |
| 77 | 추가: retained_partial_count: 0, | |
| 78 | 추가: durability: if listing { | |
| 79 | 추가: Durability::NotApplicable | |
| 80 | 추가: } else { | |
| 81 | 추가: Durability::Synced | |
| 82 | 추가: }, | |
| 83 | 추가: cleanup: Cleanup::Complete, | |
| 84 | 추가: }); | |
| 85 | 추가: } | |
| 86 | 추가: } | |
| 87 | 추가: fn entries() -> Vec<Entry> { | |
| 88 | 추가: vec![ | |
| 89 | 추가: Entry { | |
| 90 | 추가: id: 0, | |
| 91 | 추가: name: "읽어주세요.txt".into(), | |
| 92 | 추가: kind: Kind::File, | |
| 93 | 추가: bytes: Some(4096), | |
| 94 | 추가: packed: Some(1800), | |
| 95 | 추가: encrypted: false, | |
| 96 | 추가: }, | |
| 97 | 추가: Entry { | |
| 98 | 추가: id: 1, | |
| 99 | 추가: name: "여행 일정.pdf".into(), | |
| 100 | 추가: kind: Kind::File, | |
| 101 | 추가: bytes: Some(1_287_952), | |
| 102 | 추가: packed: Some(900_000), | |
| 103 | 추가: encrypted: true, | |
| 104 | 추가: }, | |
| 105 | 추가: Entry { | |
| 106 | 추가: id: 2, | |
| 107 | 추가: name: "사진".into(), | |
| 108 | 추가: kind: Kind::Directory, | |
| 109 | 추가: bytes: Some(0), | |
| 110 | 추가: packed: None, | |
| 111 | 추가: encrypted: false, | |
| 112 | 추가: }, | |
| 113 | 추가: ] | |
| 114 | 추가: } | |
| 115 | 추가: impl Factory for CaptureFactory { | |
| 116 | 추가: fn connect(&mut self, job: u64) -> Result<Box<dyn Connection>, String> { | |
| 117 | 추가: Ok(Box::new(CaptureConnection { | |
| 118 | 추가: job, | |
| 119 | 추가: sequence: 0, | |
| 120 | 추가: mode: self.mode.clone(), | |
| 121 | 추가: queue: VecDeque::new(), | |
| 122 | 추가: create_name: None, | |
| 123 | 추가: })) | |
| 124 | 추가: } | |
| 125 | 추가: } | |
| 126 | 추가: impl Connection for CaptureConnection { | |
| 127 | 추가: fn send(&mut self, request: Request) -> Result<(), String> { | |
| 128 | 추가: match request.command { | |
| 129 | 추가: Command::Start(start) => { | |
| 130 | 추가: self.event(Event::Accepted { encryption: true }); | |
| 131 | 추가: match start { | |
| 132 | 추가: Start::List { .. } => { | |
| 133 | 추가: for entry in entries() { | |
| 134 | 추가: self.event(Event::Entry(entry)); | |
| 135 | 추가: } | |
| 136 | 추가: self.event(Event::ListEnd { | |
| 137 | 추가: entry_count: 3, | |
| 138 | 추가: list_id: ListId { | |
| 139 | 추가: catalog_version: 1, | |
| 140 | 추가: format: Format::Zip, | |
| 141 | 추가: source_object: SourceObject::Unix { | |
| 142 | 추가: device: 1, | |
| 143 | 추가: inode: 1, | |
| 144 | 추가: }, | |
| 145 | 추가: archive_bytes: 902000, | |
| 146 | 추가: archive_sha256: [7; 32], | |
| 147 | 추가: }, | |
| 148 | 추가: }); | |
| 149 | 추가: self.finish(true); | |
| 150 | 추가: } | |
| 151 | 추가: Start::Extract { .. } => { | |
| 152 | 추가: if self.mode.starts_with("password") { | |
| 153 | 추가: self.event(Event::PasswordRequired { | |
| 154 | 추가: challenge_id: 17, | |
| 155 | 추가: attempt: if self.mode == "password-retry" { 2 } else { 1 }, | |
| 156 | 추가: encrypt: false, | |
| 157 | 추가: }); | |
| 158 | 추가: } else if self.mode.starts_with("progress") || self.mode == "cancelling" { | |
| 159 | 추가: self.event(Event::Progress { | |
| 160 | 추가: stage: Stage::Decode, | |
| 161 | 추가: processed: 38 << 20, | |
| 162 | 추가: total: (self.mode != "progress-unknown").then_some(61 << 20), | |
| 163 | 추가: completed_entries: 12, | |
| 164 | 추가: }); | |
| 165 | 추가: } else { | |
| 166 | 추가: self.finish(false); | |
| 167 | 추가: } | |
| 168 | 추가: } | |
| 169 | 추가: Start::CreateZip { | |
| 170 | 추가: output_file, | |
| 171 | 추가: aes256, | |
| 172 | 추가: .. | |
| 173 | 추가: } => { | |
| 174 | 추가: self.create_name = | |
| 175 | 추가: Some(output_file.file_name().unwrap().to_string_lossy().into()); | |
| 176 | 추가: if aes256 { | |
| 177 | 추가: self.event(Event::PasswordRequired { | |
| 178 | 추가: challenge_id: 17, | |
| 179 | 추가: attempt: 1, | |
| 180 | 추가: encrypt: true, | |
| 181 | 추가: }); | |
| 182 | 추가: } else { | |
| 183 | 추가: self.finish(false); | |
| 184 | 추가: } | |
| 185 | 추가: } | |
| 186 | 추가: } | |
| 187 | 추가: } | |
| 188 | 추가: Command::Password { .. } => self.finish(false), | |
| 189 | 추가: Command::Cancel => { | |
| 190 | 추가: self.event(Event::CancelAck { | |
| 191 | 추가: request_sequence: request.sequence, | |
| 192 | 추가: status: CancelStatus::Requested, | |
| 193 | 추가: }); | |
| 194 | 추가: if self.mode != "cancelling" { | |
| 195 | 추가: self.terminal(Terminal { | |
| 196 | 추가: outcome: Outcome::Cancelled, | |
| 197 | 추가: error: None, | |
| 198 | 추가: publication: Publication::None, | |
| 199 | 추가: created_count: 0, | |
| 200 | 추가: retained_partial_count: 0, | |
| 201 | 추가: durability: Durability::NotApplicable, | |
| 202 | 추가: cleanup: Cleanup::Complete, | |
| 203 | 추가: }); | |
| 204 | 추가: } | |
| 205 | 추가: } | |
| 206 | 추가: } | |
| 207 | 추가: Ok(()) | |
| 208 | 추가: } | |
| 209 | 추가: fn poll(&mut self) -> Option<HostEvent> { | |
| 210 | 추가: self.queue.pop_front() | |
| 211 | 추가: } | |
| 212 | 추가: } | |
| 213 | 추가: struct Capture { | |
| 214 | 추가: app: ArchiveApp, | |
| 215 | 추가: mode: String, | |
| 216 | 추가: factory: CaptureFactory, | |
| 217 | 추가: triggered: bool, | |
| 218 | 추가: } | |
| 219 | 추가: impl eframe::App for Capture { | |
| 220 | 추가: fn ui(&mut self, root: &mut egui::Ui, _: &mut eframe::Frame) { | |
| 221 | 추가: if self.mode == "hover" { | |
| 222 | 추가: root.ctx().input_mut(|i| { | |
| 223 | 추가: i.raw.hovered_files = vec![egui::HoveredFile { | |
| 224 | 추가: path: Some(PathBuf::from("여행.zip")), | |
| 225 | 추가: ..Default::default() | |
| 226 | 추가: }] | |
| 227 | 추가: }); | |
| 228 | 추가: } | |
| 229 | 추가: if !self.triggered && self.app.model.list_id.is_some() { | |
| 230 | 추가: self.triggered = true; | |
| 231 | 추가: if [ | |
| 232 | 추가: "password", | |
| 233 | 추가: "password-retry", | |
| 234 | 추가: "password-create", | |
| 235 | 추가: "progress", | |
| 236 | 추가: "progress-unknown", | |
| 237 | 추가: "cancelling", | |
| 238 | 추가: "success", | |
| 239 | 추가: "error", | |
| 240 | 추가: "cancelled", | |
| 241 | 추가: ] | |
| 242 | 추가: .contains(&self.mode.as_str()) | |
| 243 | 추가: { | |
| 244 | 추가: let archive = self.app.model.archive.clone().unwrap(); | |
| 245 | 추가: let start = if self.mode == "password-create" { | |
| 246 | 추가: Start::CreateZip { | |
| 247 | 추가: sources: vec![(archive.clone(), "자료".into())], | |
| 248 | 추가: output_file: archive.with_file_name("보호한 자료.zip"), | |
| 249 | 추가: method: Method::Deflate, | |
| 250 | 추가: aes256: true, | |
| 251 | 추가: } | |
| 252 | 추가: } else { | |
| 253 | 추가: Start::Extract { | |
| 254 | 추가: archive, | |
| 255 | 추가: destination: std::env::current_dir().unwrap(), | |
| 256 | 추가: selection: Selection::All, | |
| 257 | 추가: list_id: self.app.model.list_id.clone().unwrap(), | |
| 258 | 추가: gzip_output_name: None, | |
| 259 | 추가: } | |
| 260 | 추가: }; | |
| 261 | 추가: // 이전 화면과 같은 공개 상태 API로 암호 및 진행 상태를 재현함. | |
| 262 | 추가: if self.mode == "password-create" { | |
| 263 | 추가: self.app.model.begin(start, &mut self.factory); | |
| 264 | 추가: } else { | |
| 265 | 추가: self.app.begin_extract(); | |
| 266 | 추가: } | |
| 267 | 추가: } | |
| 268 | 추가: } | |
| 269 | 추가: self.app.show(root); | |
| 270 | 추가: root.ctx() | |
| 271 | 추가: .request_repaint_after(std::time::Duration::from_millis(30)); | |
| 272 | 추가: } | |
| 273 | 추가: } | |
| 274 | 추가: fn main() -> eframe::Result { | |
| 275 | 추가: let mode = std::env::args().nth(1).unwrap_or_else(|| "empty".into()); | |
| 276 | 추가: let base = std::env::current_dir() | |
| 277 | 추가: .unwrap() | |
| 278 | 추가: .join("tests/ui-redesign/runs/fixtures"); | |
| 279 | 추가: std::fs::create_dir_all(&base).unwrap(); | |
| 280 | 추가: std::fs::write(base.join("읽어주세요.txt"), "화면 검증 입력").unwrap(); | |
| 281 | 추가: std::fs::create_dir_all(base.join("사진")).unwrap(); | |
| 282 | 추가: let font = system_font::load().map_err(|e| eframe::Error::AppCreation(Box::new(e)))?; | |
| 283 | 추가: let title = format!("Zipelo UI capture {mode}"); | |
| 284 | 추가: renderer::run_native( | |
| 285 | 추가: &title, | |
| 286 | 추가: eframe::NativeOptions { | |
| 287 | 추가: viewport: egui::ViewportBuilder::default() | |
| 288 | 추가: .with_inner_size([1060.0, 720.0]) | |
| 289 | 추가: .with_min_inner_size([760.0, 540.0]), | |
| 290 | 추가: ..Default::default() | |
| 291 | 추가: }, | |
| 292 | 추가: || { | |
| 293 | 추가: let mode = mode.clone(); | |
| 294 | 추가: let base = base.clone(); | |
| 295 | 추가: let bytes = font.bytes.clone(); | |
| 296 | 추가: let face_index = font.face_index; | |
| 297 | 추가: Box::new(move |cc| { | |
| 298 | 추가: let mut fonts = FontDefinitions::empty(); | |
| 299 | 추가: let mut data = FontData::from_owned(bytes.clone()); | |
| 300 | 추가: data.index = face_index; | |
| 301 | 추가: fonts.font_data.insert("noto-kr".into(), data.into()); | |
| 302 | 추가: fonts | |
| 303 | 추가: .families | |
| 304 | 추가: .insert(FontFamily::Proportional, vec!["noto-kr".into()]); | |
| 305 | 추가: cc.egui_ctx.set_fonts(fonts); | |
| 306 | 추가: cc.egui_ctx.set_visuals(egui::Visuals::light()); | |
| 307 | 추가: cc.egui_ctx.style_mut_of(egui::Theme::Light, |style| { | |
| 308 | 추가: style | |
| 309 | 추가: .text_styles | |
| 310 | 추가: .insert(TextStyle::Body, FontId::proportional(18.0)); | |
| 311 | 추가: style | |
| 312 | 추가: .text_styles | |
| 313 | 추가: .insert(TextStyle::Button, FontId::proportional(18.0)); | |
| 314 | 추가: style | |
| 315 | 추가: .text_styles | |
| 316 | 추가: .insert(TextStyle::Heading, FontId::proportional(26.0)); | |
| 317 | 추가: }); | |
| 318 | 추가: let factory = CaptureFactory { mode: mode.clone() }; | |
| 319 | 추가: let startup = (!["empty", "hover", "create", "create-filled"] | |
| 320 | 추가: .contains(&mode.as_str())) | |
| 321 | 추가: .then(|| base.join("여행.zip")); | |
| 322 | 추가: let mut app = ArchiveApp::new(Box::new(factory.clone()), startup, true); | |
| 323 | 추가: if mode == "create-filled" { | |
| 324 | 추가: app.add_sources(vec![base.join("읽어주세요.txt"), base.join("사진")]); | |
| 325 | 추가: } | |
| 326 | 추가: Ok(Box::new(Capture { | |
| 327 | 추가: app, | |
| 328 | 추가: mode, | |
| 329 | 추가: factory, | |
| 330 | 추가: triggered: false, | |
| 331 | 추가: })) | |
| 332 | 추가: }) | |
| 333 | 추가: }, | |
| 334 | 추가: ) | |
| 335 | 추가: } |
Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기| @@ -413,7 +413,7 @@ fn renders_every_flow_with_actual_egui_widgets() { | ||
| 413 | 413 | 1060.0, |
| 414 | 414 | ); |
| 415 | 415 | let create = render(&mut app, vec![], 1060.0); |
| 416 | 삭제: assert!(create.iter().any(|(t, _)| t == "저장할 ZIP 절대 경로")); | |
| 416 | 추가: assert!(create.iter().any(|(t, _)| t == "2. 저장 위치")); | |
| 417 | 417 | let mut app = ArchiveApp::new(Box::new(f.clone()), Some(path("locked.zip")), true); |
| 418 | 418 | for _ in 0..8 { |
| 419 | 419 | app.model.poll(); |
| @@ -422,7 +422,7 @@ fn renders_every_flow_with_actual_egui_widgets() { | ||
| 422 | 422 | render(&mut app, vec![], width); |
| 423 | 423 | render(&mut app, vec![], width); |
| 424 | 424 | let password = render(&mut app, vec![], width); |
| 425 | 삭제: assert!(password.iter().any(|(t, _)| t.contains("암호 전달"))); | |
| 425 | 추가: assert!(password.iter().any(|(t, _)| t == "암호가 필요합니다")); | |
| 426 | 426 | } |
| 427 | 427 | assert!(app.model.password("synthetic secret".into())); |
| 428 | 428 | pump(&mut app.model); |
| @@ -644,29 +644,31 @@ fn extract_button_sends_gzip_name_only_for_raw_gzip() { | ||
| 644 | 644 | }], |
| 645 | 645 | ); |
| 646 | 646 | }; |
| 647 | 추가: let scratch = presentation::Folder::new(); | |
| 648 | 추가: app.choose_destination(scratch.0.clone()); | |
| 647 | 649 | render(&mut app, vec![]); |
| 648 | 삭제: let texts = render(&mut app, vec![]); | |
| 649 | 삭제: let folder = texts | |
| 650 | 삭제: .iter() | |
| 651 | 삭제: .find(|(text, _)| text == "출력 폴더") | |
| 652 | 삭제: .unwrap() | |
| 653 | 삭제: .1; | |
| 654 | 삭제: click(&mut app, folder + egui::vec2(100.0, 0.0)); | |
| 655 | 삭제: render( | |
| 656 | 삭제: &mut app, | |
| 657 | 삭제: vec![egui::Event::Text( | |
| 658 | 삭제: path("button-output").to_string_lossy().into_owned(), | |
| 659 | 삭제: )], | |
| 660 | 삭제: ); | |
| 661 | 650 | if format == Format::Gzip { |
| 662 | 삭제: let texts = render(&mut app, vec![]); | |
| 663 | 삭제: let name = texts | |
| 664 | 삭제: .iter() | |
| 665 | 삭제: .find(|(text, _)| text == "출력 파일명") | |
| 651 | 추가: render(&mut app, vec![]); | |
| 652 | 추가: let input = ctx | |
| 653 | 추가: .read_response(egui::Id::unique("gzip-name")) | |
| 666 | 654 | .unwrap() |
| 667 | 삭제: .1; | |
| 668 | 삭제: click(&mut app, name + egui::vec2(100.0, 0.0)); | |
| 669 | 삭제: render(&mut app, vec![egui::Event::Text("plain.txt".into())]); | |
| 655 | 추가: .rect | |
| 656 | 추가: .center(); | |
| 657 | 추가: click(&mut app, input); | |
| 658 | 추가: ctx.memory_mut(|memory| memory.request_focus(egui::Id::unique("gzip-name"))); | |
| 659 | 추가: render( | |
| 660 | 추가: &mut app, | |
| 661 | 추가: vec![ | |
| 662 | 추가: egui::Event::Key { | |
| 663 | 추가: key: egui::Key::A, | |
| 664 | 추가: physical_key: None, | |
| 665 | 추가: pressed: true, | |
| 666 | 추가: repeat: false, | |
| 667 | 추가: modifiers: egui::Modifiers::COMMAND, | |
| 668 | 추가: }, | |
| 669 | 추가: egui::Event::Text("plain.txt".into()), | |
| 670 | 추가: ], | |
| 671 | 추가: ); | |
| 670 | 672 | } |
| 671 | 673 | let texts = render(&mut app, vec![]); |
| 672 | 674 | let button = texts.iter().find(|(text, _)| text == "풀기").unwrap().1; |
| @@ -846,3 +848,5 @@ fn password_validation_and_retry_do_not_erase_transport_failure() { | ||
| 846 | 848 | assert_eq!(model.error.as_deref(), Some("pipe error")); |
| 847 | 849 | assert!(!model.confirmed); |
| 848 | 850 | } |
| 851 | 추가: | |
| 852 | 추가: mod presentation; |
| @@ -0,0 +1,56 @@ | ||
| 1 | 추가: # Zipelo 화면 회귀 확인 | |
| 2 | 추가: | |
| 3 | 추가: 설계 기준은 docs/ui-design-v0.1.md의 수용 기준 23개이며, 비교 기준 커밋은 b10c7eedddd202f83766aa8f001142cdfdb4097c임. | |
| 4 | 추가: | |
| 5 | 추가: ## 기능 시험 | |
| 6 | 추가: | |
| 7 | 추가: 프로젝트 루트에서 실행함. | |
| 8 | 추가: | |
| 9 | 추가: ```sh | |
| 10 | 추가: python3 tests/ci/run_rust.py local | |
| 11 | 추가: ``` | |
| 12 | 추가: | |
| 13 | 추가: tests/rust-app-ui/presentation.rs에서 결과 안내, 오류 문구, 폴더 생성과 정리, 선택창, 암호 확인, 키보드 입력과 최소 크기를 검증함. tests/rust-app-real-worker/flows.rs와 password_flows.rs는 실제 작업자를 사용해 파일 생성과 재해제, 암호 재입력 및 취소 후 파일 보존을 검증함. | |
| 14 | 추가: | |
| 15 | 추가: ## 전후 화면 재현 | |
| 16 | 추가: | |
| 17 | 추가: Linux의 Xvfb, xdotool, ImageMagick import와 시스템 CJK 글꼴이 필요함. 제품 의존성은 추가하지 않음. 실행 파일 준비는 로컬 Git 객체와 기존 Cargo 오프라인 캐시를 사용함. 기존 산출물은 지우지 않으며 새 output 폴더를 지정함. | |
| 18 | 추가: | |
| 19 | 추가: ```sh | |
| 20 | 추가: python3 tests/ui-redesign/prepare.py --output tests/ui-redesign/runs/reproduce --target-dir tests/ui-redesign/runs/target | |
| 21 | 추가: python3 tests/ui-redesign/capture.py --binary tests/ui-redesign/runs/reproduce/before-capture --variant before | |
| 22 | 추가: python3 tests/ui-redesign/capture.py --binary tests/ui-redesign/runs/reproduce/after-capture --variant after | |
| 23 | 추가: python3 tests/ui-redesign/capture.py --binary tests/ui-redesign/runs/reproduce/after-capture --variant after --width 760 --height 540 --output tests/ui-redesign/screenshots/minimum | |
| 24 | 추가: ``` | |
| 25 | 추가: | |
| 26 | 추가: 촬영기는 전용 Xvfb를 만들고 X11을 지정하며 종료 시 자신이 만든 창과 서버만 종료함. 결과는 screenshots/before, screenshots/after, screenshots/minimum에 저장함. 15개 상태를 각각 촬영하며 capture.json에 크기와 경로를 기록함. | |
| 27 | 추가: | |
| 28 | 추가: 촬영 화면은 tests/rust-app-ui/capture.rs의 합성 입력임. 글꼴과 eframe 렌더러 및 실제 화면 컴포넌트를 사용하고 "화면 시험 모드"를 표시함. 암호 불일치 화면에는 고정된 시험 문자열만 입력함. 합성 작업자는 실제 압축 파일을 읽거나 결과 파일을 저장하지 않으며, 기본 풀 위치 생성은 tests/ui-redesign/runs/fixtures 아래에서 확인함. 실제 파일 작업 검증은 별도의 real_worker 시험 결과와 구분함. | |
| 29 | 추가: | |
| 30 | 추가: 기준 화면 준비 시 같은 촬영 도우미를 기준 커밋 소스에 넣고, 새 화면 전용 메서드 두 곳만 기존 공개 모델 호출로 바꿈. 기준 제품 소스는 바꾸지 않음. --states 옵션으로 일부 상태만 다시 촬영할 수 있으며 다른 상태의 기록은 보존함. | |
| 31 | 추가: | |
| 32 | 추가: 최소 크기에서 ZIP 만들기 본문은 내부 스크롤로 모든 설정에 접근함. 주 버튼과 취소 버튼은 본문 스크롤 밖에 고정함. 폴더 열기는 셸 없이 운영체제 명령에 경로 하나를 인자로 전달하며, 특수 문자가 있는 경로도 시험함. Windows 실제 화면과 운영체제 파일 탐색기 실행 확인은 이 Linux 촬영 기록에 포함하지 않음. | |
| 33 | 추가: | |
| 34 | 추가: 실제 X11 창에서 파일 이름을 눌러 행 선택을 확인하는 별도 검증임. | |
| 35 | 추가: | |
| 36 | 추가: ```sh | |
| 37 | 추가: python3 tests/ui-redesign/check_row_selection.py --binary tests/ui-redesign/runs/reproduce/after-capture | |
| 38 | 추가: ``` | |
| 39 | 추가: | |
| 40 | 추가: validation.json에는 실행한 소스 트리, local 결과와 화면 해시를 기록함. 기록 파일과 이 설명의 추가는 시험 후 문서 변경임. 대용량 작업자 시험은 원본 스냅샷과 임시 공간을 함께 확인하므로 실행 파일 시스템에 최소 12GB 이상의 여유 공간이 필요하며 빌드 캐시 공간은 별도임. | |
| 41 | 추가: | |
| 42 | 추가: PR85 리뷰 회귀는 presentation.rs의 keyboard_file_pickers_enter_child_before_confirming_file, keyboard_folder_pickers_navigate_before_explicit_folder_confirmation, changed_zip_sources_retry_creation_with_or_without_open_archive에서 확인함. 폴더 행의 Tab 및 Enter 탐색은 6개 선택 모드에서, ZIP 원본 변경 뒤 생성 재시도는 기존 압축파일 유무 두 경우에서 검증함. | |
| 43 | 추가: | |
| 44 | 추가: ZIP 만들기의 취소 우선 처리는 keyboard_cancel_and_escape_never_start_zip_creation과 zip_creation_enter_only_activates_focused_make_button에서 검증함. Tab으로 취소와 만들기 버튼에 초점을 옮긴 뒤 Enter를 누르며, Esc와 이름 입력칸의 Enter가 생성 요청을 보내지 않는지도 확인함. | |
| 45 | 추가: | |
| 46 | 추가: Enter는 egui 버튼의 초점 활성화만 사용하며 암호 입력란의 제출만 예외임. secondary_button_enter_matrix_never_starts_creation_or_extraction은 기본 화면, 생성 창, 결과, 진행, 종료 확인과 선택창의 탐색 버튼을 한 번에 검증함. password_secondary_enter_does_not_submit_valid_input은 유효한 암호가 있어도 보기, 숨기기와 취소 버튼이 제출하지 않음을 검증함. | |
| 47 | 추가: | |
| 48 | 추가: 폴더 생성 보고는 추출 시작 시 기록한 파일 대상과 예상 폴더 및 상위 폴더로 구분함. 빈 폴더만 있는 ZIP은 실제 작업자로 만들고 새 폴더 추출과 기존 폴더 재사용 모두 성공 표시를 확인함. 파일 저장 누락, 알 수 없는 생성 보고와 저장 불확실 결과의 경고는 유지함. | |
| 49 | 추가: | |
| 50 | 추가: 선택 추출의 완료 대상은 실제 요청에 보낸 Selection에서 계산함. 폴더 선택이 하위 파일을 자동 포함하지 않으며, 선택한 항목의 상위 폴더 생성은 허용함. selection_flows.rs의 extraction_completion_matches_actual_worker_selection_matrix는 전체, 파일만, 폴더만, 혼합, 빈 폴더와 중첩 폴더 선택 6가지를 실제 작업자로 검증함. 요청 ID, 생성 보고와 개수, 실제 경로와 파일 내용, 정상 완료 표시가 모두 일치하는지 확인함. | |
| 51 | 추가: | |
| 52 | 추가: 자동 풀 위치는 Unix DirBuilder mode 0700으로 생성함. auto_destination_is_private_under_desktop_umask는 별도 자식 프로세스의 umask 0002에서 실제 작업자 추출, 폴더 권한과 파일 내용을 확인함. 시험 프로세스 전체의 umask는 변경하지 않음. completed_results_keep_folder_action_and_distinguish_durability는 추출과 ZIP 생성의 정상 완료에서 Synced, Unconfirmed와 Failed 내구성 조합을 확인함. 완료 제목과 폴더 열기를 유지하며 완료 + Unconfirmed의 저장 확인 경고만 자세히 보기 안에서 표시함. Failed 내구성 경고는 완료 결과에서도 본문에 바로 표시함. 두 시험 모두 수정 전 실패와 수정 후 통과를 확인함. Windows 실제 실행을 대신하는 시험은 아님. | |
| 53 | 추가: | |
| 54 | 추가: 실패와 부분 추출에서는 저장 확인 경고를 본문에 바로 표시함. durability_warning_visibility_matches_completed_failed_and_partial_results는 Completed + Unconfirmed, Failed + Unconfirmed, 일부 파일만 저장된 Failed + Unconfirmed 세 조합을 검증함. 자세히 보기를 열어도 경고를 중복 표시하지 않으며, 닫은 뒤에도 실패 경고는 유지함. 수정 전 실패와 수정 후 통과를 확인함. | |
| 55 | 추가: | |
| 56 | 추가: 내구성 표시는 문구 비교 없이 Durability 값으로 판단하며, 파일 게시 결과와 내구성 안내를 분리함. Failed와 Unconfirmed는 서로 다른 문구로 안내함. 위 표시 위치 시험은 완료, 실패와 부분 추출에 Synced, Unconfirmed와 Failed를 조합한 9가지로 확장함. 완료 + Failed 경고는 자세히 보기를 열지 않아도 알림 상자에 표시함. 확장한 두 UI 시험의 수정 전 실패와 수정 후 통과를 확인함. |
| @@ -0,0 +1,130 @@ | ||
| 1 | 추가: """격리한 Xvfb에서 상태별 실제 창을 촬영함.""" | |
| 2 | 추가: | |
| 3 | 추가: import argparse | |
| 4 | 추가: import json | |
| 5 | 추가: import os | |
| 6 | 추가: from pathlib import Path | |
| 7 | 추가: import subprocess | |
| 8 | 추가: import time | |
| 9 | 추가: | |
| 10 | 추가: ROOT = Path(__file__).resolve().parents[2] | |
| 11 | 추가: | |
| 12 | 추가: | |
| 13 | 추가: def command(args, environment, **kwargs): | |
| 14 | 추가: return subprocess.run(args, env=environment, check=True, **kwargs) | |
| 15 | 추가: | |
| 16 | 추가: | |
| 17 | 추가: def stop(process): | |
| 18 | 추가: process.terminate() | |
| 19 | 추가: try: | |
| 20 | 추가: process.wait(timeout=3) | |
| 21 | 추가: except subprocess.TimeoutExpired: | |
| 22 | 추가: process.kill() | |
| 23 | 추가: process.wait() | |
| 24 | 추가: | |
| 25 | 추가: | |
| 26 | 추가: def capture(binary, variant, state, output, environment, width, height): | |
| 27 | 추가: automatic = ROOT / "tests/ui-redesign/runs/fixtures/여행" | |
| 28 | 추가: try: | |
| 29 | 추가: automatic.rmdir() | |
| 30 | 추가: except OSError: | |
| 31 | 추가: pass | |
| 32 | 추가: mode = "opened" if state in {"picker", "selected-empty"} else state | |
| 33 | 추가: log = ROOT / "tests/ui-redesign/runs" / f"{variant}-{state}.log" | |
| 34 | 추가: with log.open("w") as stream: | |
| 35 | 추가: app = subprocess.Popen([str(binary), mode], cwd=ROOT, env=environment, stdout=stream, stderr=stream) | |
| 36 | 추가: try: | |
| 37 | 추가: deadline = time.monotonic() + 15 | |
| 38 | 추가: window = None | |
| 39 | 추가: while time.monotonic() < deadline and app.poll() is None: | |
| 40 | 추가: found = subprocess.run( | |
| 41 | 추가: ["xdotool", "search", "--onlyvisible", "--name", "^Zipelo UI capture"], | |
| 42 | 추가: env=environment, capture_output=True, text=True, | |
| 43 | 추가: ) | |
| 44 | 추가: if found.returncode == 0: | |
| 45 | 추가: window = found.stdout.splitlines()[0] | |
| 46 | 추가: break | |
| 47 | 추가: time.sleep(0.1) | |
| 48 | 추가: if window is None: | |
| 49 | 추가: raise RuntimeError(f"창 열기 실패: {log}") | |
| 50 | 추가: command(["xdotool", "windowsize", window, str(width), str(height)], environment) | |
| 51 | 추가: command(["xdotool", "windowfocus", "--sync", window], environment) | |
| 52 | 추가: time.sleep(0.7) | |
| 53 | 추가: | |
| 54 | 추가: def click(x, y): | |
| 55 | 추가: command(["xdotool", "mousemove", "--window", window, str(x), str(y), "click", "1"], environment) | |
| 56 | 추가: time.sleep(0.4) | |
| 57 | 추가: | |
| 58 | 추가: if state == "create" or (state == "create-filled" and variant == "before"): | |
| 59 | 추가: click(180 if variant == "before" else width - 90, 18 if variant == "before" else 40) | |
| 60 | 추가: if state == "create-filled" and variant == "before": | |
| 61 | 추가: base = ROOT / "tests/ui-redesign/runs/fixtures" | |
| 62 | 추가: click(100, 105) | |
| 63 | 추가: command(["xdotool", "type", "--clearmodifiers", "--delay", "0", | |
| 64 | 추가: str(ROOT / "tests/ui-redesign/README.md")], environment) | |
| 65 | 추가: command(["xdotool", "key", "Return"], environment) | |
| 66 | 추가: command(["xdotool", "type", "--clearmodifiers", "--delay", "0", str(base)], environment) | |
| 67 | 추가: click(100, 200) | |
| 68 | 추가: command(["xdotool", "type", "--clearmodifiers", "--delay", "0", str(base / "archive.zip")], environment) | |
| 69 | 추가: elif state == "picker": | |
| 70 | 추가: click(97 if variant == "before" else width - 90, 18 if variant == "before" else height - 80) | |
| 71 | 추가: elif state == "selected-empty": | |
| 72 | 추가: click(16 if variant == "before" else 24, 126 if variant == "before" else height - 36) | |
| 73 | 추가: elif state == "cancelling": | |
| 74 | 추가: click(260 if variant == "before" else width - 60, 18 if variant == "before" else height - 36) | |
| 75 | 추가: if state == "password-create" and variant == "after": | |
| 76 | 추가: click(width // 2 - 56, height // 2 - 12) | |
| 77 | 추가: command(["xdotool", "type", "--clearmodifiers", "--delay", "0", "fixture-password"], environment) | |
| 78 | 추가: command(["xdotool", "key", "Tab", "Tab"], environment) | |
| 79 | 추가: command(["xdotool", "type", "--clearmodifiers", "--delay", "0", "different"], environment) | |
| 80 | 추가: command(["xdotool", "mousemove", "--window", window, "2", "2"], environment) | |
| 81 | 추가: time.sleep(0.3) | |
| 82 | 추가: destination = output / f"{state}.png" | |
| 83 | 추가: command(["import", "-window", window, str(destination)], environment) | |
| 84 | 추가: return {"state": state, "path": str(destination.relative_to(ROOT)), "width": width, "height": height} | |
| 85 | 추가: finally: | |
| 86 | 추가: stop(app) | |
| 87 | 추가: | |
| 88 | 추가: | |
| 89 | 추가: def main(): | |
| 90 | 추가: parser = argparse.ArgumentParser(description=__doc__) | |
| 91 | 추가: parser.add_argument("--binary", type=Path, required=True) | |
| 92 | 추가: parser.add_argument("--variant", choices=["before", "after"], required=True) | |
| 93 | 추가: parser.add_argument("--states", nargs="+", default=["empty", "hover", "opened", "selected-empty", "picker", "create", "create-filled", "password", "password-retry", "password-create", "progress", "progress-unknown", "cancelling", "success", "error"]) | |
| 94 | 추가: parser.add_argument("--width", type=int, default=1060) | |
| 95 | 추가: parser.add_argument("--height", type=int, default=720) | |
| 96 | 추가: parser.add_argument("--output", type=Path) | |
| 97 | 추가: args = parser.parse_args() | |
| 98 | 추가: output = (args.output or ROOT / "tests/ui-redesign/screenshots" / args.variant).resolve() | |
| 99 | 추가: if not output.is_relative_to(ROOT / "tests"): | |
| 100 | 추가: raise ValueError("촬영 결과는 tests/ 안에만 저장함") | |
| 101 | 추가: output.mkdir(parents=True, exist_ok=True) | |
| 102 | 추가: read_fd, write_fd = os.pipe() | |
| 103 | 추가: server = subprocess.Popen( | |
| 104 | 추가: ["Xvfb", "-displayfd", str(write_fd), "-screen", "0", "1280x900x24", "-nolisten", "tcp"], | |
| 105 | 추가: pass_fds=(write_fd,), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, | |
| 106 | 추가: ) | |
| 107 | 추가: os.close(write_fd) | |
| 108 | 추가: try: | |
| 109 | 추가: with os.fdopen(read_fd) as stream: | |
| 110 | 추가: display = stream.readline().strip() | |
| 111 | 추가: if not display: | |
| 112 | 추가: raise RuntimeError("Xvfb를 시작하지 못함") | |
| 113 | 추가: environment = dict(os.environ, DISPLAY=f":{display}", LIBGL_ALWAYS_SOFTWARE="1", WINIT_UNIX_BACKEND="x11", XDG_SESSION_TYPE="x11") | |
| 114 | 추가: environment.pop("WAYLAND_DISPLAY", None) | |
| 115 | 추가: results = [ | |
| 116 | 추가: capture(args.binary.resolve(), args.variant, state, output, environment, args.width, args.height) | |
| 117 | 추가: for state in args.states | |
| 118 | 추가: ] | |
| 119 | 추가: metadata = output / "capture.json" | |
| 120 | 추가: existing = json.loads(metadata.read_text()) if metadata.exists() else [] | |
| 121 | 추가: merged = {row["state"]: row for row in existing} | |
| 122 | 추가: merged.update({row["state"]: row for row in results}) | |
| 123 | 추가: metadata.write_text(json.dumps(list(merged.values()), ensure_ascii=False, indent=4) + "\n") | |
| 124 | 추가: print(json.dumps(results, ensure_ascii=False)) | |
| 125 | 추가: finally: | |
| 126 | 추가: stop(server) | |
| 127 | 추가: | |
| 128 | 추가: | |
| 129 | 추가: if __name__ == "__main__": | |
| 130 | 추가: main() |
| @@ -0,0 +1,51 @@ | ||
| 1 | 추가: """실제 X11 창에서 파일 행을 눌렀을 때 선택 배경이 바뀌는지 확인함.""" | |
| 2 | 추가: | |
| 3 | 추가: import argparse | |
| 4 | 추가: from pathlib import Path | |
| 5 | 추가: import subprocess | |
| 6 | 추가: import sys | |
| 7 | 추가: import time | |
| 8 | 추가: | |
| 9 | 추가: import capture | |
| 10 | 추가: | |
| 11 | 추가: | |
| 12 | 추가: def main(): | |
| 13 | 추가: parser = argparse.ArgumentParser(description=__doc__) | |
| 14 | 추가: parser.add_argument("--binary", type=Path, required=True) | |
| 15 | 추가: args = parser.parse_args() | |
| 16 | 추가: original = capture.command | |
| 17 | 추가: clicked = False | |
| 18 | 추가: | |
| 19 | 추가: def command(arguments, environment, **kwargs): | |
| 20 | 추가: nonlocal clicked | |
| 21 | 추가: if arguments[:3] == ["xdotool", "mousemove", "--window"] and arguments[-2:] == ["2", "2"]: | |
| 22 | 추가: original( | |
| 23 | 추가: ["xdotool", "mousemove", "--window", arguments[3], "120", "271"], | |
| 24 | 추가: environment, | |
| 25 | 추가: ) | |
| 26 | 추가: time.sleep(0.2) | |
| 27 | 추가: original(["xdotool", "click", "1"], environment) | |
| 28 | 추가: clicked = True | |
| 29 | 추가: time.sleep(0.2) | |
| 30 | 추가: return original(arguments, environment, **kwargs) | |
| 31 | 추가: | |
| 32 | 추가: capture.command = command | |
| 33 | 추가: output = capture.ROOT / "tests/ui-redesign/runs/row-selection" | |
| 34 | 추가: sys.argv = [ | |
| 35 | 추가: sys.argv[0], "--binary", str(args.binary), "--variant", "after", | |
| 36 | 추가: "--states", "opened", "--output", str(output), | |
| 37 | 추가: ] | |
| 38 | 추가: capture.main() | |
| 39 | 추가: if not clicked: | |
| 40 | 추가: raise AssertionError("행 클릭을 실행하지 못함") | |
| 41 | 추가: pixel = subprocess.check_output( | |
| 42 | 추가: ["convert", str(output / "opened.png"), "-format", "%[pixel:p{500,271}]", "info:"], | |
| 43 | 추가: text=True, | |
| 44 | 추가: ).strip() | |
| 45 | 추가: if pixel != "srgb(232,240,254)": | |
| 46 | 추가: raise AssertionError(f"행 선택 배경 불일치: {pixel}") | |
| 47 | 추가: print("실제 파일 이름 클릭 후 선택 표시 확인") | |
| 48 | 추가: | |
| 49 | 추가: | |
| 50 | 추가: if __name__ == "__main__": | |
| 51 | 추가: main() |
| @@ -0,0 +1,65 @@ | ||
| 1 | 추가: """현재 화면과 로컬 Git 기준 화면의 촬영 실행 파일을 준비함.""" | |
| 2 | 추가: | |
| 3 | 추가: import argparse | |
| 4 | 추가: import os | |
| 5 | 추가: from pathlib import Path | |
| 6 | 추가: import subprocess | |
| 7 | 추가: import tarfile | |
| 8 | 추가: | |
| 9 | 추가: ROOT = Path(__file__).resolve().parents[2] | |
| 10 | 추가: MANIFEST = Path("experiments/rust-ui-memory-app/Cargo.toml") | |
| 11 | 추가: HELPER = Path("tests/rust-app-ui/capture.rs") | |
| 12 | 추가: BIN = '\n[[bin]]\nname = "zipelo-ui-capture"\npath = "../../tests/rust-app-ui/capture.rs"\nrequired-features = ["ui-fixture"]\n' | |
| 13 | 추가: | |
| 14 | 추가: | |
| 15 | 추가: def main(): | |
| 16 | 추가: parser = argparse.ArgumentParser(description=__doc__) | |
| 17 | 추가: parser.add_argument("--before-ref", default="b10c7eedddd202f83766aa8f001142cdfdb4097c") | |
| 18 | 추가: parser.add_argument("--output", type=Path, default=ROOT / "tests/ui-redesign/runs") | |
| 19 | 추가: parser.add_argument("--target-dir", type=Path, required=True) | |
| 20 | 추가: args = parser.parse_args() | |
| 21 | 추가: output = args.output.resolve() | |
| 22 | 추가: if not output.is_relative_to(ROOT / "tests"): | |
| 23 | 추가: raise ValueError("기준 소스와 실행 파일은 tests/ 안에만 저장함") | |
| 24 | 추가: before = output / "before-src" | |
| 25 | 추가: if before.exists(): | |
| 26 | 추가: raise ValueError("기존 기준 소스는 보존함. 새 --output 폴더를 지정하세요") | |
| 27 | 추가: before.mkdir(parents=True) | |
| 28 | 추가: revision = subprocess.check_output( | |
| 29 | 추가: ["git", "rev-parse", "--verify", "--end-of-options", args.before_ref + "^{commit}"], | |
| 30 | 추가: cwd=ROOT, text=True, | |
| 31 | 추가: ).strip() | |
| 32 | 추가: with subprocess.Popen(["git", "archive", revision], cwd=ROOT, stdout=subprocess.PIPE) as archive: | |
| 33 | 추가: with tarfile.open(fileobj=archive.stdout, mode="r|") as source: | |
| 34 | 추가: source.extractall(before, filter="data") | |
| 35 | 추가: if archive.wait() != 0: | |
| 36 | 추가: raise RuntimeError("로컬 기준 소스를 읽지 못함") | |
| 37 | 추가: helper = (ROOT / HELPER).read_text() | |
| 38 | 추가: helper = helper.replace( | |
| 39 | 추가: "self.app.begin_extract();", | |
| 40 | 추가: "self.app.model.begin(start, &mut self.factory);", | |
| 41 | 추가: ) | |
| 42 | 추가: helper = helper.replace( | |
| 43 | 추가: 'app.add_sources(vec![base.join("읽어주세요.txt"), base.join("사진")]);', | |
| 44 | 추가: "let _ = &mut app;", | |
| 45 | 추가: ) | |
| 46 | 추가: (before / HELPER).write_text(helper) | |
| 47 | 추가: original = before / MANIFEST | |
| 48 | 추가: original.write_text(original.read_text() + BIN) | |
| 49 | 추가: environment = dict(os.environ, CARGO_TARGET_DIR=str(args.target_dir.resolve())) | |
| 50 | 추가: for variant, root in [("before", before), ("after", ROOT)]: | |
| 51 | 추가: with (output / f"{variant}-build.log").open("w") as log: | |
| 52 | 추가: subprocess.run( | |
| 53 | 추가: ["cargo", "+1.99.1", "build", "--locked", "--offline", "--manifest-path", | |
| 54 | 추가: str(root / MANIFEST), "--features", "ui-fixture", "--bin", "zipelo-ui-capture"], | |
| 55 | 추가: cwd=ROOT, env=environment, stdout=log, stderr=log, check=True, | |
| 56 | 추가: ) | |
| 57 | 추가: executable = args.target_dir.resolve() / "debug/zipelo-ui-capture" | |
| 58 | 추가: destination = output / f"{variant}-capture" | |
| 59 | 추가: destination.write_bytes(executable.read_bytes()) | |
| 60 | 추가: destination.chmod(executable.stat().st_mode) | |
| 61 | 추가: print(f"기준 커밋 {revision}, 촬영 실행 파일 {output}") | |
| 62 | 추가: | |
| 63 | 추가: | |
| 64 | 추가: if __name__ == "__main__": | |
| 65 | 추가: main() |
바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기| @@ -0,0 +1,92 @@ | ||
| 1 | 추가: [ | |
| 2 | 추가: { | |
| 3 | 추가: "state": "empty", | |
| 4 | 추가: "path": "tests/ui-redesign/screenshots/after/empty.png", | |
| 5 | 추가: "width": 1060, | |
| 6 | 추가: "height": 720 | |
| 7 | 추가: }, | |
| 8 | 추가: { | |
| 9 | 추가: "state": "hover", | |
| 10 | 추가: "path": "tests/ui-redesign/screenshots/after/hover.png", | |
| 11 | 추가: "width": 1060, | |
| 12 | 추가: "height": 720 | |
| 13 | 추가: }, | |
| 14 | 추가: { | |
| 15 | 추가: "state": "opened", | |
| 16 | 추가: "path": "tests/ui-redesign/screenshots/after/opened.png", | |
| 17 | 추가: "width": 1060, | |
| 18 | 추가: "height": 720 | |
| 19 | 추가: }, | |
| 20 | 추가: { | |
| 21 | 추가: "state": "selected-empty", | |
| 22 | 추가: "path": "tests/ui-redesign/screenshots/after/selected-empty.png", | |
| 23 | 추가: "width": 1060, | |
| 24 | 추가: "height": 720 | |
| 25 | 추가: }, | |
| 26 | 추가: { | |
| 27 | 추가: "state": "picker", | |
| 28 | 추가: "path": "tests/ui-redesign/screenshots/after/picker.png", | |
| 29 | 추가: "width": 1060, | |
| 30 | 추가: "height": 720 | |
| 31 | 추가: }, | |
| 32 | 추가: { | |
| 33 | 추가: "state": "create", | |
| 34 | 추가: "path": "tests/ui-redesign/screenshots/after/create.png", | |
| 35 | 추가: "width": 1060, | |
| 36 | 추가: "height": 720 | |
| 37 | 추가: }, | |
| 38 | 추가: { | |
| 39 | 추가: "state": "create-filled", | |
| 40 | 추가: "path": "tests/ui-redesign/screenshots/after/create-filled.png", | |
| 41 | 추가: "width": 1060, | |
| 42 | 추가: "height": 720 | |
| 43 | 추가: }, | |
| 44 | 추가: { | |
| 45 | 추가: "state": "password", | |
| 46 | 추가: "path": "tests/ui-redesign/screenshots/after/password.png", | |
| 47 | 추가: "width": 1060, | |
| 48 | 추가: "height": 720 | |
| 49 | 추가: }, | |
| 50 | 추가: { | |
| 51 | 추가: "state": "password-retry", | |
| 52 | 추가: "path": "tests/ui-redesign/screenshots/after/password-retry.png", | |
| 53 | 추가: "width": 1060, | |
| 54 | 추가: "height": 720 | |
| 55 | 추가: }, | |
| 56 | 추가: { | |
| 57 | 추가: "state": "password-create", | |
| 58 | 추가: "path": "tests/ui-redesign/screenshots/after/password-create.png", | |
| 59 | 추가: "width": 1060, | |
| 60 | 추가: "height": 720 | |
| 61 | 추가: }, | |
| 62 | 추가: { | |
| 63 | 추가: "state": "progress", | |
| 64 | 추가: "path": "tests/ui-redesign/screenshots/after/progress.png", | |
| 65 | 추가: "width": 1060, | |
| 66 | 추가: "height": 720 | |
| 67 | 추가: }, | |
| 68 | 추가: { | |
| 69 | 추가: "state": "progress-unknown", | |
| 70 | 추가: "path": "tests/ui-redesign/screenshots/after/progress-unknown.png", | |
| 71 | 추가: "width": 1060, | |
| 72 | 추가: "height": 720 | |
| 73 | 추가: }, | |
| 74 | 추가: { | |
| 75 | 추가: "state": "cancelling", | |
| 76 | 추가: "path": "tests/ui-redesign/screenshots/after/cancelling.png", | |
| 77 | 추가: "width": 1060, | |
| 78 | 추가: "height": 720 | |
| 79 | 추가: }, | |
| 80 | 추가: { | |
| 81 | 추가: "state": "success", | |
| 82 | 추가: "path": "tests/ui-redesign/screenshots/after/success.png", | |
| 83 | 추가: "width": 1060, | |
| 84 | 추가: "height": 720 | |
| 85 | 추가: }, | |
| 86 | 추가: { | |
| 87 | 추가: "state": "error", | |
| 88 | 추가: "path": "tests/ui-redesign/screenshots/after/error.png", | |
| 89 | 추가: "width": 1060, | |
| 90 | 추가: "height": 720 | |
| 91 | 추가: } | |
| 92 | 추가: ] |
바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기| @@ -0,0 +1,92 @@ | ||
| 1 | 추가: [ | |
| 2 | 추가: { | |
| 3 | 추가: "state": "empty", | |
| 4 | 추가: "path": "tests/ui-redesign/screenshots/before/empty.png", | |
| 5 | 추가: "width": 1060, | |
| 6 | 추가: "height": 720 | |
| 7 | 추가: }, | |
| 8 | 추가: { | |
| 9 | 추가: "state": "hover", | |
| 10 | 추가: "path": "tests/ui-redesign/screenshots/before/hover.png", | |
| 11 | 추가: "width": 1060, | |
| 12 | 추가: "height": 720 | |
| 13 | 추가: }, | |
| 14 | 추가: { | |
| 15 | 추가: "state": "opened", | |
| 16 | 추가: "path": "tests/ui-redesign/screenshots/before/opened.png", | |
| 17 | 추가: "width": 1060, | |
| 18 | 추가: "height": 720 | |
| 19 | 추가: }, | |
| 20 | 추가: { | |
| 21 | 추가: "state": "selected-empty", | |
| 22 | 추가: "path": "tests/ui-redesign/screenshots/before/selected-empty.png", | |
| 23 | 추가: "width": 1060, | |
| 24 | 추가: "height": 720 | |
| 25 | 추가: }, | |
| 26 | 추가: { | |
| 27 | 추가: "state": "picker", | |
| 28 | 추가: "path": "tests/ui-redesign/screenshots/before/picker.png", | |
| 29 | 추가: "width": 1060, | |
| 30 | 추가: "height": 720 | |
| 31 | 추가: }, | |
| 32 | 추가: { | |
| 33 | 추가: "state": "create", | |
| 34 | 추가: "path": "tests/ui-redesign/screenshots/before/create.png", | |
| 35 | 추가: "width": 1060, | |
| 36 | 추가: "height": 720 | |
| 37 | 추가: }, | |
| 38 | 추가: { | |
| 39 | 추가: "state": "create-filled", | |
| 40 | 추가: "path": "tests/ui-redesign/screenshots/before/create-filled.png", | |
| 41 | 추가: "width": 1060, | |
| 42 | 추가: "height": 720 | |
| 43 | 추가: }, | |
| 44 | 추가: { | |
| 45 | 추가: "state": "password", | |
| 46 | 추가: "path": "tests/ui-redesign/screenshots/before/password.png", | |
| 47 | 추가: "width": 1060, | |
| 48 | 추가: "height": 720 | |
| 49 | 추가: }, | |
| 50 | 추가: { | |
| 51 | 추가: "state": "password-retry", | |
| 52 | 추가: "path": "tests/ui-redesign/screenshots/before/password-retry.png", | |
| 53 | 추가: "width": 1060, | |
| 54 | 추가: "height": 720 | |
| 55 | 추가: }, | |
| 56 | 추가: { | |
| 57 | 추가: "state": "password-create", | |
| 58 | 추가: "path": "tests/ui-redesign/screenshots/before/password-create.png", | |
| 59 | 추가: "width": 1060, | |
| 60 | 추가: "height": 720 | |
| 61 | 추가: }, | |
| 62 | 추가: { | |
| 63 | 추가: "state": "progress", | |
| 64 | 추가: "path": "tests/ui-redesign/screenshots/before/progress.png", | |
| 65 | 추가: "width": 1060, | |
| 66 | 추가: "height": 720 | |
| 67 | 추가: }, | |
| 68 | 추가: { | |
| 69 | 추가: "state": "progress-unknown", | |
| 70 | 추가: "path": "tests/ui-redesign/screenshots/before/progress-unknown.png", | |
| 71 | 추가: "width": 1060, | |
| 72 | 추가: "height": 720 | |
| 73 | 추가: }, | |
| 74 | 추가: { | |
| 75 | 추가: "state": "cancelling", | |
| 76 | 추가: "path": "tests/ui-redesign/screenshots/before/cancelling.png", | |
| 77 | 추가: "width": 1060, | |
| 78 | 추가: "height": 720 | |
| 79 | 추가: }, | |
| 80 | 추가: { | |
| 81 | 추가: "state": "success", | |
| 82 | 추가: "path": "tests/ui-redesign/screenshots/before/success.png", | |
| 83 | 추가: "width": 1060, | |
| 84 | 추가: "height": 720 | |
| 85 | 추가: }, | |
| 86 | 추가: { | |
| 87 | 추가: "state": "error", | |
| 88 | 추가: "path": "tests/ui-redesign/screenshots/before/error.png", | |
| 89 | 추가: "width": 1060, | |
| 90 | 추가: "height": 720 | |
| 91 | 추가: } | |
| 92 | 추가: ] |
바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기| @@ -0,0 +1,92 @@ | ||
| 1 | 추가: [ | |
| 2 | 추가: { | |
| 3 | 추가: "state": "empty", | |
| 4 | 추가: "path": "tests/ui-redesign/screenshots/minimum/empty.png", | |
| 5 | 추가: "width": 760, | |
| 6 | 추가: "height": 540 | |
| 7 | 추가: }, | |
| 8 | 추가: { | |
| 9 | 추가: "state": "hover", | |
| 10 | 추가: "path": "tests/ui-redesign/screenshots/minimum/hover.png", | |
| 11 | 추가: "width": 760, | |
| 12 | 추가: "height": 540 | |
| 13 | 추가: }, | |
| 14 | 추가: { | |
| 15 | 추가: "state": "opened", | |
| 16 | 추가: "path": "tests/ui-redesign/screenshots/minimum/opened.png", | |
| 17 | 추가: "width": 760, | |
| 18 | 추가: "height": 540 | |
| 19 | 추가: }, | |
| 20 | 추가: { | |
| 21 | 추가: "state": "selected-empty", | |
| 22 | 추가: "path": "tests/ui-redesign/screenshots/minimum/selected-empty.png", | |
| 23 | 추가: "width": 760, | |
| 24 | 추가: "height": 540 | |
| 25 | 추가: }, | |
| 26 | 추가: { | |
| 27 | 추가: "state": "picker", | |
| 28 | 추가: "path": "tests/ui-redesign/screenshots/minimum/picker.png", | |
| 29 | 추가: "width": 760, | |
| 30 | 추가: "height": 540 | |
| 31 | 추가: }, | |
| 32 | 추가: { | |
| 33 | 추가: "state": "create", | |
| 34 | 추가: "path": "tests/ui-redesign/screenshots/minimum/create.png", | |
| 35 | 추가: "width": 760, | |
| 36 | 추가: "height": 540 | |
| 37 | 추가: }, | |
| 38 | 추가: { | |
| 39 | 추가: "state": "create-filled", | |
| 40 | 추가: "path": "tests/ui-redesign/screenshots/minimum/create-filled.png", | |
| 41 | 추가: "width": 760, | |
| 42 | 추가: "height": 540 | |
| 43 | 추가: }, | |
| 44 | 추가: { | |
| 45 | 추가: "state": "password", | |
| 46 | 추가: "path": "tests/ui-redesign/screenshots/minimum/password.png", | |
| 47 | 추가: "width": 760, | |
| 48 | 추가: "height": 540 | |
| 49 | 추가: }, | |
| 50 | 추가: { | |
| 51 | 추가: "state": "password-retry", | |
| 52 | 추가: "path": "tests/ui-redesign/screenshots/minimum/password-retry.png", | |
| 53 | 추가: "width": 760, | |
| 54 | 추가: "height": 540 | |
| 55 | 추가: }, | |
| 56 | 추가: { | |
| 57 | 추가: "state": "password-create", | |
| 58 | 추가: "path": "tests/ui-redesign/screenshots/minimum/password-create.png", | |
| 59 | 추가: "width": 760, | |
| 60 | 추가: "height": 540 | |
| 61 | 추가: }, | |
| 62 | 추가: { | |
| 63 | 추가: "state": "progress", | |
| 64 | 추가: "path": "tests/ui-redesign/screenshots/minimum/progress.png", | |
| 65 | 추가: "width": 760, | |
| 66 | 추가: "height": 540 | |
| 67 | 추가: }, | |
| 68 | 추가: { | |
| 69 | 추가: "state": "progress-unknown", | |
| 70 | 추가: "path": "tests/ui-redesign/screenshots/minimum/progress-unknown.png", | |
| 71 | 추가: "width": 760, | |
| 72 | 추가: "height": 540 | |
| 73 | 추가: }, | |
| 74 | 추가: { | |
| 75 | 추가: "state": "cancelling", | |
| 76 | 추가: "path": "tests/ui-redesign/screenshots/minimum/cancelling.png", | |
| 77 | 추가: "width": 760, | |
| 78 | 추가: "height": 540 | |
| 79 | 추가: }, | |
| 80 | 추가: { | |
| 81 | 추가: "state": "success", | |
| 82 | 추가: "path": "tests/ui-redesign/screenshots/minimum/success.png", | |
| 83 | 추가: "width": 760, | |
| 84 | 추가: "height": 540 | |
| 85 | 추가: }, | |
| 86 | 추가: { | |
| 87 | 추가: "state": "error", | |
| 88 | 추가: "path": "tests/ui-redesign/screenshots/minimum/error.png", | |
| 89 | 추가: "width": 760, | |
| 90 | 추가: "height": 540 | |
| 91 | 추가: } | |
| 92 | 추가: ] |
바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기