team-ljyzipelo

공개

Merge pull request #90 from Team-LJY/features/ui-toolbar-native-dialog

시안 기반 툴바와 폴더 탐색 및 운영체제 기본 창 적용
작성자
LeeJunyoung
작성 시각
커밋
9cc95c3c26c5b65d7442687c3244ead2437e6d3d
이 시점의 파일 보기

변경된 파일 44개

+1,675-320

변경 내용이 커서 일부 파일의 Diff를 생략했어요. 생략한 파일은 파일 보기나 Raw로 확인할 수 있어요.

수정experiments/rust-ui-memory-app/Cargo.lock+494-11
@@ -205,6 +205,25 @@ version = "1.0.1"
205205source = "registry+https://github.com/rust-lang/crates.io-index"
206206checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b"
207207
208추가: [[package]]
209추가: name = "ashpd"
210추가: version = "0.11.1"
211추가: source = "registry+https://github.com/rust-lang/crates.io-index"
212추가: checksum = "d2f3f79755c74fd155000314eb349864caa787c6592eace6c6882dad873d9c39"
213추가: dependencies = [
214추가: "async-fs",
215추가: "async-net",
216추가: "enumflags2",
217추가: "futures-channel",
218추가: "futures-util",
219추가: "rand",
220추가: "raw-window-handle",
221추가: "serde",
222추가: "serde_repr",
223추가: "url",
224추가: "zbus",
225추가: ]
226추가:
208227[[package]]
209228name = "async-broadcast"
210229version = "0.7.2"
@@ -243,6 +262,17 @@ dependencies = [
243262 "slab",
244263]
245264
265추가: [[package]]
266추가: name = "async-fs"
267추가: version = "2.2.0"
268추가: source = "registry+https://github.com/rust-lang/crates.io-index"
269추가: checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5"
270추가: dependencies = [
271추가: "async-lock",
272추가: "blocking",
273추가: "futures-lite",
274추가: ]
275추가:
246276[[package]]
247277name = "async-io"
248278version = "2.6.0"
@@ -272,6 +302,17 @@ dependencies = [
272302 "pin-project-lite",
273303]
274304
305추가: [[package]]
306추가: name = "async-net"
307추가: version = "2.0.0"
308추가: source = "registry+https://github.com/rust-lang/crates.io-index"
309추가: checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7"
310추가: dependencies = [
311추가: "async-io",
312추가: "blocking",
313추가: "futures-lite",
314추가: ]
315추가:
275316[[package]]
276317name = "async-process"
277318version = "2.5.0"
@@ -748,9 +789,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
748789checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38"
749790dependencies = [
750791 "bitflags 2.13.2",
792추가: "block2 0.6.2",
793추가: "libc",
751794 "objc2 0.6.5",
752795]
753796
797추가: [[package]]
798추가: name = "displaydoc"
799추가: version = "0.2.7"
800추가: source = "registry+https://github.com/rust-lang/crates.io-index"
801추가: checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
802추가: dependencies = [
803추가: "proc-macro2",
804추가: "quote",
805추가: "syn 3.0.10",
806추가: ]
807추가:
754808[[package]]
755809name = "dlib"
756810version = "0.5.3"
@@ -816,7 +870,7 @@ dependencies = [
816870 "objc2-foundation 0.3.2",
817871 "parking_lot",
818872 "percent-encoding",
819삭제: "pollster",
873추가: "pollster 1.0.1",
820874 "profiling",
821875 "raw-window-handle",
822876 "send_wrapper",
@@ -1160,6 +1214,24 @@ version = "0.3.1"
11601214source = "registry+https://github.com/rust-lang/crates.io-index"
11611215checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
11621216
1217추가: [[package]]
1218추가: name = "form_urlencoded"
1219추가: version = "1.2.2"
1220추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1221추가: checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
1222추가: dependencies = [
1223추가: "percent-encoding",
1224추가: ]
1225추가:
1226추가: [[package]]
1227추가: name = "futures-channel"
1228추가: version = "0.3.34"
1229추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1230추가: checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
1231추가: dependencies = [
1232추가: "futures-core",
1233추가: ]
1234추가:
11631235[[package]]
11641236name = "futures-core"
11651237version = "0.3.34"
@@ -1209,8 +1281,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
12091281checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
12101282dependencies = [
12111283 "futures-core",
1284추가: "futures-io",
12121285 "futures-macro",
12131286 "futures-task",
1287추가: "memchr",
12141288 "pin-project-lite",
12151289 "slab",
12161290]
@@ -1462,6 +1536,110 @@ dependencies = [
14621536 "digest",
14631537]
14641538
1539추가: [[package]]
1540추가: name = "icu_collections"
1541추가: version = "2.4.0"
1542추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1543추가: checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd"
1544추가: dependencies = [
1545추가: "displaydoc",
1546추가: "potential_utf",
1547추가: "utf8_iter",
1548추가: "yoke",
1549추가: "zerofrom",
1550추가: "zerovec",
1551추가: ]
1552추가:
1553추가: [[package]]
1554추가: name = "icu_locale_core"
1555추가: version = "2.4.0"
1556추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1557추가: checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0"
1558추가: dependencies = [
1559추가: "displaydoc",
1560추가: "litemap",
1561추가: "tinystr",
1562추가: "writeable",
1563추가: "zerovec",
1564추가: ]
1565추가:
1566추가: [[package]]
1567추가: name = "icu_normalizer"
1568추가: version = "2.4.0"
1569추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1570추가: checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599"
1571추가: dependencies = [
1572추가: "icu_collections",
1573추가: "icu_normalizer_data",
1574추가: "icu_properties",
1575추가: "icu_provider",
1576추가: "smallvec",
1577추가: "zerovec",
1578추가: ]
1579추가:
1580추가: [[package]]
1581추가: name = "icu_normalizer_data"
1582추가: version = "2.4.0"
1583추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1584추가: checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc"
1585추가:
1586추가: [[package]]
1587추가: name = "icu_properties"
1588추가: version = "2.4.0"
1589추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1590추가: checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f"
1591추가: dependencies = [
1592추가: "displaydoc",
1593추가: "icu_collections",
1594추가: "icu_locale_core",
1595추가: "icu_properties_data",
1596추가: "icu_provider",
1597추가: "zerotrie",
1598추가: "zerovec",
1599추가: ]
1600추가:
1601추가: [[package]]
1602추가: name = "icu_properties_data"
1603추가: version = "2.4.0"
1604추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1605추가: checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf"
1606추가:
1607추가: [[package]]
1608추가: name = "icu_provider"
1609추가: version = "2.4.0"
1610추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1611추가: checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514"
1612추가: dependencies = [
1613추가: "displaydoc",
1614추가: "icu_locale_core",
1615추가: "writeable",
1616추가: "yoke",
1617추가: "zerofrom",
1618추가: "zerotrie",
1619추가: "zerovec",
1620추가: ]
1621추가:
1622추가: [[package]]
1623추가: name = "idna"
1624추가: version = "1.1.0"
1625추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1626추가: checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
1627추가: dependencies = [
1628추가: "idna_adapter",
1629추가: "smallvec",
1630추가: "utf8_iter",
1631추가: ]
1632추가:
1633추가: [[package]]
1634추가: name = "idna_adapter"
1635추가: version = "1.2.2"
1636추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1637추가: checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
1638추가: dependencies = [
1639추가: "icu_normalizer",
1640추가: "icu_properties",
1641추가: ]
1642추가:
14651643[[package]]
14661644name = "image"
14671645version = "0.25.10"
@@ -1653,6 +1831,12 @@ version = "0.12.1"
16531831source = "registry+https://github.com/rust-lang/crates.io-index"
16541832checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
16551833
1834추가: [[package]]
1835추가: name = "litemap"
1836추가: version = "0.8.3"
1837추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1838추가: checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"
1839추가:
16561840[[package]]
16571841name = "litrs"
16581842version = "1.0.1"
@@ -2398,6 +2582,12 @@ dependencies = [
23982582 "windows-sys 0.61.2",
23992583]
24002584
2585추가: [[package]]
2586추가: name = "pollster"
2587추가: version = "0.4.0"
2588추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2589추가: checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3"
2590추가:
24012591[[package]]
24022592name = "pollster"
24032593version = "1.0.1"
@@ -2428,6 +2618,24 @@ dependencies = [
24282618 "portable-atomic",
24292619]
24302620
2621추가: [[package]]
2622추가: name = "potential_utf"
2623추가: version = "0.1.6"
2624추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2625추가: checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661"
2626추가: dependencies = [
2627추가: "zerovec",
2628추가: ]
2629추가:
2630추가: [[package]]
2631추가: name = "ppv-lite86"
2632추가: version = "0.2.21"
2633추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2634추가: checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
2635추가: dependencies = [
2636추가: "zerocopy",
2637추가: ]
2638추가:
24312639[[package]]
24322640name = "presser"
24332641version = "0.3.1"
@@ -2500,6 +2708,35 @@ version = "6.0.0"
25002708source = "registry+https://github.com/rust-lang/crates.io-index"
25012709checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
25022710
2711추가: [[package]]
2712추가: name = "rand"
2713추가: version = "0.9.5"
2714추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2715추가: checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41"
2716추가: dependencies = [
2717추가: "rand_chacha",
2718추가: "rand_core",
2719추가: ]
2720추가:
2721추가: [[package]]
2722추가: name = "rand_chacha"
2723추가: version = "0.9.0"
2724추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2725추가: checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
2726추가: dependencies = [
2727추가: "ppv-lite86",
2728추가: "rand_core",
2729추가: ]
2730추가:
2731추가: [[package]]
2732추가: name = "rand_core"
2733추가: version = "0.9.5"
2734추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2735추가: checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
2736추가: dependencies = [
2737추가: "getrandom 0.3.4",
2738추가: ]
2739추가:
25032740[[package]]
25042741name = "range-alloc"
25052742version = "0.1.5"
@@ -2556,6 +2793,30 @@ version = "1.1.0"
25562793source = "registry+https://github.com/rust-lang/crates.io-index"
25572794checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832"
25582795
2796추가: [[package]]
2797추가: name = "rfd"
2798추가: version = "0.16.0"
2799추가: source = "registry+https://github.com/rust-lang/crates.io-index"
2800추가: checksum = "a15ad77d9e70a92437d8f74c35d99b4e4691128df018833e99f90bcd36152672"
2801추가: dependencies = [
2802추가: "ashpd",
2803추가: "block2 0.6.2",
2804추가: "dispatch2",
2805추가: "js-sys",
2806추가: "log",
2807추가: "objc2 0.6.5",
2808추가: "objc2-app-kit 0.3.2",
2809추가: "objc2-core-foundation",
2810추가: "objc2-foundation 0.3.2",
2811추가: "pollster 0.4.0",
2812추가: "raw-window-handle",
2813추가: "urlencoding",
2814추가: "wasm-bindgen",
2815추가: "wasm-bindgen-futures",
2816추가: "web-sys",
2817추가: "windows-sys 0.60.2",
2818추가: ]
2819추가:
25592820[[package]]
25602821name = "roxmltree"
25612822version = "0.21.2"
@@ -2867,6 +3128,12 @@ dependencies = [
28673128 "serde",
28683129]
28693130
3131추가: [[package]]
3132추가: name = "stable_deref_trait"
3133추가: version = "1.2.1"
3134추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3135추가: checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
3136추가:
28703137[[package]]
28713138name = "static_assertions"
28723139version = "1.1.0"
@@ -2901,6 +3168,17 @@ dependencies = [
29013168 "unicode-ident",
29023169]
29033170
3171추가: [[package]]
3172추가: name = "synstructure"
3173추가: version = "0.14.0"
3174추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3175추가: checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02"
3176추가: dependencies = [
3177추가: "proc-macro2",
3178추가: "quote",
3179추가: "syn 3.0.10",
3180추가: ]
3181추가:
29043182[[package]]
29053183name = "sys-locale"
29063184version = "0.3.2"
@@ -2977,6 +3255,16 @@ dependencies = [
29773255 "zune-jpeg",
29783256]
29793257
3258추가: [[package]]
3259추가: name = "tinystr"
3260추가: version = "0.8.5"
3261추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3262추가: checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a"
3263추가: dependencies = [
3264추가: "displaydoc",
3265추가: "zerovec",
3266추가: ]
3267추가:
29803268[[package]]
29813269name = "tokio"
29823270version = "1.54.1"
@@ -3127,6 +3415,40 @@ version = "0.2.3"
31273415source = "registry+https://github.com/rust-lang/crates.io-index"
31283416checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557"
31293417
3418추가: [[package]]
3419추가: name = "url"
3420추가: version = "2.5.8"
3421추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3422추가: checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
3423추가: dependencies = [
3424추가: "form_urlencoded",
3425추가: "idna",
3426추가: "percent-encoding",
3427추가: "serde",
3428추가: "serde_derive",
3429추가: ]
3430추가:
3431추가: [[package]]
3432추가: name = "urlencoding"
3433추가: version = "2.1.3"
3434추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3435추가: checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
3436추가:
3437추가: [[package]]
3438추가: name = "utf8_iter"
3439추가: version = "1.1.0"
3440추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3441추가: checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0"
3442추가: dependencies = [
3443추가: "utf_types",
3444추가: ]
3445추가:
3446추가: [[package]]
3447추가: name = "utf_types"
3448추가: version = "1.0.0"
3449추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3450추가: checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6"
3451추가:
31303452[[package]]
31313453name = "uuid"
31323454version = "1.29.2"
@@ -3654,7 +3976,7 @@ version = "0.52.0"
36543976source = "registry+https://github.com/rust-lang/crates.io-index"
36553977checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
36563978dependencies = [
3657삭제: "windows-targets",
3979추가: "windows-targets 0.52.6",
36583980]
36593981
36603982[[package]]
@@ -3663,7 +3985,16 @@ version = "0.59.0"
36633985source = "registry+https://github.com/rust-lang/crates.io-index"
36643986checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
36653987dependencies = [
3666삭제: "windows-targets",
3988추가: "windows-targets 0.52.6",
3989추가: ]
3990추가:
3991추가: [[package]]
3992추가: name = "windows-sys"
3993추가: version = "0.60.2"
3994추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3995추가: checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
3996추가: dependencies = [
3997추가: "windows-targets 0.53.5",
36673998]
36683999
36694000[[package]]
@@ -3681,14 +4012,31 @@ version = "0.52.6"
36814012source = "registry+https://github.com/rust-lang/crates.io-index"
36824013checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
36834014dependencies = [
3684삭제: "windows_aarch64_gnullvm",
3685삭제: "windows_aarch64_msvc",
3686삭제: "windows_i686_gnu",
3687삭제: "windows_i686_gnullvm",
3688삭제: "windows_i686_msvc",
3689삭제: "windows_x86_64_gnu",
3690삭제: "windows_x86_64_gnullvm",
3691삭제: "windows_x86_64_msvc",
4015추가: "windows_aarch64_gnullvm 0.52.6",
4016추가: "windows_aarch64_msvc 0.52.6",
4017추가: "windows_i686_gnu 0.52.6",
4018추가: "windows_i686_gnullvm 0.52.6",
4019추가: "windows_i686_msvc 0.52.6",
4020추가: "windows_x86_64_gnu 0.52.6",
4021추가: "windows_x86_64_gnullvm 0.52.6",
4022추가: "windows_x86_64_msvc 0.52.6",
4023추가: ]
4024추가:
4025추가: [[package]]
4026추가: name = "windows-targets"
4027추가: version = "0.53.5"
4028추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4029추가: checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
4030추가: dependencies = [
4031추가: "windows-link",
4032추가: "windows_aarch64_gnullvm 0.53.1",
4033추가: "windows_aarch64_msvc 0.53.1",
4034추가: "windows_i686_gnu 0.53.1",
4035추가: "windows_i686_gnullvm 0.53.1",
4036추가: "windows_i686_msvc 0.53.1",
4037추가: "windows_x86_64_gnu 0.53.1",
4038추가: "windows_x86_64_gnullvm 0.53.1",
4039추가: "windows_x86_64_msvc 0.53.1",
36924040]
36934041
36944042[[package]]
@@ -3706,48 +4054,96 @@ version = "0.52.6"
37064054source = "registry+https://github.com/rust-lang/crates.io-index"
37074055checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
37084056
4057추가: [[package]]
4058추가: name = "windows_aarch64_gnullvm"
4059추가: version = "0.53.1"
4060추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4061추가: checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
4062추가:
37094063[[package]]
37104064name = "windows_aarch64_msvc"
37114065version = "0.52.6"
37124066source = "registry+https://github.com/rust-lang/crates.io-index"
37134067checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
37144068
4069추가: [[package]]
4070추가: name = "windows_aarch64_msvc"
4071추가: version = "0.53.1"
4072추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4073추가: checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
4074추가:
37154075[[package]]
37164076name = "windows_i686_gnu"
37174077version = "0.52.6"
37184078source = "registry+https://github.com/rust-lang/crates.io-index"
37194079checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
37204080
4081추가: [[package]]
4082추가: name = "windows_i686_gnu"
4083추가: version = "0.53.1"
4084추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4085추가: checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
4086추가:
37214087[[package]]
37224088name = "windows_i686_gnullvm"
37234089version = "0.52.6"
37244090source = "registry+https://github.com/rust-lang/crates.io-index"
37254091checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
37264092
4093추가: [[package]]
4094추가: name = "windows_i686_gnullvm"
4095추가: version = "0.53.1"
4096추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4097추가: checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
4098추가:
37274099[[package]]
37284100name = "windows_i686_msvc"
37294101version = "0.52.6"
37304102source = "registry+https://github.com/rust-lang/crates.io-index"
37314103checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
37324104
4105추가: [[package]]
4106추가: name = "windows_i686_msvc"
4107추가: version = "0.53.1"
4108추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4109추가: checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
4110추가:
37334111[[package]]
37344112name = "windows_x86_64_gnu"
37354113version = "0.52.6"
37364114source = "registry+https://github.com/rust-lang/crates.io-index"
37374115checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
37384116
4117추가: [[package]]
4118추가: name = "windows_x86_64_gnu"
4119추가: version = "0.53.1"
4120추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4121추가: checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
4122추가:
37394123[[package]]
37404124name = "windows_x86_64_gnullvm"
37414125version = "0.52.6"
37424126source = "registry+https://github.com/rust-lang/crates.io-index"
37434127checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
37444128
4129추가: [[package]]
4130추가: name = "windows_x86_64_gnullvm"
4131추가: version = "0.53.1"
4132추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4133추가: checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
4134추가:
37454135[[package]]
37464136name = "windows_x86_64_msvc"
37474137version = "0.52.6"
37484138source = "registry+https://github.com/rust-lang/crates.io-index"
37494139checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
37504140
4141추가: [[package]]
4142추가: name = "windows_x86_64_msvc"
4143추가: version = "0.53.1"
4144추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4145추가: checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
4146추가:
37514147[[package]]
37524148name = "winit"
37534149version = "0.30.13"
@@ -3832,6 +4228,12 @@ dependencies = [
38324228 "wayland-protocols-wlr",
38334229]
38344230
4231추가: [[package]]
4232추가: name = "writeable"
4233추가: version = "0.6.4"
4234추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4235추가: checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
4236추가:
38354237[[package]]
38364238name = "x11-dl"
38374239version = "2.21.0"
@@ -3906,6 +4308,29 @@ dependencies = [
39064308 "pkg-config",
39074309]
39084310
4311추가: [[package]]
4312추가: name = "yoke"
4313추가: version = "0.8.4"
4314추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4315추가: checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3"
4316추가: dependencies = [
4317추가: "stable_deref_trait",
4318추가: "yoke-derive",
4319추가: "zerofrom",
4320추가: ]
4321추가:
4322추가: [[package]]
4323추가: name = "yoke-derive"
4324추가: version = "0.8.4"
4325추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4326추가: checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71"
4327추가: dependencies = [
4328추가: "proc-macro2",
4329추가: "quote",
4330추가: "syn 3.0.10",
4331추가: "synstructure",
4332추가: ]
4333추가:
39094334[[package]]
39104335name = "zbus"
39114336version = "5.19.0"
@@ -4032,6 +4457,27 @@ dependencies = [
40324457 "syn 2.0.119",
40334458]
40344459
4460추가: [[package]]
4461추가: name = "zerofrom"
4462추가: version = "0.1.8"
4463추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4464추가: checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"
4465추가: dependencies = [
4466추가: "zerofrom-derive",
4467추가: ]
4468추가:
4469추가: [[package]]
4470추가: name = "zerofrom-derive"
4471추가: version = "0.1.8"
4472추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4473추가: checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a"
4474추가: dependencies = [
4475추가: "proc-macro2",
4476추가: "quote",
4477추가: "syn 3.0.10",
4478추가: "synstructure",
4479추가: ]
4480추가:
40354481[[package]]
40364482name = "zeroize"
40374483version = "1.9.1"
@@ -4052,6 +4498,39 @@ dependencies = [
40524498 "syn 2.0.119",
40534499]
40544500
4501추가: [[package]]
4502추가: name = "zerotrie"
4503추가: version = "0.2.5"
4504추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4505추가: checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"
4506추가: dependencies = [
4507추가: "displaydoc",
4508추가: "yoke",
4509추가: "zerofrom",
4510추가: ]
4511추가:
4512추가: [[package]]
4513추가: name = "zerovec"
4514추가: version = "0.11.9"
4515추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4516추가: checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40"
4517추가: dependencies = [
4518추가: "yoke",
4519추가: "zerofrom",
4520추가: "zerovec-derive",
4521추가: ]
4522추가:
4523추가: [[package]]
4524추가: name = "zerovec-derive"
4525추가: version = "0.11.7"
4526추가: source = "registry+https://github.com/rust-lang/crates.io-index"
4527추가: checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a"
4528추가: dependencies = [
4529추가: "proc-macro2",
4530추가: "quote",
4531추가: "syn 3.0.10",
4532추가: ]
4533추가:
40554534[[package]]
40564535name = "zip"
40574536version = "9.5.0"
@@ -4120,7 +4599,10 @@ dependencies = [
41204599name = "zipelo-ui-memory-app"
41214600version = "0.1.0"
41224601dependencies = [
4602추가: "ashpd",
41234603 "eframe",
4604추가: "pollster 0.4.0",
4605추가: "rfd",
41244606 "wgpu",
41254607 "zipelo-app-core-memory",
41264608 "zipelo-archive-worker",
@@ -4156,6 +4638,7 @@ dependencies = [
41564638 "endi",
41574639 "enumflags2",
41584640 "serde",
4641추가: "url",
41594642 "winnow",
41604643 "zcheapstr",
41614644 "zvariant_derive",
수정experiments/rust-ui-memory-app/Cargo.toml+9-1
@@ -14,7 +14,7 @@ doctest = false
1414
1515[features]
1616default = []
17삭제: ui = ["dep:eframe", "dep:wgpu"]
17추가: ui = ["dep:eframe", "dep:wgpu", "dep:rfd", "dep:ashpd", "dep:pollster"]
1818ui-fixture = ["ui"]
1919
2020[dependencies]
@@ -43,6 +43,14 @@ path = "../../tests/rust-app-real-worker/flows.rs"
4343name = "format_contract"
4444path = "../../tests/rust-app-real-worker/formats.rs"
4545
46추가: [target.'cfg(target_os = "linux")'.dependencies]
47추가: ashpd = { version = "=0.11.1", optional = true, default-features = false, features = ["async-std"] }
48추가: pollster = { version = "=0.4.0", optional = true }
49추가: rfd = { version = "=0.16.0", optional = true, default-features = false, features = ["xdg-portal", "async-std"] }
50추가:
51추가: [target.'cfg(not(target_os = "linux"))'.dependencies]
52추가: rfd = { version = "=0.16.0", optional = true, default-features = false }
53추가:
4654[target.'cfg(target_os = "windows")'.dependencies]
4755wgpu = { version = "=30.0.1", optional = true, default-features = false, features = ["std", "dx12"] }
4856eframe = { version = "=0.37.0", optional = true, default-features = false, features = ["wgpu_no_default_features"] }
수정experiments/rust-ui-memory-app/THIRD-PARTY-NOTICES.txt+1-0
@@ -4,3 +4,4 @@ Zipelo 의존성 고지 생성 안내
44앱과 작업자의 Cargo.lock 전체 항목을 오프라인 cargo metadata와 대조함.
55로컬 registry의 원문과 잠금 체크섬을 확인하며 누락 시 패키지 생성을 중단함.
66이 안내 파일과 과거 시험용 보충 원문은 최종 배포 고지를 대신하지 않음.
7추가: 운영체제 기본 파일 창의 rfd 0.16.0(MIT)과 Linux xdg-portal 전이 의존성도 잠금 파일에서 수집함.
추가experiments/rust-ui-memory-app/src/archive_browser.rs+116-0
@@ -0,0 +1,116 @@
1추가: use crate::archive_ui::{Entry, Kind};
2추가: use std::collections::{BTreeMap, BTreeSet};
3추가:
4추가: #[derive(Clone, Debug)]
5추가: pub struct Row {
6추가: pub path: String,
7추가: pub name: String,
8추가: pub directory: bool,
9추가: pub ids: BTreeSet<u32>,
10추가: pub bytes: Option<u64>,
11추가: pub encrypted: bool,
12추가: }
13추가:
14추가: pub fn normalized(name: &str) -> Option<String> {
15추가: let name = name.replace('\\', "/");
16추가: let name = name.trim_end_matches('/');
17추가: if name.is_empty()
18추가: || name.starts_with('/')
19추가: || name.contains(':')
20추가: || name
21추가: .split('/')
22추가: .any(|part| part.is_empty() || part == "." || part == ".." || part.contains('\0'))
23추가: {
24추가: return None;
25추가: }
26추가: Some(name.to_owned())
27추가: }
28추가:
29추가: pub fn rows(entries: &[Entry], current: &str, query: &str) -> Vec<Row> {
30추가: let prefix = if current.is_empty() {
31추가: String::new()
32추가: } else {
33추가: format!("{current}/")
34추가: };
35추가: let mut rows = BTreeMap::<String, Row>::new();
36추가: for entry in entries {
37추가: let Some(path) = normalized(&entry.name) else {
38추가: continue;
39추가: };
40추가: let Some(relative) = path.strip_prefix(&prefix) else {
41추가: continue;
42추가: };
43추가: if relative.is_empty() {
44추가: continue;
45추가: }
46추가: let (name, implicit) = relative
47추가: .split_once('/')
48추가: .map_or((relative, false), |(first, _)| (first, true));
49추가: let directory = implicit || entry.kind == Kind::Directory;
50추가: let row = rows.entry(name.to_owned()).or_insert_with(|| Row {
51추가: path: format!("{prefix}{name}"),
52추가: name: name.to_owned(),
53추가: directory,
54추가: ids: BTreeSet::new(),
55추가: bytes: None,
56추가: encrypted: false,
57추가: });
58추가: row.directory |= directory;
59추가: if matches!(entry.kind, Kind::File | Kind::Directory) {
60추가: row.ids.insert(entry.id);
61추가: }
62추가: if !directory {
63추가: row.bytes = entry.bytes;
64추가: }
65추가: row.encrypted |= entry.encrypted;
66추가: }
67추가: let query = query.to_lowercase();
68추가: let mut rows = rows
69추가: .into_values()
70추가: .filter(|row| row.name.to_lowercase().contains(&query))
71추가: .collect::<Vec<_>>();
72추가: rows.sort_by(|a, b| {
73추가: b.directory
74추가: .cmp(&a.directory)
75추가: .then_with(|| a.name.cmp(&b.name))
76추가: });
77추가: rows
78추가: }
79추가:
80추가: pub fn expand_selection(entries: &[Entry], selected: &BTreeSet<u32>) -> BTreeSet<u32> {
81추가: let directories = entries
82추가: .iter()
83추가: .filter(|entry| entry.kind == Kind::Directory && selected.contains(&entry.id))
84추가: .filter_map(|entry| normalized(&entry.name).map(|path| format!("{path}/")))
85추가: .collect::<Vec<_>>();
86추가: entries
87추가: .iter()
88추가: .filter(|entry| {
89추가: selected.contains(&entry.id)
90추가: || normalized(&entry.name)
91추가: .is_some_and(|name| directories.iter().any(|prefix| name.starts_with(prefix)))
92추가: })
93추가: .filter(|entry| matches!(entry.kind, Kind::File | Kind::Directory))
94추가: .map(|entry| entry.id)
95추가: .collect()
96추가: }
97추가:
98추가: pub fn remove_selection(entries: &[Entry], selected: &mut BTreeSet<u32>, removed: &BTreeSet<u32>) {
99추가: let paths = entries
100추가: .iter()
101추가: .filter(|entry| removed.contains(&entry.id))
102추가: .filter_map(|entry| normalized(&entry.name))
103추가: .collect::<Vec<_>>();
104추가: let ancestors = entries
105추가: .iter()
106추가: .filter(|entry| entry.kind == Kind::Directory)
107추가: .filter_map(|entry| {
108추가: let prefix = format!("{}/", normalized(&entry.name)?);
109추가: paths
110추가: .iter()
111추가: .any(|path| path.starts_with(&prefix))
112추가: .then_some(entry.id)
113추가: })
114추가: .collect::<BTreeSet<_>>();
115추가: selected.retain(|id| !removed.contains(id) && !ancestors.contains(id));
116추가: }
추가experiments/rust-ui-memory-app/src/archive_dialog.rs+177-0
@@ -0,0 +1,177 @@
1추가: use std::path::PathBuf;
2추가:
3추가: #[derive(Clone, Copy, Debug, Eq, PartialEq)]
4추가: pub enum Purpose {
5추가: Open,
6추가: Files,
7추가: Folder,
8추가: Destination,
9추가: Retry,
10추가: SaveZip,
11추가: SaveGzip,
12추가: RetryGzip,
13추가: }
14추가:
15추가: #[derive(Clone, Debug)]
16추가: pub struct DialogRequest {
17추가: pub purpose: Purpose,
18추가: pub directory: PathBuf,
19추가: pub file_name: String,
20추가: }
21추가:
22추가: pub trait Dialogs {
23추가: fn choose(&mut self, request: DialogRequest) -> Result<Option<Vec<PathBuf>>, String>;
24추가: }
25추가:
26추가: pub fn archive_filters() -> Vec<(&'static str, Vec<String>)> {
27추가: let mut extensions = Vec::new();
28추가: for extension in ["zip", "7z", "tar", "gz", "tgz"] {
29추가: let mut variants = vec![String::new()];
30추가: for character in extension.chars() {
31추가: let mut next = Vec::new();
32추가: for prefix in variants {
33추가: next.push(format!("{prefix}{character}"));
34추가: if character.is_ascii_alphabetic() {
35추가: next.push(format!("{prefix}{}", character.to_ascii_uppercase()));
36추가: }
37추가: }
38추가: variants = next;
39추가: }
40추가: extensions.extend(variants);
41추가: }
42추가: vec![("압축파일", extensions), ("모든 파일", vec!["*".into()])]
43추가: }
44추가:
45추가: #[derive(Default)]
46추가: pub struct NativeDialogs;
47추가:
48추가: pub const DIALOG_UNAVAILABLE: &str =
49추가: "파일 선택 창을 열 수 없습니다. 파일을 창으로 끌어 놓아 주세요.";
50추가:
51추가: impl Dialogs for NativeDialogs {
52추가: fn choose(&mut self, request: DialogRequest) -> Result<Option<Vec<PathBuf>>, String> {
53추가: std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
54추가: #[cfg(target_os = "linux")]
55추가: {
56추가: choose_portal(request)
57추가: }
58추가: #[cfg(not(target_os = "linux"))]
59추가: {
60추가: choose_native(request)
61추가: }
62추가: }))
63추가: .unwrap_or_else(|_| Err(DIALOG_UNAVAILABLE.into()))
64추가: }
65추가: }
66추가:
67추가: #[cfg(target_os = "linux")]
68추가: pub fn portal_response(
69추가: response: Result<Vec<PathBuf>, ashpd::Error>,
70추가: ) -> Result<Option<Vec<PathBuf>>, String> {
71추가: match response {
72추가: Ok(paths) if !paths.is_empty() => Ok(Some(paths)),
73추가: Err(ashpd::Error::Response(ashpd::desktop::ResponseError::Cancelled))
74추가: | Err(ashpd::Error::Portal(ashpd::PortalError::Cancelled(_))) => Ok(None),
75추가: _ => Err(DIALOG_UNAVAILABLE.into()),
76추가: }
77추가: }
78추가:
79추가: #[cfg(target_os = "linux")]
80추가: fn choose_portal(request: DialogRequest) -> Result<Option<Vec<PathBuf>>, String> {
81추가: use ashpd::desktop::file_chooser::{FileFilter, OpenFileRequest, SaveFileRequest};
82추가: let filters = match request.purpose {
83추가: Purpose::Open => archive_filters(),
84추가: Purpose::SaveZip => vec![("ZIP 압축파일", vec!["zip".into()])],
85추가: _ => Vec::new(),
86추가: }
87추가: .into_iter()
88추가: .map(|(name, extensions)| {
89추가: extensions
90추가: .into_iter()
91추가: .fold(FileFilter::new(name), |filter, extension| {
92추가: let glob = if extension == "*" {
93추가: "*".to_owned()
94추가: } else {
95추가: format!("*.{extension}")
96추가: };
97추가: filter.glob(&glob)
98추가: })
99추가: })
100추가: .collect::<Vec<_>>();
101추가: portal_response(pollster::block_on(async move {
102추가: let selected = match request.purpose {
103추가: Purpose::SaveZip | Purpose::SaveGzip | Purpose::RetryGzip => SaveFileRequest::default()
104추가: .title(if request.purpose == Purpose::SaveZip {
105추가: "ZIP 파일 저장"
106추가: } else {
107추가: "압축 해제 파일 저장"
108추가: })
109추가: .current_name(Some(request.file_name.as_str()))
110추가: .filters(filters)
111추가: .current_folder::<&PathBuf>(Some(&request.directory))?
112추가: .send()
113추가: .await?
114추가: .response()?,
115추가: purpose => OpenFileRequest::default()
116추가: .title(match purpose {
117추가: Purpose::Open => "압축파일 열기",
118추가: Purpose::Files => "파일 추가",
119추가: Purpose::Folder => "폴더 추가",
120추가: _ => "압축을 풀 폴더 선택",
121추가: })
122추가: .multiple(purpose == Purpose::Files)
123추가: .directory(matches!(
124추가: purpose,
125추가: Purpose::Folder | Purpose::Destination | Purpose::Retry
126추가: ))
127추가: .filters(filters)
128추가: .current_folder::<&PathBuf>(Some(&request.directory))?
129추가: .send()
130추가: .await?
131추가: .response()?,
132추가: };
133추가: selected
134추가: .uris()
135추가: .iter()
136추가: .map(|uri| {
137추가: uri.to_file_path()
138추가: .map_err(|_| ashpd::Error::ParseError("파일 경로 응답 오류"))
139추가: })
140추가: .collect::<Result<Vec<_>, _>>()
141추가: }))
142추가: }
143추가:
144추가: #[cfg(not(target_os = "linux"))]
145추가: fn choose_native(request: DialogRequest) -> Result<Option<Vec<PathBuf>>, String> {
146추가: let dialog = rfd::FileDialog::new().set_directory(request.directory);
147추가: let answer = match request.purpose {
148추가: Purpose::Open => {
149추가: let mut dialog = dialog.set_title("압축파일 열기");
150추가: for (name, extensions) in archive_filters() {
151추가: dialog = dialog.add_filter(name, &extensions);
152추가: }
153추가: dialog.pick_file().map(|path| vec![path])
154추가: }
155추가: Purpose::Files => dialog.set_title("파일 추가").pick_files(),
156추가: Purpose::Folder => dialog
157추가: .set_title("폴더 추가")
158추가: .pick_folder()
159추가: .map(|path| vec![path]),
160추가: Purpose::Destination | Purpose::Retry => dialog
161추가: .set_title("압축을 풀 폴더 선택")
162추가: .pick_folder()
163추가: .map(|path| vec![path]),
164추가: Purpose::SaveGzip | Purpose::RetryGzip => dialog
165추가: .set_title("압축 해제 파일 저장")
166추가: .set_file_name(request.file_name)
167추가: .save_file()
168추가: .map(|path| vec![path]),
169추가: Purpose::SaveZip => dialog
170추가: .set_title("ZIP 파일 저장")
171추가: .set_file_name(request.file_name)
172추가: .add_filter("ZIP 압축파일", &["zip"])
173추가: .save_file()
174추가: .map(|path| vec![path]),
175추가: };
176추가: Ok(answer)
177추가: }
삭제experiments/rust-ui-memory-app/src/archive_picker.rs+0-263
@@ -1,263 +0,0 @@
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삭제: }
수정experiments/rust-ui-memory-app/src/archive_present.rs+20-0
@@ -362,3 +362,23 @@ pub fn activity_text(model: &Model, creating: bool) -> &'static str {
362362 })
363363 }
364364}
365추가:
366추가: pub fn valid_output_leaf(name: &str) -> bool {
367추가: valid_leaf(name) && worker_protocol::archive::valid_name(name, false).is_ok()
368추가: }
369추가:
370추가: pub fn gzip_output_name(archive: &Path) -> String {
371추가: let file_name = archive
372추가: .file_name()
373추가: .and_then(|name| name.to_str())
374추가: .unwrap_or("");
375추가: let candidate = file_name
376추가: .rsplit_once('.')
377추가: .filter(|(_, suffix)| suffix.eq_ignore_ascii_case("gz"))
378추가: .map_or(file_name, |(stem, _)| stem);
379추가: if valid_output_leaf(candidate) {
380추가: candidate.to_owned()
381추가: } else {
382추가: "압축 해제 파일".into()
383추가: }
384추가: }
수정experiments/rust-ui-memory-app/src/archive_screen.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
수정experiments/rust-ui-memory-app/src/archive_theme.rs+123-2
@@ -18,7 +18,7 @@ pub const WARNING: Color32 = Color32::from_rgb(180, 83, 9);
1818pub const WARNING_BG: Color32 = Color32::from_rgb(255, 247, 232);
1919pub const ERROR: Color32 = Color32::from_rgb(185, 28, 28);
2020pub const ERROR_BG: Color32 = Color32::from_rgb(253, 237, 237);
21삭제: pub const FOLDER: Color32 = Color32::from_rgb(224, 165, 38);
21추가: pub const FOLDER: Color32 = Color32::from_rgb(240, 160, 0);
2222pub const FILE: Color32 = Color32::from_rgb(123, 135, 148);
2323pub const SPACE: f32 = 8.0;
2424pub const PAD: i8 = 16;
@@ -27,7 +27,7 @@ pub const DROP_HEIGHT: f32 = 280.0;
2727pub const DROP_RADIUS: u8 = 12;
2828pub const ROW: f32 = 32.0;
2929pub const BUTTON: f32 = 40.0;
30삭제: pub const BODY: f32 = 15.0;
30추가: pub const BODY: f32 = 17.0;
3131pub const TITLE: f32 = 22.0;
3232
3333pub fn apply(ctx: &egui::Context) {
@@ -199,6 +199,37 @@ pub fn icon(ui: &mut egui::Ui, kind: Icon, size: f32) {
199199 }
200200}
201201
202추가: pub fn bounded_text(ui: &mut egui::Ui, text: &str, width: f32) -> egui::Response {
203추가: let width = width.max(0.0);
204추가: ui.allocate_ui_with_layout(
205추가: egui::vec2(width, ui.text_style_height(&TextStyle::Body)),
206추가: ui.layout().clone(),
207추가: |ui| {
208추가: ui.set_min_width(width);
209추가: ui.set_max_width(width);
210추가: ui.add(egui::Label::new(text).truncate())
211추가: },
212추가: )
213추가: .inner
214추가: .on_hover_text(text)
215추가: }
216추가:
217추가: pub fn window_title(ui: &egui::Ui, text: &str, width: f32) -> String {
218추가: let mut job =
219추가: egui::text::LayoutJob::simple_singleline(text.into(), FontId::proportional(BODY), TEXT);
220추가: job.wrap = egui::text::TextWrapping {
221추가: max_width: width.max(0.0),
222추가: max_rows: 1,
223추가: break_anywhere: true,
224추가: ..Default::default()
225추가: };
226추가: ui.fonts_mut(|fonts| fonts.layout_job(job))
227추가: .rows
228추가: .iter()
229추가: .flat_map(|row| row.glyphs.iter().map(|glyph| glyph.chr))
230추가: .collect()
231추가: }
232추가:
202233pub fn column_label(
203234 ui: &mut egui::Ui,
204235 text: impl Into<egui::WidgetText>,
@@ -279,3 +310,93 @@ pub fn indeterminate(ui: &mut egui::Ui) {
279310 )
280311 });
281312}
313추가:
314추가: pub const OPEN: &str = include_str!("assets/icons/open-archive.svg");
315추가: pub const CREATE: &str = include_str!("assets/icons/create-zip.svg");
316추가: pub const EXTRACT: &str = include_str!("assets/icons/extract-archive.svg");
317추가: pub const UP: &str = include_str!("assets/icons/navigate-up.svg");
318추가: pub const CLOSE: &str = include_str!("assets/icons/close-dialog.svg");
319추가:
320추가: pub fn svg_icon(painter: &egui::Painter, rect: egui::Rect, asset: &str, color: Color32) {
321추가: for element in asset.split("points=\"").skip(1) {
322추가: let points = element
323추가: .split('"')
324추가: .next()
325추가: .unwrap_or_default()
326추가: .split_whitespace()
327추가: .filter_map(|pair| {
328추가: let (x, y) = pair.split_once(',')?;
329추가: Some(
330추가: rect.min
331추가: + egui::vec2(x.parse::<f32>().ok()?, y.parse::<f32>().ok()?)
332추가: * (rect.width() / 24.0),
333추가: )
334추가: })
335추가: .collect::<Vec<_>>();
336추가: painter.add(egui::Shape::line(
337추가: points,
338추가: Stroke::new(rect.width() / 18.0, color),
339추가: ));
340추가: }
341추가: }
342추가:
343추가: pub fn tool(
344추가: ui: &mut egui::Ui,
345추가: label: &str,
346추가: asset: &str,
347추가: enabled: bool,
348추가: blue: bool,
349추가: ) -> egui::Response {
350추가: let response = ui.add_enabled(
351추가: enabled,
352추가: egui::Button::new(
353추가: egui::RichText::new(label)
354추가: .size(18.0)
355추가: .color(Color32::TRANSPARENT),
356추가: )
357추가: .frame(false)
358추가: .min_size(egui::vec2(108.0, 86.0)),
359추가: );
360추가: let rect = response.rect;
361추가: let color = if enabled {
362추가: if blue { BLUE } else { TEXT }
363추가: } else {
364추가: MUTED
365추가: };
366추가: let icon_rect = egui::Rect::from_center_size(
367추가: egui::pos2(rect.center().x, rect.top() + 27.0),
368추가: egui::vec2(36.0, 36.0),
369추가: );
370추가: ui.painter()
371추가: .rect_filled(rect.shrink2(egui::vec2(1.0, 27.0)), 0, PANEL);
372추가: svg_icon(ui.painter(), icon_rect, asset, color);
373추가: ui.painter().text(
374추가: egui::pos2(rect.center().x, rect.bottom() - 15.0),
375추가: egui::Align2::CENTER_CENTER,
376추가: label,
377추가: FontId::proportional(18.0),
378추가: color,
379추가: );
380추가: focus(&response);
381추가: response
382추가: }
383추가:
384추가: pub const SEARCH: &str = include_str!("assets/icons/search-files.svg");
385추가:
386추가: pub fn icon_button(ui: &mut egui::Ui, name: &str, asset: &str, enabled: bool) -> egui::Response {
387추가: let response = ui
388추가: .add_enabled(
389추가: enabled,
390추가: egui::Button::new("").min_size(egui::vec2(38.0, 36.0)),
391추가: )
392추가: .on_hover_text(name);
393추가: response.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, enabled, name));
394추가: svg_icon(
395추가: ui.painter(),
396추가: egui::Rect::from_center_size(response.rect.center(), egui::vec2(22.0, 22.0)),
397추가: asset,
398추가: if enabled { TEXT } else { MUTED },
399추가: );
400추가: focus(&response);
401추가: response
402추가: }
추가experiments/rust-ui-memory-app/src/assets/icons/close-dialog.svg+1-0
@@ -0,0 +1 @@
1추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="4,4 20,20"/><polyline points="20,4 4,20"/></svg>
추가experiments/rust-ui-memory-app/src/assets/icons/create-zip.svg+1-0
@@ -0,0 +1 @@
1추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="14,3 5,3 5,21 16,21"/><polyline points="14,3 20,9 14,9 14,3"/><polyline points="20,14 20,22"/><polyline points="16,18 24,18"/></svg>
추가experiments/rust-ui-memory-app/src/assets/icons/extract-archive.svg+1-0
@@ -0,0 +1 @@
1추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="12,2 12,16"/><polyline points="6,10 12,16 18,10"/><polyline points="3,16 3,22 21,22 21,16"/></svg>
추가experiments/rust-ui-memory-app/src/assets/icons/navigate-up.svg+1-0
@@ -0,0 +1 @@
1추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="5,10 12,3 19,10"/><polyline points="12,3 12,22"/></svg>
추가experiments/rust-ui-memory-app/src/assets/icons/open-archive.svg+1-0
@@ -0,0 +1 @@
1추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="3,8 3,4 10,4 13,7 21,7 19,20 3,20 3,8 21,8"/></svg>
추가experiments/rust-ui-memory-app/src/assets/icons/search-files.svg+1-0
@@ -0,0 +1 @@
1추가: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><polyline points="16,16 23,23"/><polyline points="18,10 17,5 13,2 7,2 3,5 2,10 4,15 9,18 14,17 18,13 18,10"/></svg>
수정experiments/rust-ui-memory-app/src/lib.rs+2-1
@@ -14,7 +14,8 @@ pub mod archive_process;
1414
1515pub mod archive_present;
1616
17추가: pub mod archive_browser;
1718#[cfg(feature = "ui")]
18삭제: pub mod archive_picker;
19추가: pub mod archive_dialog;
1920#[cfg(feature = "ui")]
2021pub mod archive_theme;
추가tests/rust-app-real-worker/fixtures/sample.gz

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
수정tests/rust-app-real-worker/flows.rs+63-28
@@ -156,19 +156,28 @@ fn completed(model: &Model) {
156156 );
157157}
158158#[cfg(feature = "ui")]
159추가: #[path = "../rust-app-ui/dialogs.rs"]
160추가: mod dialogs;
161추가: #[cfg(feature = "ui")]
159162mod screen {
163추가: use super::dialogs::TestDialogs;
160164 use super::*;
161165 use eframe::egui::{self, epaint::Shape};
162166 use zipelo_ui_memory_app::archive_screen::ArchiveApp;
163167 struct Screen {
164168 context: egui::Context,
165169 app: ArchiveApp,
170추가: dialogs: TestDialogs,
166171 }
167172 impl Screen {
168173 fn new(factory: ObservedFactory) -> Self {
174추가: let dialogs = TestDialogs::default();
175추가: let mut app = ArchiveApp::new(Box::new(factory), None, false);
176추가: app.set_dialogs(Box::new(dialogs.clone()));
169177 Self {
170178 context: egui::Context::default(),
171삭제: app: ArchiveApp::new(Box::new(factory), None, false),
179추가: app,
180추가: dialogs,
172181 }
173182 }
174183 fn render(&mut self, events: Vec<egui::Event>) -> Vec<(String, egui::Pos2)> {
@@ -235,6 +244,10 @@ mod screen {
235244 self.click_at(point);
236245 }
237246 fn set_text(&mut self, id: &str, value: &str) {
247추가: if id == "zip-name" {
248추가: self.dialogs.0.borrow_mut().save_name = Some(value.to_owned());
249추가: return;
250추가: }
238251 self.render(vec![]);
239252 let point = self
240253 .context
@@ -281,7 +294,12 @@ mod screen {
281294 }
282295 fn extract(&mut self, destination: &Path) {
283296 self.app.choose_destination(destination.to_path_buf());
284삭제: self.click("풀기");
297추가: self.dialogs
298추가: .0
299추가: .borrow_mut()
300추가: .answers
301추가: .push_back(Some(vec![destination.to_path_buf()]));
302추가: self.click("압축해제");
285303 assert!(self.app.model.busy());
286304 self.settle();
287305 assert_eq!(
@@ -292,6 +310,7 @@ mod screen {
292310 }
293311 include!("password_flows.rs");
294312 include!("selection_flows.rs");
313추가: include!("native_dialog_flows.rs");
295314
296315 fn archive_flow(name: &str, format: Format) {
297316 let scratch = Scratch::new();
@@ -368,7 +387,7 @@ mod screen {
368387 let mut screen = Screen::new(factory);
369388 screen.app.add_sources(vec![source]);
370389 screen.render(vec![]);
371삭제: screen.click("만들기");
390추가: screen.click("압축하기");
372391 screen.settle();
373392 assert!(archive.is_file());
374393 screen.open(&archive);
@@ -411,7 +430,7 @@ mod screen {
411430 screen.app.add_sources(vec![source.clone()]);
412431 screen.render(vec![]);
413432 screen.set_text("zip-name", archive.file_name().unwrap().to_str().unwrap());
414삭제: screen.click("만들기");
433추가: screen.click("압축하기");
415434 assert!(screen.app.model.busy());
416435 screen.settle();
417436 assert!(archive.is_file());
@@ -449,12 +468,16 @@ fn broken_or_incomplete_worker_output_is_not_success() {
449468 fs::copy(binary("zipelo-real-worker-probe"), &probe).unwrap();
450469 let mut factory = ProcessFactory::new(probe);
451470 let mut model = Model::default();
452삭제: assert!(model.begin(
453삭제: Start::List {
454삭제: archive: scratch.path("sample.zip")
455삭제: },
456삭제: &mut factory
457삭제: ));
471추가: assert!(
472추가: model.begin(
473추가: Start::List {
474추가: archive: scratch.path("sample.zip")
475추가: },
476추가: &mut factory
477추가: ),
478추가: "{:?}",
479추가: model.error
480추가: );
458481 model.request_close();
459482 model.confirm_close();
460483 assert_eq!(model.close, Close::Waiting);
@@ -474,12 +497,16 @@ fn dropping_live_connection_kills_and_reaps_owned_child() {
474497 fs::copy(binary("zipelo-real-worker-probe"), &probe).unwrap();
475498 let mut factory = ProcessFactory::new(probe);
476499 let mut model = Model::default();
477삭제: assert!(model.begin(
478삭제: Start::List {
479삭제: archive: scratch.path("sample.zip")
480삭제: },
481삭제: &mut factory
482삭제: ));
500추가: assert!(
501추가: model.begin(
502추가: Start::List {
503추가: archive: scratch.path("sample.zip")
504추가: },
505추가: &mut factory
506추가: ),
507추가: "{:?}",
508추가: model.error
509추가: );
483510 let deadline = Instant::now() + Duration::from_secs(5);
484511 while !scratch.path("probe.pid").exists() {
485512 assert!(Instant::now() < deadline);
@@ -615,12 +642,16 @@ fn cancel_racing_child_exit_preserves_completed_result_before_poll() {
615642 for iteration in 0..100 {
616643 let mut factory = CompletedFactory(ProcessFactory::new(binary("zipelo-archive-worker")));
617644 let mut model = Model::default();
618삭제: assert!(model.begin(
619삭제: Start::List {
620삭제: archive: archive.clone()
621삭제: },
622삭제: &mut factory
623삭제: ));
645추가: assert!(
646추가: model.begin(
647추가: Start::List {
648추가: archive: archive.clone()
649추가: },
650추가: &mut factory
651추가: ),
652추가: "{:?}",
653추가: model.error
654추가: );
624655 assert!(model.terminal.is_none());
625656 model.cancel();
626657 wait(&mut model);
@@ -637,12 +668,16 @@ fn cancel_racing_exit_without_terminal_remains_unconfirmed() {
637668 fs::copy(binary("zipelo-real-worker-probe"), &probe).unwrap();
638669 let mut factory = ProcessFactory::new(probe);
639670 let mut model = Model::default();
640삭제: assert!(model.begin(
641삭제: Start::List {
642삭제: archive: scratch.path("sample.zip")
643삭제: },
644삭제: &mut factory
645삭제: ));
671추가: assert!(
672추가: model.begin(
673추가: Start::List {
674추가: archive: scratch.path("sample.zip")
675추가: },
676추가: &mut factory
677추가: ),
678추가: "{:?}",
679추가: model.error
680추가: );
646681 std::thread::sleep(Duration::from_millis(2));
647682 model.cancel();
648683 model.request_close();
추가tests/rust-app-real-worker/native_dialog_flows.rs+86-0
@@ -0,0 +1,86 @@
1추가: fn native_fixture(scratch: &Scratch, fixture: &str, name: &str) -> PathBuf {
2추가: let target = scratch.path(name);
3추가: fs::copy(
4추가: Path::new(env!("CARGO_MANIFEST_DIR"))
5추가: .join("../../tests/rust-app-real-worker/fixtures")
6추가: .join(fixture),
7추가: &target,
8추가: ).unwrap();
9추가: target
10추가: }
11추가:
12추가: #[test]
13추가: fn raw_gzip_save_dialog_corrects_names_and_preserves_cancel_and_conflict_retry() {
14추가: use zipelo_ui_memory_app::archive_dialog::Purpose;
15추가: let mut names = vec![".gz", "report.GZ", "report.Gz", "report.gz"];
16추가: #[cfg(unix)]
17추가: names.push("report:2026.gz");
18추가: for name in names {
19추가: let scratch = Scratch::new();
20추가: let archive = native_fixture(&scratch, "sample.gz", name);
21추가: let original = fs::read(&archive).unwrap();
22추가: let output = make_directory(&scratch.path("output"));
23추가: let (factory, observed) = observed_factory();
24추가: let mut screen = Screen::new(factory);
25추가: screen.open(&archive);
26추가: assert_eq!(screen.app.model.list_id.as_ref().unwrap().format, Format::Gzip);
27추가: screen.click("압축해제");
28추가: assert!(!screen.app.model.busy());
29추가: assert_eq!(observed.borrow().jobs.len(), 1);
30추가: let request = screen.dialogs.0.borrow().requests.last().unwrap().clone();
31추가: assert_eq!(request.purpose, Purpose::SaveGzip);
32추가: assert_eq!(request.directory, scratch.0);
33추가: assert_eq!(request.file_name, if name == ".gz" || name.contains(':') { "압축 해제 파일" } else { "report" });
34추가: let existing = output.join("기존 파일.txt");
35추가: fs::write(&existing, b"preserve").unwrap();
36추가: screen.dialogs.0.borrow_mut().answers.push_back(Some(vec![existing.clone()]));
37추가: screen.click("압축해제");
38추가: let deadline = Instant::now() + Duration::from_secs(10);
39추가: while screen.app.model.busy() {
40추가: screen.render(vec![]);
41추가: assert!(Instant::now() < deadline);
42추가: std::thread::sleep(Duration::from_millis(2));
43추가: }
44추가: assert_eq!(screen.app.model.terminal.as_ref().unwrap().error, Some(ErrorCode::Conflict));
45추가: assert_eq!(fs::read(&existing).unwrap(), b"preserve");
46추가: screen.click("다른 이름으로 저장");
47추가: assert!(!screen.app.model.busy());
48추가: assert_eq!(observed.borrow().jobs.len(), 2);
49추가: assert_eq!(screen.dialogs.0.borrow().requests.last().unwrap().purpose, Purpose::RetryGzip);
50추가: let saved = output.join("사용자 이름.txt");
51추가: screen.dialogs.0.borrow_mut().answers.push_back(Some(vec![saved.clone()]));
52추가: screen.click("다른 이름으로 저장");
53추가: screen.settle();
54추가: assert_eq!(fs::read(saved).unwrap(), b"Zipelo real worker flow\n");
55추가: assert_eq!(fs::read(existing).unwrap(), b"preserve");
56추가: assert_eq!(fs::read(&archive).unwrap(), original);
57추가: assert!(matches!(
58추가: observed.borrow().starts.last(),
59추가: Some(Start::Extract { destination, gzip_output_name: Some(name), .. })
60추가: if destination == &output && name == "사용자 이름.txt"
61추가: ));
62추가: assert_reaped(&observed);
63추가: }
64추가: }
65추가:
66추가: #[test]
67추가: fn mixed_case_zip_names_open_and_extract_through_native_dialog_responses() {
68추가: use zipelo_ui_memory_app::archive_dialog::Purpose;
69추가: for name in ["sample.ZIP", "sample.Zip", "sample.zIp"] {
70추가: let scratch = Scratch::new();
71추가: let archive = native_fixture(&scratch, "sample.zip", name);
72추가: let original = fs::read(&archive).unwrap();
73추가: let output = make_directory(&scratch.path("output"));
74추가: let (factory, observed) = observed_factory();
75추가: let mut screen = Screen::new(factory);
76추가: screen.dialogs.0.borrow_mut().answers.push_back(Some(vec![archive.clone()]));
77추가: screen.click("열기");
78추가: screen.settle();
79추가: assert_eq!(screen.dialogs.0.borrow().requests[0].purpose, Purpose::Open);
80추가: assert_eq!(screen.app.model.list_id.as_ref().unwrap().format, Format::Zip);
81추가: screen.extract(&output);
82추가: assert_eq!(fs::read(output.join("content.txt")).unwrap(), b"Zipelo real worker flow\n");
83추가: assert_eq!(fs::read(archive).unwrap(), original);
84추가: assert_reaped(&observed);
85추가: }
86추가: }
수정tests/rust-app-real-worker/password_flows.rs+25-5
@@ -48,14 +48,24 @@ impl Screen {
4848 if !text.is_empty() {
4949 assert!(!rendered.iter().any(|(value, _)| value.contains(text)));
5050 }
51삭제: if self.app.model.challenge.is_some_and(|(_, _, encrypt)| encrypt) {
51추가: if self
52추가: .app
53추가: .model
54추가: .challenge
55추가: .is_some_and(|(_, _, encrypt)| encrypt)
56추가: {
5257 self.set_text("archive-password-confirm", text);
5358 }
5459 self.click("확인");
5560 }
5661 fn start_password_extract(&mut self, output: &Path) {
5762 self.app.choose_destination(output.to_path_buf());
58삭제: self.click("풀기");
63추가: self.dialogs
64추가: .0
65추가: .borrow_mut()
66추가: .answers
67추가: .push_back(Some(vec![output.to_path_buf()]));
68추가: self.click("압축해제");
5969 assert!(self.app.model.busy());
6070 }
6171 fn finish_password_job(&mut self, expected: Outcome) {
@@ -74,7 +84,7 @@ impl Screen {
7484 self.render(vec![]);
7585 self.set_text("zip-name", archive.file_name().unwrap().to_str().unwrap());
7686 self.click("암호로 보호하기");
77삭제: self.click("만들기");
87추가: self.click("압축하기");
7888 assert!(self.app.model.busy(), "{}", self.app.model.status());
7989 }
8090}
@@ -245,7 +255,12 @@ fn oversized_utf8_password_stays_in_dialog_then_accepts_valid_input() {
245255 let id = screen.password_request(1, false);
246256 screen.password_answer(&"가".repeat(342));
247257 assert_eq!(screen.app.model.challenge, Some((id, 1, false)));
248삭제: assert!(screen.render(vec![]).iter().any(|(text, _)| text.contains("1~1024바이트")));
258추가: assert!(
259추가: screen
260추가: .render(vec![])
261추가: .iter()
262추가: .any(|(text, _)| text.contains("1~1024바이트"))
263추가: );
249264 assert_eq!(fs::read_dir(&output).unwrap().count(), 0);
250265 screen.password_answer(FIXTURE_PASSWORD);
251266 screen.finish_password_job(Outcome::Completed);
@@ -266,7 +281,12 @@ fn invalid_password_then_cancel(invalid: &str, close: bool) {
266281 if invalid.is_empty() {
267282 assert!(screen.app.model.input_error.is_none());
268283 } else {
269삭제: assert!(screen.render(vec![]).iter().any(|(text, _)| text.contains("1~1024바이트")));
284추가: assert!(
285추가: screen
286추가: .render(vec![])
287추가: .iter()
288추가: .any(|(text, _)| text.contains("1~1024바이트"))
289추가: );
270290 }
271291 if close {
272292 screen.app.model.request_close();
수정tests/rust-app-real-worker/selection_flows.rs+19-7
@@ -36,7 +36,7 @@ fn extraction_completion_matches_actual_worker_selection_matrix() {
3636 screen.app.add_sources(vec![docs, root_file]);
3737 screen.render(vec![]);
3838 screen.set_text("zip-name", "selection.zip");
39삭제: screen.click("만들기");
39추가: screen.click("압축하기");
4040 screen.settle();
4141
4242 let cases: [(&str, Option<&[&str]>, &[&str]); 6] = [
@@ -56,17 +56,21 @@ fn extraction_completion_matches_actual_worker_selection_matrix() {
5656 Some(&["docs/nested/one.txt", "root.txt"]),
5757 &["docs", "docs/nested", "docs/nested/one.txt", "root.txt"],
5858 ),
59삭제: ("directory", Some(&["docs"]), &["docs"]),
59추가: (
60추가: "directory",
61추가: Some(&["docs"]),
62추가: &["docs", "docs/empty", "docs/nested", "docs/nested/one.txt"],
63추가: ),
6064 (
6165 "mixed",
6266 Some(&["docs", "docs/nested/one.txt"]),
63삭제: &["docs", "docs/nested", "docs/nested/one.txt"],
67추가: &["docs", "docs/empty", "docs/nested", "docs/nested/one.txt"],
6468 ),
6569 ("empty", Some(&["docs/empty"]), &["docs", "docs/empty"]),
6670 (
6771 "nested-directory",
6872 Some(&["docs/nested"]),
69삭제: &["docs", "docs/nested"],
73추가: &["docs", "docs/nested", "docs/nested/one.txt"],
7074 ),
7175 ];
7276 for (name, selected, expected) in cases {
@@ -88,7 +92,6 @@ fn extraction_completion_matches_actual_worker_selection_matrix() {
8892 });
8993 if let Some(ids) = &ids {
9094 screen.app.model.selected = ids.clone();
91삭제: screen.click("선택한 항목만 풀기");
9295 }
9396 let output = make_directory(&scratch.path(name));
9497 screen.extract(&output);
@@ -125,7 +128,16 @@ fn extraction_completion_matches_actual_worker_selection_matrix() {
125128 Start::Extract { selection, .. } => match (selection, &ids) {
126129 (Selection::All, None) => {}
127130 (Selection::EntryIds(actual), Some(ids)) => {
128삭제: assert_eq!(actual, &ids.iter().copied().collect::<Vec<_>>(), "{name}");
131추가: assert_eq!(
132추가: actual,
133추가: &zipelo_ui_memory_app::archive_browser::expand_selection(
134추가: &screen.app.model.entries,
135추가: ids
136추가: )
137추가: .into_iter()
138추가: .collect::<Vec<_>>(),
139추가: "{name}"
140추가: );
129141 }
130142 _ => panic!("요청 선택 범위 불일치: {name}"),
131143 },
@@ -193,7 +205,7 @@ fn auto_destination_is_private_under_desktop_umask() {
193205 let (factory, observed) = observed_factory();
194206 let mut screen = Screen::new(factory);
195207 screen.open(&archive);
196삭제: screen.click("풀기");
208추가: assert!(screen.app.begin_extract());
197209 assert!(screen.app.model.busy());
198210 screen.settle();
199211 assert_eq!(
수정tests/rust-app-ui/capture.rs+111-2
@@ -112,6 +112,61 @@ fn entries() -> Vec<Entry> {
112112 },
113113 ]
114114}
115추가: fn toolbar_entries() -> Vec<Entry> {
116추가: let mut entries = vec![
117추가: Entry {
118추가: id: 0,
119추가: name: "Install".into(),
120추가: kind: Kind::Directory,
121추가: bytes: Some(0),
122추가: packed: None,
123추가: encrypted: false,
124추가: },
125추가: Entry {
126추가: id: 1,
127추가: name: "Install.exe".into(),
128추가: kind: Kind::File,
129추가: bytes: Some(234_906),
130추가: packed: None,
131추가: encrypted: false,
132추가: },
133추가: ];
134추가: for (index, name) in [
135추가: "cab1.cab",
136추가: "cab10.cab",
137추가: "cab11.cab",
138추가: "cab12.cab",
139추가: "cab2.cab",
140추가: "cab3.cab",
141추가: "cab4.cab",
142추가: "cab5.cab",
143추가: ]
144추가: .iter()
145추가: .enumerate()
146추가: {
147추가: entries.push(Entry {
148추가: id: index as u32 + 2,
149추가: name: format!("Install/{name}"),
150추가: kind: Kind::File,
151추가: bytes: Some(
152추가: [
153추가: 99_510_272,
154추가: 77_909_197,
155추가: 102_236_160,
156추가: 67_842_867,
157추가: 103_389_594,
158추가: 59_454_669,
159추가: 78_014_054,
160추가: 81_159_782,
161추가: ][index],
162추가: ),
163추가: packed: None,
164추가: encrypted: false,
165추가: });
166추가: }
167추가: entries
168추가: }
169추가:
115170impl Factory for CaptureFactory {
116171 fn connect(&mut self, job: u64) -> Result<Box<dyn Connection>, String> {
117172 Ok(Box::new(CaptureConnection {
@@ -130,11 +185,17 @@ impl Connection for CaptureConnection {
130185 self.event(Event::Accepted { encryption: true });
131186 match start {
132187 Start::List { .. } => {
133삭제: for entry in entries() {
188추가: let entries = if self.mode.starts_with("toolbar-") {
189추가: toolbar_entries()
190추가: } else {
191추가: entries()
192추가: };
193추가: let count = entries.len() as u32;
194추가: for entry in entries {
134195 self.event(Event::Entry(entry));
135196 }
136197 self.event(Event::ListEnd {
137삭제: entry_count: 3,
198추가: entry_count: count,
138199 list_id: ListId {
139200 catalog_version: 1,
140201 format: Format::Zip,
@@ -228,6 +289,54 @@ impl eframe::App for Capture {
228289 }
229290 if !self.triggered && self.app.model.list_id.is_some() {
230291 self.triggered = true;
292추가: if self.mode.starts_with("long-") {
293추가: let name = format!("{}.txt", "W".repeat(220));
294추가: let folder = "deep-folder/".repeat(30);
295추가: let base = std::env::current_dir()
296추가: .unwrap()
297추가: .join("tests/ui-redesign/runs/fixtures");
298추가: self.app.model.archive = Some(base.join(&folder).join(format!("{name}.zip")));
299추가: if self.mode == "long-list" || self.mode == "long-folder" {
300추가: self.app.model.entries = (0..5000)
301추가: .map(|id| Entry {
302추가: id,
303추가: name: format!(
304추가: "{}{id:04}-{name}",
305추가: if self.mode == "long-folder" {
306추가: folder.as_str()
307추가: } else {
308추가: ""
309추가: }
310추가: ),
311추가: kind: Kind::File,
312추가: bytes: Some(31),
313추가: packed: None,
314추가: encrypted: true,
315추가: })
316추가: .collect();
317추가: if self.mode == "long-folder" {
318추가: self.app.browse_folder(folder.trim_end_matches('/'));
319추가: }
320추가: }
321추가: if self.mode == "long-create" {
322추가: let source = base.join(&name);
323추가: std::fs::write(&source, b"capture source").unwrap();
324추가: self.app.add_sources(vec![source]);
325추가: self.app.show_create(false);
326추가: }
327추가: if self.mode == "long-result" {
328추가: let destination = base.join(&folder);
329추가: std::fs::create_dir_all(&destination).unwrap();
330추가: self.app.choose_destination(destination);
331추가: self.app.begin_extract();
332추가: }
333추가: }
334추가: if self.mode == "toolbar-folder" {
335추가: self.app.browse_folder("Install");
336추가: }
337추가: if self.mode == "toolbar-create" {
338추가: self.app.show_create(false);
339추가: }
231340 if [
232341 "password",
233342 "password-retry",
추가tests/rust-app-ui/dialogs.rs+32-0
@@ -0,0 +1,32 @@
1추가: use std::{cell::RefCell, collections::VecDeque, path::PathBuf, rc::Rc};
2추가: use zipelo_ui_memory_app::archive_dialog::{DialogRequest, Dialogs, Purpose};
3추가:
4추가: #[derive(Default)]
5추가: pub struct DialogState {
6추가: pub requests: Vec<DialogRequest>,
7추가: pub answers: VecDeque<Option<Vec<PathBuf>>>,
8추가: pub save_name: Option<String>,
9추가: pub cancel_save: bool,
10추가: pub error: Option<String>,
11추가: }
12추가:
13추가: #[derive(Clone, Default)]
14추가: pub struct TestDialogs(pub Rc<RefCell<DialogState>>);
15추가:
16추가: impl Dialogs for TestDialogs {
17추가: fn choose(&mut self, request: DialogRequest) -> Result<Option<Vec<PathBuf>>, String> {
18추가: let mut state = self.0.borrow_mut();
19추가: state.requests.push(request.clone());
20추가: if let Some(error) = &state.error {
21추가: return Err(error.clone());
22추가: }
23추가: if let Some(answer) = state.answers.pop_front() {
24추가: return Ok(answer);
25추가: }
26추가: if request.purpose == Purpose::SaveZip && !state.cancel_save {
27추가: let name = state.save_name.take().unwrap_or(request.file_name);
28추가: return Ok(Some(vec![request.directory.join(name)]));
29추가: }
30추가: Ok(None)
31추가: }
32추가: }
추가tests/rust-app-ui/long_layout.rs+211-0
@@ -0,0 +1,211 @@
1추가: fn narrow_frame(
2추가: ctx: &egui::Context,
3추가: app: &mut ArchiveApp,
4추가: time: f64,
5추가: events: Vec<egui::Event>,
6추가: ) -> egui::FullOutput {
7추가: let mut output = ctx.run_ui(
8추가: egui::RawInput {
9추가: screen_rect: Some(egui::Rect::from_min_size(
10추가: egui::Pos2::ZERO,
11추가: egui::vec2(760.0, 540.0),
12추가: )),
13추가: time: Some(time),
14추가: events,
15추가: ..Default::default()
16추가: },
17추가: |ui| app.show(ui),
18추가: );
19추가: output.textures_delta.clear();
20추가: output
21추가: }
22추가:
23추가: fn layout_text(output: &egui::FullOutput) -> Vec<(String, egui::Rect, bool)> {
24추가: fn walk(shape: &Shape, result: &mut Vec<(String, egui::Rect, bool)>) {
25추가: match shape {
26추가: Shape::Text(text) => result.push((
27추가: text.galley.job.text.clone(),
28추가: text.galley.rect.translate(text.pos.to_vec2()),
29추가: text.galley.elided,
30추가: )),
31추가: Shape::Vec(shapes) => {
32추가: for shape in shapes {
33추가: walk(shape, result);
34추가: }
35추가: }
36추가: _ => {}
37추가: }
38추가: }
39추가: let mut result = Vec::new();
40추가: for shape in &output.shapes {
41추가: walk(&shape.shape, &mut result);
42추가: }
43추가: result
44추가: }
45추가:
46추가: fn assert_narrow_text(output: &egui::FullOutput) {
47추가: for (text, rect, _) in layout_text(output) {
48추가: assert!(
49추가: rect.left() >= -1.0 && rect.right() <= 761.0,
50추가: "{text:?}: {rect:?}"
51추가: );
52추가: }
53추가: }
54추가:
55추가: fn assert_full_tooltip(ctx: &egui::Context, app: &mut ArchiveApp, point: egui::Pos2, full: &str) {
56추가: ctx.style_mut_of(egui::Theme::Light, |style| {
57추가: style.interaction.tooltip_delay = 0.0
58추가: });
59추가: let mut output = narrow_frame(ctx, app, 10.0, vec![egui::Event::PointerMoved(point)]);
60추가: for time in [11.0, 12.0, 13.0] {
61추가: output = narrow_frame(ctx, app, time, vec![]);
62추가: }
63추가: assert!(
64추가: layout_text(&output)
65추가: .iter()
66추가: .any(|(text, _, elided)| text == full && !elided),
67추가: "전체 툴팁 없음: {full} point={point:?} shown={:?}",
68추가: layout_text(&output)
69추가: );
70추가: assert_narrow_text(&output);
71추가: }
72추가:
73추가: #[test]
74추가: fn narrow_archive_keeps_columns_and_virtualizes_thousands_of_long_names() {
75추가: let scratch = Folder::new();
76추가: let factory = FakeFactory::default();
77추가: let mut app = loaded(&scratch, &factory);
78추가: let name = format!("{}.txt", "W".repeat(220));
79추가: app.model.entries = (0..5000)
80추가: .map(|id| Entry {
81추가: id,
82추가: name: format!("{id:04}-{name}"),
83추가: kind: Kind::File,
84추가: bytes: Some(31),
85추가: packed: None,
86추가: encrypted: true,
87추가: })
88추가: .collect();
89추가: app.model.selected = (0..5000).collect();
90추가: app.model.archive = Some(
91추가: scratch
92추가: .0
93추가: .join("deep-folder/".repeat(30))
94추가: .join(format!("{name}.zip")),
95추가: );
96추가: let full_title = format!("{} — Zipelo", app.model.archive.as_ref().unwrap().display());
97추가: let ctx = egui::Context::default();
98추가: narrow_frame(&ctx, &mut app, 0.0, vec![]);
99추가: let output = narrow_frame(&ctx, &mut app, 1.0, vec![]);
100추가: assert_narrow_text(&output);
101추가: let text = layout_text(&output);
102추가: assert!(text.len() < 100);
103추가: let first = text
104추가: .iter()
105추가: .find(|(text, _, _)| text == &format!("0000-{name}"))
106추가: .unwrap();
107추가: assert!(first.2);
108추가: assert!(
109추가: text.iter()
110추가: .any(|(text, rect, _)| text == "31 B" && rect.right() < 720.0)
111추가: );
112추가: for expected in ["크기", "암호", "5000개 항목", "선택 5000개"] {
113추가: assert!(text.iter().any(|(text, _, _)| text == expected));
114추가: }
115추가: let title = output
116추가: .viewport_output
117추가: .values()
118추가: .flat_map(|v| &v.commands)
119추가: .find_map(|cmd| match cmd {
120추가: egui::ViewportCommand::Title(title) => Some(title),
121추가: _ => None,
122추가: })
123추가: .unwrap();
124추가: assert!(title.contains('…') && title.ends_with(" — Zipelo"));
125추가: assert!(title.chars().count() < full_title.chars().count());
126추가: assert_full_tooltip(&ctx, &mut app, first.1.center(), &first.0);
127추가: let output = narrow_frame(&ctx, &mut app, 14.0, vec![egui::Event::PointerGone]);
128추가: let point = layout_text(&output)
129추가: .into_iter()
130추가: .find(|(text, _, _)| text == "열기")
131추가: .unwrap()
132추가: .1
133추가: .center();
134추가: assert_full_tooltip(&ctx, &mut app, point, &full_title);
135추가: }
136추가:
137추가: #[test]
138추가: fn narrow_deep_folder_path_is_elided_without_displacing_search() {
139추가: let scratch = Folder::new();
140추가: let factory = FakeFactory::default();
141추가: let mut app = loaded(&scratch, &factory);
142추가: let folder = "deep-folder/".repeat(40).trim_end_matches('/').to_owned();
143추가: app.model.entries[0].name = format!("{folder}/file.txt");
144추가: app.browse_folder(&folder);
145추가: let ctx = egui::Context::default();
146추가: narrow_frame(&ctx, &mut app, 0.0, vec![]);
147추가: let output = narrow_frame(&ctx, &mut app, 1.0, vec![]);
148추가: assert_narrow_text(&output);
149추가: let text = layout_text(&output);
150추가: let full = format!("/{folder}");
151추가: let path = text.iter().find(|(text, _, _)| text == &full).unwrap();
152추가: assert!(path.2);
153추가: assert!(
154추가: text.iter()
155추가: .any(|(text, rect, _)| text == "파일 찾기" && rect.right() < 760.0)
156추가: );
157추가: assert_full_tooltip(&ctx, &mut app, path.1.center(), &full);
158추가: }
159추가:
160추가: #[test]
161추가: fn narrow_create_sources_keep_remove_and_footer_actions_visible() {
162추가: let scratch = Folder::new();
163추가: let factory = FakeFactory::default();
164추가: let mut app = loaded(&scratch, &factory);
165추가: let name = format!("{}.txt", "W".repeat(220));
166추가: let path = scratch.0.join(&name);
167추가: fs::write(&path, b"source").unwrap();
168추가: app.add_sources(vec![path]);
169추가: app.show_create(false);
170추가: let ctx = egui::Context::default();
171추가: narrow_frame(&ctx, &mut app, 0.0, vec![]);
172추가: let output = narrow_frame(&ctx, &mut app, 1.0, vec![]);
173추가: assert_narrow_text(&output);
174추가: let text = layout_text(&output);
175추가: assert!(
176추가: text.iter()
177추가: .any(|(text, _, elided)| text == &name && *elided)
178추가: );
179추가: for expected in ["빼기", "취소", "압축하기"] {
180추가: assert!(
181추가: text.iter()
182추가: .any(|(text, rect, _)| text == expected && rect.bottom() <= 540.0)
183추가: );
184추가: }
185추가: }
186추가:
187추가: #[test]
188추가: fn narrow_result_path_is_elided_and_full_path_remains_in_tooltip() {
189추가: let scratch = Folder::new();
190추가: let factory = FakeFactory::default();
191추가: let mut app = loaded(&scratch, &factory);
192추가: let output_path = scratch.0.join("nested-output/".repeat(30));
193추가: fs::create_dir_all(&output_path).unwrap();
194추가: app.choose_destination(output_path.clone());
195추가: assert!(app.begin_extract());
196추가: pump(&mut app.model);
197추가: let ctx = egui::Context::default();
198추가: for frame in 0..8 {
199추가: narrow_frame(&ctx, &mut app, frame as f64 / 10.0, vec![]);
200추가: }
201추가: let output = narrow_frame(&ctx, &mut app, 1.0, vec![]);
202추가: assert_narrow_text(&output);
203추가: let text = layout_text(&output);
204추가: let full = format!("{} 폴더에 저장했습니다.", output_path.display());
205추가: let path = text.iter().find(|(text, _, _)| text == &full).unwrap();
206추가: assert!(path.2);
207추가: for expected in ["확인", "폴더 열기"] {
208추가: assert!(text.iter().any(|(text, _, _)| text == expected));
209추가: }
210추가: assert_full_tooltip(&ctx, &mut app, path.1.center(), &full);
211추가: }
추가tests/rust-app-ui/native_dialogs.rs+180-0
@@ -0,0 +1,180 @@
1추가: use std::{collections::BTreeSet, path::Path};
2추가: use zipelo_ui_memory_app::{
3추가: archive_dialog::archive_filters,
4추가: archive_present::{gzip_output_name, valid_output_leaf},
5추가: };
6추가:
7추가: #[test]
8추가: fn archive_filter_contains_every_case_variant_and_all_files_option() {
9추가: let filters = archive_filters();
10추가: assert_eq!(filters.len(), 2);
11추가: assert_eq!(filters[0].0, "압축파일");
12추가: let expected = [
13추가: "zip", "ziP", "zIp", "zIP", "Zip", "ZiP", "ZIp", "ZIP", "7z", "7Z", "tar", "taR", "tAr",
14추가: "tAR", "Tar", "TaR", "TAr", "TAR", "gz", "gZ", "Gz", "GZ", "tgz", "tgZ", "tGz", "tGZ",
15추가: "Tgz", "TgZ", "TGz", "TGZ",
16추가: ]
17추가: .into_iter()
18추가: .map(str::to_owned)
19추가: .collect::<BTreeSet<_>>();
20추가: assert_eq!(
21추가: filters[0].1.iter().cloned().collect::<BTreeSet<_>>(),
22추가: expected
23추가: );
24추가: assert_eq!(filters[0].1.len(), expected.len());
25추가: assert_eq!(filters[1], ("모든 파일", vec!["*".to_owned()]));
26추가: }
27추가:
28추가: #[test]
29추가: fn gzip_suggested_names_are_portable_and_preserve_valid_stems() {
30추가: for name in [
31추가: ".gz",
32추가: ".GZ",
33추가: "report:2026.gz",
34추가: "report?2026.gz",
35추가: "CON.gz",
36추가: "COM1.gz",
37추가: "name..gz",
38추가: "name .gz",
39추가: ] {
40추가: assert_eq!(
41추가: gzip_output_name(Path::new(name)),
42추가: "압축 해제 파일",
43추가: "{name}"
44추가: );
45추가: }
46추가: for (name, expected) in [
47추가: ("report.gz", "report"),
48추가: ("report.GZ", "report"),
49추가: ("report.Gz", "report"),
50추가: ("한글.gz", "한글"),
51추가: ("input.archive", "input.archive"),
52추가: ] {
53추가: assert_eq!(gzip_output_name(Path::new(name)), expected);
54추가: }
55추가: for name in [
56추가: "",
57추가: ".",
58추가: "..",
59추가: "../file",
60추가: "dir/file",
61추가: "dir\\file",
62추가: "a:b",
63추가: "a*",
64추가: "a?",
65추가: "a|b",
66추가: "a<b",
67추가: "a>b",
68추가: "a\"b",
69추가: "NUL.txt",
70추가: "name.",
71추가: "name ",
72추가: "control\n",
73추가: ] {
74추가: assert!(!valid_output_leaf(name), "{name:?}");
75추가: }
76추가: assert!(valid_output_leaf("사용자 이름.txt"));
77추가: }
78추가:
79추가: #[cfg(target_os = "linux")]
80추가: #[test]
81추가: fn portal_response_distinguishes_cancellation_from_backend_failure() {
82추가: use ashpd::{Error, PortalError, desktop::ResponseError};
83추가: use zipelo_ui_memory_app::archive_dialog::{DIALOG_UNAVAILABLE, portal_response};
84추가: for error in [
85추가: Error::Response(ResponseError::Cancelled),
86추가: Error::Portal(PortalError::Cancelled("cancelled".into())),
87추가: ] {
88추가: assert_eq!(portal_response(Err(error)), Ok(None));
89추가: }
90추가: for error in [
91추가: Error::Response(ResponseError::Other),
92추가: Error::Portal(PortalError::Failed("failed".into())),
93추가: Error::Portal(PortalError::WindowDestroyed("destroyed".into())),
94추가: Error::NoResponse,
95추가: Error::PortalNotFound("org.freedesktop.portal.FileChooser".try_into().unwrap()),
96추가: Error::IO(std::io::Error::other("backend unavailable")),
97추가: Error::ParseError("invalid URI"),
98추가: ] {
99추가: assert_eq!(portal_response(Err(error)), Err(DIALOG_UNAVAILABLE.into()));
100추가: }
101추가: assert_eq!(portal_response(Ok(vec![])), Err(DIALOG_UNAVAILABLE.into()));
102추가: let path = Path::new("/selected/archive.zip").to_path_buf();
103추가: assert_eq!(
104추가: portal_response(Ok(vec![path.clone()])),
105추가: Ok(Some(vec![path]))
106추가: );
107추가: }
108추가:
109추가: #[cfg(target_os = "linux")]
110추가: #[test]
111추가: fn missing_portal_returns_errors_for_every_dialog() {
112추가: use std::{
113추가: process::{Command, Stdio},
114추가: time::{Duration, Instant},
115추가: };
116추가: use zipelo_ui_memory_app::archive_dialog::{
117추가: DIALOG_UNAVAILABLE, DialogRequest, Dialogs, NativeDialogs, Purpose,
118추가: };
119추가: if std::env::var_os("ZIPELO_NO_PORTAL_CHILD").is_some() {
120추가: let mut dialogs = NativeDialogs;
121추가: for purpose in [
122추가: Purpose::Open,
123추가: Purpose::Files,
124추가: Purpose::Folder,
125추가: Purpose::Destination,
126추가: Purpose::Retry,
127추가: Purpose::SaveZip,
128추가: Purpose::SaveGzip,
129추가: Purpose::RetryGzip,
130추가: ] {
131추가: let result = dialogs.choose(DialogRequest {
132추가: purpose,
133추가: directory: std::env::current_dir().unwrap(),
134추가: file_name: "output.zip".into(),
135추가: });
136추가: assert_eq!(result, Err(DIALOG_UNAVAILABLE.into()), "{purpose:?}");
137추가: }
138추가: return;
139추가: }
140추가: let endpoint = Path::new(env!("CARGO_MANIFEST_DIR")).join(format!(
141추가: "../../tests/rust-app-ui/runs/no-bus-{}",
142추가: std::process::id()
143추가: ));
144추가: assert!(!endpoint.exists());
145추가: let mut child = Command::new(std::env::current_exe().unwrap())
146추가: .args([
147추가: "--exact",
148추가: "native_dialogs::missing_portal_returns_errors_for_every_dialog",
149추가: "--nocapture",
150추가: ])
151추가: .env("ZIPELO_NO_PORTAL_CHILD", "1")
152추가: .env(
153추가: "DBUS_SESSION_BUS_ADDRESS",
154추가: format!("unix:path={}", endpoint.display()),
155추가: )
156추가: .env_remove("DBUS_STARTER_ADDRESS")
157추가: .stdout(Stdio::piped())
158추가: .stderr(Stdio::piped())
159추가: .spawn()
160추가: .unwrap();
161추가: let deadline = Instant::now() + Duration::from_secs(15);
162추가: loop {
163추가: if child.try_wait().unwrap().is_some() {
164추가: break;
165추가: }
166추가: if Instant::now() >= deadline {
167추가: child.kill().unwrap();
168추가: child.wait().unwrap();
169추가: panic!("portal 실패 응답 시간 초과");
170추가: }
171추가: std::thread::sleep(Duration::from_millis(10));
172추가: }
173추가: let output = child.wait_with_output().unwrap();
174추가: assert!(
175추가: output.status.success(),
176추가: "{}{}",
177추가: String::from_utf8_lossy(&output.stdout),
178추가: String::from_utf8_lossy(&output.stderr)
179추가: );
180추가: }
수정tests/rust-app-ui/presentation.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
수정tests/rust-app-ui/regressions.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-app-ui/toolbar.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
수정tests/ui-redesign/README.md

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
수정tests/ui-redesign/capture.py

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
수정tests/ui-redesign/prepare.py

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/ui-redesign/screenshots/long-layout/capture.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/ui-redesign/screenshots/long-layout/long-create.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
추가tests/ui-redesign/screenshots/long-layout/long-folder.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
추가tests/ui-redesign/screenshots/long-layout/long-list.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
추가tests/ui-redesign/screenshots/long-layout/long-result.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
추가tests/ui-redesign/screenshots/portal-failure/capture.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/ui-redesign/screenshots/portal-failure/create-dialog-unavailable.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
추가tests/ui-redesign/screenshots/portal-failure/dialog-unavailable.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
추가tests/ui-redesign/screenshots/toolbar/capture.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/ui-redesign/screenshots/toolbar/toolbar-create.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
추가tests/ui-redesign/screenshots/toolbar/toolbar-folder.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
추가tests/ui-redesign/screenshots/toolbar/toolbar-root.png

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
수정tests/ui-redesign/validation.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기