fix(editor): add recent open doc with mode button (#11419)

Closes: [BS-3013](https://linear.app/affine-design/issue/BS-3013/open-doc-分开两个按钮:一个快捷按钮和一个菜单)

Split into two buttons: `recent open doc with mode button` and `open doc with dropdown menu`.
This commit is contained in:
fundon
2025-04-03 02:06:14 +00:00
parent b53b2acfe3
commit 03dd073cb4
5 changed files with 58 additions and 33 deletions

View File

@@ -716,18 +716,20 @@ function renderOpenDocMenu(
}));
if (!actions.length) return null;
const openDocMode = computed(
() => settings.settingSignal.value.openDocMode ?? 'open-in-active-view'
);
const updateOpenDocMode = (mode: OpenDocMode) =>
settings.openDocMode.set(mode);
return html`${keyed(
target,
html`
<affine-open-doc-dropdown-menu
.actions=${actions}
.context=${ctx}
.openDocMode$=${computed(
() =>
settings.settingSignal.value.openDocMode ?? 'open-in-active-view'
)}
.updateOpenDocMode=${(mode: OpenDocMode) =>
settings.openDocMode.set(mode)}
.openDocMode$=${openDocMode}
.updateOpenDocMode=${updateOpenDocMode}
>
</affine-open-doc-dropdown-menu>
`