Skip to content

Add publora extension - #21066

Closed
T0ha wants to merge 7 commits into
raycast:mainfrom
T0ha:ext/publora
Closed

T0ha wants to merge 7 commits into
raycast:mainfrom
T0ha:ext/publora

Conversation

@T0ha

@T0ha T0ha commented Aug 20, 2025 •

Copy link
Copy Markdown
Contributor

Description

Helps to managed and schedule social media posts through Publora.
Currently, supports only scheduling new post due to API limitations.
Going to add searching and management existing stuff.

Screencast

Screenshot

Checklist

- Prepared for publishing
- Added characters counter
- Added drafting posts
- First working prototype
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Aug 20, 2025
@raycastbot

raycastbot commented Aug 20, 2025 •

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

You can expect an initial review within five business days.

Once the PR is approved and merged, the extension will be available on our Store.

@T0ha
T0ha marked this pull request as ready for review August 20, 2025 14:06

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR introduces a new Publora extension that enables users to schedule social media posts directly from Raycast. The extension integrates with Publora's API to fetch connected social media platforms (Twitter/X, BlueSky, Mastodon, LinkedIn) and schedule posts across multiple platforms simultaneously.

The extension follows standard Raycast patterns with proper file structure including package.json configuration, TypeScript interfaces, API wrapper functions, and a React form component. The main functionality is provided through a single "Schedule Post" command that presents a form interface with content input, date/time picker, platform selection, and draft support.

The implementation uses Raycast's form components, cached state management for platform data, and integrates with Publora's REST API endpoints for fetching platforms and creating scheduled posts. The extension requires users to provide their Publora API key through preferences for authentication.

PR Description Notes:

  • The PR description is missing the required summary and screencast sections - only placeholder comments are provided

Important Files Changed

File Changes
Filename Score Overview
extensions/publora/package.json 3/5 New extension configuration with typo in command description ('shedule' instead of 'schedule')
extensions/publora/src/schedule-post.tsx 1/5 Main form component with critical async/error handling issues in handleSubmit function
extensions/publora/src/api.tsx 2/5 API wrapper functions with incomplete error handling and missing response validation
extensions/publora/src/types.tsx 5/5 Clean TypeScript interfaces for Post and Platform data structures
extensions/publora/README.md 2/5 Standard README but extension has missing screenshots and error handling issues
extensions/publora/CHANGELOG.md 4/5 Properly formatted changelog with correct {PR_MERGE_DATE} template
extensions/publora/.prettierrc 5/5 Standard Raycast Prettier configuration
extensions/publora/.gitignore 5/5 Comprehensive gitignore following Raycast conventions
extensions/publora/TODO.md 4/5 Well-documented future feature plans

Confidence score: 1/5

  • This PR has critical issues that will cause immediate problems in production use
  • Score reflects serious async/error handling bugs in core functionality that could crash the extension
  • Pay close attention to src/schedule-post.tsx and src/api.tsx for error handling fixes before merge

Context used:

Rule - Extensions must include at least one screenshot in a metadata folder for store submission. (link)
Rule - Extensions must include at least one screenshot in a metadata folder for store submission. (link)

9 files reviewed, 3 comments

Edit Code Review Bot Settings | Greptile

Comment thread extensions/publora/package.json Resolved
Comment thread extensions/publora/src/api.tsx Resolved
@T0ha

T0ha commented Aug 24, 2025 •

Copy link
Copy Markdown
Contributor Author

@greptilebot, I've fixed issues, pls, review

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This review covers only the changes made since the last review (commit 7e48053), not the entire PR.

The recent changes address all the critical issues identified in the previous review. The developer has properly implemented async/await error handling in the handleSubmit function, ensuring that the form state is only cleared after successful API calls and providing appropriate user feedback for both success and failure scenarios. The fetchPlatforms function now includes proper response status checking with meaningful error messages. Additionally, a spelling error in the command description has been corrected from 'shedule' to 'schedule'.

These changes significantly improve the robustness of the extension by preventing data loss when API calls fail and ensuring users receive proper feedback about the status of their operations. The error handling patterns now follow Raycast best practices and create consistency across the API module.

Important Files Changed

Click to expand
Filename Score Overview
extensions/publora/src/schedule-post.tsx 4/5 Fixed critical async/await handling and added proper error handling to prevent form clearing on API failures
extensions/publora/src/api.tsx 4/5 Added response status checking to fetchPlatforms function to handle API errors gracefully
extensions/publora/package.json 5/5 Fixed typo in command description from 'shedule' to 'schedule'

Confidence score: 4/5

  • This PR addresses all previously identified issues and is safe to merge with minimal risk
  • Score reflects solid error handling improvements and proper async patterns that enhance user experience
  • All files show appropriate fixes without introducing new issues or complexity

3 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

Comment thread extensions/publora/src/api.tsx Resolved

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use useForm for the form to help with validation, errors and states - also if API key is wrong there is no warning about that

