From c5376d43d9642d2aa214026fee914ce027470313 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 17 Oct 2025 10:20:59 +0200 Subject: [PATCH] Rename Orphans tab to Unanchored --- src/sidebar/components/SidebarTabs.tsx | 6 ++-- .../components/test/SidebarTabs-test.js | 31 +++++++++---------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/sidebar/components/SidebarTabs.tsx b/src/sidebar/components/SidebarTabs.tsx index 5448a0e3cff..583561386fc 100644 --- a/src/sidebar/components/SidebarTabs.tsx +++ b/src/sidebar/components/SidebarTabs.tsx @@ -138,7 +138,7 @@ function SidebarTabs({ tabCountsSummaryPieces.push(`${noteCount} ${term}`); } if (orphanCount > 0) { - const term = pluralize(noteCount, 'orphan', 'orphans'); + const term = pluralize(noteCount, 'unanchored', 'unanchored'); tabCountsSummaryPieces.push(`${orphanCount} ${term}`); } const tabCountsSummary = tabCountsSummaryPieces.join(', '); @@ -180,11 +180,11 @@ function SidebarTabs({ count={orphanCount} isWaitingToAnchor={isWaitingToAnchorAnnotations} isSelected={selectedTab === 'orphan'} - label="Orphans" + label="Unanchored" name="orphan" onSelect={() => selectTab('orphan')} > - Orphans + Unanchored )} diff --git a/src/sidebar/components/test/SidebarTabs-test.js b/src/sidebar/components/test/SidebarTabs-test.js index a2847108c7d..5fbeaded5d3 100644 --- a/src/sidebar/components/test/SidebarTabs-test.js +++ b/src/sidebar/components/test/SidebarTabs-test.js @@ -162,31 +162,28 @@ describe('SidebarTabs', () => { }); }); - describe('orphans tab', () => { - it('should display orphans tab if there is 1 or more orphans', () => { + describe('unanchored tab', () => { + it('should display unanchored tab if there is 1 or more orphans', () => { stubTabCounts({ orphan: 1 }); const wrapper = createComponent(); - const orphanTab = wrapper.find('Tab[label="Orphans"]'); - assert.isTrue(orphanTab.exists()); + const unanchoredTab = wrapper.find('Tab[label="Unanchored"]'); + assert.isTrue(unanchoredTab.exists()); }); - it('should display orphans tab as selected when it is active', () => { + it('should display unanchored tab as selected when it is active', () => { fakeStore.selectedTab.returns('orphan'); stubTabCounts({ orphan: 1 }); const wrapper = createComponent(); - const orphanTab = wrapper.find('Tab[label="Orphans"]'); - assert.isTrue(orphanTab.find('LinkButton').prop('pressed')); + const unanchoredTab = wrapper.find('Tab[label="Unanchored"]'); + assert.isTrue(unanchoredTab.find('LinkButton').prop('pressed')); }); - it('should not display orphans tab if there are 0 orphans', () => { + it('should not display unanchored tab if there are 0 orphans', () => { const wrapper = createComponent(); - - const orphanTab = wrapper.find('Tab[label="Orphans"]'); - - assert.isFalse(orphanTab.exists()); + assert.isFalse(wrapper.exists('Tab[label="Unanchored"]')); }); }); @@ -257,12 +254,12 @@ describe('SidebarTabs', () => { [ { label: 'Annotations', tab: 'annotation' }, { label: 'Page Notes', tab: 'note' }, - { label: 'Orphans', tab: 'orphan' }, + { label: 'Unanchored', tab: 'orphan' }, ].forEach(({ label, tab }) => { it(`should change the selected tab when "${label}" tab is clicked`, () => { // Pre-select a different tab than the one we are about to click. fakeStore.selectedTab.returns('other-tab'); - // Make the "Orphans" tab appear. + // Make the "Unanchored" tab appear. stubTabCounts({ orphan: 1 }); const wrapper = createComponent(); @@ -305,7 +302,7 @@ describe('SidebarTabs', () => { note: 0, orphan: 4, }, - message: '4 orphans', + message: '4 unanchored', }, { tabCounts: { @@ -313,7 +310,7 @@ describe('SidebarTabs', () => { note: 3, orphan: 4, }, - message: '2 annotations, 3 notes, 4 orphans', + message: '2 annotations, 3 notes, 4 unanchored', }, { tabCounts: { @@ -321,7 +318,7 @@ describe('SidebarTabs', () => { note: 1, orphan: 1, }, - message: '1 annotation, 1 note, 1 orphan', + message: '1 annotation, 1 note, 1 unanchored', }, ].forEach(({ tabCounts, message }) => { it('reports annotation count to screen readers', () => {