镜像自地址
https://github.com/lhly/cloud-drive-renamer.git
已同步 2026-10-20 21:57:47 +08:00
refactor: clarify truncation ownership
这个提交包含在:
父节点
8b75e30744
当前提交
1b5bd627fe
@ -270,19 +270,14 @@ export class VirtualPreviewList extends LitElement {
|
|||||||
.old-name {
|
.old-name {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--cdr-text-secondary, #595959);
|
color: var(--cdr-text-secondary, #595959);
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
flex: 1 1 0;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.old-name.old-name-secondary {
|
.old-name.old-name-secondary {
|
||||||
|
flex: 1 1 0;
|
||||||
|
min-width: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
flex: 1 1 0;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.new-name {
|
.new-name {
|
||||||
@ -300,14 +295,9 @@ export class VirtualPreviewList extends LitElement {
|
|||||||
.new-name-text {
|
.new-name-text {
|
||||||
flex: 1 1 0;
|
flex: 1 1 0;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.new-name-primary .new-name-text {
|
.new-name-primary .new-name-text {
|
||||||
flex: 1 1 0;
|
|
||||||
min-width: 0;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|||||||
@ -189,7 +189,7 @@ describe('VirtualPreviewList pending preview mapping', () => {
|
|||||||
const staticCss = stylesArray
|
const staticCss = stylesArray
|
||||||
.map((result) => ('cssText' in result ? (result as any).cssText : result.toString()))
|
.map((result) => ('cssText' in result ? (result as any).cssText : result.toString()))
|
||||||
.join(' ');
|
.join(' ');
|
||||||
const extractBlock = (selector: string) => {
|
const selectorBlock = (selector: string) => {
|
||||||
const start = staticCss.indexOf(selector);
|
const start = staticCss.indexOf(selector);
|
||||||
expect(start, `missing ${selector}`).toBeGreaterThan(-1);
|
expect(start, `missing ${selector}`).toBeGreaterThan(-1);
|
||||||
const braceOpen = staticCss.indexOf('{', start);
|
const braceOpen = staticCss.indexOf('{', start);
|
||||||
@ -197,15 +197,25 @@ describe('VirtualPreviewList pending preview mapping', () => {
|
|||||||
return staticCss.slice(braceOpen + 1, braceClose);
|
return staticCss.slice(braceOpen + 1, braceClose);
|
||||||
};
|
};
|
||||||
|
|
||||||
const oldNameDeclarations = extractBlock('.old-name.old-name-secondary');
|
const oldNameDeclarations = selectorBlock('.old-name.old-name-secondary');
|
||||||
expect(oldNameDeclarations).toContain('flex: 1 1 0');
|
|
||||||
expect(oldNameDeclarations).toContain('min-width: 0');
|
|
||||||
expect(oldNameDeclarations).toContain('overflow: hidden');
|
expect(oldNameDeclarations).toContain('overflow: hidden');
|
||||||
|
expect(oldNameDeclarations).toContain('text-overflow: ellipsis');
|
||||||
|
expect(oldNameDeclarations).toContain('white-space: nowrap');
|
||||||
|
|
||||||
const newNameDeclarations = extractBlock('.new-name-primary .new-name-text');
|
const baseOldNameDeclarations = selectorBlock('.old-name');
|
||||||
expect(newNameDeclarations).toContain('flex: 1 1 0');
|
expect(baseOldNameDeclarations).not.toContain('overflow: hidden');
|
||||||
expect(newNameDeclarations).toContain('min-width: 0');
|
expect(baseOldNameDeclarations).not.toContain('text-overflow: ellipsis');
|
||||||
|
expect(baseOldNameDeclarations).not.toContain('white-space: nowrap');
|
||||||
|
|
||||||
|
const newNameDeclarations = selectorBlock('.new-name-primary .new-name-text');
|
||||||
expect(newNameDeclarations).toContain('overflow: hidden');
|
expect(newNameDeclarations).toContain('overflow: hidden');
|
||||||
|
expect(newNameDeclarations).toContain('text-overflow: ellipsis');
|
||||||
|
expect(newNameDeclarations).toContain('white-space: nowrap');
|
||||||
|
|
||||||
|
const baseNewNameDeclarations = selectorBlock('.new-name-text');
|
||||||
|
expect(baseNewNameDeclarations).not.toContain('overflow: hidden');
|
||||||
|
expect(baseNewNameDeclarations).not.toContain('text-overflow: ellipsis');
|
||||||
|
expect(baseNewNameDeclarations).not.toContain('white-space: nowrap');
|
||||||
|
|
||||||
element.remove();
|
element.remove();
|
||||||
});
|
});
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户