From 551fbe163b90cc1f318612c167fbdfe738dd7132 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Fri, 1 Jul 2022 19:28:12 +1000
Subject: Generate 3 reduced trees, keeping the original, and serve only those

Generate a 'trimmed' reduced tree instead of changing the original.
Generate an 'images-only' reduced tree, and use it as the default.
Combine 'picked' reduced tree code with that of other reduced trees.
Adapt server API to allow selecting between more than 2 trees.
Add client setting for selecting between 3 trees.
---
 src/components/SettingsModal.vue | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

(limited to 'src/components/SettingsModal.vue')

diff --git a/src/components/SettingsModal.vue b/src/components/SettingsModal.vue
index 16351c4..315ddb4 100644
--- a/src/components/SettingsModal.vue
+++ b/src/components/SettingsModal.vue
@@ -78,8 +78,15 @@
 		<div class="border rounded p-1">
 			<h2 class="text-center">Other</h2>
 			<div>
-				<label> <input type="checkbox" v-model="uiOpts.useReducedTree"
-					@change="onSettingChg('UI', 'useReducedTree')"/> Use simplified tree </label>
+				<div>Tree to use</div>
+				<ul>
+					<li> <label> <input type="radio" v-model="uiOpts.tree" value="trimmed"
+						@change="onSettingChg('UI', 'tree')"/> Comprehensive </label> </li>
+					<li> <label> <input type="radio" v-model="uiOpts.tree" value="images"
+						@change="onSettingChg('UI', 'tree')"/> Visual </label> </li>
+					<li> <label> <input type="radio" v-model="uiOpts.tree" value="picked"
+						@change="onSettingChg('UI', 'tree')"/> Minimal </label> </li>
+				</ul>
 			</div>
 			<div>
 				<label> <input type="checkbox" v-model="uiOpts.searchJumpMode"
@@ -161,7 +168,7 @@ export default defineComponent({
 			}
 			// Notify App
 			this.$emit('setting-chg', optionType, option,
-				{relayout: optionType == 'LYT', reinit: optionType == 'UI' && option == 'useReducedTree'});
+				{relayout: optionType == 'LYT', reinit: optionType == 'UI' && option == 'tree'});
 			// Possibly make saved-indicator appear/animate
 			if (!this.saved){
 				this.saved = true;
@@ -205,7 +212,7 @@ export default defineComponent({
 			// Restore default options
 			let defaultLytOpts = getDefaultLytOpts();
 			let defaultUiOpts = getDefaultUiOpts(defaultLytOpts);
-			let needReinit = this.uiOpts.useReducedTree != defaultUiOpts.useReducedTree;
+			let needReinit = this.uiOpts.tree != defaultUiOpts.tree;
 			Object.assign(this.lytOpts, defaultLytOpts);
 			Object.assign(this.uiOpts, defaultUiOpts);
 			// Notify App
-- 
cgit v1.2.3

