Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 14, 2025

Summary

Implements optional sorting of programming languages as requested in #32. Users can now choose whether their programming languages are displayed sorted alphabetically or in the order they were added.

Changes Made

  • Database Schema: Added new field programming_languages_sorted (defaults to True for backward compatibility)
  • New Commands:
    • Enable sorting: сортировать, sort, включить сортировку, enable sorting
    • Disable sorting: не сортировать, no sort, выключить сортировку, disable sorting
  • Enhanced Info Display: Shows sorting status in user info (only for current user viewing their own profile)
  • Core Logic: Updated DataBuilder.build_programming_languages to respect user's sorting preference
  • Tests: Added comprehensive unit tests for the new functionality

Technical Implementation

  1. Data Layer: Extended BetterBotBaseDataService to include the new preference field
  2. Command Layer: Added change_sorting_preference method with appropriate feedback messages
  3. Display Layer: Modified message builders to respect sorting preference and show status
  4. Pattern Matching: Added regex patterns for multilingual command support (Russian/English)

Backward Compatibility

  • Existing users will default to sorted display (current behavior)
  • No breaking changes to existing functionality
  • All existing tests continue to pass

Test plan

  • Unit tests added for sorting preference functionality
  • Integration with existing command system verified
  • Backward compatibility confirmed through existing test suite
  • Manual testing patterns for command recognition
  • Database schema migration handled gracefully

🤖 Generated with Claude Code


Resolves #32

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #32
@konard konard self-assigned this Sep 14, 2025
Add user preference for programming language sorting with the following features:
- New database field 'programming_languages_sorted' (defaults to True for backward compatibility)
- Commands to enable/disable sorting: 'сортировать'/'sort' and 'не сортировать'/'no sort'
- Updated info message to show sorting status for current user
- Updated data builder to respect user's sorting preference
- Added comprehensive tests for the new functionality

Users can now choose whether their programming languages are displayed sorted alphabetically or in the order they were added.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@konard konard changed the title [WIP] Implement optional sorting of programming languages Implement optional sorting of programming languages Sep 14, 2025
@konard konard marked this pull request as ready for review September 14, 2025 01:58
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.

Implement optional sorting of programming languages

2 participants