From 43857fd3eb3b72979b8266f022fa674878b90348 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 30 Jun 2026 06:17:17 +0300 Subject: [PATCH] fix warnings and better handing of highlight/goto --- src/components/conversation/conversation.vue | 10 +++++----- src/components/status_body/status_body.js | 8 +++++++- src/components/status_content/status_content.vue | 1 + src/components/thread_tree/thread_tree.js | 2 +- src/components/thread_tree/thread_tree.vue | 7 ++++--- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index 36ab7e0b4..8a46722ad 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -97,7 +97,7 @@ :expandable="!isExpanded" :focused="isFocused(status.id)" - :highlight="getHighlight()" + :highlight="maybeHighlight" :inline-expanded="collapsable && isExpanded" :show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]" :in-profile="inProfile" @@ -156,8 +156,7 @@ :is-focused-function="isFocused" :get-replies="getReplies" - :highlight="maybeHighlight" - :set-highlight="setHighlight" + :highlight="maybeHighlight === status.id" :toggle-expanded="toggleExpanded" :simple="treeViewIsSimple" @@ -165,8 +164,9 @@ :show-thread-recursively="showThreadRecursively" :total-reply-count="totalReplyCount" :total-reply-depth="totalReplyDepth" - :can-dive="canDive" + + @goto="setHighlight" @dive="diveIntoStatus" @suspendable-state-change="onStatusSuspendStateChange" /> @@ -186,7 +186,7 @@ :expandable="!isExpanded" :focused="isFocused(status.id)" - :highlight="getHighlight()" + :highlight="maybeHighlight === status.id" :inline-expanded="collapsable && isExpanded" :show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]" :in-profile="inProfile" diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js index 5188f49bd..2da6da555 100644 --- a/src/components/status_body/status_body.js +++ b/src/components/status_body/status_body.js @@ -38,6 +38,12 @@ const StatusBody = { type: Boolean, default: false, }, + inConversation: { + // Is status rendered within open conversation? + // Used to automatically expand subjects (if collapsed) + type: Boolean, + default: false, + } }, data() { return { @@ -70,7 +76,7 @@ const StatusBody = { // button. If the default is to collapse statuses with subjects, we just treat it like // a status with a subject; otherwise, we just treat it like a tall status. mightHideBecauseSubject() { - return this.hasSubject && this.mergedConfig.collapseMessageWithSubject + return !this.inConversation && this.hasSubject && this.mergedConfig.collapseMessageWithSubject }, mightHideBecauseTall() { if (this.singleLine || this.compact) return false diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue index 973290872..6b46bd768 100644 --- a/src/components/status_content/status_content.vue +++ b/src/components/status_content/status_content.vue @@ -9,6 +9,7 @@ :compact="compact" :single-line="singleLine" :collapse="collapse" + :in-conversation="inConversation" @parse-ready="$emit('parseReady', $event)" >
diff --git a/src/components/thread_tree/thread_tree.js b/src/components/thread_tree/thread_tree.js index 14e79e188..7631d127f 100644 --- a/src/components/thread_tree/thread_tree.js +++ b/src/components/thread_tree/thread_tree.js @@ -32,7 +32,7 @@ const ThreadTree = { totalReplyCount: Object, totalReplyDepth: Object, }, - emits: ['suspendableStateChange', 'dive'], + emits: ['suspendableStateChange', 'goto', 'dive'], computed: { reverseLookupTable() { return this.conversation.reduce( diff --git a/src/components/thread_tree/thread_tree.vue b/src/components/thread_tree/thread_tree.vue index ee0aa75fb..72f8512e5 100644 --- a/src/components/thread_tree/thread_tree.vue +++ b/src/components/thread_tree/thread_tree.vue @@ -10,17 +10,17 @@ :show-pinned="pinnedStatusIdsObject && pinnedStatusIdsObject[status.id]" :focused="isFocusedFunction(status.id)" :in-conversation="isExpanded" - :highlight="highlight" + :highlight="highlight === status.id" :in-profile="inProfile" :profile-user-id="profileUserId" class="conversation-status conversation-status-treeview status-fadein panel-body" :simple-tree="simple" :thread-display-status="threadDisplayStatus[status.id]" - :can-dive="canDive" + @dive="$emit('dive', status.id)" - @goto="setHighlight" + @goto="$emit('goto', status.id)" @toggle-expanded="toggleExpanded" @suspendable-state-change="e => $emit('suspendableStateChange', e)" /> @@ -55,6 +55,7 @@ :total-reply-depth="totalReplyDepth" :can-dive="canDive" + @goto="(e) => $emit('goto', e)" @dive="(e) => $emit('dive', e)" @suspendable-state-change="e => $emit('suspendableStateChange', e)" />