Skip to content

Rename CommentsDetailRouter to CommentDetailContext - #26029

Merged
crazytonyli merged 1 commit into
trunkfrom
task/comment-detail-context
Nov 16, 2026
Merged

crazytonyli merged 1 commit into
trunkfrom
task/comment-detail-context

Conversation

@crazytonyli

Copy link
Copy Markdown
Contributor

Description

Testing instructions

@dangermattic

dangermattic commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.

Generated by 🚫 Danger

@crazytonyli crazytonyli changed the title task/comment detail context Rename CommentsDetailRouter to CommentDetailContext Sep 18, 2026
@wpmobilebot

wpmobilebot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor
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
ConfigurationRelease-Alpha
Build Number34647
VersionPR #26029
Bundle IDorg.wordpress.alpha
Commit6de7953
Installation URL1jhvclfa1aomg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor
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
ConfigurationRelease-Alpha
Build Number34647
VersionPR #26029
Bundle IDcom.jetpack.alpha
Commit6de7953
Installation URL431sh52oseee8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@crazytonyli
crazytonyli force-pushed the task/comment-detail-context branch from 864fc18 to ea53437 Compare September 18, 2026 01:43
@crazytonyli
crazytonyli force-pushed the task/comment-detail-context branch from ea53437 to 6de7953 Compare September 24, 2026 08:52
@crazytonyli
crazytonyli force-pushed the task/comment-detail-context branch from 6de7953 to c4aef1e Compare October 28, 2026 22:25
@crazytonyli
crazytonyli force-pushed the task/comment-detail-context branch from c4aef1e to 01b0a42 Compare October 28, 2026 22:37
@crazytonyli
crazytonyli force-pushed the task/comment-detail-context branch from 01b0a42 to 9ff6f34 Compare October 28, 2026 23:53
@crazytonyli
crazytonyli force-pushed the task/comment-detail-context branch 2 times, most recently from 8a73b70 to 4546781 Compare November 10, 2026 01:03
@crazytonyli
crazytonyli requested a review from jkmassel November 10, 2026 21:26
@crazytonyli crazytonyli added this to the 27.5 milestone Nov 10, 2026
@crazytonyli
crazytonyli marked this pull request as ready for review November 10, 2026 21:26
@crazytonyli
crazytonyli force-pushed the task/comment-detail-context branch 3 times, most recently from 75a2eb3 to 823d563 Compare November 12, 2026 00:40

public var body: some View {
CommentsTabView(viewModels: context.listViewModels, router: context.detailRouter)
CommentsTabView(viewModels: context.listViewModels, context: context.detailContext)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Finding from Claude:

"Context" now means three different things in this module. The REST API's edit and view context shows up all through CommentsService and CommentDetailViewModel. There is also the private CommentsContext here, and now CommentDetailContext. So this line reads context.detailContext, and one level down, in CommentsTabView, CommentsListView and CommentDetailView, context is a different type.

Nit, not blocking: a name that doesn't reuse "context" would read more clearly, for example CommentDetailDependencies or CommentScreenFactory.

/// Shares dependencies across comment detail and parent destinations.
@MainActor
final class CommentsDetailRouter {
final class CommentDetailContext {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Finding from Claude:

The type does more than the name says. Besides detail screens, it builds review sessions and the review sheet (makeReviewSession, makeReviewView), and the list gets its titleResolver from it. The doc comment on line 3 ("comment detail and parent destinations") is out of date for the same reason. The file also stays in Services/ even though it builds views.

Nit, not blocking: consider a broader name, updating the doc comment, and moving the file next to the views.

@ObservedObject var viewModel: CommentsListViewModel
@ObservedObject var titleResolver: PostTitleResolver
let router: CommentsDetailRouter
let context: CommentDetailContext

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Finding from Claude:

CommentsListView takes both titleResolver and context, but its only caller passes context.titleResolver. So the same object goes in twice, and a caller could pass a resolver that doesn't match the context.

Nit, not blocking: drop the titleResolver parameter and read it from context.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Finding from Claude:

This one predates this PR. makeRenderer opens any link tapped in a comment with UIApplication.shared.open(url) (line 74). It doesn't check the link type or ask first. A comment is untrusted content, so a moderator who taps a tel:, sms: or another app's link while reviewing is sent straight to that app.

Not blocking for this rename, but worth a follow-up: allow only http/https, or confirm before opening anything else.

Base automatically changed from task/comments-v2-swiftui-navigation to trunk November 16, 2026 02:58
@crazytonyli
crazytonyli force-pushed the task/comment-detail-context branch from 823d563 to 5df8505 Compare November 16, 2026 02:58
@crazytonyli
crazytonyli added this pull request to the merge queue Nov 16, 2026
Merged via the queue into trunk with commit 2d4d3db Nov 16, 2026
21 checks passed
@crazytonyli
crazytonyli deleted the task/comment-detail-context branch November 16, 2026 03:22
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.

4 participants