hunk.code_window:     const fetchWorkspaceName = useCallback(async () => {
           if (!currentSpaceId) {
               return;
           }
           const name = await services.api.userConfig.getWorkspaceName(
               currentSpaceId
           );
           setWorkspaceName(name);
  
hunk.labels: keep keep keep keep keep replace replace replace replace keep
hunk.after_edit:         const [name, workspaceId] = await Promise.all([
               services.api.userConfig.getWorkspaceName(currentSpaceId),
               services.api.userConfig.getWorkspaceId(currentSpaceId),
           ]);
  
hunk.file_path: apps/ligo-virgo/src/pages/workspace/docs/workspace-name.tsx
hunk.type: replace
file: import { TreeItem, TreeItems } from './../workspace-sidebar/page-tree';
  
  const pickPath = (treeItems: TreeItem | TreeItems, targetId: string) => {
      const pick = (tree: TreeItem, result: TreeItem[] = []) => {
          if (tree.id === targetId) {
              result.push(tree);
              return result;
          }
  
          for (const child of tree?.children || []) {
              if (pick(child, result).length) {
                  result.unshift(tree);
                  break;
              }
          }
  
          return result;
      };
  
      return (Array.isArray(treeItems) ? treeItems : [treeItems]).map(treeItem =>
          pick(treeItem)
      );
  };
  
  export { pickPath };
  