From f233d3aa56c3d506b881dea34537e4772dbabf30 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Sun, 22 May 2022 20:29:20 +1000
Subject: Hide more ancestors upon search layout-failure

---
 src/App.vue | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index 79743ac..1dd0b93 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -384,13 +384,14 @@ export default defineComponent({
 					setTimeout(() => this.expandToNode(name), this.uiOpts.tileChgDuration);
 					return;
 				}
-				// Attempt expand-to-view on ancestor just below activeRoot
+				// Attempt expand-to-view on an ancestor
 				if (layoutNode == this.activeRoot){
 					console.log('Screen too small to expand active root');
 					this.modeRunning = false;
 					return;
 				}
-				while (true){
+				const MAX_ANCESTOR_DIST = 5;
+				for (let i = 0; i < MAX_ANCESTOR_DIST; i++){
 					if (layoutNode.parent! == this.activeRoot){
 						break;
 					}
-- 
cgit v1.2.3

