Skip to content

Conversation

@adalpari
Copy link
Contributor

@adalpari adalpari commented Oct 23, 2025

Description

This PR links the whole "Ask the Happiness Engineers" with the rust layer and improves the general ticket handling.
Now you can: browse current tickets, interact with them, and add new ones. Notice that we still depend on Zendesk in the backend, so some actions can take a while, like a ticker being included in the tickets list (we are doing it locally to mitigate it and improve the UX though)

Sorry about the size of the PR, but it includes some refactor and renaming after putting all the pieces together. So, that's why several files are impacted. Some of the extra work done:

  • Extracted common logic and visual code
  • Created a common ViewModel for AI and HE conversations (so that's why both are affected)
  • Improved some visual elements
  • Also fixes CMM-878 (tablet scroll problems cc @jkmassel )

Testing instructions

  1. Log into a WP.COM site
  2. Enable MODERN_SUPPORT
  3. Go to "Me" -> Help & Support
  4. Go to "Ask the Happiness Engineers"
  • Smoke test creating and answering tickets. Don't forget to mark them as solved in Zendesk after the tests are done.

  • Also, please smoke test AI bot assistant as well as the code has been refactored a bit.

  • NOTE: Attachments and logs are not supported yet.

  • NOTE 2: Please don't pay attention to UI styles, since they are being corrected to look more Android-ish and become homogeneous here.

Screen_recording_20251023_104002.mp4

is CreateConversationResult.Success -> {
val newConversation = result.conversation
// update conversations locally
_conversations.value = listOf(newConversation) + _conversations.value
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local State Update Before Remote Operation

The newly created conversation is added to the local list immediately after creation, which is good for UX. However, consider what happens if the user:

  1. Creates a ticket
  2. Navigates back before the network completes
  3. The network call fails or times out

The ticket might appear in the list but not actually exist on the server. Consider adding a "pending" or "syncing" state to distinguish locally-created items from server-confirmed items.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good catch!

@wpmobilebot
Copy link
Contributor

Project dependencies changes

list
! Upgraded Dependencies
rs.wordpress.api:android:trunk-a0864c91b8dc3726b0ad43e22662c4415aca59ce, (changed from trunk-1a64cb921601fd34bfe6030919960676d45a19c0)
rs.wordpress.api:kotlin:trunk-a0864c91b8dc3726b0ad43e22662c4415aca59ce, (changed from trunk-1a64cb921601fd34bfe6030919960676d45a19c0)
tree
 +--- project :libs:fluxc
-|    \--- rs.wordpress.api:android:trunk-1a64cb921601fd34bfe6030919960676d45a19c0
-|         +--- com.squareup.okhttp3:okhttp:4.12.0 -> 5.2.1 (*)
-|         +--- com.squareup.okhttp3:okhttp-tls:4.12.0
-|         |    +--- com.squareup.okhttp3:okhttp:4.12.0 -> 5.2.1 (*)
-|         |    +--- com.squareup.okio:okio:3.6.0 -> 3.16.1 (*)
-|         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.24 (*)
-|         +--- net.java.dev.jna:jna:5.18.1
-|         +--- rs.wordpress.api:kotlin:trunk-1a64cb921601fd34bfe6030919960676d45a19c0
-|         |    +--- com.squareup.okhttp3:okhttp:4.12.0 -> 5.2.1 (*)
-|         |    +--- com.squareup.okhttp3:okhttp-tls:4.12.0 (*)
-|         |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 (*)
-|         |    \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.2.20 (*)
-|         \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.2.20 (*)
+|    \--- rs.wordpress.api:android:trunk-a0864c91b8dc3726b0ad43e22662c4415aca59ce
+|         +--- com.squareup.okhttp3:okhttp:4.12.0 -> 5.2.1 (*)
+|         +--- com.squareup.okhttp3:okhttp-tls:4.12.0
+|         |    +--- com.squareup.okhttp3:okhttp:4.12.0 -> 5.2.1 (*)
+|         |    +--- com.squareup.okio:okio:3.6.0 -> 3.16.1 (*)
+|         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.24 (*)
+|         +--- net.java.dev.jna:jna:5.18.1
+|         +--- rs.wordpress.api:kotlin:trunk-a0864c91b8dc3726b0ad43e22662c4415aca59ce
+|         |    +--- com.squareup.okhttp3:okhttp:4.12.0 -> 5.2.1 (*)
+|         |    +--- com.squareup.okhttp3:okhttp-tls:4.12.0 (*)
+|         |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 (*)
+|         |    \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.2.20 (*)
+|         \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.2.20 (*)
-\--- rs.wordpress.api:android:trunk-1a64cb921601fd34bfe6030919960676d45a19c0 (*)
+\--- rs.wordpress.api:android:trunk-a0864c91b8dc3726b0ad43e22662c4415aca59ce (*)

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 23, 2025

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: jetpackVanillaRelease):

--- ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/base_manifest.txt	2025-10-27 07:32:36.365666867 +0000
+++ ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/head_manifest.txt	2025-10-27 07:32:46.175765049 +0000
@@ -629,7 +629,8 @@
         <activity
             android:name="org.wordpress.android.support.aibot.ui.AIBotSupportActivity"
             android:label="@string/ai_bot_conversations_title"
-            android:theme="@style/WordPress.NoActionBar" />
+            android:theme="@style/WordPress.NoActionBar"
+            android:windowSoftInputMode="adjustResize" />
         <activity
             android:name="org.wordpress.android.support.main.ui.SupportActivity"
             android:label="@string/support_screen_title"
@@ -641,7 +642,8 @@
         <activity
             android:name="org.wordpress.android.support.he.ui.HESupportActivity"
             android:label="@string/support_screen_title"
-            android:theme="@style/WordPress.NoActionBar" /> <!-- Reader Activities -->
+            android:theme="@style/WordPress.NoActionBar"
+            android:windowSoftInputMode="adjustResize" /> <!-- Reader Activities -->
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderPostListActivity"
             android:label="@string/reader"

Go to https://buildkite.com/automattic/wordpress-android/builds/23741/canvas?sid=019a2491-5e5c-480e-977f-440da2c85f29, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 23, 2025

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: wordpressVanillaRelease):

--- ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/base_manifest.txt	2025-10-27 07:32:35.759410398 +0000
+++ ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/head_manifest.txt	2025-10-27 07:32:43.339407539 +0000
@@ -495,7 +495,8 @@
         <activity
             android:name="org.wordpress.android.support.aibot.ui.AIBotSupportActivity"
             android:label="@string/ai_bot_conversations_title"
-            android:theme="@style/WordPress.NoActionBar" />
+            android:theme="@style/WordPress.NoActionBar"
+            android:windowSoftInputMode="adjustResize" />
         <activity
             android:name="org.wordpress.android.support.main.ui.SupportActivity"
             android:label="@string/support_screen_title"
@@ -507,7 +508,8 @@
         <activity
             android:name="org.wordpress.android.support.he.ui.HESupportActivity"
             android:label="@string/support_screen_title"
-            android:theme="@style/WordPress.NoActionBar" /> <!-- Deep Linking Activity -->
+            android:theme="@style/WordPress.NoActionBar"
+            android:windowSoftInputMode="adjustResize" /> <!-- Deep Linking Activity -->
         <activity
             android:name="org.wordpress.android.ui.deeplinks.DeepLinkingIntentReceiverActivity"
             android:excludeFromRecents="true"

Go to https://buildkite.com/automattic/wordpress-android/builds/23741/canvas?sid=019a2491-5e5a-4ec8-b29e-434ef948810e, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 23, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
FlavorJalapeno
Build TypeDebug
Versionpr22309-5c157d6
Commit5c157d6
Direct Downloadjetpack-prototype-build-pr22309-5c157d6.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 23, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
FlavorJalapeno
Build TypeDebug
Versionpr22309-5c157d6
Commit5c157d6
Direct Downloadwordpress-prototype-build-pr22309-5c157d6.apk
Note: Google Login is not supported on these builds.

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

❌ Patch coverage is 42.32283% with 293 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.37%. Comparing base (2189e63) to head (5c157d6).
⚠️ Report is 2 commits behind head on trunk.

Files with missing lines Patch % Lines
...ndroid/support/he/ui/HEConversationDetailScreen.kt 0.00% 106 Missing ⚠️
...android/support/he/ui/HEConversationsListScreen.kt 0.00% 52 Missing ⚠️
...rdpress/android/support/he/ui/HENewTicketScreen.kt 0.00% 32 Missing ⚠️
...droid/support/he/repository/HESupportRepository.kt 69.79% 27 Missing and 2 partials ⚠️
...ndroid/support/common/ui/EmptyConversationsView.kt 0.00% 27 Missing ⚠️
...d/support/aibot/ui/AIBotConversationsListScreen.kt 0.00% 19 Missing ⚠️
.../support/aibot/ui/AIBotConversationDetailScreen.kt 0.00% 15 Missing ⚠️
...ess/android/support/he/ui/TicketMainContentView.kt 0.00% 8 Missing ⚠️
...support/common/ui/ConversationsSupportViewModel.kt 97.36% 2 Missing ⚠️
...dpress/android/support/main/ui/SupportViewModel.kt 66.66% 1 Missing and 1 partial ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #22309      +/-   ##
==========================================
- Coverage   39.43%   39.37%   -0.06%     
==========================================
  Files        2192     2195       +3     
  Lines      104938   105246     +308     
  Branches    14926    14955      +29     
