Skip to content

Kindness Mode UX Update#1670

Draft
tladesignz wants to merge 16 commits intoguardianproject:masterfrom
tladesignz:kindness_mode
Draft

Kindness Mode UX Update#1670
tladesignz wants to merge 16 commits intoguardianproject:masterfrom
tladesignz:kindness_mode

Conversation

@tladesignz
Copy link
Copy Markdown
Collaborator

Fixes issue #1509.

@tladesignz tladesignz requested a review from bitmold April 27, 2026 14:43
@tladesignz
Copy link
Copy Markdown
Collaborator Author

@bitmold, it's about time you have a look at this.

Since you know the Tor-controlling part way better than me: What would you consider the best way to implement the test?

Additionally, I would be happy for any testing against non-standard phones and tablets.

Thank you!

@syphyr
Copy link
Copy Markdown
Contributor

syphyr commented Apr 27, 2026

please rebase

@bitmold
Copy link
Copy Markdown
Collaborator

bitmold commented Apr 27, 2026

Awesome, I'll take a look at it tonight + tomorrow morning.

@syphyr
Copy link
Copy Markdown
Contributor

syphyr commented Apr 28, 2026

Something is strange with the latest merge. This commit tladesignz@b070bf1 changes String to String?, but then the following change to override fun natTypeUpdated in SnowflakeProxyWrapper.kt is 6bfcb7e which shows String not String?, but this does not match HEAD.

Also, kindness_mode_disclaimer_bridge should be removed from app/src/main/res/values-tr/strings.xml

diff --git a/app/src/main/java/org/torproject/android/ui/kindness/SnowflakeProxyWrapper.kt b/app/src/main/java/org/torproject/android/ui/kindness/SnowflakeProxyWrapper.kt
index eefd62d14..6ae9cc305 100644
--- a/app/src/main/java/org/torproject/android/ui/kindness/SnowflakeProxyWrapper.kt
+++ b/app/src/main/java/org/torproject/android/ui/kindness/SnowflakeProxyWrapper.kt
@@ -89,8 +89,8 @@ class SnowflakeProxyWrapper(private val service: SnowflakeProxyService) {
                         // Ignored.
                     }
 
-                    override fun natTypeUpdated(natType: String?) {
-                        // TODO feature added in IPtProxy 5.4.1
+                    override fun natTypeUpdated(natType: String) {
+                        service.updateNatType(natType)
                     }
                 }
 
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index 695dc397c..bd94cd87a 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -277,7 +277,6 @@
     <string name="kindness_never_had_a_direct_connection">Paylaşım Modunu kullanabilmek için, en az bir kez Tor ağına doğrudan (herhangi bir köprü kullanmadan) bağlanmanız gerekir. Bağlantı kurduktan sonra, lütfen buraya geri dönerek Paylaşım Modunu etkinleştirin. Bu doğrudan bağlantı testini tamamladıktan sonra, Tor ağına bağlı olsanız da olmasanız da Paylaşım Modunu dilediğiniz gibi kullanabilirsiniz.</string>
     <string name="kindness_mode_cant_run_with_bridge">Tor ağına bağlanmak için bir köprü kullanırken Paylaşım Modu çalıştırılamaz.</string>
     <string name="kindness_mode_cant_run_in_your_country">Sansür nedeniyle, ülkenizde diğer kişilerin Tor ağına bağlanmasına yardımcı olmak için kullanılan Paylaşım Modu şu anda devre dışıdır.</string>
-    <string name="kindness_mode_disclaimer_bridge">Sansür uygulanan bir bölgedeyseniz veya Tor ağına bağlanmak için bir köprü kullanmanız gerekiyorsa, Paylaşım Modunu kullanmayın.</string>
     <string name="battery_optimization_title">Pil İyileştirmelerini Devre Dışı Bırak</string>
     <string name="battery_optimization_pref_msg">Aygıtlarının Orbot uygulamasını arka planda çalışırken erken bir şekilde kapattığından şüphelenen kullanıcılar için ayar.</string>
     <string name="battery_optimization_dialog_msg">Bazı Android aygıtlar, Orbot arka planda çalışırken uygulamayı kapatabilir. Orbot\'un bağlantısının kesilmemesini ve çalışmaya devam etmesini isteyen çoğu kullanıcı için, sistem ayarlarından Orbot\'u \"Her Zaman Açık\" VPN olarak ayarlamak yeterlidir. Bununla birlikte, gerekli görürseniz, aygıtınızın Orbot üzerinde herhangi bir pil iyileştirmesi yapmasını engellemek için gerekli adımları atabilirsiniz.</string>

