portal

hanDerPeder 2023-11-25T11:31:27.119839Z

how can I adjust the viewer height to fit its content?

hanDerPeder 2023-11-25T11:37:06.401339Z

ie, not like this

hanDerPeder 2023-11-25T11:37:58.344919Z

but like this

hanDerPeder 2023-11-25T11:38:50.668549Z

so more precisely I want to remove overflow: auto and max-height from the roots

hanDerPeder 2023-11-25T11:42:00.475099Z

tapping values like this:

(tap> (with-meta
                [:portal.viewer/markdown doc]
                {:portal.viewer/default :portal.viewer/hiccup
                 :window :markdown}))

hanDerPeder 2023-11-25T11:50:52.090379Z

there's an expanded? option, but this seems to only be used when you select a value

djblue 2023-11-26T20:52:08.736019Z

I've been playing with the idea of specifying the expansion depth as metadata. Something like {:portal.viewer/inspector {:expanded 10}} which would expand ten levels below the value that contains that metadata. https://github.com/djblue/portal/blob/master/src/portal/ui/state.cljs#L127-L136 would need to be updated to look at that metadata if nothing is available in state. Should be relatively easy 🤔

hanDerPeder 2023-11-26T20:57:32.756819Z

so in my case that would be something like:

(tap> (with-meta
                [:portal.viewer/markdown doc]
                {:portal.viewer/default :portal.viewer/hiccup
                 :portal.viewer/inspector {:expanded 10 (?)}
                 :window :markdown}))
not sure what you mean by 10 levels. it might be more guessable if there was an option attribute you could set, like:
(tap> (with-meta
                [:portal.viewer/markdown doc]
                {:portal.viewer/default :portal.viewer/hiccup
                 :portal.viewer/options {:expanded true :color "skyblue"}
                 :window :markdown}))
dunno..

djblue 2023-11-26T20:59:53.171679Z

Expansion is recursive, so I would always want it to be a number. But I'm down with using :portal.viewer/options as the key since these are options for all viewers.

djblue 2023-11-26T21:01:43.197079Z

Although, the inspector is the wrapper that will use the expanded option 🤔

hanDerPeder 2023-11-26T21:03:14.739909Z

have a think on it. I can only offer the gut reaction of someone fairly unfamiliar with the internals.

👍 1