Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 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
b9163ab
Convert the unified comment edit screen to Compose
nbradbury Jul 8, 2026
74539bc
Keep comment author fields always editable
nbradbury Jul 8, 2026
4d933a2
Centre the More action in its slot
nbradbury Jul 8, 2026
27f78b2
Merge branch 'feature/rs-comment-detail-compose' into feature/rs-comm…
nbradbury Jul 8, 2026
261673e
Save site-comment edits through wordpress-rs
nbradbury Jul 9, 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,13 +16,12 @@
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;
import org.wordpress.android.ui.comments.unified.UnifiedCommentsActivity;
import org.wordpress.android.ui.comments.unified.UnifiedCommentsDetailsActivity;
import org.wordpress.android.ui.comments.unified.UnifiedCommentsEditFragment;
import org.wordpress.android.ui.comments.unified.UnifiedCommentsEditActivity;
import org.wordpress.android.ui.debug.cookies.DebugCookiesFragment;
import org.wordpress.android.ui.domains.DomainRegistrationDetailsFragment;
import org.wordpress.android.ui.domains.DomainRegistrationResultFragment;
Expand Down Expand Up @@ -487,9 +486,7 @@ public interface AppComponent {

void inject(UnifiedCommentListAdapter object);

void inject(UnifiedCommentsEditFragment object);

void inject(EditCancelDialogFragment object);
void inject(UnifiedCommentsEditActivity object);

void inject(BloggingReminderBottomSheetFragment object);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import uniffi.wp_api.CommentDeleteParams
import uniffi.wp_api.CommentListParams
import uniffi.wp_api.CommentRetrieveParams
import uniffi.wp_api.CommentUpdateParams
import uniffi.wp_api.CommentWithEditContext
import uniffi.wp_api.CommentWithViewContext
import uniffi.wp_api.PostEndpointType
import uniffi.wp_api.PostListParams
Expand Down Expand Up @@ -59,6 +60,18 @@ class CommentsRsDataSource @Inject constructor(
val status: CommentStatus
)

/**
* A comment's editable fields, loaded with the edit context so the author email (absent from
* the view context) and the raw (unrendered) content are available for the edit form.
*/
data class RsCommentEdit(
val remoteCommentId: Long,
val content: String,
val authorName: String,
val authorEmail: String,
val authorUrl: String
)

/** Result of a write request, carrying the server error message when one is available. */
sealed interface RsResult {
object Success : RsResult
Expand Down Expand Up @@ -88,6 +101,24 @@ class CommentsRsDataSource @Inject constructor(
}
}

/**
* Loads a comment's editable fields with the edit context. Unlike [getComment] (view context)
* this includes the author email and the raw content the edit form needs, and works on the
* self-hosted application-password sites the FluxC edit path can't reach.
*/
suspend fun getCommentForEdit(site: SiteModel, commentId: Long): RsCommentEdit? =
safe(errorValue = null) {
val client = wpApiClientProvider.getWpApiClient(site)
when (
val result = client.request {
it.comments().retrieveWithEditContext(commentId, CommentRetrieveParams())
}
) {
is WpRequestResult.Success -> result.response.data.toRsCommentEdit()
else -> null
}
}

/**
* Fetches one page of the site's comments. Pass [firstPageParams] for the first page and the
* previous page's [RsCommentsPageResult.Success.nextPageParams] for subsequent pages.
Expand Down Expand Up @@ -206,6 +237,31 @@ class CommentsRsDataSource @Inject constructor(
suspend fun updateStatus(site: SiteModel, commentId: Long, status: CommentStatus): RsResult =
write(site) { it.comments().update(commentId, CommentUpdateParams(status = status.toRsCommentStatus())) }

/**
* Edits a comment's content and author fields. [CommentUpdateParams] is an all-nullable PATCH,
* so only these four fields are sent — status/parent/etc. are left untouched. Named arguments
* are required: the constructor's positional order differs from this field list.
*/
@Suppress("LongParameterList")
suspend fun editComment(
site: SiteModel,
commentId: Long,
content: String,
authorName: String,
authorEmail: String,
authorUrl: String
): RsResult = write(site) {
it.comments().update(
commentId,
CommentUpdateParams(
content = content,
authorName = authorName,
authorEmail = authorEmail,
authorUrl = authorUrl
)
)
}

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

Expand Down Expand Up @@ -257,6 +313,15 @@ internal fun CommentWithViewContext.toRsComment() = CommentsRsDataSource.RsComme
status = status.toAppCommentStatus()
)

internal fun CommentWithEditContext.toRsCommentEdit() = CommentsRsDataSource.RsCommentEdit(
remoteCommentId = id,
// Raw (unrendered) content is the editable source, matching wp-admin's comment editor.
content = content.raw,
authorName = authorName,
authorEmail = authorEmail,
authorUrl = authorUrl
)

internal fun CommentWithViewContext.pickAvatarUrl(): String =
(authorAvatarUrls[UserAvatarSize.Size96] ?: authorAvatarUrls.values.firstOrNull { !it.isNullOrEmpty() }).orEmpty()

Expand Down

This file was deleted.

Loading
Loading