Skip to content

feat: add size sort toggle button to category detail view#14

Open
jeffdeen wants to merge 1 commit intomomenbasel:mainfrom
jeffdeen:feat/sort-by-size
Open

feat: add size sort toggle button to category detail view#14
jeffdeen wants to merge 1 commit intomomenbasel:mainfrom
jeffdeen:feat/sort-by-size

Conversation

@jeffdeen
Copy link
Copy Markdown
Contributor

Summary

  • Add a sort toggle button (↑↓ icon) to the file list toolbar in CategoryDetailView, next to "Deselect All"
  • Clicking the button toggles between descending (largest first) and ascending (smallest first) order by file size
  • Defaults to largest-first sorting, with a tooltip indicating the current sort order

Changes

  • PureMac/Views/CategoryDetailView.swift:
    • Added @State private var sortDescending to track sort direction
    • Added sort toggle button with arrow.up.arrow.down SF Symbol icon
    • Added sortedItems(_:) helper to sort items by size
    • Updated ForEach to use sorted items

Test plan

  • Build and run the app
  • Navigate to any category detail view with scanned items
  • Verify items default to largest-first order
  • Click the sort button and verify items reorder to smallest-first
  • Click again and verify it toggles back
  • Hover over the sort button and verify tooltip shows correct sort order

Add a sort button (arrow.up.arrow.down icon) to the right of "Deselect All",
defaulting to largest-first. Clicking toggles between descending/ascending
order without changing the icon.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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