Repository navigation
Rename CommentsDetailRouter to CommentDetailContext - #26029
Conversation
Generated by 🚫 Danger |
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 34647 | |
| Version | PR #26029 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 6de7953 | |
| Installation URL | 1jhvclfa1aomg |
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 34647 | |
| Version | PR #26029 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 6de7953 | |
| Installation URL | 431sh52oseee8 |
864fc18 to
ea53437
Compare
ea53437 to
6de7953
Compare
6de7953 to
c4aef1e
Compare
c4aef1e to
01b0a42
Compare
01b0a42 to
9ff6f34
Compare
8a73b70 to
4546781
Compare
75a2eb3 to
823d563
Compare
|
|
||
| public var body: some View { | ||
| CommentsTabView(viewModels: context.listViewModels, router: context.detailRouter) | ||
| CommentsTabView(viewModels: context.listViewModels, context: context.detailContext) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
823d563 to
5df8505
Compare


Description
Testing instructions