Skip to content

Commit

Permalink
feat: add block visibility config (#8371)
Browse files Browse the repository at this point in the history
  • Loading branch information
doodlewind authored Sep 24, 2024
1 parent 3d9a777 commit a77061e
Show file tree
Hide file tree
Showing 11 changed files with 184 additions and 174 deletions.
2 changes: 1 addition & 1 deletion packages/common/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"type": "module",
"devDependencies": {
"@blocksuite/affine": "0.17.14",
"@blocksuite/affine": "0.17.15",
"vitest": "2.1.1"
},
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@affine/debug": "workspace:*",
"@affine/env": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/affine": "0.17.14",
"@blocksuite/affine": "0.17.15",
"@datastructures-js/binary-search-tree": "^5.3.2",
"foxact": "^0.2.33",
"fuse.js": "^7.0.0",
Expand Down
9 changes: 9 additions & 0 deletions packages/common/infra/src/modules/feature-flag/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ export const AFFINE_FLAGS = {
configurable: isCanaryBuild,
defaultState: isDesktopEnvironment || isCanaryBuild,
},
enable_advanced_block_visibility: {
category: 'blocksuite',
bsFlag: 'enable_advanced_block_visibility',
displayName: 'Advanced block visibility control',
description:
'To provide detailed control over which edgeless blocks are visible in page mode.',
configurable: true,
defaultState: false,
},
} satisfies { [key in string]: FlagInfo };

export type AFFINE_FLAGS = typeof AFFINE_FLAGS;
2 changes: 1 addition & 1 deletion packages/frontend/apps/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@affine/core": "workspace:*",
"@affine/i18n": "workspace:*",
"@affine/native": "workspace:*",
"@blocksuite/affine": "0.17.14",
"@blocksuite/affine": "0.17.15",
"@electron-forge/cli": "^7.3.0",
"@electron-forge/core": "^7.3.0",
"@electron-forge/core-utils": "^7.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@affine/component": "workspace:*",
"@affine/core": "workspace:*",
"@affine/i18n": "workspace:*",
"@blocksuite/affine": "0.17.14",
"@blocksuite/affine": "0.17.15",
"@blocksuite/icons": "^2.1.67",
"@sentry/react": "^8.0.0",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@blocksuite/affine": "0.17.14",
"@blocksuite/affine": "0.17.15",
"@blocksuite/icons": "2.1.67",
"@chromatic-com/storybook": "^2.0.0",
"@storybook/addon-essentials": "^8.2.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@affine/i18n": "workspace:*",
"@affine/templates": "workspace:*",
"@affine/track": "workspace:*",
"@blocksuite/affine": "0.17.14",
"@blocksuite/affine": "0.17.15",
"@blocksuite/icons": "2.1.67",
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/modifiers": "^7.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ const SAVE_CHAT_TO_BLOCK_ACTION: ChatAction = {
curMode,
rootService as RootService
);
const newBlockIndex = layer.generateIndex('affine:embed-ai-chat');
const newBlockIndex = layer.generateIndex();
// If current mode is not edgeless, switch to edgeless mode first
if (curMode !== 'edgeless') {
// Set mode to edgeless
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function createNewNote(host: EditorHost): AIItemConfig {
{
xywh: newBound.serialize(),
displayMode: NoteDisplayMode.EdgelessOnly,
index: service.generateIndex('affine:note'),
index: service.generateIndex(),
},
doc.root.id
);
Expand Down
2 changes: 1 addition & 1 deletion tools/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@affine/env": "workspace:*",
"@affine/templates": "workspace:*",
"@aws-sdk/client-s3": "^3.620.0",
"@blocksuite/affine": "0.17.14",
"@blocksuite/affine": "0.17.15",
"@clack/core": "^0.3.4",
"@clack/prompts": "^0.7.0",
"@magic-works/i18n-codegen": "^0.6.0",
Expand Down
Loading

0 comments on commit a77061e

Please sign in to comment.