refactor(extension): rename createOwnedGroup to match post-rollback semantics

Both reviewers flagged that the function no longer ungroups on title-update
failure (Fix 1 dropped the rollback), so the -WithRollback suffix misled.
Pure rename, no behavior change.
This commit is contained in:
jackwener
2026-06-05 22:12:36 +08:00
parent 8f049d9260
commit 8505facfa6
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -1147,7 +1147,7 @@ async function attachTabsToOwnedGroup(role, group, ids) {
updateOwnedSessionWindowForTabs(role, ids, group.windowId);
return group;
}
async function createOwnedGroupWithRollback(role, windowId, ids) {
async function createOwnedGroup(role, windowId, ids) {
if (ids.length === 0) throw new Error(`Cannot create ${role} tab group without tabs`);
await ensureTabsInWindow(ids, windowId);
const groupId = await chrome.tabs.group({ tabIds: ids, createProperties: { windowId } });
@@ -1183,7 +1183,7 @@ async function ensureOwnedContainerGroupUnlocked(role, fallbackWindowId, ids) {
canonical = await ensureCanonicalGroupTitle(role, canonical);
canonical = await attachTabsToOwnedGroup(role, canonical, ids);
} else if (fallbackWindowId !== null && ids.length > 0) {
canonical = await createOwnedGroupWithRollback(role, fallbackWindowId, ids);
canonical = await createOwnedGroup(role, fallbackWindowId, ids);
}
if (canonical) {
ownedContainers[role].windowId = canonical.windowId;
+2 -2
View File
@@ -697,7 +697,7 @@ async function attachTabsToOwnedGroup(
return group;
}
async function createOwnedGroupWithRollback(
async function createOwnedGroup(
role: OwnedWindowRole,
windowId: number,
ids: number[],
@@ -757,7 +757,7 @@ async function ensureOwnedContainerGroupUnlocked(
canonical = await ensureCanonicalGroupTitle(role, canonical);
canonical = await attachTabsToOwnedGroup(role, canonical, ids);
} else if (fallbackWindowId !== null && ids.length > 0) {
canonical = await createOwnedGroupWithRollback(role, fallbackWindowId, ids);
canonical = await createOwnedGroup(role, fallbackWindowId, ids);
}
if (canonical) {