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.

Illustration showing the difference between mixed and directories-first file sorting, highlighting improved code navigation.
Illustration showing the difference between mixed and directories-first file sorting, highlighting improved code navigation.

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.rs might have a corresponding foo/ directory for submodules.
  • Haskell: Similarly, Map.hs could be paired with a Map/ 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.

GitHub Octocat examining an organized, mixed-alphabetical file list in settings, symbolizing user preference.
GitHub Octocat examining an organized, mixed-alphabetical file list in settings, symbolizing user preference.

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).
    • ls command: Defaults to mixed sorting (unless --group-directories-first is used).
    • macOS Finder: Uses mixed alphabetical sorting by default, with directories-first as an opt-in.

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.

Track, Analyze and Optimize Your Software DeveEx!

Effortlessly implement gamification, pre-generated performance reviews and retrospective, work quality analytics, alerts on top of your code repository activity

 Install GitHub App to Start
devActivity Screenshot