Compare commits

...
Author SHA1 Message Date
l0ng-ai 8c33459fcd fix(gradle): keep task descriptions in row tooltips 2026-11-23 08:05:57 +08:00
3 changed files with 10 additions and 4 deletions

No files matched your search

+4
View File
@@ -83,6 +83,10 @@ test("links independent Gradle roots, runs identical task paths in their own bui
});
const tasks = tree.getByRole("treeitem", { name: /^assemble\b/ });
await expect(tasks).toHaveCount(2);
expect(await tasks.allTextContents()).toEqual(["assemble", "assemble"]);
for (const task of await tasks.all()) {
await expect(task).toHaveAccessibleDescription("Assembles this project");
}
await page.screenshot({ path: info.outputPath("gradle-two-roots.png"), animations: "disabled" });
await tasks.nth(0).dblclick();
+3 -4
View File
@@ -317,14 +317,12 @@ function NodeRow({ node, state }: { node: BuildNode; state: TreeRowState }) {
? `(${node.dependency.scope}${node.dependency.optional ? ", optional" : ""})`
: node.kind === "dependency" && node.dependency.optional
? "(optional)"
: node.kind === "task"
? node.task.description
: null;
: null;
const skipped =
(mavenSkipTests && node.kind === "phase" && node.phase === "test") ||
(gradleSkipTests && node.kind === "task" && node.task.name === "test");
return (
<span className={styles.row} title={node.kind === "task" ? (node.task.description ?? undefined) : undefined}>
<span className={styles.row}>
<Icon name={nodeIcon(node)} size={16} className={styles.icon} />
<span className={clsx(styles.label, state.selected && styles.selectedLabel, skipped && styles.skippedGoal)}>
{nodeLabel(node)}
@@ -475,6 +473,7 @@ function BuildToolView({ tool }: { tool: BuildTool }) {
roots={roots}
getKey={(n) => n.key}
getLabel={nodeLabel}
getTooltip={(n) => (n.kind === "task" ? (n.task.description ?? undefined) : undefined)}
getChildren={getChildren}
isExpandable={(n) => !!getChildren(n)?.length}
expanded={expanded}
+3
View File
@@ -93,6 +93,8 @@ export interface TreeProps<T> {
getIcon?: (node: T, expanded: boolean) => IconName | (string & {}) | undefined;
/** Muted trailing detail (e.g. a path next to the project root); may include styled content. */
getDetail?: (node: T) => ReactNode;
/** Native tooltip and accessible description for a row. */
getTooltip?: (node: T) => string | undefined;
/** Label colour, e.g. VCS status. */
getColor?: (node: T) => string | undefined;
/** Filesystem directory for actions on the focused selection; groups return null. */
@@ -800,6 +802,7 @@ export function Tree<T>(props: TreeProps<T>) {
aria-setsize={positions[v.index]![1]}
aria-expanded={row.expandable ? row.expanded : undefined}
aria-selected={isSelected}
title={props.getTooltip?.(row.node)}
className={clsx(
styles.row,
props.horizontalScroll && styles.wideRow,