보조지표 합치기, 분리, 복사하기 기능 오류 수정

This commit is contained in:
Macbook
2026-06-01 01:50:54 +09:00
parent f2208aab99
commit 227db1e607
4 changed files with 110 additions and 35 deletions
+14
View File
@@ -1,4 +1,5 @@
import type { IndicatorConfig } from '../types';
import { layoutKey } from './indicatorPaneMerge';
export type IndicatorChartSyncMode =
| 'none'
@@ -6,6 +7,7 @@ export type IndicatorChartSyncMode =
| 'add-only'
| 'params-changed'
| 'reorder-only'
| 'layout-changed'
| 'full';
export interface IndicatorChartChange {
@@ -62,6 +64,9 @@ export function classifyIndicatorChartChange(
};
if (removedIds.length === 0 && added.length === 0 && paramsChangedIds.length === 0) {
if (layoutKey(prev) !== layoutKey(curr)) {
return { ...empty, mode: 'layout-changed' };
}
const sameSet = prev.length === curr.length
&& prev.every(p => currMap.has(p.id));
if (sameSet && prev.map(i => i.id).join(',') !== curr.map(i => i.id).join(',')) {
@@ -70,6 +75,15 @@ export function classifyIndicatorChartChange(
return empty;
}
/** 병합·분리 등 mergedWith 변경 — params 키에도 잡히지만 pane 재배치가 필요 */
if (
removedIds.length === 0
&& added.length === 0
&& layoutKey(prev) !== layoutKey(curr)
) {
return { ...empty, mode: 'layout-changed', paramsChangedIds };
}
if (removedIds.length > 0 && added.length === 0 && paramsChangedIds.length === 0) {
return { ...empty, mode: 'remove-only' };
}