Explore @page.tsx @three-column-layout.tsx @/document-processing @/firestarter Think hard and… Save Share Download ▾ Report@page.tsx @three-column-layout.tsx @/document-processing @/firestarter Think hard and devise an elegant and stylish solution to implement and render the attached features such that the user interface never navigates to another route or page view but the center column (or right column if deemed necessary) smoothly transitions/animates/renders the feature interface depending on the user's selection. The idea is that the ambitious and complex capabilities of the application are all at the user's finger tips and the result of "invisible UX" and are agentically orchestrated
Copy first prompt Copy first response
Details
Model Unknown
Provider unknown
Model provenance As recorded by source dataset
Turns 1 (2 messages)
Language Not recorded
Added to archive Dec 3, 2026
ID 01m8x6f35w3mnw6wh7qa9gpcd5Source & license Imported from Coding-assistant chat logs from public GitHub repos (source ). Imported records earn no Research Points.
Upstream record: Monichre/marketing-ai@e605e2ea941cd69dce61d3cec43351e97fd625b2:.specstory/history/2025-07-14_23-35Z-implementing-seamless-user-interface-transitions.md#0
github.com/public-chat-logs, revision c3a0b429d1b8d531f1b66e6d8f33ff7edba9c4c2
License: MIT
Dataset releases Not yet included in a published release.
Looking at your requirements, I'll create an elegant solution that implements a seamless feature orchestration system within your three-column layout. The key is to create an "invisible UX" where users can effortlessly switch between powerful features without page navigation.
Tool create_todos not found.
code Copy code
Searched codebase "Where is the existing feature registration or pipeline registry system used?" • **25** results
File Lines src/features/shared/lib/registry.tsxL1-34 src/features/register-pipelines.tsL1-39 src/features/shared/lib/registry.tsxL286-305 src/features/shared/lib/registry.tsxL268-286 src/features/register-pipelines.tsL39-74 src/features/index.tsL7-26 ProcessingPipelinesUnification.mdL49-113 src/features/shared/lib/registry.tsxL305-326 src/features/register-pipelines.tsL144-147 src/lib/core.tsL19-30 src/features/register-pipelines.tsL108-144 src/features/index.tsL104-111 src/features/shared/lib/registry.tsxL265-268 src/features/shared/lib/types.tsL228-241 src/features/shared/lib/registry.tsxL249-257 src/features/shared/lib/registry.tsxL257-265 ProcessingPipelinesUnification.mdL1-49 src/features/shared/lib/registry.tsxL78-103 src/features/shared/lib/registry.tsxL337-340 src/features/ProcessingPipelines.tsxL1-61 ProcessingPipelinesUnification.mdL349-374 src/features/shared/lib/registry.tsxL50-57 src/features/shared/lib/registry.tsxL170-214 src/features/shared/components/navigation/PipelineRouter.tsxL1-45 src/features/shared/lib/registry.tsxL326-337
code Copy code
Searched codebase "How are React contexts and providers used for state management in this codebase?" • **25** results
File Lines src/app/page.tsxL28-72 src/features/shared/lib/types.tsL119-145 src/features/agent-sandbox/agent.tsxL30-81 src/hooks/use-context-detection.tsL82-99 CsvUploadComponent.mdL1-45 .cursor/rules/project-architecture.mdcL57-112 src/components/csv-upload.tsxL58-111 src/features/ProcessingPipelines.tsxL1-61 ProcessingPipelinesUnification_PSEUDOCODE.mdL126-210 CsvUploadComponent.mdL126-193 CsvUploadComponent_PSEUDOCODE.mdL1-72 src/hooks/use-context-detection.tsL3-60 CsvUploadComponent_PSEUDOCODE.mdL72-142 src/components/ui/ai-prompt-box.tsxL265-278 src/hooks/use-context-detection.tsL1-3 src/components/ui/sidebar.tsxL54-114 StickyContextMenu.mdL1-56 src/features/pdf-processing/hooks/use-toast.tsL172-192 src/features/firestarter/hooks/useFirestarter.tsL1-58 StickyContextMenu_PSEUDOCODE.mdL1-75 src/components/layout/layout-provider.tsxL10-39 src/app/page.tsxL1-28 src/features/fire-enrich/enrichment-table.tsxL84-133 open-researcher-main/components/ui/sidebar.tsxL54-114 src/components/ui/sidebar.tsxL43-54
code Copy code
Searched web "React feature orchestration seamless transitions 2025 best practices" • **6** results
code Copy code
Searched web "framer-motion React app-like transitions smooth orchestration 2025" • **6** results
diff Copy code
-
+ import { ReactNode, ComponentType } from 'react'
+
+ // Feature status type
+ export type FeatureStatus = 'idle' | 'loading' | 'active' | 'error' | 'suspended'
+
+ // Feature metadata
+ export interface FeatureMetadata {
+ id: string
+ name: string
+ description: string
+ icon: ReactNode | string
+ category: 'enrichment' | 'document-processing' | 'ai-agents' | 'analytics'
+ tags?: string[]
+ version?: string
+ author?: string
+ lastUpdated?: string
+ }
+
+ // Feature configuration
+ export interface FeatureConfig {
+ preload?: boolean
+ preserveState?: boolean
+ animationType?: 'fade' | 'slide' | 'scale' | 'morph'
+ transitionDuration?: number
+ requiresAuth?: boolean
+ permissions?: string[]
+ }
+
+ // Feature definition
+ export interface Feature {
+ metadata: FeatureMetadata
+ component: ComponentType<any>
+ config?: FeatureConfig
+ contextPanel?: ComponentType<any>
+ onActivate?: () => void | Promise<void>
+ onDeactivate?: () => void | Promise<void>
+ }
+
+ // Feature state
+ export interface FeatureState {
+ activeFeatureId: string | null
+ previousFeatureId: string | null
+ features: Map<string, Feature>
+ featureStates: Map<string, any>
+ status: FeatureStatus
+ error?: Error | null
+ transitionDirection?: 'forward' | 'backward'
+ }
+
+ // Feature orchestrator context value
+ export interface FeatureOrchestratorContextValue extends FeatureState {
+ // Navigation actions
+ activateFeature: ( featureId: string ) => Promise<void>
+ deactivateFeature: () => void
+ switchFeature: ( featureId: string ) => Promise<void>
+
+ // State management
+ getFeatureState: ( featureId: string ) => any
+ setFeatureState: ( featureId: string, state: any ) => void
+ clearFeatureState: ( featureId: string ) => void
+
+ // Registry actions
+ registerFeature: ( feature: Feature ) => void
+ unregisterFeature: ( featureId: string ) => void
+ getFeature: ( featureId: string ) => Feature | undefined
+ getAllFeatures: () => Feature[]
+
+ // Utility
+ isFeatureActive: ( featureId: string ) => boolean
+ canActivateFeature: ( featureId: string ) => boolean
+ }
+
+ // Animation variants for transitions
+ export interface TransitionVariants {
+ initial: any
+ animate: any
+ exit: any
+ }
+
+ // Keyboard shortcut definition
+ export interface KeyboardShortcut {
+ key: string
+ ctrl?: boolean
+ cmd?: boolean
+ alt?: boolean
+ shift?: boolean
+ action: () => void
+ description?: string
+ }
I'll continue the implementation of the Feature Orchestration System (T-1) by first fixing the linter error and then completing the remaining components.
Read file: src/features/orchestrator/hooks/useFeatureOrchestrator.ts
Read file: src/features/orchestrator/FeatureRegistry.tsx
code Copy code
Grep search for "getAll\(" • **8** files
File Line Match file:///Users/[user]/Desktop/marketing-ai/src/features/orchestrator/hooks/useFeatureOrchestrator.tsL33 featureRegistry.getAll().map( ( f ) => [f.metadata.id, f] )file:///Users/[user]/Desktop/marketing-ai/src/features/shared/lib/registry.tsxL54 getAll(): Pipeline[] {file:///Users/[user]/Desktop/marketing-ai/src/features/shared/lib/registry.tsxL62 return filterByCategory(this.getAll(), category)file:///Users/[user]/Desktop/marketing-ai/src/features/shared/lib/registry.tsxL69 return this.getAll().filter((pipeline) => pipeline.status === status)file:///Users/[user]/Desktop/marketing-ai/src/features/shared/lib/registry.tsxL76 return searchPipelines(this.getAll(), query)file:///Users/[user]/Desktop/marketing-ai/src/features/shared/lib/registry.tsxL83 return this.getAll().filter(file:///Users/[user]/Desktop/marketing-ai/src/features/shared/lib/registry.tsxL137 const pipelines = this.getAll()file:///Users/[user]/Desktop/marketing-ai/src/features/shared/lib/registry.tsxL231 const pipelines = this.getAll()file:///Users/[user]/Desktop/marketing-ai/src/features/shared/lib/registry.tsxL247 return this.getAll()file:///Users/[user]/Desktop/marketing-ai/src/features/orchestrator/FeatureRegistry.tsxL46 getAll(): Feature[] {file:///Users/[user]/Desktop/marketing-ai/src/features/orchestrator/FeatureRegistry.tsxL54 return this.getAll().filter(file:///Users/[user]/Desktop/marketing-ai/src/features/orchestrator/FeatureRegistry.tsxL64 return this.getAll().filter((feature) => {file:///Users/[user]/Desktop/marketing-ai/src/features/orchestrator/FeatureRegistry.tsx
Read file: src/features/orchestrator/FeatureRegistry.tsx
bash Copy code
cd /Users/[user]/Desktop/marketing-ai && bunx tsc --noEmit
bash Copy code
bunx eslint src/features/orchestrator/hooks/useFeatureOrchestrator.ts
code Copy code
<s/orchestrator/hooks/useFeatureOrchestrator.ts
diff Copy code
-
+ 'use client'
+
+ import {createContext, useContext, ReactNode} from 'react'
+ import {FeatureOrchestratorContextValue} from './types'
+ import {useFeatureOrchestrator} from './hooks/useFeatureOrchestrator'
+
+ // Create context
+ const FeatureOrchestratorContext =
+ createContext<FeatureOrchestratorContextValue | null>(null)
+
+ // Context provider props
+ interface FeatureOrchestratorProviderProps {
+ children: ReactNode
+ initialFeatureId?: string
+ preserveStates?: boolean
+ }
+
+ /**
+ * Provider component that wraps the app with feature orchestration capabilities
+ */
+ export function FeatureOrchestratorProvider({
+ children,
+ initialFeatureId,
+ preserveStates = true,
+ }: FeatureOrchestratorProviderProps) {
+ const orchestrator = useFeatureOrchestrator({
+ initialFeatureId,
+ preserveStates,
+ })
+
+ return (
+ <FeatureOrchestratorContext.Provider value={orchestrator}>
+ {children}
+ </FeatureOrchestratorContext.Provider>
+ )
+ }
+
+ /**
+ * Hook to access the feature orchestrator context
+ * @throws {Error} If used outside of FeatureOrchestratorProvider
+ */
+ export function useFeatureOrchestratorContext(): FeatureOrchestratorContextValue {
+ const context = useContext(FeatureOrchestratorContext)
+
+ if (!context) {
+ throw new Error(
+ 'useFeatureOrchestratorContext must be used within a FeatureOrchestratorProvider'
+ )
+ }
+
+ return context
+ }
+
Read file: src/features/orchestrator/hooks/useFeatureOrchestrator.ts
diff Copy code
} from '../types'
import { featureRegistry } from '../FeatureRegistry'
+
+ interface UseFeatureOrchestratorOptions {
+ initialFeatureId?: string
+ preserveStates?: boolean
+ }
/**
* Main hook for managing feature orchestration
*/
- export function useFeatureOrchestrator(): FeatureOrchestratorContextValue {
+ export function useFeatureOrchestrator(
+ options: UseFeatureOrchestratorOptions = {}
+ ): FeatureOrchestratorContextValue {
+ const { initialFeatureId, preserveStates = true } = options
+
// Feature state
const [state, setState] = useState<FeatureState>( {
- activeFeatureId: null,
- previousFeatureId: null,
features: new Map(),
+ activeFeatureId: initialFeatureId || null,
featureStates: new Map(),
status: 'idle',
diff Copy code
features: new Map(),
activeFeatureId: initialFeatureId || null,
+ previousFeatureId: null,
featureStates: new Map(),
status: 'idle',
Read file: src/features/orchestrator/FeatureRegistry.tsx
Read file: src/features/orchestrator/hooks/useFeatureOrchestrator.ts
Read file: src/features/orchestrator/hooks/useFeatureOrchestrator.ts
diff Copy code
-
+ 'use client'
+
+ import {ReactNode, useEffect, useRef} from 'react'
+ import {motion, AnimatePresence} from 'framer-motion'
+ import {TransitionVariants} from '../types'
+
+ interface AnimatedFeatureProps {
+ children: ReactNode
+ isActive: boolean
+ direction: 'forward' | 'backward'
+ preserveHeight?: boolean
+ variants?: TransitionVariants
+ className?: string
+ }
+
+ // Default animation variants
+ const defaultVariants: TransitionVariants = {
+ // Slide animations
+ slideForward: {
+ initial: {x: '100%', opacity: 0},
+ animate: {x: 0, opacity: 1},
+ exit: {x: '-100%', opacity: 0},
+ },
+ slideBackward: {
+ initial: {x: '-100%', opacity: 0},
+ animate: {x: 0, opacity: 1},
+ exit: {x: '100%', opacity: 0},
+ },
+ // Fade animations
+ fade: {
+ initial: {opacity: 0},
+ animate: {opacity: 1},
+ exit: {opacity: 0},
+ },
+ // Scale animations
+ scale: {
+ initial: {scale: 0.9, opacity: 0},
+ animate: {scale: 1, opacity: 1},
+ exit: {scale: 1.1, opacity: 0},
+ },
+ }
+
+ /**
+ * Component that wraps features with smooth animations
+ */
+ export function AnimatedFeature({
+ children,
+ isActive,
+ direction,
+ preserveHeight = false,
+ variants = defaultVariants,
+ className = '',
+ }: AnimatedFeatureProps) {
+ const containerRef = useRef<HTMLDivElement>(null)
+ const heightRef = useRef<number>(0)
+
+ // Preserve height during transitions
+ useEffect(() => {
+ if (preserveHeight && containerRef.current && isActive) {
+ heightRef.current = containerRef.current.offsetHeight
+ }
+ }, [isActive, preserveHeight])
+
+ // Select animation variant based on direction
+ const selectedVariant =
+ direction === 'forward'
+ ? variants.slideForward || defaultVariants.slideForward
+ : variants.slideBackward || defaultVariants.slideBackward
+
+ return (
+ <AnimatePresence mode='wait'>
+ {isActive && (
+ <motion.div
+ ref={containerRef}
+ className={className}
+ initial={selectedVariant?.initial}
+ animate={selectedVariant?.animate}
+ exit={selectedVariant?.exit}
+ transition={{
+ duration: 0.3,
+ ease: [0.4, 0, 0.2, 1], // Smooth easing
+ }}
+ style={{
+ minHeight: preserveHeight ? heightRef.current : undefined,
+ }}
+ >
+ {children}
+ </motion.div>
+ )}
+ </AnimatePresence>
+ )
+ }
+
Read file: src/features/orchestrator/types.ts
diff Copy code
// Animation variants for transitions
- export interface TransitionVariants {
+ export interface TransitionVariant {
initial: any
animate: any
exit: any
}
+
+ export interface TransitionVariants {
+ slideForward?: TransitionVariant
+ slideBackward?: TransitionVariant
+ fade?: TransitionVariant
+ scale?: TransitionVariant
+ morph?: TransitionVariant
+ [key: string]: TransitionVariant | undefined
+ }
// Keyboard shortcut definition
diff Copy code
-
+ 'use client'
+
+ import {useEffect} from 'react'
+ import {useFeatureOrchestratorContext} from '../context'
+ import {AnimatedFeature} from './AnimatedFeature'
+ import {TransitionVariants} from '../types'
+ import {ErrorBoundary} from 'react-error-boundary'
+
+ interface FeatureOrchestratorProps {
+ className?: string
+ variants?: TransitionVariants
+ preserveHeight?: boolean
+ fallback?: React.ComponentType<{error: Error}>
+ }
+
+ // Error fallback component
+ function DefaultErrorFallback({error}: {error: Error}) {
+ return (
+ <div className='flex flex-col items-center justify-center p-8 text-center'>
+ <h2 className='text-xl font-semibold text-red-600 mb-2'>Feature Error</h2>
+ <p className='text-gray-600 mb-4'>{error.message}</p>
+ <button
+ onClick={() => window.location.reload()}
+ className='px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 transition-colors'
+ >
+ Reload
+ </button>
+ </div>
+ )
+ }
+
+ /**
+ * Main orchestrator component that renders the active feature with transitions
+ */
+ export function FeatureOrchestrator({
+ className = '',
+ variants,
+ preserveHeight = true,
+ fallback: ErrorFallback = DefaultErrorFallback,
+ }: FeatureOrchestratorProps) {
+ const {
+ activeFeatureId,
+ features,
+ status,
+ error,
+ transitionDirection,
+ getFeature,
+ getFeatureState,
+ } = useFeatureOrchestratorContext()
+
+ // Get the active feature
+ const activeFeature = activeFeatureId ? getFeature(activeFeatureId) : null
+ const featureState = activeFeatureId ? getFeatureState(activeFeatureId) : null
+
+ // Handle loading state
+ if (status === 'loading') {
+ return (
+ <div className={`flex items-center justify-center p-8 ${className}`}>
+ <div className='animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500' />
+ </div>
+ )
+ }
+
+ // Handle error state
+ if (status === 'error' && error) {
+ return <ErrorFallback error={error} />
+ }
+
+ // Handle no active feature
+ if (!activeFeature) {
+ return (
+ <div
+ className={`flex items-center justify-center p-8 text-gray-500 ${className}`}
+ >
+ <p>Select a feature to get started</p>
+ </div>
+ )
+ }
+
+ const FeatureComponent = activeFeature.component
+
+ return (
+ <div className={className}>
+ <ErrorBoundary
+ fallbackComponent={ErrorFallback}
+ resetKeys={[activeFeatureId]}
+ >
+ <AnimatedFeature
+ isActive={true}
+ direction={transitionDirection || 'forward'}
+ preserveHeight={preserveHeight}
+ variants={variants}
+ className='w-full h-full'
+ >
+ <FeatureComponent {...featureState} />
+ </AnimatedFeature>
+ </ErrorBoundary>
+ </div>
+ )
+ }
+
bash Copy code
bun add react-error-boundary
code Copy code
liamellis@MacBookPro marketing-ai % bun add react-error-boundary
[0.66ms] ".env"
bun add v1.2.17 (282dda62)
122 | "@tailwindcss/typography": "^0.5.16",
^
warn: Duplicate dependency: "@tailwindcss/typography" specified in package.json
at /Users/[user]/Desktop/marketing-ai/package.json:122:5
63 | "@tailwindcss/typography": "^0.5.12",
^
note: "@tailwindcss/typography" originally specified here
at /Users/[user]/Desktop/marketing-ai/package.json:63:32
$ prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
✔ Generated Prisma Client (v6.9.0) to ./node_modules/@prisma/client in 58ms
Start by importing your Prisma Client (See: https://pris.ly/d/importing-client)
Tip: Want to turn off tips and other hints? https://pris.ly/tip-4-nohints
installed react-error-boundary@6.0.0
1 package installed [1.80s]
liamellis@MacBookPro marketing-ai %
diff Copy code
-
+ // Main exports
+ export {
+ FeatureOrchestratorProvider,
+ useFeatureOrchestratorContext,
+ } from './context'
+
+ export {
+ FeatureOrchestrator,
+ } from './components/FeatureOrchestrator'
+
+ export {
+ AnimatedFeature,
+ } from './components/AnimatedFeature'
+
+ // Registry exports
+ export {
+ featureRegistry,
+ registerFeature,
+ unregisterFeature,
+ getFeature,
+ getAllFeatures,
+ searchFeatures,
+ getFeaturesByCategory,
+ } from './FeatureRegistry'
+
+ // Hook exports
+ export {
+ useFeatureOrchestrator,
+ } from './hooks/useFeatureOrchestrator'
+
+ export {
+ useKeyboardShortcuts,
+ } from './hooks/useKeyboardShortcuts'
+
+ // Type exports
+ export type {
+ Feature,
+ FeatureMetadata,
+ FeatureConfig,
+ FeatureStatus,
+ FeatureState,
+ FeatureOrchestratorContextValue,
+ TransitionVariant,
+ TransitionVariants,
+ KeyboardShortcut,
+ } from './types'
code Copy code
Searched codebase "fire-enrich index" • **10** results
File undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined
code Copy code
Grep search for "export.*function.*UnifiedEnrichmentView" • **3** files
File Line Match file:///Users/[user]/Desktop/marketing-ai/src/features/fire-enrich/unified-enrichment-view.tsxL108 export function UnifiedEnrichmentView({file:///Users/[user]/Desktop/marketing-ai/src/app/fire-enrich/unified-enrichment-view.tsxL108 export function UnifiedEnrichmentView({file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL11893 export function UnifiedEnrichmentView({file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL39596 export function UnifiedEnrichmentView({
code Copy code
Grep search for "export.*ChatbotManager" • **0** files
No results found
code Copy code
Searched codebase "ChatbotManager firestarter" • **0** results
No results found
code Copy code
Listed directory src/features/firestarter/components • **6** results
Name 📄 ChatbotCreator.tsx 📄 ApiKeySetup.tsx 📄 ChatInterface.tsx 📄 CrawlProgress.tsx 📄 ChatbotList.tsx 📄 ChatbotCard.tsx
code Copy code
Searched codebase "firestarter index.ts" • **10** results
File undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined
code Copy code
Grep search for "interface ThreeColumnLayoutProps" • **4** files
File Line Match file:///Users/[user]/Desktop/marketing-ai/src/components/layout/three-column-layout.tsxL5 export interface ThreeColumnLayoutProps {file:///Users/[user]/Desktop/marketing-ai/FlexibleThreeColumnLayout.mdL27 interface ThreeColumnLayoutProps {file:///Users/[user]/Desktop/marketing-ai/.specstory/history/2025-06-16_13-48Z-create-a-three-column-layout-specification.mdL961 + export interface ThreeColumnLayoutProps {file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL2265 + export interface ThreeColumnLayoutProps {file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL15782 export interface ThreeColumnLayoutProps {file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL64542 interface ThreeColumnLayoutProps {
Read file: src/components/layout/three-column-layout.tsx
diff Copy code
useKeyboardShortcuts,
} from '@/features/orchestrator'
- import {FireEnrich} from '@/features/fire-enrich'
+ import {UnifiedEnrichmentView} from '@/features/fire-enrich/unified-enrichment-view'
import {DocumentProcessor} from '@/features/document-processing/document-processor'
- import {ChatbotManager} from '@/features/firestarter/components/ChatbotManager'
+ import {ChatbotCreator} from '@/features/firestarter/components/ChatbotCreator'
/**
diff Copy code
tags: ['ai', 'enrichment', 'scraping'],
},
- component: FireEnrich,
+ component: UnifiedEnrichmentView,
config: {
preload: true,
diff Copy code
tags: ['chatbots', 'ai', 'agents'],
},
- component: ChatbotManager,
+ component: ChatbotCreator,
config: {
preserveState: false,
diff Copy code
leftSidebar={<FeatureNavigation />}
rightSidebar={<FeatureContextPanel />}
- >
+ centerContent={
<FeatureOrchestrator
className='h-full'
diff Copy code
}}
/>
- </ThreeColumnLayout>
+ }
+ />
)
}
Cancelled
Show full message · 2,510 lines -
+ import {Feature} from './types'
+
+ /**
+ * Feature Registry - Manages registration and discovery of features
+ * Inspired by the existing PipelineRegistry pattern
+ */
+ class FeatureRegistryImpl {
+ private features = new Map<string, Feature>()
+ private listeners = new Set<(features: Feature[]) => void>()
+
+ /**
+ * Register a new feature
+ */
+ register(feature: Feature): void {
+ const featureId = feature.metadata.id
+
+ if (this.features.has(featureId)) {
+ console.warn(`Feature ${featureId} is already registered. Overwriting.`)
+ }
+
+ // Validate feature structure
+ this.validateFeature(feature)
+
+ this.features.set(featureId, {...feature})
+ this.notifyListeners()
+ }
+
+ /**
+ * Unregister a feature
+ */
+ unregister(featureId: string): void {
+ if (this.features.delete(featureId)) {
+ this.notifyListeners()
+ }
+ }
+
+ /**
+ * Get a specific feature
+ */
+ get(featureId: string): Feature | undefined {
+ return this.features.get(featureId)
+ }
+
+ /**
+ * Get all registered features
+ */
+ getAll(): Feature[] {
+ return Array.from(this.features.values())
+ }
+
+ /**
+ * Get features by category
+ */
+ getByCategory(category: Feature['metadata']['category']): Feature[] {
+ return this.getAll().filter(
+ (feature) => feature.metadata.category === category
+ )
+ }
+
+ /**
+ * Search features by query
+ */
+ search(query: string): Feature[] {
+ const lowerQuery = query.toLowerCase()
+ return this.getAll().filter((feature) => {
+ const {name, description, tags = []} = feature.metadata
+ return (
+ name.toLowerCase().includes(lowerQuery) ||
+ description.toLowerCase().includes(lowerQuery) ||
+ tags.some((tag) => tag.toLowerCase().includes(lowerQuery))
+ )
+ })
+ }
+
+ /**
+ * Subscribe to registry changes
+ */
+ subscribe(listener: (features: Feature[]) => void): () => void {
+ this.listeners.add(listener)
+ return () => this.listeners.delete(listener)
+ }
+
+ /**
+ * Clear all features
+ */
+ clear(): void {
+ this.features.clear()
+ this.notifyListeners()
+ }
+
+ /**
+ * Validate feature structure
+ */
+ private validateFeature(feature: Feature): void {
+ const {metadata, component} = feature
+
+ if (!metadata || typeof metadata !== 'object') {
+ throw new Error('Feature validation failed: Invalid metadata')
+ }
+
+ const requiredFields = ['id', 'name', 'description', 'category']
+ for (const field of requiredFields) {
+ if (!metadata[field as keyof typeof metadata]) {
+ throw new Error(
+ `Feature validation failed: Missing required field '${field}' in metadata`
+ )
+ }
+ }
+
+ if (typeof component !== 'function') {
+ throw new Error(
+ 'Feature validation failed: Component must be a React component'
+ )
+ }
+ }
+
+ /**
+ * Notify all listeners of changes
+ */
+ private notifyListeners(): void {
+ const features = this.getAll()
+ this.listeners.forEach((listener) => listener(features))
+ }
+
+ /**
+ * Get feature statistics
+ */
+ getStatistics() {
+ const features = this.getAll()
+ const byCategory = features.reduce(
+ (acc, feature) => {
+ const category = feature.metadata.category
+ acc[category] = (acc[category] || 0) + 1
+ return acc
+ },
+ {} as Record<string, number>
+ )
+
+ return {
+ total: features.length,
+ byCategory,
+ withContextPanel: features.filter((f) => f.contextPanel).length,
+ withPreload: features.filter((f) => f.config?.preload).length,
+ }
+ }
+ }
+
+ // Create singleton instance
+ export const featureRegistry = new FeatureRegistryImpl()
+
+ // Export convenience methods
+ export const {
+ register: registerFeature,
+ unregister: unregisterFeature,
+ get: getFeature,
+ getAll: getAllFeatures,
+ getByCategory: getFeaturesByCategory,
+ search: searchFeatures,
+ subscribe: subscribeToFeatureChanges,
+ clear: clearFeatureRegistry,
+ getStatistics: getFeatureStatistics,
+ } = featureRegistry
+
+ // Default export
+ export default featureRegistry
+
-
+ import { useState, useCallback, useEffect, useRef } from 'react'
+ import {
+ Feature,
+ FeatureState,
+ FeatureStatus,
+ FeatureOrchestratorContextValue
+ } from '../types'
+ import { featureRegistry } from '../FeatureRegistry'
+
+ /**
+ * Main hook for managing feature orchestration
+ */
+ export function useFeatureOrchestrator(): FeatureOrchestratorContextValue {
+ // Feature state
+ const [state, setState] = useState<FeatureState>( {
+ activeFeatureId: null,
+ previousFeatureId: null,
+ features: new Map(),
+ featureStates: new Map(),
+ status: 'idle',
+ error: null,
+ transitionDirection: 'forward',
+ } )
+
+ // Refs for async operations
+ const transitionTimeoutRef = useRef<NodeJS.Timeout>()
+
+ // Sync with feature registry
+ useEffect( () => {
+ const syncFeatures = () => {
+ setState( ( prev ) => ( {
+ ...prev,
+ features: new Map(
+ featureRegistry.getAll().map( ( f ) => [f.metadata.id, f] )
+ ),
+ } ) )
+ }
+
+ // Initial sync
+ syncFeatures()
+
+ // Subscribe to changes
+ const unsubscribe = featureRegistry.subscribe( syncFeatures )
+
+ return () => {
+ unsubscribe()
+ if ( transitionTimeoutRef.current ) {
+ clearTimeout( transitionTimeoutRef.current )
+ }
+ }
+ }, [] )
+
+ // Activate a feature
+ const activateFeature = useCallback( async ( featureId: string ) => {
+ const feature = state.features.get( featureId )
+ if ( !feature ) {
+ console.error( `Feature ${featureId} not found` )
+ return
+ }
+
+ // Set loading state
+ setState( ( prev ) => ( {
+ ...prev,
+ status: 'loading',
+ transitionDirection: 'forward',
+ } ) )
+
+ try {
+ // Call onActivate hook if provided
+ if ( feature.onActivate ) {
+ await feature.onActivate()
+ }
+
+ // Update state to active
+ setState( ( prev ) => ( {
+ ...prev,
+ activeFeatureId: featureId,
+ previousFeatureId: prev.activeFeatureId,
+ status: 'active',
+ error: null,
+ } ) )
+
+ // If feature doesn't preserve state and has no saved state, initialize it
+ if ( !feature.config?.preserveState && !state.featureStates.has( featureId ) ) {
+ setState( ( prev ) => ( {
+ ...prev,
+ featureStates: new Map( prev.featureStates ).set( featureId, {} ),
+ } ) )
+ }
+ } catch ( error ) {
+ console.error( `Error activating feature ${featureId}:`, error )
+ setState( ( prev ) => ( {
+ ...prev,
+ status: 'error',
+ error: error as Error,
+ } ) )
+ }
+ }, [state.features, state.featureStates] )
+
+ // Deactivate current feature
+ const deactivateFeature = useCallback( async () => {
+ const currentFeatureId = state.activeFeatureId
+ if ( !currentFeatureId ) return
+
+ const feature = state.features.get( currentFeatureId )
+ if ( !feature ) return
+
+ try {
+ // Call onDeactivate hook if provided
+ if ( feature.onDeactivate ) {
+ await feature.onDeactivate()
+ }
+
+ // Clear state if not preserving
+ if ( !feature.config?.preserveState ) {
+ setState( ( prev ) => {
+ const newStates = new Map( prev.featureStates )
+ newStates.delete( currentFeatureId )
+ return {
+ ...prev,
+ featureStates: newStates,
+ }
+ } )
+ }
+
+ setState( ( prev ) => ( {
+ ...prev,
+ activeFeatureId: null,
+ status: 'idle',
+ } ) )
+ } catch ( error ) {
+ console.error( `Error deactivating feature ${currentFeatureId}:`, error )
+ }
+ }, [state.activeFeatureId, state.features] )
+
+ // Switch between features
+ const switchFeature = useCallback( async ( featureId: string ) => {
+ if ( featureId === state.activeFeatureId ) return
+
+ // Determine transition direction
+ const currentIndex = Array.from( state.features.keys() ).indexOf(
+ state.activeFeatureId || ''
+ )
+ const targetIndex = Array.from( state.features.keys() ).indexOf( featureId )
+ const direction = targetIndex > currentIndex ? 'forward' : 'backward'
+
+ setState( ( prev ) => ( {
+ ...prev,
+ transitionDirection: direction,
+ } ) )
+
+ // Deactivate current feature if any
+ if ( state.activeFeatureId ) {
+ await deactivateFeature()
+ }
+
+ // Small delay for smooth transition
+ await new Promise( ( resolve ) => {
+ transitionTimeoutRef.current = setTimeout( resolve, 50 )
+ } )
+
+ // Activate new feature
+ await activateFeature( featureId )
+ }, [state.activeFeatureId, state.features, activateFeature, deactivateFeature] )
+
+ // Get feature state
+ const getFeatureState = useCallback( ( featureId: string ) => {
+ return state.featureStates.get( featureId ) || {}
+ }, [state.featureStates] )
+
+ // Set feature state
+ const setFeatureState = useCallback( ( featureId: string, newState: any ) => {
+ setState( ( prev ) => ( {
+ ...prev,
+ featureStates: new Map( prev.featureStates ).set( featureId, newState ),
+ } ) )
+ }, [] )
+
+ // Clear feature state
+ const clearFeatureState = useCallback( ( featureId: string ) => {
+ setState( ( prev ) => {
+ const newStates = new Map( prev.featureStates )
+ newStates.delete( featureId )
+ return {
+ ...prev,
+ featureStates: newStates,
+ }
+ } )
+ }, [] )
+
+ // Registry actions (delegate to featureRegistry)
+ const registerFeature = useCallback( ( feature: Feature ) => {
+ featureRegistry.register( feature )
+ }, [] )
+
+ const unregisterFeature = useCallback( ( featureId: string ) => {
+ featureRegistry.unregister( featureId )
+ }, [] )
+
+ const getFeature = useCallback( ( featureId: string ) => {
+ return state.features.get( featureId )
+ }, [state.features] )
+
+ const getAllFeatures = useCallback( () => {
+ return Array.from( state.features.values() )
+ }, [state.features] )
+
+ // Utility functions
+ const isFeatureActive = useCallback( ( featureId: string ) => {
+ return state.activeFeatureId === featureId
+ }, [state.activeFeatureId] )
+
+ const canActivateFeature = useCallback( ( featureId: string ) => {
+ const feature = state.features.get( featureId )
+ if ( !feature ) return false
+
+ // Check auth requirements
+ if ( feature.config?.requiresAuth ) {
+ // TODO: Implement auth check
+ return true
+ }
+
+ return true
+ }, [state.features] )
+
+ return {
+ // State
+ ...state,
+
+ // Navigation actions
+ activateFeature,
+ deactivateFeature,
+ switchFeature,
+
+ // State management
+ getFeatureState,
+ setFeatureState,
+ clearFeatureState,
+
+ // Registry actions
+ registerFeature,
+ unregisterFeature,
+ getFeature,
+ getAllFeatures,
+
+ // Utility
+ isFeatureActive,
+ canActivateFeature,
+ }
+ }
const features = this.getAll()
file:///Users/[user]/Desktop/marketing-ai/src/features/orchestrator/FeatureRegistry.tsxL128 const features = this.getAll()
file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL49490 getAll(): Pipeline[] {
file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL49498 return filterByCategory(this.getAll(), category)
file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL49505 return this.getAll().filter((pipeline) => pipeline.status === status)
file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL49512 return searchPipelines(this.getAll(), query)
file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL49519 return this.getAll().filter(
file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL49573 const pipelines = this.getAll()
file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL49667 const pipelines = this.getAll()
file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL49683 return this.getAll()
file:///Users/[user]/Desktop/marketing-ai/repomix-output.xmlL66981 console.log(pipelineRegistry.getAll())
file:///Users/[user]/Desktop/marketing-ai/ProcessingPipelinesUnification.mdL362 console.log(pipelineRegistry.getAll())
file:///Users/[user]/Desktop/marketing-ai/open-researcher-main/components/search-results-display.tsxL98 setIsImageTall(false)
file:///Users/[user]/Desktop/marketing-ai/open-researcher-main/components/search-results-display.tsxL112 setIsImageTall(false)
file:///Users/[user]/Desktop/marketing-ai/open-researcher-main/components/search-results-display.tsxL253 setIsImageTall(imageHeight > containerHeight * 1.5); // Image is tall if it's 1.5x the container height
file:///Users/[user]/Desktop/marketing-ai/src/features/orchestrator/FeatureRegistry.tsxL46 getAll(): Feature[] {
file:///Users/[user]/Desktop/marketing-ai/src/features/orchestrator/FeatureRegistry.tsxL54 return this.getAll().filter(
file:///Users/[user]/Desktop/marketing-ai/src/features/orchestrator/FeatureRegistry.tsxL64 return this.getAll().filter((feature) => {
file:///Users/[user]/Desktop/marketing-ai/src/features/orchestrator/FeatureRegistry.tsxL120 const features = this.getAll()
file:///Users/[user]/Desktop/marketing-ai/src/features/orchestrator/FeatureRegistry.tsxL128 const features = this.getAll()
file:///Users/[user]/Desktop/marketing-ai/src/features/orchestrator/hooks/useFeatureOrchestrator.tsL33 featureRegistry.getAll().map( ( f ) => [f.metadata.id, f] )
src/features/shared/testing/pipeline-integration.test.ts:29:27 - error TS1005: '
>' expected.
29 component: () => <div data-testid="agent-sandbox">Agent Sandbox Content</
div>,
~~~~
src/features/shared/testing/pipeline-integration.test.ts:29:38 - error TS1005: '
,' expected.
29 component: () => <div data-testid="agent-sandbox">Agent Sandbox Content</
div>,
~
src/features/shared/testing/pipeline-integration.test.ts:29:54 - error TS1005: '
:' expected.
29 component: () => <div data-testid="agent-sandbox">Agent Sandbox Content</
div>,
~
src/features/shared/testing/pipeline-integration.test.ts:29:61 - error TS1005: '
,' expected.
29 component: () => <div data-testid="agent-sandbox">Agent Sandbox Content</
div>,
~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:29:69 - error TS1005: '
,' expected.
29 component: () => <div data-testid="agent-sandbox">Agent Sandbox Content</
div>,
~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:29:77 - error TS1139: T
ype parameter d
eclaration expected.
29 component: () => <div data-testid="agent-sandbox">Agent Sandbox Content</
div>,
~
src/features/shared/testing/pipeline-integration.test.ts:29:82 - error TS1109: E
xpression expec
ted.
29 component: () => <div data-testid="agent-sandbox">Agent Sandbox Content</
div>,
~
src/features/shared/testing/pipeline-integration.test.ts:30:13 - error TS1005: '
,' expected.
30 category: 'ai-agents',
~
src/features/shared/testing/pipeline-integration.test.ts:31:15 - error TS1005: '
,' expected.
31 complexity: 'intermediate',
~
src/features/shared/testing/pipeline-integration.test.ts:32:3 - error TS1137: Ex
pression or com
ma expected.
32 },
~
src/features/shared/testing/pipeline-integration.test.ts:32:4 - error TS1128: De
claration or st
atement expected.
32 },
~
src/features/shared/testing/pipeline-integration.test.ts:35:9 - error TS1005: ';
' expected.
35 name: 'Document Processor',
~
src/features/shared/testing/pipeline-integration.test.ts:36:14 - error TS1005: '
;' expected.
36 component: () => <div data-testid="document-processing">Document Processi
ng Content</div
>,
~
src/features/shared/testing/pipeline-integration.test.ts:36:27 - error TS1005: '
>' expected.
36 component: () => <div data-testid="document-processing">Document Processi
ng Content</div
>,
~~~~
src/features/shared/testing/pipeline-integration.test.ts:36:38 - error TS1005: '
;' expected.
36 component: () => <div data-testid="document-processing">Document Processi
ng Content</div
>,
~
src/features/shared/testing/pipeline-integration.test.ts:36:70 - error TS1005: '
;' expected.
36 component: () => <div data-testid="document-processing">Document Processi
ng Content</div
>,
~~~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:36:89 - error TS1161: U
nterminated reg
ular expression literal.
36 component: () => <div data-testid="document-processing">Document Processi
ng Content</div
>,
~~~~
~~
src/features/shared/testing/pipeline-integration.test.ts:38:15 - error TS1005: '
;' expected.
38 complexity: 'beginner',
~
src/features/shared/testing/pipeline-integration.test.ts:39:3 - error TS1109: Ex
pression expect
ed.
39 },
~
src/features/shared/testing/pipeline-integration.test.ts:39:4 - error TS1128: De
claration or st
atement expected.
39 },
~
src/features/shared/testing/pipeline-integration.test.ts:42:9 - error TS1005: ';
' expected.
42 name: 'PDF Processor',
~
src/features/shared/testing/pipeline-integration.test.ts:43:14 - error TS1005: '
;' expected.
43 component: () => <div data-testid="pdf-processing">PDF Processing Content
</div>,
~
src/features/shared/testing/pipeline-integration.test.ts:43:27 - error TS1005: '
>' expected.
43 component: () => <div data-testid="pdf-processing">PDF Processing Content
</div>,
~~~~
src/features/shared/testing/pipeline-integration.test.ts:43:38 - error TS1005: '
;' expected.
43 component: () => <div data-testid="pdf-processing">PDF Processing Content
</div>,
~
src/features/shared/testing/pipeline-integration.test.ts:43:60 - error TS1005: '
;' expected.
43 component: () => <div data-testid="pdf-processing">PDF Processing Content
</div>,
~~~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:43:79 - error TS1161: U
nterminated reg
ular expression literal.
43 component: () => <div data-testid="pdf-processing">PDF Processing Content
</div>,
~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:45:15 - error TS1005: '
;' expected.
45 complexity: 'beginner',
~
src/features/shared/testing/pipeline-integration.test.ts:46:3 - error TS1109: Ex
pression expect
ed.
46 },
~
src/features/shared/testing/pipeline-integration.test.ts:46:4 - error TS1128: De
claration or st
atement expected.
46 },
~
src/features/shared/testing/pipeline-integration.test.ts:49:9 - error TS1005: ';
' expected.
49 name: 'Prompt Engineer',
~
src/features/shared/testing/pipeline-integration.test.ts:50:14 - error TS1005: '
;' expected.
50 component: () => <div data-testid="prompt-processing">Prompt Engineering
Content</div>,
~
src/features/shared/testing/pipeline-integration.test.ts:50:27 - error TS1005: '
>' expected.
50 component: () => <div data-testid="prompt-processing">Prompt Engineering
Content</div>,
~~~~
src/features/shared/testing/pipeline-integration.test.ts:50:38 - error TS1005: '
;' expected.
50 component: () => <div data-testid="prompt-processing">Prompt Engineering
Content</div>,
~
src/features/shared/testing/pipeline-integration.test.ts:50:66 - error TS1005: '
;' expected.
50 component: () => <div data-testid="prompt-processing">Prompt Engineering
Content</div>,
~~~~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:50:86 - error TS1161: U
nterminated reg
ular expression literal.
50 component: () => <div data-testid="prompt-processing">Prompt Engineering
Content</div>,
~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:52:15 - error TS1005: '
;' expected.
52 complexity: 'intermediate',
~
src/features/shared/testing/pipeline-integration.test.ts:53:3 - error TS1109: Ex
pression expect
ed.
53 },
~
src/features/shared/testing/pipeline-integration.test.ts:53:4 - error TS1128: De
claration or st
atement expected.
53 },
~
src/features/shared/testing/pipeline-integration.test.ts:56:9 - error TS1005: ';
' expected.
56 name: 'Web Scraper',
~
src/features/shared/testing/pipeline-integration.test.ts:57:14 - error TS1005: '
;' expected.
57 component: () => <div data-testid="web-scraping">Web Scraping Content</di
v>,
~
src/features/shared/testing/pipeline-integration.test.ts:57:27 - error TS1005: '
>' expected.
57 component: () => <div data-testid="web-scraping">Web Scraping Content</di
v>,
~~~~
src/features/shared/testing/pipeline-integration.test.ts:57:38 - error TS1005: '
;' expected.
57 component: () => <div data-testid="web-scraping">Web Scraping Content</di
v>,
~
src/features/shared/testing/pipeline-integration.test.ts:57:58 - error TS1005: '
;' expected.
57 component: () => <div data-testid="web-scraping">Web Scraping Content</di
v>,
~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:57:75 - error TS1161: U
nterminated reg
ular expression literal.
57 component: () => <div data-testid="web-scraping">Web Scraping Content</di
v>,
~~~
~~~
src/features/shared/testing/pipeline-integration.test.ts:59:15 - error TS1005: '
;' expected.
59 complexity: 'intermediate',
~
src/features/shared/testing/pipeline-integration.test.ts:60:3 - error TS1109: Ex
pression expect
ed.
60 },
~
src/features/shared/testing/pipeline-integration.test.ts:60:4 - error TS1128: De
claration or st
atement expected.
60 },
~
src/features/shared/testing/pipeline-integration.test.ts:61:1 - error TS1128: De
claration or st
atement expected.
61 ];
~
src/features/shared/testing/pipeline-integration.test.ts:148:12 - error TS1005:
'>' expected.
148 <div data-testid="processing-pipelines">
~~~~
src/features/shared/testing/pipeline-integration.test.ts:148:23 - error TS1005:
')' expected.
148 <div data-testid="processing-pipelines">
~
src/features/shared/testing/pipeline-integration.test.ts:150:14 - error TS1005:
';' expected.
150 <nav data-testid="pipeline-navigation">
~~~~
src/features/shared/testing/pipeline-integration.test.ts:150:25 - error TS1005:
';' expected.
150 <nav data-testid="pipeline-navigation">
~
src/features/shared/testing/pipeline-integration.test.ts:151:25 - error TS1005:
',' expected.
151 {mockPipelines.map(pipeline => (
~
src/features/shared/testing/pipeline-integration.test.ts:153:15 - error TS1005:
'>' expected.
153 key={pipeline.id}
~~~
src/features/shared/testing/pipeline-integration.test.ts:153:18 - error TS1005:
')' expected.
153 key={pipeline.id}
~
src/features/shared/testing/pipeline-integration.test.ts:153:28 - error TS1005:
',' expected.
153 key={pipeline.id}
~
src/features/shared/testing/pipeline-integration.test.ts:154:15 - error TS1005:
',' expected.
154 data-testid={`nav-${pipeline.id}`}
~~~~
src/features/shared/testing/pipeline-integration.test.ts:154:26 - error TS1005:
',' expected.
154 data-testid={`nav-${pipeline.id}`}
~
src/features/shared/testing/pipeline-integration.test.ts:154:28 - error TS1136:
Property assign
ment expected.
154 data-testid={`nav-${pipeline.id}`}
~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:154:48 - error TS1005:
',' expected.
154 data-testid={`nav-${pipeline.id}`}
~
src/features/shared/testing/pipeline-integration.test.ts:155:24 - error TS1136:
Property assign
ment expected.
155 onClick={() => switchPipeline(pipeline.id)}
~
src/features/shared/testing/pipeline-integration.test.ts:155:27 - error TS1005:
';' expected.
155 onClick={() => switchPipeline(pipeline.id)}
~~
src/features/shared/testing/pipeline-integration.test.ts:156:41 - error TS1005:
',' expected.
156 className={activePipeline === pipeline.id ? 'active' : ''}
~~~
src/features/shared/testing/pipeline-integration.test.ts:157:13 - error TS1109:
Expression expe
cted.
157 >
~
src/features/shared/testing/pipeline-integration.test.ts:158:24 - error TS1005:
',' expected.
158 {pipeline.name}
~
src/features/shared/testing/pipeline-integration.test.ts:160:28 - error TS1005:
';' expected.
160 data-testid={`favorite-${pipeline.id}`}
~
src/features/shared/testing/pipeline-integration.test.ts:161:26 - error TS1136:
Property assign
ment expected.
161 onClick={(e) => {
~
src/features/shared/testing/pipeline-integration.test.ts:161:30 - error TS1005:
';' expected.
161 onClick={(e) => {
~~
src/features/shared/testing/pipeline-integration.test.ts:164:18 - error TS1128:
Declaration or
statement expected.
164 }}
~
src/features/shared/testing/pipeline-integration.test.ts:165:37 - error TS1005:
',' expected.
165 className={favorites.includes(pipeline.id) ? 'favorited' : '
'}
~
src/features/shared/testing/pipeline-integration.test.ts:167:17 - error TS1127:
Invalid charact
er.
167 ★
~
src/features/shared/testing/pipeline-integration.test.ts:168:16 - error TS1110:
Type expected.
168 </button>
~
src/features/shared/testing/pipeline-integration.test.ts:169:14 - error TS1161:
Unterminated re
gular expression literal.
169 </button>
~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:170:11 - error TS1128:
Declaration or
statement expected.
170 ))}
~
src/features/shared/testing/pipeline-integration.test.ts:170:12 - error TS1128:
Declaration or
statement expected.
170 ))}
~
src/features/shared/testing/pipeline-integration.test.ts:170:13 - error TS1128:
Declaration or
statement expected.
170 ))}
~
src/features/shared/testing/pipeline-integration.test.ts:171:10 - error TS1110:
Type expected.
171 </nav>
~
src/features/shared/testing/pipeline-integration.test.ts:175:11 - error TS1005:
'>' expected.
175 data-testid="pipeline-search"
~~~~
src/features/shared/testing/pipeline-integration.test.ts:175:22 - error TS1005:
';' expected.
175 data-testid="pipeline-search"
~
src/features/shared/testing/pipeline-integration.test.ts:178:10 - error TS1109:
Expression expe
cted.
178 />
~
src/features/shared/testing/pipeline-integration.test.ts:181:17 - error TS1005:
';' expected.
181 <select data-testid="category-filter">
~~~~
src/features/shared/testing/pipeline-integration.test.ts:181:28 - error TS1005:
';' expected.
181 <select data-testid="category-filter">
~
src/features/shared/testing/pipeline-integration.test.ts:182:19 - error TS1005:
'>' expected.
182 <option value="">All Categories</option>
~~~~~
src/features/shared/testing/pipeline-integration.test.ts:182:24 - error TS1005:
';' expected.
182 <option value="">All Categories</option>
~
src/features/shared/testing/pipeline-integration.test.ts:182:32 - error TS1005:
';' expected.
182 <option value="">All Categories</option>
~~~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:182:43 - error TS1161:
Unterminated re
gular expression literal.
182 <option value="">All Categories</option>
~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:183:19 - error TS1005:
';' expected.
183 <option value="ai-agents">AI Agents</option>
~~~~~
src/features/shared/testing/pipeline-integration.test.ts:183:40 - error TS1005:
';' expected.
183 <option value="ai-agents">AI Agents</option>
~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:183:47 - error TS1161:
Unterminated re
gular expression literal.
183 <option value="ai-agents">AI Agents</option>
~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:184:19 - error TS1005:
';' expected.
184 <option value="document-processing">Document Processing</option>
~~~~~
src/features/shared/testing/pipeline-integration.test.ts:184:56 - error TS1005:
';' expected.
184 <option value="document-processing">Document Processing</option>
~~~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:184:67 - error TS1161:
Unterminated re
gular expression literal.
184 <option value="document-processing">Document Processing</option>
~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:185:19 - error TS1005:
';' expected.
185 <option value="content-generation">Content Generation</option>
~~~~~
src/features/shared/testing/pipeline-integration.test.ts:185:54 - error TS1005:
';' expected.
185 <option value="content-generation">Content Generation</option>
~~~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:185:65 - error TS1161:
Unterminated re
gular expression literal.
185 <option value="content-generation">Content Generation</option>
~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:186:19 - error TS1005:
';' expected.
186 <option value="data-analysis">Data Analysis</option>
~~~~~
src/features/shared/testing/pipeline-integration.test.ts:186:46 - error TS1005:
';' expected.
186 <option value="data-analysis">Data Analysis</option>
~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:186:55 - error TS1161:
Unterminated re
gular expression literal.
186 <option value="data-analysis">Data Analysis</option>
~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:187:10 - error TS1161:
Unterminated re
gular expression literal.
187 </select>
~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:190:15 - error TS1005:
'>' expected.
190 <main data-testid="active-pipeline">
~~~~
src/features/shared/testing/pipeline-integration.test.ts:190:26 - error TS1005:
';' expected.
190 <main data-testid="active-pipeline">
~
src/features/shared/testing/pipeline-integration.test.ts:191:31 - error TS1005:
',' expected.
191 {activePipelineData && (
~~
src/features/shared/testing/pipeline-integration.test.ts:193:15 - error TS1005:
'>' expected.
193 pipelineId={activePipeline}
~~~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:193:25 - error TS1005:
')' expected.
193 pipelineId={activePipeline}
~
src/features/shared/testing/pipeline-integration.test.ts:194:31 - error TS1136:
Property assign
ment expected.
194 onStatusChange={() => {}}
~
src/features/shared/testing/pipeline-integration.test.ts:194:34 - error TS1005:
';' expected.
194 onStatusChange={() => {}}
~~
src/features/shared/testing/pipeline-integration.test.ts:194:39 - error TS1128:
Declaration or
statement expected.
194 onStatusChange={() => {}}
~
src/features/shared/testing/pipeline-integration.test.ts:195:13 - error TS1161:
Unterminated re
gular expression literal.
195 />
~~
src/features/shared/testing/pipeline-integration.test.ts:196:11 - error TS1128:
Declaration or
statement expected.
196 )}
~
src/features/shared/testing/pipeline-integration.test.ts:196:12 - error TS1128:
Declaration or
statement expected.
196 )}
~
src/features/shared/testing/pipeline-integration.test.ts:197:10 - error TS1110:
Type expected.
197 </main>
~
src/features/shared/testing/pipeline-integration.test.ts:200:14 - error TS1005:
'>' expected.
200 <div data-testid="pipeline-status">
~~~~
src/features/shared/testing/pipeline-integration.test.ts:200:25 - error TS1005:
';' expected.
200 <div data-testid="pipeline-status">
~
src/features/shared/testing/pipeline-integration.test.ts:201:17 - error TS1005:
';' expected.
201 Active: {activePipelineData?.name}
~
src/features/shared/testing/pipeline-integration.test.ts:202:10 - error TS1110:
Type expected.
202 </div>
~
src/features/shared/testing/pipeline-integration.test.ts:205:14 - error TS1005:
'>' expected.
205 <div data-testid="favorites-list">
~~~~
src/features/shared/testing/pipeline-integration.test.ts:205:25 - error TS1005:
';' expected.
205 <div data-testid="favorites-list">
~
src/features/shared/testing/pipeline-integration.test.ts:206:20 - error TS1005:
';' expected.
206 Favorites: {favorites.join(', ')}
~
src/features/shared/testing/pipeline-integration.test.ts:207:10 - error TS1110:
Type expected.
207 </div>
~
src/features/shared/testing/pipeline-integration.test.ts:208:8 - error TS1161: U
nterminated reg
ular expression literal.
208 </div>
~~~~~
src/features/shared/testing/pipeline-integration.test.ts:209:5 - error TS1128: D
eclaration or s
tatement expected.
209 );
~
src/features/shared/testing/pipeline-integration.test.ts:210:3 - error TS1128: D
eclaration or s
tatement expected.
210 };
~
src/features/shared/testing/pipeline-integration.test.ts:211:1 - error TS1128: D
eclaration or s
tatement expected.
211 }
~
src/features/shared/testing/pipeline-integration.test.ts:229:39 - error TS1005:
'>' expected.
229 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:239:39 - error TS1005:
'>' expected.
239 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:246:39 - error TS1005:
'>' expected.
246 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:266:39 - error TS1005:
'>' expected.
266 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:287:39 - error TS1005:
'>' expected.
287 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:298:39 - error TS1005:
'>' expected.
298 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:310:39 - error TS1005:
'>' expected.
310 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:322:39 - error TS1005:
'>' expected.
322 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:334:39 - error TS1005:
'>' expected.
334 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:360:39 - error TS1005:
'>' expected.
360 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:377:39 - error TS1005:
'>' expected.
377 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:384:39 - error TS1005:
'>' expected.
384 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:398:39 - error TS1005:
'>' expected.
398 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:422:39 - error TS1005:
'>' expected.
422 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:437:39 - error TS1005:
'>' expected.
437 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:454:39 - error TS1005:
'>' expected.
454 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:465:39 - error TS1005:
'>' expected.
465 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:481:39 - error TS1005:
'>' expected.
481 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:497:39 - error TS1005:
'>' expected.
497 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:507:39 - error TS1005:
'>' expected.
507 render(<MockProcessingPipelines />);
~
src/features/shared/testing/pipeline-integration.test.ts:525:27 - error TS1005:
'>' expected.
525 component: () => <div data-testid={id}>Test Pipeline Content</div>,
~~~~
src/features/shared/testing/pipeline-integration.test.ts:525:38 - error TS1005:
',' expected.
525 component: () => <div data-testid={id}>Test Pipeline Content</div>,
~
src/features/shared/testing/pipeline-integration.test.ts:525:39 - error TS1136:
Property assign
ment expected.
525 component: () => <div data-testid={id}>Test Pipeline Content</div>,
~
src/features/shared/testing/pipeline-integration.test.ts:525:43 - error TS1109:
Expression expe
cted.
525 component: () => <div data-testid={id}>Test Pipeline Content</div>,
~
src/features/shared/testing/pipeline-integration.test.ts:525:49 - error TS1005:
';' expected.
525 component: () => <div data-testid={id}>Test Pipeline Content</div>,
~~~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:525:66 - error TS1161:
Unterminated re
gular expression literal.
525 component: () => <div data-testid={id}>Test Pipeline Content</div>,
~~~~~~
src/features/shared/testing/pipeline-integration.test.ts:527:15 - error TS1005:
';' expected.
527 complexity: 'beginner',
~
src/features/shared/testing/pipeline-integration.test.ts:528:5 - error TS1109: E
xpression expec
ted.
528 ...overrides,
~~~
src/features/shared/testing/pipeline-integration.test.ts:529:3 - error TS1109: E
xpression expec
ted.
529 };
~
src/features/shared/testing/pipeline-integration.test.ts:530:1 - error TS1128: D
eclaration or s
tatement expected.
530 }
~
Found 153 errors in the same file, starting at: src/features/shared/testing/pipe
line-integratio
n.test.ts:29
-
+ 'use client'
+
+ import { useEffect, useCallback } from 'react'
+ import { KeyboardShortcut } from '../types'
+ import { useFeatureOrchestratorContext } from '../context'
+
+ interface UseKeyboardShortcutsOptions {
+ enabled?: boolean
+ shortcuts?: KeyboardShortcut[]
+ }
+
+ /**
+ * Hook for managing keyboard shortcuts for feature navigation
+ */
+ export function useKeyboardShortcuts(
+ options: UseKeyboardShortcutsOptions = {}
+ ) {
+ const { enabled = true, shortcuts = [] } = options
+ const {
+ getAllFeatures,
+ activateFeature,
+ activeFeatureId,
+ } = useFeatureOrchestratorContext()
+
+ // Default shortcuts for feature navigation
+ const defaultShortcuts: KeyboardShortcut[] = [
+ // Navigate between features with Alt+1-9
+ ...getAllFeatures().slice( 0, 9 ).map( ( feature, index ) => ( {
+ key: String( index + 1 ),
+ alt: true,
+ action: () => activateFeature( feature.metadata.id ),
+ description: `Switch to ${feature.metadata.name}`,
+ } ) ),
+ // Previous/Next navigation
+ {
+ key: 'ArrowLeft',
+ alt: true,
+ action: () => {
+ const features = getAllFeatures()
+ const currentIndex = features.findIndex( f => f.metadata.id === activeFeatureId )
+ if ( currentIndex > 0 ) {
+ activateFeature( features[currentIndex - 1].metadata.id )
+ }
+ },
+ description: 'Previous feature',
+ },
+ {
+ key: 'ArrowRight',
+ alt: true,
+ action: () => {
+ const features = getAllFeatures()
+ const currentIndex = features.findIndex( f => f.metadata.id === activeFeatureId )
+ if ( currentIndex < features.length - 1 ) {
+ activateFeature( features[currentIndex + 1].metadata.id )
+ }
+ },
+ description: 'Next feature',
+ },
+ // Quick search with Cmd/Ctrl+K
+ {
+ key: 'k',
+ cmd: true,
+ ctrl: true,
+ action: () => {
+ // Trigger feature search modal
+ const event = new CustomEvent( 'feature-search-open' )
+ window.dispatchEvent( event )
+ },
+ description: 'Open feature search',
+ },
+ ]
+
+ // Combine default and custom shortcuts
+ const allShortcuts = [...defaultShortcuts, ...shortcuts]
+
+ // Handle keyboard events
+ const handleKeyDown = useCallback( ( event: KeyboardEvent ) => {
+ if ( !enabled ) return
+
+ // Find matching shortcut
+ const matchingShortcut = allShortcuts.find( shortcut => {
+ const keyMatch = shortcut.key.toLowerCase() === event.key.toLowerCase()
+ const ctrlMatch = shortcut.ctrl ? event.ctrlKey : true
+ const cmdMatch = shortcut.cmd ? event.metaKey : true
+ const altMatch = shortcut.alt ? event.altKey : true
+ const shiftMatch = shortcut.shift ? event.shiftKey : true
+
+ return keyMatch && ctrlMatch && cmdMatch && altMatch && shiftMatch
+ } )
+
+ // Execute action if found
+ if ( matchingShortcut ) {
+ event.preventDefault()
+ matchingShortcut.action()
+ }
+ }, [enabled, allShortcuts] )
+
+ // Register keyboard listeners
+ useEffect( () => {
+ if ( !enabled ) return
+
+ window.addEventListener( 'keydown', handleKeyDown )
+
+ return () => {
+ window.removeEventListener( 'keydown', handleKeyDown )
+ }
+ }, [enabled, handleKeyDown] )
+
+ return {
+ shortcuts: allShortcuts,
+ enabled,
+ }
+ }
-
+ 'use client'
+
+ import {useEffect} from 'react'
+ import {ThreeColumnLayout} from '@/components/layout/three-column-layout'
+ import {
+ FeatureOrchestratorProvider,
+ FeatureOrchestrator,
+ registerFeature,
+ useFeatureOrchestratorContext,
+ useKeyboardShortcuts,
+ } from '@/features/orchestrator'
+ import {FireEnrich} from '@/features/fire-enrich'
+ import {DocumentProcessor} from '@/features/document-processing/document-processor'
+ import {ChatbotManager} from '@/features/firestarter/components/ChatbotManager'
+
+ /**
+ * Example: Register features with the orchestrator
+ */
+ function registerExistingFeatures() {
+ // Register Fire Enrich feature
+ registerFeature({
+ metadata: {
+ id: 'fire-enrich',
+ name: 'Fire Enrich',
+ description: 'AI-powered lead enrichment with web scraping',
+ icon: '🔥',
+ category: 'enrichment',
+ tags: ['ai', 'enrichment', 'scraping'],
+ },
+ component: FireEnrich,
+ config: {
+ preload: true,
+ preserveState: true,
+ animationType: 'slide',
+ },
+ })
+
+ // Register Document Processing feature
+ registerFeature({
+ metadata: {
+ id: 'document-processing',
+ name: 'Document Processing',
+ description: 'Process and analyze documents with AI',
+ icon: '📄',
+ category: 'document-processing',
+ tags: ['documents', 'ai', 'analysis'],
+ },
+ component: DocumentProcessor,
+ config: {
+ preserveState: true,
+ animationType: 'slide',
+ },
+ })
+
+ // Register Firestarter feature
+ registerFeature({
+ metadata: {
+ id: 'firestarter',
+ name: 'Firestarter',
+ description: 'Create and manage AI chatbots',
+ icon: '🤖',
+ category: 'ai-agents',
+ tags: ['chatbots', 'ai', 'agents'],
+ },
+ component: ChatbotManager,
+ config: {
+ preserveState: false,
+ animationType: 'fade',
+ },
+ })
+ }
+
+ /**
+ * Example: Feature navigation component for left sidebar
+ */
+ function FeatureNavigation() {
+ const {getAllFeatures, activeFeatureId, activateFeature} =
+ useFeatureOrchestratorContext()
+
+ const features = getAllFeatures()
+
+ return (
+ <nav className='space-y-1 p-4'>
+ {features.map((feature) => (
+ <button
+ key={feature.metadata.id}
+ onClick={() => activateFeature(feature.metadata.id)}
+ className={`
+ w-full flex items-center gap-3 px-3 py-2 rounded-lg
+ transition-all duration-200
+ ${
+ activeFeatureId === feature.metadata.id
+ ? 'bg-blue-50 text-blue-600 font-medium'
+ : 'hover:bg-gray-50 text-gray-700'
+ }
+ `}
+ >
+ <span className='text-xl'>{feature.metadata.icon}</span>
+ <span className='text-sm'>{feature.metadata.name}</span>
+ </button>
+ ))}
+ </nav>
+ )
+ }
+
+ /**
+ * Example: Context panel for right sidebar
+ */
+ function FeatureContextPanel() {
+ const {activeFeatureId, getFeature} = useFeatureOrchestratorContext()
+
+ if (!activeFeatureId) {
+ return (
+ <div className='p-4 text-gray-500'>Select a feature to see context</div>
+ )
+ }
+
+ const feature = getFeature(activeFeatureId)
+
+ return (
+ <div className='p-4'>
+ <h3 className='font-semibold mb-2'>{feature?.metadata.name}</h3>
+ <p className='text-sm text-gray-600 mb-4'>
+ {feature?.metadata.description}
+ </p>
+
+ {/* Feature-specific context panel if available */}
+ {feature?.contextPanel && <feature.contextPanel />}
+ </div>
+ )
+ }
+
+ /**
+ * Example: Main application with orchestration
+ */
+ export function OrchestratedApp() {
+ // Register features on mount
+ useEffect(() => {
+ registerExistingFeatures()
+ }, [])
+
+ return (
+ <FeatureOrchestratorProvider initialFeatureId='fire-enrich'>
+ <OrchestratedContent />
+ </FeatureOrchestratorProvider>
+ )
+ }
+
+ /**
+ * Inner component that uses orchestration
+ */
+ function OrchestratedContent() {
+ // Enable keyboard shortcuts
+ useKeyboardShortcuts()
+
+ return (
+ <ThreeColumnLayout
+ leftSidebar={<FeatureNavigation />}
+ rightSidebar={<FeatureContextPanel />}
+ >
+ <FeatureOrchestrator
+ className='h-full'
+ preserveHeight={true}
+ variants={{
+ slideForward: {
+ initial: {x: '100%', opacity: 0},
+ animate: {x: 0, opacity: 1},
+ exit: {x: '-100%', opacity: 0},
+ },
+ slideBackward: {
+ initial: {x: '-100%', opacity: 0},
+ animate: {x: 0, opacity: 1},
+ exit: {x: '100%', opacity: 0},
+ },
+ }}
+ />
+ </ThreeColumnLayout>
+ )
+ }
+