Skip to content

Conversation

@bramburn
Copy link
Contributor

@bramburn bramburn commented May 10, 2025

  • Added areArraysEqual utility function to compare two arrays of strings for equality, handling null/undefined inputs.
  • Updated the activate function to only update the global state for allowed commands if the current commands differ from the defaults.
  • Introduced tests for the new utility function and modified tests for the extension activation to ensure correct behavior.
  • Enhanced AutoApproveSettings component to conditionally update settings based on the comparison with default commands.

Related GitHub Issue

Closes: #2625

Description

Test Procedure

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Documentation Updates

Additional Notes

…lly in extension activation

- Added `areArraysEqual` utility function to compare two arrays of strings for equality, handling null/undefined inputs.
- Updated the `activate` function to only update the global state for allowed commands if the current commands differ from the defaults.
- Introduced tests for the new utility function and modified tests for the extension activation to ensure correct behavior.
- Enhanced `AutoApproveSettings` component to conditionally update settings based on the comparison with default commands.
@changeset-bot
Copy link

changeset-bot bot commented May 10, 2025

⚠️ No Changeset found

Latest commit: 4d78171

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR


// Get default commands from configuration.
const defaultCommands = vscode.workspace.getConfiguration("roo-cline").get<string[]>("allowedCommands") || []
const currentCommands = context.globalState.get<string[]>("allowedCommands")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we compare the settings for the commands before force re-write. its just a check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

basic util file for checking two arrays

Hint: 3,
},
languages: {
getDiagnostics: jest.fn().mockReturnValue([]),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bug fix for one of the test I ran but failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not related to #2625

import { Section } from "./Section"
import { AutoApproveToggle } from "./AutoApproveToggle"

// Default allowed commands from package.json
Copy link
Contributor Author

Choose a reason for hiding this comment

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

set hard coded default command, not sure if you guys are happy about this

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 10, 2025
@hannesrudolph hannesrudolph moved this from PR [Pre Approval Review] to Issue [In Progress] in Roo Code Roadmap May 10, 2025
@hannesrudolph hannesrudolph moved this from Issue [In Progress] to PR [Draft/WIP] in Roo Code Roadmap May 10, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Draft/WIP] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Draft / In Progress] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs
Copy link
Member

daniel-lxs commented May 26, 2025

Hey @bramburn,
Thank you for your contribution!, We noticed this PR is stale and will be closed. If you plan to revisit this, please leave a comment on #2625 to have it reassigned to you.

@daniel-lxs daniel-lxs closed this May 26, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft/WIP] to Done in Roo Code Roadmap May 26, 2025
@github-project-automation github-project-automation bot moved this from TEMP to Done in Roo Code Roadmap May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[Bug] Roo code always inserts setting even if it's the same as the default setting

2 participants