Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish flow: ensure setting date to the past sets the status to draft #62151

Open
annezazu opened this issue May 30, 2024 · 4 comments
Open
Labels
Needs Decision Needs a decision to be actionable or relevant [Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended

Comments

@annezazu
Copy link
Contributor

annezazu commented May 30, 2024

In testing this PR for 6.6 #62070 I noticed that I could set the status to scheduled but then pick a date in the past and the scheduled status wouldn't update. I think the status should be "draft" since it's not yet published but curious for @WordPress/gutenberg-design feedback.

To replicate, set status to "Scheduled" then change the Publish date to the past or now. Notice the status remains as "Scheduled" while the Schedule/Publish button changes:

three.bugs.mov

^Note this shows two bugs I'm opening to give a full view of the current flow. cc @ntsekouras

@annezazu annezazu added the [Type] Bug An existing feature does not function as intended label May 30, 2024
@ntsekouras
Copy link
Contributor

In this PR I mention that there are still some nuances due to the many different possible flows.

This has some nuances similar to the problem it solves, but on the other way around. For example if a user sets the status to scheduled and not update the date, the final status will not be future. I think that's fine since the rendering of the control will be very prominent to the user to also select a date, but just mentioning.

Status and publish date are quite connected, but because they are different props we already have some side effects to update one when the other changes and we should see to refine holistically. That is because by handling a use case might cause other problems and the example for this specific case is:

  1. User opens post status panel and sets scheduled, so the time picker renders.
  2. User makes a mistake and chooses a past date
  3. Status goes to draft or whatever and the time picker is not rendered there now..

Having said that, with a temporary inconsistency created by the user, if they save, the status will be updated properly to reflect what it should be. I thought the direction is try to be a bit less 'smart' when trying to guess user intentions and not be too eager to update other props automatically.

Refining and unifying the publish flow has still lots of work and this is mostly due to the big complexity there. I'd suggest try to explore how we can do this holistically (when/how to be smart and auto update) and not try this for 6.6.

I'm happy to hear others' thoughts too for this one.

@jameskoster
Copy link
Contributor

I think this is another great example of why Status and Publish date should be combined in a single UI for unpublished posts. That UI should not allow incompatible date + status to be applied. Status updates should feel like more definitive actions, whether it's publishing, scheduling, or unpublishing. There's a Figma here with some longer-term concepts around these flows. Feedback very welcome!

With separate controls we open the door to all kinds of shenanigans, and (as Nik already mentioned) must include additional logic to conditionally update values in the background. This is confusing to use, and adds more code, lose/lose.

Having said that, with a temporary inconsistency created by the user, if they save, the status will be updated properly to reflect what it should be

This is what happens in wp-admin 'quick edit' experience and seems acceptable to me. A user choosing to schedule a post then selecting a date in the past is probably an edge case. Though it's worth noting in this flow the status is updated from scheduled to published rather than draft.

@annezazu
Copy link
Contributor Author

I think this is another great example of why Status and Publish date should be combined in a single UI for unpublished posts. That UI should not allow incompatible date + status to be applied. Status updates should feel like more definitive actions, whether it's publishing, scheduling, or unpublishing. There's a Figma here with some longer-term concepts around these flows. Feedback very welcome!

Very much agreed here.

Refining and unifying the publish flow has still lots of work and this is mostly due to the big complexity there. I'd suggest try to explore how we can do this holistically (when/how to be smart and auto update) and not try this for 6.6.

I hear you and don't want to switch things up too much either. With that said, I worry a bit about changing the flow for folks when it's the key part of using WordPress (publishing content) when these issues haven't been solved.

@jordesign jordesign added the [Package] Editor /packages/editor label Jun 2, 2024
@jameskoster
Copy link
Contributor

I feel this flow is in an acceptable spot for 6.6. The exact same problem has existed in wp-admin for years: you can quick-edit a scheduled post and set a publish date in the past. If you do this then the status automatically switches to published behind the scenes. It's definitely not ideal, but I have to question how often we expect users to intentionally do this?

The decision was made early in the 6.6 cycle to align publish flows around the site editor due to it's better handling of multi-entity saving. If we reverted this work to align with the post editor I fear we'll be creating a lot of headaches for ourselves down the road. It doesn't seem worth it to cater to what is arguably an edge case.

@colorful-tones colorful-tones added the Needs Decision Needs a decision to be actionable or relevant label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Decision Needs a decision to be actionable or relevant [Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended
Projects
No open projects
Status: 🗣️ In Discussion / Needs Decision
Development

No branches or pull requests

5 participants