T0ha added 2 commits August 29, 2025 09:07
- Deps updated
- TODO updated
- Fix lint
- Toast errors from JSON
- Refactored to useForm and added validation
@T0ha

T0ha commented Aug 29, 2025

Copy link
Copy Markdown
Contributor Author

@greptilebot, I've fixed issues, pls, review

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

Note: This review covers only the changes made since commit 4aa2d54, not the entire PR.

The recent changes to the Publora extension include several refinements and improvements. The most significant change is a comprehensive refactoring of the form handling in schedule-post.tsx from manual state management to using Raycast's useForm hook. This brings automatic validation, draft support, and platform-specific character limits for different social media platforms (Twitter/X: 280, Bluesky: 300, Threads: 500 characters).

Additionally, the Post interface in types.tsx was updated to make the scheduledTime property optional (Date | null), enabling more flexible posting options including immediate posting and draft creation. Minor improvements were made to error handling in api.tsx by correcting the error message field from errorData.message to errorData.error to match the actual API response format. Finally, a completed TODO item for "Post length validation for different social media platforms" was removed from the documentation, indicating this feature has been successfully implemented.

Important Files Changed

Files Changed
Filename Score Overview
extensions/publora/TODO.md 5/5 Removed completed task for post length validation from TODO list
extensions/publora/src/types.tsx 4/5 Made scheduledTime property optional (Date | null) in Post interface
extensions/publora/src/api.tsx 4/5 Fixed error message handling to use 'error' field instead of 'message' field
extensions/publora/src/schedule-post.tsx 4/5 Major refactor to use useForm hook with platform-specific character validation

Confidence score: 4/5

  • This PR contains solid improvements with good form validation and error handling enhancements
  • Score reflects well-structured refactoring to modern Raycast patterns with useForm hook
  • Pay close attention to schedule-post.tsx for the comprehensive form handling changes and validation logic

4 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@T0ha

T0ha commented Aug 29, 2025

Copy link
Copy Markdown
Contributor Author

@pernielsentikaer @LitoMore I've refactored to useForm and added validation and API key error. But I couldn't find a way to clear form after successful schedule. Could you, pls, suggest the way?

@pernielsentikaer

Copy link
Copy Markdown
Contributor

I updated the code, can you give it a test to see if it's working for you?

@T0ha T0ha closed this Sep 4, 2025
@T0ha
T0ha deleted the ext/publora branch September 4, 2025 08:28
@T0ha
T0ha restored the ext/publora branch September 4, 2025 08:31
@T0ha T0ha reopened this Sep 4, 2025
@T0ha T0ha closed this Sep 4, 2025
@T0ha
T0ha deleted the ext/publora branch September 4, 2025 08:32

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

Note: This review covers only the changes made since the last review, not the entire PR.

The latest changes focus on improving the robustness and user experience of the Publora extension through two main areas: API timeout handling and form state management.

In api.tsx, the developer added request timeout functionality to the fetchPlatforms function using AbortController with a 2-second timeout. This prevents hanging requests when the Publora API is unresponsive, which is crucial for maintaining a responsive Raycast experience. The implementation includes proper cleanup with clearTimeout and distinguishes between timeout errors and other exceptions for clearer error messaging.

In schedule-post.tsx, the changes introduce better loading state management through isLoading and canSubmit flags. The canSubmit flag prevents form submission before platforms are successfully fetched, while isLoading provides visual feedback during API operations. The form now resets properly after successful submissions, improving the user workflow for scheduling multiple posts.

These changes integrate with the existing Publora API integration by adding defensive programming patterns common in production Raycast extensions. The timeout handling follows similar patterns seen in other extensions that interact with external APIs, while the loading state management aligns with Raycast's UI best practices for form components.

Important Files Changed

Changed Files
Filename Score Overview
extensions/publora/src/api.tsx 4/5 Added 2-second timeout handling to fetchPlatforms with proper AbortController cleanup
extensions/publora/src/schedule-post.tsx 2/5 Improved form state management but introduced console.log and dependency issues

Confidence score: 2/5

  • This PR has some improvements but contains production code issues that need to be addressed before merging
  • Score lowered due to console.log statement in production code, inconsistent validation logic, and potential stale state issues with useEffect dependencies
  • Pay close attention to schedule-post.tsx which has multiple code quality issues that could affect user experience

2 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@T0ha
T0ha restored the ext/publora branch September 4, 2025 08:39
@T0ha T0ha reopened this Sep 4, 2025

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR adds a new Publora extension for Raycast that enables users to manage and schedule social media posts through the Publora platform. The extension consists of a single "Schedule Post" command that allows users to create posts with content validation, select target platforms, and schedule posts for future publication.

The extension follows Raycast's standard structure with proper TypeScript configuration, ESLint setup, and Prettier formatting. It includes a form-based interface that fetches available connected platforms from Publora's API and validates content length based on platform-specific limits (Twitter 280 chars, Bluesky 300 chars, Threads 500 chars). The API integration uses secure password-type preferences for authentication and includes proper error handling with toast notifications.

