-
Notifications
You must be signed in to change notification settings - Fork 62
feat: add per-project configuration support #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add ProjectConfigEditor for project-level config (.ccmanager.json) - Add ConfigEditor for scope-aware config editing (project/global) - Add ConfigReader for merged config reading (project > global priority) - Rename configurationManager to globalConfigEditor for clarity - Add ConfigEditorProvider React Context for configuration UI - Update Configuration UI to show scope and inheritance status - Update Menu to show Project/Global configuration options - Use singleton pattern for consistent config state across components BREAKING CHANGE: configurationManager is now globalConfigEditor Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove CommandConfig interface and all associated code since command presets (CommandPresetsConfig) replaced this functionality: - Remove CommandConfig interface from types/index.ts - Remove commandConfig property from Session interface - Remove getCommandConfig/setCommandConfig from globalConfigEditor - Remove getCommandConfig from configReader - Simplify session creation by removing commandConfig parameter - Update fallback handler to use default 'claude' command - Update all test files to remove CommandConfig references Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Resolved conflicts by accepting both changes: - ConfigureCommand.tsx: Keep origin/main's handleAddStrategySelect logic - sessionManager.ts: Keep CommandConfig removal (HEAD) + stateDetector (origin/main) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Simplify ConfigEditor by removing the confusing getEffectiveXXX methods. The getXXX methods now handle fallback to global config internally when project config value is undefined. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move all config-related files into src/services/config/ directory and rename: - globalConfigEditor -> globalConfigManager - projectConfigEditor -> projectConfigManager The globalConfigManager and projectConfigManager are now marked as internal and should only be used within the config directory. External code should use ConfigEditor or ConfigReader from the public index.ts exports. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GlobalConfigManager already provides default values, so the additional fallbacks in ConfigReader were unnecessary. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move worktreeLastOpened state from config layer to worktreeService where it belongs (runtime state, not configuration data) - Fix ConfigReader.reload() to reload both project and global configs - Update sessionManager to import setWorktreeLastOpened from worktreeService - Update tests to use actual setWorktreeLastOpened instead of mocking Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use Either-based error handling for preset lookup in sessionManager - Remove getPresetById from configReader and globalConfigManager - Inline preset lookup logic into getPresetByIdEffect - Fix Either type parameter order (CommandPreset, ValidationError) - Update all test mocks to use getPresetByIdEffect Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move loadConfigEffect and validateConfig from globalConfigManager.ts and configReader.ts to a dedicated testUtils.ts file. These functions were only used in tests. The testUtils.ts file includes a clear warning that it is for test use only. getPresetByIdEffect remains in the main classes as it is used in production code by sessionManager.ts. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove methods that exist only in one of GlobalConfigManager or ProjectConfigManager to ensure both classes implement only the IConfigEditor interface consistently. Deleted (unused in app): - GlobalConfigManager: getConfiguration, setConfiguration, setAutoApprovalEnabled, setAutoApprovalTimeout - ProjectConfigManager: getConfigPath, hasConfigFile Moved to testUtils.ts (test-only): - addPreset, deletePreset, setDefaultPreset - getDefaultPreset, getSelectPresetOnStart, setSelectPresetOnStart - isAutoApprovalEnabled, getPresetByIdEffect - saveConfigEffect, setShortcutsEffect, setCommandPresetsEffect - addPresetEffect, deletePresetEffect, setDefaultPresetEffect The app now uses configReader which has its own implementations of these methods, so globalConfigManager versions were redundant. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Split the config interface to better reflect read-only vs read-write usage: - IConfigReader: provides read-only access to configuration - IConfigEditor: extends IConfigReader with write capabilities Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename test files from globalConfigManager.*.test.ts to configEditor.*.test.ts - Update tests to use ConfigEditor with 'global' scope instead of GlobalConfigManager directly - Update testUtils.ts to accept IConfigEditor interface instead of GlobalConfigManager - Add reload() calls after ConfigEditor creation to pick up mocked filesystem Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused CommandPreset import from globalConfigManager.ts - Fix prettier formatting in test files and testUtils.ts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GlobalConfigManager and ProjectConfigManager classes are now private to their modules. Only singleton instances are exported. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When CCMANAGER_MULTI_PROJECT_ROOT is set, ProjectConfigManager skips loading project config to ensure global config is used. Added tests to verify this behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add getGitRepositoryRoot utility function in gitUtils.ts - ProjectConfigManager now reads .ccmanager.json from git root - Renamed constructor arg to 'cwd', fields to 'gitRoot' and 'configPath' - Added tests to verify config is read/written to git root, not cwd Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add docs/project-config.md explaining project config feature - Update README.md with Per-Project Configuration section - Rename "Configuration" menu to "Global Configuration" in all docs - Add references to project config where config.json is mentioned Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
.ccmanager.jsonfilesChanges
New Files
src/services/projectConfigEditor.ts- Project-level config editorsrc/services/configEditor.ts- Scope-aware config editor wrappersrc/services/configReader.ts- Merged config reader for runtimesrc/contexts/ConfigEditorContext.tsx- React Context for config UIRenamed
configurationManager.ts→globalConfigEditor.tsArchitecture
All components use the same singletons, ensuring config changes are immediately reflected everywhere.
Test plan
.ccmanager.jsonwith shortcut override, verify it takes precedence🤖 Generated with Claude Code