Skip to content

Conversation

@apoorvajainrp21
Copy link

@apoorvajainrp21 apoorvajainrp21 commented Nov 14, 2025

Description

This PR implements a comprehensive Truth Social Auto-Poster frontend component that enables users to compose, schedule, and manage Truth Social posts directly from the Highest Good Network application. The component provides a modern, feature-rich interface for content planning and social media management with full dark mode support and responsive design.
Note: Truth Social does not currently provide public API access. This frontend implementation is ready for integration once backend API endpoints are developed and Truth Social opens API access to third-party applications.

Related PRS (if any):

This is a frontend-only PR

Main changes explained:

New Files Created:

Create src/components/AutoPoster/TruthSocialAutoPoster.jsx - Main React component with post composition, scheduling, and management interface
Create src/components/AutoPoster/TruthSocialAutoPoster.module.css - CSS modules stylesheet with light/dark mode support and responsive design
Create src/services/truthSocialService.js - Service layer for Truth Social API communication with JWT authentication

Modified Files:

Update src/components/Announcements/index.jsx - Integrated Truth Social tab into existing tab navigation with icon and routing

How to test:

  • Checkout the feature-truth-social-autoposter-frontend branch
  • Run npm install to ensure all dependencies are installed
  • Run npm start to start the development server
  • Clear browser cache and site data (Ctrl+Shift+Delete)
  • Log in as an admin user (requires sendEmails permission)
  • Navigate to Announcements page
  • Click on the Truth Social tab (icon should be visible in tab list)

Verify the following features work correctly:

Compose Tab:

Post content textarea with character counter (0/500)
Character counter changes color: green → yellow (75%) → red (90%)
Tag suggestions appear after typing 10+ characters
Click suggested tags to add them to the tags field
All form inputs are functional (content, tags, media URL, visibility, sensitive checkbox)
Date/time picker for scheduling (calendar and clock icons visible)
Three action buttons: "Post Now", "Schedule Post", "Copy to Clipboard"
Form validation shows errors for empty content or 500+ characters

Scheduled Posts Tab:

Shows count of scheduled posts in tab title
Displays list of scheduled posts with date, status badge, and delete button
Shows "No scheduled posts yet" message when empty
Each post shows content preview and tags

API Settings Tab:

API token input field (password type)
"Save API Token" button
Info box with API documentation
Warning message about API access limitations

Dark Mode:

Toggle dark mode using the app's theme switcher
Verify all components change appearance:

Background becomes dark (#16181c)
Text becomes light (#e7e9ea)
Inputs have dark backgrounds
Calendar and clock icons are WHITE and visible (critical!)
Buttons maintain proper contrast
Status badges have appropriate dark mode colors

Screenshots or videos of changes:

https://github.com/user-attachments/assets/2ffdaf57-bf1e-43cb-b2d5-a68ff841ccbf
Screenshot 2025-11-12 205447
Screenshot 2025-11-12 205715
Screenshot 2025-11-12 205732
Screenshot 2025-11-12 205756
Screenshot 2025-11-12 205816

Note:

For Reviewers:
Backend Implementation Required:
This PR provides the complete frontend UI/UX. To make this feature fully functional, the following backend work is needed (separate PR):

API Routes (src/routes/truthSocialRoutes.js):

POST /api/truthsocial/post - Post immediately
POST /api/truthsocial/schedule - Schedule post
GET /api/truthsocial/scheduled - Get scheduled posts
DELETE /api/truthsocial/scheduled/:id - Delete post
POST /api/truthsocial/token - Save API token
GET /api/truthsocial/token - Get token (masked)

Database Schema Updates (UserProfile model):

truthSocialApiToken: String (with select: false)
scheduledTruthSocialPosts: [{ content, tags, scheduledFor, status, ... }]

Background Scheduler (node-cron):

Check for posts with scheduledFor <= now every minute
Post to Truth Social API
Update status to 'posted' or 'failed'

Dependencies: node-cron: ^3.0.3

Permissions:
Users need the sendEmails front permission to access this feature (defined in routePermissions.js).
Truth Social API Limitation:
Truth Social does not currently offer public API access. The component is designed to work with the Mastodon-compatible API specification that Truth Social is built upon. Until API access is available, users can:

Use the component for content planning and composition
Use "Copy to Clipboard" for manual posting
Schedule posts for tracking purposes

Code Quality:

Follows project ESLint rules
Uses CSS modules (.module.css) as required by project standards
Implements Redux for dark mode state management
Fully typed prop validation
No console errors or warnings
Passes Husky pre-commit hooks (with --no-verify for pre-push due to test environment)

Testing Considerations:

API calls will fail until backend is implemented (expected behavior)
Scheduled posts will save to state but not persist (no database)
"Post Now" will show appropriate error message about API access

@netlify
Copy link

netlify bot commented Nov 14, 2025

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 2281ca6
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/696eb73e45b75100080e0c5d
😎 Deploy Preview https://deploy-preview-4386--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@apoorvajainrp21 apoorvajainrp21 self-assigned this Nov 14, 2025
…eaderboard_blue_text_issue

Venkataramanan 🔥 intangible time to be blue in color in leaderboard
…als_kpi_buttons_phase2

Juhitha - Add Financials KPI tiles with isolated CSS and gated rendering
…skProfile

Vamsidhar - phase 2 Summary Dashboard: Fixed chart design and added percentage label for Y-axis
…lding_inventory_management_dashboard

Aayush dark mode to building and inventory management dashboard
…y-portal-access

Bhanu Anish - Kitchen and inventory portal access and Navbar
Venkataramanan Venkateswaran and others added 2 commits January 15, 2026 13:40
…arn/undici-7.18.2

Bump undici from 7.16.0 to 7.18.2
…olor_issue

siva : fix pie chart color issue
Venkataramanan Venkateswaran and others added 3 commits January 19, 2026 13:39
@sonarqubecloud
Copy link

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.