Skip to content

Conversation

jcobis
Copy link
Collaborator

@jcobis jcobis commented Oct 9, 2025

Description

Spawned from this nit PR comment: #7433 (comment)

Refactor Mock Data Generator state to maintain separate copies of the original LLM response and user-edited faker schema.

  • Update MockDataGeneratorCompletedState to include originalLlmResponse and editedFakerSchema fields
  • Add FakerSchemaEdited Redux action for tracking user modifications
  • Update components to use editedFakerSchema for script generation
  • Preserve originalLlmResponse as immutable reference

@github-actions github-actions bot added the feat label Oct 9, 2025
@jcobis jcobis marked this pull request as ready for review October 15, 2025 18:00
@jcobis jcobis requested a review from a team as a code owner October 15, 2025 18:00
@jcobis jcobis requested review from Copilot and mabaasit October 15, 2025 18:00
Copy link
Contributor

@Copilot 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

Refactor Mock Data Generator to separate original LLM response from user-edited faker schema, enabling better debugging by comparing original output against user modifications.

  • Split faker schema state into originalLlmResponse and editedFakerSchema fields
  • Add Redux actions for tracking field type and method changes
  • Update components to use editedFakerSchema for script generation while preserving original LLM response

Reviewed Changes

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

Show a summary per file
File Description
packages/compass-collection/src/modules/collection-tab.ts Add new Redux actions and reducer logic for field editing; update state structure
packages/compass-collection/src/components/mock-data-generator-modal/types.ts Update state type to include separate original and edited schema fields
packages/compass-collection/src/components/mock-data-generator-modal/script-screen.tsx Update to use editedFakerSchema instead of fakerSchema
packages/compass-collection/src/components/mock-data-generator-modal/mock-data-generator-modal.tsx Remove unused isSchemaConfirmed prop from FakerSchemaEditorScreen
packages/compass-collection/src/components/mock-data-generator-modal/mock-data-generator-modal.spec.tsx Update test data structure to include both original and edited schema fields
packages/compass-collection/src/components/mock-data-generator-modal/faker-schema-editor-screen.tsx Replace local state management with Redux actions; connect component to dispatch

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

Assigned ivandevp for team compass-developers because mabaasit is out of office.

@jcobis jcobis marked this pull request as draft October 15, 2025 18:03
@jcobis jcobis added the no release notes Fix or feature not for release notes label Oct 15, 2025
@jcobis jcobis marked this pull request as ready for review October 15, 2025 19:03
@jcobis jcobis requested a review from kpamaran October 15, 2025 19:06
Copy link
Collaborator

@kpamaran kpamaran left a comment

Choose a reason for hiding this comment

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

lgtm

type MockDataGeneratorCompletedState = {
status: 'completed';
fakerSchema: FakerSchema;
originalLlmResponse: FakerSchema; // Immutable LLM response
Copy link
Collaborator

@kpamaran kpamaran Oct 15, 2025

Choose a reason for hiding this comment

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

Typing as Readonly and/or using Object.freeze when it's created will help enforce immutability

@jcobis jcobis force-pushed the separate-llm-response-from-edited-schema-2 branch from a0ebd38 to a0366d5 Compare October 15, 2025 22:17
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.

2 participants