team-ljyzipelo

공개

제거 안내의 화면 미리보기와 시험을 추가함

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

변경된 파일 4개

+143-7
수정docs/ui-scenario-guide.md+5-1
@@ -72,6 +72,10 @@ cargo +1.99.1 build --locked --manifest-path experiments/rust-ui-memory-app/Carg
7272- create-error: ZIP 만들기 실패. 디스크 여유 공간 안내를 확인한다.
7373- password-create: 암호 ZIP 생성 중 작업자 암호 요청. 암호와 암호 확인 입력 배치를 확인한다.
7474- close-confirm: 진행 중 창 닫기 확인. 작업 취소와 유지 선택지를 확인한다.
75추가: - uninstall-windows: Windows 제거 전 다른 기본 앱 선택 안내와 설정 열기 버튼 문구를 확인한다.
76추가: - uninstall-settings-error: Windows 설정 실행 실패 시 수동 설정 경로를 확인한다.
77추가: - uninstall-ubuntu-missing: 이전 앱이 없어 복원하지 못한 경우의 터미널 안내 문구를 확인한다.
78추가: - uninstall-ubuntu-unknown-user: 제거 사용자를 확인하지 못해 설정을 유지하는 안내 문구를 확인한다.
7579
7680--ui-scenario에는 이름 하나만 지정한다. 없는 이름, 누락된 이름, 다른 옵션이나 경로와의 혼합은 사용 가능한 목록을 출력하고 실패로 끝난다. --list-ui-scenarios도 단독으로 사용한다. 기존 파일 연결 실행과 --ui-fixture의 인자 해석은 유지한다.
7781
@@ -96,7 +100,7 @@ python3 tests/ci/run_rust.py local
96100
97101## 설치 프로그램의 제거 안내
98102
99삭제: Windows NSIS 제거 프로그램은 앱과 별도의 실행 파일입니다. 이번 제거 안내는 Uninstall.exe 실행 후 확인 화면 앞에 표시되며 [기본 앱 설정 열기]로 Windows 설정을 엽니다. 아직 앱의 --ui-scenario 목록에 이 안내의 미리보기는 추가하지 않았습니다. frontend 담당의 상황 목록과 시험 보완 전까지 해당 변경은 초안으로 유지합니다.
103추가: Windows NSIS 제거 프로그램은 앱과 별도의 실행 파일입니다. 이번 제거 안내는 Uninstall.exe 실행 후 확인 화면 앞에 표시되며 [기본 앱 설정 열기]로 Windows 설정을 엽니다. --ui-scenario uninstall-windows와 uninstall-settings-error로 안내 문구를 확인합니다. Ubuntu 터미널 안내는 uninstall-ubuntu-missing과 uninstall-ubuntu-unknown-user로 확인합니다. 이 네 상황은 외부 설치 프로그램과 터미널의 문구를 egui에 재현한 읽기 전용 미리보기이며, NSIS의 실제 배치나 운영체제 창 모양을 재현하지 않습니다. 버튼은 설정을 열거나 제거를 실행하지 않습니다. 다른 운영체제에서도 같은 안내를 확인할 수 있습니다.
100104
101105실제 검증은 전용 Windows VM에서 설치와 기본 앱 지정 후 Uninstall.exe를 실행합니다. 설정에서 ZIP의 다른 기본 앱을 선택하고 제거한 뒤 ZIP을 열어야 합니다. 설정을 열지 않고 제거한 경우의 [연결 프로그램] 경로, 취소 시 앱 유지, /S 무인 제거의 창 생략, 사용자가 바꾼 등록 값 보존도 확인합니다. NSIS 컴파일 시험은 이 운영체제 화면 검증을 대신하지 않습니다.
102106
수정experiments/rust-ui-memory-app/src/desktop.rs+2-1
@@ -112,7 +112,8 @@ fn run() -> eframe::Result {
112112 zipelo_ui_memory_app::archive_screen::scenarios::Preview::new(
113113 app,
114114 &cc.egui_ctx,
115삭제: ),
115추가: )
116추가: .with_scenario(scenario),
116117 ) as Box<dyn eframe::App>);
117118 }
118119 let factory: Box<dyn zipelo_ui_memory_app::archive_ui::Factory> = if fixture {
수정tests/rust-app-ui/scenario_tests.rs+61-1
@@ -82,7 +82,7 @@ fn every_listed_scenario_draws_and_keeps_its_expected_screen() {
8282 screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, size)),
8383 ..Default::default()
8484 },
85삭제: |ui| app.show(ui),
85추가: |ui| scenario.show(&mut app, ui),
8686 );
8787 assert!(!output.shapes.is_empty(), "{}", scenario.name);
8888 labels = text(&output.shapes);
@@ -96,6 +96,10 @@ fn every_listed_scenario_draws_and_keeps_its_expected_screen() {
9696 );
9797 assert!(app.model.input_error.is_none(), "{}", scenario.name);
9898 let expected = match scenario.name {
99추가: "uninstall-windows" => "제거 전에 다른 앱을 선택하세요",
100추가: "uninstall-settings-error" => "Windows 설정을 열지 못했습니다",
101추가: "uninstall-ubuntu-missing" => "이전 앱을 복원할 수 없습니다",
102추가: "uninstall-ubuntu-unknown-user" => "사용자 기본 앱 설정은 변경하지 않습니다",
99103 "empty" => "압축파일",
100104 "folder-empty" => "이 폴더는 비어 있습니다",
101105 "dialog-error" => "파일 선택 창을 열 수 없습니다",
@@ -189,3 +193,59 @@ fn preview_ignores_password_submission() {
189193 assert_eq!(preview.0.model.challenge, Some((17, 1, false)));
190194 assert!(preview.0.model.busy());
191195}
196추가:
197추가: #[test]
198추가: fn uninstall_previews_match_packaged_notices_and_do_not_start_jobs() {
199추가: let installer = include_str!("../../packaging/windows/rust/installer.nsi");
200추가: let prerm = include_str!("../../packaging/ubuntu/rust/prerm");
201추가: let helper = include_str!("../../packaging/ubuntu/rust/default-apps");
202추가: for (name, source, expected) in [
203추가: (
204추가: "uninstall-windows",
205추가: installer,
206추가: "직접 고른 기본 앱은 자동으로 바꾸지 않습니다.",
207추가: ),
208추가: (
209추가: "uninstall-settings-error",
210추가: installer,
211추가: "Windows 설정을 열지 못했습니다.",
212추가: ),
213추가: (
214추가: "uninstall-ubuntu-missing",
215추가: helper,
216추가: "이전 앱을 복원할 수 없습니다:",
217추가: ),
218추가: (
219추가: "uninstall-ubuntu-unknown-user",
220추가: prerm,
221추가: "제거를 요청한 사용자를 확인할 수 없어 사용자 기본 앱 설정은 변경하지 않습니다.",
222추가: ),
223추가: ] {
224추가: assert!(source.contains(expected));
225추가: let scenario = scenarios::parse(name).unwrap();
226추가: let ctx = egui::Context::default();
227추가: let mut preview = scenarios::Preview::new(scenario.build(), &ctx).with_scenario(scenario);
228추가: let mut output = ctx.run_ui(
229추가: egui::RawInput {
230추가: screen_rect: Some(egui::Rect::from_min_size(
231추가: egui::Pos2::ZERO,
232추가: egui::vec2(760.0, 540.0),
233추가: )),
234추가: events: vec![egui::Event::Key {
235추가: key: egui::Key::Enter,
236추가: physical_key: None,
237추가: pressed: true,
238추가: repeat: false,
239추가: modifiers: egui::Modifiers::NONE,
240추가: }],
241추가: ..Default::default()
242추가: },
243추가: |ui| preview.show(ui),
244추가: );
245추가: assert!(text(&output.shapes).contains(expected), "{name}");
246추가: assert!(!preview.0.model.busy());
247추가: assert!(preview.0.model.archive.is_none());
248추가: assert!(output.platform_output.commands.is_empty());
249추가: output.textures_delta.clear();
250추가: }
251추가: }
수정tests/rust-app-ui/scenarios.rs+75-4
@@ -52,6 +52,10 @@ catalog! {
5252 "create-error" => "ZIP 만들기 중 디스크 공간 부족",
5353 "password-create" => "암호 ZIP 생성의 작업자 암호 요청",
5454 "close-confirm" => "진행 중 창 닫기 확인",
55추가: "uninstall-windows" => "Windows 제거 전 기본 앱 선택 안내",
56추가: "uninstall-settings-error" => "Windows 기본 앱 설정 실행 실패",
57추가: "uninstall-ubuntu-missing" => "Ubuntu 이전 기본 앱 복원 불가 안내",
58추가: "uninstall-ubuntu-unknown-user" => "Ubuntu 제거 사용자 확인 불가 안내",
5559}
5660
5761pub fn listing() -> String {
@@ -149,6 +153,60 @@ fn entries(many: bool) -> Vec<Entry> {
149153}
150154
151155impl Scenario {
156추가: /// 제거 안내는 외부 설치 화면의 문구만 재현하며 OS 동작은 실행하지 않음.
157추가: pub fn show(self, app: &mut ArchiveApp, ui: &mut egui::Ui) {
158추가: let (title, messages, button): (&str, Vec<&str>, Option<&str>) = match self.name {
159추가: "uninstall-windows" => (
160추가: "제거 전 기본 앱 선택",
161추가: vec![
162추가: "Zipelo를 기본 앱으로 사용했다면 제거 전에 다른 앱을 선택하세요. [기본 앱 설정 열기]에서 .zip, .7z, .tar, .gz, .tgz를 검색해 사용할 앱을 고를 수 있습니다. 다른 앱이 없으면 먼저 설치하세요.",
163추가: "직접 고른 기본 앱은 자동으로 바꾸지 않습니다. 제거 후 파일이 열리지 않으면 파일을 오른쪽 클릭하고 [연결 프로그램]에서 다른 앱을 선택하세요.",
164추가: ],
165추가: Some("기본 앱 설정 열기"),
166추가: ),
167추가: "uninstall-settings-error" => (
168추가: "기본 앱 설정 실행 실패",
169추가: vec![
170추가: "Windows 설정을 열지 못했습니다. 설정 > 앱 > 기본 앱에서 확장자를 검색해 다른 앱을 선택하세요.",
171추가: ],
172추가: Some("확인"),
173추가: ),
174추가: "uninstall-ubuntu-missing" => (
175추가: "Ubuntu 제거 안내",
176추가: vec![
177추가: "Zipelo를 제거합니다. 파일이 열리지 않으면 파일을 오른쪽 클릭하고 [다른 프로그램으로 열기]에서 다른 앱을 선택하세요.",
178추가: "이전 앱을 복원할 수 없습니다: application/zip. 파일을 오른쪽 클릭해 [다른 프로그램으로 열기]에서 앱을 선택하세요.",
179추가: ],
180추가: None,
181추가: ),
182추가: "uninstall-ubuntu-unknown-user" => (
183추가: "Ubuntu 제거 안내",
184추가: vec![
185추가: "Zipelo를 제거합니다. 파일이 열리지 않으면 파일을 오른쪽 클릭하고 [다른 프로그램으로 열기]에서 다른 앱을 선택하세요.",
186추가: "제거를 요청한 사용자를 확인할 수 없어 사용자 기본 앱 설정은 변경하지 않습니다.",
187추가: ],
188추가: None,
189추가: ),
190추가: _ => {
191추가: app.show(ui);
192추가: return;
193추가: }
194추가: };
195추가: egui::CentralPanel::default().show_inside(ui, |ui| {
196추가: ui.add_space(16.0);
197추가: ui.heading(title);
198추가: ui.add_space(16.0);
199추가: for message in messages {
200추가: ui.label(message);
201추가: ui.add_space(16.0);
202추가: }
203추가: if let Some(button) = button {
204추가: // 미리보기에서는 설정 열기와 제거를 실행하지 않음.
205추가: let _ = ui.button(button);
206추가: }
207추가: });
208추가: }
209추가:
152210 /// 실제 파일과 작업자를 사용하지 않고 기존 화면 상태를 준비함.
153211 pub fn build(self) -> ArchiveApp {
154212 let factory = FakeFactory::manual();
@@ -159,7 +217,7 @@ impl Scenario {
159217 app.automatic_destination = false;
160218 app.zip_folder = base.clone();
161219 app.zip_name = "여행 자료.zip".into();
162삭제: if self.name == "empty" {
220추가: if self.name == "empty" || self.name.starts_with("uninstall-") {
163221 return app;
164222 }
165223 let archive = base.join(if self.name == "gzip-conflict" {
@@ -394,8 +452,21 @@ impl Scenario {
394452}
395453
396454/// 화면을 고정하고 실제 파일 조작을 막는 미리보기임.
397삭제: pub struct Preview(pub ArchiveApp);
455추가: pub struct Preview(pub ArchiveApp, Option<Scenario>);
398456impl Preview {
457추가: pub fn with_scenario(mut self, scenario: Scenario) -> Self {
458추가: self.1 = Some(scenario);
459추가: self
460추가: }
461추가:
462추가: pub fn show(&mut self, ui: &mut egui::Ui) {
463추가: if let Some(scenario) = self.1 {
464추가: scenario.show(&mut self.0, ui);
465추가: } else {
466추가: self.0.show(ui);
467추가: }
468추가: }
469추가:
399470 pub fn new(app: ArchiveApp, ctx: &egui::Context) -> Self {
400471 ctx.on_begin_pass(
401472 "ui-scenario-readonly",
@@ -410,7 +481,7 @@ impl Preview {
410481 });
411482 }),
412483 );
413삭제: Self(app)
484추가: Self(app, None)
414485 }
415486}
416487impl eframe::App for Preview {
@@ -419,6 +490,6 @@ impl eframe::App for Preview {
419490 root.ctx().send_viewport_cmd(egui::ViewportCommand::Close);
420491 return;
421492 }
422삭제: self.0.show(root);
493추가: self.show(root);
423494 }
424495}