Skip to content

Conversation

@KJ7LNW
Copy link
Contributor

@KJ7LNW KJ7LNW commented May 30, 2025

This PR adds detailed documentation for adding and managing settings in the application.

Context

This PR adds comprehensive documentation on how to add and manage settings in the application, including:

  • Steps for adding all types of settings (checkbox, dropdown, enum)
  • Type safety considerations
  • Persistence chain details
  • Debugging guidance for settings issues

Implementation

The documentation provides a complete guide for developers to understand the settings system and implement new settings correctly, ensuring proper type safety and persistence.

How to Test

Review the documentation for completeness and accuracy.

Fixes: #4129


Important

Adds comprehensive documentation for adding and managing settings, covering schema definitions, type safety, persistence, and debugging.

  • Documentation:
    • Adds docs/settings.md with detailed steps for adding and managing settings, including schema definitions, type definitions, and test coverage.
    • Covers specific instructions for checkbox, dropdown, and enum settings.
    • Provides guidance on type safety, persistence chain, and debugging settings issues.
  • Settings Management:
    • Instructions for adding settings to globalSettingsSchema and globalSettingsRecord in schemas/index.ts.
    • Details on adding settings to type definitions in exports/types.ts, exports/roo-code.d.ts, shared/ExtensionMessage.ts, and shared/WebviewMessage.ts.
    • Steps for UI integration in SettingsView.tsx and state management in ClineProvider.ts.
  • Debugging and Testing:
    • Debugging strategies for settings persistence issues.
    • Emphasizes test coverage for new settings in ClineProvider.test.ts.

This description was created by Ellipsis for 0ece9e7. You can customize this summary. It will automatically update as commits are pushed.

@KJ7LNW KJ7LNW requested review from cte and mrubens as code owners May 30, 2025 01:06
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. documentation Improvements or additions to documentation labels May 30, 2025
</Select>
```

For enum/compound data types, additional type-safety steps are needed:
Copy link
Contributor

Choose a reason for hiding this comment

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

The enum/compound data type instructions are duplicated (lines 174–250 and 252–349). Consider merging or removing one copy to avoid redundancy.

@daniel-lxs
Copy link
Member

daniel-lxs commented May 30, 2025

Hey @KJ7LNW, This seems slightly outdated, we recently moved types definitions to it's own package @roo-code/types.

You might have to rewrite some parts of the documentation, I'm not sure how stable the current structure is, so we can wait until things settle down.

@daniel-lxs daniel-lxs moved this from Triage to PR [Draft / In Progress] in Roo Code Roadmap May 30, 2025
@KJ7LNW
Copy link
Contributor Author

KJ7LNW commented May 30, 2025

Hey @KJ7LNW, This seems slightly outdated, we recently moved types definitions to it's own package @roo-code/types.

You might have to rewrite some parts of the documentation, I'm not sure how stable the current structure is, so we can wait until things settle down.

that sounds fine I am not in a hurry for this but I do not want to get lost either

@hannesrudolph hannesrudolph marked this pull request as draft June 2, 2025 17:36
SmartManoj pushed a commit to SmartManoj/Raa-Code that referenced this pull request Jun 13, 2025
@KJ7LNW KJ7LNW self-assigned this Jun 27, 2025
@KJ7LNW KJ7LNW moved this from PR [Draft / In Progress] to PR [Needs Prelim Review] in Roo Code Roadmap Jun 27, 2025
@KJ7LNW KJ7LNW marked this pull request as ready for review June 27, 2025 01:36
@KJ7LNW KJ7LNW requested a review from jr as a code owner June 27, 2025 01:37
Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

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

Thank you for updating this, I think there are a couple of outdated instructions, although it makes sense considering how fast is Roo Code changing.

- Ensure all tests pass before submitting changes

## For Checkbox Settings

Copy link
Member

Choose a reason for hiding this comment

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

The import path here is incorrect. Based on the codebase:

// ❌ Incorrect
import { globalSettingsSchema, globalSettingsRecord } from "schemas/index.ts"

// ✅ Correct
import { globalSettingsSchema } from "@roo-code/types"

Also, globalSettingsRecord doesn't exist in the codebase - only globalSettingsSchema is available.


2. Add the setting to ExtensionStateContext.tsx:

- Add the setting to the ExtensionStateContextType interface
Copy link
Member

Choose a reason for hiding this comment

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

These files don't exist in the repository. The actual built type definitions are located at:

packages/types/dist/index.d.ts

Could you update this section to reference the correct location of the auto-generated types?


```typescript
// In ExtensionMessage.ts
export type ExtensionState = Pick<GlobalSettings, "displayMode" | "otherSettings">
Copy link
Member

Choose a reason for hiding this comment

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

This test example doesn't exist in src/core/webview/__tests__/ClineProvider.test.ts. The file contains tests for various settings, but no test specifically for myCheckboxSetting.

Would it be helpful to either:

  1. Add this test to demonstrate the pattern, or
  2. Update the documentation to reference an existing test case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll be adding a setting soon, so I'll validate these for a real use case and re-push 'em.

@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Changes Requested] in Roo Code Roadmap Jun 27, 2025
@KJ7LNW KJ7LNW marked this pull request as draft June 28, 2025 00:10
@KJ7LNW
Copy link
Contributor Author

KJ7LNW commented Jul 18, 2025

probably not going to get to this, closing.

@KJ7LNW KJ7LNW closed this Jul 18, 2025
@github-project-automation github-project-automation bot moved this from PR [Changes Requested] to Done in Roo Code Roadmap Jul 18, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation PR - Changes Requested size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Restore docs folder for critical implementation guides

3 participants