-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): frame editor settings #9970
feat(core): frame editor settings #9970
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
7a26130
to
319b086
Compare
blocksuite/blocks/src/root-block/edgeless/gfx-tool/frame-tool.ts
Outdated
Show resolved
Hide resolved
packages/frontend/core/src/desktop/dialogs/setting/general-setting/editor/edgeless/snapshot.tsx
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## canary #9970 +/- ##
==========================================
- Coverage 54.10% 53.84% -0.27%
==========================================
Files 2279 2279
Lines 104475 104464 -11
Branches 17381 17332 -49
==========================================
- Hits 56527 56245 -282
- Misses 46571 46850 +279
+ Partials 1377 1369 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on the PR! I've noticed there are other entry points for adding affine:frame
that might also need to be modified. Could you please take a look at those areas and make the necessary adjustments? Thank you for your hard work and contribution!
AFFiNE/blocksuite/blocks/src/root-block/edgeless/components/auto-complete/auto-complete-panel.ts
Lines 161 to 169 in 17bf75e
const id = this.crud.addBlock( | |
'affine:frame', | |
{ | |
title: new Y.Text(`Frame ${frameIndex}`), | |
xywh: serializeXYWH(...xywh), | |
presentationIndex: frameMgr.generatePresentationIndex(), | |
}, | |
surfaceBlockModel | |
); |
AFFiNE/blocksuite/blocks/src/root-block/edgeless/frame-manager.ts
Lines 195 to 206 in 5842d45
private _addFrameBlock(bound: Bound) { | |
const surfaceModel = this.gfx.surface as SurfaceBlockModel; | |
const id = this.gfx.doc.addBlock( | |
'affine:frame', | |
{ | |
title: new Text(new Y.Text(`Frame ${this.frames.length + 1}`)), | |
xywh: bound.serialize(), | |
index: this.gfx.layer.generateIndex(true), | |
presentationIndex: this.generatePresentationIndex(), | |
}, | |
surfaceModel | |
); |
Thank you for the feedback, I really appreciate it! I have added |
Related to #9970 (comment) ### What changes: - Add missing zod shcema for edgeless basic props - Change `applyLastProps` to generic function for better return type inference of - Fix: add `ZodIntersection` case to `makeDeepOptional`
fa0a744
to
d396ee6
Compare
I have updated the branch to the latest changes by rebasing it, since 459972f wasn't included. It seems I should've been updated it using another method, since my commit dates were updated. I know I can use merge, but will all merged commits will be included in this PR? Could you please tell me the method you use to update the branch? Thanks |
There is a problem with editor settings preview. It started looking like this after update. I tried changing the frame from |
I'm sorry about that. It seems that the declarations for ZodSchema in the editor are currently only used for editor settings, not for model definitions. This can lead to some properties in the snapshot being overridden during initialization. I have reverted these changes in this PR. |
Everything works great now. Thank you for your help! |
Fixes #9646
Demo
Screen.Recording.2025-02-05.at.22.19.05.mov
Design Decisions
frame-tools.ts
: other blocks update their props using one of the extensions insurface
block. Sinceframe
block is not a part of thesurface
, this extension wasn't called. I decided to update the props directly in theframe-tool.ts
instead of writing an extension for entireframe
blocksnapshot.tsx
: whenever editor settings are opened, one frame in each block preview area is deleted. This behavior deleted the preview frame that shows the selected color of frame settings. I decided to exclude this frame from deletion process