Skip to content

Commit

Permalink
AI Assistant: Add thumbs feedback for list-to-table feature (#40755)
Browse files Browse the repository at this point in the history
* add preTransformAction to block attributes

* map lastAction to preTransformAction on first value

* changelog
  • Loading branch information
dhasilva authored Dec 27, 2024
1 parent 00c7c1c commit a3f4157
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

AI Assistant: Add thumbs feedback for list-to-table feature
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
"requestingState": {
"type": "string",
"default": "init"
},

"preTransformAction": {
"type": "string",
"default": null
}
},
"example": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export default function AIAssistantEdit( { attributes, setAttributes, clientId,
const { replaceBlocks, removeBlock } = useDispatch( 'core/block-editor' );
const { editPost } = useDispatch( 'core/editor' );

const [ lastAction, setLastAction ] = useState( null );
const [ lastAction, setLastAction ] = useState(
mapActionToHumanText( attributes.preTransformAction )
);

const {
isOverLimit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const useTransformToAssistant = () => {
const extendedBlockAttributes = {
...( firstBlock?.attributes || {} ), // firstBlock.attributes should never be undefined, but still add a fallback
content,
preTransformAction: request?.promptType,
};

const newAIAssistantBlock = transformToAIAssistantBlock(
Expand Down

0 comments on commit a3f4157

Please sign in to comment.