Skip to content

Add sorting functionality (#67, #74)#82

Open
trek-e wants to merge 2 commits intorubenwe:masterfrom
trek-e:feature/sorting
Open

Add sorting functionality (#67, #74)#82
trek-e wants to merge 2 commits intorubenwe:masterfrom
trek-e:feature/sorting

Conversation

@trek-e
Copy link
Copy Markdown

@trek-e trek-e commented Jan 24, 2026

Summary

Adds ability to sort library items by name, date, or file size. Addresses both #67 and #74.

Sort Modes

Mode Description
Name A-Z Alphabetical ascending (default)
Name Z-A Alphabetical descending
Date Newest Most recently modified first
Date Oldest Oldest modified first
Size Largest Largest files first
Size Smallest Smallest files first

Changes

  • New: SortMode.cs - Enum defining sort options
  • Modified: PreviewList.cs - Maintains sorted order, supports re-sorting
  • Modified: IPreviewList.cs - Added SetSortMode() interface method
  • Modified: ItemsModel.cs - Sort mode state management
  • Modified: LibraryView.cs - Keyboard shortcuts

Keyboard Shortcuts

  • Ctrl+1 - Name A-Z
  • Ctrl+2 - Name Z-A
  • Ctrl+3 - Date (newest)
  • Ctrl+4 - Date (oldest)
  • Ctrl+5 - Size (largest)
  • Ctrl+6 - Size (smallest)

Note on UI

Adding a visual sort button/dropdown in the UI requires modifying Unity scene files, which cannot be done from code alone. The keyboard shortcuts provide immediate functionality. A follow-up could add a sort dropdown in the Unity Editor.

Test plan

  • Verify Ctrl+1 sorts by name A-Z
  • Verify Ctrl+3 sorts by date (newest first)
  • Verify Ctrl+5 sorts by file size (largest first)
  • Verify sorting persists when filtering by tags
  • Verify new items are inserted in correct sorted position

🤖 Generated with Claude Code

trek-e and others added 2 commits January 23, 2026 18:39
- STACK.md - Technologies and dependencies
- ARCHITECTURE.md - System design and patterns
- STRUCTURE.md - Directory layout
- CONVENTIONS.md - Code style and patterns
- TESTING.md - Test structure
- INTEGRATIONS.md - External services
- CONCERNS.md - Technical debt and issues
- Add SortMode enum with 6 sort options:
  - Name (ascending/descending)
  - Date (newest/oldest)
  - Size (largest/smallest)

- Update PreviewList to maintain sort order:
  - SetSortMode() method to change sort
  - Resort() to reorder existing items
  - ApplySort() for new items
  - FindInsertIndex() for sorted insertion

- Update ItemsModel with sort mode management:
  - SetSortMode() method
  - CurrentSortMode property
  - Apply sort when search changes

- Add keyboard shortcuts in LibraryView:
  - Ctrl+1: Name A-Z
  - Ctrl+2: Name Z-A
  - Ctrl+3: Date (newest first)
  - Ctrl+4: Date (oldest first)
  - Ctrl+5: Size (largest first)
  - Ctrl+6: Size (smallest first)

Note: UI sort button requires Unity Editor changes (scene modification).
Keyboard shortcuts provide immediate functionality.

Co-Authored-By: Claude Opus 4.5 <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