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

通过parseDiff解析,新增的文件对应的旧文件区域没有展示UI #212

Open
Bairuina opened this issue Dec 5, 2023 · 9 comments

Comments

@Bairuina
Copy link

Bairuina commented Dec 5, 2023

No description provided.

@otakustay
Copy link
Owner

有没有截图或者可复现的代码,看这个描述我还不太清楚是怎么个样子

@Bairuina
Copy link
Author

Bairuina commented Dec 5, 2023

简单写了一个demo
https://codesandbox.io/p/sandbox/j7lwqj0l63?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clpseku0m0006356ovpe9ycwj%2522%252C%2522sizes%2522%253A%255B90%252C10%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clpseku0m0002356os74vtr9u%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clpseku0m0003356o9koimmdi%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clpseku0m0005356owjm6jwuz%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clpseku0m0002356os74vtr9u%2522%253A%257B%2522id%2522%253A%2522clpseku0m0002356os74vtr9u%2522%252C%2522tabs%2522%253A%255B%255D%257D%252C%2522clpseku0m0005356owjm6jwuz%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clpseku0m0004356ol7e55lfu%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A0%252C%2522path%2522%253A%2522%2522%257D%255D%252C%2522id%2522%253A%2522clpseku0m0005356owjm6jwuz%2522%252C%2522activeTabId%2522%253A%2522clpseku0m0004356ol7e55lfu%2522%257D%252C%2522clpseku0m0003356o9koimmdi%2522%253A%257B%2522tabs%2522%253A%255B%255D%252C%2522id%2522%253A%2522clpseku0m0003356o9koimmdi%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

@Bairuina
Copy link
Author

Bairuina commented Dec 5, 2023

不还意思,demo有点问题,我再重新写一个

@Bairuina
Copy link
Author

Bairuina commented Dec 5, 2023

@zzuu666
Copy link

zzuu666 commented Jan 2, 2024

从代码的实现来看,在新增文件的情况下只展示新增内容是特性。

const monotonous = diffType === 'add' || diffType === 'delete';

if (monotonous) {
return (
<colgroup>
{!hideGutter && <col className="diff-gutter-col" />}
<col />
</colgroup>
);
}

@Bairuina
Copy link
Author

好的 感谢~

@otakustay
Copy link
Owner

你有全新增的内容要展示旧文件(完全就是空的)的需求吗

@Bairuina
Copy link
Author

是的

@otakustay
Copy link
Owner

你试试是不是渲染组件时把diffType改成modify就行了?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants