Skip to content

Boost: Added Toggle Microphone Mute as Double-click Action option - #2174

Merged
Belphemur merged 3 commits into
devfrom
double-click
May 27, 2026
Merged

Belphemur merged 3 commits into
devfrom
double-click

Conversation

@XangelMusic

Copy link
Copy Markdown
Collaborator

No description provided.

@coderabbitai

coderabbitai Bot commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 78dddfdd-acf7-48ba-a6e1-ebf9c5be919b

📥 Commits

Reviewing files that changed from the base of the PR and between 52cf927 and c510465.

📒 Files selected for processing (6)
  • SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs
  • SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAbstract.cs
  • SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerNone.cs
  • SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IconDoubleClickToggleMicrophoneMute.cs
  • SoundSwitch/Model/AppModel.cs
  • SoundSwitch/Model/IAppModel.cs
🚧 Files skipped from review as they are similar to previous changes (6)
  • SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerNone.cs
  • SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs
  • SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAbstract.cs
  • SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IconDoubleClickToggleMicrophoneMute.cs
  • SoundSwitch/Model/IAppModel.cs
  • SoundSwitch/Model/AppModel.cs

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Toggle microphone mute by double-clicking the tray icon (new localized label).
  • Changes

    • Tray icon switching behavior and migration defaults updated (default icon option adjusted; legacy systray handling migrated).
    • Icon mode name simplified: "Never" renamed to "None".

Walkthrough

This PR standardizes icon changer class names and enum member (Never → None) and wires those changes through the factory and configuration migration. It also adds a tray icon double-click action to toggle microphone mute, adds localization, registers the action, and changes model/hotkey logic so the toggle is handled internally.

Changes

Icon changer class hierarchy and naming refactor

Layer / File(s) Summary
Base class and enum rename
SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAbstract.cs, SoundSwitch/Framework/TrayIcon/IconChanger/IconChanger.cs
AbstractIconChanger renamed to IconChangerAbstract; enum member IconChanger.Never renamed to IconChanger.None (value 0 unchanged); minor header normalization edits.
Concrete implementation renames
SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAlways.cs, SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerNone.cs, SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerPlayback.cs, SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerRecording.cs
Concrete icon changer classes renamed to IconChangerAlways, IconChangerNone, IconChangerPlayback, and IconChangerRecording; all now inherit from IconChangerAbstract; documentation additions preserved.
Factory and configuration integration
SoundSwitch/Framework/TrayIcon/IconChanger/IconChangerFactory.cs, SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs
Factory implementation list updated to instantiate renamed classes; configuration default SwitchIcon changed to IconChanger.None; migration maps legacy KeepSystrayIcon to IconChanger.None when enabled and IconChanger.Always when disabled.

Microphone mute toggle tray icon action

Layer / File(s) Summary
Action enum and implementation
SoundSwitch/Framework/TrayIcon/IconDoubleClick/IconDoubleClick.cs, SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IconDoubleClickToggleMicrophoneMute.cs, SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IconDoubleClickSwitchProfile.cs
New IconDoubleClick.ToggleMicrophoneMute enum value added; new IconDoubleClickToggleMicrophoneMute action class implements IIconDoubleClick and invokes AppModel.Instance.ToggleMicrophoneMute(); a GPL header was added to a related action file.
Factory wiring and localization
SoundSwitch/Framework/TrayIcon/IconDoubleClick/IconDoubleClickFactory.cs, SoundSwitch/Localization/SettingsStrings.Designer.cs, SoundSwitch/Localization/SettingsStrings.resx
New action registered in factory double-click list; localization string toggleMicrophoneMute added to resource designer and resx with text "Toggle microphone mute".
Model and hotkey handler changes
SoundSwitch/Model/IAppModel.cs, SoundSwitch/Model/AppModel.cs
ToggleMicrophoneMute signature changed from returning (string DeviceName, bool IsMuted)? to void; implementation now handles failures internally (raises ErrorTriggered and logs errors) and logs success; hotkey handler updated to call the method without using a return value.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • Belphemur

🐰 A refactor hops with glee,
Icon changers renamed with style so free,
And a microphone mute, toggled with flair,
Now whispers are silent, floating through air! 🎤✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess relevance to the changeset. Add a pull request description explaining the purpose, implementation details, and any testing performed for this feature.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main feature addition: implementing a toggle microphone mute option as a tray icon double-click action.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch double-click

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request renames the Never option to None across the IconChanger enum and its associated classes, and introduces a new ToggleMicrophoneMute double-click action for the tray icon. It also refactors the ToggleMicrophoneMute method in AppModel to return void and handle its own logging. A critical piece of feedback points out that renaming the Never enum value to None can break backwards compatibility for existing user configurations during deserialization, and suggests keeping Never as an obsolete alias.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (6)
SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAbstract.cs (1)

25-25: ⚡ Quick win

Add XML documentation to this public class.

Please add a /// <summary> doc comment for the renamed public class to keep API surface documentation consistent.

