ClinicianFOCUS / FreeScribe

A medical scribe capable of creating SOAP notes running Whisper and Kobold based on conversation with a patient
GNU General Public License v3.0
0 stars 0 forks source link

Reformatted settings menu #6

Closed ItsSimko closed 2 weeks ago

ItsSimko commented 2 weeks ago

Reformatted settings menu

Description

Redid the settings menu to use tabs and started to modulate code.

Changes Made

Related Issues

New Look: image image

Summary by Sourcery

Reformat the settings menu to use a tabbed interface and modularize the code by introducing an ApplicationSettings class. Update the main client to utilize this new class for managing settings. Enhance documentation with Sphinx-style comments for the new class.

New Features:

Enhancements:

Documentation:

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This pull request refactors the settings management of the application by introducing a new ApplicationSettings class. The changes aim to improve code organization, modularity, and maintainability by centralizing settings-related functionality.

User journey diagram for the updated settings menu

journey
    title User journey for the updated settings menu
    section Accessing Settings
      User opens application: 5: User
      User clicks on Settings button: 5: User
      Application opens settings window: 5: System
    section Navigating Settings
      User sees Basic and Advanced tabs: 5: User
      User selects Basic tab: 5: User
      User selects Advanced tab: 5: User
    section Modifying Settings
      User modifies settings in Basic tab: 5: User
      User modifies settings in Advanced tab: 5: User
      User saves changes: 5: User
      Application saves settings to file: 5: System
    section Closing Settings
      User closes settings window: 5: User
      Application returns to main interface: 5: System

Class diagram for the new ApplicationSettings class

classDiagram
    class ApplicationSettings {
        -String KOBOLDCPP_IP
        -String WHISPERAUDIO_IP
        -String KOBOLDCPP_PORT
        -String WHISPERAUDIO_PORT
        -String SSL_ENABLE
        -String SSL_SELFCERT
        -String OPENAI_API_KEY
        -String AISCRIBE
        -String AISCRIBE2
        -String API_STYLE
        -Map editable_settings
        -Map editable_settings_entries
        +load_settings_from_file() Tuple
        +save_settings_to_file() void
        +save_settings(String, String, String, String, String, Toplevel, String, String, int, int, String) void
        +open_settings_window() void
        +load_aiscribe_from_file() String
        +load_aiscribe2_from_file() String
        +build_url(String, String) String
        +start() void
        +clear_settings_file(Toplevel) void
    }
    note for ApplicationSettings "This class manages application settings related to audio processing and external API services."

File-Level Changes

Change Details Files
Introduced a new ApplicationSettings class to manage application settings
  • Created a new file ApplicationSettings_client.py with the ApplicationSettings class
  • Moved settings-related code from client.py to ApplicationSettings class
  • Implemented methods for loading and saving settings
  • Added functionality to manage basic and advanced settings separately
ApplicationSettings_client.py
client.py
Refactored the settings window to use a tabbed interface
  • Created separate tabs for basic and advanced settings
  • Implemented scrollable frames for each settings tab
  • Reorganized settings fields into appropriate tabs
ApplicationSettings_client.py
Updated client.py to use the new ApplicationSettings class
  • Removed redundant settings-related code from client.py
  • Created an instance of ApplicationSettings in client.py
  • Updated references to settings throughout client.py to use the new ApplicationSettings instance
client.py
Modified the GitHub Actions workflow file
  • Removed specific NSIS script and output file references
  • Removed the 'overwrite' parameter from the release creation step
.github/workflows/release.yml

Possibly linked issues


Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
yingbull commented 2 weeks ago

Keep adding inline comments, and it would be good to keep refactoring slightly (ie config object, more functions) when possible as we move other work forward.