Skip to content

fix(posts): drop redundant 'publishing' toast on publish#40

Merged
paulocastellano merged 2 commits into
mainfrom
fix/remove-redundant-publish-toast
May 15, 2026
Merged

fix(posts): drop redundant 'publishing' toast on publish#40
paulocastellano merged 2 commits into
mainfrom
fix/remove-redundant-publish-toast

Conversation

@paulocastellano
Copy link
Copy Markdown
Contributor

Why

When you publish a post, you land on Show.vue which already renders a full-screen overlay (`isPublishing` block — spinner + 'Seu post está sendo publicado' + subtitle) while `post.status === 'publishing'`. The flash toast was saying the same thing transiently, adding visual noise.

Compounding this: each platform job emits 2+ Echo broadcasts during publish (`PostPlatformStatusUpdated`), and Show.vue's listener does `router.visit({ only: ['post'] })` per event. Multiple partial reloads make the page feel busy. Removing the toast won't fix the over-broadcasting (that's a separate concern — see below), but it removes the redundant signal that was the visible irritation.

Changes

  • `PostController::update` drops `session()->flash('flash.banner', ...)` for the `Publishing` action. The redirect to `app.posts.show` is unchanged.
  • Drop the orphan `posts.flash.publishing` key from `lang/en|pt-BR|es/posts.php`.
  • `Scheduled` action keeps its flash — no overlay equivalent on Show.vue.

Follow-up (not in this PR)

The over-broadcasting in `PublishToSocialPlatform` (6 `broadcastStatus()` call sites, ~2 broadcasts per platform in the happy path) causes N partial reloads on the frontend per publish. Fix ideas:

  1. Include status + url + error in `PostPlatformStatusUpdated::broadcastWith()` so the frontend patches local state instead of reloading.
  2. Reduce the broadcast cadence to just the terminal state per platform.
  3. Debounce `router.visit` on the Echo listener.

Notifications module is already gated to fire once per post (only when all platforms finish — see `PublishToSocialPlatform::updatePostStatus` lines 217-219), so that part is fine.

Test plan

  • Full suite: 1542 passing
  • Publish a post → land on Show.vue → overlay shows, no toast
  • Schedule a post → land on Show.vue → toast shows (unchanged behavior)
  • Grep clean: no other `posts.flash.publishing` references

Show.vue already renders a full-screen overlay with spinner + the same
'post is being published' messaging while post.status === 'publishing'.
The flash toast was saying the same thing transiently — duplicate UX
that also contributed to the visual noise as Echo events triggered
partial reloads.

- Remove session()->flash() for the Publishing action in PostController
- Drop the now-orphan 'flash.publishing' key from en/pt-BR/es

Scheduled-action flash kept (Show.vue has no equivalent overlay for it).
@paulocastellano paulocastellano merged commit 626da2c into main May 15, 2026
2 checks passed
@paulocastellano paulocastellano deleted the fix/remove-redundant-publish-toast branch May 15, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant