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/layout/TabBar/TabBar.tsx | tsx | 13,035 | 1978e803c2811cefaed993b79f30386e318ea2c414c5c8b3ffbcd7cf4665c258 | /**
* TabBar component - Browser-style tabs for multi-flow navigation.
*
* Features:
* - Tab display with dirty indicator, suspended icon, flow name
* - Click to switch, middle-click to close, right-click context menu
* - Drag and drop reordering
* - Keyboard shortcuts (Alt-based to avoid browser conflicts)
* -... |
eren23/non_linear_ai_chat | frontend/src/components/layout/TabBar/__tests__/TabBar.test.tsx | tsx | 16,313 | db72afd59013253085236c23baadcdd09cd150c22b3066123a45ec54bd292b94 | /**
* Tests for TabBar component.
*
* Covers:
* - Export verification (named and default)
* - Component interface and props (TabBarProps)
* - truncateName helper
* - Tab ordering logic
* - Context menu state
* - Keyboard shortcut logic
* - Drag and drop state management
* - Context menu action routing
* - T... |
eren23/non_linear_ai_chat | frontend/src/components/layout/LeftSidebar/CompactFlowsList.tsx | tsx | 29,735 | 5dd7a71baa657c68de2366b12e817a4d6e98b10518ead718c30b037f64990b55 | /**
* CompactFlowsList - Hierarchical flows list for the left sidebar.
*
* Features:
* - Shows groups and subgroups (up to 3 levels)
* - Expandable/collapsible groups
* - Create new groups and subgroups
* - Move flows between groups
* - Quick actions: load, delete, move
* - "Manage All Flows" button for full F... |
eren23/non_linear_ai_chat | frontend/src/components/layout/LeftSidebar/index.ts | ts | 92 | 4bd73b44a8a80e5ea0cbab2861ca35481c113b15e531e3f21bc67ebcc97e51c9 | export { LeftSidebar, default } from './LeftSidebar';
export type { } from './LeftSidebar';
|
eren23/non_linear_ai_chat | frontend/src/components/layout/LeftSidebar/LeftSidebar.tsx | tsx | 9,034 | c1ae5a82b8c0d011d1fc24a52dd5617470a3a2dd1b431967022fc3b299d0d02e | /**
* LeftSidebar - Simple collapsible navigation sidebar.
*
* Structure:
* - Logo
* - Flows section: CompactFlowsList with search
* - Knowledge section: Memories, Library
* - Bottom: Settings, Admin (if admin), Dashboard, Logout
*/
import React from 'react';
import {
Sparkles,
Settings,
BookOpen,
Glob... |
eren23/non_linear_ai_chat | frontend/src/components/layout/LeftSidebar/__tests__/CompactFlowsList.test.tsx | tsx | 3,045 | f94b168e641aafe55b51ede8dd44297083939050743897f720bb3b65386415a6 | // @vitest-environment happy-dom
import React from 'react';
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, waitFor } from '@testing-library/react';
const mockListFlowsWithHierarchyCached = vi.hoisted(() => vi.fn());
const mockT = vi.hoisted(() => vi.fn((_key: string, options?: ... |
eren23/non_linear_ai_chat | frontend/src/components/layout/__tests__/Navbar.test.tsx | tsx | 6,423 | 0485e669ac28d099c562e2ce04637bdd8d21ecc753967f0805629fc0bcbf65ce | /**
* Tests for Navbar component
*
* Tests: export verification, props interface, breadcrumb rendering,
* notification badge logic, callback invocations, invites dropdown.
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import React from 'react';
vi.mock('@/store/useGraphStore', () => ({
defa... |
eren23/non_linear_ai_chat | frontend/src/components/layout/__tests__/RightSidebar.test.tsx | tsx | 11,662 | 3d4eb97b2e0150eb22d217fe9e75c1dec2477fbddd7e4d659036e162d3f642b8 | /**
* Tests for RightSidebar component
*
* Tests: export verification, props interface, collapse behavior,
* node type header, create buttons, model selector context,
* save button logic, tab switching, section expand/collapse.
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import React from '... |
eren23/non_linear_ai_chat | frontend/src/components/layout/__tests__/LeftSidebar.test.tsx | tsx | 12,609 | 2347960b4d5b24bddf95896af21b1f7f37ff3b8c92304854a3381bb6145f820a | // @vitest-environment happy-dom
/**
* Tests for LeftSidebar component
*
* Tests: export verification, props interface, collapse behavior,
* navigation sections, admin visibility, callback invocations.
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import React from 'react';
import { render, sc... |
eren23/non_linear_ai_chat | frontend/src/components/documentChat/DocumentChatPanel.helpers.ts | ts | 2,698 | b9c40b5edaa1bdf81b64c62a74695275a3fd97b4c5ee3150d953e359a58391ca | /**
* Pure helpers for DocumentChatPanel. Kept in a separate module so the
* helpers can be unit-tested without pulling in the panel itself (which
* transitively imports `@/hooks/useDocumentChat` and a stack of other
* runtime dependencies that are heavy to mock in a unit test).
*/
import type { ChatReference } f... |
eren23/non_linear_ai_chat | frontend/src/components/documentChat/DocumentSummaryCard.tsx | tsx | 4,423 | 835010c855a84ed35862de247298cf1071b9ee7ca12beebb2281f54ebc560d2a | /**
* DocumentSummaryCard - Shows AI-generated summary and title suggestions.
*
* Displayed inline in LibraryPanel document rows after processing completes.
*/
import { useState } from 'react';
import { Sparkles, ChevronDown, ChevronUp, Loader2 } from 'lucide-react';
import styles from './DocumentSummaryCard.modul... |
eren23/non_linear_ai_chat | frontend/src/components/documentChat/index.ts | ts | 210 | 344682fbb3d923661aa4a960db6617bf8c0efce752e73e2a0d897ca2a38dd850 | export { default as DocumentChatPanel } from './DocumentChatPanel';
export { default as DocumentSummaryCard } from './DocumentSummaryCard';
export { default as ConvertToFlowModal } from './ConvertToFlowModal';
|
eren23/non_linear_ai_chat | frontend/src/components/documentChat/ConvertToFlowModal.tsx | tsx | 11,855 | 49f117bf9019127b53dfa1aa3d632766b5b568cfabd1c39f2cc51ff1bca9b47a | /**
* ConvertToFlowModal - Pick a destination for the chat-to-flow import.
*
* Presents a unified hierarchy tree (groups + flows). Selecting:
* - The Root node or any group → create a new flow under it.
* - An existing flow → append the imported chain beneath it.
*/
import { useState, useEffect... |
eren23/non_linear_ai_chat | frontend/src/components/documentChat/DocumentChatPanel.tsx | tsx | 13,860 | ce8f9ccc457a39f56ea4883076a1d985240451a73cb86e3068b0afa0312b9433 | /**
* DocumentChatPanel - Main chat panel for document Q&A.
*
* Centered modal overlay (expanded) with minimize to bottom-right dock.
* Features: clean minimal message styling, streaming responses,
* chunk references, convert-to-flow trigger.
*/
import React, { useState, useRef, useEffect, useCallback, useMemo }... |
eren23/non_linear_ai_chat | frontend/src/components/documentChat/__tests__/DocumentSummaryCard.test.tsx | tsx | 3,971 | edb27409da4cd1d996df1357ddf03fc484d7508367f1e981ff18cdc8003f08ce | // @vitest-environment happy-dom
/**
* Tests for DocumentSummaryCard rename-chip loading states.
*
* Guards the visual contract: when a rename request is in flight, the chip
* that was clicked shows a spinner and is aria-busy; sibling chips get the
* disabled style but no spinner. Without this feedback the user ca... |
eren23/non_linear_ai_chat | frontend/src/components/documentChat/__tests__/DocumentChatPanel.test.tsx | tsx | 16,744 | 8222dc9102dfd776e5124af2b9455a994014afdf525189a1f37973f476f22cbb | // @vitest-environment happy-dom
/**
* Tests for DocumentChatPanel component.
*
* DocumentChatPanel is a portal-rendered slide-in panel for document Q&A.
* It uses createPortal to render into document.body, so all queries use
* `screen` which searches the entire document.
*
* Key behaviors tested:
* - Export ve... |
eren23/non_linear_ai_chat | frontend/src/components/documentChat/__tests__/DocumentChatPanel.helpers.test.ts | ts | 3,679 | 614beaf09036824589fa418e21fe3440f920455791dad2cb2c024faf3561ee99 | /**
* Unit tests for DocumentChatPanel's pure helpers:
* - sortReferencesForDisplay (chip ordering)
* - phaseStatusLine (loading status text)
*
* These cover the UX contracts surfaced after the Personal Library doc-chat
* screenshot: a lone "Full document match" chip should not lead the list, and
* the panel... |
eren23/non_linear_ai_chat | frontend/src/components/documentChat/__tests__/ConvertToFlowModal.test.tsx | tsx | 6,845 | b423d1e98358036c04bf1eda96f0606443ca183434a50a1f7b681b0a1af3e638 | // @vitest-environment happy-dom
/**
* Tests for ConvertToFlowModal — hierarchy tree picker (groups + flows).
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
// ------------------------------------------------------------... |
eren23/non_linear_ai_chat | frontend/src/components/admin/AdminDashboard.tsx | tsx | 12,926 | 8f46422d5bf0f04c3e8a9784d23ee97efec6ec74819ffc15b9ea6cdb0f49069d | /**
* Admin dashboard shell component.
* Renders a sidebar with section tabs and the active section content.
*/
import React, { useState, useEffect } from 'react';
import {
BarChart3, Users, Shield, Bug, Settings as SettingsIcon,
List, LayoutTemplate, ThumbsUp, Activity, Server, Zap, Clock, Sliders,
} from 'luc... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminModels.tsx | tsx | 18,450 | 722efb47612a438a9ae88885f13b224fb3cfc6dd8b7dd819d4d020832505ba19 | import { useState, useMemo } from 'react';
import { Settings as SettingsIcon, RefreshCw, Plus, Trash2, ChevronRight, X, Search, Clock, History } from 'lucide-react';
import { Button, Badge } from '@/design-system/primitives';
import { useTranslation } from '@/i18n/useTranslation';
import { DashboardSection } from '@/co... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminActivityHeatmap.tsx | tsx | 3,732 | 356c8d501c583b314b008112fc4f06a3b48e26e39e5581bc03b396d181de5106 | import { useTranslation } from '@/i18n/useTranslation';
import { useEffect, useState } from 'react';
import { getUserActivityPatterns, type UserActivityPattern } from '@/lib/analyticsApi';
import styles from './AdminSections.module.css';
const DAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
const HOURS = Arr... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminBugReports.tsx | tsx | 9,575 | 869ce2a6293b224d981fb79b10cba70e666439118dda747ba5086c555b525244 | import { useState } from 'react';
import { Bug, Eye } from 'lucide-react';
import { Button, Modal } from '@/design-system/primitives';
import { DashboardSection, StatusBadge, DataTable, type Column } from '@/components/dashboard';
import { useTranslation } from '@/i18n/useTranslation';
import { getBugReportById, type B... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminWaitingList.tsx | tsx | 4,960 | 5dd45f2ba8c5dac0b1de0cf62455e5291449f52e64d1f8986f0a1277e3803765 | import { useState } from 'react';
import { List, Plus } from 'lucide-react';
import { Button } from '@/design-system/primitives';
import { DashboardSection, DataTable, type Column } from '@/components/dashboard';
import { useTranslation } from '@/i18n/useTranslation';
import { addAllowedEmail, approveWaitingListEmail, ... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminSecurity.tsx | tsx | 5,612 | c31acfb2a35ec6f20af6d60b416e3cd0fdf872b17e8c77a6e16e663a2fc60ebb | import { useState } from 'react';
import { Shield, AlertCircle, RefreshCw } from 'lucide-react';
import { Button } from '@/design-system/primitives';
import { DashboardSection, StatCard, StatusBadge, DataTable, type Column } from '@/components/dashboard';
import { useTranslation } from '@/i18n/useTranslation';
import t... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminFeedback.tsx | tsx | 17,661 | ba7a2cc5cfacfebf5d516b8d62cfa1bda743dc1ef236bfd64bbcdf71e123699d | import React, { useEffect, useState, useCallback } from 'react';
import { ThumbsUp, ThumbsDown, RefreshCw, X } from 'lucide-react';
import { useTranslation } from '@/i18n/useTranslation';
import {
getAdminFeedbackList,
getAdminFeedbackStats,
type AdminFeedbackEntry,
type AdminFeedbackStats,
} from '@/lib/adminA... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminFeatures.tsx | tsx | 1,443 | c4a0b38e0a8aaf1cdf88456974e46c140d2ae60e651821e8a06e5edf79af2b64 | import { useTranslation } from '@/i18n/useTranslation';
import { Settings as SettingsIcon } from 'lucide-react';
import { Badge } from '@/design-system/primitives';
import { DashboardSection, StatCard } from '@/components/dashboard';
import { useAllFeatures, FEATURE_DISPLAY_NAMES, type FeatureStates } from '@/store/use... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminSystemConfig.tsx | tsx | 14,071 | 44355c542c129c7147c684ef794706b69fcab122a99f4e8c561eff5cc606fa7e | import React, { useState, useEffect, useRef } from 'react';
import {
Sliders, RotateCcw, Search, Download, Upload,
ChevronDown, ChevronRight, Clock, AlertTriangle,
} from 'lucide-react';
import { useTranslation } from '@/i18n/useTranslation';
import { DashboardSection } from '@/components/dashboard';
import { useAd... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminUsers.tsx | tsx | 15,051 | 5cbfe845e507a6c672571d05d79164d2915f28e25b972dc774c1cfcc3db038ce | import { useState, useCallback } from 'react';
import { Button, Badge, Dialog } from '@/design-system/primitives';
import { DashboardSection, DataTable, type Column } from '@/components/dashboard';
import { Users, History, MoreVertical } from 'lucide-react';
import { useTranslation } from '@/i18n/useTranslation';
impor... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminTemplates.tsx | tsx | 26,524 | 2dd4462f3718bdc575f8af56e5c6f645c32612026264df6ccc213078f708cb58 | /**
* Admin template management component.
* Allows admins to create, update, and manage workflow templates.
*/
import React, { useEffect, useState, useCallback } from 'react';
import {
LayoutTemplate,
Plus,
Trash2,
Edit2,
Eye,
EyeOff,
Star,
StarOff,
FolderPlus,
RefreshCw,
X,
Rocket,
Searc... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminCronJobs.tsx | tsx | 13,482 | 20b4d4d179a2a319cdcde8a55c12fe90ac420273cf01c7260ac95f9fb1f98426 | import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { RefreshCw, Clock, CheckCircle, XCircle, Loader, AlertCircle } from 'lucide-react';
import { Button, Badge } from '@/design-system/primitives';
import { StatCard } from '@/components/dashboard';
import { useTranslation } from '@/i18n/use... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminOverview.tsx | tsx | 1,917 | 2b70f2bb14075a4cd449969c7ee68812fd11b729cabe04d65fedd6eb986afbdd | import { BarChart3, Users, TrendingUp, Activity } from 'lucide-react';
import { StatCard } from '@/components/dashboard';
import { useTranslation } from '@/i18n/useTranslation';
import type { SystemStats } from '@/lib/adminApi';
import styles from './AdminSections.module.css';
interface AdminOverviewProps {
stats: S... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminSystemHealth.tsx | tsx | 5,052 | ca899c5c50398422b429c5dc933446e749f973b07b35daed2d18abe9d4a401b2 | import { useTranslation } from '@/i18n/useTranslation';
import { useEffect, useState } from 'react';
import { Server, RefreshCw } from 'lucide-react';
import { Button, Badge } from '@/design-system/primitives';
import { StatCard } from '@/components/dashboard';
import { getCacheStats, getSystemHealth, type CacheStats, ... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/AdminAnalyticsCharts.tsx | tsx | 26,888 | 8e51dc578572715c9479f25a288d2aa627372a95e3c013632afeb3ee702178a9 | import { useEffect, useState } from 'react';
import { BarChart3, TrendingUp, Users, Activity, DollarSign, Calendar } from 'lucide-react';
import { useTranslation } from '@/i18n/useTranslation';
import {
BarChart, Bar, PieChart, Pie, Cell,
XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, Area, Area... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/__tests__/AdminFeedback.test.tsx | tsx | 9,087 | ebaadf56cc76441d3949790bd3dfb54c8a7a7fb35065dfc097aa350da3fe3acb | /**
* Tests for AdminFeedback section component.
*
* Covers:
* - Export verification
* - Component interface and props
* - DATE_RANGES constant
* - getDateRangeStart helper
* - Positive rate calculation
* - Pagination flag logic
* - Comment expand/collapse
* - Model breakdown rendering
* - Filter options
*... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/__tests__/AdminUsers.test.tsx | tsx | 9,369 | e333fff0ba92025ead441356f9fd2df9ce2494695e65d9820c07ef628323d943 | /**
* Tests for AdminUsers section component.
*
* Covers:
* - Export verification
* - Component interface and props
* - StatusBadge logic
* - StatusActions self-protection
* - ReasonDialog validation
* - User table columns
* - Demographic table columns
* - Status action menu state machine
*/
import { descr... |
eren23/non_linear_ai_chat | frontend/src/components/admin/sections/__tests__/AdminTemplates.test.tsx | tsx | 10,411 | 21904f01c4955e6dfecea1c53ab55914880037e77d16281bdab8a7b95b1595e7 | /**
* Tests for AdminTemplates component.
*
* Covers:
* - Export verification
* - Component interface and props
* - ICON_MAP constant
* - Tag add/remove logic
* - Category slug normalization
* - Toggle template status
* - Create template validation
* - Create category validation
* - Table column definitions... |
eren23/non_linear_ai_chat | frontend/src/components/admin/__tests__/AdminDashboard.test.tsx | tsx | 11,230 | ea2ca7c2cd6d533da72ec21f9f82512fd0eaae87f391c0af5d70f648aa196c40 | /**
* Tests for AdminDashboard component.
*
* Covers:
* - Export verification (via dynamic import with mocked dependencies)
* - Component interface and props validation
* - SECTIONS constant structure
* - Refresh logic per section
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import React f... |
eren23/non_linear_ai_chat | frontend/src/components/admin/__tests__/AdminSystemConfig.test.tsx | tsx | 20,980 | 39a6c03c0f1888cca03d00a0df9caaf98564db33d7a88dc4acd28cb858265de6 | // @vitest-environment happy-dom
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, waitFor, fireEvent, within } from '@testing-library/react';
import { AdminSystemConfig } from '../sections/AdminSystemConfig';
import type { ConfigItem, CategorySummary, HistoryEntry } from '../hooks... |
eren23/non_linear_ai_chat | frontend/src/components/admin/__tests__/AdminFeedback.test.tsx | tsx | 6,281 | 2592ab704d274fd3d273df4126e3b3650bf84c5767967704195a84a06712d2c9 | // @vitest-environment happy-dom
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, waitFor, fireEvent } from '@testing-library/react';
import AdminFeedback from '../sections/AdminFeedback';
const mockFeedbackList = vi.hoisted(() => vi.fn());
const mockFeedbackStats = vi.hoisted(()... |
eren23/non_linear_ai_chat | frontend/src/components/admin/__tests__/AdminCronJobs.test.tsx | tsx | 5,097 | bdd6b3682698df2de20ba34a6f39e5ec99bcf551539bcbc2bcbf36c0ef126843 | // @vitest-environment happy-dom
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { AdminCronJobs } from '../sections/AdminCronJobs';
import type { CronJobRun, CronJobSummary } from '@/lib/cronApi';
const sampleSummary: C... |
eren23/non_linear_ai_chat | frontend/src/components/admin/__tests__/AdminUsers.test.tsx | tsx | 6,401 | 79d5910f210fa5b8f038391853bb83aed3eb488399efeb7daa6322e86a5b4dee | // @vitest-environment happy-dom
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import { AdminUsers } from '../sections/AdminUsers';
import type { User, UserDemographics } from '@/lib/adminApi';
const mockUpdateUserStatus = vi... |
eren23/non_linear_ai_chat | frontend/src/components/admin/hooks/useAdminModels.ts | ts | 6,891 | 7ad8a6350d60dc735208b6e331b0b2277a852dc44b11e2a151a6ac139c6b4ba4 | import { useState, useCallback, useMemo } from 'react';
import {
getAdminModels,
addOrUpdateModel,
enableModel,
disableModel,
bulkEnableModels,
bulkDisableModels,
getDefaultModel,
setDefaultModel,
syncModelsFromOpenRouter,
getSyncStatus,
getSyncHistory,
clearModelRegistry,
type ModelInfo,
ty... |
eren23/non_linear_ai_chat | frontend/src/components/admin/hooks/useAdminConfig.ts | ts | 6,712 | f2942c21fab707cc1e44c4f2816afa1e889a08d7b62e9b6a9a802e454cb7c7cb | import { useState, useCallback } from 'react';
import { useTranslation } from '@/i18n/useTranslation';
import { apiFetch } from '@/lib/csrfApi';
interface ConfigItem {
category: string;
key: string;
currentValue: unknown;
defaultValue: unknown;
isOverridden: boolean;
description: string;
valueType: 'numb... |
eren23/non_linear_ai_chat | frontend/src/components/admin/hooks/useAdminData.ts | ts | 6,963 | 98ceb3f1ebbc9a68949d33af442d33b88d1df09e1494f29deefaedd58bb0fa3e | import { useEffect, useState, useCallback, useRef } from 'react';
import { useTranslation } from '@/i18n/useTranslation';
import {
getUsers,
getWaitingList,
getSystemStats,
getAllUsersDemographics,
getBugReports,
getSecurityViolations,
getRepeatOffenders,
getViolationStats,
type User,
type WaitingLi... |
eren23/non_linear_ai_chat | frontend/src/components/admin/hooks/__tests__/useAdminModels.test.ts | ts | 21,423 | 5cba1cada016f038aaee3776dd0d1ea7b59f4099ef7f218132ad74cb43a45093 | // @vitest-environment happy-dom
/**
* Tests for useAdminModels hook.
*
* Verifies state management, API interactions, sorting, selection toggling,
* sync polling, and error handling.
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { renderHook, act } from '@testing-library/rea... |
eren23/non_linear_ai_chat | frontend/src/components/admin/hooks/__tests__/useAdminData.test.ts | ts | 13,250 | f5494a3cd540c15f5e9fda81b45f30938c262b3a33d24762d47fbb9079eebc0c | // @vitest-environment happy-dom
/**
* Tests for useAdminData hook.
*
* Verifies loading overview/users/bugs/security data, race condition handling
* via request IDs, error handling, and computed loading state.
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { renderHook, act, waitFor } f... |
eren23/non_linear_ai_chat | frontend/src/components/admin/hooks/__tests__/useAdminConfig.test.ts | ts | 19,311 | b6cabcb9fe238784840114a9b449fea518f59e7310477cf82649f4f8434d1698 | // @vitest-environment happy-dom
/**
* Tests for useAdminConfig hook.
*
* Verifies loading categories, items, updating/resetting config,
* history, export, import, and error handling.
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { renderHook, act } from '@testing-library/react';
// ──... |
eren23/non_linear_ai_chat | frontend/src/components/modals/FlowBrowserModal.tsx | tsx | 11,323 | d99fd4f2bc98ed5b7fdb3cdcb136f929067a6c1625214b36a8bd2eed51890130 | /**
* FlowBrowserModal - Browse and select nodes from a referenced flow.
*
* Displays nodes from a referenced flow in a list with checkboxes,
* allowing users to select which nodes should be included in the context.
* Shows token estimates for each node and the total.
* Supports chat, information, group, and medi... |
eren23/non_linear_ai_chat | frontend/src/components/modals/__tests__/FlowBrowserModal.test.tsx | tsx | 6,598 | 8cf4037e8ed7e48634fbbf7c65bc1723f59c5c92974bf465ddf88516d92763bf | // @vitest-environment happy-dom
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import { FlowBrowserModal } from '../FlowBrowserModal';
// Mock the flowsApi module
const mockGetFlow = vi.fn();
vi.mock('@/lib/flowsApi', () => (... |
eren23/non_linear_ai_chat | frontend/src/components/user/ExpenseDashboard.tsx | tsx | 20,917 | fd385de7935ee5e832852729fdd7ed8da04ec6c83da2ebfa98afc02a92e3acec | import React, { useState, useEffect, useCallback } from 'react';
import {
BarChart,
Bar,
XAxis,
YAxis,
Tooltip,
ResponsiveContainer,
} from 'recharts';
import {
RefreshCw,
DollarSign,
TrendingUp,
AlertCircle,
ChevronLeft,
ChevronRight,
BarChart3,
Folder,
PieChart as PieChartIcon,
} from 'l... |
eren23/non_linear_ai_chat | frontend/src/components/user/UserDashboard.tsx | tsx | 4,588 | f17371369f3207b7c6fa0bbe698e0e5ca61119c7e291fe7f959e6ea0b87936ad | /**
* User dashboard shell component.
* Renders a sidebar with section tabs and the active section content.
*/
import React, { useState } from 'react';
import {
User, BarChart3, Settings, Key,
Brain, DollarSign, Gauge,
} from 'lucide-react';
import { useTranslation } from '@/i18n/useTranslation';
import { useAu... |
eren23/non_linear_ai_chat | frontend/src/components/user/ApiTokensSettings.tsx | tsx | 16,825 | 3fc4fbe57ea82d2b7a373921281e512b7b24c609240b2253e8aea115fba3a672 | /**
* API Tokens Settings component.
* Allows users to generate, view, and revoke API tokens for MCP access.
*/
import React, { useEffect, useState } from 'react';
import { Key, Plus, Trash2, Copy, Check, AlertCircle, ChevronDown, ChevronUp, ExternalLink } from 'lucide-react';
import { generateApiToken, listApiToke... |
eren23/non_linear_ai_chat | frontend/src/components/user/TelegramSettings.tsx | tsx | 11,775 | f6c88701a9806bb00cd6ceb27b0453a51dd14e78c143bf3bb64e9699a729eabf | /**
* Telegram Settings Component - Link/unlink Telegram for mobile capture.
*/
import { useState, useEffect, useRef, useCallback } from 'react';
import { MessageCircle, Link2, Unlink, Copy, Check, RefreshCw, AlertCircle, CheckCircle } from 'lucide-react';
import { useTranslation } from '@/i18n/useTranslation';
impo... |
eren23/non_linear_ai_chat | frontend/src/components/user/CalendarSettings.tsx | tsx | 10,512 | 4939dd2765f6dae02ab6abf598bd301945a88c564bd6f3712d73744ba8b05cda | /**
* Calendar Settings Component - Manage calendar connections and preferences.
*/
import { useState, useEffect } from 'react';
import { useTranslation } from '@/i18n/useTranslation';
import styles from './CalendarSettings.module.css';
import {
getCalendarStatus,
connectGoogleCalendar,
disconnectCalendar,
g... |
eren23/non_linear_ai_chat | frontend/src/components/user/sections/UserProfile.tsx | tsx | 1,663 | 2563d8034d8581f3878b9fd1572ef7ddd1731220abb659ef9d64118f23fef078 | import { useTranslation } from '@/i18n/useTranslation';
import type { UserStats } from '@/lib/userStatsApi';
import styles from './UserSections.module.css';
interface UserProfileProps {
stats: UserStats;
}
export function UserProfile({ stats }: UserProfileProps) {
const { t } = useTranslation();
return (
<d... |
eren23/non_linear_ai_chat | frontend/src/components/user/sections/UserUsageStats.tsx | tsx | 2,066 | bf6e7cda00d3ec3f712102eda8b00866d4c832f547f1aae7cd4a9e540d7256ca | import {
Zap, TrendingUp, FileText, Image as ImageIcon,
MessageSquare,
} from 'lucide-react';
import { StatCard } from '@/components/dashboard';
import { useTranslation } from '@/i18n/useTranslation';
import styles from './UserSections.module.css';
import type { UserStats } from '@/lib/userStatsApi';
interface Use... |
eren23/non_linear_ai_chat | frontend/src/components/user/sections/UserFlowUsage.tsx | tsx | 2,034 | 4ca50782604d71acf695acfb34e98933dcee287cbba7b1c31ec859bc3fe98647 | import { useTranslation } from '@/i18n/useTranslation';
import { DataTable, type Column } from '@/components/dashboard';
import { Badge } from '@/design-system/primitives';
import type { FlowUsage } from '@/lib/userStatsApi';
interface UserFlowUsageProps {
flowUsage: FlowUsage[];
}
export function UserFlowUsage({ f... |
eren23/non_linear_ai_chat | frontend/src/components/user/sections/UserExpenses.tsx | tsx | 123 | eae9055d4dac2c64b0217909bef73370d59776058f578ddcf5d2c9328c2f83c3 | import { ExpenseDashboard } from '../ExpenseDashboard';
export function UserExpenses() {
return <ExpenseDashboard />;
}
|
eren23/non_linear_ai_chat | frontend/src/components/user/sections/UserIntegrations.tsx | tsx | 1,063 | 3dbe0f133bfe389f764fa945abd49e5980faa532de6c67fbf9e81d0b5fd8da10 | import { useTranslation } from '@/i18n/useTranslation';
import { CalendarSettings } from '../CalendarSettings';
import { TelegramSettings } from '../TelegramSettings';
import ApiTokensSettings from '../ApiTokensSettings';
import styles from './UserSections.module.css';
export function UserIntegrations() {
const { t ... |
eren23/non_linear_ai_chat | frontend/src/components/user/sections/UserPreferences.tsx | tsx | 1,896 | 51b322f87dc406c0bd45049bdf129a3c92966bf471e3a0756a7e93c4a557a62f | import { useTranslation } from '@/i18n/useTranslation';
import styles from './UserSections.module.css';
import type { UserStats } from '@/lib/userStatsApi';
interface UserPreferencesProps {
stats: UserStats;
}
export function UserPreferences({ stats }: UserPreferencesProps) {
const { t } = useTranslation();
ret... |
eren23/non_linear_ai_chat | frontend/src/components/user/sections/UserLimits.tsx | tsx | 1,161 | def9251d7768b08670f6976103ea1c2d2a8a7cbea66d523f7d36daa33f4fa9ce | import { useTranslation } from '@/i18n/useTranslation';
import { ProgressBar } from '@/components/dashboard';
import styles from './UserSections.module.css';
import type { UserStats } from '@/lib/userStatsApi';
interface UserLimitsProps {
stats: UserStats;
}
export function UserLimits({ stats }: UserLimitsProps) {
... |
eren23/non_linear_ai_chat | frontend/src/components/user/sections/UserFacts.tsx | tsx | 138 | c366033ce0016a672f33e7528ae8ecea6f4fb9a54591c7626083b77e4224164d | import UserFactsDashboard from '@/components/notes/UserFactsDashboard';
export function UserFacts() {
return <UserFactsDashboard />;
}
|
eren23/non_linear_ai_chat | frontend/src/components/user/__tests__/CalendarSettings.test.tsx | tsx | 5,556 | c5f08241f9a81f308c6ddd5a3db842a69280c87c76a0afbdf925ba0cd7c74ae3 | /**
* Tests for CalendarSettings component.
*
* Covers:
* - Export verification
* - Component interface
* - API mock configuration
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import React from 'react';
const mockGetCalendarStatus = vi.hoisted(() => vi.fn());
const mockConnectGoogleCalenda... |
eren23/non_linear_ai_chat | frontend/src/components/user/__tests__/UserExpenses.test.tsx | tsx | 1,715 | 1b75ba35091c509dc541cd6d351dba0fca84d50c7380621a494e48271f764e8f | // @vitest-environment happy-dom
/**
* Tests for UserExpenses section component.
*
* UserExpenses is a thin wrapper that renders the ExpenseDashboard component.
* Since ExpenseDashboard has its own comprehensive tests, these tests focus on:
* - Component exports correctly
* - Renders the ExpenseDashboard child
*... |
eren23/non_linear_ai_chat | frontend/src/components/user/__tests__/TelegramSettings.test.tsx | tsx | 5,984 | ea513087ef986d6d1a908276dbd5ac409c68dec549cf17f487959ed38aee0f10 | /**
* Tests for TelegramSettings component.
*
* Covers:
* - Export verification
* - Helper functions (formatTimeRemaining, formatDate)
* - Component interface
* - Countdown logic
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import React from 'react';
const mockGetTelegramStatus = vi.hoist... |
eren23/non_linear_ai_chat | frontend/src/components/user/__tests__/ApiTokensSettings.test.tsx | tsx | 7,398 | ac6f7fb27bcc713f565f75d6f63ac863819cb82b0b86b2d07c117dbaa0997d90 | /**
* Tests for ApiTokensSettings component.
*
* Covers:
* - Export verification
* - Helper functions (getConfigPathHint, getMcpHttpConfig)
* - Component interface
* - Date formatting
* - URL constants
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import React from 'react';
const mockGene... |
eren23/non_linear_ai_chat | frontend/src/components/user/__tests__/UserFacts.test.tsx | tsx | 1,613 | 8a7aa8af0295139c3f162c14bd8aa7c1ff94744947bbc6a6537b77913b270e32 | // @vitest-environment happy-dom
/**
* Tests for UserFacts section component.
*
* UserFacts is a thin wrapper that renders the UserFactsDashboard component.
* Since UserFactsDashboard has its own comprehensive tests, these tests focus on:
* - Component exports correctly
* - Renders the UserFactsDashboard child
*... |
eren23/non_linear_ai_chat | frontend/src/components/user/__tests__/ExpenseDashboard.test.tsx | tsx | 11,278 | 22367ee1064d7e87d47097edb36d37b4f0d2a5a78c054126d374948c515ceeed | /**
* Tests for ExpenseDashboard component.
*
* Covers:
* - Export verification
* - Pure helper functions (formatCurrency, formatDate, daysUntil, isUnlimitedBudget, getProgressColor)
* - Component interface
* - CustomTooltip sub-component behavior
* - OPERATION_COLORS and ITEMS_PER_PAGE constants
* - Spending ... |
eren23/non_linear_ai_chat | frontend/src/components/user/hooks/useUserData.ts | ts | 1,701 | 573e2df2e3e529a7441f8b782fa1fc18f240217267482afb344508b2a3122022 | import { useEffect, useState, useCallback, useRef } from 'react';
import { getUserStats, getFlowUsage, type UserStats, type FlowUsage } from '@/lib/userStatsApi';
import { API_BASE } from '@/lib/api';
import { apiFetch } from '@/lib/csrfApi';
export function useUserData(isLoggedIn: boolean) {
const [stats, setStats... |
eren23/non_linear_ai_chat | frontend/src/components/agent/PermissionDialog.tsx | tsx | 4,751 | 28e3ded135a8bd4d01caa58b14dfd9a813bf537266bb26c4ba5f7174d6f9ff08 | /**
* PermissionDialog - Appears when the agent needs user approval for a gated action.
*/
import React, { useEffect, useState } from 'react';
import { AlertTriangle } from 'lucide-react';
import { useTranslation } from '@/i18n/useTranslation';
import { useAgentStore, type AgentPermissionRequest } from '@/store/useA... |
eren23/non_linear_ai_chat | frontend/src/components/agent/AgentActivityFeed.tsx | tsx | 2,214 | 8d6fa5e15f05423032b387c2b973d368551e2883a2ff5c6f4dcd6751fb39aa99 | /**
* AgentActivityFeed - Real-time log of agent actions.
*/
import React, { useRef, useEffect } from 'react';
import { Check, X, Loader } from 'lucide-react';
import { useTranslation } from '@/i18n/useTranslation';
import type { AgentActivity } from '@/store/useAgentStore';
interface AgentActivityFeedProps {
act... |
eren23/non_linear_ai_chat | frontend/src/components/agent/AgentBudgetMeter.tsx | tsx | 2,070 | 04eaa57ce078de6559ee95346280e1e9cc5be95ff80d4a312448ceeabfd64fc7 | /**
* AgentBudgetMeter - Displays remaining budget for the agent session.
*/
import React from 'react';
import { useTranslation } from '@/i18n/useTranslation';
import type { AgentBudgetState } from '@/store/useAgentStore';
interface AgentBudgetMeterProps {
budget: AgentBudgetState;
}
const AgentBudgetMeter: Reac... |
eren23/non_linear_ai_chat | frontend/src/components/agent/AgentSetupDialog.tsx | tsx | 6,786 | 986d802b3f2d833bf60e63f16421c0fcfa8812ecc6186daf5a81b80f4bbac0f2 | /**
* AgentSetupDialog - Modal for configuring and starting an AI agent session.
*/
import React, { useState, useEffect } from 'react';
import { Bot, Zap } from 'lucide-react';
import { useTranslation } from '@/i18n/useTranslation';
import { useAgentStore } from '@/store/useAgentStore';
import useGraphStore from '@/... |
eren23/non_linear_ai_chat | frontend/src/components/agent/AgentChatBar.tsx | tsx | 6,530 | 7af7cd96d663f802ec3dd4a46aa4a8a85616036d1cfb0d86ccadadb2eaac7296 | /**
* AgentChatBar - Replaces FloatingInputBar when agent is active.
*
* Shows task status, activity feed, message input, and budget meter.
*/
import React, { useState, useRef } from 'react';
import { Bot, Pause, Square, RotateCcw, Send } from 'lucide-react';
import { useTranslation } from '@/i18n/useTranslation';... |
eren23/non_linear_ai_chat | frontend/src/components/agent/BackgroundTasksPanel.tsx | tsx | 24,836 | 1bcd9fb87470fdf40b129f46807373e094d5e047797f8ca21bc2ecf74174a8de | /**
* BackgroundTasksPanel - Dialog for managing background agent tasks.
*
* Shows a list of background tasks (research, synthesis, connection_discovery)
* with status tracking, a "New Task" form, and expandable detail views.
*/
import React, { useCallback, useEffect, useState } from 'react';
import { createPorta... |
eren23/non_linear_ai_chat | frontend/src/components/agent/AgentOverlay.tsx | tsx | 7,314 | 839613db8a5d9be1928f47b40d9bb9e6e557a8d803a1c15c8c8e1ebee25c1f69 | /**
* AgentOverlay - Semi-transparent overlay shown when agent is working.
*
* The canvas still renders underneath (nodes appear in real-time),
* but user cannot edit. Only agent controls are interactive.
*/
import React from 'react';
import { ZoomIn, ZoomOut, Maximize } from 'lucide-react';
import { useReactFlow... |
eren23/non_linear_ai_chat | frontend/src/components/agent/__tests__/AgentSetupDialog.test.tsx | tsx | 6,043 | 982ebb9485a2a64a37b228f4fae7467e1bef523601061697f4bc32285a0e754b | /**
* Tests for AgentSetupDialog component
*
* Tests: export verification, props interface, task validation,
* budget info display, start button logic, error handling.
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import React from 'react';
const mockStartSession = vi.fn();
const mockCurrentF... |
eren23/non_linear_ai_chat | frontend/src/components/agent/__tests__/AgentBudgetMeter.test.tsx | tsx | 5,126 | 7b08d761b2c89b9a429bdfe60361ff8b3edb29600c2f442168f219e7abdb16d2 | /**
* Tests for AgentBudgetMeter component
*
* Tests: export verification, props interface, budget calculations,
* percentage capping, warning color thresholds, display text.
*/
import { describe, it, expect } from 'vitest';
import React from 'react';
import type { AgentBudgetState } from '@/store/useAgentStore';... |
eren23/non_linear_ai_chat | frontend/src/components/agent/__tests__/AgentOverlay.test.tsx | tsx | 7,590 | 434a7601873ef0aed814ba64a3fbb4a1924e60ad3820da8539fd5127ebf73587 | /**
* Tests for AgentOverlay component
*
* Tests: export verification, visibility conditions, flow matching,
* formatHeartbeatStatus helper, status-based rendering.
*/
import { describe, it, expect, vi } from 'vitest';
import React from 'react';
const mockAgentStore = vi.fn();
const mockGraphStore = vi.fn();
vi... |
eren23/non_linear_ai_chat | frontend/src/components/agent/__tests__/BackgroundTasksPanel.test.tsx | tsx | 35,167 | efdace9930ded07f727e50d8f3985c16d30641ee7e581660c6a9ccec3e5fb0c4 | // @vitest-environment happy-dom
/**
* Tests for BackgroundTasksPanel component.
*
* Covers render conditions, task list fetching, task creation,
* auto-populate flowId, task cancellation, expand/collapse,
* TYPE_CONFIG/STATUS_CONFIG, and View Results button.
*/
import { describe, it, expect, vi, beforeEach, aft... |
eren23/non_linear_ai_chat | frontend/src/components/agent/__tests__/PermissionDialog.test.tsx | tsx | 5,512 | ef1272190121167f776a6bb8420f705cc03ad0da6a0053a14c9db0c5ed005907 | /**
* Tests for PermissionDialog component
*
* Tests: export verification, props interface, action formatting,
* countdown timer logic, response buttons, auto-deny behavior.
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import React from 'react';
import type { AgentPermissionRequest... |
eren23/non_linear_ai_chat | frontend/src/components/agent/__tests__/AgentActivityFeed.test.tsx | tsx | 5,908 | c5366a480455657b229be5d23be878c89801fddc551818a34c585fb4cee287ba | /**
* Tests for AgentActivityFeed component
*
* Tests: export verification, props interface, empty state,
* activity rendering, icon logic, scrolling behavior, maxHeight prop.
*/
import { describe, it, expect, vi } from 'vitest';
import React from 'react';
import type { AgentActivity } from '@/store/useAgentStore... |
eren23/non_linear_ai_chat | frontend/src/components/agent/__tests__/AgentChatBar.test.tsx | tsx | 8,140 | 9506c4e4c97362b0a73fe107f46dc325a92374455ba8bb505a70526ecec4dbec | /**
* Tests for AgentChatBar component
*
* Tests: export verification, store integration, status-based rendering,
* input handling, button visibility logic, task truncation.
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import React from 'react';
// Mock the agent store
const mockStoreState =... |
eren23/non_linear_ai_chat | frontend/src/components/canvas/AlignmentGuides.tsx | tsx | 2,024 | 8d60afa97d90535f44f821522e14595dd0bb465d5b93ad8f5bc429a53cafbe3f | /**
* AlignmentGuides - Visual overlay showing alignment guides during drag.
*
* Renders dashed lines when nodes align with neighbors.
* Uses ReactFlow's viewport transform for proper positioning.
*/
import React, { memo, useMemo } from 'react';
import { useViewport } from '@xyflow/react';
import useGraphStore fr... |
eren23/non_linear_ai_chat | frontend/src/components/canvas/__tests__/AlignmentGuides.test.tsx | tsx | 7,420 | 20fb0b4d0c3bd699e22d1eec0276434ab6ad89d4eeb5b05bdc1c5c6c0ab5cf33 | // @vitest-environment happy-dom
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render } from '@testing-library/react';
import { useViewport } from '@xyflow/react';
// Mock useGraphStore
const mockStoreState = {
activeAlignmentGuides: [] as any[],
snapModeEnabled: true,
};
vi.mock('@/stor... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/DashboardNavbar.tsx | tsx | 1,650 | efdabc9014d987a456ddbd3fa79e758e31d142eae42d21b8fe44139b66cd4832 | import { ArrowLeft, RefreshCw, LogOut } from 'lucide-react';
import { Button, IconButton } from '@/design-system/primitives';
import { useTranslation } from '@/i18n/useTranslation';
import SpiderChatLogo from '@/components/common/SpiderChatLogo';
import styles from './Dashboard.module.css';
interface DashboardNavbarPr... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/DashboardSection.tsx | tsx | 2,050 | 6cb18a237b4c9c0f5292cc7c498ec2ad0f40222a4f1b542cc564aaa60c8905d3 | import { type ReactNode, useState } from 'react';
import { ChevronDown, ChevronRight } from 'lucide-react';
import { Card, IconButton } from '@/design-system/primitives';
import { useTranslation } from '@/i18n/useTranslation';
import styles from './Dashboard.module.css';
interface DashboardSectionProps {
title: stri... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/StatCard.tsx | tsx | 1,002 | 52979bb85482ecf2cf0bd8e34aa1f4fa8601cf63a3891e655a6d8835607c9672 | import { type ReactNode } from 'react';
import { Card } from '@/design-system/primitives';
import styles from './Dashboard.module.css';
interface StatCardProps {
label: string;
value: string | number;
icon?: ReactNode;
trend?: {
value: number;
label?: string;
};
}
export function StatCard({ label, v... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/ProgressBar.tsx | tsx | 1,468 | f2947056560ded57116cdabafedd9c6ada1ec9491b08e1d249c321ef3b00fc0b | import styles from './Dashboard.module.css';
interface ProgressBarProps {
current: number;
total: number;
label?: string;
showPercent?: boolean;
formatCurrent?: (v: number) => string;
formatTotal?: (v: number) => string;
}
export function ProgressBar({
current,
total,
label,
showPercent = true,
... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/StatusBadge.tsx | tsx | 716 | 7d8f1513324d6df5e78ebb01e60feec43bbe39325803739dc1b146f6731ed200 | import { Badge, type BadgeVariant } from '@/design-system/primitives';
const STATUS_MAP: Record<string, BadgeVariant> = {
open: 'error',
investigating: 'warning',
resolved: 'success',
closed: 'default',
active: 'success',
inactive: 'default',
blocked: 'error',
flagged: 'warning',
allowed: 'success',
... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/MetricCard.tsx | tsx | 1,148 | c09334b3e3474a0bb9d406df8e4aa21a6cd263697a9843fea6fa3d5594673a12 | import { type ReactNode } from 'react';
import { Card, Badge } from '@/design-system/primitives';
import styles from './Dashboard.module.css';
interface MetricCardProps {
label: string;
value: string | number;
icon?: ReactNode;
change?: number;
changeLabel?: string;
iconColor?: string;
}
export function M... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/ChartCard.tsx | tsx | 1,113 | ea430d0282c3bfe05d67538d1fad4cfdf20a844210c0b1e003631c3f6c2cbccb | import { type ReactNode } from 'react';
import { Download } from 'lucide-react';
import { Card, IconButton } from '@/design-system/primitives';
import { useTranslation } from '@/i18n/useTranslation';
import styles from './Dashboard.module.css';
interface ChartCardProps {
title: string;
icon?: ReactNode;
onExport... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/DataTable.tsx | tsx | 3,102 | 3edb7910f365026ec99ff4e8d81cb6e316d94570d8abd487e4b97e770697c5a4 | import { useState, useMemo, type ReactNode } from 'react';
import { ChevronUp, ChevronDown } from 'lucide-react';
import styles from './Dashboard.module.css';
export interface Column<T> {
key: string;
header: string;
render?: (item: T) => ReactNode;
sortable?: boolean;
width?: string;
}
interface DataTableP... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/index.ts | ts | 375 | b592da318c84d3fedfe2d59fd4931eeb638a72932c1ee3b69996355c90ef17ab | export { StatCard } from './StatCard';
export { MetricCard } from './MetricCard';
export { DashboardSection } from './DashboardSection';
export { DataTable, type Column } from './DataTable';
export { StatusBadge } from './StatusBadge';
export { ProgressBar } from './ProgressBar';
export { ChartCard } from './ChartCard'... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/__tests__/StatCard.test.tsx | tsx | 3,897 | be710dae2cde4473b98eca17d73ce0032a9d9e96a9a9785e17ca69093da68b79 | // @vitest-environment happy-dom
import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
// Mock design-system Card primitive
vi.mock('@/design-system/primitives', () => ({
Card: ({ children, variant, padding, className }: any) => (
<div data-testid="card" data... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/__tests__/StatusBadge.test.tsx | tsx | 2,878 | 5d0b8aae6ab42de72ac6c3da03cba7cba4ab35399e4c3cdd765adf3474004ba6 | // @vitest-environment happy-dom
import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
// Mock design-system Badge primitive
vi.mock('@/design-system/primitives', () => ({
Badge: ({ children, variant, size, className }: any) => (
<span data-testid="badge" dat... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/__tests__/MetricCard.test.tsx | tsx | 4,491 | a81790ce731fb0c4af882302645fbf40c17efb2cc384935cad55a875dea1fd16 | // @vitest-environment happy-dom
import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
// Mock design-system primitives
vi.mock('@/design-system/primitives', () => ({
Card: ({ children, variant, padding, className }: any) => (
<div data-testid="card" data-var... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/__tests__/DashboardComponents.test.tsx | tsx | 12,951 | 60356cea85ed9bbd67a8801f92974ac228084af6782c2a5acd9c11288ba9b22e | // @vitest-environment happy-dom
/**
* Tests for Dashboard components: DashboardNavbar, DashboardSection, StatCard.
*
* Tests rendering, props, click handlers, and collapsible behavior.
*/
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, fireEvent } from '@testing-library/rea... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/__tests__/ProgressBar.test.tsx | tsx | 5,723 | f19faddc240346c41ab7f0177bb25f9fc385446819150b2eae2783a3c946aa29 | // @vitest-environment happy-dom
import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
// Mock CSS module
vi.mock('../Dashboard.module.css', () => ({
default: {
progressWrapper: 'progressWrapper',
progressLabel: 'progressLabel',
progressTrack: 'progre... |
eren23/non_linear_ai_chat | frontend/src/components/dashboard/__tests__/DataTable.test.tsx | tsx | 9,505 | b5974e07c375e50dc4380ae9a373ed48b5cabcba4969e2eff821269349ed60f2 | // @vitest-environment happy-dom
import { describe, it, expect, vi } from 'vitest';
import { render, screen, fireEvent } from '@testing-library/react';
// Mock CSS module
vi.mock('../Dashboard.module.css', () => ({
default: {
tableContainer: 'tableContainer',
table: 'table',
sortableHeader: 'sortableHead... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.