 
        Greasy Fork is available in English.
Sort directories before files in repository tree view
A user script designed to sort directories before files in the repository tree view on git.sr.ht.
Once installed, the script will automatically sort directories before files whenever you're viewing the tree on git.sr.ht.
The script uses the following logic to sort the tree list:
Identify Tree List:
const tree_list = document.querySelector(".tree-list");
Classify Nodes:
.name to categorize them into directories (trees) and files (blobs).Sorting Mechanism:
trees and blobs to sort the children of tree_list with directories prioritized.Reordering:
tree_list.This script is released under the GPL-3.0 License.