Skip to content

Post, Scheduled posts and To post today (#116) - #128

Merged
Oceandek merged 1 commit into
mainfrom
feat/scheduled-posts
Nov 12, 2026
Merged

Oceandek merged 1 commit into
mainfrom
feat/scheduled-posts

Conversation

@Oceandek

Copy link
Copy Markdown
Collaborator

Closes #116, part of spec #110 (Social media posts).

What's new

  • Post: the button on a suggestion waiting for Review, enabled only when there are no unsaved changes, so what is posted is what is saved. It puts the suggestion in Instagram's line. There is no "post right now".
  • The planner (services/posting.py, plan):
    • every Scheduled post gets the next free Posting time (the Superuser's Instagram weekdays and times) at least 10 minutes away;
    • posts are placed in the order they were Posted;
    • the same Project is never twice in a row: such a post swaps with the next one, also counting the last post before the line;
    • posts due within the 10 minutes keep their time when the line changes;
    • the line is re-planned on every Post and Pull back.
  • Scheduled posts screen (new navigation item for Teachers and the Superuser):
    • To post today on top: posts whose Posting time has come, with Download media, Copy caption (the title as the first line) and Posted, which records who and when and marks the medium as posted so it is never cleaned up;
    • below it, Scheduled: the line, with Pull back (back to Review; the others move up).
  • Job: an always-on background loop (every minute) moves due posts to to_post_by_hand. Automatic publishing comes in Social media: automatic publishing on Instagram #117.
  • Archiving a Project doesn't cancel its Scheduled post.
  • Migration 0025: post_suggestions.queued_at, scheduled_for, posted_by_id (SET NULL) and posted_at.

Tests

  • Backend: new test_scheduled_posts.py covers:
    • the next free Posting times, in order, on weekdays at 12:00/19:00 and at least 10 minutes away;
    • never the same Project twice in a row (Alpha, Alpha, Bravo becomes Alpha, Bravo, Alpha);
    • Pull back moving the others up into the same times;
    • due posts going to To post today, then Posted (posted_by, medium posted);
    • archiving not cancelling;
    • 409s for the wrong state, 403 for Students.
  • Frontend: new test_scheduled_posts.py covers:
    • Post disabled with unsaved changes, then the confirmation and "Scheduled for…";
    • Pull back from Scheduled posts;
    • To post today with Download media, Copy caption and Posted.
  • The full local suites were still running when this PR was opened (end of session). CI runs both.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Oceandek
Oceandek merged commit 9f96197 into main Nov 12, 2026
2 checks passed
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.

Social media: Post, Scheduled posts and To post today

1 participant