The codebase is well-organized with separate modules for API calls (api.tsx), type definitions (types.tsx), and the main scheduling component (schedule-post.tsx). The extension follows Raycast's conventions for form handling, loading states, and user feedback through the toast system.

Important Files Changed

Changed Files
Filename Score Overview
extensions/publora/package.json 4/5 Adds extension manifest with single schedule command and secure API key preference
extensions/publora/src/schedule-post.tsx 3/5 Implements main scheduling form with platform validation but has validation logic issues
extensions/publora/src/api.tsx 3/5 Contains API functions with inconsistent error handling between methods
extensions/publora/src/types.tsx 4/5 Defines TypeScript interfaces for Post and Platform data structures
extensions/publora/eslint.config.js 5/5 Standard Raycast ESLint configuration, properly implemented
extensions/publora/.prettierrc 5/5 Follows Raycast's code formatting standards with correct configuration
extensions/publora/tsconfig.json 5/5 Standard TypeScript configuration appropriate for Raycast extensions
extensions/publora/CHANGELOG.md 5/5 Correctly formatted initial changelog entry with required template string
extensions/publora/.gitignore 5/5 Standard Raycast extension gitignore with appropriate exclusions
extensions/publora/TODO.md 5/5 Simple documentation file outlining future enhancement plans

Confidence score: 3/5

  • This PR has some logic issues that could cause user experience problems, particularly with form validation and error handling
  • Score reflects well-structured extension architecture but validation bugs and console.log statements need attention
  • Pay close attention to schedule-post.tsx and api.tsx for validation logic fixes and error handling improvements

10 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

export interface Post {
content: string;
scheduledTime: Date | null;
platforms: string[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider using Platform['platformId'][] instead of string[] to ensure type safety between Post.platforms and Platform.platformId

@T0ha T0ha closed this Sep 5, 2025
@T0ha
T0ha deleted the ext/publora branch September 5, 2025 08:16
@T0ha
T0ha restored the ext/publora branch September 5, 2025 08:18
@T0ha T0ha reopened this Sep 5, 2025

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR introduces a new Publora extension for Raycast that enables users to create and schedule social media posts across multiple platforms including Twitter/X, BlueSky, Mastodon, and LinkedIn. The extension provides a form interface with platform selection, content validation based on platform-specific character limits, and scheduling functionality.

Key Changes

  • New extension structure: Complete extension setup with proper configuration files following Raycast standards
  • API integration: Implements functions to fetch connected platforms and schedule posts via Publora's API
  • Form validation: Character limit validation for different platforms (280 for Twitter, 300 for Bluesky, 500 for Threads)
  • User experience: Form with draft support, platform picker, and scheduling capabilities
  • Proper tooling: Follows Raycast conventions with correct ESLint and Prettier configurations

Issues Found

  • Logic error in Threads character limit validation (using != 0 instead of == -1)
  • Debug console.log statement left in production code
  • Error handling improvements needed in API functions (previously identified)
  • Form submission flow issues (previously identified)

Confidence score: 3/5

  • This PR has moderate risk due to logical errors and API handling issues that need resolution
  • While the extension follows Raycast standards and provides a complete feature implementation, it contains a logical error in validation logic and could benefit from improved error handling in API calls. The functionality is solid but needs minor fixes before merge.
  • Pay close attention to src/schedule-post.tsx and src/api.tsx for logical and error handling improvements

Important Files Changed

File Analysis
Filename Score Overview Issues
extensions/publora/package.json 3/5 Extension manifest with basic configuration and dependencies Typo in description has been identified previously: 'shedule' should be 'schedule'
extensions/publora/src/api.tsx 2/5 API functions for platform fetching and post scheduling with error handling Missing response status check in schedulePost function - potential error handling issue
extensions/publora/src/schedule-post.tsx 2/5 Main form component for scheduling posts with platform validation and character limits schedulePost call should be awaited and wrapped in try-catch, multiple character limit validation issues

11 files reviewed, 2 comments

Edit Code Review Bot Settings | Greptile

value?.length &&
value?.length > 500 &&
values.platforms &&
values.platforms.findIndex((v) => v.startsWith("threads")) != 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Logic error in platform check - using != 0 should be == -1 for indexOf comparison

Suggested change
values.platforms.findIndex((v) => v.startsWith("threads")) != 0
values.platforms.findIndex((v) => v.startsWith("threads")) == -1

}, []);

// console.log(allPlatforms);
console.log(isLoading);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Remove debug console.log statement - should not be included in production code

@T0ha T0ha closed this Sep 5, 2025
@T0ha
T0ha deleted the ext/publora branch September 5, 2025 09:47
@T0ha

T0ha commented Sep 5, 2025

Copy link
Copy Markdown
Contributor Author

@pernielsentikaer Seems the tool reopened this in new PR #21372

@T0ha T0ha mentioned this pull request Sep 6, 2025
5 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants