Skip to content

Commit 342c17a

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(knowledge): keep resource imports direct on list routes
1 parent ef993ec commit 342c17a

5 files changed

Lines changed: 64 additions & 54 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/document.tsx‎

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,36 @@ import { getDocumentIcon } from '@/components/icons/document-icons'
3131
import { getDocumentIndexingStatus } from '@/lib/knowledge/documents/types'
3232
import type { ChunkData } from '@/lib/knowledge/types'
3333
import { formatTokenCount } from '@/lib/tokenization'
34-
import type {
35-
BreadcrumbItem,
36-
FilterTag,
37-
PaginationConfig,
38-
ResourceAction,
39-
ResourceColumn,
40-
ResourceRow,
41-
SearchConfig,
42-
SelectableConfig,
43-
SortConfig,
44-
} from '@/app/workspace/[workspaceId]/components'
45-
import {
46-
EMPTY_CELL_PLACEHOLDER,
47-
Resource,
48-
SearchHighlight,
49-
} from '@/app/workspace/[workspaceId]/components'
5034
import {
5135
FOLDERED_RESOURCE_HEADERS,
5236
folderBreadcrumbItems,
5337
folderedResourceListHref,
5438
useFolderAncestors,
5539
} from '@/app/workspace/[workspaceId]/components/folders'
40+
import type {
41+
BreadcrumbItem,
42+
ResourceAction,
43+
} from '@/app/workspace/[workspaceId]/components/resource/components/resource-header'
44+
import type {
45+
FilterTag,
46+
SearchConfig,
47+
SortConfig,
48+
} from '@/app/workspace/[workspaceId]/components/resource/components/resource-options'
5649
import {
5750
ResourceFilterPanel,
5851
ResourceFilterSection,
5952
} from '@/app/workspace/[workspaceId]/components/resource/components/resource-options'
53+
import type {
54+
PaginationConfig,
55+
ResourceColumn,
56+
ResourceRow,
57+
SelectableConfig,
58+
} from '@/app/workspace/[workspaceId]/components/resource/resource'
59+
import {
60+
EMPTY_CELL_PLACEHOLDER,
61+
Resource,
62+
} from '@/app/workspace/[workspaceId]/components/resource/resource'
63+
import { SearchHighlight } from '@/app/workspace/[workspaceId]/components/search-highlight/search-highlight'
6064
import {
6165
ChunkContextMenu,
6266
ChunkEditor,

‎apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,29 +59,31 @@ import type { DocumentData } from '@/lib/knowledge/types'
5959
import { captureEvent } from '@/lib/posthog/client'
6060
import { formatFileSize } from '@/lib/uploads/utils/file-utils'
6161
import { SEARCH_DEBOUNCE_MS } from '@/lib/url-state'
62-
import type {
63-
BreadcrumbItem,
64-
FilterTag,
65-
ResourceAction,
66-
ResourceCell,
67-
ResourceRow,
68-
SelectableConfig,
69-
SortConfig,
70-
} from '@/app/workspace/[workspaceId]/components'
71-
import {
72-
FILTER_SECTION_LABEL_CLASS,
73-
FloatingOverflowText,
74-
isResourceListEmpty,
75-
Resource,
76-
SearchHighlight,
77-
} from '@/app/workspace/[workspaceId]/components'
7862
import {
7963
FOLDERED_RESOURCE_HEADERS,
8064
folderBreadcrumbItems,
8165
folderedResourceListHref,
8266
useFolderAncestors,
8367
} from '@/app/workspace/[workspaceId]/components/folders'
68+
import { FloatingOverflowText } from '@/app/workspace/[workspaceId]/components/resource/components/floating-overflow-text'
8469
import { DocumentsEmptyState } from '@/app/workspace/[workspaceId]/components/resource/components/resource-empty-state'
70+
import type {
71+
BreadcrumbItem,
72+
ResourceAction,
73+
} from '@/app/workspace/[workspaceId]/components/resource/components/resource-header'
74+
import type {
75+
FilterTag,
76+
SortConfig,
77+
} from '@/app/workspace/[workspaceId]/components/resource/components/resource-options'
78+
import { FILTER_SECTION_LABEL_CLASS } from '@/app/workspace/[workspaceId]/components/resource/components/resource-options'
79+
import { isResourceListEmpty } from '@/app/workspace/[workspaceId]/components/resource/is-resource-list-empty'
80+
import type {
81+
ResourceCell,
82+
ResourceRow,
83+
SelectableConfig,
84+
} from '@/app/workspace/[workspaceId]/components/resource/resource'
85+
import { Resource } from '@/app/workspace/[workspaceId]/components/resource/resource'
86+
import { SearchHighlight } from '@/app/workspace/[workspaceId]/components/search-highlight/search-highlight'
8587
/**
8688
* Deep import on purpose: the `[documentId]/components` barrel also exports `ChunkEditor`,
8789
* which needs exact token counts and therefore `js-tiktoken` (~2.5 MB gzip of BPE rank

‎apps/sim/app/workspace/[workspaceId]/knowledge/[id]/document-columns.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ResourceColumn } from '@/app/workspace/[workspaceId]/components'
1+
import type { ResourceColumn } from '@/app/workspace/[workspaceId]/components/resource/resource'
22

33
export const DOCUMENT_COLUMNS: ResourceColumn[] = [
44
{ id: 'name', header: 'Name', widthMultiplier: 0.8 },

‎apps/sim/app/workspace/[workspaceId]/knowledge/components/knowledge-filter-heading.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Button } from '@sim/emcn'
2-
import { FILTER_SECTION_LABEL_CLASS } from '@/app/workspace/[workspaceId]/components'
2+
import { FILTER_SECTION_LABEL_CLASS } from '@/app/workspace/[workspaceId]/components/resource/components/resource-options'
33

44
interface KnowledgeFilterHeadingProps {
55
title: string

‎apps/sim/app/workspace/[workspaceId]/knowledge/knowledge.tsx‎

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,6 @@ import { useQueryStates } from 'nuqs'
1111
import { MAX_KNOWLEDGE_BATCH_ITEMS } from '@/lib/knowledge/constants'
1212
import type { KnowledgeBaseData } from '@/lib/knowledge/types'
1313
import { SEARCH_DEBOUNCE_MS } from '@/lib/url-state'
14-
import type {
15-
BreadcrumbItem,
16-
FilterTag,
17-
ResourceAction,
18-
ResourceCell,
19-
ResourceColumn,
20-
ResourceRow,
21-
SearchConfig,
22-
SortConfig,
23-
} from '@/app/workspace/[workspaceId]/components'
24-
import {
25-
EMPTY_CELL_PLACEHOLDER,
26-
ownerCell,
27-
Resource,
28-
reportBulkOutcome,
29-
resourceListState,
30-
selectionLabel,
31-
timeCell,
32-
useResourceRowSelection,
33-
} from '@/app/workspace/[workspaceId]/components'
3414
import type {
3515
MoveOptionNode,
3616
SortableResource,
@@ -57,11 +37,35 @@ import {
5737
useFolderNavigation,
5838
useFolderRowDragDrop,
5939
} from '@/app/workspace/[workspaceId]/components/folders'
40+
import { reportBulkOutcome } from '@/app/workspace/[workspaceId]/components/resource/bulk-outcome'
6041
import { ResourceActionBar } from '@/app/workspace/[workspaceId]/components/resource/components/action-bar'
42+
import { ownerCell } from '@/app/workspace/[workspaceId]/components/resource/components/owner-cell'
6143
import {
6244
KnowledgeEmptyState,
6345
ResourceNoResults,
6446
} from '@/app/workspace/[workspaceId]/components/resource/components/resource-empty-state'
47+
import type {
48+
BreadcrumbItem,
49+
ResourceAction,
50+
} from '@/app/workspace/[workspaceId]/components/resource/components/resource-header'
51+
import type {
52+
FilterTag,
53+
SearchConfig,
54+
SortConfig,
55+
} from '@/app/workspace/[workspaceId]/components/resource/components/resource-options'
56+
import { timeCell } from '@/app/workspace/[workspaceId]/components/resource/components/time-cell'
57+
import { resourceListState } from '@/app/workspace/[workspaceId]/components/resource/is-resource-list-empty'
58+
import type {
59+
ResourceCell,
60+
ResourceColumn,
61+
ResourceRow,
62+
} from '@/app/workspace/[workspaceId]/components/resource/resource'
63+
import {
64+
EMPTY_CELL_PLACEHOLDER,
65+
Resource,
66+
} from '@/app/workspace/[workspaceId]/components/resource/resource'
67+
import { selectionLabel } from '@/app/workspace/[workspaceId]/components/resource/selection-label'
68+
import { useResourceRowSelection } from '@/app/workspace/[workspaceId]/components/resource/use-resource-row-selection'
6569
import { BaseTagsModal } from '@/app/workspace/[workspaceId]/knowledge/[id]/components/base-tags-modal'
6670
import {
6771
CreateBaseModal,

0 commit comments

Comments
 (0)