Skip to content

Conversation

@Sky-FE
Copy link
Contributor

@Sky-FE Sky-FE commented Jun 5, 2025

No description provided.

@Sky-FE Sky-FE requested a review from Copilot June 5, 2025 03:25
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 pull request fixes an issue where appending rows prevents adding new options to single/multi-select fields by updating the mechanism that adds options. Key changes include setting the query cache time explicitly to 0 for record duplication, and refactoring the onOptionAdd callback across multiple select editor components to use temporaryPaste instead of updateRecord.

Reviewed Changes

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

Show a summary per file
File Description
packages/sdk/src/hooks/use-record-operations.ts Sets cacheTime to 0 in duplicateRecord for query freshness
packages/sdk/src/components/grid-enhancements/editor/GridSelectEditor.tsx Refactors onOptionAdd to use temporaryPaste and simplifies logic
packages/sdk/src/components/editor/select/EditorMain.tsx Updates onOptionAdd prop type to a single-parameter function
packages/sdk/src/components/editor/select/Editor.tsx Aligns the Editor component prop type with the new onOptionAdd signature
packages/sdk/src/components/cell-value-editor/CellEditorMain.tsx Updates onOptionAdd signature similar to GridSelectEditor changes
Comments suppressed due to low confidence (5)

packages/sdk/src/hooks/use-record-operations.ts:50

  • Consider adding a comment to explain why cacheTime is explicitly set to 0 to improve maintainability and clarity for future developers.
cacheTime: 0,

packages/sdk/src/components/editor/select/EditorMain.tsx:18

  • Ensure that all consuming components are updated to match the new onOptionAdd signature which now accepts a single parameter.
onOptionAdd?: (optionName: string) => Promise<void>;

packages/sdk/src/components/editor/select/Editor.tsx:13

  • Verify that the updated type for onOptionAdd in the Editor component is consistent with its usage in child components after the refactor.
ISelectEditorMain<boolean>

packages/sdk/src/components/cell-value-editor/CellEditorMain.tsx:49

  • Double-check that removing the curValue parameter and using temporaryPaste instead of updateRecord in onOptionAdd meets the intended design and correctly appends new options.
async (name: string) => {

packages/sdk/src/components/grid-enhancements/editor/GridSelectEditor.tsx:73

  • Review the refactored onOptionAdd implementation to ensure that switching from updateRecord to temporaryPaste and removing the record id dependency is intentional and aligns with business logic.
async (name: string) => {

@Sky-FE Sky-FE merged commit 69f4860 into develop Jun 6, 2025
10 checks passed
@Sky-FE Sky-FE deleted the fix/duplicate-record branch June 6, 2025 02:53
@github-actions
Copy link

github-actions bot commented Jun 6, 2025

🧹 Preview Environment Cleanup

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to create singe select option when creating a row, only when editing or when editing the field itself

3 participants