Skip to content

Commit

Permalink
chore: replace ambiguous "page" with "doc" (toeverything#6171)
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmFly authored Feb 1, 2024
1 parent b178f26 commit 49fc7c5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/blocks/src/page-block/widgets/linked-doc/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const getMenus: (ctx: {

return [
{
name: 'Link to Page',
name: 'Link to Doc',
styles: 'overflow-y: scroll; max-height: 224px;',
items: filteredPageList.map(page => ({
key: page.id,
Expand All @@ -103,11 +103,11 @@ export const getMenus: (ctx: {
})),
},
{
name: 'New page',
name: 'New Doc',
items: [
{
key: 'create',
name: `Create "${displayPageName}" page`,
name: `Create "${displayPageName}" doc`,
icon: NewPageIcon,
action: async () => {
const pageName = query;
Expand Down
6 changes: 3 additions & 3 deletions packages/blocks/src/page-block/widgets/slash-menu/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ export const menuGroups: SlashMenuOptions['menus'] = [
},

{
name: 'Pages',
name: 'Docs',
items: [
{
name: 'New Page',
name: 'New Doc',
icon: NewPageIcon,
action: async ({ pageElement, model }) => {
const newPage = await createDefaultPage(pageElement.page.workspace);
Expand All @@ -204,7 +204,7 @@ export const menuGroups: SlashMenuOptions['menus'] = [
},
},
{
name: 'Link Page',
name: 'Link Doc',
alias: ['dual link'],
icon: DualLinkIcon,
showWhen: (_, pageElement) => {
Expand Down
4 changes: 2 additions & 2 deletions tests/linked-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,14 +698,14 @@ test.describe('linked page popover', () => {
await expect(pageBtn).toHaveText([
'page1',
'page2',
'Create "Untitled" page',
'Create "Untitled" doc',
'Import',
]);
// page2
// ^ ^
await type(page, 'a2');
await expect(pageBtn).toHaveCount(3);
await expect(pageBtn).toHaveText(['page2', 'Create "a2" page', 'Import']);
await expect(pageBtn).toHaveText(['page2', 'Create "a2" doc', 'Import']);
await pressEnter(page);
await expect(linkedPagePopover).toBeHidden();
await assertExistRefText('page2');
Expand Down
2 changes: 2 additions & 0 deletions tests/slash-menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ test.describe('slash search', () => {
await expect(slashItems).toHaveText([
'Code Block',
'Italic',
'New Doc',
'Link Doc',
'File',
'Copy',
'Duplicate',
Expand Down

0 comments on commit 49fc7c5

Please sign in to comment.