You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deferred from #323 (posts vertical convergence). During #323 review we noticed the
post read/result DTOs and the #[server] arg wrappers are named for their role in
the plumbing (*Result, *Response, args) rather than for what they are — the FooManager smell. Splitting this out so it gets its own focused review + e2e pass
rather than riding on #323's large convergence PR (which does the reorg; this does the renaming/remodeling).
PostResponse is the lone read DTO named by transaction-role. Its siblings are DraftSummary / TimelinePostSummary (*Summary). Its own doc says "Details of a
post." → rename to PostDetails (PostView collides with the render-twin struct).
CreatePostResult and UpdatePostResult differ by exactly one field
(CreatePostResult.created_at) — and created_at may not even be read by the create
client. They're the same thing (the saved post's identity + links: post_id, slug,
preview/permalink URLs) wearing two names. → collapse into ONE type named for what it
is (e.g. SavedPost / PostRef / PostLinks); confirm whether created_at is used
and drop it if not. PublishPostResult is a genuinely narrower shape (publish always
yields a published post, so published_at/permalink are non-optional) — either
fold it into the unified type with optionals or keep it as the one real special case.
More broadly: audit the posts DTO family and drop *Result/*Response role-suffixes
in favor of shape/noun names, consistent with *Summary.
Rename PostResponse → PostDetails (also touches the shared render layer: PageSeed::Permalink(PostResponse) in render/mod.rs).
Unify CreatePostResult + UpdatePostResult (and consider PublishPostResult) into one
well-named type; drop the *Result/*Response suffixes across the posts DTOs.
Acceptance
No posts DTO named by transaction-role (*Result/*Response); no generic args wire key.
One saved-post result type for create/update (publish reconciled).
cargo xtask validate green incl. the create/edit/publish/draft posts e2e (the wire
changes are verified end-to-end).
Notes
Purely naming/modeling — no behavior change. Blocked-by #323 (do it on the converged
layout).
Deferred from #323 (posts vertical convergence). During #323 review we noticed the
post read/result DTOs and the
#[server]arg wrappers are named for their role inthe plumbing (
*Result,*Response,args) rather than for what they are — theFooManagersmell. Splitting this out so it gets its own focused review + e2e passrather than riding on #323's large convergence PR (which does the reorg; this does the
renaming/remodeling).
Observations
create_post/update_postwire arg is namedargs({"args": {…}}on the wire,from Remove too_many_arguments #[allow] from the create_post/update_post #[server] fns (#94 follow-up) #299's arg-struct fold). Generic — the endpoint already says it's the arguments.
→ name it for the noun:
post({"post": {…}}),create_post(post: CreatePostArgs).PostResponseis the lone read DTO named by transaction-role. Its siblings areDraftSummary/TimelinePostSummary(*Summary). Its own doc says "Details of apost." → rename to
PostDetails(PostViewcollides with the render-twin struct).CreatePostResultandUpdatePostResultdiffer by exactly one field(
CreatePostResult.created_at) — andcreated_atmay not even be read by the createclient. They're the same thing (the saved post's identity + links:
post_id,slug,preview/permalink URLs) wearing two names. → collapse into ONE type named for what it
is (e.g.
SavedPost/PostRef/PostLinks); confirm whethercreated_atis usedand drop it if not.
PublishPostResultis a genuinely narrower shape (publish alwaysyields a published post, so
published_at/permalinkare non-optional) — eitherfold it into the unified type with optionals or keep it as the one real special case.
*Result/*Responserole-suffixesin favor of shape/noun names, consistent with
*Summary.Scope
create_post/update_postwire argargs→post(updates the Rustdispatch sites, the TS e2e helpers, and the server integration tests that POST directly
— same set Remove too_many_arguments #[allow] from the create_post/update_post #[server] fns (#94 follow-up) #299 touched).
PostResponse→PostDetails(also touches the shared render layer:PageSeed::Permalink(PostResponse)inrender/mod.rs).CreatePostResult+UpdatePostResult(and considerPublishPostResult) into onewell-named type; drop the
*Result/*Responsesuffixes across the posts DTOs.Acceptance
*Result/*Response); no genericargswire key.cargo xtask validategreen incl. the create/edit/publish/draft posts e2e (the wirechanges are verified end-to-end).
Notes
Purely naming/modeling — no behavior change. Blocked-by #323 (do it on the converged
layout).