codesandbox / codesandbox/codesandbox-client

Sandbox folders should show the total sandboxes and not just the 1st level sandboxes

Open
#6,626 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.6k
Forks
2.4k
Avg merge
6d 19h
Merged PRs (30d)
2

Description

🌈 Feature

Sandbox folders should show the total sandboxes and not just the 1st level sandboxes, Currently, nested sandboxes within sub-folders are not part of the number of sandboxes shown beside the folder name.

image

We can calculate the sandboxes on the front end or get the same from the API.

I can open a PR for this if we chose to calculate them on the frontend using the path property

For folders with /CSS in the path, the count of them will be added and the total count will be shown for the "CSS" folder.

{
    "data": {
        "me": {
            "collections": [
                {
                    "id": "8d3a2ea4-e5ca-4a8c-abe2-a04593fddf3c",
                    "path": "/CSS",
                    "sandboxCount": 7
                },
                {
                    "id": "db85311a-67b0-4833-9400-891a3e0dd620",
                    "path": "/CSS/examples",
                    "sandboxCount": 1
                },
                {
                    "id": "543acbc0-6b5e-458f-bb09-931c4a7209ef",
                    "path": "/CSS/overflow",
                    "sandboxCount": 0
                },
                {
                    "id": "0ed3de54-0d3b-4ddd-ac88-4cd79fa76964",
                    "path": "/CSS/tutorial",
                    "sandboxCount": 4
                },
            ]
        }
    }
}

Over here the total Count will be : 12.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how collection folders render their sandboxCount in the frontend and how the collections data is supplied by the API. Decide whether nested counts should be aggregated client-side from each path or returned by the API. Done means a folder count includes sandboxes in all nested subfolders, including folders with zero direct sandboxes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.