mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
fix: connector label editing (#12282)
Fixes [BS-3373](https://linear.app/affine-design/issue/BS-3373/connector%E7%9A%84%E5%8F%8C%E5%87%BB%E6%B7%BB%E5%8A%A0note%E8%A1%8C%E4%B8%BA%E5%8F%97%E5%88%B0%E4%BA%86%E8%A6%86%E7%9B%96%E8%8C%83%E5%9B%B4%E7%9A%84%E5%BD%B1%E5%93%8D) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Connector label elements now include identity and creator metadata. - **Bug Fixes** - Improved hit-testing for pointer interactions, resulting in more accurate detection of hovered elements. - **Refactor** - Enhanced internal comparison logic for elements, improving sorting and ordering consistency. - Strengthened type definitions for search filters, improving result accuracy and clarity. - **Tests** - Added end-to-end tests to verify correct label entry and retrieval for multiple connectors. - Introduced utility functions to fetch connector labels and improved connector creation in test actions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -13,7 +13,7 @@ import { mutex } from 'lib0';
|
||||
|
||||
import type { EditorHost } from '../../../view/index.js';
|
||||
import type { GfxCompatibleInterface, PointTestOptions } from '../base.js';
|
||||
import type { GfxGroupModel } from '../model.js';
|
||||
import type { GfxGroupModel, GfxModel } from '../model.js';
|
||||
import type { SurfaceBlockModel } from './surface-model.js';
|
||||
|
||||
export function prop<V, T extends GfxLocalElementModel>() {
|
||||
@@ -61,6 +61,8 @@ export abstract class GfxLocalElementModel implements GfxCompatibleInterface {
|
||||
|
||||
abstract readonly type: string;
|
||||
|
||||
creator: GfxModel | null = null;
|
||||
|
||||
get deserializedXYWH() {
|
||||
if (!this._local.has('deserializedXYWH')) {
|
||||
const xywh = this.xywh;
|
||||
|
||||
Reference in New Issue
Block a user