Skip to content

Commit c0f7432

Browse files
JonasBaTkDodo
andauthored
stories: sort children of categories (#86168)
We were only sorting the categories, and forgetting to sort the individual file in each category --------- Co-authored-by: Dominik Dorfmeister <[email protected]>
1 parent 328bd55 commit c0f7432

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

static/app/views/stories/storyTree.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ export function useStoryTree(
206206
root.children = Object.fromEntries(
207207
Object.entries(root.children).sort(rootCategorySort)
208208
);
209+
// Sort the children of each category by file, folder or alphabetically
210+
Object.values(root.children).forEach(child => {
211+
child.sort(folderOrSearchScoreFirst);
212+
});
209213
}
210214

211215
// If the user navigates to a story, expand to its location in the tree

0 commit comments

Comments
 (0)