Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature and code refactor #77

Merged
merged 18 commits into from
Oct 13, 2024
Merged

New feature and code refactor #77

merged 18 commits into from
Oct 13, 2024

Commits on Oct 6, 2024

  1. Refactor PulsoidModule and related classes

    Refactored PulsoidModule and related classes to improve modularity and maintainability. Centralized settings in PulsoidModuleSettings and simplified methods by delegating responsibilities to appropriate classes and methods.
    
    - DataController.cs: Removed Pulsoid-related settings, added OptionsTabState settings.
    - OSCController.cs: Simplified AddHeartRate method.
    - PulsoidModule.cs: Introduced new observable properties, refactored methods to use new settings.
    - PulsoidTrendSymbolSet: Removed redundant public keyword.
    - MainWindow.xaml: Updated data bindings to use HeartRateConnector properties.
    - ViewModel.cs: Removed heart rate-related properties, encapsulated them in HeartRateConnector.
    BoiHanny committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    4377cd0 View commit details
    Browse the repository at this point in the history
  2. Add Pulsoid stats and improve heart rate handling

    - OSCController.cs: Add checks for IntgrHeartRate and null heart rate string.
    - AfkModule.cs: Change FormatDuration access modifier to public.
    - PulsoidModule.cs: Add pulsoidStatsEnabled property, adjust heart rate stats, refactor display text with StringBuilder, and add HeartRateMonitoringLoopAsync method.
    - MainWindow.xaml: Add UI elements for configuring and displaying Pulsoid statistics.
    BoiHanny committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    4dc5b32 View commit details
    Browse the repository at this point in the history
  3. Update project version to 0.9.025

    The version number of the project has been updated from 0.9.021 to 0.9.025.
    BoiHanny committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    30546a4 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2024

  1. Update observable properties and trend symbols

    Added `hideCurrentHeartRate` property with default `false`. Changed default values of `showCalories` and `showDuration` to `false`. Removed `showMinHeartRate` property. Modified `RefreshTrendSymbols` to include `PulsoidTrendSymbolSet` with "↑" and "↓". Updated display text logic to respect `hideCurrentHeartRate`. Corrected order of max/min heart rate stats. Standardized default trend symbols to "↑" and "↓".
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    bafbe38 View commit details
    Browse the repository at this point in the history
  2. Expand OAuth2 scope to include profile and statistics read

    The OAuth2 authorization request scope has been expanded from
    "data:heart_rate:read" to include "profile:read" and
    "data:statistics:read". This change allows the application to
    request additional permissions for reading the user's profile
    and statistics data, enhancing the range of accessible data
    from the Pulsoid service.
    
    This was a bug, people couldn't do manual OAuth2 because the scopes where not correct...
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    d6c721a View commit details
    Browse the repository at this point in the history
  3. Update UI layout and dependencies in MagicChatbox

    - Updated LibreHardwareMonitorLib to 0.9.4-pre350 in MagicChatbox.csproj.
    - Adjusted margins for better spacing and alignment in MainWindow.xaml.
    - Corrected typo in TextBlock from "peroid" to "period".
    - Repositioned and updated margins for several CheckBox elements.
    - Added new CheckBox for hiding current heart rate when showing stats.
    - Introduced new TextBlock for HeartRateTitleStackMethod_checkbox.
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    401ce48 View commit details
    Browse the repository at this point in the history
  4. Add SoundpadModule to ViewModel and clean up usings

    Introduced a new private field `_SoundpadModule` and its public
    property `SoundpadModule` in the `ViewModel` class, including
    instantiation with a parameter `1000` and property change
    notification handling. Reorganized and removed unnecessary
    `using` directives for better code organization.
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    45aa57c View commit details
    Browse the repository at this point in the history
  5. Refactor SoundpadModule initialization and access

    - Update progress message in App.xaml.cs from 96% to 98%.
    - Remove Soundpad Module initialization from App.xaml.cs.
    - Remove public static SoundpadModule from DataController.cs.
    - Add private static readonly dictionary SuperscriptMapping to DataController.cs.
    - Replace DataController.soundpadModule with ViewModel.Instance.SoundpadModule in OSCController.cs.
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    804562e View commit details
    Browse the repository at this point in the history
  6. Refactor SoundpadModule to use ObservableObject

    Refactored the SoundpadModule class to use the ObservableObject pattern from the CommunityToolkit.Mvvm.ComponentModel library, replacing the previous INotifyPropertyChanged implementation. Added new observable properties such as Error, ErrorString, EnablePanel, IsSoundpadRunning, Stopped, CurrentSoundpadState, PlayingNow, and PlayingSong. Converted several methods from static to instance methods, including InitializeSoundpadModuleAsync, UpdateSoundpadState, InitializeAndStartModuleIfNeeded, StartModule, StopModule, ShouldStartMonitoring, ExecuteSoundpadCommand, PlayNextSound, PlayPreviousSound, TogglePause, StopSound, PlaySound, PlaySoundFromCategory, and PlaySoundByIndex. Added new methods PlayRandomSound and PlaySoundByIndex. Improved error handling and updated the soundpadState enum to include a new state Unknown. Removed the PropertyChanged event and handler, as ObservableObject now handles property change notifications. Enhanced the overall structure and maintainability of the code.
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    7e1ec44 View commit details
    Browse the repository at this point in the history
  7. Enhance Soundpad UI and add new control handlers

    Updated MainWindow.xaml to improve Soundpad UI with new layout,
    buttons, and styling. Added event handlers in MainWindow.xaml.cs
    for play, pause, previous, next, stop, and random sound controls.
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    47ee2b1 View commit details
    Browse the repository at this point in the history
  8. Add GlowyButtonSoundpadWithText style for Button elements

    A new style named `GlowyButtonSoundpadWithText` has been added for `Button` elements, featuring custom property setters for background, foreground, font size, height, opacity, cursor, and font family. The style includes a `ControlTemplate` with a `Grid`, `Border`, and `ContentPresenter`, and defines triggers for `MouseOver`, `IsPressed`, and `IsEnabled` states. The previous `DropShadowEffect` setter has been removed.
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    92a01f0 View commit details
    Browse the repository at this point in the history
  9. Update models, moderation logic, and message handling

    - Added `gpt4omini` and `gpt4_turbo` to `IntelliGPTModel` enum.
    - Modified `Settings.PerformModerationCheckModel` logic.
    - Updated initial system message in sentence rewriting.
    - Removed logic for handling selected languages.
    - Reduced `maxTokens` in `GetCompletionAsync` from 120 to 60.
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    9dfe263 View commit details
    Browse the repository at this point in the history
  10. Enhance translation and add spelling/grammar check

    Improved translation handling by using `Settings.SelectedTranslateLanguage` for `intelliChatLanguage` and adding system messages for accurate translation and supported languages. Reformatted `ChatRequest` instantiation for readability. Introduced `PerformSpellingAndGrammarCheckAsync` method to check spelling and grammar, ensuring `Settings.IntelliChatUILabel` is set correctly based on response status.
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    60cfb0c View commit details
    Browse the repository at this point in the history
  11. Enhance IntelliChat functionality and add new method

    - Ensure early return if moderation check fails.
    - Update settings for IntelliChat UI label and text.
    - Introduce `intelliChatWritingStyle` variable.
    - Modify message construction for better clarity.
    - Refactor language consideration code.
    - Update OpenAI API request: reduce `maxTokens` to 60, add `temperature` of 0.3.
    - Maintain existing error handling.
    - Add `RejectIntelliChatSuggestion` method to clear text and update status.
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    4fa7f7f View commit details
    Browse the repository at this point in the history
  12. Refactor response handling and add text sanitization

    Refactored code to improve handling and processing of OpenAI API responses. Introduced `SanitizeShortenedText` method to sanitize and trim response text to 140 characters or fewer. Updated prompt for clearer instructions. Enhanced message construction for role clarity and language selection. Adjusted retry logic for text shortening to allow two retries. Simplified `ProcessResponse` method by removing redundant checks. Ensured `SanitizeShortenedText` removes leading/trailing quotation marks and trims text. Utilized `RemoveQuotationMarkAroundResponse` within `SanitizeShortenedText`.
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    4cacd32 View commit details
    Browse the repository at this point in the history
  13. Refine prompt and update model parameters

    - Refined prompt for generating creative conversation starters
    - Added role clarity in message construction
    - Included language consideration when auto-selection is off
    - Adjusted model parameters: maxTokens=20, temperature=0.7
    - Dynamically retrieve model name using GetModelDescription
    - Removed old prompt and outdated API call method
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    c1854ed View commit details
    Browse the repository at this point in the history
  14. Update project version to 0.9.030

    The version number of the project has been updated from 0.9.025 to 0.9.030.
    BoiHanny committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    cd6ff10 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2024

  1. Update project version to 0.9.032

    The version number of the project has been updated from 0.9.030 to 0.9.032.
    BoiHanny committed Oct 12, 2024
    Configuration menu
    Copy the full SHA
    b70ec10 View commit details
    Browse the repository at this point in the history