Skip to content

audit: sort Search results by displayed name - #149

Merged
StanleyLl0yd merged 3 commits into
mainfrom
audit/search-basename-sort
Oct 12, 2026
Merged

StanleyLl0yd merged 3 commits into
mainfrom
audit/search-basename-sort

Conversation

@StanleyLl0yd

@StanleyLl0yd StanleyLl0yd commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Repository-wide audit correctness fix for #145.

Original exact audit baseline: a866d398b3337ccb71e8aec4d671847e39b3f169.
Updated exact base after #148 merge: 2b5972dfd6328da9283830d36a3c339293afc626.
Current re-synced exact PR head: 79646ff4bd8e53b47209031001f20a5e50e83db1.

Finding: SortOption.name compares the entire FolderUsage.path. Tree siblings usually have a shared prefix, but flattened Search results may come from different parents; the chosen Name sort then follows parent directories instead of the displayed basename.

Changes:

  • compare lhs.name vs rhs.name with the existing localized case-insensitive comparison;
  • preserve full path as deterministic tie-breaker;
  • compute FolderUsage.name lastPathComponent once per access, rather than twice (same fallback semantics);
  • add a synthetic cross-directory test covering direct SortOption.name and the actual Search presentation preprocessor.

Exactly three files: Utilities.swift, FolderUsage.swift, and DiskUsageTests/FolderUsageTests.swift.
No scanner, filesystem, Trash, pagination, persistence, localization resources, dependencies, workflows or release changes.

Merge only after full exact-head CI/Security/Dependency Review/CodeQL and zero review threads, and after preceding merged-main gates are green. Verify exact-main after merge.

@StanleyLl0yd
StanleyLl0yd force-pushed the audit/search-basename-sort branch from b7b2095 to 79646ff Compare October 12, 2026 13:23
@StanleyLl0yd
StanleyLl0yd merged commit d5906be into main Oct 12, 2026
8 checks passed
@StanleyLl0yd
StanleyLl0yd deleted the audit/search-basename-sort branch October 12, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant