feat: Brainstorm Topics with GSC + Issue #518 fixes + Blog Editor enhancements

Issue #518 - Subscription not updating after checkout:
- Fix stale closure in SubscriptionContext checkout polling (use subscriptionRef)
- Move checkout success polling from InitialRouteHandler into SubscriptionContext
- Remove redundant polling code from InitialRouteHandler
- Fix plan label: 'Free' instead of 'No Plan', proper capitalization
- Add plan refresh button in UserBadge
- Add 'View Costing Details' to UserBadge dropdown
- Rename 'ALwrity Podcast Maker' to 'Podcast Creator' across UI
- Clean subscription=success URL param after verification

Blog Writer WYSIWYG Editor enhancements:
- Per-section preview toggle (view/edit icons)
- Enhanced hover-based toolbar
- Circular SVG progress stats bar with detailed tooltip
- Research tool chips in stats bar footer
- Per-section TTS with useTextToSpeech hook (browser native)
- Full blog preview modal with print/PDF support
- PlayAllTTSButton: sequential playback with progress bar
- OnThisPageNav: floating sidebar with scroll tracking
- Section data attributes for scroll anchoring

GSC Brainstorm Topics feature:
- Backend: gsc_brainstorm_service.py (rule-based + LLM recommendations)
- Backend: POST /gsc/brainstorm endpoint with 3-word minimum validation
- Frontend: gscBrainstorm.ts API client
- Frontend: useGSCBrainstormConnection hook (popup OAuth, no /onboarding redirect)
- Frontend: useGSCBrainstorm hook (connect check + brainstorm call)
- Frontend: GSCBrainstormModal (3-tab results: Opportunities, Gaps, AI Recs)
- Frontend: BrainstormButton (visible at 3+ words, GSC connect overlay)
- Wire BrainstormButton into ManualResearchForm and ResearchAction
- Add blog_writer to gsc_auth router features for ALWRITY_ENABLED_FEATURES
This commit is contained in:
ajaysi
2026-05-20 22:34:37 +05:30
parent 68190dedb3
commit 644e72d289
98 changed files with 16137 additions and 2501 deletions

View File

@@ -147,13 +147,26 @@ else:
product_marketing_router = None
campaign_creator_router = None
# Import hallucination detector router (skip in feature-only modes - triggers heavy ML)
if _is_full_mode():
# Import hallucination detector router
try:
from api.hallucination_detector import router as hallucination_detector_router
from api.writing_assistant import router as writing_assistant_router
else:
except Exception as e:
logger.warning(f"Failed to import hallucination_detector router: {e}")
hallucination_detector_router = None
writing_assistant_router = None
# Import charts router (shared chart generation for blog writer, podcast, etc.)
try:
from api.charts import router as charts_router
except Exception as e:
logger.warning(f"Failed to import charts router: {e}")
charts_router = None
# Import links router (internal & external link search and rewording)
try:
from api.links import router as links_router
except Exception as e:
logger.warning(f"Failed to import links router: {e}")
links_router = None
# Import research configuration router (skip in feature-only modes)
if _is_full_mode():
@@ -486,10 +499,18 @@ else:
"reason": f"Feature-only mode: {enabled_features}",
}
# Safety net: explicitly include hallucination detector (router_manager may skip silently)
# Safety net: explicitly include hallucination detector (import may fail gracefully)
if hallucination_detector_router:
router_manager.include_router_safely(hallucination_detector_router, "hallucination_detector")
# Include charts router (shared chart generation)
if charts_router:
router_manager.include_router_safely(charts_router, "charts")
# Include links router (internal & external link search)
if links_router:
router_manager.include_router_safely(links_router, "links")
# Log startup summary
router_manager.log_startup_summary()