aba01ed6 Fixed three publish flow defects found in review
no ref
The confirm button went to its success state before the email poll it was
still waiting on, so for up to fifteen seconds it read "Published & sent"
and stayed clickable — a second click dispatched the publish again. It now
holds its running state until the confirmation settles, and a succeeded
publish disables it outright. Ember's task button behaved this way already;
the port lost it by treating the acknowledged save as the end of the work.
A cancelled confirmation was treated as success. Cancellation only happens
when the flow is torn down, so closing the modal mid-poll wrote the
celebration handoff and told the caller to navigate, after the user had
left. It now completes nothing, and a `not-needed` outcome reports no email
so the caller does not route to analytics for a send that never happened.
The date picker mixed timezones: it handed the calendar the scheduled
instant, whose local getters read the browser's day, while committing the
picked day back onto a site-timezone moment. Wherever the two zones
disagreed the calendar highlighted one day and committed another. Both ends
now go through `siteCalendarDay`, which carries the site-timezone day in the
local fields a picker reads. Every existing spec used Etc/UTC, so this was
invisible; the mapping now has a unit test that does not depend on the
runner's zone, and the picker spec runs in two zones a day apart.
Also from the review: every request the flow makes opts out of the
session-expiry redirect and the global error handler, since the poller fires
once a second over an editor holding unsaved work and one 401 would
otherwise navigate away with it; the update flow reads the newsletter from
the post rather than the options machine, which can never yield an archived
one, and ports Ember's sentence naming an earlier send; the options step
renders a host limit through the same typed parts the confirm step uses; and
continuing to the review waits for the limit checks that can demote the
publish type. aba01ed6 Fixed three publish flow defects found in review
no ref
The confirm button went to its success state before the email poll it was
still waiting on, so for up to fifteen seconds it read "Published & sent"
and stayed clickable — a second click dispatched the publish again. It now
holds its running state until the confirmation settles, and a succeeded
publish disables it outright. Ember's task button behaved this way already;
the port lost it by treating the acknowledged save as the end of the work.
A cancelled confirmation was treated as success. Cancellation only happens
when the flow is torn down, so closing the modal mid-poll wrote the
celebration handoff and told the caller to navigate, after the user had
left. It now completes nothing, and a `not-needed` outcome reports no email
so the caller does not route to analytics for a send that never happened.
The date picker mixed timezones: it handed the calendar the scheduled
instant, whose local getters read the browser's day, while committing the
picked day back onto a site-timezone moment. Wherever the two zones
disagreed the calendar highlighted one day and committed another. Both ends
now go through `siteCalendarDay`, which carries the site-timezone day in the
local fields a picker reads. Every existing spec used Etc/UTC, so this was
invisible; the mapping now has a unit test that does not depend on the
runner's zone, and the picker spec runs in two zones a day apart.
Also from the review: every request the flow makes opts out of the
session-expiry redirect and the global error handler, since the poller fires
once a second over an editor holding unsaved work and one 401 would
otherwise navigate away with it; the update flow reads the newsletter from
the post rather than the options machine, which can never yield an archived
one, and ports Ember's sentence naming an earlier send; the options step
renders a host limit through the same typed parts the confirm step uses; and
continuing to the review waits for the limit checks that can demote the
publish type. 3dba92df Added the editor publish flow modal to the React admin
no ref
The React editor can save a post but has no way to change its status. This
adds the publish flow itself — options, confirm, complete, and the email
failure step — plus the update flow that reverts a published or scheduled
post, as self-contained components over the publish options machine and the
email confirmation poller that already landed.
Nothing mounts them yet. The editor header is being ported in parallel, and
wiring belongs with the publish buttons that open these modals, so this PR
stops at the components and their tests. The seam is a single `dispatch`
prop taking the save engine's command: the flow branches on the completion
kind it gets back and never reaches into the engine, the editor session or
the router. Where the user lands after publishing is the caller's decision;
the flow only writes the localStorage handoff the posts list already reads.
Copy, states and options follow the Ember flow closely enough to swap one
for the other, including the details that are easy to lose: the "all"
prefix that appears in the confirm sentence but only for a plural count in
the collapsed row, the button text that keeps its publish-type idle copy
while taking the schedule's running and success copy, and the TK gate
suppressing the public-preview warning rather than stacking with it.
Two things are deliberately left: the email size warning renders its slot
but not the estimate, which needs the Ember service ported, and the host
limit ports are unset until the flow has a caller to supply them. 3dba92df Added the editor publish flow modal to the React admin
no ref
The React editor can save a post but has no way to change its status. This
adds the publish flow itself — options, confirm, complete, and the email
failure step — plus the update flow that reverts a published or scheduled
post, as self-contained components over the publish options machine and the
email confirmation poller that already landed.
Nothing mounts them yet. The editor header is being ported in parallel, and
wiring belongs with the publish buttons that open these modals, so this PR
stops at the components and their tests. The seam is a single `dispatch`
prop taking the save engine's command: the flow branches on the completion
kind it gets back and never reaches into the engine, the editor session or
the router. Where the user lands after publishing is the caller's decision;
the flow only writes the localStorage handoff the posts list already reads.
Copy, states and options follow the Ember flow closely enough to swap one
for the other, including the details that are easy to lose: the "all"
prefix that appears in the confirm sentence but only for a plural count in
the collapsed row, the button text that keeps its publish-type idle copy
while taking the schedule's running and success copy, and the TK gate
suppressing the public-preview warning rather than stacking with it.
Two things are deliberately left: the email size warning renders its slot
but not the estimate, which needs the Ember service ported, and the host
limit ports are unset until the flow has a caller to supply them.