Skip to content

Enhance Settings Toggle: Disable Advanced Whisper & AI Context Window#478

Open
Yogesh-333 wants to merge 5 commits into
devfrom
feature/toggle-whisper-ai-context
Open

Enhance Settings Toggle: Disable Advanced Whisper & AI Context Window#478
Yogesh-333 wants to merge 5 commits into
devfrom
feature/toggle-whisper-ai-context

Conversation

@Yogesh-333

@Yogesh-333 Yogesh-333 commented Mar 26, 2025

Copy link
Copy Markdown
  • Disabled only advanced Whisper settings when Built-in Speech2Text is OFF.
  • Disabled only AI Context Window when Built-in AI Processing is OFF.
  • Ensured other AI settings remain unaffected.
    image
    image

Summary by Sourcery

Improve settings toggle functionality by conditionally disabling advanced Whisper and AI Context Window settings based on local processing mode

Bug Fixes:

  • Fix settings state management to correctly disable advanced settings when local processing is turned off

Enhancements:

  • Refactor settings toggle logic to provide more granular control over advanced settings visibility

- Disabled only advanced Whisper settings when Built-in Speech2Text is OFF.
- Disabled only AI Context Window Size when Built-in AI Processing is OFF.
- Ensured other AI settings remain unaffected.
@sourcery-ai

sourcery-ai Bot commented Mar 26, 2025

Copy link
Copy Markdown

Reviewer's Guide by Sourcery

This pull request enhances the settings toggle functionality by disabling advanced Whisper settings when Built-in Speech2Text is OFF and disabling the AI Context Window when Built-in AI Processing is OFF. It also ensures that the UI states for Whisper and AI settings are correctly initialized when the settings window is opened.

Sequence diagram for toggling remote Whisper settings

sequenceDiagram
    participant UI
    participant Settings

    UI->>UI: User toggles Built-in Speech2Text (LOCAL_WHISPER)
    UI->>Settings: Get current state of LOCAL_WHISPER
    Settings-->>UI: Returns current state
    UI->>UI: Determine state for Whisper settings
    loop For each basic whisper setting
        UI->>UI: config(state=state)
    end
    loop For each advanced whisper setting
        UI->>UI: config(state=inverted_state)
    end
    UI->>UI: config(state=inverted_state) for whisper_models_drop_down
    UI->>UI: config(state=inverted_state) for whisper_architecture_dropdown
Loading

Sequence diagram for toggling remote LLM settings

sequenceDiagram
    participant UI
    participant Settings

    UI->>UI: User toggles Built-in AI Processing (LOCAL_LLM)
    UI->>Settings: Get current state of LOCAL_LLM
    Settings-->>UI: Returns current state
    UI->>UI: Determine state for LLM settings
    UI->>UI: config(state=state) for openai_api_key_entry
    loop For each LLM setting
        UI->>UI: config(state=state)
    end
    loop For each AI context setting
        UI->>UI: config(state=inverted_state)
    end
    UI->>UI: config(state=inverted_state) for architecture_dropdown
Loading

File-Level Changes

Change Details Files
Conditionally disable advanced Whisper settings based on the state of the Built-in Speech2Text setting.
  • Modified the toggle_remote_whisper_settings function to disable advanced Whisper settings when Built-in Speech2Text is OFF.
  • Added logic to invert the state of advanced Whisper settings, enabling them when Built-in Speech2Text is OFF and disabling them when it's ON.
src/FreeScribe.client/UI/SettingsWindowUI.py
Conditionally disable the AI Context Window setting based on the state of the Built-in AI Processing setting.
  • Modified the toggle_remote_llm_settings function to disable the AI Context Window setting when Built-in AI Processing is OFF.
  • Added logic to invert the state of the AI Context Window setting, enabling it when Built-in AI Processing is OFF and disabling it when it's ON.
src/FreeScribe.client/UI/SettingsWindowUI.py
Ensured that the UI states for Whisper and AI settings are correctly initialized when the settings window is opened.
  • Added calls to toggle_remote_whisper_settings and toggle_remote_llm_settings in the open_settings_window function to initialize the UI states.
  • This ensures that the settings are correctly enabled or disabled based on the initial values of the Built-in Speech2Text and Built-in AI Processing settings.
src/FreeScribe.client/UI/SettingsWindowUI.py

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. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the 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 exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard 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

Comment thread src/FreeScribe.client/client.py Fixed

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Yogesh-333 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider extracting the common logic for toggling widget states into a separate helper function to reduce code duplication.
  • It might be cleaner to use boolean variables directly instead of comparing to 0 for state management.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/FreeScribe.client/client.py Outdated
@ItsSimko ItsSimko changed the title Enhance Settings Toggle: Disable Advanced Whisper & AI Context Window Enhance Settings Toggle: Disable Advanced Whisper & AI Context Window (dev-branch) Mar 31, 2025
@yingbull

yingbull commented Apr 7, 2025

Copy link
Copy Markdown

I don't think this works, isn't the translate for remote here?

@Yogesh-333

Copy link
Copy Markdown
Author

I don't think this works, isn't the translate for remote here?

@yingbull yes it should be there sorry i missed it but added it now . Should be fine.

image

@ItsSimko ItsSimko changed the base branch from dev to main May 7, 2025 15:21
@ItsSimko ItsSimko changed the title Enhance Settings Toggle: Disable Advanced Whisper & AI Context Window (dev-branch) Enhance Settings Toggle: Disable Advanced Whisper & AI Context Window May 7, 2025
@ItsSimko ItsSimko changed the base branch from main to dev May 7, 2025 15:22
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.

3 participants