Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2fc6f16
Add wordpress-rs comments list (Phase 2a: core browsing)
nbradbury Jul 2, 2026
aad42b4
Rename RS comments experimental flag to cover the whole comments expe…
nbradbury Jul 2, 2026
a2cc6b3
Simplify rs comments list: drop dead/unused state, share page handlin…
nbradbury Jul 2, 2026
3cd35f7
Use new string keys for the renamed experimental flag copy
nbradbury Jul 2, 2026
b1bf058
Harden rs comments list paging and post-title resolution
nbradbury Jul 2, 2026
8266317
Address review findings in rs comments paging hardening
nbradbury Jul 2, 2026
ca271c8
Close title-resolve race windows and strengthen data source tests
nbradbury Jul 2, 2026
e666ee4
Construct uniffi data classes in tests instead of mocking them
nbradbury Jul 2, 2026
89e2b61
Fix review findings and slim the list PR
nbradbury Jul 3, 2026
0c05ef5
Merge remote-tracking branch 'origin/trunk' into feature/rs-comments-…
nbradbury Jul 3, 2026
0c828e9
Simplify review-pass leftovers
nbradbury Jul 3, 2026
0f0c47d
Merge remote-tracking branch 'origin/trunk' into feature/rs-comments-…
nbradbury Jul 3, 2026
8a944bc
Add batch moderation to the rs comments list (Phase 2b)
nbradbury Jul 2, 2026
8d90ca5
Add search to the rs comments list (Phase 2c)
nbradbury Jul 2, 2026
e6bdeac
Merge remote-tracking branch 'origin/trunk' into feature/rs-comments-…
nbradbury Jul 7, 2026
44a5686
Fix search review findings: clear races, scoping, scroll and focus
nbradbury Jul 7, 2026
68ae990
Address second-pass review findings on comments list search
nbradbury Jul 7, 2026
5296d0d
Address third-pass review findings on comments list search
nbradbury Jul 7, 2026
1e1baf6
Remove stray blank line before brace (checkstyle)
nbradbury Jul 7, 2026
7afff50
Add note mode to the rs comment detail ViewModel
nbradbury Jul 8, 2026
e7e197b
Support notification args and result extras in the rs comment detail
nbradbury Jul 8, 2026
f0990ed
Serve comment notifications with the rs comment detail when gated
nbradbury Jul 8, 2026
7fd68b2
Merge remote-tracking branch 'origin/trunk' into feature/rs-comments-…
nbradbury Jul 8, 2026
0f4f9f3
Give the rs comment detail a surface background
nbradbury Jul 8, 2026
220f878
Convert the unified comment detail to Compose
nbradbury Jul 8, 2026
24496ca
Render images in the Compose comment body
nbradbury Jul 8, 2026
a49da52
Fix detekt findings in the Compose comment detail
nbradbury Jul 8, 2026
3745eed
Merge remote-tracking branch 'origin/trunk' into feature/rs-comment-d…
nbradbury Jul 8, 2026
038e0ed
Simplify the Compose comment detail
nbradbury Jul 8, 2026
4d933a2
Centre the More action in its slot
nbradbury Jul 8, 2026
f9fc781
Merge remote-tracking branch 'origin/trunk' into feature/rs-comment-d…
nbradbury Jul 9, 2026
e9c7328
Merge branch 'trunk' into feature/rs-comment-detail-compose
nbradbury Jul 9, 2026
3b082af
Address review feedback on the Compose comment detail
nbradbury Jul 9, 2026
33e7b5e
Fix review findings: snackbar dismiss, reply newlines, mention panel
nbradbury Jul 9, 2026
3b9b0ce
Convert the comment editor to Compose and save via wordpress-rs
nbradbury Jul 9, 2026
842b620
Group comment-edit author fields to fix detekt LongParameterList
nbradbury Jul 9, 2026
8a44238
Drop dead view-era state from the comment editor
nbradbury Jul 9, 2026
aee5acf
Drop redundant param from updateCommentViaRs
nbradbury Jul 9, 2026
15fe3ab
Merge remote-tracking branch 'origin/trunk' into feature/rs-comment-e…
nbradbury Jul 10, 2026
0a72474
Address editor review findings
nbradbury Jul 10, 2026
99a1fc5
Remove orphaned WordPress.ActionBar.MenuAlign style
nbradbury Jul 10, 2026
5b66817
Address code review findings on the comment editor
nbradbury Jul 10, 2026
bc8969a
Restore disabled author fields for registered-user comments
nbradbury Jul 10, 2026
b7a5584
Re-enable author fields for all comments; the endpoint applies them
nbradbury Jul 10, 2026
2e7109f
Merge remote-tracking branch 'origin/trunk' into feature/rs-comment-e…
nbradbury Jul 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.wordpress.android.ui.bloggingreminders.BloggingReminderBottomSheetFragment;
import org.wordpress.android.ui.bloggingreminders.BloggingReminderTimePicker;
import org.wordpress.android.ui.comments.CommentDetailFragment;
import org.wordpress.android.ui.comments.unified.EditCancelDialogFragment;
import org.wordpress.android.ui.comments.unified.UnifiedCommentDetailsFragment;
import org.wordpress.android.ui.comments.unified.UnifiedCommentListAdapter;
import org.wordpress.android.ui.comments.unified.UnifiedCommentListFragment;
Expand Down Expand Up @@ -489,8 +488,6 @@ public interface AppComponent {

void inject(UnifiedCommentsEditFragment object);

void inject(EditCancelDialogFragment object);

void inject(BloggingReminderBottomSheetFragment object);

void inject(LocalePickerBottomSheet object);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ data class CommentEssentials(
val userName: String = "",
val commentText: String = "",
val userUrl: String = "",
val userEmail: String = "",
val isFromRegisteredUser: Boolean = true
val userEmail: String = ""
) {
/**
* Checks if this instance of CommentEssentials is valid. An invalid instance should not be used to display data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,63 @@ class CommentsRsDataSource @Inject constructor(
suspend fun updateStatus(site: SiteModel, commentId: Long, status: CommentStatus): RsResult =
write(site) { it.comments().update(commentId, CommentUpdateParams(status = status.toRsCommentStatus())) }

/** Editable author-identity fields, applied to the comment record for any comment. */
data class CommentAuthor(val name: String, val email: String, val url: String)

/**
* The server's post-save state of an edited comment. Mirroring this (rather than the values
* that were sent) into the FluxC cache keeps the cache faithful when the server normalises
* fields — e.g. content passes through KSES filtering.
*/
data class RsEditedComment(
val authorName: String,
val authorEmail: String,
val authorUrl: String,
val contentRaw: String
)

/** Result of editing a comment, carrying the server's resulting state on success. */
sealed interface RsEditResult {
data class Success(val comment: RsEditedComment) : RsEditResult
data class Error(val message: String?) : RsEditResult
}

/** Edits a comment's body and author identity, returning the state the server stored. */
suspend fun updateComment(
site: SiteModel,
commentId: Long,
content: String,
author: CommentAuthor
): RsEditResult = safe(errorValue = RsEditResult.Error(null)) {
val client = wpApiClientProvider.getWpApiClient(site)
val result = client.request {
it.comments().update(
commentId,
CommentUpdateParams(
content = content,
authorName = author.name,
authorEmail = author.email,
authorUrl = author.url
)
)
}
when (result) {
is WpRequestResult.Success -> {
val serverComment = result.response.data
RsEditResult.Success(
RsEditedComment(
authorName = serverComment.authorName,
authorEmail = serverComment.authorEmail,
authorUrl = serverComment.authorUrl,
contentRaw = serverComment.content.raw
)
)
}
is WpRequestResult.WpError -> RsEditResult.Error(result.errorMessage)
else -> RsEditResult.Error(null)
}
}

suspend fun delete(site: SiteModel, commentId: Long): RsResult =
write(site) { it.comments().delete(commentId, CommentDeleteParams()) }

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import android.view.ViewGroup
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.material3.SnackbarDuration
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.SnackbarResult
import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.runtime.mutableStateOf
Expand All @@ -24,8 +22,6 @@ import androidx.compose.ui.text.input.TextFieldValue
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.lifecycleScope
import com.google.android.material.snackbar.BaseTransientBottomBar.BaseCallback
import com.google.android.material.snackbar.Snackbar
import kotlinx.coroutines.launch
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
Expand All @@ -43,6 +39,7 @@ import org.wordpress.android.ui.comments.unified.UnifiedCommentDetailsViewModel.
import org.wordpress.android.ui.comments.unified.compose.CommentDetailsActions
import org.wordpress.android.ui.comments.unified.compose.UnifiedCommentDetailsScreen
import org.wordpress.android.ui.compose.theme.AppThemeM3
import org.wordpress.android.ui.compose.utils.showMessage
import org.wordpress.android.ui.notifications.NotificationsListFragment
import org.wordpress.android.ui.pages.SnackbarMessageHolder
import org.wordpress.android.ui.reader.ReaderActivityLauncher
Expand Down Expand Up @@ -287,40 +284,11 @@ class UnifiedCommentDetailsFragment : Fragment() {

private fun showSnackbar(holder: SnackbarMessageHolder) {
val context = context ?: return
val message = uiHelpers.getTextOfUiString(context, holder.message).toString()
val actionLabel = holder.buttonTitle?.let { uiHelpers.getTextOfUiString(context, it).toString() }
viewLifecycleOwner.lifecycleScope.launch {
// MANUAL is reported when the view is torn down (e.g. rotation) while the snackbar is
// still showing: cancellation skips the try body, but the finally block still fires
// onDismissAction, matching the legacy Snackbar callback which fired on view detach.
// That matters for the load-error snackbar, whose dismiss action closes the screen.
var dismissEvent = BaseCallback.DISMISS_EVENT_MANUAL
try {
val result = snackbarHostState.showSnackbar(
message = message,
actionLabel = actionLabel,
duration = holder.duration.toSnackbarDuration()
)
dismissEvent = if (result == SnackbarResult.ActionPerformed) {
holder.buttonAction()
BaseCallback.DISMISS_EVENT_ACTION
} else {
BaseCallback.DISMISS_EVENT_TIMEOUT
}
} finally {
holder.onDismissAction(dismissEvent)
}
snackbarHostState.showMessage(holder, context, uiHelpers)
}
}

// Compose SnackbarDuration ignores the millisecond-style Snackbar length constants the holders
// carry, so map them explicitly to preserve the legacy LENGTH_LONG display time.
private fun Int.toSnackbarDuration(): SnackbarDuration = when (this) {
Snackbar.LENGTH_SHORT -> SnackbarDuration.Short
Snackbar.LENGTH_INDEFINITE -> SnackbarDuration.Indefinite
else -> SnackbarDuration.Long
}

private fun copyLink(url: String) {
if (url.isEmpty()) return
val clipboard = requireContext().getSystemService(ClipboardManager::class.java)
Expand Down
Loading
Loading