mirror of
https://github.com/stablyai/orca.git
synced 2026-10-07 00:02:29 +00:00
Group CSV editor modules and tests in their own folder (#25476)
This commit is contained in:
@@ -5375,7 +5375,7 @@
|
||||
"src/renderer/src/components/editor/combined-diff/scroll-viewport/combined-diff-restore-signal-equivalence.test.tsx": 552,
|
||||
"src/renderer/src/components/editor/combined-diff/scroll-viewport/combined-diff-scrollbar-drag.test.ts": 59,
|
||||
"src/renderer/src/components/editor/conflict-review-file-tree-windowing.test.tsx": 2238,
|
||||
"src/renderer/src/components/editor/csv-parse.test.ts": 122,
|
||||
"src/renderer/src/components/editor/csv/csv-parse.test.ts": 122,
|
||||
"src/renderer/src/components/editor/details-markdown-html.test.ts": 99,
|
||||
"src/renderer/src/components/editor/diff-editor-hide-unchanged-options.test.ts": 35,
|
||||
"src/renderer/src/components/editor/diff-editor-line-number-options.test.ts": 48,
|
||||
|
||||
+3
-3
@@ -4,12 +4,12 @@ import { translate } from '@/i18n/i18n'
|
||||
import { detectCsvDelimiter } from './csv-parse'
|
||||
import { CsvFooter, csvChosenDelimiter } from './CsvViewer'
|
||||
import { CsvGrid } from './CsvGrid'
|
||||
import type { CsvFilePreview } from './editor-csv-file-content'
|
||||
import type { CsvFilePreview } from './csv-file-content'
|
||||
import type { CsvDelimiterChoice } from './csv-delimiter-picker'
|
||||
import { useCsvPagedPreview } from './useCsvPagedPreview'
|
||||
import { EditorFileLoadErrorView } from './EditorFileLoadErrorView'
|
||||
import { EditorFileLoadErrorView } from '../EditorFileLoadErrorView'
|
||||
import { useCsvColumnWidths } from './useCsvColumnWidths'
|
||||
import { buildFileViewPreferenceKey } from './file-view-preference-storage'
|
||||
import { buildFileViewPreferenceKey } from '../file-view-preference-storage'
|
||||
import { openCsvHttpLink } from './csv-link-routing'
|
||||
|
||||
export default function CsvPagedViewer({
|
||||
+2
-2
@@ -5,9 +5,9 @@ import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import CsvViewer from './CsvViewer'
|
||||
import { useCsvTableEditor } from './useCsvTableEditor'
|
||||
import { parseCsvTextDocument } from './csv-text-document'
|
||||
import { flushPendingEditorChange, hasPendingEditorChange } from './editor-pending-flush'
|
||||
import { flushPendingEditorChange, hasPendingEditorChange } from '../editor-pending-flush'
|
||||
import { APP_MENU_PASTE_EVENT } from '@/lib/app-menu-paste'
|
||||
import { ORCA_EDITOR_FILE_SAVED_EVENT } from './editor-autosave'
|
||||
import { ORCA_EDITOR_FILE_SAVED_EVENT } from '../editor-autosave'
|
||||
|
||||
vi.mock('@tanstack/react-virtual', () => ({
|
||||
useVirtualizer: ({
|
||||
+1
-1
@@ -10,7 +10,7 @@ import { useCsvTableEditor } from './useCsvTableEditor'
|
||||
import { CsvTableToolbar } from './CsvTableToolbar'
|
||||
import { remapCsvColumnWidths } from './csv-column-width-preferences'
|
||||
import { useCsvColumnWidths } from './useCsvColumnWidths'
|
||||
import { buildFileViewPreferenceKey } from './file-view-preference-storage'
|
||||
import { buildFileViewPreferenceKey } from '../file-view-preference-storage'
|
||||
|
||||
export default function CsvViewer({
|
||||
content,
|
||||
+2
-2
@@ -2,9 +2,9 @@ import {
|
||||
CLIPBOARD_TEXT_WRITE_MAX_BYTES,
|
||||
assertClipboardTextWithinLimit,
|
||||
assertClipboardTextWriteWithinLimit
|
||||
} from '../../../../shared/clipboard-text'
|
||||
} from '../../../../../shared/clipboard-text'
|
||||
import { CSV_MAX_COLUMNS, CSV_RECORD_BYTES } from './csv-byte-index'
|
||||
import { measureUtf8ByteLength } from '../../../../shared/utf8-byte-limits'
|
||||
import { measureUtf8ByteLength } from '../../../../../shared/utf8-byte-limits'
|
||||
import { parseCsv } from './csv-parse'
|
||||
import { serializeCsvRecord } from './csv-serialization'
|
||||
import { csvSelectionBounds, type CsvCellSelection } from './csv-cell-selection'
|
||||
+1
-1
@@ -6,7 +6,7 @@ import {
|
||||
writeCsvColumnWidths,
|
||||
remapCsvColumnWidths
|
||||
} from './csv-column-width-preferences'
|
||||
import { buildFileViewPreferenceKey } from './file-view-preference-storage'
|
||||
import { buildFileViewPreferenceKey } from '../file-view-preference-storage'
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { CSV_MAX_COLUMNS } from './csv-byte-index'
|
||||
import { CSV_MAX_COLUMN_WIDTH, CSV_MIN_COLUMN_WIDTH } from './csv-column-width-limits'
|
||||
import { readFileViewPreference, writeFileViewPreference } from './file-view-preference-storage'
|
||||
import { readFileViewPreference, writeFileViewPreference } from '../file-view-preference-storage'
|
||||
import type { CsvTableMutation } from './csv-text-document'
|
||||
|
||||
export const CSV_COLUMN_WIDTHS_STORAGE_KEY = 'orca.csv.column-widths.v1'
|
||||
+1
-1
@@ -4,7 +4,7 @@ import {
|
||||
statRuntimeReadTarget,
|
||||
type RuntimeFileSnapshot
|
||||
} from '@/runtime/runtime-file-range-client'
|
||||
import type { FileContent } from './editor-panel-content-types'
|
||||
import type { FileContent } from '../editor-panel-content-types'
|
||||
|
||||
import { CSV_PAGED_PREVIEW_BYTES } from './csv-file-limits'
|
||||
export { CSV_PAGED_PREVIEW_BYTES } from './csv-file-limits'
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { getConnectionIdForFile } from '@/lib/connection-context'
|
||||
import { openHttpLink, type HttpLinkSourceOwner } from '@/lib/http-link-routing'
|
||||
import { resolveMarkdownPreviewHttpOpenOptions } from './markdown-preview-links'
|
||||
import { resolveMarkdownPreviewHttpOpenOptions } from '../markdown-preview-links'
|
||||
|
||||
export function openCsvHttpLink(
|
||||
url: string,
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { MAX_FILE_RANGE_READ_BYTES } from '../../../../shared/file-range-read'
|
||||
import { MAX_FILE_RANGE_READ_BYTES } from '../../../../../shared/file-range-read'
|
||||
import { readRuntimeFileRange, statRuntimeReadTarget } from '@/runtime/runtime-file-range-client'
|
||||
import type { CsvFilePreview } from './editor-csv-file-content'
|
||||
import type { CsvFilePreview } from './csv-file-content'
|
||||
import {
|
||||
CSV_MAX_PAGE_BYTES,
|
||||
csvPageForRow,
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
import { afterEach, expect, it, vi } from 'vitest'
|
||||
import { createEditorSaveQueue } from './editor-save-queue'
|
||||
import { registerPendingEditorFlush } from './editor-pending-flush'
|
||||
import { createEditorSaveQueue } from '../editor-save-queue'
|
||||
import { registerPendingEditorFlush } from '../editor-pending-flush'
|
||||
import {
|
||||
createEditorStore,
|
||||
stubEditorWindowWithDisk
|
||||
} from './editor-autosave-controller-test-fixture'
|
||||
} from '../editor-autosave-controller-test-fixture'
|
||||
|
||||
afterEach(() => vi.unstubAllGlobals())
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// @vitest-environment happy-dom
|
||||
import { expect, it, vi } from 'vitest'
|
||||
import { createEditorStore } from '@/store/slices/editor-slice-test-harness'
|
||||
import { createEditorSaveQueue } from './editor-save-queue'
|
||||
import { canAutoSaveOpenFile } from './editor-autosave'
|
||||
import { createEditorSaveQueue } from '../editor-save-queue'
|
||||
import { canAutoSaveOpenFile } from '../editor-autosave'
|
||||
|
||||
const { writeFile } = vi.hoisted(() => ({ writeFile: vi.fn() }))
|
||||
vi.mock('@/runtime/runtime-file-client', () => ({ writeRuntimeFile: writeFile }))
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { measureUtf8ByteLength } from '../../../../shared/utf8-byte-limits'
|
||||
import { measureUtf8ByteLength } from '../../../../../shared/utf8-byte-limits'
|
||||
import { assertCsvTableEditBytes } from './csv-table-edit-budget'
|
||||
import { CSV_RECORD_BYTES } from './csv-byte-index'
|
||||
import { csvRecordTokens } from './csv-source-record'
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { measureUtf8ByteLength } from '../../../../shared/utf8-byte-limits'
|
||||
import { measureUtf8ByteLength } from '../../../../../shared/utf8-byte-limits'
|
||||
import { parseCsv } from './csv-parse'
|
||||
import { CSV_MAX_COLUMNS, CSV_RECORD_BYTES } from './csv-byte-index'
|
||||
import { assertCsvTableEditBytes } from './csv-table-edit-budget'
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import type { CsvFilePreview } from './editor-csv-file-content'
|
||||
import type { CsvFilePreview } from './csv-file-content'
|
||||
import { CsvPagedPreview } from './csv-paged-preview'
|
||||
import type { CsvIndex } from './csv-byte-index'
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { useCallback, useEffect, useLayoutEffect, useRef, type RefObject } from 'react'
|
||||
import { registerPendingEditorFlush } from './editor-pending-flush'
|
||||
import { ORCA_EDITOR_FILE_SAVED_EVENT } from './editor-autosave'
|
||||
import { registerPendingEditorFlush } from '../editor-pending-flush'
|
||||
import { ORCA_EDITOR_FILE_SAVED_EVENT } from '../editor-autosave'
|
||||
import type { CsvTextDocument } from './csv-text-document'
|
||||
import { editCsvTextCells } from './csv-text-cell-edits'
|
||||
import type { CsvCellEditSession } from './csv-grid-interaction'
|
||||
@@ -12,6 +12,6 @@ export const MarkdownPreview = lazy(() => import('./MarkdownPreview'))
|
||||
export const ImageViewer = lazy(() => import('./ImageViewer'))
|
||||
export const ImageDiffViewer = lazy(() => import('./ImageDiffViewer'))
|
||||
export const MermaidViewer = lazy(() => import('./MermaidViewer'))
|
||||
export const CsvViewer = lazy(() => import('./CsvViewer'))
|
||||
export const CsvPagedViewer = lazy(() => import('./CsvPagedViewer'))
|
||||
export const CsvViewer = lazy(() => import('./csv/CsvViewer'))
|
||||
export const CsvPagedViewer = lazy(() => import('./csv/CsvPagedViewer'))
|
||||
export const IpynbViewer = lazy(() => import('./IpynbViewer'))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GitDiffResult } from '../../../../shared/git-diff-compare-types'
|
||||
import type { CsvFilePreview } from './editor-csv-file-content'
|
||||
import type { CsvFilePreview } from './csv/csv-file-content'
|
||||
|
||||
/**
|
||||
* Thrown when a worktree's host owner is not yet known (the backing repo has
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getConnectionIdForFile, isWorktreeConnectionResolved } from '@/lib/conn
|
||||
import { useAppStore } from '@/store'
|
||||
import { getDiskBaselineSignature } from './diff-content-signature'
|
||||
import { getRuntimeFileReadScope } from '@/runtime/runtime-file-client'
|
||||
import { readEditorCsvFileContent } from './editor-csv-file-content'
|
||||
import { readEditorCsvFileContent } from './csv/csv-file-content'
|
||||
import { RuntimeRpcCallError, settingsForRuntimeOwner } from '@/runtime/runtime-rpc-client'
|
||||
import { findWorkspaceFileRoute } from '@/lib/runtime-workspace-file-route'
|
||||
import { selectWorktreeHostConnectionPhase } from '@/lib/worktree-host-connection-phase'
|
||||
|
||||
@@ -3,7 +3,7 @@ import { readRuntimeFileRange, statRuntimeReadTarget } from './runtime-file-rang
|
||||
import {
|
||||
readEditorCsvFileContent,
|
||||
CSV_PAGED_PREVIEW_BYTES
|
||||
} from '../components/editor/editor-csv-file-content'
|
||||
} from '../components/editor/csv/csv-file-content'
|
||||
import {
|
||||
fsReadFile,
|
||||
fsReadFileChunk,
|
||||
|
||||
Reference in New Issue
Block a user