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 | extension/lib/extractor/pdf.ts | ts | 5,351 | 17aab4e8497c23ebca688fe513315f0505c934febf51e4d08071249788ba25b1 | /**
* PDF detection and text extraction.
*
* - `isPdfPage()` runs in the content script (DOM access, no heavy deps).
* - `extractPdfText()` runs in the background service worker (no DOM needed).
*
* pdfjs-dist is loaded via dynamic import in the background handler so the
* initial bundle stays small (~300KB chun... |
eren23/non_linear_ai_chat | extension/lib/extractor/generic.ts | ts | 1,950 | 14d12fea36ef20104e785f03b5f60744795adedbaac7bd0bc51dfb9244f6abb3 | /**
* Generic fallback DOM text extraction.
* Used when Readability.js fails to extract article content.
*/
export interface GenericContent {
text: string;
html: string;
}
/**
* Extract clean content from the page body.
* Strips scripts, styles, nav, and other non-content elements.
* Returns both text and s... |
eren23/non_linear_ai_chat | extension/lib/extractor/index.ts | ts | 2,856 | ac12fbed27461299f86f4dbdff8749d4386d5f1613e83d0f59296a2b6c9b6773 | /**
* Content extraction orchestrator.
* Selects the best extraction strategy for the current page.
*/
import { extractArticle, type ExtractedArticle } from './readability';
import { isYouTubePage, extractYouTubeData, type YouTubeTranscript } from './youtube';
import { extractMetadata, type PageMetadata } from './m... |
eren23/non_linear_ai_chat | extension/lib/extractor/metadata.ts | ts | 4,097 | 501a0bbbc7f673ce0cd7fe9715497a352aee742e3b9eb05159331dd18075b27a | /**
* Page metadata extraction.
* Extracts Open Graph, JSON-LD, and meta tag information.
*/
export interface PageMetadata {
title: string;
description: string;
author: string | null;
publishDate: string | null;
siteName: string | null;
imageUrl: string | null;
favicon: string | null;
contentType: '... |
eren23/non_linear_ai_chat | extension/lib/extractor/youtube.ts | ts | 3,104 | 407e8ccf142dc3e52c3e85957d7af8a02e769ab438dd56be12c0df574cb213be | /**
* YouTube transcript extraction.
* Extracts video transcripts from YouTube pages.
*/
export interface YouTubeTranscript {
title: string;
channelName: string;
transcript: string;
duration: string;
videoId: string;
}
/**
* Check if the current page is a YouTube video page.
*/
export function isYouTub... |
eren23/non_linear_ai_chat | extension/lib/extractor/readability.ts | ts | 1,153 | 1dcd78450be9386d73f6d139656a3e8d3894b262254f9791a3c969707ab5694a | /**
* Article content extraction using Mozilla's Readability.js.
* Extracts clean article text from web pages.
*/
import { Readability } from '@mozilla/readability';
export interface ExtractedArticle {
title: string;
content: string; // Clean text content
htmlContent: string; // HTML content with ima... |
eren23/non_linear_ai_chat | extension/lib/extractor/__tests__/images.test.ts | ts | 17,946 | 1f009ebac2662aed99c56776057a968f3200d793484166bf8bdb1bb171af2f80 | import { describe, it, expect, beforeEach, vi } from 'vitest';
import { JSDOM } from 'jsdom';
import { extractPageImages, ExtractedImage } from '../images';
// ---------------------------------------------------------------------------
// Helpers
// ---------------------------------------------------------------------... |
eren23/non_linear_ai_chat | extension/lib/extractor/__tests__/youtube.test.ts | ts | 8,175 | eb0dfbaab5f5c753b831343cf3d6b06da2369a645672719fc000dd2d0811e200 | import { describe, it, expect } from 'vitest';
import { JSDOM } from 'jsdom';
import { isYouTubePage, getVideoId, extractYouTubeData } from '../youtube';
/**
* Helper to create a JSDOM document with optional head/body HTML.
*/
function makeDoc(
headHtml: string = '',
bodyHtml: string = '',
url: string = 'https... |
eren23/non_linear_ai_chat | extension/lib/extractor/__tests__/htmlToMarkdown.test.ts | ts | 6,604 | 1f382a8d50b13fdd1f3a3c90bb2fcf8749bc4942163baaa9dcac680674bc86ce | import { describe, it, expect } from 'vitest';
import { htmlToMarkdown } from '../htmlToMarkdown';
const PAGE_URL = 'https://example.com/article/test-page';
describe('htmlToMarkdown', () => {
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// Basic conversion
// ββββββββββββββββββββ... |
eren23/non_linear_ai_chat | extension/lib/extractor/__tests__/metadata.test.ts | ts | 13,227 | 11c2f909d6b5392e1c36e327613ada048fbfcc221521fa30a05e9b60edcc984a | import { describe, it, expect } from 'vitest';
import { JSDOM } from 'jsdom';
import { extractMetadata, type PageMetadata } from '../metadata';
/**
* Helper to create a JSDOM document with the given head and body HTML.
*/
function makeDoc(
headHtml: string,
bodyHtml = '',
url = 'https://example.com/page',
): D... |
eren23/non_linear_ai_chat | extension/lib/extractor/__tests__/pdf.test.ts | ts | 4,730 | 1f681a69b1847b5370b3ac584f87403866e367e1f206d4372ac5d607f28abd09 | import { describe, it, expect } from 'vitest';
import { JSDOM } from 'jsdom';
import { isPdfPage } from '../pdf';
// ---------------------------------------------------------------------------
// Helpers
// ---------------------------------------------------------------------------
function buildDocument(html = '<!DO... |
eren23/non_linear_ai_chat | extension/lib/storage/syncQueue.ts | ts | 12,531 | 544521525832334cf58619facd8cf126ed0bfd7ea8a17272d35585b9fb4336cd | /**
* Sync queue for batching and sending captures to the Spider Chat backend.
* Handles batching, retry classification, explicit queue states, and progress reporting.
*/
import {
getUnsyncedCapturesBatch,
markSynced,
markSyncError,
markSyncing,
MAX_RETRIES,
type CaptureFailureCategory,
type CaptureRe... |
eren23/non_linear_ai_chat | extension/lib/storage/indexeddb.ts | ts | 18,034 | 298bb9b1fe058bc526914fab8cae1bd171ac794a2f76b594ba8d144ca8be2b6e | /**
* IndexedDB storage for offline-first capture queue.
* Uses the `idb` library for a Promise-based API.
*
* v3: explicit sync state, queue diagnostics, retry actions, dashboard helpers.
*/
import { openDB, type IDBPDatabase } from 'idb';
import { canonicalizeUrl } from '../security/urlCanonicalizer';
const DB... |
eren23/non_linear_ai_chat | extension/lib/storage/audioSync.ts | ts | 5,808 | 92b28d3aabb29d9a3725dfe19d4d1806f9a474edef209b35e4ff1189f7002e6d | /**
* Audio Chunk Sync β Uploads pending audio chunks to the Spider Chat backend.
*
* Runs on a chrome.alarms schedule. Batches chunks (up to 10) into a single
* multipart/form-data POST to /api/audio-capture/chunks.
*
* Works with audioChunkStore.ts for IndexedDB persistence and
* the audioCapture.ts session ma... |
eren23/non_linear_ai_chat | extension/lib/storage/audioChunkStore.ts | ts | 8,131 | edd8399ab494108270e942e30eb8ed2d1775f9e60e0c3bbf3573801a60c3a9c2 | /**
* IndexedDB Storage for Audio Chunks
*
* Separate DB from captures to avoid migration complexity.
* Stores raw audio blobs with metadata for batch upload to backend.
*
* Storage lifecycle:
* 1. Audio chunk recorded β stored with status 'pending'
* 2. Sync picks up pending chunks β status 'uploading'
* 3. B... |
eren23/non_linear_ai_chat | extension/lib/storage/__tests__/syncQueue.test.ts | ts | 27,867 | 275795f4a3e258051594524d4fd03012a3cd88f416fdade00cd543358b15d706 | /**
* Unit tests for syncQueue.ts
*
* Covers:
* - recordToInput: screenshotData extraction from screenshotDataUrl
* - recordToInput: fallbackData from imageDataUrl on photos
* - processSyncQueue: screenshot records sent individually via createCapture
* - processSyncQueue: non-screenshot records batched via creat... |
eren23/non_linear_ai_chat | extension/lib/api/client.ts | ts | 14,497 | 6a3bb6e620eb07a5b66cc134574f1ac2427b4c1c0f09173e2732480ace0c0ea3 | /**
* Spider Chat API client for the browser extension.
* Handles authentication via shared cookies and provides typed methods
* for all capture-related API endpoints.
*/
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8000/api';
interface CaptureInput {
url: string;
title: string;
favico... |
eren23/non_linear_ai_chat | extension/lib/api/__tests__/client.csrf.test.ts | ts | 3,007 | 99b4ef1f5b4ffaf3b86b5f0b0a3f4edb2b3f7b20177fba02b6862e539180b1b9 | /**
* Tests for CSRF token inclusion in extension API client.
*
* Verifies that state-changing requests (POST, PUT, PATCH) include
* the X-CSRF-Token header read from chrome.cookies, and that GET
* requests skip CSRF entirely.
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
// =====... |
eren23/non_linear_ai_chat | extension/lib/captureSystem/fullContentEligibility.ts | ts | 1,032 | 5d4a80f147c6b0adf636cc453b98c68e006e3b17c14d0873c3d9915040f27b70 | /**
* Decide whether to run expensive full-page extraction for an always-on session.
* Uses explicit rules so behavior matches docs: repeat interest (2+ visits) or
* meaningful scroll (50%+ bucket). Provisional score alone cannot reach 0.3 at
* session start with dwell/focus unknown, so we do not gate on that thres... |
eren23/non_linear_ai_chat | extension/lib/captureSystem/types.ts | ts | 2,548 | 9a88e1cfc1d75d7fe1bd3657574921191ebefc2996a0f414f6ae25433cb6c926 | import type { AuthStatus } from '../api/client';
import type {
CaptureFailureCategory,
CaptureRecord,
CaptureSyncStatus,
QueueSummary,
} from '../storage/indexeddb';
import type { SyncProgress } from '../storage/syncQueue';
export type BackendReachability = 'unknown' | 'reachable' | 'unreachable';
export inte... |
eren23/non_linear_ai_chat | extension/lib/captureSystem/vadDetector.ts | ts | 6,003 | 5939dbd0734975a1c53f4c85c23327b2a9254c17bb3a3c8363a23b97f428fd64 | /**
* Voice Activity Detection (VAD) for Always-On Audio Capture
*
* Energy-based VAD that analyzes audio chunks to determine if they contain speech.
* Filters out ~65% of captured audio (silence/background noise) to reduce
* transcription volume and cost.
*
* Uses RMS energy with adaptive thresholding β no ML m... |
eren23/non_linear_ai_chat | extension/lib/captureSystem/audioCapture.ts | ts | 12,954 | f3a2eba006838cb584fad13ce0d0dee3a1e501aafe84b4ba5bd09ddcbf486bce | /**
* Audio Capture System for Always-On Capture
*
* Manages two audio capture modes:
* 1. Tab Audio β via chrome.tabCapture + offscreen document (captures what user hears)
* 2. Microphone β via navigator.mediaDevices.getUserMedia (captures user's voice)
*
* Audio is recorded as WebM/Opus chunks (30s each), anal... |
eren23/non_linear_ai_chat | extension/lib/captureSystem/client.ts | ts | 4,368 | 1e46c3e230a678a76265377280c0d4c396a110cf184414f9143fcb7b4cdb264a | import type { AuthStatus, CaptureSettings } from '../api/client';
import type { CaptureSystemState, QueueListItem } from './types';
import type { CaptureSyncStatus } from '../storage/indexeddb';
const STATE_PORT_NAME = 'capture-system-state';
export type AlwaysOnSettingsResponse =
| { ok: true; settings: CaptureSet... |
eren23/non_linear_ai_chat | extension/lib/captureSystem/privacyRules.ts | ts | 7,610 | f2eeb9224f222ce42c84e4ea18ea10c8af72b5d535a17ec485d90b6c8cf2ec77 | /**
* Privacy Rules Engine for Audio Capture
*
* Controls when audio capture is allowed based on:
* - Per-domain rules (blocklist/allowlist)
* - URL pattern matching (banking, health, auth pages)
* - User consent state
* - Recording indicator management
*/
// ===================================================... |
eren23/non_linear_ai_chat | extension/lib/captureSystem/formatters.ts | ts | 2,396 | 5abe70a922ee927de1e6e45bc00f08d7064236faa98fb90acfdfcb422a3a8ef9 | import type { CaptureFailureCategory, CaptureSyncStatus } from '../storage/indexeddb';
export function formatTimeAgo(timestamp?: number | null): string {
if (!timestamp) return 'never';
const seconds = Math.floor((Date.now() - timestamp) / 1000);
if (seconds < 10) return 'just now';
if (seconds < 60) return `$... |
eren23/non_linear_ai_chat | extension/lib/captureSystem/__tests__/formatters.test.ts | ts | 6,204 | 2ecc235a42794ea3ccccb64363e3b4fc5653ff2288f2ac6700e5844642603feb | import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import {
formatTimeAgo,
formatBytes,
formatStatusLabel,
statusColor,
formatFailureCategory,
trimText,
} from '../formatters';
import type { CaptureSyncStatus, CaptureFailureCategory } from '../../storage/indexeddb';
describe('formatT... |
eren23/non_linear_ai_chat | extension/lib/captureSystem/__tests__/privacyRules.test.ts | ts | 12,756 | 4d0eb44ace82e4f5a824405c8213830dd973ffc632c1cbecedbf958cff81d9f2 | import { describe, it, expect, beforeEach, vi } from 'vitest';
import { AudioPrivacyRules } from '../privacyRules';
// ---------------------------------------------------------------------------
// Mock chrome.storage.local
// ---------------------------------------------------------------------------
const storageSto... |
eren23/non_linear_ai_chat | extension/lib/captureSystem/__tests__/alwaysOnSignals.test.ts | ts | 4,421 | bd34829adcd96da65cd8bbcdd0a53d66b45115c1cb07d6c9e878b5b73267c436 | /**
* Tests for always-on signal session scoring logic.
*
* computeProvisionalScore mirrors the server-side scoring formula and is used
* client-side to decide whether to request full content extraction for
* high-value sessions.
*
* We test the logic directly here (it's a pure function) rather than importing
*... |
eren23/non_linear_ai_chat | extension/entrypoints/offscreen.ts | ts | 8,213 | 710ae01c6d4aa2300135a6f496f38e45aff24b11f356cb3da3e80a93d37d263d | /**
* Offscreen Document β Audio Recording Worker
*
* This document runs in a separate context from the MV3 service worker.
* It handles MediaRecorder operations (which require a DOM context)
* and sends audio chunks back to the background script via chrome.runtime.sendMessage.
*
* Lifecycle:
* 1. Background sc... |
eren23/non_linear_ai_chat | extension/entrypoints/content.ts | ts | 15,642 | 28f189acb80d6834cdb84ebaea2175a0770e9e275caa7454bc715effe74f8e7c | /**
* Content Script for Spider Chat extension.
*
* Responsibilities:
* - Page content extraction (Readability.js)
* - Text selection/highlight capture
* - Page metadata extraction
* - Augmented browsing overlay (show related past saves)
*
* IMPORTANT: Content scripts run in the page's origin context.
* All I... |
eren23/non_linear_ai_chat | extension/entrypoints/background.ts | ts | 65,383 | 4fab052f1d145d24bb659dadab4e2c258a1c5482f4a4a7e3a28bbd3ca3e6ca53 | /**
* Background Service Worker for Spider Chat extension.
*
* Responsibilities:
* - Auth management (cookie-based, shared with web app)
* - Sync queue processor (batch captures to backend)
* - Context menu handler ("Capture to Spider Chat")
* - Message router (content script <-> backend)
* - Augmented browsing... |
eren23/non_linear_ai_chat | extension/entrypoints/popup/main.tsx | tsx | 224 | b331b253905f943e9b7534eb72e27741f5f777528e2d7d136df686d24f59bdc8 | import React from 'react';
import ReactDOM from 'react-dom/client';
import { Popup } from './Popup';
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<Popup />
</React.StrictMode>
);
|
eren23/non_linear_ai_chat | extension/entrypoints/popup/Popup.tsx | tsx | 8,101 | 3950ec4279429028653b370ae4cda6a4036bfdddc03b4af543b363b2b4d8fbfa | import React, { useCallback, useEffect, useRef, useState } from 'react';
import { PopupView } from '@/components/popup/PopupView';
import type { AlwaysOnSettingsUpdates, CaptureResult, CaptureState, PageInfo, ScreenshotState } from '@/components/uiTypes';
import {
clearSyncedCaptures,
forceSync,
getCaptureSystem... |
eren23/non_linear_ai_chat | extension/entrypoints/dashboard/main.tsx | tsx | 238 | d852d118377338940eca05a881631fabd55a1cc7d02198c541e90f4cd3d89b8e | import React from 'react';
import ReactDOM from 'react-dom/client';
import { Dashboard } from './Dashboard';
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<Dashboard />
</React.StrictMode>,
);
|
eren23/non_linear_ai_chat | extension/entrypoints/dashboard/Dashboard.tsx | tsx | 5,357 | bab8e0cd23671fd142b7d543950108c2870f52fa52d6ba5d08204554be234273 | import React, { useCallback, useEffect, useState } from 'react';
import { DashboardView } from '@/components/dashboard/DashboardView';
import type { DashboardStatusFilter } from '@/components/uiTypes';
import {
clearSyncedCaptures,
deleteQueueItem,
skipQueueItem,
exportDebugSnapshot,
forceSync,
getCaptureS... |
eren23/non_linear_ai_chat | frontend/vite.config.ts | ts | 1,701 | 63cdacc94c898d7f6b4b6fc84c9a6bbeaab6997c42b8c06a71c709dd2416e57f | import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig(async ({ mode }) => {
const plugins: any[] = [react()];
// Bundle analysis β activated via `npm run build:analyze`
if (process.env.ANALYZE === 'true') {
... |
eren23/non_linear_ai_chat | frontend/vitest.config.ts | ts | 1,390 | ef8f7c2ff3cc5951e8ee21843dfdfadb0d78ae971c2f56c1220c7ade75949be7 | import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
test: {
globals: true,
// Use node environment for store te... |
eren23/non_linear_ai_chat | frontend/.storybook/main.ts | ts | 712 | 2dfca595b4b9751a24ebc5d60b51bf4a05bbe372c18470fa5d75db14722cad24 | import type { StorybookConfig } from '@storybook/react-vite';
import { mergeConfig } from 'vite';
import path from 'path';
const config: StorybookConfig = {
stories: [
'../src/design-system/**/*.stories.@(js|jsx|mjs|ts|tsx)',
'../src/design-system/**/*.mdx',
],
addons: [
'@storybook/addon-links',
... |
eren23/non_linear_ai_chat | frontend/.storybook/preview.tsx | tsx | 1,093 | 0596783994e4a3f24444b8c7e4be897a9155f1cd91e1da59f0fe166977e43a0f | import React from 'react';
import type { Preview } from '@storybook/react';
// Import design system tokens
import '../src/design-system/tokens/_variables.css';
// Import global styles (which also imports tokens)
import '../src/styles/global.css';
const preview: Preview = {
parameters: {
controls: {
match... |
eren23/non_linear_ai_chat | frontend/src/App.tsx | tsx | 84,955 | ef6910deee1ee23009023ac6e62dbee6aea60f706aef35213b96400a4933f50e | import React, { useMemo, useCallback, useRef, useEffect, useState } from 'react';
import {
ReactFlow,
Background,
Controls,
MiniMap,
BackgroundVariant,
ConnectionMode,
ReactFlowInstance,
type NodeChange,
type EdgeChange,
type Viewport,
type OnSelectionChangeParams,
type NodeTypes,
} from '@xyflo... |
eren23/non_linear_ai_chat | frontend/src/main.tsx | tsx | 4,548 | 86690d72343654e6e4d6bd9372ec547af1ba0f643cf97d5fc0109f7be2b31c5a | /**
* Application entry point.
*/
import React from 'react';
import ReactDOM from 'react-dom/client';
import * as Sentry from '@sentry/react';
import { ReactFlowProvider } from '@xyflow/react';
import App from './App';
import { ErrorBoundary } from './components/ErrorBoundary';
import { toastManager } from './compon... |
eren23/non_linear_ai_chat | frontend/src/labs-entry.tsx | tsx | 7,186 | a2627d4b296fddfc900a9892f64a0d456bf91c66f6a92af95a9697f094e3711f | /**
* Standalone entry for the HTML-in-Canvas Labs experiment.
*
* This file mounts a MINIMAL React app containing ONLY the labs UI. It:
* - Imports nothing from the main Spider Chat app (no auth, no graph
* store, no API clients, no user data, no i18n, no collaboration).
* The only imports allowed are ... |
eren23/non_linear_ai_chat | frontend/src/types/snapping.ts | ts | 1,222 | 5846b6ce36b99cfd8ce7ffba1b90f745686c8b702c637f983c1795a1a2e33dfe | /**
* Types for the hybrid snap mode feature.
* Supports grid snapping + neighbor edge alignment with visual guides.
*/
export type AlignmentType =
| 'left'
| 'right'
| 'center-x'
| 'top'
| 'bottom'
| 'center-y';
export interface AlignmentGuide {
type: AlignmentType;
/** The x or y coordinate of th... |
eren23/non_linear_ai_chat | frontend/src/types/sketch.ts | ts | 864 | a44625f853a31c9899e4e6e83a3df3f64417ff732b77aa0247089838355b01d3 | /**
* Sketch-related type definitions and constants.
*/
/** Max inline scene JSON size before offloading to R2 */
export const SKETCH_INLINE_THRESHOLD = 500 * 1024; // 500KB
/** Max number of embedded images (base64 files) allowed in a sketch */
export const SKETCH_MAX_EMBEDDED_IMAGES = 5;
/** Max scene JSON size ... |
eren23/non_linear_ai_chat | frontend/src/types/templates.ts | ts | 1,785 | ac58858e9b7dfe26a24954a9e5181ca87b44c61f5de92e25c5d05817faba0165 | /**
* Types for workflow templates.
*/
export interface TemplateCategory {
_id: string;
slug: string;
name: string;
description?: string;
icon?: string;
displayOrder: number;
isCustom: boolean;
templateCount?: number;
}
export interface TemplateListItem {
_id: string;
title: string;
descriptio... |
eren23/non_linear_ai_chat | frontend/src/types/attachments.ts | ts | 3,907 | 7fee0c180008046390a5aaa4b73e442f0907d51b97846af8f82840f1aeb892a6 | /**
* Type definitions for node media attachments.
* @module types/attachments
*/
/**
* Attachment processing status.
*/
export type AttachmentStatus =
| 'uploading' // Client uploading to server
| 'processing' // Server extracting content
| 'ready' // Available for use
| 'error'; //... |
eren23/non_linear_ai_chat | frontend/src/types/graph.ts | ts | 22,156 | fb9b0ae9e3cac1fcf1314d80f33614fb964a452298751b7919f4d505633645ed | /**
* Type definitions for the graph structure.
*/
import { Node as ReactFlowNode, Edge as ReactFlowEdge } from '@xyflow/react';
export type NodeStatus = 'idle' | 'loading' | 'stale' | 'error';
/**
* Tracks a single tool call/result during generation for live feedback.
*/
export interface ToolActivityItem {
to... |
eren23/non_linear_ai_chat | frontend/src/types/window.d.ts | ts | 642 | ec71d68341779964544ea4c2092f655dc51cb70f72def7c3e21b52e08f09e7d2 | /**
* Global Window interface extensions for Spider Chat.
*
* These properties are set at runtime by various modules:
* - __spiderchat_storage_listener: Cross-tab logout detection (useAuthStore.ts)
* - __spiderchat_fetch_patched: Global 401 fetch interceptor (useAuthStore.ts)
* - __addMemoryToTimeline: Memory tim... |
eren23/non_linear_ai_chat | frontend/src/test/setup.ts | ts | 3,907 | 2de48dc93b8fd2edfc81b21a588d0287af6dbeec75f2acedffe99eadf148c792 | // Set up minimal DOM environment for tests when window doesn't exist
// This handles the case when jsdom environment fails to load due to ESM issues
if (typeof window === 'undefined' && typeof global !== 'undefined') {
// Create minimal DOM-like globals for React Testing Library
const createMinimalDOM = () => {
... |
eren23/non_linear_ai_chat | frontend/src/components/RevisionBadge.tsx | tsx | 1,976 | c36ec347e9f587b1225c72e7dc65cc3215565d4047e089f7e43c4bd74a927484 | /**
* Tiny presence badge that flags a node/note/memory as having been edited
* by a non-human writer (MCP, Agent, Telegram, browser extension, or API client).
* Issue #1130 β provides at-a-glance awareness so users know to open the
* History panel and review/restore.
*/
import React from 'react';
import { Bot, S... |
eren23/non_linear_ai_chat | frontend/src/components/InformationPage.tsx | tsx | 283 | 51450c78cd1f492465c1a791119a95349359722c40b8b7978ce88e2a79898c3c | import React from 'react';
import { HelpModal } from './help';
interface InformationPageProps {
onClose: () => void;
}
const InformationPage: React.FC<InformationPageProps> = ({ onClose }) => {
return <HelpModal isOpen onClose={onClose} />;
};
export default InformationPage;
|
eren23/non_linear_ai_chat | frontend/src/components/ErrorBoundary.tsx | tsx | 6,366 | a7b14582d6b3016eba49f8f254155c2721a58cf88ff635a2a82a5dce46effa73 | /**
* Error Boundary Component
*
* Catches JavaScript errors anywhere in the child component tree,
* logs them to Sentry, and displays a fallback UI.
*/
import { Component, ErrorInfo, ReactNode } from 'react';
import * as Sentry from '@sentry/react';
import { toastManager } from './controls/ToastNotifications';
i... |
eren23/non_linear_ai_chat | frontend/src/components/captures/PhotoLightbox.tsx | tsx | 7,055 | 0e731aa158f86d8ee8cd16ef6c6af3414403ef9c7aa7d7f62bd54177613641ec | /**
* PhotoLightbox - Full-viewport lightbox overlay with navigation, zoom, and pan.
* Rendered via createPortal into document.body.
*/
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { createPortal } from 'react-dom';
import { X, ChevronLeft, ChevronRight, ZoomIn, ZoomOut } from 'lu... |
eren23/non_linear_ai_chat | frontend/src/components/captures/PhotoGallery.tsx | tsx | 2,653 | e7f3c26bce8fb96a6b33317728725662aee1cb81d3a8c813cd07efed3de1d282 | /**
* PhotoGallery - CSS Grid photo gallery with optional lightbox support.
*/
import React, { useState, useCallback } from 'react';
import { ImageIcon } from 'lucide-react';
import { AuthenticatedImage } from '@/components/nodes/AuthenticatedImage';
import type { CapturePhoto } from '@/store/useCaptureStore';
impor... |
eren23/non_linear_ai_chat | frontend/src/components/captures/SignalsWeeklyView.tsx | tsx | 7,145 | 578284d4d6e17439c3306afe8cff59088a8c0d54f78b2e15eb823e5a8f40ea23 | /**
* SignalsWeeklyView - Shows daily breakdown across 7 days, totals, and
* promotion rate from the /capture-signals/weekly endpoint.
*/
import React, { useCallback, useEffect, useState } from 'react';
import { ChevronLeft, ChevronRight, Loader2 } from 'lucide-react';
import { formatDuration } from '@/lib/formatte... |
eren23/non_linear_ai_chat | frontend/src/components/captures/CaptureViewer.tsx | tsx | 12,497 | 20b4b183904ddb17791ed9ae42e31a16999ee33789ae4dcccafbf893499c0e8e | /**
* CaptureViewer - Full-screen viewer for captures with photos, content, and metadata.
* Rendered via createPortal into document.body.
*/
import React, { useEffect, useState, useCallback } from 'react';
import { createPortal } from 'react-dom';
import ReactMarkdown from 'react-markdown';
import {
X,
Edit2,
... |
eren23/non_linear_ai_chat | frontend/src/components/captures/CaptureEditModal.tsx | tsx | 7,779 | 0223c17d8a0ca98a64a68e54d1da1aa98e32c4c6f969d23f108442a3164aed78 | /**
* CaptureEditModal - Portal-based modal for editing capture title, content, and tags.
*/
import React, { useState, useEffect, useCallback } from 'react';
import { createPortal } from 'react-dom';
import { X, Loader2 } from 'lucide-react';
import { useCaptureStore, type CaptureItem, type CapturePhoto } from '@/st... |
eren23/non_linear_ai_chat | frontend/src/components/captures/CapturePickerPanel.tsx | tsx | 27,051 | fe21b7f316dfef678a5c6170f6bf47381dd72c8ce7a57a4b1952ed8e341ce4a9 | /**
* CapturePickerPanel β Full-size modal for browsing, searching, and selecting
* captures to import into a node. Supports both chat and information nodes.
*
* Uses independent local state for data fetching so it doesn't interfere with
* the main CapturesPanel's store state.
*
* Features:
* - Multi-select wit... |
eren23/non_linear_ai_chat | frontend/src/components/captures/CapturePhotoThumbnail.tsx | tsx | 1,724 | fbc5ea3c30a5d1ad3378ebcdc18b55e694ee2ac560364617608c7bc1be56feca | /**
* CapturePhotoThumbnail - Small preview showing 1-3 thumbnails with +N badge.
*/
import React from 'react';
import { ImageIcon } from 'lucide-react';
import { AuthenticatedImage } from '@/components/nodes/AuthenticatedImage';
import type { CapturePhoto } from '@/store/useCaptureStore';
import styles from './Capt... |
eren23/non_linear_ai_chat | frontend/src/components/captures/SignalsDailyView.tsx | tsx | 7,519 | 70bd41cf81b9c7646cc473803b1d70b640a6c20e082c1b556d03288f5e9f15fc | /**
* SignalsDailyView - Shows hourly breakdown, top domains, and top pages
* for a single day from the /capture-signals/daily endpoint.
*/
import React, { useCallback, useEffect, useState } from 'react';
import { ChevronLeft, ChevronRight, Loader2 } from 'lucide-react';
import { formatDuration } from '@/lib/format... |
eren23/non_linear_ai_chat | frontend/src/components/captures/PhotoManager.tsx | tsx | 6,736 | bed1fc289739af82933baea71221790ea4afb91d4341a2e993f565a3c4bf03bb | /**
* PhotoManager - Photo management UI for CaptureEditModal.
* Displays existing photos with delete/reorder, and an upload zone to add new ones.
*/
import React, { useState, useCallback } from 'react';
import { X, Plus, ChevronUp, ChevronDown, ImageIcon, Loader2 } from 'lucide-react';
import { AuthenticatedImage ... |
eren23/non_linear_ai_chat | frontend/src/components/captures/CapturesPanel.tsx | tsx | 26,868 | 25fccc87539dbb2c25cbd62f83c9632f3cab744a5101ae69f5271ae8d5026f56 | /**
* CapturesPanel - Centered dialog for browsing and managing captures
* from the browser extension. Tree-only view grouped by URL.
*/
import React, { useEffect, useRef, useState, useCallback, useMemo, memo } from 'react';
import { createPortal } from 'react-dom';
import {
Globe,
X,
Search,
Trash2,
Exte... |
eren23/non_linear_ai_chat | frontend/src/components/captures/PhotoUploadZone.tsx | tsx | 4,219 | d257dd11ab5bf912de12b54628271fd1de38becdd942cc3bb322bc43600b18f9 | /**
* PhotoUploadZone - Drop zone + file picker for adding photos to captures.
*/
import React, { useState, useRef, useCallback } from 'react';
import { Upload, AlertCircle } from 'lucide-react';
import styles from './PhotoUploadZone.module.css';
const DEFAULT_MAX_FILES = 10;
const DEFAULT_MAX_SIZE_BYTES = 5 * 1024... |
eren23/non_linear_ai_chat | frontend/src/components/captures/SignalsTab.tsx | tsx | 16,587 | 24b66010818970fac42418fabd0ef0e0f90aed42a2bf7e3f1bba3ace6c576334 | /**
* SignalsTab - Admin-only tab within CapturesPanel showing always-on
* browsing signal threads and telemetry.
*
* Sub-views: Threads (default), Daily, Weekly, Settings.
*/
import React, { useCallback, useEffect, useState } from 'react';
import { Loader2, RefreshCw, Settings } from 'lucide-react';
import { for... |
eren23/non_linear_ai_chat | frontend/src/components/captures/__tests__/SignalsTab.test.tsx | tsx | 14,291 | 82909b0e0f83bb5788800e199f13d1d49d93f3bf4284ca1beff5caed4c2de9a0 | // @vitest-environment happy-dom
/**
* Tests for SignalsTab component.
*
* SignalsTab fetches and displays always-on browsing signal threads
* and telemetry data from the capture-signals API. Now includes
* sub-view toggling, enhanced summary stats, revisit badges, and timestamps.
*/
import { describe, it, expec... |
eren23/non_linear_ai_chat | frontend/src/components/captures/__tests__/CaptureEditModal.test.tsx | tsx | 23,156 | 541d7f66f8e64e48fc3fdeb98c635ee0471d4ef57d0031de34142756e18c47ec | // @vitest-environment happy-dom
/**
* Tests for CaptureEditModal component.
*
* CaptureEditModal is a portal-based modal for editing capture title, content, and tags.
* It uses createPortal to render into document.body, so all queries use `screen`
* which searches the entire document rather than the render contai... |
eren23/non_linear_ai_chat | frontend/src/components/captures/__tests__/CapturesPanel.test.tsx | tsx | 51,592 | 78acc6b4e8bfb9da393ccfac43ab300eb1047c4bf9575eeedc93a5058871d85c | // @vitest-environment happy-dom
/**
* Tests for CapturesPanel component.
*
* CapturesPanel is a dialog that displays browser extension captures in a
* tree-only (grouped by URL) view. It uses createPortal to render into
* document.body, so all queries use `screen` which searches the entire
* document rather than... |
eren23/non_linear_ai_chat | frontend/src/components/captures/__tests__/CapturesPanel.security.test.tsx | tsx | 9,640 | 14c3050ae02d38c9f33df73f3d5dc2bf7abecc8956f5810ab6557ca57de260f1 | // @vitest-environment happy-dom
/**
* Frontend security tests for CapturesPanel.
*
* Verifies that XSS vectors in capture data are safely rendered.
* React auto-escapes text content, so these tests confirm
* that malicious payloads appear as plain text and never execute.
*/
import { describe, it, expect, vi, be... |
eren23/non_linear_ai_chat | frontend/src/components/captures/__tests__/CaptureViewer.test.tsx | tsx | 9,774 | c38213b1c1862d717e0cc5d89c883a8ccf13ca5c8d8b7f1d15daf37be446aca3 | // @vitest-environment happy-dom
/**
* Tests for CaptureViewer component.
*
* CaptureViewer is a full-screen viewer rendered via createPortal into
* document.body. It fetches capture data by ID, shows loading/error states,
* and displays the capture's photos, content, and metadata.
*
* Key behaviors tested:
* -... |
eren23/non_linear_ai_chat | frontend/src/components/captures/__tests__/CapturePickerPanel.test.tsx | tsx | 15,356 | b42609d6d97c734741a3a79ab82b9866cfd28de61eaa0e8a0b07fd1c109bdb41 | // @vitest-environment happy-dom
/**
* Tests for CapturePickerPanel component.
*
* CapturePickerPanel is a full-size modal for browsing, searching, and selecting
* captures to import into a node. It renders via createPortal into document.body.
*
* Now uses local state for data fetching (independent from useCaptur... |
eren23/non_linear_ai_chat | frontend/src/components/captures/__tests__/PhotoGallery.test.tsx | tsx | 6,256 | f16b1ff0333f25d4695c085cf6f3a7e66046c9574abc6f5a87869a2ce4d79d5f | // @vitest-environment happy-dom
/**
* Tests for PhotoGallery component.
*
* PhotoGallery renders a CSS grid of photo cards. Clicking a card opens a
* PhotoLightbox overlay. When photos is empty, it shows an empty state message.
*
* Key behaviors tested:
* - Renders grid with correct number of photo items
* - S... |
eren23/non_linear_ai_chat | frontend/src/components/captures/__tests__/PhotoLightbox.test.tsx | tsx | 6,975 | 5647b6a7c9a82c48caff6a1a4d45bf08e9e3cff73f05baa738c97c33edb08949 | // @vitest-environment happy-dom
/**
* Tests for PhotoLightbox component.
*
* PhotoLightbox is a full-viewport overlay rendered via createPortal into
* document.body. It shows the current photo, a counter, prev/next navigation,
* and closes on Escape or backdrop click.
*
* Key behaviors tested:
* - Renders with... |
eren23/non_linear_ai_chat | frontend/src/components/captures/__tests__/PhotoUploadZone.test.tsx | tsx | 12,181 | cf5c6df6b45d57dc1e8d17dc70cc2c14f326134508c133ebcea73071cc914c26 | // @vitest-environment happy-dom
/**
* Tests for PhotoUploadZone component.
*
* PhotoUploadZone provides a drag-and-drop zone and file picker for adding
* photos to captures. It validates file types and sizes before calling
* the onFilesSelected callback.
*
* Key behaviors tested:
* - Renders drop zone with lab... |
eren23/non_linear_ai_chat | frontend/src/components/captures/__tests__/PhotoManager.test.tsx | tsx | 7,120 | 72c0fea959e5608ce5cc1384494c3b894773ba6e3abf8286fe258347b159297e | // @vitest-environment happy-dom
/**
* Tests for PhotoManager component.
*
* PhotoManager is used in the CaptureEditModal for managing photos attached to
* a capture: viewing existing thumbnails, deleting, reordering, and adding new
* photos via PhotoUploadZone.
*
* Key behaviors tested:
* - Renders existing ph... |
eren23/non_linear_ai_chat | frontend/src/components/captures/__tests__/CapturePhotoThumbnail.test.tsx | tsx | 6,043 | 16391909db5be73a4d0cbe7db4b02e97ebdd665ba70756fc8a3f9e21a780d09c | // @vitest-environment happy-dom
/**
* Tests for CapturePhotoThumbnail component.
*
* CapturePhotoThumbnail shows 1-N small thumbnail previews with an optional +N badge
* when there are more photos than maxVisible. It returns null for empty arrays.
*
* Key behaviors tested:
* - Renders correct number of thumbnai... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/GraphLegend.tsx | tsx | 3,214 | 3e2768865f71beb21fc5918de77429c58120dc62dec920bebbe08a4e7c80f528 | /**
* Reusable collapsible legend component for graph visualizations.
*/
import React, { useState } from 'react';
import { ChevronDown, ChevronUp } from 'lucide-react';
import { useTranslation } from '@/i18n/useTranslation';
import styles from './GraphLegend.module.css';
export interface LegendItem {
color: strin... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/GraphQuickChat.tsx | tsx | 9,351 | 4c09579df4214b150e02b456b57c70f1be45268666bcc8f8eb21768d9545e55c | /**
* Graph Quick Chat - Floating chat panel for asking questions about selected graph items.
* Used by both the memory graph and the notes graph; the calling graph maps its nodes to
* a neutral `GraphChatItem` shape so this component stays kind-agnostic.
*/
import React, { useState, useRef, useEffect, useCallback... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/UnifiedKnowledgeGraph.tsx | tsx | 13,891 | c47f1f39ef79a0c9717f8abc8ec49b0d8c232ab905b125bd3fd15726438c01f3 | /**
* UnifiedKnowledgeGraph β Orchestrator for unified notes/captures/documents graph.
* Reuses MemoryGraph2D/3D for rendering, similar pattern to MemoryGraphViewer.
*/
import React, { useState, useEffect, useCallback, useMemo } from 'react';
import { Loader2, Brain, ChevronDown } from 'lucide-react';
import Memory... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/graphQuickChatPrompt.ts | ts | 8,358 | 027f6683305cb72261302c30c137e491436dc7c1f78369ac49ef5b0beb31c35d | import { INPUT_LIMITS } from '@/lib/sanitize';
export type GraphChatKind = 'memory' | 'note';
export interface GraphChatItem {
id: string;
title: string;
body: string;
meta?: string;
}
export interface KindCopy {
singular: string;
plural: string;
blockLabel: string;
connectedBlockLabel: string;
sys... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/GraphSearchBar.tsx | tsx | 5,664 | eb86548b07df437b40b48c902b7ff6db0e825b05d2f67b6acac9f61e65e946a8 | /**
* GraphSearchBar - Shared search bar for graph visualizations.
* Supports fuzzy/AI mode toggle, match navigation, and loading state.
*/
import React, { useCallback, useRef } from 'react';
import { Search, ChevronUp, ChevronDown, X, Loader2 } from 'lucide-react';
import type { SearchMode } from '../../hooks/useG... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/KnowledgeOverview.tsx | tsx | 11,846 | 78c14fd223edc74e3890326908501d86beb608385ad285c901042ed441d3d9af | /**
* KnowledgeOverview - Dashboard showing stats, top topics/people, insights.
*/
import React, { useState, useEffect } from 'react';
import { Loader2, BarChart3, Users, Hash, AlertTriangle, HelpCircle, Network, TrendingUp } from 'lucide-react';
import { getUserTopics, getUserPeople, getGraphStats, getMyInsights } ... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/FlowRelationshipGraph.tsx | tsx | 51,879 | d3cc02f40594019515205092555222ee65b59f85fd28b608d4e61d364166c822 | /**
* FlowRelationshipGraph - Force-directed graph showing relationships between flows.
* Each node is a flow, edges represent shared topics/people.
* Flows can be expanded to reveal internal chat nodes.
*
* Configure-first UX: user picks flows before loading the graph.
*/
import React, { useEffect, useRef, useS... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/MemoryGraph2D.tsx | tsx | 37,547 | 87734f525dcc60d93dad9ccae0bba88a026adf1303f3aa6ab5ea0013363f5690 | /**
* 2D Memory Graph Visualization using D3.js force-directed layout.
* Features: legend, mini-labels, tooltip, search highlight, cluster regions, minimap.
*/
import React, { useEffect, useRef, useState, useMemo, useCallback, useLayoutEffect } from 'react';
import { select, type Selection } from 'd3-selection';
im... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/ItemPicker.tsx | tsx | 4,834 | 3c08f2f5ca1ab331256e0741ac92090b58c1329efd91f73e2603c859e9b9b272 | /**
* ItemPicker β Collapsible panel for selecting individual items to include in the knowledge graph.
*/
import React, { useMemo } from 'react';
import type { KnowledgeItem, KnowledgeContentType } from '../../lib/knowledgeGraphApi';
import { getPrefixedId } from '../../lib/knowledgeGraphUtils';
import { useTranslat... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/MemoryGraph3D.tsx | tsx | 20,285 | db5ecb6803a69c4bbb7fb6bdd68671cd3e69d77a76048175cef1bc1b2c5168a4 | /**
* 3D Memory Graph Visualization using Three.js and react-three-fiber.
* Features: starfield, glow nodes with type labels, tube edges, rich tooltips,
* cluster spheres, and visual parity with the 2D graph.
*/
import React, { useRef, useState, useMemo, useCallback, useEffect } from 'react';
import { Canvas, useF... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/GraphContextMenu.tsx | tsx | 3,267 | 6001e33cf089abe5f95ecde05e28daec0503560b056502b0e5be792a32f24a31 | /**
* Graph Context Menu - Right-click context menu for selected memory graph nodes.
*/
import React, { useEffect, useRef, useCallback } from 'react';
import { MessageSquare, Copy, XCircle } from 'lucide-react';
import { useTranslation } from '@/i18n/useTranslation';
import styles from './GraphContextMenu.module.css... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/MemoryGraphViewer.tsx | tsx | 42,421 | 7e2f96a107860e86ddce0fbd52e6d7155a41ee02462ecd7ee356c3eafd94e3f8 | /**
* Memory Graph Viewer - Main component that combines 2D/3D views with controls.
*/
import React, { useState, useEffect, useMemo, useCallback } from 'react';
import { X, Loader2, Filter, Calendar, TrendingUp, Brain, Tag, ChevronDown, Copy, ChevronUp, ChevronRight, Maximize2, Minimize2, MousePointer2, Search } fro... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/__tests__/GraphSearchBar.test.tsx | tsx | 6,608 | 5a5d52452ae5909bc13d3706b482976bc3742c665ba2383565e67191ebc86e39 | // @vitest-environment happy-dom
/**
* Tests for GraphSearchBar component
*/
import { describe, it, expect, vi } from 'vitest';
import React from 'react';
import { render, screen, fireEvent } from '@testing-library/react';
import GraphSearchBar from '../GraphSearchBar';
// Default props for all tests
const defaultP... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/__tests__/GraphQuickChat.test.tsx | tsx | 12,057 | f6b1b72f9e52af91cc4d238dd8da2212e998a93ea0d865fb9ba2f72ef796e327 | // @vitest-environment happy-dom
/**
* Tests for GraphQuickChat component
*
* GraphQuickChat is a floating chat panel used by both the memory graph and the
* notes graph. It takes a neutral `GraphChatItem[]` context, a `kind` (memory|note),
* and streams an LLM response grounded in the provided items.
*/
import ... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/__tests__/MemoryGraphViewer.test.tsx | tsx | 70,347 | 276979922c00d6508de0fb4380432797cead9218ce3f5366ad98c1dcfcfe2cad | // @vitest-environment happy-dom
/**
* Tests for MemoryGraphViewer component.
*
* MemoryGraphViewer is the main visualization component that combines 2D/3D
* memory graph views with controls for filtering, search, node selection,
* context menus, and quick chat.
*
* Tests cover:
* - Initial render (empty state,... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/__tests__/graphQuickChatPrompt.test.ts | ts | 2,524 | 0564a331b1b87587d872e1519f8a1244a9d87b9f3c48cd97aae4e205f5b17495 | import { describe, it, expect } from 'vitest';
import { INPUT_LIMITS } from '@/lib/sanitize';
import {
buildQuickChatMessages,
GRAPH_QUICK_CHAT_LIMITS,
type GraphChatItem,
} from '../graphQuickChatPrompt';
function makeItem(id: string, label: string, bodyLength: number): GraphChatItem {
return {
id,
... |
eren23/non_linear_ai_chat | frontend/src/components/visualization/__tests__/GraphContextMenu.test.tsx | tsx | 5,193 | dee6c21541926e412384c70b22c77b84f91e96db7dea681c1fd190d93f157e2f | /**
* Tests for GraphContextMenu component
*
* GraphContextMenu is a right-click context menu for selected memory graph nodes.
* It shows actions like Quick Chat, Copy Content, and Clear Selection.
*/
import { describe, it, expect, vi } from 'vitest';
import React from 'react';
describe('GraphContextMenu', () =>... |
eren23/non_linear_ai_chat | frontend/src/components/labs/HtmlCanvasLab/HtmlCanvasFlow.tsx | tsx | 3,112 | 0c7b67ae958dc245e521f3995867dd852f641810298fd5fdd5f78875863c1154 | /**
* Top-level HTML-in-Canvas lab renderer.
*
* This component is the parallel-to-ReactFlow entry point. When labs mode is
* active, App.tsx mounts this INSTEAD of <ReactFlow>. When labs mode is off,
* this component never renders β the normal ReactFlow canvas is used.
*
* Milestone M0: renders a placeholder th... |
eren23/non_linear_ai_chat | frontend/src/components/labs/HtmlCanvasLab/index.ts | ts | 537 | bdb1a672cbb7912966c980e329683094069bf37231e48330d8cc1980b32bdef6 | /**
* Public exports for the HTML-in-Canvas Labs module.
*
* Everything else under this directory is implementation detail of the
* experimental parallel-to-ReactFlow renderer.
*/
export { HtmlCanvasFlow } from './HtmlCanvasFlow';
export { useLabsCapabilities } from './capability/useLabsCapabilities';
export { de... |
eren23/non_linear_ai_chat | frontend/src/components/labs/HtmlCanvasLab/settings/LabsSettingsSection.tsx | tsx | 4,507 | 2bbaa1eb2c44c8a285e11c787558be849b8ad74c830d856c6edff4f40e1121d4 | /**
* Settings UI for the HTML-in-Canvas Labs module.
*
* Rendered inside SettingsPanel's existing "Advanced" category. Renders
* nothing when the browser doesn't expose the WICG draw-element API, so
* users without Chromium + the flag never see a broken toggle.
*/
import { FlaskConical } from 'lucide-react';
im... |
eren23/non_linear_ai_chat | frontend/src/components/labs/HtmlCanvasLab/capability/useLabsCapabilities.ts | ts | 1,595 | 5c00a8cfa8a76c0478564c3a4c2bc055c8c76623d5e79a1233d3bc4fe7db3977 | /**
* React hook wrapping the HTML-in-Canvas capability detector.
*
* Returns a stable, memoized CapabilityReport for the lifetime of the page.
* Detection is cheap and runs at most once per session thanks to the
* module-level cache in `detectCanvasDrawElement`.
*
* Dev override: appending `?lab-force=1` to the... |
eren23/non_linear_ai_chat | frontend/src/components/labs/HtmlCanvasLab/capability/detectCanvasDrawElement.ts | ts | 3,015 | 6fb8462f94587e7355f7037dbbfb3f90814850035747ef04cdfbc2c218b1ae27 | /**
* Runtime feature detection for the experimental WICG HTML-in-Canvas API.
*
* Spec: https://github.com/WICG/html-in-canvas
* Currently flag-gated in Chromium: chrome://flags/#canvas-draw-element
*
* The API requires three coordinated primitives:
* 1. `CanvasRenderingContext2D.prototype.drawElementImage(el,... |
eren23/non_linear_ai_chat | frontend/src/components/labs/HtmlCanvasLab/__tests__/detectCanvasDrawElement.test.ts | ts | 5,199 | eca92ff8e068519878ebacc056266c872d58db4e31379180abe5798cd27f07cd | /**
* Tests for the WICG HTML-in-Canvas capability detector.
*
* The detector checks whether the browser exposes:
* - `CanvasRenderingContext2D.prototype.drawElementImage`
* - `HTMLCanvasElement.prototype.requestPaint`
* - The `layoutsubtree` attribute on HTMLCanvasElement
*
* Since the API is behind a Ch... |
eren23/non_linear_ai_chat | frontend/src/components/labs/HtmlCanvasLab/__tests__/LabsSettingsSection.test.tsx | tsx | 4,494 | dc5aca1a63f447eade915bfbb9dafe2047832f427fc9513c06d59fa762293a29 | /**
* @vitest-environment happy-dom
*
* Smoke tests for LabsSettingsSection.
*
* The section has two behaviors we care about at M0:
* 1. It renders NOTHING when the browser doesn't expose the WICG API.
* This is the "hidden fallback" that protects users without the flag.
* 2. When the API is present, i... |
eren23/non_linear_ai_chat | frontend/src/components/labs/HtmlCanvasLab/__tests__/LabCanvasRoot.test.tsx | tsx | 4,786 | 8cd376ca589d0b5644cc11c4fcc842187c14d64a5b66b45eb51514d53b2ebcfb | /**
* @vitest-environment happy-dom
*
* Tests for LabCanvasRoot β the M1 "hello world" canvas host.
*
* We can't call the real WICG API in happy-dom, so we:
* 1. Stub drawElementImage and requestPaint on the canvas prototype
* BEFORE the component mounts.
* 2. Render the component.
* 3. Assert that ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.