@bitmold
Copy link
Copy Markdown
Collaborator

bitmold commented Apr 29, 2026

Noting this regression here, though I understand that this dialog that checks if a direct tor connection has been established is being replaced in some way by this testing dialog.

When you click activate on a cold install, the dialog to ensure that you have at least historically have had a direct tor connection appears. At this moment snowflake proxy is running and there's no way to turn it off.

If I go ahead and connect to tor, then go to activate kindness mode, the bug still exists. The testing dialog appears, but kindness mode is already running.

image image

@bitmold
Copy link
Copy Markdown
Collaborator

bitmold commented Apr 29, 2026

On small screens, the headings get cramped
image

@bitmold
Copy link
Copy Markdown
Collaborator

bitmold commented Apr 29, 2026

The connected UI looks great, but unfortunately it breaks in landscape

image

And this is a bit nitpicky, but the labels aren't lining up with these grey panels
Screenshot From 2026-04-29 18-30-45

Also @cstiens it just dawned on me that on the kindness screen rectangular grey panels are used, whereas on the "more" screen to the right rounded panels are used. Personally, I think the slightly rounded ones look much nicer.

@tladesignz
Copy link
Copy Markdown
Collaborator Author

Noting this regression here, though I understand that this dialog that checks if a direct tor connection has been established is being replaced in some way by this testing dialog.

When you click activate on a cold install, the dialog to ensure that you have at least historically have had a direct tor connection appears. At this moment snowflake proxy is running and there's no way to turn it off.

If I go ahead and connect to tor, then go to activate kindness mode, the bug still exists. The testing dialog appears, but kindness mode is already running.

Good catch! I removed the legacy test.

@tladesignz
Copy link
Copy Markdown
Collaborator Author

  • Fixed the header indent.
  • Added rounded cards as suggested.
  • Added first test code and a mock test to be able to continue development.
  • Added final behaviour to show initial scene only, when no valid test result. (older than 24 hours.)

Found another problem:

We need to bind to the SnowflakeProxyService to receive the evaluation of the proxy quality.

However, doing so unintentionally starts a SnowflakeProxy. I'm afraid, SnowflakeProxyService is in for a redesign. @bitmold, what do you think?

@bitmold
Copy link
Copy Markdown
Collaborator

bitmold commented May 1, 2026

We need to bind to the SnowflakeProxyService to receive the evaluation of the proxy quality.
However, doing so unintentionally starts a SnowflakeProxy. I'm afraid, SnowflakeProxyService is in for a redesign. @bitmold, what do you think?

This is true, it needs to be modified, however I don't think a thorough redesign is needed.

SnowflakeProxyService is capable of running as a foreground service without actually running the snowflake proxy in IPtProxy. For instance, if the Service is configured to run on WiFi only and/or if the device is connected to a power source, the Service is capable of calling stopSnowflakeProxy(String?) to turn off the proxying.

When the Service is created in onCreate() it calls initNetworkCallbacks() which immediately starts proxying if the network conditions are met. In this function you could add preconditions to ensure that the correct proxy evaluations are met before invoking startSnowflakeProxy(String?)

@bitmold
Copy link
Copy Markdown
Collaborator

bitmold commented May 1, 2026

I'll provide more feedback as I can the next few days, but something to keep in mind, I know you're removing a lot of Strings here. I just merged more translations into the master branch, could you please merge master into here and remove whatever strings need to be removed for this PR. thanks. this is coming along really nice :+)

@bitmold
Copy link
Copy Markdown
Collaborator

bitmold commented May 4, 2026

It's hard to see in the first screenshot, but the labels on the configuration bottom sheet were misaligned. The view was also broken in landscape, which I fixed in this tiny xml commit I pushed right now.

image image

Is there a reason why this tiny bottom sheet needs to be so big? Perhaps it could be made smaller.

    override fun getHeightRatio(): Float = 1/2f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants