Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): do not show starter bar for doc in history modal (#10107)

CatsJuice39182b5fc6f5
diff --git a/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx b/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx
index 15c8177c64..daf2ba24c8 100644
--- a/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx
+++ b/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx
@@ -139,6 +139,7 @@ const HistoryEditorPreview = ({
className={styles.editor}
mode={mode}
page={snapshotPage}
+ readonly={true}
/>
</CustomEditorWrapper>
</Scrollable.Viewport>
diff --git a/tests/affine-cloud/e2e/page-history.spec.ts b/tests/affine-cloud/e2e/page-history.spec.ts
index f5fdf769a2..2cf2677c2a 100644
--- a/tests/affine-cloud/e2e/page-history.spec.ts
+++ b/tests/affine-cloud/e2e/page-history.spec.ts
@@ -154,3 +154,32 @@ test('can restore page to a history version', async ({ page }) => {
// title should be restored to 'TEST TITLE'
await expect(title).toContainText('TEST TITLE');
});
+
+test('empty history doc should not show starter bar', async ({ page }) => {
+ await page.reload();
+ await waitForEditorLoad(page);
+ await createLocalWorkspace({ name: 'test' }, page);
+ await enableCloudWorkspace(page);
+
+ await pushCurrentPageUpdates(page);
+
+ const title = getBlockSuiteEditorTitle(page);
+ await title.focus();
+ await title.pressSequentially('TEST TITLE', {
+ delay: 50,
+ });
+ // write something and push to history
+ await pushCurrentPageUpdates(page);
+
+ // click the history button
+ await page.getByTestId('header-dropDownButton').click();
+ await page.getByTestId('editor-option-menu-history').click();
+
+ const modal = page.getByTestId('page-history-modal');
+
+ // expect history modal shown up
+ await expect(modal).toBeVisible();
+
+ const aiBadge = modal.getByTestId('start-with-ai-badge');
+ await expect(aiBadge).not.toBeVisible();
+});