chore: remove multiple cloud server flag (#12531)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - The "Add Selfhosted" and "Add Server" options are now displayed whenever the build configuration is native, without relying on feature flags.

- **Refactor**
  - Simplified conditional rendering for server addition buttons by replacing feature flag checks with build configuration checks.

- **Chores**
  - Removed the "Multiple Cloud Servers" feature flag and its related localization strings, streamlining feature management and UI labels.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
forehalo
2025-05-26 12:37:14 +00:00
parent 7f2b094eb5
commit c2ffcb2c2c
6 changed files with 6 additions and 38 deletions

View File

@@ -10,7 +10,6 @@ import { OAuth } from '@affine/core/components/affine/auth/oauth';
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
import { AuthService, ServerService } from '@affine/core/modules/cloud';
import type { AuthSessionStatus } from '@affine/core/modules/cloud/entities/session';
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { ServerDeploymentType } from '@affine/graphql';
import { Trans, useI18n } from '@affine/i18n';
import {
@@ -61,10 +60,6 @@ export const SignInStep = ({
)
);
const authService = useService(AuthService);
const featureFlagService = useService(FeatureFlagService);
const enableMultipleCloudServers = useLiveData(
featureFlagService.flags.enable_multiple_cloud_servers.$
);
const [isMutating, setIsMutating] = useState(false);
const [email, setEmail] = useState('');
@@ -181,7 +176,7 @@ export const SignInStep = ({
<div className={style.skipDividerLine} />
</div>
<div className={style.skipSection}>
{BUILD_CONFIG.isElectron && enableMultipleCloudServers ? (
{BUILD_CONFIG.isNative ? (
<Button
variant="plain"
className={style.addSelfhostedButton}

View File

@@ -1,9 +1,8 @@
import { Divider, MenuItem } from '@affine/component';
import { GlobalDialogService } from '@affine/core/modules/dialogs';
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { useI18n } from '@affine/i18n';
import { PlusIcon } from '@blocksuite/icons/rc';
import { useLiveData, useService } from '@toeverything/infra';
import { useService } from '@toeverything/infra';
import { useCallback } from 'react';
import {
@@ -16,18 +15,15 @@ import { addServerDividerWrapper } from './index.css';
export const AddServer = () => {
const t = useI18n();
const globalDialogService = useService(GlobalDialogService);
const featureFlagService = useService(FeatureFlagService);
const enableMultipleServer = useLiveData(
featureFlagService.flags.enable_multiple_cloud_servers.$
);
const onAddServer = useCallback(() => {
globalDialogService.open('sign-in', { step: 'addSelfhosted' });
}, [globalDialogService]);
if (!enableMultipleServer) {
if (!BUILD_CONFIG.isNative) {
return null;
}
return (
<>
<div className={addServerDividerWrapper}>

View File

@@ -10,7 +10,6 @@ import {
ServersService,
} from '@affine/core/modules/cloud';
import { GlobalDialogService } from '@affine/core/modules/dialogs';
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { GlobalContextService } from '@affine/core/modules/global-context';
import {
type WorkspaceMetadata,
@@ -262,18 +261,15 @@ const CloudWorkSpaceList = ({
const AddServer = () => {
const globalDialogService = useService(GlobalDialogService);
const featureFlagService = useService(FeatureFlagService);
const enableMultipleServer = useLiveData(
featureFlagService.flags.enable_multiple_cloud_servers.$
);
const onAddServer = useCallback(() => {
globalDialogService.open('sign-in', { step: 'addSelfhosted' });
}, [globalDialogService]);
if (!enableMultipleServer) {
if (!BUILD_CONFIG.isNative) {
return null;
}
return <IconButton onClick={onAddServer} size="24" icon={<SelfhostIcon />} />;
};

View File

@@ -209,15 +209,6 @@ export const AFFINE_FLAGS = {
configurable: false,
defaultState: isMobile,
},
enable_multiple_cloud_servers: {
category: 'affine',
displayName:
'com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.name',
description:
'com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.description',
configurable: false,
defaultState: isDesktopEnvironment || BUILD_CONFIG.isIOS,
},
enable_mobile_edgeless_editing: {
category: 'affine',
displayName:

View File

@@ -5834,14 +5834,6 @@ export function useAFFiNEI18N(): {
* `Once enabled, users can import and export blocksuite snapshots.`
*/
["com.affine.settings.workspace.experimental-features.enable-snapshot-import-export.description"](): string;
/**
* `Multiple Cloud Servers`
*/
["com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.name"](): string;
/**
* `Once enabled, users can connect to selfhosted cloud servers.`
*/
["com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.description"](): string;
/**
* `Enable Edgeless Editing`
*/

View File

@@ -1456,8 +1456,6 @@
"com.affine.settings.workspace.experimental-features.enable-mobile-linked-doc-menu.description": "Enables the mobile linked doc menu.",
"com.affine.settings.workspace.experimental-features.enable-snapshot-import-export.name": "Enable Snapshot Import Export",
"com.affine.settings.workspace.experimental-features.enable-snapshot-import-export.description": "Once enabled, users can import and export blocksuite snapshots.",
"com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.name": "Multiple Cloud Servers",
"com.affine.settings.workspace.experimental-features.enable-multiple-cloud-servers.description": "Once enabled, users can connect to selfhosted cloud servers.",
"com.affine.settings.workspace.experimental-features.enable-mobile-edgeless-editing.name": "Enable Edgeless Editing",
"com.affine.settings.workspace.experimental-features.enable-mobile-edgeless-editing.description": "Once enabled, users can edit edgeless canvas.",
"com.affine.settings.workspace.experimental-features.enable-pdf-embed-preview.name": "PDF embed preview",