fix: tree explorer nodes not filling parent container width

Add min-w-0 to TreeRoot to allow flex shrinking within sidebar.
Add w-full and min-w-0 to tree node rows so absolutely-positioned
virtualizer items fill the container width and text truncates correctly.

Amp-Thread-ID: https://ampcode.com/threads/T-019cf1f6-5d46-7338-8019-2bcee8b19b51
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Yourz
2026-03-15 23:12:33 +08:00
parent 63442d2fb0
commit 8cbc4b9df3
2 changed files with 2 additions and 2 deletions

View File

@@ -8,7 +8,7 @@
:get-children="
(item) => (item.children?.length ? item.children : undefined)
"
class="m-0 p-0 pb-6"
class="m-0 min-w-0 p-0 pb-6"
>
<TreeVirtualizer
v-slot="{ item }"

View File

@@ -105,7 +105,7 @@ defineOptions({
})
const ROW_CLASS =
'group/tree-node flex cursor-pointer select-none items-center gap-3 overflow-hidden py-2 outline-none hover:bg-comfy-input mx-2 rounded'
'group/tree-node flex w-full min-w-0 cursor-pointer select-none items-center gap-3 overflow-hidden py-2 outline-none hover:bg-comfy-input mx-2 rounded'
const { item } = defineProps<{
item: FlattenedItem<RenderedTreeExplorerNode<ComfyNodeDefImpl>>