diff --git a/apps/remix-ide-e2e/src/tests/file_decorator.test.ts b/apps/remix-ide-e2e/src/tests/file_decorator.test.ts index cb1e82ecf8..1e44988bcf 100644 --- a/apps/remix-ide-e2e/src/tests/file_decorator.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_decorator.test.ts @@ -4,7 +4,6 @@ import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' module.exports = { - "@disabled": true, before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done) }, diff --git a/libs/remix-ui/workspace/src/lib/components/flat-tree.tsx b/libs/remix-ui/workspace/src/lib/components/flat-tree.tsx index e8794ab54c..5e9cb3c018 100644 --- a/libs/remix-ui/workspace/src/lib/components/flat-tree.tsx +++ b/libs/remix-ui/workspace/src/lib/components/flat-tree.tsx @@ -1,14 +1,12 @@ -import React, { SyntheticEvent, startTransition, useEffect, useRef, useState, RefObject, useMemo } from 'react' +import React, { SyntheticEvent, useEffect, useRef, useState, RefObject, useMemo } from 'react' import { Popover } from 'react-bootstrap' import { FileType, WorkspaceElement } from '../types' -import { ROOT_PATH } from '../utils/constants' import { getPathIcon } from '@remix-ui/helper'; import { Virtuoso, VirtuosoHandle } from 'react-virtuoso' import { FlatTreeItemInput } from './flat-tree-item-input'; import { FlatTreeDrop } from './flat-tree-drop'; import { getEventTarget } from '../utils/getEventTarget'; -import { fileDecoration } from '@remix-ui/file-decorators'; -import { focusElement } from '../actions/payload'; +import { fileDecoration, FileDecorationIcons } from '@remix-ui/file-decorators'; export default function useOnScreen(ref: RefObject) { @@ -142,6 +140,16 @@ export const FlatTree = (props: FlatTreeProps) => { } } + const getFileStateIcons = (file: FileType) => { + const state = fileState.find((state: fileDecoration) => { + if (state.path === file.path) return true + if (state.bubble && file.isDirectory && state.path.startsWith(file.path)) return true + }) + if (state && state.fileStateLabelClass) { + return + } + } + const onMouseMove = async (e: any) => { const target = await getEventTarget(e, true) if (target && target.path) { @@ -224,7 +232,7 @@ export const FlatTree = (props: FlatTreeProps) => { : -
{ data-label-path={`${file.path}`} key={index}> {file.name} +
+ {getFileStateIcons(file)} + }
)