-
Notifications
You must be signed in to change notification settings - Fork 246
feat(settings, components): add preference for legacy UUID display encoding COMPASS-9690 #7625
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new user preference legacyUUIDDisplayEncoding that allows users to choose how Binary subtype 3 (Legacy UUID) values are displayed in Compass. The feature supports viewing legacy UUIDs in Java, C#, Python, or raw formats, addressing the needs of users who work with legacy UUID implementations from different programming languages.
Key changes:
- Added a new
legacyUUIDDisplayEncodingpreference with four encoding options (raw, Java, C#, Python) - Implemented UUID conversion logic to transform legacy UUIDs between different language-specific formats
- Extended the settings UI to include the new preference in the General settings section
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/compass-preferences-model/src/preferences-schema.tsx | Defines the new legacyUUIDDisplayEncoding preference with validation schema and UI options |
| packages/compass-preferences-model/src/provider.ts | Exports the LEGACY_UUID_ENCODINGS constant for use across packages |
| packages/compass-components/src/components/document-list/legacy-uuid-format-context.tsx | Creates React context for providing legacy UUID display encoding preference throughout the component tree |
| packages/compass-components/src/components/compass-components-provider.tsx | Integrates the legacy UUID display context into the main component provider |
| packages/compass-components/src/components/bson-value.tsx | Implements the LegacyUUIDValue component with conversion functions for Java, C#, and Python UUID formats |
| packages/compass-components/src/components/bson-value.spec.tsx | Adds comprehensive test coverage for legacy UUID display formats including error handling |
| packages/compass-settings/src/components/settings/settings-list.tsx | Refactors the enum setting component to handle multiple string enum preferences instead of just defaultSortOrder |
| packages/compass-settings/src/components/settings/general.tsx | Adds the new preference to the General settings section |
| packages/compass-settings/src/components/settings/general.spec.tsx | Tests the rendering and interaction of the new preference in the settings UI |
| packages/compass/src/app/components/home.tsx | Passes the preference value to the CompassComponentsProvider |
| packages/compass-web/src/entrypoint.tsx | Passes the preference value to the CompassComponentsProvider in the web version |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Assigned |
COMPASS-9690
Description
Adds a new preference to Compass
legacyUUIDDisplayEncoding. When this is set it'll change how we render Binary subtype 3 values.There are a good amount of folks using Legacy UUIDs (created via Java, CSharp, and Python) in Compass. We want to give them the ability to view (this pr) and modify (not this pr) their legacy UUIDs in Compass in a format they're comfortable with.
Part of this ticket involves making these values editable. This PR focuses only on the display side of things, the Binary values are still not-editable. There will be another pr updating them to be editable.
No encoding (raw)

LegacyJavaUUID

LegacyPythonUUID

LegacyCSharpUUID
