chore(core): remove client comment feature flag (#13034)

#### PR Dependency Tree


* **PR #13034** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

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

## Summary by CodeRabbit

* **Refactor**
  * Removed the comment feature flag from the application.
* The ability to enable comments now depends solely on server
configuration, not on a feature flag.
* **Chores**
* Cleaned up related feature flag definitions and internal logic for
comment enablement.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: fengmk2 <fengmk2@gmail.com>
This commit is contained in:
L-Sun
2025-07-04 19:26:30 +08:00
committed by GitHub
parent 1452f77c85
commit ee8c7616bc
4 changed files with 4 additions and 18 deletions
@@ -21,7 +21,6 @@ export interface BlockSuiteFlags {
enable_table_virtual_scroll: boolean;
enable_turbo_renderer: boolean;
enable_dom_renderer: boolean;
enable_comment: boolean;
}
export class FeatureFlagService extends StoreExtension {
@@ -47,7 +46,6 @@ export class FeatureFlagService extends StoreExtension {
enable_table_virtual_scroll: false,
enable_turbo_renderer: false,
enable_dom_renderer: false,
enable_comment: false,
});
setFlag(key: keyof BlockSuiteFlags, value: boolean) {
@@ -85,10 +85,8 @@ const usePatchSpecs = (mode: DocMode) => {
const serverService = useService(ServerService);
const serverConfig = useLiveData(serverService.server.config$);
const enableComment =
useLiveData(featureFlagService.flags.enable_comment.$) &&
// comment may not be supported by the server
serverConfig.features.includes(ServerFeature.Comment);
// comment may not be supported by the server
const enableComment = serverConfig.features.includes(ServerFeature.Comment);
const patchedSpecs = useMemo(() => {
const manager = getViewManager()
@@ -118,10 +118,8 @@ const DetailPageImpl = memo(function DetailPageImpl() {
const serverService = useService(ServerService);
const serverConfig = useLiveData(serverService.server.config$);
const enableComment =
useLiveData(featureFlagService.flags.enable_comment.$) &&
// comment may not be supported by the server
serverConfig.features.includes(ServerFeature.Comment);
// comment may not be supported by the server
const enableComment = serverConfig.features.includes(ServerFeature.Comment);
useEffect(() => {
if (isActiveView) {
@@ -264,14 +264,6 @@ export const AFFINE_FLAGS = {
configurable: isCanaryBuild,
defaultState: false,
},
enable_comment: {
category: 'blocksuite',
bsFlag: 'enable_comment',
displayName: 'Enable Comment',
description: 'Enable comment',
configurable: true,
defaultState: isCanaryBuild,
},
} satisfies { [key in string]: FlagInfo };
// oxlint-disable-next-line no-redeclare