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
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ chrome-extension/
- Tabs are sorted alphabetically by title within each group
- Only groups with 2+ tabs are created (singles remain ungrouped)
- Chrome internal pages (`chrome://`, `chrome-extension://`, `about:`) are skipped
- Each group shows name and tab count: `github.com (25)`
- Each group shows name only: `github.com`
- Colors rotate through: blue, red, yellow, green, pink, purple, cyan, orange
- Bookmark save/restore automatically manages Tab Organizer bookmark folders with timestamps
- Merge duplicate groups respects protected groups (protected groups absorb but never dissolve)
Expand Down
4 changes: 2 additions & 2 deletions chrome-extension/e2e/base-domain-and-edge-cases.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('Base Domain Grouping and Edge Cases', () => {
// Should have one group for github.com (all subdomains grouped together)
const githubGroup = groups.find(g => g.title.includes('github.com'));
expect(githubGroup).toBeDefined();
expect(githubGroup.title).toBe('github.com (3)');
expect(githubGroup.title).toBe('github.com');

console.log('✅ Subdomains grouped by base domain.');
}, 90000);
Expand Down Expand Up @@ -213,7 +213,7 @@ describe('Base Domain Grouping and Edge Cases', () => {

const githubGroup = groups.find(g => g.title.includes('github.com'));
expect(githubGroup).toBeDefined();
expect(githubGroup.title).toBe('github.com (2)');
expect(githubGroup.title).toBe('github.com');

console.log('✅ Chrome internal pages skipped.');
}, 90000);
Expand Down
4 changes: 2 additions & 2 deletions chrome-extension/e2e/collapsed-group-preservation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ describe('Group State Preservation (Collapsed Groups)', () => {
// Verify color is preserved
expect(updatedGroup.color).toBe(initialColor);

// Verify tab count updated
expect(updatedGroup.title).toBe('github.com (5)'); // 3 initial + 2 additional
// Verify title is preserved
expect(updatedGroup.title).toBe('github.com');

console.log('✅ Collapsed state was preserved.');
}, 90000);
Expand Down
6 changes: 2 additions & 4 deletions chrome-extension/e2e/combine-groups.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ describe('Combine Groups Feature', () => {

console.log('Final groups:', finalGroups);
expect(finalGroups.length).toBe(1);
expect(finalGroups[0].title).toContain('github.com');
expect(finalGroups[0].title).toContain('5'); // 3 github + 2 google tabs
expect(finalGroups[0].title).toBe('github.com');

console.log('✅ Combine two groups test passed!');

Expand Down Expand Up @@ -354,8 +353,7 @@ describe('Combine Groups Feature', () => {

console.log('Final groups:', finalGroups);
expect(finalGroups.length).toBe(1);
expect(finalGroups[0].title).toContain('github.com');
expect(finalGroups[0].title).toContain('7'); // 3 github + 2 google + 2 stackoverflow
expect(finalGroups[0].title).toBe('github.com');

console.log('✅ Combine multiple source groups test passed!');

Expand Down
8 changes: 4 additions & 4 deletions chrome-extension/e2e/cross-window-organization.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('Cross-Window Tab Organization', () => {
// Should have created github group with all tabs from both windows
const githubGroup = groups.find(g => g.title.includes('github.com'));
expect(githubGroup).toBeDefined();
expect(githubGroup.title).toBe('github.com (3)');
expect(githubGroup.title).toBe('github.com');

console.log('✅ Cross-window consolidation passed!');
}, 120000);
Expand Down Expand Up @@ -164,7 +164,7 @@ describe('Cross-Window Tab Organization', () => {

const githubGroup = groups.find(g => g.title.includes('github.com'));
expect(githubGroup).toBeDefined();
expect(githubGroup.title).toBe('github.com (2)'); // react + vue (angular duplicate removed)
expect(githubGroup.title).toBe('github.com'); // react + vue (angular duplicate removed)

console.log('✅ Cross-window duplicate removal passed!');
}, 120000);
Expand Down Expand Up @@ -216,7 +216,7 @@ describe('Cross-Window Tab Organization', () => {

const developmentGroup = groups.find(g => g.title.includes('Development'));
expect(developmentGroup).toBeDefined();
expect(developmentGroup.title).toBe('Development (4)');
expect(developmentGroup.title).toBe('Development');

console.log('✅ Cross-window category organization passed!');
}, 120000);
Expand Down Expand Up @@ -282,7 +282,7 @@ describe('Cross-Window Tab Organization', () => {

const githubGroup = groups.find(g => g.title.includes('github.com'));
expect(githubGroup).toBeDefined();
expect(githubGroup.title).toBe('github.com (3)'); // Only the 3 github tabs
expect(githubGroup.title).toBe('github.com');

console.log('✅ Chrome internal pages skipped correctly!');
}, 120000);
Expand Down
6 changes: 2 additions & 4 deletions chrome-extension/e2e/first-time-organization.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,9 @@ describe('First-Time Organization (Create New Groups)', () => {
// Verify we have 3 groups (github, google, example)
expect(groups.length).toBe(3);

// Verify group titles match expected domains
// Verify group titles match expected domains (no longer include tab counts)
const groupTitles = groups.map(g => g.title).sort();
expect(groupTitles).toContain('example.com (3)');
expect(groupTitles).toContain('github.com (5)');
expect(groupTitles).toContain('google.com (4)');
expect(groupTitles).toEqual(['example.com', 'github.com', 'google.com']);

// Step 5: Verify tabs are sorted alphabetically within each group
const tabs = await serviceWorker.evaluate(async () => {
Expand Down
14 changes: 7 additions & 7 deletions chrome-extension/e2e/tab-movement-and-ungrouping.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ describe('Tab Movement, Ungrouping, Mixed Operations', () => {
const githubGroup = initialGroups.find(g => g.title.includes('github.com'));
const googleGroup = initialGroups.find(g => g.title.includes('google.com'));

expect(githubGroup.title).toBe('github.com (3)');
expect(googleGroup.title).toBe('google.com (2)');
expect(githubGroup.title).toBe('github.com');
expect(googleGroup.title).toBe('google.com');

// Navigate a GitHub tab to google.com
console.log('Changing one GitHub tab to google.com...');
Expand Down Expand Up @@ -152,8 +152,8 @@ describe('Tab Movement, Ungrouping, Mixed Operations', () => {
const updatedGoogle = updatedGroups.find(g => g.title.includes('google.com'));

// GitHub should have 1 less, Google should have 1 more
expect(updatedGithub.title).toBe('github.com (2)');
expect(updatedGoogle.title).toBe('google.com (3)');
expect(updatedGithub.title).toBe('github.com');
expect(updatedGoogle.title).toBe('google.com');

console.log('✅ Tab moved between groups correctly.');
}, 120000);
Expand Down Expand Up @@ -183,7 +183,7 @@ describe('Tab Movement, Ungrouping, Mixed Operations', () => {
console.log('Groups before closing tab:', groupsBefore);
const exampleGroup = groupsBefore.find(g => g.title.includes('example.com'));
expect(exampleGroup).toBeDefined();
expect(exampleGroup.title).toBe('example.com (2)');
expect(exampleGroup.title).toBe('example.com');

// Close one example.com tab
console.log('Closing one example.com tab...');
Expand Down Expand Up @@ -283,11 +283,11 @@ describe('Tab Movement, Ungrouping, Mixed Operations', () => {
// Should have created stackoverflow group
const stackoverflowGroup = groupsAfter.find(g => g.title.includes('stackoverflow.com'));
expect(stackoverflowGroup).toBeDefined();
expect(stackoverflowGroup.title).toBe('stackoverflow.com (3)');
expect(stackoverflowGroup.title).toBe('stackoverflow.com');

// Should have updated github group (2 initial + 2 new = 4)
const githubGroup = groupsAfter.find(g => g.title.includes('github.com'));
expect(githubGroup.title).toBe('github.com (4)');
expect(githubGroup.title).toBe('github.com');

console.log('✅ Mixed create and update worked correctly.');
}, 120000);
Expand Down
6 changes: 2 additions & 4 deletions chrome-extension/e2e/update-existing-groups.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,9 @@ describe('Re-Organization (Update Existing Groups)', () => {
const updatedGroupIds = updatedGroups.map(g => g.id).sort();
expect(updatedGroupIds).toEqual(initialGroupIds.sort());

// Verify group titles reflect the new tab counts
// Verify group titles (no longer include tab counts)
const groupTitles = updatedGroups.map(g => g.title).sort();
expect(groupTitles).toContain('example.com (3)'); // was 2, now 3
expect(groupTitles).toContain('github.com (5)'); // was 3, now 5
expect(groupTitles).toContain('google.com (4)'); // was 2, now 4
expect(groupTitles).toEqual(['example.com', 'github.com', 'google.com']);

// Step 8: Verify tabs are sorted alphabetically within each group
const allTabs = await serviceWorker.evaluate(async () => {
Expand Down
6 changes: 3 additions & 3 deletions chrome-extension/src/background/combineGroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function combineGroups(sourceGroupIds, targetGroupId) {
};
}

// Get current target tab count for final count calculation
// Get current target tab count for status message display
const targetTabs = await chrome.tabs.query({ groupId: targetGroupId });
const tabsMoved = allSourceTabs.length;
const newTargetTabCount = targetTabs.length + tabsMoved;
Expand All @@ -41,9 +41,9 @@ export async function combineGroups(sourceGroupIds, targetGroupId) {
const sourceTabIds = allSourceTabs.map(tab => tab.id);
await chrome.tabs.group({ tabIds: sourceTabIds, groupId: targetGroupId });

// Update target group title with new count
// Update target group title
await chrome.tabGroups.update(targetGroupId, {
title: `${targetGroupName} (${newTargetTabCount})`
title: targetGroupName
});

return {
Expand Down
4 changes: 2 additions & 2 deletions chrome-extension/src/background/combineGroups.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('combineGroups', () => {
groupId: 2,
});
expect(chrome.tabGroups.update).toHaveBeenCalledWith(2, {
title: 'Development (7)',
title: 'Development',
});
expect(result).toEqual({
sourceGroupNames: ['Documentation'],
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('combineGroups', () => {
groupId: 2,
});
expect(chrome.tabGroups.update).toHaveBeenCalledWith(2, {
title: 'Development (9)',
title: 'Development',
});
expect(result).toEqual({
sourceGroupNames: ['Documentation', 'Research'],
Expand Down
5 changes: 2 additions & 3 deletions chrome-extension/src/background/mergeDuplicateGroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,9 @@ async function mergeDuplicateGroups() {
try {
await chrome.tabs.group({ tabIds: allSourceTabIds, groupId: targetGroupData.group.id });

// Update target group title with new count
const newTabCount = targetGroupData.tabCount + allSourceTabIds.length;
// Update target group title
await chrome.tabGroups.update(targetGroupData.group.id, {
title: `${baseName} (${newTabCount})`
title: baseName
});

mergedGroups += sourceGroupsData.length;
Expand Down
4 changes: 2 additions & 2 deletions chrome-extension/src/background/mergeDuplicateGroups.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('mergeDuplicateGroups', () => {
groupId: 1,
});
expect(chrome.tabGroups.update).toHaveBeenCalledWith(1, {
title: 'github.com (15)',
title: 'github.com',
});
expect(result.mergedGroups).toBe(1);
expect(result.tabsMoved).toBe(5);
Expand Down Expand Up @@ -134,7 +134,7 @@ describe('mergeDuplicateGroups', () => {
groupId: 2,
});
expect(chrome.tabGroups.update).toHaveBeenCalledWith(2, {
title: 'github.com (15)',
title: 'github.com',
});
});

Expand Down
6 changes: 3 additions & 3 deletions chrome-extension/src/background/organizeTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ async function organizeTabs(mode = 'domain', allWindows = false) {
await chrome.tabs.ungroup(toRemove);
}

// Update group title with new count (preserve color and collapsed state)
// Update group title (preserve color and collapsed state)
await chrome.tabGroups.update(existingGroup.id, {
title: `${groupName} (${newTabIds.length})`
title: groupName
});

groupsUpdated++;
Expand All @@ -221,7 +221,7 @@ async function organizeTabs(mode = 'domain', allWindows = false) {
const groupId = await chrome.tabs.group({ tabIds: newTabIds });

await chrome.tabGroups.update(groupId, {
title: `${groupName} (${newTabIds.length})`,
title: groupName,
color: getNextColor(),
collapsed: false
});
Expand Down
Loading