Remove the duplicate Root visits label from the link table #53

Merged
eleith merged 1 commits from fix/root-row-visit-label into main 2026-11-24 20:52:29 +00:00
3 changed files with 8 additions and 14 deletions

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
'@goto/web': patch
---
Use the same Visits column for the root row and named links without repeating the Root visits label.
+1 -1
View File
@@ -126,7 +126,7 @@ test('shared credentials protect admin pages and sign-out removes access', async
'404 Not found',
domainReportPath
]);
await expect(rootRow.getByText('Root visits', { exact: true })).toBeVisible();
await expect(rootRow.getByText('Root visits', { exact: true })).toHaveCount(0);
await expect(rootRow.locator('.admin-inventory-number')).toHaveText('1');
await expect(domainDetails.getByRole('link', { name: 'Root', exact: true })).toHaveCount(0);
await expect(domainDetails.getByRole('link', { name: 'Fallback', exact: true })).toHaveCount(0);
@@ -40,8 +40,7 @@
</div>
<ul class="admin-inventory-list">
{#each links as link (link.href)}
{@const isRoot = link.path === '/'}
{@const pathLabel = isRoot ? '(root)' : link.path}
{@const pathLabel = link.path === '/' ? '(root)' : link.path}
{@const linkLabel = showDomain ? `${link.domain}${link.path}` : pathLabel}
<li>
<a class="admin-inventory-row admin-inventory-link" href={link.href} aria-label={linkLabel}>
@@ -61,11 +60,7 @@
</span>
{#if visitLabel}
<span class="admin-inventory-count">
{#if isRoot}
<span class="root-visit-label">Root visits</span>
{:else}
<span class="admin-inventory-label">{visitLabel}</span>
{/if}
<span class="admin-inventory-label">{visitLabel}</span>
<span class="admin-inventory-number">{formatCount(link.visits)}</span>
</span>
{/if}
@@ -74,9 +69,3 @@
{/each}
</ul>
</div>
<style>
.root-visit-label {
color: var(--color-text-muted);
}
</style>