molecule icon indicating copy to clipboard operation
molecule copied to clipboard

bug: 新建文件夹、文件UI、activityBar的icon样式有错误渲染

Open Jixiangup opened this issue 2 years ago • 5 comments

新建文件夹、文件UI样式有错误渲染

复现逻辑

molecule.folderTree.add(
  new TreeNodeModel({
    id: uniqueId(),
    name: '',
    isLeaf: type === FileTypes.File,
    fileType: type,
    isEditable: true,
    data: {
      parentId
    }
  }), parentId);

问题截图:

image image

activityBar的icon样式有错误渲染

关于这个问题 追踪后问修老师 @mortalYoung 发现是因为样式优先级相关的问题 我暂时不确定如何修复它 但是有个临时的解决方案来处理优先级的问题

  • 没有被污染之前的样式
image
  • 被污染之后的样式

image

  • 复现

我也不确定这样能不能保证一定复线 但是在我本地是一定可以的

import { Header } from '@dtinsight/molecule/esm/workbench/sidebar';
import {ActionBar, IActionBarItemProps} from "@dtinsight/molecule/esm/components";

<Header
  title='哈哈哈'
  toolbar={<ActionBar data={headerToolBar} />}
/>

我在我的全局样式中添加如下样式 得以解决

/*.*/
#molecule .codicon {
    align-items: center;
    color: inherit;
    display: flex;
    font-size: 24px;
    justify-content: center;
}

Jixiangup avatar Feb 16 '23 10:02 Jixiangup

const folderTreeNode = new TreeNodeModel({
      id: randomId(),
      name: "",
      fileType: type,
      isEditable: true,
      icon: type === FileTypes.File ? "file-code" : "chevron-right",  // 在这里加上icon就好了
      data: {},
      asyncRemote: false,
      updateTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
    });
    // 往文件树里面添加节点
    molecule.folderTree.add(folderTreeNode, nodeId);
我是看了下源码实现,然后自己手动设置了下icon就好了

alvin0804 avatar Jun 16 '23 03:06 alvin0804

const folderTreeNode = new TreeNodeModel({
      id: randomId(),
      name: "",
      fileType: type,
      isEditable: true,
      icon: type === FileTypes.File ? "file-code" : "chevron-right",  // 在这里加上icon就好了
      data: {},
      asyncRemote: false,
      updateTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
    });
    // 往文件树里面添加节点
    molecule.folderTree.add(folderTreeNode, nodeId);
我是看了下源码实现,然后自己手动设置了下icon就好了

谢谢你的回复,但是我去本地验证了一下 貌似还是有问题 在我切换light类主题都会有问题

Jixiangup avatar Jun 21 '23 07:06 Jixiangup

如果这些问题不被认为是bug 不会修复它的话请在这个issue @我 来对我进行告知。thx :)

Jixiangup avatar Jun 21 '23 07:06 Jixiangup

是一个 bug,@bnyte 来个 PR 呗 😉

mortalYoung avatar Jun 25 '23 02:06 mortalYoung

是一个 bug,@bnyte 来个 PR 呗 😉

可以试一下😁

Jixiangup avatar Jun 25 '23 06:06 Jixiangup