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/components/notes/AISelectionToolbar.tsx
tsx
13,306
0561e205471f67d3cfd8d008baddce11aaa4bc3166f2f1097b9da699ca810c66
/** * AI Selection Toolbar - Compact floating toolbar for AI text transformations. * Appears directly above selected text with inline actions and expandable submenus. */ import React, { useState, useRef, useEffect } from 'react'; import { Sparkles, FileText, Expand, Check, List, PenLine, MoreHorizonta...
eren23/non_linear_ai_chat
frontend/src/components/notes/NoteSidePanel.tsx
tsx
11,331
1c6976cf8194eb650db58a5b2da25c2b29ef5f497bcbb257975389b0a7719534
/** * NoteSidePanel - Slide-out side panel for focused note editing. * * Features: * - Header with close, pin toggle, and more menu * - NoteEditor component for editing * - Collapsible connections section showing links and backlinks * - Delete confirmation dialog */ import React, { useState, useEffect, useCall...
eren23/non_linear_ai_chat
frontend/src/components/notes/TaskSuggestionBanner.tsx
tsx
2,345
b5bb14768175f608f2cb2bcada2f18c8ed52041bb658265153520743eee09b7c
/** * Task Suggestion Banner - Shows notification when actionable task is detected. */ import { X, Calendar, Zap } from 'lucide-react'; import { useTranslation } from '@/i18n/useTranslation'; import styles from './TaskSuggestionBanner.module.css'; import type { Memory } from '../../lib/memoriesApi'; interface TaskS...
eren23/non_linear_ai_chat
frontend/src/components/notes/MemoryConnections.tsx
tsx
11,050
77813700f7cabf9929b6660e5bdb160dadddf9731b7b13cbbc57652135414c56
/** * Memory Connections - Visualize relationships between memories. */ import { useState, useEffect } from 'react'; import { Network, Sparkles, Search } from 'lucide-react'; import { useTranslation } from '@/i18n/useTranslation'; import styles from './MemoryConnections.module.css'; import { searchMemoriesSemantic, ...
eren23/non_linear_ai_chat
frontend/src/components/notes/ContentTypeFilter.tsx
tsx
1,951
49a2646bb4b377e54cb7957d26c83bf75ede49657793f87fcd55c5608d994529
/** * ContentTypeFilter — Pill-shaped checkbox filters for Notes, Captures, Documents. */ import { FileText, Globe, BookOpen } from 'lucide-react'; import type { KnowledgeContentType, KnowledgeCounts } from '../../lib/knowledgeGraphApi'; import { useTranslation } from '@/i18n/useTranslation'; import styles from './C...
eren23/non_linear_ai_chat
frontend/src/components/notes/MemoryTimeline.tsx
tsx
42,261
cab66da5414145df8419c395695c67bb076a1b4c34cf4f35cc294d825637c497
/** * Memory Timeline - Displays memories chronologically. */ import { useState, useEffect, useRef, useCallback, useMemo } from 'react'; import { Clock, Trash2, Star, MessageSquare, FileText, Lightbulb, Edit2, Save, X, Tag, Users, ListTodo, Building2, Copy, ChevronDown, ChevronUp, Calendar as CalendarIcon, Zap, Load...
eren23/non_linear_ai_chat
frontend/src/components/notes/NoteEditor.tsx
tsx
21,148
6cd8d77fbc0647c39562975fb7ecab1e510bb9cef1af9ef33beefcdaa9250052
/** * NoteEditor - Main note editor component with autocomplete support. * * Features: * - Title input and content textarea * - Autocomplete for [[note links]], @mentions, and #tags * - Keyboard shortcuts (Cmd/Ctrl+Enter to save) * - Edit existing notes or create new ones * - View mode with clickable [[links]],...
eren23/non_linear_ai_chat
frontend/src/components/notes/UnifiedSearch.tsx
tsx
19,550
5e40c000d5ad064bd4fd4c1a6073da755d79b7c703922d9afd2aba7d2b614b34
/** * UnifiedSearch - Global search across all data sources (memories, notes, flows, documents, captures) * with optional NL "Ask" mode for pattern analysis. */ import React, { useState, useCallback, useEffect, useRef, useMemo } from 'react'; import { Search, X, Sparkles, ChevronDown, Filter, Calendar, ...
eren23/non_linear_ai_chat
frontend/src/components/notes/OcrModeDialog.tsx
tsx
3,520
d45128cd21b396deaf4d05d7b9c2cef2b9dbc71604515aea1e7129c88814d14c
/** * OCR Mode Selection Dialog * Shows when user drops/pastes an image to let them choose OCR method */ import { useCallback, useEffect, useRef } from 'react'; import { createPortal } from 'react-dom'; import { useTranslation } from '@/i18n/useTranslation'; import styles from './OcrModeDialog.module.css'; export ...
eren23/non_linear_ai_chat
frontend/src/components/notes/NoteGraphExplorer.tsx
tsx
10,379
15cf341e6589815b22f7faaaa8940c32bf32546650f6ac5ad844d50a12d4fa74
/** * NoteGraphExplorer - Visualize note connections (backlinks and outgoing links). * * This is an MVP implementation showing connections in a list-based view. * A full force-directed graph visualization can be added later. */ import { useState, useEffect, useCallback } from 'react'; import { ArrowRight, ArrowLe...
eren23/non_linear_ai_chat
frontend/src/components/notes/NoteForceGraph.tsx
tsx
75,010
ac59f161ad8f43fd9fd82e50080572cd85d8d54ed6f7f9eedddb481b6b82c61a
/** * NoteForceGraph - Obsidian-style force-directed graph visualization for notes. * Shows notes as nodes and their connections as edges. */ import { useState, useEffect, useLayoutEffect, useRef, useMemo, useCallback } from 'react'; import { RefreshCw, ZoomIn, ZoomOut, Maximize2, Minimize2, RotateCcw, X, FileText,...
eren23/non_linear_ai_chat
frontend/src/components/notes/UserFactsDashboard.tsx
tsx
21,922
4e11400875b5c867940100f1a5139d0375c8ef1cdb96d215dd864360464c795c
/** * User Facts Dashboard - Displays and manages user facts. */ import { useState, useEffect } from 'react'; import { Brain, Shield, Timer, Sparkles, Edit2, Save, X, Trash2, Plus, RefreshCw, TrendingUp, User, Target, Lightbulb, Heart, Calendar, Loader2 } from 'lucide-react'; import styles from './UserFactsDashboard...
eren23/non_linear_ai_chat
frontend/src/components/notes/ChainToNoteModal.tsx
tsx
9,542
c4d42baa4f11e77dfe5dcd5481fe8df34ce1dcc33a7f93dc0825bc8da7949d18
/** * ChainToNoteModal - Allows users to select ancestor nodes from the ancestry chain * and promote them to a note with aggregated content. */ import React, { useState, useEffect, useCallback } from 'react'; import { X, Check, Sparkles } from 'lucide-react'; import useGraphStore from '@/store/useGraphStore'; impor...
eren23/non_linear_ai_chat
frontend/src/components/notes/NoteContentRenderer.tsx
tsx
4,733
2b0855952567159e0ea1cf3ac13e51aa29d0e8e1116f0dd57b4c56aebb4abd1d
/** * NoteContentRenderer - Renders note content with clickable [[links]], @mentions, and #tags. */ import React, { useCallback, useMemo } from 'react'; import { useNotesStore } from '../../store/useNotesStore'; import styles from './NoteContentRenderer.module.css'; interface NoteContentRendererProps { content: s...
eren23/non_linear_ai_chat
frontend/src/components/notes/noteGraphFilters.ts
ts
6,337
a75bc9264de85227bec47cd0941ea06a526f89de1d7ac7061e1ff94d1a8275ad
/** * Pure helpers for NoteForceGraph filter logic. * Extracted so they can be unit-tested without mounting the D3 component. */ import type { NoteGraphNode, NoteGraphEdge } from '../../lib/notesApi'; export type NodeCategory = 'pinned' | 'hubLinks' | 'linked' | 'orphan'; export type ContentState = 'hasContent' | ...
eren23/non_linear_ai_chat
frontend/src/components/notes/TagSuggestions.tsx
tsx
3,488
a84a60b7a8a9a16a151a4a3129257bc455b4323e9639232e59e43f8ac1128876
/** * TagSuggestions - Display AI-suggested tags and mentions as clickable chips. * Shows below the note editor when suggestions are available. */ import React from 'react'; import { Hash, AtSign, X, RefreshCw, Sparkles, Loader2 } from 'lucide-react'; import { useTranslation } from '@/i18n/useTranslation'; import s...
eren23/non_linear_ai_chat
frontend/src/components/notes/HighlightedText.tsx
tsx
2,160
e9e41f83a3257d6528c34c3a908b90bec2508762345d3fcb6290f0fe1bd8e43b
/** * HighlightedText - Renders text with specific character indexes highlighted. * Uses ONLY React JSX text interpolation for safe auto-escaping. */ import React from 'react'; import styles from './AutocompletePopup.module.css'; interface HighlightedTextProps { text: string; matchIndexes?: number[]; } /** *...
eren23/non_linear_ai_chat
frontend/src/components/notes/SummaryView.tsx
tsx
6,210
088a6d107fa074e4a32788b37aeea57d940a05ac08750c49913447eff110ecff
/** * Summary View - Display daily/weekly summaries. */ import { useState, useEffect } from 'react'; import { Calendar, Sparkles, RefreshCw } from 'lucide-react'; import styles from './SummaryView.module.css'; import { getSummaries, generateSummary, type MemorySummary } from '../../lib/memoriesApi'; import { showErr...
eren23/non_linear_ai_chat
frontend/src/components/notes/LinkSuggestorBanner.tsx
tsx
2,198
9539e9ddecb9b3af3587fc5446ec7daaf52bbd9fd95a023eb56d48388d0d1d30
/** * LinkSuggestorBanner - Subtle banner showing suggested note links. * Displays matched keywords with suggested note titles and actions. */ import { Link2, X, ArrowRight } from 'lucide-react'; import { LinkSuggestion } from '../../hooks/useLinkSuggestor'; import { useTranslation } from '@/i18n/useTranslation'; i...
eren23/non_linear_ai_chat
frontend/src/components/notes/KnowledgeListTab.tsx
tsx
18,015
ee694cc63b3d8f7716c7e95511c9a5be9dfd3bf70831daa69e484e8206858082
/** * KnowledgeListTab — Unified list view for Notes, Captures, and Documents. * Replaces the old NotesListTab in NotesModal. */ import { useState, useCallback, useMemo, useEffect } from 'react'; import { Plus, Search, FileText, Globe, BookOpen, Pin, Loader2, ExternalLink, File, Image as ImageIc...
eren23/non_linear_ai_chat
frontend/src/components/notes/SelectionContextMenu.tsx
tsx
5,630
3480b5a91362f0356bab3053d78587117c8eccc42c6abf3ec3d9110546cd8fd4
/** * Selection Context Menu - A right-click context menu for saving selected text as notes. * * This component listens globally for right-click events when text is selected, * showing a floating menu that allows users to save the selection as a note. */ import React, { useState, useEffect, useCallback, useRef } ...
eren23/non_linear_ai_chat
frontend/src/components/notes/CreateEventModal.tsx
tsx
9,337
81d2d7ae1d2848b172c86eb214cb3c5bea3f84b67a7908d6082209c619219bc2
/** * Create/Edit Calendar Event Modal. */ import { useState, useEffect } from 'react'; import { X, Calendar, Clock, MapPin, Bell } from 'lucide-react'; import styles from './CreateEventModal.module.css'; import { createCalendarEvent, listCalendars, type CalendarInfo, type CalendarEventDetails, } from '../.....
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/UserFactsDashboard.test.tsx
tsx
42,143
85bffd7654870d3536960dd8f337dcebd47c1bf48e43ea95956eea14fa1ad045
// @vitest-environment happy-dom /** * Tests for UserFactsDashboard component. * * Tests focus on: * - Loading state * - Empty state (no facts) * - Rendering facts with correct content, badges, and stats * - Category filtering * - Persistence filtering * - Sorting (createdAt, confidence, category) * - Editing...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/ChainToNoteModal.test.tsx
tsx
5,177
a1b9dd7aad68ee060151b13de2e97cae479e68abbfa47087d4c92ed777b7c3e8
/** * Tests for ChainToNoteModal component. * * Tests focus on: * - Export verification * - Props interface validation * - Content aggregation logic * - Title generation from chain */ import { describe, it, expect, vi } from 'vitest'; import React from 'react'; // Mock stores vi.mock('@/store/useGraphStore', ...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/NoteEditor.test.tsx
tsx
5,701
09f9ed23a8bc8de8939b2dd393aaeb78444b6dd6a4023cf1e16a1def025faf93
/** * Tests for NoteEditor component * * NoteEditor is the main note editor with autocomplete support for * [[note links]], @mentions, and #tags. It supports view and edit modes, * OCR image paste/drop, markdown toolbar, and link suggestions. * * Tests focus on: * - Component interface shape validation (via Rea...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/NoteContentRenderer.test.tsx
tsx
8,501
ab30837dc20c09945c9f7be1df3c1c9d593b799ca9417346ba41e94b87789f28
// @vitest-environment happy-dom /** * Tests for NoteContentRenderer component. * * NoteContentRenderer parses note content and renders clickable * [[note links]], @mentions, and #tags. Plain text is preserved * with whitespace and newlines. * * Key behaviors tested: * - Renders plain text content * - Handles ...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/MemoryConnections.test.tsx
tsx
36,079
aeb7edef40742c371b335cbdbcd163fdae4f66b7faa3f0a0e1e006d335b0d0be
// @vitest-environment happy-dom /** * Tests for MemoryConnections component. * * Tests focus on: * - Loading state while memories are being fetched * - Empty state (no high-importance memories) * - Memory list rendering with content, importance, date, topics * - Selecting a memory to find related connections *...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/noteChatItems.test.ts
ts
12,118
b536aec81a2d3da6dd58b8a2eab67b99d12483b69f5af87c2a0c9f59ba2532fb
/** * Tests for pure helpers that drive NoteForceGraph's Quick Chat flow. */ import { describe, it, expect, vi } from 'vitest'; import { buildNoteChatItem, buildNoteAdjacencyMap, computeConnectedNoteIds, formatSelectedNotesForCopy, assembleSelectedNotesCopyText, NOTES_CONTEXT_BATCH_SIZE, type NoteForCh...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/AutocompletePopup.test.tsx
tsx
3,241
7548c7923ed34850228d371dee13c0a65678ae9a27793445a186784b037f7e7f
// @vitest-environment happy-dom import { describe, it, expect, vi } from 'vitest'; import React from 'react'; import { render, screen } from '@testing-library/react'; // Mock CSS module vi.mock('../AutocompletePopup.module.css', () => ({ default: new Proxy({}, { get: (_target, name) => String(name) }), })); import...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/KnowledgeListTab.test.tsx
tsx
13,034
35f3af58679954866b6e512d85f520544cc88e3f408a150d7fa08ec66f5f27e2
// @vitest-environment happy-dom /** * Tests for KnowledgeListTab component. */ import { describe, it, expect, vi, beforeEach } from 'vitest'; import React from 'react'; import { render, screen, fireEvent } from '@testing-library/react'; // Mock CSS modules vi.mock('../KnowledgeListTab.module.css', () => ({ defau...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/MemoryTimeline.test.tsx
tsx
17,608
eb79a105c5be51412313eb68ede68e8dd167a6ec73b32f44d43b4f77fda493f3
// @vitest-environment happy-dom /** * Tests for MemoryTimeline component. * * Tests focus on: * - Loading state * - Empty state (no memories) * - Filter-empty state (memories exist but none match filters) * - Memory card rendering with content, importance, category, entities * - Basic rendering with various pr...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/HighlightedText.test.tsx
tsx
3,536
dc5a41e1bce85fcbdd36759ecc269c2c2d95d89849114fb3dfcbaf604aaa23c1
// @vitest-environment happy-dom import { describe, it, expect, vi } from 'vitest'; import React from 'react'; import { render, screen } from '@testing-library/react'; // Mock CSS module vi.mock('../AutocompletePopup.module.css', () => ({ default: new Proxy({}, { get: (_target, name) => String(name) }), })); import...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/NotesModal.test.tsx
tsx
12,258
2f9a5858b3613c1b48452ae904f58989489fad3d8068aa5d755d379cef6d2266
/** * Tests for NotesModal component * * NotesModal is the main container for the memory/notes interface. * It includes tabbed navigation (notes, timeline, reminders, search, graph), * a collapsible note/memory creation input, and helper functions: * - generateTitle: creates a title from content * - parseReminde...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/MarkdownToolbar.test.tsx
tsx
3,588
6fd8ad0fc66d2c6083351cfc4c40cfdfcc7d567d855d08eb2e5a61897995db02
// @vitest-environment happy-dom import { describe, it, expect, vi } from 'vitest'; import React from 'react'; import { render, screen, fireEvent } from '@testing-library/react'; // Mock CSS module vi.mock('../MarkdownToolbar.module.css', () => ({ default: new Proxy({}, { get: (_target, name) => String(name) }), }))...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/SummaryViewFeedback.test.tsx
tsx
5,111
d898331328b7b24307538cc4c1c46c865ea20902b5b20666e579643a62eb4864
// @vitest-environment happy-dom /** * Tests for feedback integration in SummaryView. * * Verifies that ChatNodeFeedback is rendered for each summary card * with correct props: nodeId=summary._id, flowId="__summary__", * contentType="summary", contentDescription from summary content. */ import { describe, it, ex...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/noteGraphFilters.test.ts
ts
17,717
e62cc3f3b0001662c14663f47f040904c76b8d70da2472a2504208839da744ad
import { describe, it, expect } from 'vitest'; import type { NoteGraphNode, NoteGraphEdge } from '../../../lib/notesApi'; import { ALL_CATEGORIES, ALL_CONTENT_STATES, applyNoteFilters, getNodeCategory, isDefaultFilters, makeDefaultFilters, passesNoteFilters, summarizeFilters, toggleInArray, type Not...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/QuickCaptureModal.test.tsx
tsx
9,703
46f4dd2c3a1645c5afd73d8fd951a86e714fd95c037f1d53b6b70cb76c004504
/** * Tests for QuickCaptureModal component * * QuickCaptureModal is a lightweight modal for rapid note-taking with * autocomplete support for [[links]], @mentions, and #tags. * Includes helper functions: * - generateTitle: creates a title from content or timestamp * - extractTagsFromContent: extracts #tags from...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/LinkSuggestorBanner.test.tsx
tsx
2,968
60d73cad913a2cd04af31e4eeea6c78fb3dc7451f213a0f54606bcdc5ff38537
// @vitest-environment happy-dom import { describe, it, expect, vi } from 'vitest'; import React from 'react'; import { render, screen, fireEvent } from '@testing-library/react'; // Mock CSS module vi.mock('../LinkSuggestorBanner.module.css', () => ({ default: new Proxy({}, { get: (_target, name) => String(name) }),...
eren23/non_linear_ai_chat
frontend/src/components/notes/__tests__/UnifiedSearch.test.tsx
tsx
5,489
0a73562a612c5663ec1abee2edd529c63dc87c6fd374fe5048677caeb4b8f86f
/** * Tests for UnifiedSearch component * * UnifiedSearch provides global search across all data sources * (memories, notes, flows, documents, captures) with optional * natural language "Ask" mode for pattern analysis. * * Tests focus on: * - Props interface validation (via stub) * - SOURCE_TABS constant valid...
eren23/non_linear_ai_chat
frontend/src/components/__tests__/ErrorBoundary.test.tsx
tsx
6,071
4e8d8bcdc3b781176f65a6c11394db1399546660bffe2b74fdc7be29bb2160a1
/** * Tests for ErrorBoundary component * * ErrorBoundary catches JavaScript errors in its children, * reports them to Sentry, and displays a fallback UI. * * Note: Due to jsdom ESM compatibility issues, tests focus on: * - Export verification * - Props interface validation * - Component structure (class compo...
eren23/non_linear_ai_chat
frontend/src/components/properties/MediaNodeProperties.tsx
tsx
20,435
3017d8333aa26c916d07b387cf5a7ed9916616a3bafc7740d5947ed71c75c4f9
/** * MediaNodeProperties - Expanded properties panel for media generation nodes. * * All controls moved from MediaGenerationNode: * - Model selector dropdown * - Template selector with enable/disable toggle * - Template override modal trigger * - Mode toggle (Image/Video) * - Duration selector (video mode) * ...
eren23/non_linear_ai_chat
frontend/src/components/properties/PropertiesPanel.tsx
tsx
10,193
acc9e3e46c6b92ac140b95d105bf6922d1b40f8cf5c09363c2d163189dcd9fa0
/** * PropertiesPanel - Context-sensitive properties router. * * Shows different property panels based on current selection: * - FlowProperties when nothing is selected * - NodeProperties when a single chat node is selected * - GroupProperties when a group is selected * - InfoNodeProperties when an information n...
eren23/non_linear_ai_chat
frontend/src/components/properties/FlowReferenceProperties.tsx
tsx
10,460
c7dd73a42b481cfb39facc6778b19f997e8ed5086a7d29ce73453bcaeca21dbc
/** * FlowReferenceProperties - Properties panel for flow reference nodes. * * Shows when a flowReference node is selected: * - Reference info (flow name, ID, last synced) * - AI-generated summary with refresh * - Context selection (selected nodes and token count) * - Actions (open in tab, remove reference) */ ...
eren23/non_linear_ai_chat
frontend/src/components/properties/GroupProperties.tsx
tsx
6,426
c1b5387268b97f025f9f8a2b46c3b6618f7e8ac072faad437b23525507cefe03
/** * GroupProperties - Group node properties panel. * * Contains: * - Group name editing * - Summary display with regenerate * - Member node list * - Add/remove nodes * - Branch creation button * - Ungroup button * - Color picker */ import React from 'react'; import { useTranslation } from '@/i18n/useTrans...
eren23/non_linear_ai_chat
frontend/src/components/properties/InfoNodeProperties.tsx
tsx
42,565
b3ec26555821234c5d0c62110f7c2b7b86b27521707d768cd649f8c603f39cc2
/** * InfoNodeProperties - Expanded information node properties panel. * * Contains ALL controls moved from InformationNode: * - Name editing * - Grid size slider * - Add image/text/weblink buttons with inline inputs * - Reference selector * - Color picker * - Promote to Note button * - Delete button */ imp...
eren23/non_linear_ai_chat
frontend/src/components/properties/FlowGraphInsights.tsx
tsx
9,043
a34484f55980b2e82c12bd4a3527b75508478e3a9f78d09f92ffbab1f0946d24
/** * FlowGraphInsights - Displays knowledge graph insights for a flow. * * Shows: * - Topics discussed with weight bars * - People mentioned as tags * - Related flows with shared topics * * Uses store-level caching to prevent re-fetching insights when component remounts. */ import React, { useState, useEffec...
eren23/non_linear_ai_chat
frontend/src/components/properties/index.ts
ts
812
1e07eac66dc60ddeb1bf82cc853aa14c4f6ef388189202c8c5bcbe03da6521e6
/** * Properties panel components for the new ElevenLabs-style layout. * * These panels show context-sensitive controls in the right sidebar * based on the current selection: * - Nothing selected: FlowProperties (flow stats and settings) * - Chat node: NodeProperties (prompt, model, tools, etc.) * - Group node: ...
eren23/non_linear_ai_chat
frontend/src/components/properties/NodeProperties.tsx
tsx
15,731
1fc7ef62fe8d5b5efa8564ed52f003e3f63d3837f1a98375627dfcb2bdc06f0e
/** * NodeProperties - Chat node properties panel. * * Contains node settings and metadata controls: * - Name, Tools, Features (Deep Mode/RAG) * - Documents & Captures, Color Picker * - Actions (Save chain as note, Delete) * * Input/Send/Regenerate have moved to FloatingInputBar. */ import React, { useState, ...
eren23/non_linear_ai_chat
frontend/src/components/properties/FlowProperties.tsx
tsx
9,187
27a90a0b9a0c331d54c1c051bbe03c1adca08c115aa9ba3d56c4305a4a10551c
/** * FlowProperties - Shows flow-level information when nothing is selected. * * Displays: * - Flow name (editable if saved) * - AI-generated summary * - Node count by type * - Edge count * - Auto-save toggle * * Uses store-level caching to prevent re-fetching summary when component remounts. */ import Rea...
eren23/non_linear_ai_chat
frontend/src/components/properties/__tests__/InfoNodeProperties.test.tsx
tsx
13,388
e65e3baae133be84c3891d2c168ab25fc448bb9ecc9a2bdea7873f56e1aed5ae
/** * Tests for InfoNodeProperties component * * InfoNodeProperties is the expanded properties panel for information nodes. * It includes controls for name editing, grid size, adding images/text/weblinks, * reference selection, color picking, promote to note, and delete. * * Contains the utility function getToke...
eren23/non_linear_ai_chat
frontend/src/components/properties/__tests__/PropertiesPanel.test.tsx
tsx
11,968
3dac9e2c7b81c02e5caeca0dff2ac0305bd50af27af400bee704b1372cf4e248
// @vitest-environment happy-dom /** * Tests for PropertiesPanel component. * * PropertiesPanel is a context-sensitive router that shows different * property panels based on the current node selection: * - No selection: FlowProperties * - Single chat node: NodeProperties * - Single group node: GroupProperties *...
eren23/non_linear_ai_chat
frontend/src/components/properties/__tests__/MediaNodeProperties.test.tsx
tsx
6,294
6b5898e0ac20d6eaddeccbd1a501ded8511196e90e6f5ae3d1b7f459754b3dc1
/** * Tests for MediaNodeProperties component * * MediaNodeProperties is the expanded properties panel for media generation nodes. * It includes model selector, template selector with toggle, mode switch (image/video), * duration selector, color picker, regenerate, and delete. * * Tests focus on: * - Props inte...
eren23/non_linear_ai_chat
frontend/src/components/knowledge/ReviewPanel.tsx
tsx
11,406
dfc235bc23658a949c870aef3773e01fd31ffaf1d87eb35674ca4032a25a8a16
/** * ReviewPanel - Knowledge retention review UI. * * Shows cards due for review with spaced repetition scheduling. * Users mark cards as "remembered" or "forgot" to adjust intervals. */ import React, { useCallback, useEffect, useState } from 'react'; import { Brain, CheckCircle, RotateCcw, Archive, Lo...
eren23/non_linear_ai_chat
frontend/src/components/knowledge/__tests__/ReviewPanel.test.tsx
tsx
2,897
7bfc2ab9f3390ba2874cfc7cead86fc33dd5d6b69f939d3f2adb5d6de73d088d
/** * @vitest-environment happy-dom */ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { render, screen, waitFor } from '@testing-library/react'; import ReviewPanel from '../ReviewPanel'; const mockApiFetch = vi.fn(); vi.mock('@/lib/csrfApi', () => ({ apiFetch: (...args: unknown[]) => mockA...
eren23/non_linear_ai_chat
frontend/src/components/mobile/MobileLinearView.tsx
tsx
39,884
f6a731ed75725d8aa949e8bff2ada158bf3fa103fae67af1112d9abdf5bbfa66
/** * MobileLinearView - A linear, scrollable view of the conversation graph. * * Designed for mobile devices where ReactFlow's canvas would be unwieldy. * Shows nodes in ancestry order from root to current, with branch indicators. */ import React, { useCallback, useMemo, useRef, useEffect, useState } from 'react...
eren23/non_linear_ai_chat
frontend/src/components/mobile/__tests__/MobileLinearView.test.tsx
tsx
14,573
88506a90dd7caf7dd325db035c942f7ccf042cc0cbf443b9ce18bfb35343504a
/** * Tests for MobileLinearView component * * MobileLinearView is a linear, scrollable view of the conversation graph * designed for mobile devices. It includes several sub-components: * - MobileNodeCard: chat node card with collapse, send, branch indicators * - MobileInfoCard: information node card * - MobileM...
eren23/non_linear_ai_chat
frontend/src/components/tour/TourProvider.tsx
tsx
4,104
e6ace0895dfe001b88474708065e082c4df489a41aefdcba05eee3fdf49b4899
/** * TourProvider - Joyride wrapper with custom styling * * Wraps react-joyride with glassmorphism styling to match the app's * dark theme aesthetic. Handles tour callbacks and state management. */ import React, { useCallback } from 'react'; import Joyride, { CallBackProps, STATUS, ACTIONS, EVENTS } from 'react-...
eren23/non_linear_ai_chat
frontend/src/components/templates/TemplatePreviewModal.tsx
tsx
17,094
10b45b599b9d90baa119e42c0aa01d770834ae145c5e78e60541d7451980df4f
/** * Modal for previewing template details before importing. * Shows template info and a tree view of the node structure. */ import React, { useState, useMemo } from 'react'; import { X, Star, GitBranch, Users, Download, Loader2, ChevronRight, ChevronDown, MessageSquare, Image, FileText, Sparkles } from 'lucide-re...
eren23/non_linear_ai_chat
frontend/src/components/templates/TemplateGallery.tsx
tsx
8,220
c1feb1510a4a4185041e4ad88c036c67a41b9dd916356a070ac0d7a9b25b3b4f
/** * TemplateGallery - Modal for browsing and importing workflow templates. * * Styled as a hovering panel matching the app's glassmorphism theme. */ import React, { useEffect, useState, useCallback, useRef } from 'react'; import { X, Search, Loader2, LayoutTemplate } from 'lucide-react'; import { useTranslation ...
eren23/non_linear_ai_chat
frontend/src/components/templates/TemplateMinimap.tsx
tsx
7,663
98300809ca282401b78b523275596af13bf3e0c8c1fb658b14d37cd15c7f43b9
/** * TemplateMinimap - Visual preview of template flow structure * * Renders a small, non-interactive ReactFlow visualization showing * how nodes connect in the template. Uses simplified node styling. */ import React, { useMemo, useCallback } from 'react'; import { ReactFlow, Background, ReactFlowProvider } from...
eren23/non_linear_ai_chat
frontend/src/components/templates/index.ts
ts
196
e3bea05f40b53120a12e6fda4132f24570982d2bf4a49b9a5a9789b9e5c1afb7
export { default as TemplateGallery } from './TemplateGallery'; export { default as TemplateCard } from './TemplateCard'; export { default as TemplatePreviewModal } from './TemplatePreviewModal';
eren23/non_linear_ai_chat
frontend/src/components/templates/TemplateCard.tsx
tsx
4,122
0340ab33685dbdcd28916455bd725d72b9d8ef39586cb908f80cabb35f7a5063
/** * Template card component for displaying a single template in the gallery. */ import React from 'react'; import { Star, Users, GitBranch } from 'lucide-react'; import type { TemplateListItem } from '@/types/templates'; interface TemplateCardProps { template: TemplateListItem; onSelect: (template: TemplateLi...
eren23/non_linear_ai_chat
frontend/src/components/templates/__tests__/TemplateCard.test.tsx
tsx
8,191
7ae48e6d0a8bd0aaf7ccc006e45cb8885e8baafa8ae20478c5936c677240c362
/** * Tests for TemplateCard component * * TemplateCard displays a single template in the gallery. * It shows title, description, tags, and usage stats. * * Note: Due to jsdom ESM compatibility issues, tests focus on: * - Export verification * - Props interface validation * - Component structure */ import { ...
eren23/non_linear_ai_chat
frontend/src/components/documents/ChunkManagementPanel.tsx
tsx
23,496
1c96d532abe0c4ca84c1af46f1a3e0fd4fe11cd0b74a67deb3f718eecc4431e1
/** * ChunkManagementPanel — Modal for reviewing and selecting chunks from a library document. * * Shows chunks from a document with snippet previews, per-chunk toggles, suggested import selection, * and query-driven bulk actions. */ import React, { useEffect, useState, useCallback, useMemo, useRef } from 'react'...
eren23/non_linear_ai_chat
frontend/src/components/documents/DocumentPickerPanel.tsx
tsx
8,742
3d754ef80785b3d16ba1dc6abb5c0ad034306e077e93d6da5fd02163486fb411
/** * DocumentPickerPanel — Modal for selecting a library document to import into an info node. * * Shows a searchable, paginated list of library documents that are ready (processingStatus === 'ready'). * Single-select: clicking a document calls onSelect(documentId, documentName). */ import React, { useEffect, us...
eren23/non_linear_ai_chat
frontend/src/components/documents/__tests__/ChunkManagementPanel.test.tsx
tsx
10,016
e4046f5301db6d532362e4be50a8652088ca1ab0d7f0a8eff6a9333ad4157a26
// @vitest-environment happy-dom import React from 'react'; import { describe, it, expect, vi, beforeEach } from 'vitest'; import { render, screen, fireEvent, waitFor } from '@testing-library/react'; import { ChunkManagementPanel } from '../ChunkManagementPanel'; import type { LibraryDocumentChunksResponse } from '@/l...
eren23/non_linear_ai_chat
frontend/src/components/sketch/SketchGridItem.tsx
tsx
5,146
e3e7d23dadeeb8ab4d17740e2b1b33c54a456affa12565a74458f793eadf9f3b
/** * SketchGridItem - Thumbnail display for a sketch sub-node in the InfoNode grid. */ import React, { memo, useCallback } from 'react'; import { Pen, Edit2, Trash2, Eye, EyeOff, Loader2 } from 'lucide-react'; import { useTranslation } from '@/i18n/useTranslation'; import type { SketchSubNodeData } from '@/types/gr...
eren23/non_linear_ai_chat
frontend/src/components/sketch/useSketchSave.ts
ts
3,656
4cbbff071c4c19bf8091f05973382690ff98a03588f1295181809780ba7f1b52
/** * useSketchSave - Orchestrates sketch save pipeline: * 1. Export Excalidraw scene to PNG blob * 2. Upload PNG to R2 * 3. If scene JSON > threshold, upload to R2 * 4. Update sub-node in store * 5. Background OCR via existing extract-image endpoint * 6. Auto-save flow */ import { useCallback, useState } from...
eren23/non_linear_ai_chat
frontend/src/components/sketch/SketchEditorModal.tsx
tsx
9,806
9bda07ade9d1d836ee6107c441831174a58e01437fd40a1f862feb6ba4475b4a
/** * SketchEditorModal - Fullscreen modal wrapping Excalidraw for drawing. * * Lazy-loads Excalidraw to avoid bundle bloat. * On save: exports scene JSON + PNG blob, delegates to useSketchSave hook. */ import React, { useState, useCallback, useRef, Suspense, useEffect } from 'react'; import { createPortal } from...
eren23/non_linear_ai_chat
frontend/src/components/notifications/NotificationPanel.tsx
tsx
7,665
082261c7cb98f38b5d86230070f876904c2a195132cd1d6c10d9424f342cccaf
/** * NotificationPanel Component * * Dropdown panel showing recent notifications with actions. */ import { useEffect, useRef } from 'react'; import { Bell, X, Check, Clock, AlertCircle, Info, CheckCircle2 } from 'lucide-react'; import useNotificationStore, { selectNotifications, selectUnreadCount, type Noti...
eren23/non_linear_ai_chat
frontend/src/components/notifications/index.ts
ts
109
be92fb37e35f7326e4f1557887dd18906def4fc0e72236cb5b1291ddeb3b7890
/** * Notifications components barrel export. */ export { NotificationPanel } from './NotificationPanel';
eren23/non_linear_ai_chat
frontend/src/components/help/helpContent.ts
ts
24,462
cc0e96b6255c25f8f1ef7885be48648b4964788008ecf3bb92aaa03028902061
/** * Help Content - Comprehensive documentation for all Spider Chat features * * Organized into 9 categories covering core concepts to advanced features. * Each article includes a title, content (markdown-ish), and search keywords. */ export interface HelpArticle { id: string; title: string; content: strin...
eren23/non_linear_ai_chat
frontend/src/components/help/index.ts
ts
86
df19e74f6d0865748f951fb51f720edd7d9874536c5807a3a2a44b0740ced6ee
export { HelpModal } from './HelpModal'; export { helpContent } from './helpContent';
eren23/non_linear_ai_chat
frontend/src/components/help/HelpModal.tsx
tsx
11,432
68b2ddcf54ce7a182d3961cd680790ee7e7aedcd7d7fed7ac817d9e8a62c3f88
/** * HelpModal - Comprehensive searchable help system * * Replaces the old InformationPage with a full-featured help center * covering all Spider Chat features organized by category. * * Note: This component uses dangerouslySetInnerHTML for rendering markdown-like * formatting in help content. This is SAFE beca...
eren23/non_linear_ai_chat
frontend/src/components/help/__tests__/HelpModal.test.tsx
tsx
14,408
6f8841023dc77505ebe4618509129e46a818f81e7e09bff4249cae5986234bf3
/** * Tests for HelpModal component * * HelpModal is a comprehensive searchable help system that replaces * the old InformationPage. It provides categorized help articles, * search functionality, and inline markdown rendering. * * Tests cover: * - Export verification (default and named exports) * - Props inter...
eren23/non_linear_ai_chat
frontend/src/components/help/__tests__/helpContent.test.ts
ts
14,656
2a45820f6526c61dc890d134bcb506582bac409d4e380219af426643e71ce1c8
/** * Tests for helpContent data module * * helpContent.ts is a pure data module exporting help documentation * organized into categories, each containing articles with titles, * content, and search keywords. * * This is high-ROI testing since validating the structure covers * all ~814 lines of data declaration...
eren23/non_linear_ai_chat
frontend/src/components/flow/FlowInsightsPanel.tsx
tsx
15,017
44ef06d3585f0df4133fdbf26a13f803e09b7af8b9cb1ec2ebe36e43fff11fdd
/** * Flow Insights Panel - Displays flow metadata, analytics, and relationships. */ import { useState, useEffect } from 'react'; import { BarChart3, Tag, Users, ListTodo, Building2, Calendar, RefreshCw, Sparkles, TrendingUp, Layers, Clock, FileText, Loader2, X, Link2, GitBranch } from 'lucide-react'; import styles ...
eren23/non_linear_ai_chat
frontend/src/hooks/useInfoNodeAutoSize.ts
ts
4,924
d49325ecbd713e8c20965e055ec7c432a92ae5b558b174180c0b7202d485b55e
/** * useInfoNodeAutoSize — Automatically calculates and applies InformationNode height * based on content count and grid geometry (DOM-free). * * InformationNodes display subnodes (images, text, sketches, docs) in a CSS grid. * This hook computes the ideal height from item count and column layout, * mirroring th...
eren23/non_linear_ai_chat
frontend/src/hooks/useGlobalShortcuts.ts
ts
1,221
9969f2822d4c639879954265eb93b729e14c1274935bc63a906d815da9607b48
import { useEffect } from 'react'; interface GlobalShortcutsConfig { onQuickCapture?: () => void; onQuickSearch?: () => void; } export function useGlobalShortcuts(config: GlobalShortcutsConfig) { useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { // Ignore if typing in an input (except fo...
eren23/non_linear_ai_chat
frontend/src/hooks/useMarkdownToolbar.ts
ts
2,962
a09c8d25d3a4ff6dfd3e3f91964a32a084e1e24e3df6a2135996522af77fbbe6
/** * Shared markdown formatting hook extracted from RichTextEditor. * Provides insertMarkdown, insertAtCursor, and keyboard shortcut handling. */ import { useCallback } from 'react'; export interface MarkdownToolbarActions { insertMarkdown: (prefix: string, suffix?: string) => void; insertAtCursor: (text: str...
eren23/non_linear_ai_chat
frontend/src/hooks/useModal.ts
ts
5,101
88f5c60492e2ba233bfd947d7f67a027daac6361a82b192a161a9f9ad14e482a
/** * Generic modal state management hook. * Replaces 49+ instances of [showX, setShowX] = useState(false) pattern. * * @example * // Single modal * const modal = useModal(); * <button onClick={modal.open}>Open</button> * {modal.isOpen && <Modal onClose={modal.close} />} * * @example * // With initial state ...
eren23/non_linear_ai_chat
frontend/src/hooks/useAutoSave.ts
ts
11,920
314865ffb2e7f37c26cd136b9d103ffc365eca2c8a0bb0e8926bd5e36e2fb74b
import { useEffect, useRef, useCallback } from 'react'; import useGraphStore from '@/store/useGraphStore'; import { useBackgroundTaskStore } from '@/store/useBackgroundTaskStore'; import { shallow } from 'zustand/shallow'; const AUTO_SAVE_DEBOUNCE_MS = 2500; /** * Hook to manage auto-save functionality with debounci...
eren23/non_linear_ai_chat
frontend/src/hooks/usePendingInvitesCount.ts
ts
2,051
c5c4a38ecb6390609a4c16f548b405a5645af98a582ef47876237294454ca003
import { useState, useEffect, useCallback, useRef } from 'react'; import { useAuthStore } from '@/store/useAuthStore'; import { createBackoffPoller, type BackoffPoller } from '@/lib/pollingUtils'; /** * Hook to fetch and track the number of pending collaboration invites. * Uses exponential backoff on failure (30s → ...
eren23/non_linear_ai_chat
frontend/src/hooks/useGraphSelection.ts
ts
2,986
ac8b9f87bd024b0c3f8fc976c81d7d0bb28be7cae452ff335fd1a017cf35375f
/** * useGraphSelection - Shared selection logic for graph visualizations. * Encapsulates multi-select, adjacency, connected-set computation, * context menu, and rectangle selection. */ import { useState, useMemo, useCallback } from 'react'; interface GraphEdge { source: string; target: string; } interface U...
eren23/non_linear_ai_chat
frontend/src/hooks/useNodeAutoSize.ts
ts
3,645
bb2764ceaa29180d5bd86a719b11060e9f1d8850514f6d7c2084f5e82e3a511d
/** * useNodeAutoSize — Automatically calculates and applies node height * based on text content using pretext (DOM-free measurement). * * Nodes auto-size to their content unless the user has manually resized * them via NodeResizer (manuallyResized flag). */ import { useEffect, useRef } from 'react'; import useG...
eren23/non_linear_ai_chat
frontend/src/hooks/useNodeLock.ts
ts
2,471
f0635fd25d80ce4844e4d209029311d39bd99a9396524ff85cf91aff8d74225f
/** * useNodeLock - Hook for managing node lock state in collaboration. * * Provides: * - canEdit: whether the current user can edit this node * - isLockedByOther: whether another user has locked this node * - lockerName: name of the user who locked the node * - acquireLock: request a lock for editing * - relea...
eren23/non_linear_ai_chat
frontend/src/hooks/useGraphSearch.ts
ts
8,006
bd0c5ed655e736e0e2d5a3556ec5a0ec539674fc7cb18d8c877b6630d21c49e6
/** * useGraphSearch - Shared hook for fuzzy + semantic search across graph visualizations. * Supports debounced fuzzy search (fuzzysort), semantic search (backend vectors), * and keyboard navigation between matches. */ import { useState, useMemo, useCallback, useRef, useEffect } from 'react'; import fuzzysort fro...
eren23/non_linear_ai_chat
frontend/src/hooks/useLinkAutocomplete.ts
ts
11,771
c452deb69e78973291e3e10ccf5b8b541342c2a96f556545a4ade25c6d47df44
/** * Hook for detecting trigger patterns ([[, @, #) in text input * and providing autocomplete suggestions. * * Notes-only linking: [[links]] only autocomplete note titles. * This maintains Obsidian compatibility for import/export. */ import { useState, useCallback, useEffect, useRef } from 'react'; import { us...
eren23/non_linear_ai_chat
frontend/src/hooks/useClickOutside.ts
ts
4,539
10ce8baddf7807266f466abbdddcc56a57e64b35d8d40fd64ac1177c59d8a560
/** * Click outside detection hook. * Consolidates 5+ implementations of click-outside detection in ChatNode.tsx. * * @example * // Basic usage * const ref = useRef<HTMLDivElement>(null); * useClickOutside(ref, () => setIsOpen(false)); * * @example * // Conditional activation * useClickOutside(ref, handleClo...
eren23/non_linear_ai_chat
frontend/src/hooks/useAncestryHighlight.ts
ts
3,026
0fda1ead1f189a85936a6056150c2cc73da8659630530b1da58f6219b7551060
/** * Hook for highlighting ancestry nodes when a node is selected. * * When a single node is selected, this hook calculates its ancestry chain * and highlights those nodes with a subtle glow to show what context will * be sent to the LLM. */ import { useEffect, useRef } from 'react'; import useGraphStore from '...
eren23/non_linear_ai_chat
frontend/src/hooks/useRevisions.ts
ts
5,677
b740aa19d94e7d293c046d067ac59191c5dc835c03bfcba00ea5de9376020944
import { useCallback, useEffect, useRef, useState } from 'react'; import { listEntityRevisions, restoreRevision as apiRestoreRevision, type RevisionListItem, type RevisionEntityType, } from '@/lib/revisionsApi'; import useGraphStore from '@/store/useGraphStore'; import { useNotesStore } from '@/store/useNotesSt...
eren23/non_linear_ai_chat
frontend/src/hooks/useTokenEstimate.ts
ts
4,723
418537a61ecdfb6b8494db112fc496bd906d00a19f8e13404699859f78246bac
/** * Hook for estimating token count of ancestry chain. * * Uses a 300ms debounce to avoid calculation on every keystroke. */ import { useMemo, useState, useEffect, useRef } from 'react'; import useGraphStore from '@/store/useGraphStore'; import { estimateChainTokens, type ChainTokenEstimate, } from '@/lib/to...
eren23/non_linear_ai_chat
frontend/src/hooks/useDocumentChat.ts
ts
9,865
57832984fb9b9567c217817d723c4a7ec47218431e387f6a9a9cccc8781c4b8e
/** * useDocumentChat - Hook for document chat feature. * * Wraps the document chat store with API orchestration for: * - Sending messages (with streaming SSE) * - Loading/creating sessions * - Converting chat to flow */ import { useCallback, useRef } from 'react'; import useDocumentChatStore from '@/store/useD...
eren23/non_linear_ai_chat
frontend/src/hooks/useChatGeneration.ts
ts
19,552
a5836faddd747ade20d42a41a3ad650e73cd53dcaa5e6f1dc66ac2fb8ad405b9
import { useCallback, useEffect, useRef, useState } from 'react'; import useGraphStore from '@/store/useGraphStore'; import { sanitizeMessage, INPUT_LIMITS } from '@/lib/sanitize'; import { showError } from '@/lib/notifications'; import type { NodeData } from '@/types/graph'; import { GenerationError, type ToolEvent } ...
eren23/non_linear_ai_chat
frontend/src/hooks/useLinkSuggestor.ts
ts
5,180
775bc45cbec0bc715c44c1bfd43b820790213d6f87a9caabc67fcba840dced24
/** * useLinkSuggestor - Passive hook that detects keywords in typed text * and suggests existing notes to link to via [[noteTitle]]. */ import { useState, useCallback, useEffect, useRef, useMemo } from 'react'; import { fuzzyMatchWord } from '../lib/fuzzySearch'; export interface LinkSuggestion { noteId: string...
eren23/non_linear_ai_chat
frontend/src/hooks/useChatNodeFiles.ts
ts
10,855
88ba9b1ecfd5f3a45e77daf4119c0c612b03338d57a5668bd5711f3d8171041d
/** * useChatNodeFiles - Hook for managing file attachments in chat nodes. * * Extracts file operation logic from ChatNode including: * - File attachment/detachment * - File uploads with progress tracking * - Library document attachment * - Centralized flow files sync * * This hook manages files separately fro...
eren23/non_linear_ai_chat
frontend/src/hooks/useAISelection.ts
ts
8,263
30fdd18abcc629855cc373776ff7904ae4b40e3124130fd9ecdcc0fd13c71e93
/** * Hook for managing AI text selection toolbar in NoteEditor. * Handles selection tracking, positioning, and AI transformation streaming. */ import { useState, useCallback, useRef, useEffect } from 'react'; import { transformTextStream, AITransformAction, AITransformParams } from '../lib/notesApi'; import { getC...
eren23/non_linear_ai_chat
frontend/src/hooks/useFeatureDiscovery.ts
ts
2,257
d7e734f9ae383292e1e937d21cc00a545b92bf85b5c0e9175b51108a53192ebc
/** * useFeatureDiscovery - Track which features users have discovered. * * Stores discovered features in localStorage to show first-use hints * only once per user. */ import { useState, useCallback, useEffect } from 'react'; // Feature keys for trackable features export const FEATURE_KEYS = { TELEPORT_MODE: '...
eren23/non_linear_ai_chat
frontend/src/hooks/useSlashCommands.ts
ts
4,986
f846f5623b520a70f8c8a339d506421eac7af35ffac42482b8598b0c615ee3ae
/** * Hook for detecting slash commands (/) in text input * and providing command suggestions. */ import { useState, useCallback } from 'react'; import { SlashCommand, defaultSlashCommands, filterCommands } from '../components/controls/SlashCommandMenu'; interface SlashCommandState { isOpen: boolean; filter: s...
eren23/non_linear_ai_chat
frontend/src/hooks/useCollaboration.ts
ts
20,036
baf6f3e2efe07ccf86d5c3ed5655a70abf750ec4dc6b377381d1e9e44752f5d9
import { useEffect, useCallback, useRef, useState } from 'react'; import { connectSocket, disconnectSocket, getSocket, areSocketsEnabled } from '@/lib/socket'; import { setRoomJoined, clearThrottleState } from '@/lib/collabBroadcast'; import { useCollaborationStore, type NodeLock } from '@/store/useCollaborationStore';...