📰 NewsStack

A secure, login-protected curation & publishing tool for This Week In Chia. Curators review posts from multiple X accounts, make keep/hide decisions, generate exact TWIC-style <li class='post'> blocks, and batch-publish while maintaining full state and audit trail — all without exposing internals.

Live Curation Deck
Rich Embeds
LiGenerator + Batch
LIFO Undo + Counts
🔒
Secure Auth & Deploys

Current Capabilities (High-Level)

🃏
Focused Curation Deck
Prominent top card + queue below. Dedicated action bar + per-card buttons. Keyboard (letters + arrows) with modifier keys ignored. Top card always the focus for actions.
🐦
Rich Tweet Embeds
Cards render real embedded tweets via official blockquote + widgets (images, video, formatting, quotes) so review decisions are made on the actual content experience.
✍️
TWIC-Style <li> Output
LiGenerator produces canonical single-line <li class='post'> blocks (emojis, categories, &mdash;, Source links, special GitHub/YouTube/Zoom handling). Reverse chronological. Blank line between different dates.
🚀
Generate & Publish Flow
Per-item Generate <li> / Publish & Append plus Generate All + Publish All. No popups - button text feedback only ("Published N!", "Nothing to publish"). Optimistic UI moves on Accept. Auto-generates missing on Publish All.
📊
Live Counts & True Undo
Inline heading row: "Curation Stack Pending (n) | Accepted (n) | Rejected (n)" (anchor scrolls the stack to top). ActionHistory LIFO undo truly reverts the last processed item (Accept or Reject) back to pending top.
🔐
Secure Auth + Reliable Deploys
Proper session cookie scoping for subfolder. Logout fully works (public visitors see only the login form). Windows-to-Linux deploy script never ships vendor/, always runs composer on server as www-data, uses root-owned post-deploy wrapper + minimal non-interactive sudoers (no password prompts, no daily mail alerts).

Live Tool

The full authenticated curation dashboard (login required) is at:

https://twic.website/newsstack/

(Authenticated curators only - data, state, and actions stay private.)

📅 Daily Progress Log

High-level notes only. We keep sensitive implementation details, methods, and keys off the public page for security.

🎯 Tonight - Final Polish and Redesign Update
- Moved Accepted + Rejected counts inline into the same row as the "Curation Stack" anchor so all three counts are visible at scroll-to-top position.
- 4-button layout now matches arrow semantics (Reject left, then Pending, Undo, Accept right) with arrows shown in button labels.
- True LIFO "Undo last" now correctly reverts the most recent processed item (whether accepted or rejected) using action history covering both.
- Eliminated every popup (no more alert/confirm on Generate All or Publish All). Pure button-text feedback + list clearing + count updates.
- Blank-line date grouping in published output preserved correctly (sanitize individual li first, then group with leading newline, re-apply in append step).
- Updated this redesign page with all the latest progress (high-level only) and called it a night.
📅 Recent - Rich Embeds + Precise Publishing
- Pulled the temporary script's blockquote + twttr.widgets.load() embed logic into the live curation cards (much better visual review).
- LiGenerator (PHP) + append flow now guarantees single-line li elements (str_replace on newlines to space both in generator and on publish).
- Publish output is reverse chronological + inserts a blank line (via newline) between groups of different dates.
- Accepted section with optimistic move on Accept, per-item + Generate All / Publish All, and authenticated "View / Copy Generated HTML" viewer (data/accepted.html stays Forbidden to the public).
📅 Recent - Live Curation + Feedback
- Focused top-of-stack card treatment + prominent action bar above the queue.
- Keyboard support: A or right-arrow = Accept, R or left-arrow = Reject, P or down-arrow = Pending/Return, U or up-arrow = Undo (Ctrl/Alt/Meta ignored so hard refreshes don't trigger actions).
- Live inline counts + top stat cards update on every action (no more stale "Pending Items in Stack" after F5 or operations).
- Logout fixed so unauthenticated visitors reliably see the login form (proper cookie path scoping + multi-path expire on logout).
- "Undo last" switched from last-accepted-only to true last-processed via actionHistory.
📅 Foundation - Deploys and Core Loop
- Full end-to-end: stack load, A/R/P/U decisions with real persistence (CurationEngine + JsonFileRepository + FileMerger), Generate li, Publish and Append.
- Deploy.ps1 + newsstack-post-deploy wrapper: safe robocopy/scp, never copies vendor/, chown/chmod first, composer as www-data, apache graceful. Split commands so sudoers matches exactly.
- Clean minimal sudoers (Cmnd_Alias lines + single user line) that is fully non-interactive - no password prompts and no more daily "password is required" emails on every deploy.
- Secure subfolder hosting (/newsstack/), .htaccess blocks on src/data/logs, proper session handling.

🔒 Security and Transparency Note

This page describes high-level progress only. Implementation details, internal tooling, authentication methods, deploy secrets, exact sudoers content, wrapper scripts, and any novel approaches stay private. The live curation tool itself requires authentication and is not publicly indexed or linked from the main site root.

Built with the same care as the newsletter itself. The real work happens inside the authenticated NewsStack at twic.website/newsstack/.