mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
feat: remove new image actions feature flag (#7256)
This commit is contained in:
@@ -453,8 +453,7 @@ export function buildAIImageItemGroups(): AIItemGroupConfig[] {
|
||||
{
|
||||
name: 'AI image filter',
|
||||
icon: ImproveWritingIcon,
|
||||
showWhen: (_, __, host) =>
|
||||
!!host.doc.awarenessStore.getFlag('enable_new_image_actions'),
|
||||
showWhen: () => true,
|
||||
subItem: createImageFilterSubItem(blockActionTrackerOptions),
|
||||
subItemOffset: [12, -4],
|
||||
beta: true,
|
||||
@@ -462,8 +461,7 @@ export function buildAIImageItemGroups(): AIItemGroupConfig[] {
|
||||
{
|
||||
name: 'Image processing',
|
||||
icon: AIImageIcon,
|
||||
showWhen: (_, __, host) =>
|
||||
!!host.doc.awarenessStore.getFlag('enable_new_image_actions'),
|
||||
showWhen: () => true,
|
||||
subItem: createImageProcessingSubItem(blockActionTrackerOptions),
|
||||
subItemOffset: [12, -6],
|
||||
beta: true,
|
||||
@@ -471,8 +469,7 @@ export function buildAIImageItemGroups(): AIItemGroupConfig[] {
|
||||
{
|
||||
name: 'Generate a caption',
|
||||
icon: AIPenIcon,
|
||||
showWhen: (_, __, host) =>
|
||||
!!host.doc.awarenessStore.getFlag('enable_new_image_actions'),
|
||||
showWhen: () => true,
|
||||
beta: true,
|
||||
handler: actionToHandler(
|
||||
'generateCaption',
|
||||
|
||||
@@ -526,17 +526,6 @@ export function imageOnlyShowWhen(_: unknown, __: unknown, host: EditorHost) {
|
||||
return selected.length === 1 && selected[0] instanceof ImageBlockModel;
|
||||
}
|
||||
|
||||
export function experimentalImageActionsShowWhen(
|
||||
_: unknown,
|
||||
__: unknown,
|
||||
host: EditorHost
|
||||
) {
|
||||
return (
|
||||
!!host.doc.awarenessStore.getFlag('enable_new_image_actions') &&
|
||||
imageOnlyShowWhen(_, __, host)
|
||||
);
|
||||
}
|
||||
|
||||
export function mindmapRootShowWhen(_: unknown, __: unknown, host: EditorHost) {
|
||||
const selected = getCopilotSelectedElems(host);
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ import {
|
||||
} from '../../_common/icons.js';
|
||||
import {
|
||||
actionToHandler,
|
||||
experimentalImageActionsShowWhen,
|
||||
imageOnlyShowWhen,
|
||||
mindmapChildShowWhen,
|
||||
mindmapRootShowWhen,
|
||||
@@ -469,7 +468,7 @@ const generateGroup: AIItemGroupConfig = {
|
||||
{
|
||||
name: 'AI image filter',
|
||||
icon: ImproveWritingIcon,
|
||||
showWhen: experimentalImageActionsShowWhen,
|
||||
showWhen: imageOnlyShowWhen,
|
||||
subItem: imageFilterSubItem,
|
||||
subItemOffset: [12, -4],
|
||||
beta: true,
|
||||
@@ -477,7 +476,7 @@ const generateGroup: AIItemGroupConfig = {
|
||||
{
|
||||
name: 'Image processing',
|
||||
icon: AIImageIcon,
|
||||
showWhen: experimentalImageActionsShowWhen,
|
||||
showWhen: imageOnlyShowWhen,
|
||||
subItem: imageProcessingSubItem,
|
||||
subItemOffset: [12, -6],
|
||||
beta: true,
|
||||
@@ -485,7 +484,7 @@ const generateGroup: AIItemGroupConfig = {
|
||||
{
|
||||
name: 'Generate a caption',
|
||||
icon: AIPenIcon,
|
||||
showWhen: experimentalImageActionsShowWhen,
|
||||
showWhen: imageOnlyShowWhen,
|
||||
beta: true,
|
||||
handler: actionToHandler(
|
||||
'generateCaption',
|
||||
|
||||
@@ -126,7 +126,6 @@ const blocksuiteFeatureFlags: Partial<Record<keyof BlockSuiteFlags, string>> = {
|
||||
enable_expand_database_block: 'Enable Expand Database Block',
|
||||
enable_database_statistics: 'Enable Database Block Statistics',
|
||||
enable_block_query: 'Enable Todo Block Query',
|
||||
enable_new_image_actions: 'Enable New Image Actions',
|
||||
enable_edgeless_text: 'Enable New Edgeless Text',
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user