Skip to content

Fix StoryPost routing and improve GPT response parsing#312

Merged
NextMonthLab merged 1 commit intomainfrom
claude/fix-blog-studio-features-NzWzP
Feb 6, 2026
Merged

Fix StoryPost routing and improve GPT response parsing#312
NextMonthLab merged 1 commit intomainfrom
claude/fix-blog-studio-features-NzWzP

Conversation

@NextMonthLab
Copy link
Copy Markdown
Owner

Summary

This PR fixes routing issues with the StoryPost feature and improves the robustness of GPT response parsing to handle multiple response formats.

Key Changes

  • Routing Fix: Updated the StoryPost route pattern from /storypost/:rest* to /storypost/*? to properly handle nested routes and optional path segments
  • Response Parsing Enhancement: Improved the GPT idea generation response parser to handle multiple possible JSON structures:
    • Direct array responses
    • Responses wrapped under ideas key
    • Responses wrapped under blogPostIdeas or blog_post_ideas keys
    • Responses with array values in any key (fallback)
    • Empty array as final fallback

Implementation Details

The parser now uses a more defensive approach to extract the ideas array from GPT responses, since different prompt variations or GPT versions may return the data structure in different formats. This prevents parsing failures and improves reliability of the blog idea generation feature.

https://claude.ai/code/session_01K2XN3xZwAiqgr4P72MtusL

- Fix 404 on /storypost/edit/:id by updating route pattern from
  Wouter v2 syntax (/:rest*) to v3 syntax (/*?) in App.tsx
- Fix idea generation not rendering by robustly extracting the ideas
  array from GPT responses regardless of key name (ideas, blogPostIdeas, etc.)
- Post view/edit navigation is fixed by the routing fix above

https://claude.ai/code/session_01K2XN3xZwAiqgr4P72MtusL
@NextMonthLab NextMonthLab temporarily deployed to claude/fix-blog-studio-features-NzWzP - NextMonth PR #312 February 6, 2026 06:59 — with Render Destroyed
@NextMonthLab NextMonthLab merged commit f13dfde into main Feb 6, 2026
1 check failed
@NextMonthLab NextMonthLab deleted the claude/fix-blog-studio-features-NzWzP branch February 6, 2026 06:59
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.

2 participants