mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Floating formula editor
Summary: Adding a way to detach an editor. Initially only implemented for the formula editor, includes redesign for the AI part. - Initially, the detached editor is tight with the formula assistant and both are behind GRIST_FORMULA_ASSISTANT flag, but this can be relaxed later on, as the detached editor can be used on its own. - Detached editor is only supported in regular fields and on the creator panel. It is not supported yet for conditional styles, due to preview limitations. - Old code for the assistant was removed completely, as it was only a temporary solution, but the AI conversation part was copied to the new one. - Prompting was not modified in this diff, it will be included in the follow-up with more test cases. Test Plan: Added only new tests; existing tests should pass. Reviewers: JakubSerafin Reviewed By: JakubSerafin Differential Revision: https://phab.getgrist.com/D3863
This commit is contained in:
@@ -74,7 +74,7 @@ describe('DocTutorial', function () {
|
||||
await gu.skipWelcomeQuestions();
|
||||
|
||||
// Make sure we have clean start.
|
||||
await driver.executeScript('resetSeenPopups();');
|
||||
await driver.executeScript('resetDismissedPopups();');
|
||||
await gu.waitForServer();
|
||||
await driver.navigate().refresh();
|
||||
await gu.waitForDocMenuToLoad();
|
||||
|
||||
@@ -13,7 +13,7 @@ describe('RightPanel', function() {
|
||||
await mainSession.tempNewDoc(cleanup);
|
||||
|
||||
// Reset prefs.
|
||||
await driver.executeScript('resetSeenPopups();');
|
||||
await driver.executeScript('resetDismissedPopups();');
|
||||
await gu.waitForServer();
|
||||
|
||||
// Refresh for a clean start.
|
||||
|
||||
@@ -960,9 +960,15 @@ export async function waitForServer(optTimeout: number = 2000) {
|
||||
* Sends UserActions using client api from the browser.
|
||||
*/
|
||||
export async function sendActions(actions: UserAction[]) {
|
||||
await driver.executeScript(`
|
||||
gristDocPageModel.gristDoc.get().docModel.docData.sendActions(${JSON.stringify(actions)});
|
||||
const result = await driver.executeAsyncScript(`
|
||||
const done = arguments[arguments.length - 1];
|
||||
const prom = gristDocPageModel.gristDoc.get().docModel.docData.sendActions(${JSON.stringify(actions)});
|
||||
prom.then(() => done(null));
|
||||
prom.catch((err) => done(String(err?.message || err)));
|
||||
`);
|
||||
if (result) {
|
||||
throw new Error(result as string);
|
||||
}
|
||||
await waitForServer();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user