==========================================
+ Hits        41380    41442      +62     
- Misses      60072    60315     +243     
- Partials     3486     3489       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adalpari adalpari marked this pull request as ready for review October 23, 2025 12:06
@adalpari adalpari requested a review from a team as a code owner October 23, 2025 12:06
@adalpari adalpari requested a review from dcalhoun October 23, 2025 12:07
Copy link
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The size of the PR definitely makes it challenging to review this thoroughly without a considerable amount of focus and time. I did my best to review and assess the changes within a normal review time. If you feel we need to slow down and review this thoroughly, please let me know.

I do recommend seeking review from one other Android developer given the size and nature of these changes. Someone with more Android experience may have suggestions on the architecture.

That said, the changes tested well for me. So, I'm approving the changes. Here are few opportunities for improvement I noted:

  • When offline, the chat lists state "no conversations." Ideally, we communicate the offline status and that we cannot fetch conversations.
  • The Site Address input should likely be lowercase and use a URL keyboard format (optimized for entering common URL characters like / and :, if Android provides that.
  • The pencil icon used in the button for creating a new ticket is confusing to me. I interpret that as "edit." Is there a more appropriate Material icon—plus, document, etc?
  • The form inputs do no have unique a11y labels. Some are completely empty; others only read aloud the placeholder text, which can be confusing.
  • Application Logs toggle as no a11y label; it simply reads aloud "off switch." This can be confusing when navigating by "controls" with VoiceOver.
  • Rather than disabling the Send button when fields are missing, a better UX may be allowing form submission and communicating missing field data. Currently, a user has to guess why they cannot submit the form.
  • None of the larger text in the UI for "section" are marked as "heading" elements, so navigating the views by "heading" with VoiceOver is not possible.
  • We might consider marking each conversation item in the list as a "link" to allow navigating "links" with VoiceOver.
  • We might consider grouping elements within each message "bubble" as a single a11y unit so that navigating chats are easier and quicker.

private val _navigationEvents = MutableSharedFlow<NavigationEvent>()
val navigationEvents: SharedFlow<NavigationEvent> = _navigationEvents.asSharedFlow()

@Suppress("VariableNaming")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given we are suppressing this so frequently, it seems we should consider updating or removing this lint rule later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the variables are protected instead of private (this is an abstract class), so probably the best here is to wrap them with getter/setter. I'll note it down with all your other suggestions

Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm this addresses CMM-878.

The conversations loaded as well.

One issue – when I first tried my device wasn't on wifi and it just said 'no conversations' – there was no indication that my device was offline.

Co-authored-by: David Calhoun <github@davidcalhoun.me>
@adalpari
Copy link
Contributor Author

  • When offline, the chat lists state "no conversations." Ideally, we communicate the offline status and that we cannot fetch conversations.
  • The Site Address input should likely be lowercase and use a URL keyboard format (optimized for entering common URL characters like / and :, if Android provides that.
  • The pencil icon used in the button for creating a new ticket is confusing to me. I interpret that as "edit." Is there a more appropriate Material icon—plus, document, etc?
  • The form inputs do no have unique a11y labels. Some are completely empty; others only read aloud the placeholder text, which can be confusing.
  • Application Logs toggle as no a11y label; it simply reads aloud "off switch." This can be confusing when navigating by "controls" with VoiceOver.
  • Rather than disabling the Send button when fields are missing, a better UX may be allowing form submission and communicating missing field data. Currently, a user has to guess why they cannot submit the form.
  • None of the larger text in the UI for "section" are marked as "heading" elements, so navigating the views by "heading" with VoiceOver is not possible.
  • We might consider marking each conversation item in the list as a "link" to allow navigating "links" with VoiceOver.
  • We might consider grouping elements within each message "bubble" as a single a11y unit so that navigating chats are easier and quicker.

Thank you for your thorough review! I know this one was certainly tricky.
I've created a new ticket with all your sugestions: https://linear.app/a8c/issue/CMM-894/androdi-general-improvements

@adalpari
Copy link
Contributor Author

adalpari commented Oct 27, 2025

One issue – when I first tried my device wasn't on wifi and it just said 'no conversations' – there was no indication that my device was offline.

Thank you, I've included that in an "improvements ticket"

@sonarqubecloud
Copy link

@adalpari adalpari merged commit 9f23ed4 into trunk Oct 27, 2025
24 checks passed
@adalpari adalpari deleted the feat/CMM-872-support-HE-conversations-and-tickets-logic branch October 27, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants