fix(editor): can not create surface block comment (#13115)

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

## Summary by CodeRabbit

* **Bug Fixes**
* Improved comment handling to ensure elements from all selections are
considered, regardless of surface ID.
* Enhanced preview generation for comments to include all relevant
selections without surface-based filtering.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
L-Sun
2025-07-09 19:05:03 +08:00
committed by GitHub
parent ecea7bd825
commit 39abd1bbb8
2 changed files with 2 additions and 6 deletions

View File

@@ -50,10 +50,7 @@ function getPreviewFromSelections(
} else if (selection instanceof ImageSelection) {
// Return <"Image"> for ImageSelection
previews.push('<Image>');
} else if (
selection instanceof SurfaceSelection &&
gfx.surface?.id === selection.blockId
) {
} else if (selection instanceof SurfaceSelection) {
selection.elements.forEach(elementId => {
const model = gfx.getElementById(elementId);
if (model instanceof GfxPrimitiveElementModel) {