+
{props.children}
);
@@ -18,12 +23,15 @@ export const AppContainer = (props: WorkspaceRootProps): ReactElement => {
export type MainContainerProps = PropsWithChildren<{
className?: string;
+ sidebarOpen?: boolean;
}>;
export const MainContainer = (props: MainContainerProps): ReactElement => {
return (
{props.children}
diff --git a/packages/env/package.json b/packages/env/package.json
index f4a260e62..a6e6476ee 100644
--- a/packages/env/package.json
+++ b/packages/env/package.json
@@ -12,6 +12,7 @@
},
"exports": {
".": "./src/index.ts",
+ "./config": "./src/config.ts",
"./constant": "./src/constant.ts",
"./blocksuite": "./src/blocksuite.ts"
},
diff --git a/packages/i18n/src/resources/en.json b/packages/i18n/src/resources/en.json
index 50be5ae51..6e4305705 100644
--- a/packages/i18n/src/resources/en.json
+++ b/packages/i18n/src/resources/en.json
@@ -18,6 +18,7 @@
"No item": "No item",
"Import": "Import",
"Trash": "Trash",
+ "others": "Others",
"New Page": "New Page",
"New Keyword Page": "New '{{query}}' page",
"Find 0 result": "Find 0 result",
@@ -231,6 +232,7 @@
"Synced with AFFiNE Cloud": "Synced with AFFiNE Cloud",
"Recent": "Recent",
"Successfully deleted": "Successfully deleted",
+ "Update Available": "Update available",
"Restart Install Client Update": "Restart to install update",
"Add Workspace": "Add Workspace",
"Add Workspace Hint": "Select where you already have",
diff --git a/tests/parallels/local-first-delete-page.spec.ts b/tests/parallels/local-first-delete-page.spec.ts
index b3d721782..4d1c0aec9 100644
--- a/tests/parallels/local-first-delete-page.spec.ts
+++ b/tests/parallels/local-first-delete-page.spec.ts
@@ -18,7 +18,7 @@ test('New a page , then delete it in all pages, permanently delete it', async ({
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to restore');
const newPageId = page.url().split('/').reverse()[0];
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to restore',
});
@@ -36,7 +36,7 @@ test('New a page , then delete it in all pages, permanently delete it', async ({
await page.getByRole('button', { name: 'Delete' }).click();
- await page.getByRole('link', { name: 'Trash' }).click();
+ await page.getByTestId('trash-page').click();
// permanently delete it
await page
.getByTestId('more-actions-' + newPageId)
diff --git a/tests/parallels/local-first-export-page.spec.ts b/tests/parallels/local-first-export-page.spec.ts
index 9c48b4d46..e4d74a555 100644
--- a/tests/parallels/local-first-export-page.spec.ts
+++ b/tests/parallels/local-first-export-page.spec.ts
@@ -18,7 +18,7 @@ test.skip('New a page ,then open it and export html', async ({ page }) => {
await page
.getByPlaceholder('Title')
.fill('this is a new page to export html content');
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to export html content',
@@ -46,7 +46,7 @@ test.skip('New a page ,then open it and export markdown', async ({ page }) => {
await page
.getByPlaceholder('Title')
.fill('this is a new page to export markdown content');
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to export markdown content',
});
diff --git a/tests/parallels/local-first-favorite-page.spec.ts b/tests/parallels/local-first-favorite-page.spec.ts
index a19a085d6..ef426da00 100644
--- a/tests/parallels/local-first-favorite-page.spec.ts
+++ b/tests/parallels/local-first-favorite-page.spec.ts
@@ -16,7 +16,7 @@ test('New a page and open it ,then favorite it', async ({ page }) => {
await newPage(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to favorite');
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to favorite',
});
@@ -55,7 +55,7 @@ test('Cancel favorite', async ({ page }) => {
await newPage(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to favorite');
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to favorite',
});
@@ -68,14 +68,13 @@ test('Cancel favorite', async ({ page }) => {
await favoriteBtn.click();
// expect it in favorite list
- await page.getByRole('link', { name: 'Favorites' }).click();
expect(
page.getByRole('cell', { name: 'this is a new page to favorite' })
).not.toBeUndefined();
// cancel favorite
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const box = await page
.getByRole('cell', { name: 'this is a new page to favorite' })
@@ -86,7 +85,6 @@ test('Cancel favorite', async ({ page }) => {
await page.getByTestId('favorited-icon').click();
// expect it not in favorite list
- await page.getByRole('link', { name: 'Favorites' }).click();
expect(
page.getByText(
'Tips: Click Add to Favorites/Trash and the page will appear here.'
diff --git a/tests/parallels/local-first-favorites-items.spec.ts b/tests/parallels/local-first-favorites-items.spec.ts
index e6c88c694..4fa62677d 100644
--- a/tests/parallels/local-first-favorites-items.spec.ts
+++ b/tests/parallels/local-first-favorites-items.spec.ts
@@ -8,7 +8,6 @@ import {
newPage,
waitMarkdownImported,
} from '../libs/page-logic';
-import { assertCurrentWorkspaceFlavour } from '../libs/workspace';
test('Show favorite items in sidebar', async ({ page }) => {
await openHomePage(page);
@@ -17,7 +16,7 @@ test('Show favorite items in sidebar', async ({ page }) => {
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to favorite');
const newPageId = page.url().split('/').reverse()[0];
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to favorite',
});
@@ -41,7 +40,7 @@ test('Show favorite items in favorite list', async ({ page }) => {
await newPage(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to favorite');
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to favorite',
});
@@ -52,16 +51,11 @@ test('Show favorite items in favorite list', async ({ page }) => {
const favoriteBtn = page.getByTestId('editor-option-menu-favorite');
await favoriteBtn.click();
- await page.getByRole('link', { name: 'Favorites' }).click();
+ await page.getByTestId('all-pages').click();
+
expect(
page.getByRole('cell', { name: 'this is a new page to favorite' })
).not.toBeUndefined();
await page.getByRole('cell').getByRole('button').nth(0).click();
- expect(
- await page
- .getByText('Click Add to Favorites and the page will appear here.')
- .isVisible()
- ).toBe(true);
- await assertCurrentWorkspaceFlavour('local', page);
});
diff --git a/tests/parallels/local-first-new-page.spec.ts b/tests/parallels/local-first-new-page.spec.ts
index d7be89fa1..0a46ebdb0 100644
--- a/tests/parallels/local-first-new-page.spec.ts
+++ b/tests/parallels/local-first-new-page.spec.ts
@@ -25,7 +25,7 @@ test('click btn bew page and find it in all pages', async ({ page }) => {
await newPage(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page');
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', { name: 'this is a new page' });
expect(cell).not.toBeUndefined();
await assertCurrentWorkspaceFlavour('local', page);
diff --git a/tests/parallels/local-first-openpage-newtab.spec.ts b/tests/parallels/local-first-openpage-newtab.spec.ts
index 65b78e253..d335b74ac 100644
--- a/tests/parallels/local-first-openpage-newtab.spec.ts
+++ b/tests/parallels/local-first-openpage-newtab.spec.ts
@@ -18,7 +18,7 @@ test('click btn bew page and open in tab', async ({ page }) => {
const newPageUrl = page.url();
const newPageId = page.url().split('/').reverse()[0];
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
await page
.getByTestId('more-actions-' + newPageId)
diff --git a/tests/parallels/local-first-restore-page.spec.ts b/tests/parallels/local-first-restore-page.spec.ts
index 153685493..49995ffba 100644
--- a/tests/parallels/local-first-restore-page.spec.ts
+++ b/tests/parallels/local-first-restore-page.spec.ts
@@ -18,7 +18,7 @@ test('New a page , then delete it in all pages, restore it', async ({
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to restore');
const newPageId = page.url().split('/').reverse()[0];
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to restore',
});
@@ -36,7 +36,7 @@ test('New a page , then delete it in all pages, restore it', async ({
await page.getByRole('button', { name: 'Delete' }).click();
- await page.getByRole('link', { name: 'Trash' }).click();
+ await page.getByTestId('trash-page').click();
await page.waitForTimeout(50);
const trashPage = page.url();
// restore it
@@ -48,7 +48,7 @@ test('New a page , then delete it in all pages, restore it', async ({
// stay in trash page
expect(page.url()).toBe(trashPage);
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const restoreCell = page.getByRole('cell', {
name: 'this is a new page to restore',
});
diff --git a/tests/parallels/local-first-show-delete-modal.spec.ts b/tests/parallels/local-first-show-delete-modal.spec.ts
index 542e08048..3933806b7 100644
--- a/tests/parallels/local-first-show-delete-modal.spec.ts
+++ b/tests/parallels/local-first-show-delete-modal.spec.ts
@@ -16,7 +16,7 @@ test('New a page ,then open it and show delete modal', async ({ page }) => {
await newPage(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to delete');
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to delete',
});
@@ -40,7 +40,7 @@ test('New a page ,then go to all pages and show delete modal', async ({
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to delete');
const newPageId = page.url().split('/').reverse()[0];
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to delete',
});
diff --git a/tests/parallels/local-first-trash-page.spec.ts b/tests/parallels/local-first-trash-page.spec.ts
index 93fe66ccd..451829f7c 100644
--- a/tests/parallels/local-first-trash-page.spec.ts
+++ b/tests/parallels/local-first-trash-page.spec.ts
@@ -18,7 +18,7 @@ test('New a page , then delete it in all pages, finally find it in trash', async
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to delete');
const newPageId = page.url().split('/').reverse()[0];
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to delete',
});
@@ -36,7 +36,7 @@ test('New a page , then delete it in all pages, finally find it in trash', async
await page.getByRole('button', { name: 'Delete' }).click();
- await page.getByRole('link', { name: 'Trash' }).click();
+ await page.getByTestId('trash-page').click();
expect(
page.getByRole('cell', { name: 'this is a new page to delete' })
).not.toBeUndefined();
diff --git a/tests/parallels/open-affine.spec.ts b/tests/parallels/open-affine.spec.ts
index d286fb98c..9aa111e5e 100644
--- a/tests/parallels/open-affine.spec.ts
+++ b/tests/parallels/open-affine.spec.ts
@@ -48,7 +48,7 @@ test('Click right-bottom corner change log icon', async ({ page }) => {
);
await page.waitForTimeout(50);
expect(await editorRightBottomChangeLog.isVisible()).toEqual(true);
- await page.getByRole('link', { name: 'All pages' }).click();
+ await page.getByTestId('all-pages').click();
const normalRightBottomChangeLog = page.locator(
'[data-testid=right-bottom-change-log-icon]'
);