diff --git a/packages/app/src/composables/useSpecFilter.ts b/packages/app/src/composables/useSpecFilter.ts
index af2acd4ea05f..3ba862083598 100644
--- a/packages/app/src/composables/useSpecFilter.ts
+++ b/packages/app/src/composables/useSpecFilter.ts
@@ -25,7 +25,6 @@ export function useSpecFilter (savedFilter?: string) {
function setSpecFilter (specFilter: string) {
if (specStore.specFilter !== specFilter) {
- specStore.setSpecFilter(specFilter)
saveSpecFilter.executeMutation({ value: JSON.stringify({ specFilter }) })
}
}
diff --git a/packages/app/src/runs/RunsError.spec.tsx b/packages/app/src/runs/RunsError.cy.tsx
similarity index 100%
rename from packages/app/src/runs/RunsError.spec.tsx
rename to packages/app/src/runs/RunsError.cy.tsx
diff --git a/packages/app/src/specs/InlineSpecList.vue b/packages/app/src/specs/InlineSpecList.vue
index 7a919705312c..8a7c0d447482 100644
--- a/packages/app/src/specs/InlineSpecList.vue
+++ b/packages/app/src/specs/InlineSpecList.vue
@@ -29,7 +29,7 @@ import InlineSpecListHeader from './InlineSpecListHeader.vue'
import InlineSpecListTree from './InlineSpecListTree.vue'
import CreateSpecModal from './CreateSpecModal.vue'
import { fuzzySortSpecs, makeFuzzyFoundSpec, useCachedSpecs } from './spec-utils'
-import type { FuzzyFoundSpec } from './spec-utils'
+import type { FuzzyFoundSpec } from './tree/useCollapsibleTree'
import { useSpecFilter } from '../composables/useSpecFilter'
gql`
diff --git a/packages/app/src/specs/InlineSpecListTree.cy.tsx b/packages/app/src/specs/InlineSpecListTree.cy.tsx
index e00e667f43c6..cd9dca57d29c 100644
--- a/packages/app/src/specs/InlineSpecListTree.cy.tsx
+++ b/packages/app/src/specs/InlineSpecListTree.cy.tsx
@@ -1,7 +1,7 @@
-import type { FuzzyFoundSpec } from './spec-utils'
import { ref } from 'vue'
import { useSpecStore } from '../store'
import InlineSpecListTree from './InlineSpecListTree.vue'
+import type { FuzzyFoundSpec } from './tree/useCollapsibleTree'
describe('InlineSpecListTree', () => {
let foundSpecs: FuzzyFoundSpec[]
diff --git a/packages/app/src/specs/InlineSpecListTree.vue b/packages/app/src/specs/InlineSpecListTree.vue
index 35d2d9b9ed82..ed70d402494d 100644
--- a/packages/app/src/specs/InlineSpecListTree.vue
+++ b/packages/app/src/specs/InlineSpecListTree.vue
@@ -60,17 +60,14 @@
diff --git a/packages/frontend-shared/src/composables/useCollapsibleTree.ts b/packages/frontend-shared/src/composables/useCollapsibleTree.ts
deleted file mode 100644
index 119523bc18c9..000000000000
--- a/packages/frontend-shared/src/composables/useCollapsibleTree.ts
+++ /dev/null
@@ -1,135 +0,0 @@
-import type { ComputedRef, Ref } from 'vue'
-import { computed } from 'vue'
-import { useToggle } from '@vueuse/core'
-
-export type RawNode = {
- id: string
- name: string
- children: RawNode[]
-}
-
-export type UseCollapsibleTreeNode > = {
- // control open/close state
- hidden: ComputedRef
- expanded: Ref
- toggle: () => void
-
- // Depth of a particular node -- 1 indexed
- depth: number
-
- parent?: UseCollapsibleTreeNode
- children: UseCollapsibleTreeNode[]
-} & { [K in keyof T]: T[K]}
-
-export interface UseCollapsibleTreeOptions {
- expandInitially?: boolean
- dropRoot?: boolean
- /**
- * Provide a long-lived cache to preserve directory collapse state across tree re-builds.
- * This can be useful when row data is updating but doesn't represent a change to the
- * structure of the tree.
- */
- cache?: Map
-}
-
-function collectRoots> (node: UseCollapsibleTreeNode | null, acc: UseCollapsibleTreeNode[] = []) {
- if (!node || !node.parent) {
- return acc
- }
-
- acc.push(node)
-
- collectRoots(node.parent, acc)
-
- return acc
-}
-
-export const useCollapsibleTreeNode = >(rawNode: T, options: UseCollapsibleTreeOptions, depth: number, parent: UseCollapsibleTreeNode | null): UseCollapsibleTreeNode => {
- const { cache, expandInitially } = options
- const treeNode = rawNode as UseCollapsibleTreeNode
- const roots = parent ? collectRoots(parent) : []
- const [expanded, toggle] = useToggle(cache?.get(rawNode.id) ?? !!expandInitially)
-
- const hidden = computed(() => {
- return !!roots.find((r) => r.expanded.value === false)
- })
-
- const wrappedToggle = (value?: boolean): boolean => {
- const originalState = expanded.value
- const newValue = toggle(value)
-
- // If this is a non-hidden directory then watch for expansion changes and register them into the cache if one was provided
- if (!!cache && !hidden.value && rawNode.children?.length) {
- cache.set(rawNode.id, !originalState)
- }
-
- return newValue
- }
-
- return {
- ...treeNode,
- depth,
- parent,
- hidden,
- expanded,
- toggle: wrappedToggle,
- }
-}
-
-function buildTree> (rawNode: T, options: UseCollapsibleTreeOptions, acc: UseCollapsibleTreeNode[] = [], depth = 1, parent: UseCollapsibleTreeNode | null = null) {
- const node = useCollapsibleTreeNode(rawNode, options, depth, parent)
-
- acc.push(node)
-
- if (node.children?.length) {
- for (const child of node.children) {
- buildTree(child, options, acc, depth + 1, node)
- }
- }
-
- return acc
-}
-
-function sortTree> (tree: T) {
- if (tree.children.length > 0) {
- tree.children = tree.children.sort((a, b) => {
- if (a.children.length === 0 && b.children.length === 0) {
- return a.name > b.name ? 1 : -1
- }
-
- if (a.children.length === 0) {
- return 1
- }
-
- if (b.children.length === 0) {
- return -1
- }
-
- return a.name > b.name ? 1 : -1
- })
-
- tree.children.forEach(sortTree)
- }
-}
-
-export function useCollapsibleTree > (tree: T, options: UseCollapsibleTreeOptions = {}) {
- options.expandInitially = options.expandInitially ?? true
- sortTree(tree)
- const collapsibleTree = buildTree(tree, options)
-
- collapsibleTree.sort((a, b) => {
- if (a.parent === b.parent) {
- if (a.children.length && !b.children.length) {
- return -1
- }
-
- return 0
- }
-
- return 0
- })
-
- return {
- tree: options.dropRoot ? collapsibleTree.slice(1) : collapsibleTree,
- }
-}
diff --git a/packages/frontend-shared/src/composables/useListNavigation.ts b/packages/frontend-shared/src/composables/useListNavigation.ts
deleted file mode 100644
index 4fef406f5ad4..000000000000
--- a/packages/frontend-shared/src/composables/useListNavigation.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { onKeyStroke } from '@vueuse/core'
-import { ref, onBeforeUpdate } from 'vue'
-
-export const useListNavigation = (rootEl) => {
- const selectedItem = ref(0)
- const itemRefs = ref([]) as any
- const setItemRef = (el) => {
- if (el) {
- itemRefs.value.push(el)
- }
- }
-
- onBeforeUpdate(() => {
- itemRefs.value = []
- })
-
- const goToItem = (direction: 'next' | 'previous', event) => {
- event.preventDefault()
- if (direction === 'next') {
- if (selectedItem.value + 1 >= itemRefs.value.length) {
- selectedItem.value = 0
- } else {
- selectedItem.value++
- }
- } else {
- if (selectedItem.value <= 0) {
- selectedItem.value = itemRefs.value.length - 1
- } else {
- selectedItem.value--
- }
- }
-
- itemRefs.value[selectedItem.value]?.focus({ preventScroll: true })
- itemRefs.value[selectedItem.value]?.scrollIntoView({ block: 'nearest' })
- }
-
- onKeyStroke('ArrowDown', (event: KeyboardEvent) => {
- goToItem('next', event)
- }, { target: rootEl })
-
- onKeyStroke('ArrowUp', (event) => {
- goToItem('previous', event)
- }, { target: rootEl })
-
- return {
- selectedItem,
- rowProps: {
- ref: setItemRef,
- tabindex: '-1',
- },
- }
-}
diff --git a/tooling/v8-snapshot/cache/dev-linux/snapshot-meta.cache.json b/tooling/v8-snapshot/cache/dev-linux/snapshot-meta.cache.json
index 0b1863a1f6da..c5cdce04453a 100644
--- a/tooling/v8-snapshot/cache/dev-linux/snapshot-meta.cache.json
+++ b/tooling/v8-snapshot/cache/dev-linux/snapshot-meta.cache.json
@@ -48,6 +48,8 @@
"./packages/server/lib/modes/record.js",
"./packages/server/lib/modes/run.ts",
"./packages/server/lib/open_project.ts",
+ "./packages/server/lib/project-base.ts",
+ "./packages/server/lib/socket-ct.ts",
"./packages/server/node_modules/@benmalka/foxdriver/node_modules/graceful-fs/polyfills.js",
"./packages/server/node_modules/glob/node_modules/minimatch/minimatch.js",
"./packages/server/node_modules/graceful-fs/polyfills.js",
@@ -3527,5 +3529,5 @@
"./tooling/v8-snapshot/cache/dev-linux/snapshot-entry.js"
],
"deferredHashFile": "yarn.lock",
- "deferredHash": "ce60d1d6cc0c77f20dcfc741105a5c53593752f814bf3cab816a3024faf68bfc"
+ "deferredHash": "6e64b278585907ecd02c6688a3964ef282453f2ca9753603ade51dc14ab6f7ee"
}