Skip to content

Commit 30016fb

Browse files
committed
hide rather than clear server eval when analysis disabled
1 parent 23e7ef6 commit 30016fb

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

ui/analyse/src/autoShape.ts

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ function hiliteVariations(ctrl: AnalyseCtrl, autoShapes: DrawShape[]) {
132132
const isGamebookEditor = chap?.gamebook && !ctrl.study?.gamebookPlay();
133133

134134
for (const [i, node] of ctrl.node.children.entries()) {
135+
if (!ctrl.showComputer() && node.comp) continue;
135136
const userShape = findShape(node.uci, ctrl.node.shapes);
136137

137138
if (userShape && i === ctrl.fork.selected()) autoShapes.push({ ...userShape }); // so we can hilite it

ui/analyse/src/ctrl.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ export default class AnalyseCtrl {
769769
!this.study?.gamebookPlay() &&
770770
!this.retro &&
771771
this.variationArrowsProp() &&
772-
this.node.children.length > 1
772+
this.node.children.filter(x => this.showComputer() || !x.comp).length > 1
773773
);
774774
}
775775

@@ -794,7 +794,6 @@ export default class AnalyseCtrl {
794794

795795
private onToggleComputer() {
796796
if (!this.showComputer()) {
797-
this.tree.removeComputerVariations();
798797
if (this.ceval.enabled()) this.toggleCeval();
799798
}
800799
this.resetAutoShapes();
@@ -812,7 +811,6 @@ export default class AnalyseCtrl {
812811
mergeAnalysisData(data: ServerEvalData) {
813812
if (this.study && this.study.data.chapter.id !== data.ch) return;
814813
this.tree.merge(data.tree);
815-
if (!this.showComputer()) this.tree.removeComputerVariations();
816814
this.data.analysis = data.analysis;
817815
if (data.analysis)
818816
data.analysis.partial = !!treeOps.findInMainline(

ui/analyse/src/treeView/columnView.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function emptyMove(conceal?: Conceal): VNode {
3939
}
4040

4141
function renderChildrenOf(ctx: Ctx, node: Tree.Node, opts: Opts): MaybeVNodes | undefined {
42-
const cs = node.children,
42+
const cs = node.children.filter(x => ctx.showComputer || !x.comp),
4343
main = cs[0];
4444
if (!main) return;
4545
const conceal = opts.noConceal

ui/analyse/src/treeView/inlineView.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from './common';
1616

1717
function renderChildrenOf(ctx: Ctx, node: Tree.Node, opts: Opts): MaybeVNodes | undefined {
18-
const cs = node.children,
18+
const cs = node.children.filter(x => ctx.showComputer || !x.comp),
1919
main = cs[0];
2020
if (!main) return;
2121
if (opts.isMainline) {

0 commit comments

Comments
 (0)