As per coding guidelines: **/*.cs: Classes should use proper XML documentation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAbstract.cs` at
line 25, Add an XML documentation summary for the public class
IconChangerAbstract (which implements IIconChanger) by inserting a /// <summary>
... </summary> comment immediately above the class declaration describing the
purpose/role of IconChangerAbstract in one concise sentence so the public API is
documented per coding guidelines.
SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerRecording.cs (1)

21-21: ⚡ Quick win

Add XML documentation to this public class.

Please add a /// <summary> comment for this renamed public class.

As per coding guidelines: **/*.cs: Classes should use proper XML documentation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerRecording.cs`
at line 21, Add XML documentation for the public class IconChangerRecording by
inserting a /// <summary> comment immediately above the class declaration for
IconChangerRecording that briefly describes its purpose and behavior (e.g., that
it implements icon-changing behavior for recording state and extends
IconChangerAbstract); include any relevant <remarks> or <inheritdoc/> if
appropriate to clarify inheritance from IconChangerAbstract.
SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerNone.cs (1)

22-22: ⚡ Quick win

Add XML documentation to this public class.

Please add a /// <summary> comment for this public class.

As per coding guidelines: **/*.cs: Classes should use proper XML documentation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerNone.cs` at
line 22, Add a XML documentation summary for the public class IconChangerNone so
it complies with coding guidelines; specifically, add a /// <summary>
description above the declaration of the IconChangerNone class (public class
IconChangerNone : IIconChanger) briefly stating the class purpose (e.g., a no-op
or placeholder implementation of IIconChanger) and, if helpful, include a
<remarks> or <inheritdoc/> tag to reference the IIconChanger behavior.
SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAlways.cs (1)

22-22: ⚡ Quick win

Add XML documentation to this public class.

Please add a /// <summary> comment for this renamed public class.

