Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jixiangup opened this issue Feb 16, 2023 · 5 comments
Open
Labels
bug Something isn't working

Comments

@Jixiangup
Copy link

Jixiangup commented Feb 16, 2023

新建文件夹、文件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 Jixiangup added the bug Something isn't working label Feb 16, 2023
@alvin0804
Copy link

alvin0804 commented Jun 16, 2023

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就好了

@Jixiangup
Copy link
Author

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 Jixiangup changed the title bug: 新建文件夹 Or 文件UI样式有错误渲染 bug: 新建文件夹、文件UI、activeBar的icon样式有错误渲染 Jun 21, 2023
@Jixiangup Jixiangup changed the title bug: 新建文件夹、文件UI、activeBar的icon样式有错误渲染 bug: 新建文件夹、文件UI、activityBar的icon样式有错误渲染 Jun 21, 2023
@Jixiangup
Copy link
Author

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

@mortalYoung
Copy link
Collaborator

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

@Jixiangup
Copy link
Author

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

可以试一下😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants