-
-
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: edgeless dnd #9988
base: canary
Are you sure you want to change the base?
feat: edgeless dnd #9988
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. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## canary #9988 +/- ##
==========================================
- Coverage 53.90% 53.87% -0.03%
==========================================
Files 2293 2294 +1
Lines 105467 105693 +226
Branches 17463 17538 +75
==========================================
+ Hits 56851 56947 +96
- Misses 47245 47374 +129
- Partials 1371 1372 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
9fa84e1
to
a0aee4d
Compare
@@ -35,6 +36,8 @@ export type BeforeExportPayload = | |||
| { | |||
model: DraftModel; | |||
type: 'block'; | |||
action: 'default' | 'skip'; |
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.
What's the meaning of this new action and transformer?
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.
I want to skip some models during export to snapshot without modifying the draf model.
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.
Understood, but why you don't want to modify the draft model? I think model.children.filter
is more straight forward than adding flags.
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.
Oh I see. I thought the DraftModel
is just an other name of BlockModel
. So we can modify the draft model without affecting the original BlockModel
?
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.
It seems like toDraftModel
has not been called.
} | ||
|
||
if (payload.model.flavour === 'affine:surface') { | ||
(payload.transformer as SurfaceBlockTransformer).selectedElements = |
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.
This is wired and not really type safe, maybe rename adapterConfigs to transformerConfigs and use it?
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.
I want to attach or send some message to the specific block transformer to change its behaviour. Any way to do that?
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.
How about modifying BaseBlockTransformer
constructor to accept adapterConfigs
, so that we can pass information for Transformer
to specific block transformer?
matchFlavours(parent, [SurfaceBlockModel]) && | ||
!selectedIds.has(payload.model.id) | ||
) { | ||
payload.action = 'skip'; |
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.
if we add action
for one type of payload, we need to add this for all the transformer payloads. But if you're trying to not transform some node, why not just filter the children in parent?
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.
Any example of the way you mentioned ? I see the _blockToSnapshot
method will directly access the model.children
, how to filter out the children I don't want to transform?
a3e978c
to
a9aeb10
Compare
Changed