Skip to content

fix(client): modify message for public and discoverable toggle on engine settings#691

Merged
johbaxter merged 9 commits intodevfrom
690-make-model-undiscoverable
Mar 17, 2025
Merged

fix(client): modify message for public and discoverable toggle on engine settings#691
johbaxter merged 9 commits intodevfrom
690-make-model-undiscoverable

Conversation

@johbaxter
Copy link
Copy Markdown
Contributor

…ine settings

Description

Changes Made

How to Test

  1. Steps to reproduce/test the behavior
  2. Expected outcomes

Notes

@johbaxter johbaxter requested a review from a team as a code owner March 11, 2025 14:46
@johbaxter johbaxter linked an issue Mar 11, 2025 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown

@CodiumAI-Agent /describe

@QodoAI-Agent
Copy link
Copy Markdown

Title

fix(client): modify message for public and discoverable toggle on engine settings


User description

…ine settings

Description

Changes Made

How to Test

  1. Steps to reproduce/test the behavior
  2. Expected outcomes

Notes


PR Type

  • Enhancement

Description

  • update notification messages dynamically

  • toggle message text for discoverable feature

  • toggle message text for global setting


Changes walkthrough 📝

Relevant files
Enhancement
SettingsTiles.tsx
Dynamic toggles for notification messages                               

packages/client/src/components/settings/SettingsTiles.tsx

  • Changed success message using conditional text.
  • Updated error message using conditional text.
  • Adjust messages for discoverable and global toggles.
  • +12/-5   
    Additional files
    pnpm-lock.yaml +653/-654

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @github-actions
    Copy link
    Copy Markdown

    @CodiumAI-Agent /review

    @github-actions
    Copy link
    Copy Markdown

    @CodiumAI-Agent /improve

    @QodoAI-Agent
    Copy link
    Copy Markdown

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Message Clarity

    Review that the notification message for the discoverable toggle correctly reflects the state change. Confirm that using the previous state to form the message does not confuse users.

            message: `Successfully made ${name} ${
                discoverable ? 'undiscoverable' : 'discoverable'
            }`,
        });
    } else {
    Message Clarity

    Validate that the global toggle messages accurately describe the result of the state change. Ensure consistency in behavior compared to similar toggles across the system.

            message: `Successfully made ${name} ${
                global ? 'non-global' : 'global'
            }`,
        });
    } else {
        notification.add({
            color: 'error',
            message: `Error making ${name} ${
                global ? 'non-global' : 'global'
            }`,
        });

    @QodoAI-Agent
    Copy link
    Copy Markdown

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Impact
    General
    Use toggled state for message

    Define and use a new variable holding the toggled state instead of relying on the
    current state for the message.

    packages/client/src/components/settings/SettingsTiles.tsx [283-288]

    +const newDiscoverable = !discoverable;
    +setDiscoverable(newDiscoverable);
     notification.add({
         color: 'success',
    -    message: `Successfully made ${name} ${
    -        discoverable ? 'undiscoverable' : 'discoverable'
    -    }`,
    +    message: `Successfully made ${name} ${newDiscoverable ? 'discoverable' : 'undiscoverable'}`,
     });
    Suggestion importance[1-10]: 5

    __

    Why: The suggestion refactors the code by computing the toggled state explicitly, which improves clarity without altering behavior. However, it's a minor enhancement rather than a critical fix.

    Low
    Use toggled state for global

    Similarly, compute the new global state in a variable and use it in the notification
    message for clarity.

    packages/client/src/components/settings/SettingsTiles.tsx [345-350]

    +const newGlobal = !global;
    +setGlobal(newGlobal);
     notification.add({
         color: 'success',
    -    message: `Successfully made ${name} ${
    -        global ? 'non-global' : 'global'
    -    }`,
    +    message: `Successfully made ${name} ${newGlobal ? 'global' : 'non-global'}`,
     });
    Suggestion importance[1-10]: 5

    __

    Why: This suggestion applies the same clarity improvement to the global state logic, making the code easier to understand. It’s a modest improvement that maintains the intended functionality.

    Low

    @johbaxter johbaxter merged commit 726db8d into dev Mar 17, 2025
    3 checks passed
    @johbaxter johbaxter deleted the 690-make-model-undiscoverable branch March 17, 2025 17:05
    @github-actions
    Copy link
    Copy Markdown

    @CodiumAI-Agent /update_changelog

    @QodoAI-Agent
    Copy link
    Copy Markdown

    Changelog updates: 🔄

    2025-03-17 *

    Fixed

    • Updated toggle notification messages in engine settings and bumped dependency versions.

    to commit the new content to the CHANGELOG.md file, please type:
    '/update_changelog --pr_update_changelog.push_changelog_changes=true'

    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.

    Make Model Undiscoverable

    2 participants