Skip to content

Commit 37519d4

Browse files
committed
refactor(resources): take the last cross-tree edges out of the canonical units
`components/resources/**` no longer imports from `app/workspace/[workspaceId]/**` at all. Three edges remained after the table migration, all in the file view's collaboration layer, and both targets were already shared across trees rather than route-specific: - `presence-avatars` -> `components/presence/`. Its own doc said "shared by workflow and files"; it had five consumers across three trees and imports nothing workspace-specific. - `untitled-title` -> `lib/uploads/utils/`. Pure string helpers over a file name, imported by the files page and the markdown editor. Both are pure `git mv` — the diff is three renames with zero content change, and every consumer moved to the new specifier. R3b drops 41 -> 38. The remainder is not this branch's: it is `ee/**` and `components/settings/**` importing the shared settings chrome that lives under `app/workspace/[workspaceId]/settings/components`. 30 of those predate this branch and 8 arrived with the staging merge. Relocating that chrome is a real change to a dozen EE surfaces and belongs in its own PR — but no canonical resource view depends on it any more, which was the point of the rule.
1 parent f89a6f5 commit 37519d4

11 files changed

Lines changed: 13 additions & 12 deletions

File tree

apps/sim/app/workspace/[workspaceId]/files/files.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ import {
5050
isAudioFileType,
5151
isVideoFileType,
5252
} from '@/lib/uploads/utils/file-utils'
53+
import {
54+
DEFAULT_UNTITLED_NAME,
55+
deriveMarkdownFileName,
56+
isUntitledName,
57+
uniqueMarkdownName,
58+
} from '@/lib/uploads/utils/untitled-title'
5359
import {
5460
isSupportedExtension,
5561
SUPPORTED_AUDIO_EXTENSIONS,
@@ -94,12 +100,6 @@ import {
94100
filesSortParams,
95101
filesUrlKeys,
96102
} from '@/app/workspace/[workspaceId]/files/search-params'
97-
import {
98-
DEFAULT_UNTITLED_NAME,
99-
deriveMarkdownFileName,
100-
isUntitledName,
101-
uniqueMarkdownName,
102-
} from '@/app/workspace/[workspaceId]/files/untitled-title'
103103
import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
104104
import { useContextMenu } from '@/app/workspace/[workspaceId]/w/components/sidebar/hooks'
105105
import { usePinItem, usePinnedIds, useUnpinItem } from '@/hooks/queries/pinned-items'

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/hooks/use-table-room.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
type TablePresenceUser,
1313
} from '@sim/realtime-protocol/table-presence'
1414
import { generateShortId } from '@sim/utils/id'
15-
import type { PresenceAvatarUser } from '@/app/workspace/[workspaceId]/components/presence/presence-avatars'
15+
import type { PresenceAvatarUser } from '@/components/presence'
1616
import { useSocket } from '@/app/workspace/providers/socket-provider'
1717

1818
const logger = createLogger('TableRoom')

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { getErrorMessage } from '@sim/utils/errors'
88
import { useRouter } from 'next/navigation'
99
import { useQueryStates } from 'nuqs'
1010
import { usePostHog } from 'posthog-js/react'
11+
import { PresenceAvatars } from '@/components/presence'
1112
import {
1213
COLUMN_SIDEBAR_WIDTH,
1314
columnTypeIcon,
@@ -33,7 +34,6 @@ import {
3334
Resource,
3435
type SortConfig,
3536
} from '@/app/workspace/[workspaceId]/components'
36-
import { PresenceAvatars } from '@/app/workspace/[workspaceId]/components/presence/presence-avatars'
3737
import { LogDetails } from '@/app/workspace/[workspaceId]/logs/components'
3838
import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
3939
import { ImportCsvDialog } from '@/app/workspace/[workspaceId]/tables/components/import-csv-dialog'

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/workflow-item/avatars/avatars.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

33
import { useMemo } from 'react'
4-
import { PresenceAvatars } from '@/app/workspace/[workspaceId]/components/presence/presence-avatars'
4+
import { PresenceAvatars } from '@/components/presence'
55
import { useSocket } from '@/app/workspace/providers/socket-provider'
66
import { SIDEBAR_WIDTH } from '@/stores/constants'
77
import { usePresenceStore } from '@/stores/presence/store'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { PresenceAvatars, type PresenceAvatarUser } from './presence-avatars'

apps/sim/app/workspace/[workspaceId]/components/presence/presence-avatars.tsx renamed to apps/sim/components/presence/presence-avatars.tsx

File renamed without changes.

apps/sim/components/resources/file-view/components/rich-markdown-editor/collaboration/file-doc-avatars.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { PresenceAvatars } from '@/app/workspace/[workspaceId]/components/presence/presence-avatars'
3+
import { PresenceAvatars } from '@/components/presence'
44
import { useFileDocOthers } from './file-doc-room-context'
55

66
/**

apps/sim/components/resources/file-view/components/rich-markdown-editor/collaboration/file-doc-room-context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

33
import { createContext, type ReactNode, useContext, useState } from 'react'
4-
import type { PresenceAvatarUser } from '@/app/workspace/[workspaceId]/components/presence/presence-avatars'
4+
import type { PresenceAvatarUser } from '@/components/presence'
55

66
const EMPTY_OTHERS: PresenceAvatarUser[] = []
77
const noop = () => {}

apps/sim/components/resources/file-view/components/rich-markdown-editor/rich-markdown-editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { useEditableFileContent } from '@/components/resources/file-view/hooks/u
1919
import { useResourceOfKind } from '@/components/resources/resource-provider'
2020
import { useSession } from '@/lib/auth/auth-client'
2121
import { extractEmbeddedFileRef } from '@/lib/uploads/utils/embedded-image-ref'
22-
import { isUntitledName } from '@/app/workspace/[workspaceId]/files/untitled-title'
22+
import { isUntitledName } from '@/lib/uploads/utils/untitled-title'
2323
import { useUploadWorkspaceFile } from '@/hooks/queries/workspace-files'
2424
import type { SaveStatus } from '@/hooks/use-autosave'
2525
import { type FileViewRecord, fileImageSrc, fileWorkspaceId } from '@/resources/file-source'

apps/sim/app/workspace/[workspaceId]/files/untitled-title.test.ts renamed to apps/sim/lib/uploads/utils/untitled-title.test.ts

File renamed without changes.

0 commit comments

Comments
 (0)