Порівняти коміти

...
3 змінених файлів з 61 додано та 25 видалено

No files matched your search

+19
Переглянути файл
@@ -0,0 +1,19 @@
import { expect, test } from "./fixtures";
test("gives the project name room before its path in a narrow tree", async ({ workbench: page }) => {
await page.evaluate(async () => {
const storeModule = "/src/features/project-tree/store.ts";
const { useProjectTree } = await import(/* @vite-ignore */ storeModule);
useProjectTree.setState({ name: "checkout-order-processing" });
});
const pane = page.getByRole("region", { name: "Project", exact: true });
await pane.getByRole("button", { name: "Options", exact: true }).click();
await page.getByRole("menuitemcheckbox", { name: "Horizontal Scrolling" }).click();
const tree = pane.getByRole("tree", { name: "Project" });
const name = tree.getByText("checkout-order-processing", { exact: true });
await expect(name).toBeVisible();
await expect.poll(() => name.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
await expect.poll(() => tree.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
});
+12 -4
Переглянути файл
@@ -21,7 +21,7 @@
height: 100%;
display: flex;
align-items: center;
gap: 5px;
gap: var(--space-1);
border-radius: var(--radius-row);
}
@@ -41,9 +41,16 @@
overflow: hidden;
text-overflow: ellipsis;
}
.rootName {
.labelGroup {
display: flex;
align-items: center;
gap: var(--space-1);
min-width: 0;
overflow: hidden;
}
.labelGroup .label {
flex: none;
max-width: 60%;
max-inline-size: 100%;
}
.rootLabel {
color: var(--fg-strong);
@@ -60,6 +67,7 @@
text-decoration-line: line-through;
}
.error {
padding-block: var(--space-0-5);
text-decoration-line: underline;
text-decoration-style: wavy;
text-decoration-color: var(--danger);
@@ -88,7 +96,7 @@
}
.detail {
min-width: 0;
margin-left: 4px;
margin-inline-start: var(--space-1);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
+30 -21
Переглянути файл
@@ -338,26 +338,29 @@ const Row = memo(function Row({
/>
) : (
<>
<HighlightedText
className={clsx(
styles.label,
node.root && styles.rootName,
// Only the project itself is bold (IDEA); contributed roots like Scratches are not.
node.root && !node.icon && styles.rootLabel,
// Maven / Gradle module folders are bold too, as in IDEA.
moduleFolder && styles.moduleLabel,
faded && !deco.color && styles.excluded,
// IDEA strikes out deprecated classes.
file?.deprecated && styles.deprecated,
deco.error && styles.error,
<span className={styles.labelGroup}>
<HighlightedText
className={clsx(
styles.label,
// Project and module roots use semibold labels.
node.root && !node.icon && styles.rootLabel,
moduleFolder && styles.moduleLabel,
faded && !deco.color && styles.excluded,
file?.deprecated && styles.deprecated,
deco.error && styles.error,
)}
style={deco.color ? { color: deco.color } : undefined}
text={node.label}
indices={matches}
tone="accent"
/>
{deco.suffix && <DecorationSuffix segments={deco.suffix} color={deco.suffixColor} />}
{detail && (
<span className={styles.detail} title={detail}>
{detail}
</span>
)}
style={deco.color ? { color: deco.color } : undefined}
text={node.label}
indices={matches}
tone="accent"
/>
{deco.suffix && <DecorationSuffix segments={deco.suffix} color={deco.suffixColor} />}
{detail && <span className={styles.detail}>{detail}</span>}
</span>
{deco.badge && <span className={styles.badge}>{deco.badge}</span>}
</>
)}
@@ -421,8 +424,14 @@ const MemberRow = memo(function MemberRow({
onPointerDown={(e) => onPointerDown(node, e)}
>
<SymbolBadge kind={badgeKind(item.kind)} className={styles.icon} />
<HighlightedText className={styles.label} text={item.name} indices={matches} tone="accent" />
{item.detail && <span className={styles.detail}>{item.detail}</span>}
<span className={styles.labelGroup}>
<HighlightedText className={styles.label} text={item.name} indices={matches} tone="accent" />
{item.detail && (
<span className={styles.detail} title={item.detail}>
{item.detail}
</span>
)}
</span>
</span>
);
});