fixes & cleanup

This commit is contained in:
Henry Jameson 2026-09-16 14:39:56 +03:00
commit 58086fed0a
4 changed files with 7 additions and 16 deletions

View file

@ -149,7 +149,7 @@ export default {
return result return result
} }
// External virtual scrolling // # External virtual scrolling
const unsuspendableIds = ref(new Set()) const unsuspendableIds = ref(new Set())
const suspendable = computed( const suspendable = computed(
() => !isExpanded.value && unsuspendableIds.value.size === 0, () => !isExpanded.value && unsuspendableIds.value.size === 0,
@ -176,7 +176,8 @@ export default {
emit('suspendableStateChange', { suspend: value, id: statusId.value }), emit('suspendableStateChange', { suspend: value, id: statusId.value }),
) )
onUnmounted(() => resizeObserver.value.disconnect()) onUnmounted(() => resizeObserver.value.disconnect())
// Internal virtual scrolling
// # Internal virtual scrolling
const virtualScrollingEnabled = ref(isExpanded.value) const virtualScrollingEnabled = ref(isExpanded.value)
// Placeholder heights. // Placeholder heights.
@ -194,10 +195,6 @@ export default {
} }
}) })
const anchorIds = computed(
() => new Set([mainStatus.value?.id, currentStatus.value?.id]),
)
// # Linear style stuff // # Linear style stuff
const isLinearView = computed(() => displayStyle.value !== 'tree') const isLinearView = computed(() => displayStyle.value !== 'tree')
const linearElement = useTemplateRef('linear') const linearElement = useTemplateRef('linear')
@ -218,8 +215,6 @@ export default {
offset, offset,
scrollPositionInstance: scroller, scrollPositionInstance: scroller,
scrollCompensation: linearScrollCompensation, scrollCompensation: linearScrollCompensation,
anchorIds,
collapseMode: 'item',
getPlaceholderHeight, getPlaceholderHeight,
}) })
const changeSuspendStateLinearLocal = (e) => { const changeSuspendStateLinearLocal = (e) => {
@ -297,7 +292,6 @@ export default {
resetTreeScrollVirtualization() resetTreeScrollVirtualization()
}) })
const treeViewIsSimple = computed( const treeViewIsSimple = computed(
() => !mergedConfig.value.conversationTreeAdvanced, () => !mergedConfig.value.conversationTreeAdvanced,
) )

View file

@ -192,6 +192,9 @@ const Status = {
user() { user() {
return useUsersStore().findUser(this.mainStatus.user.id) return useUsersStore().findUser(this.mainStatus.user.id)
}, },
isTreeView() {
return this.mergedConfig.conversationDisplay === 'tree'
},
simpleTree() { simpleTree() {
return !this.mergedConfig.conversationTreeAdvanced return !this.mergedConfig.conversationTreeAdvanced
}, },

View file

@ -235,7 +235,7 @@
/> />
</button> </button>
<button <button
v-if="isExpanded && !simpleTree" v-if="isExpanded && isTreeView && !simpleTree"
class="button-unstyled" class="button-unstyled"
:title="$t('status.show_only_conversation_under_this')" :title="$t('status.show_only_conversation_under_this')"
@click.prevent="$emit('dive')" @click.prevent="$emit('dive')"

View file

@ -26,8 +26,6 @@ export function useVirtualScrolling({
// - 'item' - same as height but uses anchor element's top offset // - 'item' - same as height but uses anchor element's top offset
// instead of whole height // instead of whole height
collapseMode, collapseMode,
// Anchor. Set of IDs of element relative to which do scroll compensation
anchorIds,
// Placeholder height specification. Must be a function. // Placeholder height specification. Must be a function.
// function will be called either: // function will be called either:
// - without arguments (for generic placeholder, i.e. buffer zone size) // - without arguments (for generic placeholder, i.e. buffer zone size)
@ -215,10 +213,6 @@ export function useVirtualScrolling({
const newBottomElement = last(newVal) const newBottomElement = last(newVal)
return newBottomElement.top + newBottomElement.height return newBottomElement.top + newBottomElement.height
} else if (toValue(collapseMode) === 'item') {
const element = newVal.find(({ id }) => toValue(anchorIds).has(id))
return element.top
} else { } else {
return 0 return 0
} }