-
Notifications
You must be signed in to change notification settings - Fork 374
feat: control Flow Editor via the Electron app menu #3660
Conversation
|
@cwhitten Chris do you think it's a good solution to share those Composer APIs via the global |
|
@yeze322 this seems reasonable. We wouldn't want to enable those actions if there was no current node selection, so we need to add a enabled/disabled heuristic. cc @tonyanziano |
|
Feature completed, ready for review and test. |
cwhitten
left a comment
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.
See my earlier comment on needing to wire up a disabled/enabled heuristic. It needs to match what options are available in the authoring surface.
|
@cwhitten I updated the code to fix UT. Ideally, the failure on undefined |
* fix: LG/LU editing performance optimize (#3738) * update luUtil interface * update * use structure luFile do CRUD * refine lgUtile interface * update worker * update lu package * update lg package * update parse line number * log * parse still use worker * lint fix * clean up * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * wrap with formatMessage Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com> Co-authored-by: Andy Brown <asbrown002@gmail.com> * feat: control Flow Editor via the Electron app menu (#3660) * draft: consume the EditorAPI in electron menu * register global EditorAPI * apply EditorAPI in ToolBar * apply EditorAPI in Electron app menu * add todos in undo/redo * emit Electron menu events to renderer process * use ipc channel to subscribe Electron menu events * override default menu event * add shortcuts * remove duplicated usage of getEditorApi() * fix UT * update 'Redo' shortcut in Electron menu * disable cut/copy/del menu when no action selected * extract Electron logic to a hook * check ipcMain in jest env Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com> * deploy logic change * azure deploy bugfix * yarn * typecheck error * fix: Luis publish missing parameter (#3764) * fix luis publish * remove empty space in setting page * resolve conflict Co-authored-by: Zhixiang Zhan <zhixzhan@microsoft.com> Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com> Co-authored-by: Andy Brown <asbrown002@gmail.com> Co-authored-by: zeye <2295905420@qq.com> Co-authored-by: Long Alan <julong@microsoft.com> Co-authored-by: Long Jun <alanlong9278@126.com>
* rebuild qna CRUD and qna page UI (#3692) * rebase * Rebuild qna (#3701) * add unique key to qna property * import online file * debug * add qna trigger type (#3703) * resolve conflict * bug fix * refine qna crud (#3711) * Update Program.cs * fix bug (#3715) * bugfix: start bot pop error message for new echo bot * revert the change on common.lg * send qna endpointKey to runtime * publish pop * eslint * Regression on publish page after recoil * clean some code * recognizer dropdown & custom default content * migration * fix files structure change * fix object can only read * add botProject interface and move some interface into shared folder * fix lint * update trigger action (#3720) * merge publish error fixed * Update package to include the resourc id fix * add id for dialog & migrate it with old bot * crosstrain config * eslint & qna jump * migration old bot for recognizer * migration old bot for recognizer * revert rootId in luUtil * change qna location * refactor publish logic * cross train when default recognizer * sync cross train config logic with azure deploy * fix bug (#3748) * Update the sdk package to include expandText fix * solve conflict * resolve conflict * cross train config filter no body trigger intent * deploy logic change * azure deploy bugfix * yarn * typecheck error * Qna recognizer tmp (#3765) * fix: LG/LU editing performance optimize (#3738) * update luUtil interface * update * use structure luFile do CRUD * refine lgUtile interface * update worker * update lu package * update lg package * update parse line number * log * parse still use worker * lint fix * clean up * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * wrap with formatMessage Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com> Co-authored-by: Andy Brown <asbrown002@gmail.com> * feat: control Flow Editor via the Electron app menu (#3660) * draft: consume the EditorAPI in electron menu * register global EditorAPI * apply EditorAPI in ToolBar * apply EditorAPI in Electron app menu * add todos in undo/redo * emit Electron menu events to renderer process * use ipc channel to subscribe Electron menu events * override default menu event * add shortcuts * remove duplicated usage of getEditorApi() * fix UT * update 'Redo' shortcut in Electron menu * disable cut/copy/del menu when no action selected * extract Electron logic to a hook * check ipcMain in jest env Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com> * deploy logic change * azure deploy bugfix * yarn * typecheck error * fix: Luis publish missing parameter (#3764) * fix luis publish * remove empty space in setting page * resolve conflict Co-authored-by: Zhixiang Zhan <zhixzhan@microsoft.com> Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com> Co-authored-by: Andy Brown <asbrown002@gmail.com> Co-authored-by: zeye <2295905420@qq.com> Co-authored-by: Long Alan <julong@microsoft.com> Co-authored-by: Long Jun <alanlong9278@126.com> * set max memory for build * refactor qna popup logic && form editor ux * Update trigger (#3768) * update trigger actions * rebase * update trigger (#3772) * fix export bug (#3776) * separates Form / Flow's ExtensionContext * test fixed * fix trigger actions bug (#3787) * fix trigger bug (#3788) * fix trigger bug * update trigger text * conflict err * update bf-lu package & fix conflict err * Creating qn a sample (#3819) * create qnaSample bot flow * update create qna bot flow * fix bug * fix bug (#3822) * test for build qna & lu in server * Update qn a flow (#3831) * fix bug * update import qna flow * Fix ui bug (#3833) * fix bug * update import QNA UI * Update autoEndDialog to false * Navigate to qna page (#3834) * fix bug * navigate to qna page * Updates * Fix * refine code * refactor & add comment * refine code" * handle comments * popup desc * hidden the subsription key * recognizer * replace the default name with unique id * use common component to show error * comments * update UI * fix the qna icon reload issue * fix UI bug * change hover color * remove toggle on row * qna endpointKey * popup * add try catch for get qna endpointKey * update UI * remove the scroll bar and update the error display * update qna UI * input luis hoisting * conflict * comments * test fixed * test fixed * handle comments * separated QnAEditor & rename to knowledge-base (#3857) * separated QnAEditor & rename to knowledge-base * rename * rename helper to utilities * fix test case * fix unit tests * test * qna-recognizer add tests (#3859) * add triggerCreattionModal test * triggerApi test * add test for import modal * add test * dialog id * fix bug * fix bug * wrong url * conflict * Update ComposerSettingsExtensions * update the error message * conflict fix * Update ComposerSettingsExtensions.cs * azure deploy * lu build * qna build bugfix * code refine * lint fix * qna name * code refine * Update package to daily to fix the CrossTrainRecognizer issue * concurrent import qna from urls and set call limits * error message & e2e test * e2e test * code scan error * fix code scanner error * fix code scanner error * update the get params * fix UI * update qna error logic * Update package to 4.10.1 * encode qna urls * refactor * fix e2e todobot Co-authored-by: Long Jun <alanlong9278@126.com> Co-authored-by: Long Alan <julong@microsoft.com> Co-authored-by: Lu Han <32191031+luhan2017@users.noreply.github.com> Co-authored-by: Wenyi Luo <wenyluo@microsoft.com> Co-authored-by: leilzh <leilzh@microsoft.com> Co-authored-by: Zhixiang Zhan <zhixzhan@microsoft.com> Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com> Co-authored-by: Andy Brown <asbrown002@gmail.com> Co-authored-by: zeye <2295905420@qq.com> Co-authored-by: zeye <zeye@microsoft.com>
* draft: consume the EditorAPI in electron menu * register global EditorAPI * apply EditorAPI in ToolBar * apply EditorAPI in Electron app menu * add todos in undo/redo * emit Electron menu events to renderer process * use ipc channel to subscribe Electron menu events * override default menu event * add shortcuts * remove duplicated usage of getEditorApi() * fix UT * update 'Redo' shortcut in Electron menu * disable cut/copy/del menu when no action selected * extract Electron logic to a hook * check ipcMain in jest env Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
* rebuild qna CRUD and qna page UI (microsoft#3692) * rebase * Rebuild qna (microsoft#3701) * add unique key to qna property * import online file * debug * add qna trigger type (microsoft#3703) * resolve conflict * bug fix * refine qna crud (microsoft#3711) * Update Program.cs * fix bug (microsoft#3715) * bugfix: start bot pop error message for new echo bot * revert the change on common.lg * send qna endpointKey to runtime * publish pop * eslint * Regression on publish page after recoil * clean some code * recognizer dropdown & custom default content * migration * fix files structure change * fix object can only read * add botProject interface and move some interface into shared folder * fix lint * update trigger action (microsoft#3720) * merge publish error fixed * Update package to include the resourc id fix * add id for dialog & migrate it with old bot * crosstrain config * eslint & qna jump * migration old bot for recognizer * migration old bot for recognizer * revert rootId in luUtil * change qna location * refactor publish logic * cross train when default recognizer * sync cross train config logic with azure deploy * fix bug (microsoft#3748) * Update the sdk package to include expandText fix * solve conflict * resolve conflict * cross train config filter no body trigger intent * deploy logic change * azure deploy bugfix * yarn * typecheck error * Qna recognizer tmp (microsoft#3765) * fix: LG/LU editing performance optimize (microsoft#3738) * update luUtil interface * update * use structure luFile do CRUD * refine lgUtile interface * update worker * update lu package * update lg package * update parse line number * log * parse still use worker * lint fix * clean up * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * Update Composer/packages/client/src/recoilModel/dispatchers/lg.ts Co-authored-by: Andy Brown <asbrown002@gmail.com> * wrap with formatMessage Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com> Co-authored-by: Andy Brown <asbrown002@gmail.com> * feat: control Flow Editor via the Electron app menu (microsoft#3660) * draft: consume the EditorAPI in electron menu * register global EditorAPI * apply EditorAPI in ToolBar * apply EditorAPI in Electron app menu * add todos in undo/redo * emit Electron menu events to renderer process * use ipc channel to subscribe Electron menu events * override default menu event * add shortcuts * remove duplicated usage of getEditorApi() * fix UT * update 'Redo' shortcut in Electron menu * disable cut/copy/del menu when no action selected * extract Electron logic to a hook * check ipcMain in jest env Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com> * deploy logic change * azure deploy bugfix * yarn * typecheck error * fix: Luis publish missing parameter (microsoft#3764) * fix luis publish * remove empty space in setting page * resolve conflict Co-authored-by: Zhixiang Zhan <zhixzhan@microsoft.com> Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com> Co-authored-by: Andy Brown <asbrown002@gmail.com> Co-authored-by: zeye <2295905420@qq.com> Co-authored-by: Long Alan <julong@microsoft.com> Co-authored-by: Long Jun <alanlong9278@126.com> * set max memory for build * refactor qna popup logic && form editor ux * Update trigger (microsoft#3768) * update trigger actions * rebase * update trigger (microsoft#3772) * fix export bug (microsoft#3776) * separates Form / Flow's ExtensionContext * test fixed * fix trigger actions bug (microsoft#3787) * fix trigger bug (microsoft#3788) * fix trigger bug * update trigger text * conflict err * update bf-lu package & fix conflict err * Creating qn a sample (microsoft#3819) * create qnaSample bot flow * update create qna bot flow * fix bug * fix bug (microsoft#3822) * test for build qna & lu in server * Update qn a flow (microsoft#3831) * fix bug * update import qna flow * Fix ui bug (microsoft#3833) * fix bug * update import QNA UI * Update autoEndDialog to false * Navigate to qna page (microsoft#3834) * fix bug * navigate to qna page * Updates * Fix * refine code * refactor & add comment * refine code" * handle comments * popup desc * hidden the subsription key * recognizer * replace the default name with unique id * use common component to show error * comments * update UI * fix the qna icon reload issue * fix UI bug * change hover color * remove toggle on row * qna endpointKey * popup * add try catch for get qna endpointKey * update UI * remove the scroll bar and update the error display * update qna UI * input luis hoisting * conflict * comments * test fixed * test fixed * handle comments * separated QnAEditor & rename to knowledge-base (microsoft#3857) * separated QnAEditor & rename to knowledge-base * rename * rename helper to utilities * fix test case * fix unit tests * test * qna-recognizer add tests (microsoft#3859) * add triggerCreattionModal test * triggerApi test * add test for import modal * add test * dialog id * fix bug * fix bug * wrong url * conflict * Update ComposerSettingsExtensions * update the error message * conflict fix * Update ComposerSettingsExtensions.cs * azure deploy * lu build * qna build bugfix * code refine * lint fix * qna name * code refine * Update package to daily to fix the CrossTrainRecognizer issue * concurrent import qna from urls and set call limits * error message & e2e test * e2e test * code scan error * fix code scanner error * fix code scanner error * update the get params * fix UI * update qna error logic * Update package to 4.10.1 * encode qna urls * refactor * fix e2e todobot Co-authored-by: Long Jun <alanlong9278@126.com> Co-authored-by: Long Alan <julong@microsoft.com> Co-authored-by: Lu Han <32191031+luhan2017@users.noreply.github.com> Co-authored-by: Wenyi Luo <wenyluo@microsoft.com> Co-authored-by: leilzh <leilzh@microsoft.com> Co-authored-by: Zhixiang Zhan <zhixzhan@microsoft.com> Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com> Co-authored-by: Andy Brown <asbrown002@gmail.com> Co-authored-by: zeye <2295905420@qq.com> Co-authored-by: zeye <zeye@microsoft.com>

Description
closes #3227
Problem
In Electron app, there are a group of menu items under the system menu -> 'Edit' label which are designed to share the same functionality with Composer Toolbar (Undo/Redo/Cut/Copy/Del).

However, they never work due to not connected to editor events.
Target
This PR connected Composer editor APIs with the Electron app menu bar to fix this issue.
Supported actions:
'undo'(api not provided by Shell, WIP by @lei9444 )'redo'(api not provided by Shell, WIP by @lei9444 )'paste'(paste is available in the flyout action menu)How it works
Electron app menu runs in main process; Composer web app runs in renderer process.
To connect them together, we can leverage Electron IPC mechanism to let 'main' process post messages to 'renderer' process.
Task Item
Screenshots