Streamlining Code Navigation: A GitHub Feature Request for Enhanced Development Performance
In the fast-paced world of software development, every small improvement in tooling can significantly impact a team's overall development performance. A recent GitHub Community discussion, initiated by user cohei, sheds light on a seemingly minor UI preference that could yield substantial benefits for code navigation and developer efficiency: the option to sort files and directories together alphabetically in the GitHub Web UI.
The Current Challenge: Directories First, Files Second
Currently, when developers browse a repository's code page or navigate the file tree in a Pull Request, GitHub's default sorting mechanism prioritizes directories, listing them all alphabetically, followed by all files, also sorted alphabetically. While this approach has its merits, cohei argues that it often disrupts logical groupings and slows down the process of understanding a project's structure.
Separated Siblings: When Paired Files and Directories Drift Apart
Many modern programming languages and frameworks employ conventions where a file and a directory with the same name form a logical pair. For instance:
- Rust: A module like
foo.rsmight have a correspondingfoo/directory for submodules. - Haskell: Similarly,
Map.hscould be paired with aMap/directory.
Under GitHub's current sorting, foo/ appears at the top among directories, while foo.rs is listed much further down among files. This separation forces developers to mentally connect disparate elements, hindering quick comprehension and impacting development performance.
The Proposal: A Unified Alphabetical View for Enhanced Developer Experience
cohei's proposal is straightforward: introduce a user preference (e.g., in Settings > Appearance) to enable a "mixed" alphabetical sort, where files and directories are interleaved in a single, unified list. This change would apply across the repository code page, the code sidebar file tree, and the "Files changed" view in Pull Requests.
Why Mixed Sorting Boosts Development Performance
- Immediate Context: Paired files and directories would appear adjacent, making their relationship instantly clear. This reduces cognitive load and speeds up navigation.
- Intuitive Scanning: Developers typically look for a specific name (e.g., 'utils', 'api') rather than first categorizing by 'file' or 'directory'. A single alphabetical list aligns with this natural search pattern, improving the overall development performance of code exploration.
- Industry Precedent: This isn't a novel concept. Other widely used developer tools already offer mixed sorting:
- VS Code: Has supported
"explorer.sortOrder": "mixed"since version 1.15 (July 2017). lscommand: Defaults to mixed sorting (unless--group-directories-firstis used).- macOS Finder: Uses mixed alphabetical sorting by default, with directories-first as an opt-in.
- VS Code: Has supported
Implications for Engineering OKRs
For platform teams at GitHub, considering such UI/UX enhancements could be a valuable engineering OKR. Improving the developer experience directly translates to increased efficiency and satisfaction for millions of users. While GitHub's automated response acknowledged the feedback, the discussion highlights a tangible opportunity to refine the platform's usability.
Ultimately, providing developers with the flexibility to customize their file sorting preferences could significantly streamline code navigation, reduce friction, and contribute positively to their daily development performance.
