From 3f340ccabd6035a6d8372c4eb6a5b543a9674f1a Mon Sep 17 00:00:00 2001 From: Joe Knapper Date: Wed, 17 Jun 2026 15:11:18 +0100 Subject: [PATCH] Collapse action logs by default --- .../labThingsComponents/actionLogDisplay.vue | 167 +++++++++++++++--- .../tabContentComponents/actionTab.vue | 4 - 2 files changed, 141 insertions(+), 30 deletions(-) diff --git a/webapp/src/components/labThingsComponents/actionLogDisplay.vue b/webapp/src/components/labThingsComponents/actionLogDisplay.vue index 38b842aa..9709de9a 100644 --- a/webapp/src/components/labThingsComponents/actionLogDisplay.vue +++ b/webapp/src/components/labThingsComponents/actionLogDisplay.vue @@ -1,25 +1,55 @@ @@ -36,15 +66,28 @@ export default { type: Array, required: true, }, + collapsedByDefault: { + type: Boolean, + default: true, + }, }, data() { return { userIsHovering: false, + isCollapsed: this.collapsedByDefault, }; }, computed: { + latestMessage() { + if (!this.log.length) { + return ""; + } + + return this.log[this.log.length - 1].message; + }, + errorMessage() { let logLength = this.log.length; var defaultMessage = "Unexpected error, please check the logs"; @@ -62,18 +105,33 @@ export default { watch: { log: { handler() { - this.scrollToBottom(); + if (!this.isCollapsed) { + this.scrollToBottom(); + } }, deep: true, }, - taskStatus: { - handler() { + + taskStatus() { + if (!this.isCollapsed) { this.scrollToBottom(); - }, + } + }, + + collapsedByDefault(newValue) { + this.isCollapsed = newValue; }, }, methods: { + toggleLog() { + this.isCollapsed = !this.isCollapsed; + + if (!this.isCollapsed) { + this.scrollToBottom(); + } + }, + onMouseEnter() { this.userIsHovering = true; }, @@ -95,16 +153,34 @@ export default { diff --git a/webapp/src/components/tabContentComponents/actionTab.vue b/webapp/src/components/tabContentComponents/actionTab.vue index 4555c1ee..36570daf 100644 --- a/webapp/src/components/tabContentComponents/actionTab.vue +++ b/webapp/src/components/tabContentComponents/actionTab.vue @@ -219,8 +219,4 @@ export default { .control-component { width: 33%; } - -#log-display { - height: 20em; -}