Skip to content

Conversation

@jcobis
Copy link
Collaborator

@jcobis jcobis commented Nov 6, 2025

Description

  • Ensure default faker methods such as database.mongodbObjectId for ObjectID _id fields are selected as backups if the LLM returns Unrecognized.

  • Add copy to the confirmation screen reading "To improve mock data quality, Project Owners can enable sending sample field values to the AI model in Project Settings. Refresh Data Explorer for changes to take effect."

Screenshot 2025-11-06 at 1 39 21 PM
  • Persist user modifications to faker method and type mappings when going back to schema editor screen.
PersistSelections.mov

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@jcobis jcobis changed the title Cloudp 356788 feat(compass-collection): Mock Data Generator QA Items Batch 1 - CLOUDP-356788 Nov 6, 2025
@github-actions github-actions bot added the feat label Nov 6, 2025
@jcobis jcobis added the no release notes Fix or feature not for release notes label Nov 6, 2025
@jcobis jcobis marked this pull request as ready for review November 6, 2025 23:05
@jcobis jcobis requested a review from a team as a code owner November 6, 2025 23:05
Copy link
Contributor

Copilot AI left a 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 addresses quality improvements for the Mock Data Generator feature, focusing on better handling of unrecognized faker methods, improved user guidance through confirmation screen messaging, and persistence of user modifications when navigating between screens.

  • Replace "Unrecognized" placeholder with sensible default faker methods based on MongoDB field types
  • Add informational copy on the confirmation screen about enabling sample field values in Project Settings
  • Implement state persistence for user-modified faker method and type mappings when navigating back from document count screen

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
collection-tab.ts Replaced hardcoded "Unrecognized" faker method with dynamic defaults and added action/reducer for restoring field mappings
raw-schema-confirmation-screen.tsx Added informational text with link to Project Settings for enabling sample field values
mock-data-generator-modal.spec.tsx Removed test validating "Unrecognized" behavior and added tests for persisting user modifications
faker-schema-editor-screen.tsx Refactored to dispatch Redux actions instead of local state management, enabling persistence of user changes
faker-mapping-selector.tsx Updated dropdown logic to include original LLM faker methods even when not in standard method lists
faker-mapping-selector.spec.tsx Added tests verifying original LLM methods are included in dropdowns without duplication

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +82 to +84
const projectSettingsLink = projectId ? (
<Link
href={`${window.location.origin}/v2/${projectId}#/settings/groupSettings`}
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

[nitpick] The hardcoded URL path /v2/${projectId}#/settings/groupSettings creates tight coupling to the Atlas UI structure. Consider extracting this to a configuration constant or utility function to make future URL changes easier to manage.

Suggested change
const projectSettingsLink = projectId ? (
<Link
href={`${window.location.origin}/v2/${projectId}#/settings/groupSettings`}
const getAtlasProjectSettingsUrl = (projectId: string) =>
`${window.location.origin}/v2/${projectId}#/settings/groupSettings`;
const projectSettingsLink = projectId ? (
<Link
href={getAtlasProjectSettingsUrl(projectId)}

Copilot uses AI. Check for mistakes.
@paula-stacho
Copy link
Collaborator

The Please select a function or .. banner still exists in faker-mapping-selector.tsx, can it be cleaned up? There are also a couple of tests in faker-mapping-selector.spec.tsx

@jcobis
Copy link
Collaborator Author

jcobis commented Nov 10, 2025

The Please select a function or .. banner still exists in faker-mapping-selector.tsx, can it be cleaned up? There are also a couple of tests in faker-mapping-selector.spec.tsx

Initially thought to leave it in in case we iterate on this experiment, but I went ahead and removed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat no release notes Fix or feature not for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants