src/vs/workbench/services/editor/common/editorGroupColumn.ts/columnToEditorGroup
export function columnToEditorGroup(editorGroupService: IEditorGroupsService, column?: EditorGroupColumn): GroupIdentifier | ACTIVE_GROUP_TYPE | SIDE_GROUP_TYPE {
	if (
		typeof column !== 'number' ||
		column === ACTIVE_GROUP ||
		(editorGroupService.count === 1 && editorGroupService.activeGroup.isEmpty)
	) {
		return ACTIVE_GROUP; // prefer active group when position is undefined or passed in as such or when no editor is opened
	}

	if (column === SIDE_GROUP) {
		return SIDE_GROUP; // return early for when column is to the side
	}

	const groupInColumn = editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE)[column];
	if (groupInColumn) {
		return groupInColumn.id; // return group when a direct match is found in column
	}

	return SIDE_GROUP; // finally open to the side when group not found
}