Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/ui/ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,24 @@
padding-right: 10px;
}

.abledom-issue_warning + .abledom-issue-group-issues {
border-left: 3px solid rgba(163, 82, 1, 0.7);
}
#abledom-report.abledom-align-right
.abledom-issue_warning
+ .abledom-issue-group-issues {
border-right: 3px solid rgba(163, 82, 1, 0.7);
}

.abledom-issue_info + .abledom-issue-group-issues {
border-left: 3px solid rgba(0, 0, 255, 0.7);
}
#abledom-report.abledom-align-right
.abledom-issue_info
+ .abledom-issue-group-issues {
border-right: 3px solid rgba(0, 0, 255, 0.7);
}

.abledom-issue-group-title {
background-color: rgba(164, 2, 2, 0.7);
color: white;
Expand Down
22 changes: 22 additions & 0 deletions src/ui/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -976,11 +976,33 @@ export class IssuesUI {

if (container && countElement) {
const count = container.children.length;

if (count === 0) {
this._removeIssueGroup(groupName, container);
continue;
}

countElement.textContent = `${count}`;
}
}
}

private _removeIssueGroup(
groupName: string,
container: HTMLElementWithAbleDOMUIFlag,
): void {
const groupElement = container.parentElement;

if (groupElement?.classList.contains("abledom-issue-group")) {
groupElement.remove();
} else {
container.remove();
}

delete this._issueGroupContainers[groupName];
delete this._issueGroupCountElements[groupName];
}

removeIssue(issue: IssueUI) {
if (!this._issues.has(issue)) {
return;
Expand Down
6 changes: 6 additions & 0 deletions tests/notificationsUI/notificationsUI.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ test.describe("Notifications UI", () => {

// All 3 label issues should be gone.
expect(await getVisibleIssueCount(page)).toBe(issuesBefore - 3);

// Empty group title should be removed, not shown with "0".
const labelGroupTitles = page.locator(
`${groupTitleSelector}:has-text("Missing text label")`,
);
await expect(labelGroupTitles).toHaveCount(0);
});

test("group close button hides all issues within the group", async ({
Expand Down
Loading