As per coding guidelines: **/*.cs: Classes should use proper XML documentation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAlways.cs` at
line 22, Add an XML documentation summary for the public class IconChangerAlways
(which derives from IconChangerAbstract): insert a /// <summary>...</summary>
comment directly above the class declaration describing the purpose/behavior of
IconChangerAlways (e.g., indicates it always changes the tray icon under
specified conditions) and include any remarks or example tags if useful to
clarify usage; ensure the comment follows the existing XML doc style used in the
project.
SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerPlayback.cs (1)

21-21: ⚡ Quick win

Add XML documentation to this public class.

Please add a /// <summary> comment for this renamed public class.

As per coding guidelines: **/*.cs: Classes should use proper XML documentation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerPlayback.cs` at
line 21, Add XML documentation for the public class IconChangerPlayback: place a
`/// <summary>` block immediately above the `public class IconChangerPlayback :
IconChangerAbstract` declaration that briefly describes the class's purpose and
behavior (e.g., that it changes tray icons during playback and extends
IconChangerAbstract). Keep the summary concise and follow existing XML doc style
in the project; update any cref references if you want to mention
`IconChangerAbstract` or related members.
SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IconDoubleClickToggleMicrophoneMute.cs (1)

20-29: ⚡ Quick win

Add XML documentation to the new action class and members.

IconDoubleClickToggleMicrophoneMute, TypeEnum, Label, and Execute are currently undocumented.

Suggested update
 internal class IconDoubleClickToggleMicrophoneMute : IIconDoubleClick
 {
+    /// <summary>
+    /// Gets the enum value handled by this double-click action.
+    /// </summary>
     public IconDoubleClick TypeEnum => IconDoubleClick.ToggleMicrophoneMute;
 
+    /// <summary>
+    /// Gets the localized label displayed in settings.
+    /// </summary>
     public string Label => SettingsStrings.toggleMicrophoneMute;
 
+    /// <summary>
+    /// Toggles the mute state of the default microphone.
+    /// </summary>
+    /// <param name="trayIcon">Tray icon instance (unused).</param>
     public void Execute(UI.Component.TrayIcon trayIcon)
     {
         AppModel.Instance.ToggleMicrophoneMute();
     }
 }

As per coding guidelines "**/*.cs: Classes should use proper XML documentation".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IconDoubleClickToggleMicrophoneMute.cs`
around lines 20 - 29, Add XML documentation comments for the
IconDoubleClickToggleMicrophoneMute class and its public members: the TypeEnum
property, the Label property, and the Execute(UI.Component.TrayIcon trayIcon)
method. For the class provide a summary describing its purpose (handles tray
icon double-click to toggle microphone mute), for TypeEnum and Label provide
<summary> describing the returned enum value and label string respectively, and
for Execute provide <summary> and <param name="trayIcon"> documenting the
trayIcon parameter and the action performed. Ensure the XML follows the
project's style (summary tags, param tags) and is placed immediately above the
class and each member.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@SoundSwitch/Model/IAppModel.cs`:
- Around line 266-269: Update the XML documentation for the ToggleMicrophoneMute
method to match its void return type: remove or replace the incorrect <returns>
element describing a tuple, and adjust the <summary> if needed to state it
toggles the default microphone mute state without returning a value; ensure the
method's XML doc sits immediately above the ToggleMicrophoneMute declaration so
tools and consumers read the correct description.

---

Nitpick comments:
In `@SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAbstract.cs`:
- Line 25: Add an XML documentation summary for the public class
IconChangerAbstract (which implements IIconChanger) by inserting a /// <summary>
... </summary> comment immediately above the class declaration describing the
purpose/role of IconChangerAbstract in one concise sentence so the public API is
documented per coding guidelines.

In `@SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAlways.cs`:
- Line 22: Add an XML documentation summary for the public class
IconChangerAlways (which derives from IconChangerAbstract): insert a ///
<summary>...</summary> comment directly above the class declaration describing
the purpose/behavior of IconChangerAlways (e.g., indicates it always changes the
tray icon under specified conditions) and include any remarks or example tags if
useful to clarify usage; ensure the comment follows the existing XML doc style
used in the project.

In `@SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerNone.cs`:
- Line 22: Add a XML documentation summary for the public class IconChangerNone
so it complies with coding guidelines; specifically, add a /// <summary>
description above the declaration of the IconChangerNone class (public class
IconChangerNone : IIconChanger) briefly stating the class purpose (e.g., a no-op
or placeholder implementation of IIconChanger) and, if helpful, include a
<remarks> or <inheritdoc/> tag to reference the IIconChanger behavior.

In `@SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerPlayback.cs`:
- Line 21: Add XML documentation for the public class IconChangerPlayback: place
a `/// <summary>` block immediately above the `public class IconChangerPlayback
: IconChangerAbstract` declaration that briefly describes the class's purpose
and behavior (e.g., that it changes tray icons during playback and extends
IconChangerAbstract). Keep the summary concise and follow existing XML doc style
in the project; update any cref references if you want to mention
`IconChangerAbstract` or related members.

In `@SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerRecording.cs`:
- Line 21: Add XML documentation for the public class IconChangerRecording by
inserting a /// <summary> comment immediately above the class declaration for
IconChangerRecording that briefly describes its purpose and behavior (e.g., that
it implements icon-changing behavior for recording state and extends
IconChangerAbstract); include any relevant <remarks> or <inheritdoc/> if
appropriate to clarify inheritance from IconChangerAbstract.

In
`@SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IconDoubleClickToggleMicrophoneMute.cs`:
- Around line 20-29: Add XML documentation comments for the
IconDoubleClickToggleMicrophoneMute class and its public members: the TypeEnum
property, the Label property, and the Execute(UI.Component.TrayIcon trayIcon)
method. For the class provide a summary describing its purpose (handles tray
icon double-click to toggle microphone mute), for TypeEnum and Label provide
<summary> describing the returned enum value and label string respectively, and
for Execute provide <summary> and <param name="trayIcon"> documenting the
trayIcon parameter and the action performed. Ensure the XML follows the
project's style (summary tags, param tags) and is placed immediately above the
class and each member.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 11674cde-c91c-45c9-9140-1cef0469a760

📥 Commits

Reviewing files that changed from the base of the PR and between df0560b and 52cf927.

📒 Files selected for processing (16)
  • SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs
  • SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAbstract.cs
  • SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAlways.cs
  • SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerNone.cs
  • SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerPlayback.cs
  • SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerRecording.cs
  • SoundSwitch/Framework/TrayIcon/IconChanger/IconChanger.cs
  • SoundSwitch/Framework/TrayIcon/IconChanger/IconChangerFactory.cs
  • SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IconDoubleClickSwitchProfile.cs
  • SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IconDoubleClickToggleMicrophoneMute.cs
  • SoundSwitch/Framework/TrayIcon/IconDoubleClick/IconDoubleClick.cs
  • SoundSwitch/Framework/TrayIcon/IconDoubleClick/IconDoubleClickFactory.cs
  • SoundSwitch/Localization/SettingsStrings.Designer.cs
  • SoundSwitch/Localization/SettingsStrings.resx
  • SoundSwitch/Model/AppModel.cs
  • SoundSwitch/Model/IAppModel.cs

Comment thread SoundSwitch/Model/IAppModel.cs Resolved
@coderabbitai

coderabbitai Bot commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Note

Docstrings generation - SUCCESS
Generated docstrings and committed to branch double-click (commit: c510465d66c70aa0206a00f5380abf350b922275)

Docstrings generation was requested by @Belphemur.

The following files were modified:

* `SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs`
* `SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerAbstract.cs`
* `SoundSwitch/Framework/TrayIcon/IconChanger/Changer/IconChangerNone.cs`
* `SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IconDoubleClickToggleMicrophoneMute.cs`
* `SoundSwitch/Model/AppModel.cs`
* `SoundSwitch/Model/IAppModel.cs`

These file types are not supported:
* `SoundSwitch/Localization/SettingsStrings.resx`
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 7.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants