mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-03 04:31:58 +00:00
Feat: Add preview as plaintext toggle for Preview As Text (#7102)
## Summary Adds a toggle to conditionally render the text as Markdown. ## Also... Fixes some type issues across our myriad Widget types. We should probably clean those up. ## Example https://github.com/user-attachments/assets/24fed943-1e79-4ea4-a962-826b06d68761 This could be a good minimal testcase for dynamic widgets @AustinMroz ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7102-WIP-Feat-Add-preview-as-plaintext-toggle-for-Preview-As-Text-2bd6d73d3650810c8b25c84866c8875c) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -4027,7 +4027,9 @@ export class LGraphNode
|
||||
w: IBaseWidget
|
||||
}[] = []
|
||||
|
||||
for (const w of this.widgets) {
|
||||
const visibleWidgets = this.widgets.filter((w) => !w.hidden)
|
||||
|
||||
for (const w of visibleWidgets) {
|
||||
if (w.computeSize) {
|
||||
const height = w.computeSize()[1] + 4
|
||||
w.computedHeight = height
|
||||
@@ -4066,7 +4068,7 @@ export class LGraphNode
|
||||
|
||||
// Position widgets
|
||||
let y = startY
|
||||
for (const w of this.widgets) {
|
||||
for (const w of visibleWidgets) {
|
||||
w.y = y
|
||||
y += w.computedHeight ?? 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user