refactor: enhance selectingEngine with multi-delete support and structured context menu items
This commit is contained in:
@@ -742,10 +742,12 @@ function EditorPageContent() {
|
||||
|
||||
if (m === "replay" && featureId) {
|
||||
// QUY TẮC: Geo chọn đầu tiên là geo main.
|
||||
const finalSelectedIds = Array.from(new Set([...selectedFeatureIds, featureId]));
|
||||
const triggerId = selectedFeatureIds.length > 0 ? selectedFeatureIds[0] : featureId;
|
||||
|
||||
setReplayFeatureId(triggerId);
|
||||
setReplaySelection({ stageId: null, stepIndex: null });
|
||||
editor.switchReplayContext(triggerId, selectedFeatureIds);
|
||||
editor.switchReplayContext(triggerId, finalSelectedIds);
|
||||
setSelectedFeatureIds([]);
|
||||
} else if (m !== "replay") {
|
||||
if (mode === "replay") {
|
||||
@@ -2037,7 +2039,13 @@ function EditorPageContent() {
|
||||
selectedFeatureIds={selectedFeatureIds}
|
||||
onSelectFeatureIds={setSelectedFeatureIds}
|
||||
onCreateFeature={handleCreateFeature}
|
||||
onDeleteFeature={editor.deleteFeature}
|
||||
onDeleteFeature={(id) => {
|
||||
if (Array.isArray(id)) {
|
||||
editor.deleteFeatures(id);
|
||||
} else {
|
||||
editor.deleteFeature(id);
|
||||
}
|
||||
}}
|
||||
onHideFeature={handleHideGeometryLocal}
|
||||
onUpdateFeature={editor.updateFeature}
|
||||
backgroundVisibility={backgroundVisibility}
|
||||
@@ -2190,10 +2198,15 @@ function EditorPageContent() {
|
||||
<EntityWikiBindingsPanel
|
||||
setLinks={setSnapshotEntityWikiLinksUndoable}
|
||||
/>
|
||||
{selectedFeature ? (
|
||||
{selectedFeatures.length > 0 ? (
|
||||
<SelectedGeometryPanel
|
||||
selectedFeatures={selectedFeatures}
|
||||
onApplyGeometryMetadata={featureCommands.applyGeometryMetadata}
|
||||
onDeleteFeatures={(ids) => {
|
||||
editor.deleteFeatures(ids);
|
||||
setSelectedFeatureIds([]);
|
||||
}}
|
||||
onDeselectAll={() => setSelectedFeatureIds([])}
|
||||
changeCount={editor.changeCount}
|
||||
onReplayEdit={(id) => setMode("replay", id)}
|
||||
/>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user