From 41504195ae1611440b9ab21924e858817cc38dcf Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Tue, 24 Nov 2026 11:58:16 +0100 Subject: [PATCH 1/5] update deps --- app/build.gradle.kts | 8 +- .../gitnote/ui/component/GetStringDialog.kt | 171 ++++---- app/src/main/rust/Cargo.lock | 380 +++++++++--------- app/src/main/rust/Cargo.toml | 4 +- gradle/libs.versions.toml | 8 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 6 files changed, 298 insertions(+), 275 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a2a41c4c..b1cc468c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -24,7 +24,11 @@ android { namespace = "io.github.wiiznokes.gitnote" // https://developer.android.com/about/versions - compileSdk = 37 + compileSdk { + version = release(37) { + minorApiLevel = 2 + } + } defaultConfig { @@ -136,7 +140,7 @@ android { } - packagingOptions { + packaging { dex.useLegacyPackaging = true jniLibs.useLegacyPackaging = true } diff --git a/app/src/main/java/io/github/wiiznokes/gitnote/ui/component/GetStringDialog.kt b/app/src/main/java/io/github/wiiznokes/gitnote/ui/component/GetStringDialog.kt index d2fdaf85..7c85b6ce 100644 --- a/app/src/main/java/io/github/wiiznokes/gitnote/ui/component/GetStringDialog.kt +++ b/app/src/main/java/io/github/wiiznokes/gitnote/ui/component/GetStringDialog.kt @@ -1,15 +1,18 @@ + package io.github.wiiznokes.gitnote.ui.component import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.widthIn -import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.foundation.text.input.TextObfuscationMode +import androidx.compose.foundation.text.input.rememberTextFieldState import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Visibility import androidx.compose.material.icons.filled.VisibilityOff import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.OutlinedSecureTextField import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -23,19 +26,13 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester -import androidx.compose.ui.text.TextRange +import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType -import androidx.compose.ui.text.input.PasswordVisualTransformation -import androidx.compose.ui.text.input.TextFieldValue -import androidx.compose.ui.text.input.VisualTransformation import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import io.github.wiiznokes.gitnote.ui.theme.LocalSpaces - -private const val TAG = "GetStringDialog" - @Composable fun GetStringDialog( expanded: MutableState, @@ -47,82 +44,111 @@ fun GetStringDialog( keyboardType: KeyboardType = KeyboardType.Text, onValidation: (String) -> Unit, ) { - BaseDialog(expanded = expanded) { - val focusRequester = remember { FocusRequester() } - LaunchedEffect(null) { - focusRequester.requestFocus() + val textFieldState = rememberTextFieldState( + initialText = defaultString + ) + + var passwordVisible by rememberSaveable { + mutableStateOf(false) } - var name by rememberSaveable(stateSaver = TextFieldValue.Saver) { - mutableStateOf( - TextFieldValue( - defaultString, - selection = TextRange(defaultString.length) - ) - ) + fun validate() { + onValidation(textFieldState.text.toString()) + + if (unExpandedOnValidation) { + expanded.value = false + } } - var passwordVisible by rememberSaveable { mutableStateOf(false) } + LaunchedEffect(focusRequester) { + focusRequester.requestFocus() + } + val isPassword = keyboardType == KeyboardType.Password - OutlinedTextField( - modifier = Modifier - .focusRequester(focusRequester), - value = name, - onValueChange = { - name = it - }, - label = { - Text( - text = label, - maxLines = 1, - overflow = TextOverflow.Ellipsis - ) - }, - singleLine = singleLine, - visualTransformation = if (keyboardType != KeyboardType.Password || passwordVisible) - VisualTransformation.None else PasswordVisualTransformation(), - keyboardOptions = KeyboardOptions(keyboardType = keyboardType), - keyboardActions = KeyboardActions( - onDone = { - onValidation(name.text) - if (unExpandedOnValidation) { - expanded.value = false - } - } - ), - trailingIcon = when (keyboardType) { - KeyboardType.Password -> { - { - val image = if (passwordVisible) - Icons.Filled.Visibility - else Icons.Filled.VisibilityOff + val keyboardOptions = KeyboardOptions( + keyboardType = keyboardType, + imeAction = ImeAction.Done, + ) - val description = if (passwordVisible) "Hide password" else "Show password" - IconButton(onClick = { passwordVisible = !passwordVisible }) { - Icon(imageVector = image, description) + if (isPassword) { + OutlinedSecureTextField( + state = textFieldState, + modifier = Modifier.focusRequester(focusRequester), + label = { + Text( + text = label, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + }, + keyboardOptions = keyboardOptions, + textObfuscationMode = if (passwordVisible) { + TextObfuscationMode.Visible + } else { + TextObfuscationMode.Hidden + }, + trailingIcon = { + IconButton( + onClick = { + passwordVisible = !passwordVisible } + ) { + Icon( + imageVector = if (passwordVisible) { + Icons.Default.Visibility + } else { + Icons.Default.VisibilityOff + }, + contentDescription = if (passwordVisible) { + "Hide password" + } else { + "Show password" + }, + ) } - } + }, + onKeyboardAction = { + validate() + }, + ) + } else { + OutlinedTextField( + state = textFieldState, + modifier = Modifier.focusRequester(focusRequester), + label = { + Text( + text = label, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + }, + lineLimits = if (singleLine) { + androidx.compose.foundation.text.input.TextFieldLineLimits.SingleLine + } else { + androidx.compose.foundation.text.input.TextFieldLineLimits.MultiLine() + }, + keyboardOptions = keyboardOptions, + onKeyboardAction = { + validate() + }, + ) + } - else -> null - } + Spacer( + modifier = Modifier.height( + LocalSpaces.current.dialogSeparation + ) ) - Spacer(modifier = Modifier.height(LocalSpaces.current.dialogSeparation)) - SimpleButton( - modifier = Modifier - .widthIn(min = 150.dp), - text = actionText + modifier = Modifier.widthIn(min = 150.dp), + text = actionText, ) { - onValidation(name.text) - if (unExpandedOnValidation) { - expanded.value = false - } + validate() } } } @@ -131,13 +157,10 @@ fun GetStringDialog( @Composable private fun DialogPreview() { GetStringDialog( - expanded = remember { - mutableStateOf(true) - }, + expanded = remember { mutableStateOf(true) }, label = "label", actionText = "action", defaultString = "hahaha", - keyboardType = KeyboardType.Password - ) { - } -} \ No newline at end of file + keyboardType = KeyboardType.Password, + ) {} +} diff --git a/app/src/main/rust/Cargo.lock b/app/src/main/rust/Cargo.lock index 559443de..da2b678e 100644 --- a/app/src/main/rust/Cargo.lock +++ b/app/src/main/rust/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "aho-corasick" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" dependencies = [ "memchr", ] @@ -80,9 +80,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.103" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" +checksum = "2cb931c189b85683d69a5cfad41d4d418671e1ac413dd209f3f2fc31e3cfd902" [[package]] name = "base64ct" @@ -92,15 +92,9 @@ checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" [[package]] name = "block-buffer" @@ -113,9 +107,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f7dc094d718f2e1c1559ad110e27eeaae14a5465d3d56dd6dbd793079fbd530" +checksum = "a680398c10c7bc0488067c4612226ea905a85f607134b69f3068d505d58c4214" dependencies = [ "memchr", "regex-automata", @@ -124,15 +118,15 @@ dependencies = [ [[package]] name = "bytes" -version = "1.12.1" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" +checksum = "776dfebd015e2d8732c684a2c71003674ccb49457b539b9e82151ba38e96dd7c" [[package]] name = "cc" -version = "1.3.0" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +checksum = "02f0e023adb368345ce0ca6cdfc0f24a06554468d0e8503e14a0841de79bfa69" dependencies = [ "find-msvc-tools", "jobserver", @@ -142,9 +136,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" [[package]] name = "cipher" @@ -164,9 +158,9 @@ checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] name = "combine" -version = "4.6.7" +version = "4.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +checksum = "4356eba6976435498d05a311ee9fc486da3bc81c200d3f0d7dd9703b41913f92" dependencies = [ "bytes", "memchr", @@ -217,37 +211,6 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "defmt" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2953bfe4f93bbd20cc71198842756f77d161884c99ebbabc41d80231ded88d1" -dependencies = [ - "bitflags 1.3.2", - "defmt-macros", -] - -[[package]] -name = "defmt-macros" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad9c72e7ca2137e0dc3813245a0d282fd6daad32fd800af018306a9169b5fe8" -dependencies = [ - "defmt-parser", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "defmt-parser" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" -dependencies = [ - "thiserror", -] - [[package]] name = "digest" version = "0.10.7" @@ -260,13 +223,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] @@ -302,9 +265,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900d271a03799a1ee8d1ca9b19893b48ca674a9284fefcfb85f05e74ed314217" +checksum = "288efae2d67fb0418d01f837feb55c7a9cdc4c5db38d3dee91324a1c7ec6fd31" dependencies = [ "log", "regex", @@ -312,13 +275,13 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.11" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de671bd27a75a797dc9ae289ba1e77276e75e2026408aab65185384e2d5cd3f6" +checksum = "82bdfc6e01c305a3ea46ed815b06ac0b379d7c5eac588fa4464048d731c4dcdf" dependencies = [ "anstream", "anstyle", - "env_filter 2.0.0", + "env_filter 2.1.0", "jiff", "log", ] @@ -337,15 +300,15 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "find-msvc-tools" -version = "0.1.9" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" +checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" dependencies = [ "percent-encoding", ] @@ -388,7 +351,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddddbf932745a6be37109b6112d3ee09696106f848449069d3a57bba937ab82e" dependencies = [ - "bitflags 2.13.1", + "bitflags", "libc", "libgit2-sys", "log", @@ -416,42 +379,52 @@ dependencies = [ "zeroize", ] +[[package]] +name = "gix-error" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50ad6c42fa50280f382026ff838a8afa7ab2ad83e92349cab4392972baae69cd" +dependencies = [ + "bstr", +] + [[package]] name = "gix-path" -version = "0.12.3" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed3e8d7a82e886e17a72e03d4ba0c13db6f2219b6cd4e2900b4cae426ec20c9" +checksum = "615e3ff75800c67022ec8065b67e0846420a88c5f484e6c4fd81c78472e4c77a" dependencies = [ "bstr", + "gix-error", "gix-trace", "gix-validate", - "thiserror", + "winreg", ] [[package]] name = "gix-trace" -version = "0.1.21" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be3eb81d9dc914335923e50d52829c551feefd6a72d176c4130c546b67a60814" +checksum = "1c96f84d731a96780e6a7ad5ee70b4ecc398499946b62617945fbaeb6ab878f8" [[package]] name = "gix-url" -version = "0.37.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d10e53b8eae21ee601687f47bbbd6cb2ed7162cb4c1cafdd422fb7ec64cbee" +checksum = "6c70991bc97388e98cba88fe98adb270fbd9bd1724c68836e58556d593829197" dependencies = [ "bstr", + "gix-error", "gix-path", "gix-utils", "percent-encoding", - "thiserror", ] [[package]] name = "gix-utils" -version = "0.3.5" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1795bd2a970ca8b2185318c2abb97d955c71992f1cf28de73ad3b593a9f3ce8" +checksum = "b5e6d46894c7a4fd9c5e26d233a0fa836002ba0af9a11aef58923d317c486e10" dependencies = [ "bstr", "fastrand", @@ -461,18 +434,19 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.11.3" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a034e84d1e04e1b1f20f51f12491da230b6ac8b925d0c8e1b89bcd87a7c5ccc" +checksum = "5d6f293fd8abd9bd9bc1e0a23541f73607e932b5a2bde2246320da38edde5726" dependencies = [ "bstr", + "gix-error", ] [[package]] name = "icu_collections" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd" dependencies = [ "displaydoc", "potential_utf", @@ -484,9 +458,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0" dependencies = [ "displaydoc", "litemap", @@ -497,9 +471,9 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599" dependencies = [ "icu_collections", "icu_normalizer_data", @@ -511,16 +485,17 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" +checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc" [[package]] name = "icu_properties" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f" dependencies = [ + "displaydoc", "icu_collections", "icu_locale_core", "icu_properties_data", @@ -531,15 +506,15 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" +checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf" [[package]] name = "icu_provider" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514" dependencies = [ "displaydoc", "icu_locale_core", @@ -607,11 +582,10 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "jiff" -version = "0.2.35" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668b7183bd07af9a4885f5c35b0cc5c83c4607a913c16b7e17291832910d2dcc" +checksum = "c5e77cbfb9fff4798e283c2d69dff39fc2c45e7da017e5ce95b654e46ea41236" dependencies = [ - "defmt", "jiff-core", "jiff-static", "log", @@ -622,23 +596,23 @@ dependencies = [ [[package]] name = "jiff-core" -version = "0.1.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feca88439efe53da3754500c1851dedf3cb36c524dd5cf8225cc0794de95d09" +checksum = "b6b46a105a9874634dd96231021526bf24ca04955a5998c59a9c7666e634b7b8" dependencies = [ - "defmt", + "log", ] [[package]] name = "jiff-static" -version = "0.2.35" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a69dcb3a21cfb32ce1cd056169337ca284af0766dd766e7878819b251a49204" +checksum = "e9067a0b23e5be3147d56b2dcf652b18e6b1364caca93fb157653b6fbcab23a9" dependencies = [ "jiff-core", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] @@ -702,15 +676,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.186" +version = "0.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" [[package]] name = "libgit2-sys" -version = "0.18.5+1.9.4" +version = "0.18.8+1.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005d6ae6eac1912906073e069f7db60b1fa98e052a68227824afe3e3a1c59ca2" +checksum = "7f7c568b25d7489bc3fb2988ed69ab111d2944d2f5fec3d5c987fe545ea97b50" dependencies = [ "cc", "libc", @@ -722,23 +696,24 @@ dependencies = [ [[package]] name = "libssh2-sys" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c04141a07bb0c0bc461cb657808764de571702a59bc5c726c400ac9a7625e3ab" +checksum = "fce5a0b125f6aeac93b304b35f7f1e9f054aad29ddac57091928e41df3ccd233" dependencies = [ "cc", "libc", "libz-sys", "openssl-sys", "pkg-config", + "semver", "vcpkg", ] [[package]] name = "libz-sys" -version = "1.1.29" +version = "1.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bc9657773828b90eeb625adff10eeac83cc21bbfd8e23a03eaa8a33c9e28d9" +checksum = "fee3f59f4321dab0c78d828942e7aa09d0bd8ad6e78a501977e6bf3d02938045" dependencies = [ "cc", "libc", @@ -748,15 +723,15 @@ dependencies = [ [[package]] name = "litemap" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" [[package]] name = "log" -version = "0.4.33" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" +checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c" [[package]] name = "memchr" @@ -787,9 +762,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.117" +version = "0.9.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" +checksum = "19c413d6ec9ebaf5e1c829d355cb3e9f783778d700f135be0921d52fce3c60ae" dependencies = [ "cc", "libc", @@ -815,48 +790,48 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pkg-config" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" [[package]] name = "portable-atomic" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d20d5497ef88037a52ff98267d066e7f11fcc5e99bbfbd58a42336193aacec3" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" [[package]] name = "portable-atomic-util" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" +checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715" dependencies = [ "portable-atomic", ] [[package]] name = "potential_utf" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" dependencies = [ "zerovec", ] [[package]] name = "proc-macro2" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.46" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ "proc-macro2", ] @@ -878,9 +853,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +checksum = "9807af0e638c12e753aa1b4e601791bf2a8f71274023c8bbeec12fc149950857" dependencies = [ "aho-corasick", "memchr", @@ -890,9 +865,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.16" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad" +checksum = "41d60ef07df457506a0a1a2073112eb4aae5733dbd2813c3da77d1b0fd441158" dependencies = [ "aho-corasick", "memchr", @@ -901,9 +876,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" +checksum = "d902046e6a28a1e4c3cab97258a0ce11e994903f01c2d97a9447a0b3df85f4f6" [[package]] name = "rustc_version" @@ -931,31 +906,31 @@ checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" dependencies = [ "serde_core", ] [[package]] name = "serde_core" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] @@ -999,9 +974,9 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "smallvec" -version = "1.15.2" +version = "1.16.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" +checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59" [[package]] name = "ssh-cipher" @@ -1074,42 +1049,53 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" -version = "0.13.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] name = "thiserror" -version = "2.0.18" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.18" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] name = "tinystr" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a" dependencies = [ "displaydoc", "zerovec", @@ -1117,18 +1103,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" [[package]] name = "typenum" @@ -1138,24 +1115,24 @@ checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "unicode-ident" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" [[package]] name = "unicode-normalization" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +checksum = "75cd3fb03d5288b3ba9a1ee103ac7e9cbb59f0b03d64f8ddfcc04dd42758a85d" dependencies = [ "tinyvec", ] [[package]] name = "url" -version = "2.5.8" +version = "2.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" dependencies = [ "form_urlencoded", "idna", @@ -1165,9 +1142,12 @@ dependencies = [ [[package]] name = "utf8_iter" -version = "1.0.4" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0" +dependencies = [ + "utf_types", +] [[package]] name = "utf8parse" @@ -1175,6 +1155,12 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "utf_types" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6" + [[package]] name = "vcpkg" version = "0.2.15" @@ -1189,9 +1175,9 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +checksum = "b42e295b7452c4604982280d8586001fcad9b8b201cac67bca9771e7a7475403" dependencies = [ "same-file", "winapi-util", @@ -1227,17 +1213,27 @@ dependencies = [ "windows-link", ] +[[package]] +name = "winreg" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10" +dependencies = [ + "cfg-if", + "windows-sys", +] + [[package]] name = "writeable" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" [[package]] name = "yoke" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3" dependencies = [ "stable_deref_trait", "yoke-derive", @@ -1246,13 +1242,13 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", "synstructure", ] @@ -1267,27 +1263,27 @@ dependencies = [ [[package]] name = "zerofrom-derive" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", "synstructure", ] [[package]] name = "zeroize" -version = "1.9.0" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" +checksum = "85ccff8a4805aba1eaa4cd4afcd49f7557dd2cf5fd79ffc37f8959466effc5aa" [[package]] name = "zerotrie" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" dependencies = [ "displaydoc", "yoke", @@ -1296,9 +1292,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.6" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40" dependencies = [ "yoke", "zerofrom", @@ -1307,11 +1303,11 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.3" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.10", ] diff --git a/app/src/main/rust/Cargo.toml b/app/src/main/rust/Cargo.toml index 0b187f5f..333a4ae6 100644 --- a/app/src/main/rust/Cargo.toml +++ b/app/src/main/rust/Cargo.toml @@ -25,8 +25,8 @@ anyhow = "1" zeroize = "1" libgit2-sys = "0.18" include-lines = "1" -gix-url = "0.37" -bstr = "1.13" +gix-url = "0.41" +bstr = "1" [dev-dependencies] env_logger = "0.11" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7d8852df..7fb0d601 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,14 +1,14 @@ [versions] -agp = "9.4.1" +agp = "9.5.2" kotlin = "2.4.21" ksp = "2.3.6" core-ktx = "1.19.1" -lifecycle-runtime = "2.11.0" +lifecycle-runtime = "2.11.1" activity-compose = "1.13.0" -datastore-preferences = "1.2.1" -compose-bom = "2026.09.00" +datastore-preferences = "1.3.0" +compose-bom = "2026.11.01" room = "2.8.5" sqlite = "3.49.0" paging = "3.5.3" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b1fc599e..70b3f0ef 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Sep 25 00:03:06 CEST 2026 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.9.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From a498e9dad2bca112fce4fcabf96dc981c80214ec Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Tue, 24 Nov 2026 13:10:41 +0100 Subject: [PATCH 2/5] fix: markdown rendering not available in edit view --- .../gitnote/ui/screen/app/edit/MarkDown.kt | 2 + app/src/main/rust/build.rs | 104 +++++++++++++++--- .../main/rust/supported_extensions/text.txt | 1 - 3 files changed, 90 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/edit/MarkDown.kt b/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/edit/MarkDown.kt index 7422fb52..d9685637 100644 --- a/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/edit/MarkDown.kt +++ b/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/edit/MarkDown.kt @@ -33,6 +33,8 @@ import androidx.compose.ui.unit.dp import com.mikepenz.markdown.m3.Markdown import io.github.wiiznokes.gitnote.ui.viewmodel.edit.MarkDownVM +private const val TAG = "MarkDown" + @Composable fun MarkDownContent( vm: MarkDownVM, diff --git a/app/src/main/rust/build.rs b/app/src/main/rust/build.rs index f06f789c..ca28ee14 100644 --- a/app/src/main/rust/build.rs +++ b/app/src/main/rust/build.rs @@ -1,4 +1,78 @@ -use std::{collections::HashSet, fs, io, path::Path}; +use std::{ + collections::{HashMap, HashSet}, + fmt::Display, + fs, io, + path::Path, +}; + +struct FileExtension { + extension: HashSet, + path: String, +} + +fn format_file(path: &Path) -> io::Result { + let content = fs::read_to_string(&path)?; + + let lines_set = content + .lines() + .map(str::trim) + .filter(|l| !l.is_empty()) + .map(str::to_ascii_lowercase) + .collect::>(); + + let mut lines = lines_set.clone().into_iter().collect::>(); + + lines.sort_unstable(); + + let sorted = lines.join("\n") + "\n"; + + // Only rewrite if the contents actually changed. + if content != sorted { + fs::write(&path, sorted)?; + } + + Ok(FileExtension { + extension: lines_set, + path: path.to_string_lossy().to_string(), + }) +} + +struct DuplicateResult { + path1: String, + path2: String, + extension: String, +} + +impl Display for DuplicateResult { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!( + f, + "Duplicate extension '{}':\n - {}\n - {}", + self.extension, self.path1, self.path2, + ) + } +} + +fn find_duplicates(files: &[FileExtension]) -> Vec { + let mut seen: HashMap<&str, &str> = HashMap::new(); + let mut duplicates = Vec::new(); + + for file in files { + for extension in &file.extension { + if let Some(path1) = seen.get(extension.as_str()) { + duplicates.push(DuplicateResult { + path1: path1.to_string(), + path2: file.path.clone(), + extension: extension.clone(), + }); + } else { + seen.insert(extension, &file.path); + } + } + } + + duplicates +} fn main() -> io::Result<()> { let dir = Path::new("supported_extensions"); @@ -6,6 +80,8 @@ fn main() -> io::Result<()> { // Rerun if the directory itself changes. println!("cargo:rerun-if-changed={}", dir.display()); + let mut supported_extensions = Vec::new(); + for entry in fs::read_dir(dir)? { let entry = entry?; let path = entry.path(); @@ -17,25 +93,21 @@ fn main() -> io::Result<()> { // Rerun if this specific file changes. println!("cargo:rerun-if-changed={}", path.display()); - let content = fs::read_to_string(&path)?; + let set = format_file(&path)?; - let mut lines: Vec<_> = content - .lines() - .map(str::trim) - .filter(|l| !l.is_empty()) - .map(str::to_ascii_lowercase) - .collect::>() - .into_iter() - .collect(); + supported_extensions.push(set); + } - lines.sort_unstable(); + let duplicate_result = find_duplicates(&supported_extensions); - let sorted = lines.join("\n") + "\n"; + if !duplicate_result.is_empty() { + let errors = duplicate_result + .iter() + .map(ToString::to_string) + .collect::>() + .join("\n"); - // Only rewrite if the contents actually changed. - if content != sorted { - fs::write(&path, sorted)?; - } + panic!("Duplicate extensions detected:\n{errors}"); } Ok(()) diff --git a/app/src/main/rust/supported_extensions/text.txt b/app/src/main/rust/supported_extensions/text.txt index ad85d738..58c608f0 100644 --- a/app/src/main/rust/supported_extensions/text.txt +++ b/app/src/main/rust/supported_extensions/text.txt @@ -228,7 +228,6 @@ markdown master matchfile mavenrc -md mdx meson.build mjs From 20959737debca2afb0e4ae5e601dbc2364d76394 Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Tue, 24 Nov 2026 13:21:47 +0100 Subject: [PATCH 3/5] fmt --- app/build.gradle.kts | 2 +- .../wiiznokes/gitnote/helper/NetworkPermissionHelper.kt | 3 +-- .../main/java/io/github/wiiznokes/gitnote/provider/GitHub.kt | 3 ++- .../github/wiiznokes/gitnote/ui/component/GetStringDialog.kt | 1 - .../wiiznokes/gitnote/ui/screen/app/grid/GridScreen.kt | 3 ++- .../github/wiiznokes/gitnote/ui/screen/app/grid/ListView.kt | 3 ++- .../wiiznokes/gitnote/ui/screen/app/grid/markdownHelper.kt | 5 ++++- .../wiiznokes/gitnote/ui/screen/setup/NewRepoMethodScreen.kt | 2 ++ .../gitnote/ui/screen/setup/remote/EnterUrlScreen.kt | 4 +++- app/src/main/rust/build.rs | 4 ++-- 10 files changed, 19 insertions(+), 11 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b1cc468c..69e764df 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -29,7 +29,7 @@ android { minorApiLevel = 2 } } - + defaultConfig { fun getGitHash(): String { diff --git a/app/src/main/java/io/github/wiiznokes/gitnote/helper/NetworkPermissionHelper.kt b/app/src/main/java/io/github/wiiznokes/gitnote/helper/NetworkPermissionHelper.kt index 5981be3c..132701c2 100644 --- a/app/src/main/java/io/github/wiiznokes/gitnote/helper/NetworkPermissionHelper.kt +++ b/app/src/main/java/io/github/wiiznokes/gitnote/helper/NetworkPermissionHelper.kt @@ -12,8 +12,7 @@ import java.net.URI class NetworkPermissionHelper { companion object { fun isPermissionGranted(context: Context): Boolean { - if (Build.VERSION.SDK_INT < 37) return true - return PermissionChecker.checkSelfPermission( + return Build.VERSION.SDK_INT < 37 || PermissionChecker.checkSelfPermission( context, Manifest.permission.ACCESS_LOCAL_NETWORK ) == PermissionChecker.PERMISSION_GRANTED diff --git a/app/src/main/java/io/github/wiiznokes/gitnote/provider/GitHub.kt b/app/src/main/java/io/github/wiiznokes/gitnote/provider/GitHub.kt index 5d60d945..6629f9a1 100644 --- a/app/src/main/java/io/github/wiiznokes/gitnote/provider/GitHub.kt +++ b/app/src/main/java/io/github/wiiznokes/gitnote/provider/GitHub.kt @@ -185,7 +185,8 @@ class GithubProvider : Provider { .sortedByDescending { it.lastModifiedTimeMillis } .take(nbFirstRepoOwner) - val other = repos.filter { !first.contains(it) }.sortedByDescending { it.lastModifiedTimeMillis } + val other = + repos.filter { !first.contains(it) }.sortedByDescending { it.lastModifiedTimeMillis } return first + other } diff --git a/app/src/main/java/io/github/wiiznokes/gitnote/ui/component/GetStringDialog.kt b/app/src/main/java/io/github/wiiznokes/gitnote/ui/component/GetStringDialog.kt index 7c85b6ce..75b90e9c 100644 --- a/app/src/main/java/io/github/wiiznokes/gitnote/ui/component/GetStringDialog.kt +++ b/app/src/main/java/io/github/wiiznokes/gitnote/ui/component/GetStringDialog.kt @@ -1,4 +1,3 @@ - package io.github.wiiznokes.gitnote.ui.component import androidx.compose.foundation.layout.Spacer diff --git a/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid/GridScreen.kt b/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid/GridScreen.kt index 8a7bf88c..69738cb5 100644 --- a/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid/GridScreen.kt +++ b/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid/GridScreen.kt @@ -392,7 +392,8 @@ private fun NoteCard( horizontalAlignment = Alignment.Start, ) { val title = if (showFullPathOfNotes || !gridNote.isUnique) { - val currentNoteFolderRelativePath = vm.currentNoteFolderRelativePath.collectAsState().value + val currentNoteFolderRelativePath = + vm.currentNoteFolderRelativePath.collectAsState().value if (currentNoteFolderRelativePath.isEmpty()) { gridNote.note.relativePath diff --git a/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid/ListView.kt b/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid/ListView.kt index 284a6aa1..2d3d8774 100644 --- a/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid/ListView.kt +++ b/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid/ListView.kt @@ -143,7 +143,8 @@ private fun NoteListRow( verticalArrangement = Arrangement.Center ) { - val currentNoteFolderRelativePath = vm.currentNoteFolderRelativePath.collectAsState().value + val currentNoteFolderRelativePath = + vm.currentNoteFolderRelativePath.collectAsState().value val title = if (currentNoteFolderRelativePath.isEmpty()) { gridNote.note.relativePath diff --git a/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid/markdownHelper.kt b/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid/markdownHelper.kt index a9054aed..4a2f3ee3 100644 --- a/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid/markdownHelper.kt +++ b/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/app/grid/markdownHelper.kt @@ -79,7 +79,10 @@ fun MarkdownCustomInner( padding: MarkdownPadding = markdownPadding(), dimens: MarkdownDimens = markdownDimens(), flavour: MarkdownFlavourDescriptor = GFMFlavourDescriptor(), - parser: MarkdownParser = MarkdownParser(flavour, cancellationToken = CancellationToken.NonCancellable), + parser: MarkdownParser = MarkdownParser( + flavour, + cancellationToken = CancellationToken.NonCancellable + ), imageTransformer: ImageTransformer = NoOpImageTransformerImpl(), annotator: MarkdownAnnotator = markdownAnnotator(), extendedSpans: MarkdownExtendedSpans = markdownExtendedSpans(), diff --git a/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/setup/NewRepoMethodScreen.kt b/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/setup/NewRepoMethodScreen.kt index 0d44a38a..cc31a07c 100644 --- a/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/setup/NewRepoMethodScreen.kt +++ b/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/setup/NewRepoMethodScreen.kt @@ -10,7 +10,9 @@ import androidx.compose.material3.Button import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MaterialTheme import androidx.compose.material3.ModalBottomSheet +import androidx.compose.material3.SheetValue import androidx.compose.material3.Text +import androidx.compose.material3.rememberBottomSheetState import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable import androidx.compose.runtime.MutableState diff --git a/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/setup/remote/EnterUrlScreen.kt b/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/setup/remote/EnterUrlScreen.kt index 0a671bf8..89e96f13 100644 --- a/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/setup/remote/EnterUrlScreen.kt +++ b/app/src/main/java/io/github/wiiznokes/gitnote/ui/screen/setup/remote/EnterUrlScreen.kt @@ -135,7 +135,9 @@ fun EnterUrlScreen( onClick = { val urlText = url.value.text scope.launch { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CINNAMON_BUN && NetworkPermissionHelper.requiresLocalNetworkPermission(urlText) && !NetworkPermissionHelper.isPermissionGranted( + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CINNAMON_BUN && NetworkPermissionHelper.requiresLocalNetworkPermission( + urlText + ) && !NetworkPermissionHelper.isPermissionGranted( context ) ) { diff --git a/app/src/main/rust/build.rs b/app/src/main/rust/build.rs index ca28ee14..025b5a8a 100644 --- a/app/src/main/rust/build.rs +++ b/app/src/main/rust/build.rs @@ -11,7 +11,7 @@ struct FileExtension { } fn format_file(path: &Path) -> io::Result { - let content = fs::read_to_string(&path)?; + let content = fs::read_to_string(path)?; let lines_set = content .lines() @@ -28,7 +28,7 @@ fn format_file(path: &Path) -> io::Result { // Only rewrite if the contents actually changed. if content != sorted { - fs::write(&path, sorted)?; + fs::write(path, sorted)?; } Ok(FileExtension { From 612f9e1558d89013ea5ef64f4c257a5af4733011 Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Fri, 27 Nov 2026 16:04:14 +0100 Subject: [PATCH 4/5] Update RUST_VERSION --- app/src/main/rust/RUST_VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/rust/RUST_VERSION b/app/src/main/rust/RUST_VERSION index 3bd6c568..7a9fecd3 100644 --- a/app/src/main/rust/RUST_VERSION +++ b/app/src/main/rust/RUST_VERSION @@ -1 +1 @@ -1.99.1 +1.100.0 From fa4a245dd59e12d8152f99cda6e187f9c77abbf4 Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Fri, 27 Nov 2026 16:04:26 +0100 Subject: [PATCH 5/5] update version --- app/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 69e764df..d189df25 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -48,8 +48,8 @@ android { applicationId = "io.github.wiiznokes.gitnote" minSdk = 30 - versionCode = 23 - versionName = "26.10.2" + versionCode = 24 + versionName = "26.11" buildConfigField( "String",