Skip to content

Refresh recent drafts after publishing to WordPress#183

Merged
jorgefilipecosta merged 1 commit into
trunkfrom
fix/refresh-sidebar-after-publish
May 20, 2026
Merged

Refresh recent drafts after publishing to WordPress#183
jorgefilipecosta merged 1 commit into
trunkfrom
fix/refresh-sidebar-after-publish

Conversation

@tyxla
Copy link
Copy Markdown
Member

@tyxla tyxla commented May 20, 2026

Summary

  • A successful WordPress publish moves the source file from drafts/ to done/ (via moveDraftToDone in the publish IPC handler), but the sidebar's Recent drafts list kept showing the now-stale drafts/ entry. Clicking it opened a broken link.
  • Hook refreshRecent() into the existing onPublishedAndMoved callback in App.tsx so the moved file drops off the list immediately. drafts.listAll() already scans only the drafts/ folder, so re-fetching is enough — no main-process change needed.
  • Mirrors the same refreshRecent() trigger already used after chat creation, rename, and project changes.

Fixes #159

Test plan

  • Open a project, send a draft to a WordPress connection from the Share panel
  • Verify the publish succeeds and the editor stays on the same document (now in done/)
  • Verify the draft is no longer listed under Recent drafts in the sidebar (without needing to switch projects or reload the window)
  • If the project has additional drafts, confirm the next most recent one slides into the sidebar slot

🤖 Generated with Claude Code

A successful WordPress publish moves the source file from drafts/ to
done/, but the sidebar's "Recent drafts" list was cached and kept
showing the now-stale drafts/ entry until the next unrelated refresh
trigger. Hook refreshRecent() into the onPublishedAndMoved callback so
the moved file drops out of the list immediately.

Fixes #159

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tyxla tyxla self-assigned this May 20, 2026
@tyxla tyxla added the enhancement New feature or request label May 20, 2026
@jorgefilipecosta jorgefilipecosta merged commit 16d8c18 into trunk May 20, 2026
@jorgefilipecosta jorgefilipecosta deleted the fix/refresh-sidebar-after-publish branch May 20, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refresh sidebar after a post is published so the draft is removed from recent drafts

2 participants