repo stringclasses 20
values | path stringlengths 6 94 | lang stringclasses 5
values | n_chars int64 81 200k | sha256 stringlengths 64 64 | content stringlengths 81 200k |
|---|---|---|---|---|---|
eren23/non_linear_ai_chat | frontend/src/design-system/stories/notes/NoteForceGraph.stories.tsx | tsx | 34,565 | 2276dd08e43e30f0153ebc673020519460563e92d9d4257a48e98c71ac4dec97 | import type { Meta, StoryObj } from '@storybook/react';
import React, { useState, useMemo, useCallback } from 'react';
/**
* NoteForceGraph displays an Obsidian-style force-directed graph visualization
* of notes and their connections.
*
* **Features:**
* - Force-directed layout using D3.js
* - Node colors based... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/notes/SummaryView.stories.tsx | tsx | 33,219 | e1cc6b2914a8d993cb3ceacd05057aebbc401c4e12c6b3c79d5bf04adda080f4 | import type { Meta, StoryObj } from '@storybook/react';
import React, { useState } from 'react';
import { ThumbsUp, ThumbsDown } from 'lucide-react';
/**
* SummaryView displays AI-generated daily and weekly summaries of memories.
* Users can filter by summary type and generate new summaries on demand.
*
* Note: Th... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/properties/InfoNodeProperties.stories.tsx | tsx | 47,783 | 5bba95edc084c2cb732b6ce94176b8f72307afe1e7feed36e9259dee4343ee66 | import type { Meta, StoryObj } from '@storybook/react';
import { useState, useCallback } from 'react';
/**
* InfoNodeProperties is the expanded properties panel for Information Nodes.
* It contains ALL controls moved from InformationNode.
*
* **Features:**
* - Name editing with input field
* - Grid size slider (... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/properties/MediaNodeProperties.stories.tsx | tsx | 38,681 | 84bbdd6d41f68f4f47a7728f186a93103cfea1fd248b3e1c23f8c3cd6b6cc676 | import type { Meta, StoryObj } from '@storybook/react';
import { useState, useCallback } from 'react';
/**
* MediaNodeProperties is the properties panel for media generation nodes.
* It provides all controls for configuring image/video generation settings.
*
* **Features:**
* - Mode toggle (Image/Video)
* - Mode... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/properties/FlowProperties.stories.tsx | tsx | 24,405 | 0a267f1da33f10b5550c315545bb7579704e94b0142672e44e2c249a780eebcd | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
/**
* FlowProperties displays flow-level information when no node is selected.
*
* **Features:**
* - Flow name input (editable when saved)
* - AI-generated summary with refresh capability
* - Node statistics grid (6 cards: ... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/properties/FlowGraphInsights.stories.tsx | tsx | 26,396 | e1c7eabffae80b13ee541a43a7d911a416dd33f48deb212b731358f3d89dd2f7 | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
/**
* FlowGraphInsights displays knowledge graph insights for a flow.
*
* **Features:**
* - Topics discussed with weight bars
* - People mentioned as tags
* - Related flows with similarity percentage and shared topics
* - ... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/properties/GroupProperties.stories.tsx | tsx | 24,274 | 7d22fd988054df4a3a531a8c0cb3b1c45a36f360b77220426503312085939ad1 | import type { Meta, StoryObj } from '@storybook/react';
import { useState, useCallback } from 'react';
/**
* GroupProperties is a properties panel for group nodes that allows users
* to edit group settings, view members, and perform group actions.
*
* **Features:**
* - Group name editing
* - AI-generated summary... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/properties/FlowReferenceProperties.stories.tsx | tsx | 34,132 | 96e17f42bba82979045aeabe03553b40d53b3f314d6f9d04fa4c3a21b16b2123 | import type { Meta, StoryObj } from '@storybook/react';
import { useState, useCallback } from 'react';
/**
* FlowReferenceProperties is the properties panel for flow reference nodes.
* It shows when a flowReference node is selected.
*
* **Features:**
* - Header with flow reference icon and flow name
* - Stale wa... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/properties/NodeProperties.stories.tsx | tsx | 22,850 | 2c6b6bbf997feb4d02bd38c7d846e2c6f3862c90935f1949b97ce125e68f182e | import type { Meta, StoryObj } from '@storybook/react';
import { useState, useCallback } from 'react';
/**
* NodeProperties is the primary properties panel for chat nodes in Spider Chat.
* It provides comprehensive controls for configuring chat nodes.
* Prompt input/send/token estimate have moved to FloatingInputBa... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/dashboards/UserFactsDashboard.stories.tsx | tsx | 27,285 | 3ed804f213da17eaf17b5f7bb8b0c05dddf9fcb127451adc1d326a965635f574 | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import {
Brain,
Shield,
Timer,
Sparkles,
Edit2,
Save,
X,
Trash2,
RefreshCw,
TrendingUp,
User,
Target,
Lightbulb,
Heart,
Calendar,
} from 'lucide-react';
/**
* UserFactsDashboard displays and manages... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/dashboards/AdminDashboard.stories.tsx | tsx | 28,122 | 84092a5364b3ab3bcb22036bf9b53d30e1e032643aa900ffaf802505216015c4 | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import {
BarChart3,
Users,
Bug,
Shield,
AlertCircle,
Eye,
RefreshCw,
Plus,
Settings,
ChevronRight,
} from 'lucide-react';
/**
* AdminDashboard provides a comprehensive administrative interface for managing
*... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/dashboards/UserDashboard.stories.tsx | tsx | 18,007 | bf64e4b36c0e6bbf2d3d974af66b840cfe06d96eb1efff759b5d360e65fea698 | import type { Meta, StoryObj } from '@storybook/react';
import {
User,
TrendingUp,
FileText,
Image as ImageIcon,
MessageSquare,
Zap,
Settings,
BarChart3,
Calendar,
Brain,
Key,
} from 'lucide-react';
/**
* UserDashboard displays personal user statistics, usage limits, preferences,
* and integrat... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/templates/TemplateGallery.stories.tsx | tsx | 13,738 | a8affe9049b314f39de8ceae8855785c7a1674926b5be09807bf23f68ccdb2d3 | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import type { TemplateListItem, TemplateCategory } from '@/types/templates';
/**
* TemplateGallery is a modal for browsing and importing workflow templates.
* Since the actual component relies on API calls, we create a mock ver... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/templates/TemplateMinimap.stories.tsx | tsx | 9,827 | 630b7a576d8c24158dd1467a383cb5d24da426d909fc4428b314c5a055c1b735 | import type { Meta, StoryObj } from '@storybook/react';
import { ReactFlowProvider } from '@xyflow/react';
import { TemplateMinimap } from '@/components/templates/TemplateMinimap';
import '@xyflow/react/dist/style.css';
/**
* TemplateMinimap renders a non-interactive preview of a template's flow structure.
* Uses Re... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/templates/TemplateCard.stories.tsx | tsx | 6,328 | faf2e7353a09b7f2fb0f122e5120ae3e04b34f9ac988e24ba07199b73198b61c | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import TemplateCard from '@/components/templates/TemplateCard';
import type { TemplateListItem } from '@/types/templates';
/**
* TemplateCard displays a single template in the gallery grid.
* Shows title, description, tags, and... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/templates/ImageTemplateManager.stories.tsx | tsx | 28,020 | 794c473bc37e23ada6b1886732ee00f70029ec56b84efb3c33e93e42373c97aa | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import type { ImageTemplate, ImageTemplateParameters } from '@/types/graph';
/**
* ImageTemplateManager is a full management interface for image generation templates.
* Since it relies on API calls and complex state, we create ... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/templates/PresetStudio.stories.tsx | tsx | 30,057 | e48ac5c9c5c541157d8280d6c447a7b3f47eec35c85b014c27f78d485d837122 | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import type { ImageTemplate, ImageTemplateParameters } from '@/types/graph';
/**
* PresetStudio is a full-screen modal for managing image generation presets.
* Features a two-panel layout with preset list on the left and editor... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/templates/ImageTemplateForm.stories.tsx | tsx | 15,775 | 1a41e73b1685699c9b3a1c04aba8c1c90fddd6fbf3e2e14ddc0a9ea039097166 | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import type { ImageTemplateParameters } from '@/types/graph';
/**
* ImageTemplateForm is used for editing image generation template parameters.
* Since it requires CSS modules and complex state, we create a mock version
* that... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/templates/index.ts | ts | 685 | 6d38824a729949f7952f3b792b10c3072e99def12ea9f00b818b9fb0715f6ff1 | /**
* Template component stories index
*
* This directory contains Storybook stories for template-related components:
*
* - TemplateCard: Individual template card for gallery display
* - TemplateGallery: Modal for browsing and importing workflow templates
* - TemplatePreviewModal: Detailed template preview befor... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/templates/TemplatePreviewModal.stories.tsx | tsx | 20,458 | 1977b4eeb7f7922e21bdda7018c0e9c6e84e64a56748bd76378f15748a23767b | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import { ReactFlowProvider } from '@xyflow/react';
import type { Template } from '@/types/templates';
/**
* TemplatePreviewModal shows detailed template information before importing.
* Since it uses TemplateMinimap which requir... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/documents/DocumentSummaryCard.stories.tsx | tsx | 9,441 | 1ca19541b4f797cf833b651b4693dd7072854ee2fe3996355818fc6749bac8b7 | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import type { CSSProperties } from 'react';
/**
* DocumentSummaryCard displays an AI-generated summary and title suggestions
* for a processed document. It appears inline in LibraryPanel document rows
* after processing comple... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/documents/InlinedDocuments.stories.tsx | tsx | 21,763 | 2178db7c131862fc388a6353917acfebe7c921f09d9339dddb23ef427163799b | import type { Meta, StoryObj } from '@storybook/react';
import type { CSSProperties } from 'react';
import { useState } from 'react';
import {
FileText,
Search,
Loader2,
ChevronDown,
ChevronUp,
Eye,
EyeOff,
File,
FileSpreadsheet,
Presentation,
Image as ImageIcon,
} from 'lucide-react';
/**
* Inl... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/text-utilities/AutocompletePopup.stories.tsx | tsx | 17,046 | 344fd8ff896a6d16823e0caed4318ffeb5fbbd34404b990384e53298570cffb4 | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import { FileText, Hash, AtSign, Plus } from 'lucide-react';
/**
* AutocompletePopup displays suggestions for note links, tags, and mentions.
* It supports different visual themes based on the autocomplete type:
* - Notes: Blu... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/text-utilities/HighlightedText.stories.tsx | tsx | 5,458 | ca4e1d268bc4c4963635adab32f53d35efef2a2052a6392e1c3725f08c1376a8 | import type { Meta, StoryObj } from '@storybook/react';
const meta: Meta = {
title: 'TextUtilities/HighlightedText',
parameters: {
layout: 'centered',
docs: {
description: {
component: `
Renders text with specific character indexes highlighted.
Used by the AutocompletePopup to show which char... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/text-utilities/AISelectionToolbar.stories.tsx | tsx | 21,488 | 539d6bee9bdf3204a8893c52b321be4877b0fd522541794217f3b37962a38dfe | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import {
Sparkles,
FileText,
Expand,
Check,
List,
PenLine,
MoreHorizontal,
X,
Replace,
ArrowDownToLine,
ChevronDown,
Loader2,
ArrowLeft,
PlayCircle,
CheckSquare,
Lightbulb,
Languages,
MessageSqu... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/text-utilities/LinkSuggestorBanner.stories.tsx | tsx | 6,194 | 10fef5a72cd9315ac68bdc027db2bdc687071723973b2f4b45e03ffbdb35b887 | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import { Link2, X, ArrowRight } from 'lucide-react';
const meta: Meta = {
title: 'TextUtilities/LinkSuggestorBanner',
parameters: {
layout: 'centered',
docs: {
description: {
component: `
Passive link su... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/text-utilities/RichTextEditor.stories.tsx | tsx | 18,557 | 9e918536f7fb9cec4c16a8f6a242c0a8e3ad6fd0fb68f43f3dacdf1525fbae70 | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import {
Bold,
Italic,
List,
ListOrdered,
Link as LinkIcon,
Code,
Quote,
Heading1,
Heading2,
Type,
} from 'lucide-react';
/**
* RichTextEditor provides enhanced markdown-based text editing for information nod... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/text-utilities/SelectionContextMenu.stories.tsx | tsx | 11,760 | 3788c0d315b49f75b46a60ff0facdf8de24843869daf8228fa78903fd94ee3a2 | import type { Meta, StoryObj } from '@storybook/react';
import { StickyNote } from 'lucide-react';
/**
* SelectionContextMenu is a right-click context menu that appears when text is selected.
* It provides a quick action to save the selected text as a note.
*
* The component:
* - Listens globally for right-click ... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/text-utilities/MarkdownToolbar.stories.tsx | tsx | 5,468 | 6610e34dfddbfd4142c39c7475fa82c9cb45297ef8772db03efa49557fd6f120 | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import {
Bold,
Italic,
Code,
Heading1,
Heading2,
List,
ListOrdered,
Quote,
Link as LinkIcon,
} from 'lucide-react';
const meta: Meta = {
title: 'TextUtilities/MarkdownToolbar',
parameters: {
layout: 'cen... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/sketch/SketchEditorModal.stories.tsx | tsx | 7,511 | 50f9ff5fbc6532c6f7da12afcd505bf94cf53bffb247e8956ff466ac13fd0d5c | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import { Pen, Save, Trash2, X, Loader2 } from 'lucide-react';
import ConfirmDialog from '@/components/controls/ConfirmDialog';
/**
* SketchEditorModal is a fullscreen overlay wrapping an Excalidraw canvas for drawing.
*
* **Fe... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/sketch/SketchGridItem.stories.tsx | tsx | 7,768 | 3658d48854ce2109a706552702ba7e2be4f1b9ca4c96462305ccad9f5fc38c36 | import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import { Pen, Edit2, Trash2, Eye, EyeOff, Loader2 } from 'lucide-react';
import ConfirmDialog from '@/components/controls/ConfirmDialog';
/**
* SketchGridItem displays a sketch thumbnail in the InformationNode grid.
*
* **Feat... |
eren23/non_linear_ai_chat | frontend/src/design-system/stories/help/HelpModal.stories.tsx | tsx | 33,078 | 5091aa7edcf3a8ebe948ef8db8d0eac269509a163d352652f104f9fb8b3890db | import type { Meta, StoryObj } from '@storybook/react';
import { useState, useMemo, useCallback, useRef, useEffect } from 'react';
/**
* HelpModal is a comprehensive searchable help center with categories and articles.
* This is a self-contained mock component that doesn't require external dependencies.
*/
// ====... |
eren23/non_linear_ai_chat | frontend/src/services/nodeIdService.ts | ts | 2,133 | 6844b4c89ac888a5c13a2d930453a461ec0756515d45b7cf4790a16c425894d6 | /**
* NodeIdService - Centralized node ID generation.
*
* Replaces module-level counter in utils.ts with a proper service:
* - Encapsulated state (no module-level variables)
* - Testable (can create fresh instances in tests)
* - Thread-safe ID generation
* - Sync with existing nodes when loading flows
*
* Usag... |
eren23/non_linear_ai_chat | frontend/src/services/PerformanceManager.ts | ts | 14,291 | 9fb24e07799a9e3e131dbd4bd3540b01bb178a59d9bcf3b3369ceeacd733dfa6 | /**
* PerformanceManager Service
*
* Singleton service that monitors and optimizes tab performance.
* Runs in the background monitoring memory usage and automatically
* suspending idle tabs when memory pressure is high.
*
* Components can subscribe to get metrics updates.
*/
import useGraphStore from '@/store/... |
eren23/non_linear_ai_chat | frontend/src/services/__tests__/PerformanceManager.test.ts | ts | 34,690 | 1490a45cee5464a1c87cd80a9a6a5d523cf021c9a993f1b8ce8b378c1d37a2a1 | /**
* Tests for PerformanceManager service.
*
* Tests cover:
* - Singleton behavior and lifecycle (start/stop)
* - Subscription and notification mechanism
* - Node and flow memory estimation
* - Metrics collection (system health, per-tab metrics, warnings)
* - Auto-suspend of idle tabs when memory exceeds targe... |
eren23/non_linear_ai_chat | frontend/src/store/useFileProgressStore.ts | ts | 4,291 | eabcb678485fcb6188740fc2aefe6aa32862d84fd8e091554a010dc4859d4bf5 | /**
* Zustand store for file upload progress tracking.
*
* Tracks real-time progress of file processing via Socket.io events.
* Separate from useGraphStore to keep file upload state isolated.
*/
import { create } from 'zustand';
/**
* Processing stages for file uploads.
*/
export type ProcessingStage =
| 'up... |
eren23/non_linear_ai_chat | frontend/src/store/useTaskStore.ts | ts | 11,342 | 67d3a456ac74dfb87dd1833e3ad820ffdbc8921ccffca76fd7fc364e9ca1ae90 | /**
* Task Store using Zustand
*
* Provides state management for tasks (commitments) and reminders.
* Includes caching, optimistic updates, and filter management.
*/
import { create } from 'zustand';
import {
Task,
TaskFilters,
Reminder,
getTasks as apiGetTasks,
completeTask as apiCompleteTask,
archiv... |
eren23/non_linear_ai_chat | frontend/src/store/useAgentStore.ts | ts | 14,142 | 72aec22abd6633c0c23441c8d5fbdd91fd0b3d3259000b1441d877521fe67f1d | /**
* Agent Store - Zustand store for AI agent collaborator state.
*
* Manages agent session state, activity log, budget display,
* and permission requests.
*/
import { create } from 'zustand';
import { connectSocket } from '@/lib/socket';
import type { Socket } from 'socket.io-client';
import useGraphStore from ... |
eren23/non_linear_ai_chat | frontend/src/store/useGraphStore.ts | ts | 2,361 | cefb44e22d6e9061195f6cdbb8d4f7fd8f7ab2de17c63ba0d34a1e2d72333b7f | /**
* Zustand store for graph state management.
*
* CRITICAL: This implements the core logic for:
* 1. Ancestry chain traversal (context for LLM)
* 2. Time travel / stale node marking
* 3. Node and edge management
*
* DO NOT use React Context for graph state - use Zustand for performance.
*
* ARCHITECTURE: Th... |
eren23/non_linear_ai_chat | frontend/src/store/useMemoryStore.ts | ts | 9,559 | 6766a167abd5feea1a7dae1b48546269ba87f74b77ae7aed0717121c55608ab5 | /**
* Memory store using Zustand - provides caching and optimistic updates.
*/
import { create } from 'zustand';
import { getMemories, type Memory } from '@/lib/memoriesApi';
import { connectSocket, areSocketsEnabled } from '@/lib/socket';
interface MemoryCache {
memories: Memory[];
nextCursor: string | null;
... |
eren23/non_linear_ai_chat | frontend/src/store/useCaptureStore.ts | ts | 30,302 | 4c0c75bd7ea3a2c5c019b63907f68ea4c5dad046c2c9177a0ac55d0bff69c2b5 | /**
* Capture Store - Zustand store for browser extension captures.
*
* Manages capture list, pagination, filtering, and API interactions.
*/
import { create } from 'zustand';
import { getSocket } from '@/lib/socket';
import { apiFetch } from '@/lib/csrfApi';
const API_BASE = import.meta.env.VITE_API_URL || '';
... |
eren23/non_linear_ai_chat | frontend/src/store/useCollaborationStore.ts | ts | 6,691 | 74694297726544e44cd83d9dcd2ac0c35ae176ecff1c8aefcc4414029deb39ff | import { create } from 'zustand';
// Types
export interface Collaborator {
userId: string;
userName: string;
userEmail: string;
userPicture?: string;
role: 'owner' | 'editor' | 'agent';
socketId: string;
joinedAt: number;
color?: string; // Assigned color for cursor/avatar
isMcpAgent?: boolean;
mcp... |
eren23/non_linear_ai_chat | frontend/src/store/useNotesStore.ts | ts | 10,661 | 96e15c7348cd083c305343b67b074c067bf1cb7ceff43b22b15ab6323292476b | /**
* Notes store using Zustand - provides caching and state management for notes.
*/
import { create } from 'zustand';
import {
Note,
NoteFilters,
NoteCreateInput,
NoteUpdateInput,
SemanticSearchResponse,
createNote as apiCreateNote,
getNotes as apiGetNotes,
updateNote as apiUpdateNote,
deleteNote... |
eren23/non_linear_ai_chat | frontend/src/store/useMobileViewStore.ts | ts | 3,492 | 36408f76e26bb12e54a27d73e71d1c25f5dc4632e3fc58d098207222e514960a | /**
* Mobile View Store
*
* Manages mobile-specific UI state and view mode switching.
* Desktop users can also opt into mobile view for a linear experience.
*/
import { create } from 'zustand';
import { persist } from 'zustand/middleware';
// Breakpoint for auto-detecting mobile
const MOBILE_BREAKPOINT = 768;
e... |
eren23/non_linear_ai_chat | frontend/src/store/useTourStore.ts | ts | 1,568 | f32d73cc506d00cc4e0b9b768e3b372b2da2b2e222f921a6c41637147d3bbc64 | /**
* Tour Store - Manages interactive tour state and completion tracking
*
* Uses localStorage to persist tour completion status so users
* aren't repeatedly shown the tour on subsequent visits.
*/
import { create } from 'zustand';
interface TourState {
// Whether the tour is currently running
isRunning: bo... |
eren23/non_linear_ai_chat | frontend/src/store/useFeatureStore.ts | ts | 2,451 | 94b2b9a235a0bcaaaae9359305c78fd7707a1c3156e6e23eb507d60912d3e031 | /**
* Feature flags store using Zustand.
* Fetched during app initialization from /api/information/init.
*/
import { create } from 'zustand';
export interface FeatureStates {
ocr: boolean;
imageGeneration: boolean;
videoGeneration: boolean;
documentUpload: boolean;
rag: boolean;
memories: boolean;
ca... |
eren23/non_linear_ai_chat | frontend/src/store/useDocumentEventsStore.ts | ts | 2,342 | 6c5307ef70ce0ba70a123e1369ad02bb392136a562b907d10289c4e3e0f14047 | /**
* Zustand store for library-document Socket.io events.
*
* Replaces an earlier `window.dispatchEvent(new CustomEvent(...))` indirection
* between `lib/socket.ts` and `LibraryPanel`. The store is the single typed
* channel: socket handlers call `applyDocumentReady` / `applyDocumentSummaryReady`
* after Zod-val... |
eren23/non_linear_ai_chat | frontend/src/store/useNotificationStore.ts | ts | 6,951 | ca47947b13e77392b857599e2b60035c56ded20d65c7aaa050c02a796d4658f0 | /**
* Notification Store
*
* Manages in-app notifications for reminders, tasks, and system events.
* Integrates with Socket.io for real-time notifications.
*/
import { create } from 'zustand';
import { getSocket, connectSocket, areSocketsEnabled } from '../lib/socket';
// ========================================... |
eren23/non_linear_ai_chat | frontend/src/store/useAuthStore.ts | ts | 6,871 | 3fa96bb347ec09d989b001e93f03a61e330e5bc4c18ebbe3971f2855f991e9d0 | /**
* Authentication store using Zustand.
*
* Features:
* - Cross-tab logout detection via `storage` event
* - Global 401 interception via `onApiFetchUnauthorized`
*/
import { create } from 'zustand';
import * as Sentry from '@sentry/react';
import { getCurrentUser, logout as apiLogout, User } from '@/lib/authAp... |
eren23/non_linear_ai_chat | frontend/src/store/useDocumentChatStore.ts | ts | 6,297 | b989cad514e76c2dc01496b91abede06ee255f8d9ea8bdd662d7f866081ede69 | /**
* Document Chat Store - Standalone Zustand store for document chat feature.
*
* Manages panel open/close, active session, messages, generation state,
* and document summaries.
*/
import { create } from 'zustand';
import type { ChatMessage, ChatReference, DocumentSummary } from '@/lib/documentChatApi';
// ===... |
eren23/non_linear_ai_chat | frontend/src/store/useBackgroundTaskStore.ts | ts | 3,523 | cccfb1e8d454480bf698a1d3d61ed06cec9c56d021724e5e10d61d23693934ec | /**
* Background Task Store - Tracks in-flight media generation tasks.
*
* When a user starts an image/video generation and switches tabs,
* the generation continues in the background. This store tracks
* those tasks so we can:
* - Block tab close while generation is running
* - Show beforeunload warning
* - Kn... |
eren23/non_linear_ai_chat | frontend/src/store/types/index.ts | ts | 19,818 | bec76303c67f64584fe49156cba1aa413440d2318b13b075e8d1110fabab7bcc | /**
* Type definitions for the graph store slices.
*
* Each slice defines its own state and actions interface.
* The full GraphStore is composed from all slice interfaces.
*/
import type { Connection, EdgeChange, NodeChange } from '@xyflow/react';
import type {
NodeData,
GroupNodeData,
InformationNodeData,
... |
eren23/non_linear_ai_chat | frontend/src/store/slices/groupSlice.ts | ts | 8,187 | e2fa1d02304a2cffbf2867c01814d9afa6b0de690be7d63f58f2395f4cf7cfa6 | /**
* Group slice - Group node management.
*
* Handles:
* - Creating and ungrouping nodes
* - Group summary generation
* - Group bounds calculation
* - Node membership in groups
*
*/
import type { StateCreator } from 'zustand';
import type { GraphStore, GroupSlice, NodeData, GroupNodeData, Message } from '../... |
eren23/non_linear_ai_chat | frontend/src/store/slices/historySlice.ts | ts | 4,060 | ec46fb4a44b8da93948b4105b12ad15b0bed5230bf23df0b10e27b009a06683c | /**
* History slice - Undo/Redo functionality.
*
* Manages snapshots of graph state for time-travel debugging.
* - Saves snapshots before mutations
* - Cleans transient states (isLoading, isGenerating) from snapshots
* - Limits history to 20 snapshots (reduced from 50 for memory optimization)
*
* Memory optimiz... |
eren23/non_linear_ai_chat | frontend/src/store/slices/initSlice.ts | ts | 3,896 | f111747ecc5348e9d043eabf6136a953d143b1001bf5f13b10900d79331b3294 | /**
* Initialization slice - Models, tools, and app initialization.
*
* Handles:
* - Batch loading of models, tools, and user preferences on app start
* - Model and tool state management
* - Default model selection
* - Error handling with retry logic
*/
import type { StateCreator } from 'zustand';
import { DEF... |
eren23/non_linear_ai_chat | frontend/src/store/slices/parallelSlice.ts | ts | 16,423 | 18a0647406d8ca0f4837ddec29f3ec994b682ef47f49a20baa2b4e1de94bc238 | /**
* Parallel generation slice - Multi-branch LLM orchestration.
*
* Handles:
* - Creating temporary branch nodes for parallel generation
* - Tracking generation state across branches
* - Selecting a winning branch and discarding others
*/
import type { StateCreator } from 'zustand';
import type { GraphStore, ... |
eren23/non_linear_ai_chat | frontend/src/store/slices/ancestrySlice.ts | ts | 38,431 | c77c248f791377e22cc4845c705be3dc6591a981fad450decc6c57f73a82f45b | /**
* Ancestry slice - Graph traversal and message building for LLM context.
*
* CRITICAL: This is the core logic for building LLM context.
*
* Handles:
* - Ancestry chain traversal (all parent branches)
* - Message formatting for LLM (with synthesis and deep mode support)
* - Stale marking for time travel
* -... |
eren23/non_linear_ai_chat | frontend/src/store/slices/utils.ts | ts | 1,526 | 8208889c51beedc322135a2a06f0a12a4a29b450649a37df688fb6a51bf7814b | /**
* Module-level shared state for store slices.
*
* These Maps hold debounce timer IDs shared across multiple slices
* (edgeSlice and nodeSlice). They are module-level for performance
* reasons -- timer/RAF IDs are inherently process-scoped and cannot
* live in React state or Zustand stores without causing re-r... |
eren23/non_linear_ai_chat | frontend/src/store/slices/subNodeSlice.ts | ts | 10,311 | 068b824db5a99eac940c0a901c609d9cf6580e518819523719021b5b55ab00e6 | /**
* SubNode slice - Information node sub-node management.
*
* Handles:
* - Adding image and text sub-nodes to information nodes
* - Updating and deleting sub-nodes
* - Managing web links
*/
import type { StateCreator } from 'zustand';
import type { GraphStore, SubNodeSlice, InformationNodeData } from '../type... |
eren23/non_linear_ai_chat | frontend/src/store/slices/uiSlice.ts | ts | 15,983 | 2d93bbca5cc9c3fcbbe5130dcb3ccee2886b93bdb416bfe4e28dac878f3d51ce | /**
* UI slice - Highlights, modals, interaction tracking, and sidebar state.
*
* Manages transient UI state:
* - Highlighted nodes during generation
* - Modal states
* - Interaction tracking for performance optimization
* - Snap mode for magnetic grid/neighbor alignment
* - Left/Right sidebar state for new Ele... |
eren23/non_linear_ai_chat | frontend/src/store/slices/nodeSlice.ts | ts | 19,760 | da109b3f0977f525aa9c632e50454440521e3e949f2e49727c0fd189eae90efc | /**
* Node slice - Node CRUD operations.
*
* Handles:
* - Adding chat, information, and media generation nodes
* - Updating node data with proper array handling
* - Deleting nodes and cleaning up references
*/
import type { StateCreator } from 'zustand';
import type {
GraphStore,
NodeSlice,
GraphNode,
G... |
eren23/non_linear_ai_chat | frontend/src/store/slices/index.ts | ts | 708 | a740e06db8b3fc438c1ecd9252c3f5633f390ba87457c01836fb744a261cdc4e | /**
* Store slices index.
*
* Re-exports all slice creators for easy composition in the main store.
*/
export { createHistorySlice } from './historySlice';
export { createInitSlice } from './initSlice';
export { createNodeSlice } from './nodeSlice';
export { createEdgeSlice } from './edgeSlice';
export { createAnc... |
eren23/non_linear_ai_chat | frontend/src/store/slices/flowSlice.ts | ts | 22,813 | 391c805bfcd1fa1a97757de869bff62c719a1a668111b72ead44aebb22f806ce | /**
* Flow slice - Flow loading, saving, and management.
*
* Handles:
* - Loading and clearing flows
* - Auto-save functionality
* - Flow suggestions cache
* - Onboarding templates
*/
import type { StateCreator } from 'zustand';
import type { GraphStore, FlowSlice, GraphNode, NodeData, GroupNodeData, SaveStatu... |
eren23/non_linear_ai_chat | frontend/src/store/slices/tabsSlice.ts | ts | 15,288 | 1a1acdbe3b7a3d48312d221a4ee5d8b924977294222bd6f02a802b0d73edd4fd | /**
* Tabs slice - Multi-tab flow management for browser-like UX.
*
* Handles:
* - Opening, closing, and switching between flow tabs
* - Tab ordering via drag-and-drop
* - Tab suspension for memory management
* - Recently closed tabs for reopen functionality
* - Pane management for future split-view support
* ... |
eren23/non_linear_ai_chat | frontend/src/store/slices/selectionSlice.ts | ts | 10,206 | 6821eaf141282ddabf3518c3bbc66518bcb027db3aedc0e80ad05677ff7eea45 | /**
* Selection slice - Node selection and organization.
*
* Manages:
* - Multi-node selection
* - Click position tracking
* - Automatic hierarchical node organization
*/
import type { StateCreator } from 'zustand';
import type { GraphStore, SelectionSlice, GraphNode, GroupNodeData } from '../types';
// Layout... |
eren23/non_linear_ai_chat | frontend/src/store/slices/edgeSlice.ts | ts | 18,244 | 5f8e3a9a3288c9c35a96ff955b7dfedb880a56f0b5e1c26d28893f46ac634614 | /**
* Edge slice - Edge and connection operations.
*
* Handles:
* - ReactFlow node and edge change events
* - Connection validation and creation
* - Group bounds updates on node movement
*/
import type { StateCreator } from 'zustand';
import type { NodeChange } from '@xyflow/react';
import { addEdge, applyNodeC... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/edgeSlice.test.ts | ts | 37,780 | 4359df2cf0f1c2361eff4e1c2e2f922b9a38482fd2cec655129f63da0c058a05 | import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { createEdgeSlice } from '../edgeSlice';
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// Mocks
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
vi.mock('@xyflow/react', ... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/utils.test.ts | ts | 2,025 | cdc5804932cf15417df0e0e9574b87e26816f52b6a2b3a7ff8128ca7668184d6 | /**
* Tests for the utils.ts module-level shared state.
*
* Covers:
* - cleanupModuleState() properly clears all Maps and cancels timers
* - Module-level Maps behave correctly under set/cleanup cycles
*/
import { describe, it, expect, beforeEach } from 'vitest';
import {
pendingSummaryUpdates,
pendingNodePo... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/initSlice.test.ts | ts | 16,658 | 71ef7a561b6f86fcfa0c7fdf67a391a7fcd840a36910350e88f8928ed08a1b65 | /**
* Tests for init slice - App initialization, models, and tools management.
*
* Tests cover:
* - Initial state
* - initializeApp - successful initialization
* - initializeApp - error handling and retry logic
* - initializeApp - setting models, tools, and default model
* - initializeApp - feature flags
* - s... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/parallelSlice.test.ts | ts | 28,063 | 469e9a24a8e056166b53d4621b37705adb24008e908688754529a07e24c552ba | /**
* Tests for parallel generation slice - Multi-branch LLM orchestration.
*
* Tests cover:
* - Starting parallel generation sessions
* - Branch node creation and positioning
* - Session state management
* - Selecting winning branches
* - Discarding branches
* - Session cleanup
* - Synthesis mode
*/
import... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/historySlice.memory.test.ts | ts | 22,468 | ff32d573da39285f843a370519d33cecf6fd3920fdb7135bafe9dc26817dee84 | /**
* Tests for history slice memory management.
*
* Focuses on memory-related concerns of the undo/redo system:
* - Undo/redo stack maintains correct state
* - Multiple undo operations work correctly
* - Redo after undo restores correct state
* - New action after undo clears redo stack
* - History has a maximu... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/flowSlice.test.ts | ts | 35,132 | 4b8351466bf6936b8a33b2719d99efffb9963a2ea42556c1e9f012ea2ccf4b37 | /**
* Tests for flow slice - Flow loading, saving, and management.
*
* Tests cover:
* - Loading flows (with nodes and edges)
* - Clearing flows
* - Flow ID and name management
* - Auto-save functionality
* - Flow suggestions caching
* - Onboarding templates
* - Flow metadata caching (summary, insights)
*/
i... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/nodeSlice.collab.test.ts | ts | 14,464 | 21385681dcd24f9296c70386ec8ad5537746382cff4d39af6ca4988be686efa5 | /**
* Tests for nodeSlice collaboration broadcasts.
*
* Verifies that store actions correctly call broadcastGraphMutation
* and that the remote update flag prevents re-broadcasting.
*/
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { createWithEqualityFn } from 'zustand/traditional';
import... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/ancestrySlice.test.ts | ts | 54,463 | e12f1a3cf0637f7066257295e6dc2d88966ffd7085e9c8952da3e4bb0af65fcf | /**
* Tests for ancestrySlice β the core graph traversal and LLM context builder.
*
* Covers:
* - getAncestryChain: topological sort, multi-parent, group inheritance, caching, cycles
* - findRecursiveChildren: BFS descendant discovery
* - detectSynthesisNode: multi-parent detection
* - markChildrenAsStale: stale... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/selectionSlice.test.ts | ts | 35,162 | 6e1c30b48f9bc2be0d172550e6f08992ad5e48594f8009089d242268422bd775 | /**
* Tests for Selection slice - Node selection and organization.
*
* Tests cover:
* - Initial state
* - Setting selected nodes (single, multiple, replacing)
* - Toggling node selection (add, remove)
* - Clearing selection
* - Last click position tracking
* - Organizing selected nodes (hierarchical tree layou... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/tabsSlice.test.ts | ts | 27,634 | 19f28367201aff15dc5d357b66fc5a5548d7c04a774d631ed993d1984ae7ebb0 | /**
* Tests for tabs slice - Multi-tab flow management.
*
* Tests cover:
* - Opening tabs
* - Closing tabs
* - Switching tabs
* - Reordering tabs
* - Duplicating tabs
* - Reopening closed tabs
* - Suspending/resuming tabs
* - Tab dirty state
* - Tab name updates
* - Tab status updates
* - Active tab retri... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/groupSlice.test.ts | ts | 28,167 | 055233a3cd73bdfdfc4735d17b74bcb2590e4b66068ad0fe4abde07b20ee333a | /**
* Tests for group slice - Group node management.
*
* Tests cover:
* - generateGroupSummary - AI summary generation
* - createGroup - creating group from selected nodes
* - updateGroupSummary - refreshing group summary
* - updateGroupName - renaming groups
* - updateGroupBounds - recalculating group dimensio... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/subNodeSlice.test.ts | ts | 29,490 | b3aeca53fcdba254c6123c2daf9f38b1c1379b958e78e435f289a91f0555a349 | /**
* Tests for subNode slice - Information node sub-node management.
*
* Tests cover:
* - addImageSubNode - adding image sub-nodes
* - addTextSubNode - adding text sub-nodes
* - updateSubNode - updating sub-node properties
* - deleteSubNode - removing sub-nodes
* - deleteWebLink - removing web links and relate... |
eren23/non_linear_ai_chat | frontend/src/store/slices/__tests__/uiSlice.test.ts | ts | 28,172 | f153110f11d31377e46b288a164a144085defd4bfbfe392449cda946c803c2ae | /**
* Tests for UI slice - Highlights, modals, interaction tracking, and sidebar state.
*
* Tests cover:
* - Highlighted nodes management
* - Ancestry highlighted nodes
* - Notes modal state
* - Snap mode settings
* - Alignment guides
* - Drag over state
* - Node upload status
* - Left sidebar state (collaps... |
eren23/non_linear_ai_chat | frontend/src/store/slices/ancestry/messageFormatters.ts | ts | 12,330 | f3b2bac39f6b9b5d9898f41c56097ddb6cfd1c77350735e39e346073ae5d3be1 | /**
* Message Formatters - Utilities for formatting different node types into LLM messages.
*
* Extracted from ancestrySlice to separate concerns:
* - formatGroupMessages: Format group nodes (deep vs summary mode)
* - formatInfoNodeContent: Extract content from information nodes
* - formatFlowReferenceMessages: F... |
eren23/non_linear_ai_chat | frontend/src/store/slices/ancestry/chainProcessors.ts | ts | 14,345 | 6325f9c22d471e9758aed01d048a117ddc654f49ae0e678206f462f377dfffab | /**
* Chain Processors - Process ancestry chains into LLM message arrays.
*
* Extracted from ancestrySlice to separate chain processing logic:
* - processSynthesisChain: Multiple parents combined with labeled inputs
* - processNormalChain: Standard linear chain processing
*/
import type {
GraphNode,
NodeData... |
eren23/non_linear_ai_chat | frontend/src/store/slices/ancestry/index.ts | ts | 463 | 615b5e7f1f35ca02b40f4074de80185f562135278ea1360291c01c9d3eec6979 | /**
* Ancestry module - Message building and chain processing utilities.
*
* This module exports utilities extracted from ancestrySlice for
* building LLM context from graph ancestry chains.
*/
export {
formatGroupMessages,
formatInfoNodeContent,
formatFlowReferenceMessages,
getInlineReferencesContent,
} ... |
eren23/non_linear_ai_chat | frontend/src/store/slices/ancestry/__tests__/messageFormatters.comprehensive.test.ts | ts | 32,643 | a4faff683ed050e4750557b4067caa2480be638b35e835bf45f5095a09a07251 | /**
* Comprehensive tests for messageFormatters.ts
*
* Covers formatGroupMessages, formatInfoNodeContent, formatFlowReferenceMessages,
* and getInlineReferencesContent with full branch coverage.
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import {
formatGroupMessages,
formatInfoNodeConte... |
eren23/non_linear_ai_chat | frontend/src/store/slices/ancestry/__tests__/messageFormatters.test.ts | ts | 4,620 | 5dbd421676ccc5868e34b67f5fd18c6a5c585baeafcc06df9dd5c4602ed3f233 | import { describe, it, expect } from 'vitest';
import { formatFlowReferenceMessages } from '../messageFormatters';
import type { GraphNode } from '../../../types';
function makeFlowRefNode(cacheEntries: Array<{ type?: string; fullContent: string }>): GraphNode {
return {
id: 'ref-1',
type: 'flowReference',
... |
eren23/non_linear_ai_chat | frontend/src/store/slices/ancestry/__tests__/chainProcessors.test.ts | ts | 46,212 | 2c0afd9ae336f99234ca66dcf61558ab00fa3ccb38536cc159b6af361bb86bc4 | /**
* Tests for chainProcessors.ts
*
* Covers:
* - processSynthesisChain: Multiple parent chain processing with labeled inputs
* - processNormalChain: Standard linear chain processing
* - Edge cases: empty chains, single node, missing nodes, duplicate processing
* - Inline reference handling
* - RAG content app... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useAuthStore-crossTab.test.ts | ts | 3,975 | 5a407a643fcdd0ea5b1bc3767b97a3aafef7c559adce314108d02037411d931b | /**
* Cross-tab logout detection tests.
*
* Verifies that when one tab logs out (setting `spiderchat-logout` in localStorage),
* other tabs detect this via the `storage` event and clear their auth state.
*
* @vitest-environment happy-dom
*/
import { describe, it, expect, beforeEach, vi } from 'vitest';
import {... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useMemoryStore.test.ts | ts | 35,869 | 6a8e0d7a32a28d9f97b952ff057100ff4334a47b08332af5213f60bb99e27eea | /**
* Tests for useMemoryStore.
*
* Tests cover:
* - Initial state (empty cache, loading map, 5-min TTL, zero newMemoryCount)
* - getCacheKey β deterministic key generation from options, type defaults
* - isCacheValid β TTL check (fresh, expired, missing)
* - fetchMemories β API call, caching, loading state, pag... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useAgentStore.socket.test.ts | ts | 4,628 | 28c805dd5f21d8113ec26920e75927617d0493f74d5cfa7326a0aab2f548dd1b | /**
* Tests for lazy socket registration in useAgentStore.
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
// ============================================================================
// Mocks
// ============================================================================
const mock... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useDocumentChatStore.test.ts | ts | 8,253 | 91aa43356962b937ae66d44b3aeecb8b3027162923cd2b52dff1961c9858fc99 | /**
* Tests for useDocumentChatStore β Fixes #4 (abort on switch) and #5 (state resets).
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import useDocumentChatStore from '../useDocumentChatStore';
import type { ChatReference } from '@/lib/documentChatApi';
describe('useDocumentChatStore', () => {
... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useGraphStore.history.test.ts | ts | 19,051 | afd389b09e73369cf858d40eba7f52ad34c781e5ff06882707db5057da412147 | /**
* Tests for undo/redo (history) functionality in the graph store.
*
* These tests use REAL slice implementations to ensure proper code coverage.
* The history slice handles:
* - Saving state snapshots before mutations
* - Undo operation (restore previous state)
* - Redo operation (restore next state)
* - Hi... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useDocumentEventsStore.test.ts | ts | 2,804 | eabf36210b122604190f89c371e0f2ad5a00befe723346623ce60900aadb0968 | /**
* Tests for useDocumentEventsStore β the typed bridge between Socket.io and
* the LibraryPanel. Each apply* setter publishes a snapshot with a fresh seq;
* subscribers can detect repeated events for the same document by seq, even
* though the documentId field hasn't changed.
*/
import { describe, it, expect, ... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useBackgroundTaskStore.test.ts | ts | 15,777 | c17c190e9c99ba4635982246cc04c7d27e60c260e8c35b00bc06c3e317d5daae | /**
* Tests for useBackgroundTaskStore.
*
* Background Task Store tracks in-flight media generation tasks.
* Tests cover:
* - registerTask: adds task with running status, returns ID
* - completeTask: marks as completed, sets completedAt, auto-cleans after 30s
* - failTask: marks as failed, sets completedAt, auto... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useGraphStore.staleDetection.test.ts | ts | 12,691 | eafc2ba0fa9ced1d96c35d72f6f2aeb139b6e1f2d2140fb62394bd4163f223c6 | /**
* Tests for stale detection and time travel functionality.
*
* These tests use REAL slice implementations to ensure proper code coverage.
* The stale marking system is critical for the time travel feature:
* - When a parent node is edited, all descendants become "stale"
* - Stale nodes show an orange border i... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useNotificationStore.test.ts | ts | 19,466 | b41a25a7b67b4b2fdbd76ebf615d1477ee7497ad3a469db2628e3ce62ceec69f | /**
* Tests for useNotificationStore.
*
* Tests cover:
* - Initial state (empty notifications, zero unread, panel closed)
* - addNotification β auto ID, timestamp, unread, prepend order, max 50 cap
* - markAsRead β single notification, already-read no-op, unreadCount floor at 0
* - markAllAsRead β marks all, res... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/testStoreHelper.ts | ts | 12,255 | 0e1562ddd3c065a70fd905ba8a2fdecee4cb42bc39360faba76d94c4001248b7 | /**
* Test helper for creating real stores from real slices.
*
* This helper composes a real Zustand store using the actual slice implementations,
* ensuring test coverage is reported for the slice code. External dependencies
* (API calls, localStorage, etc.) are mocked.
*/
import { createWithEqualityFn } from '... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useFileProgressStore.test.ts | ts | 17,505 | dd0623fd266e6705f83a9bf01fafb3cd5fd5c79bcb55e6b5c1bfbdb55c37d50a | /**
* Tests for useFileProgressStore.
*
* Tests cover:
* - Initial state (empty progress map)
* - updateProgress β creates new entry, preserves startedAt on updates
* - Multiple concurrent uploads β independent tracking
* - clearProgress β removes specific task
* - clearCompleted β removes complete/failed entri... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useCaptureStore.importToInfoNode.test.ts | ts | 11,318 | 332a7e1c934862e54d43b19d397eeac9b26412f09248b7d7430897fcc4f5b2b3 | /**
* Unit tests for useCaptureStore.importToInfoNode.
*
* Tests the import-to-info-node flow: fetching a capture, creating an info node,
* populating it with content/tags/webLinks, and adding photo sub-nodes.
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
// ----------------------------------... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useMobileViewStore.test.ts | ts | 11,627 | db6e502d6a4f5ce157e9dcb7e3d10f6156fd8594b8b50c995f68110eebfa9590 | /**
* Tests for useMobileViewStore.
*
* Tests cover:
* - Initial state (canvas mode, auto preference)
* - setViewportWidth β auto-switches viewMode based on breakpoint when preference is 'auto'
* - setViewportWidth β respects manual preference override
* - setViewMode β sets mode directly
* - setViewModePrefere... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useGraphStore.selection.test.ts | ts | 17,757 | f7076c1aae3c7b97efc02a415c66d2f4d2f77b9c01898d35e9f47c7a11c34fe2 | /**
* Tests for selection management in the graph store.
*
* These tests use REAL slice implementations to ensure proper code coverage.
* The selection slice handles:
* - Multi-node selection (set, toggle, clear)
* - Click position tracking (for context menus, node placement)
* - Automatic hierarchical node orga... |
eren23/non_linear_ai_chat | frontend/src/store/__tests__/useGraphStore.edges.test.ts | ts | 58,465 | f44541eded16678c6bd9a75901b92d634243ebec0cd407f97196586a4e65909c | /**
* Tests for edge operations in the graph store.
*
* These tests use REAL slice implementations to ensure proper code coverage.
* The edge slice handles:
* - Responding to node changes (ReactFlow integration)
* - Responding to edge changes (ReactFlow integration)
* - Connection validation (cycles, self-loops,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.