portal

Daniel Slutsky 2024-01-21T09:39:29.607509Z

Regarding the embedding of portal in static pages -- blog posts, etc. -- here are a couple of details worth knowing about: • It captures global key bindings of the page, which might be confusing to a user -- e.g., try pressing the arrow keys in https://scicloj.github.io/clay/ and it will jump to one of the Portal views embedded in it. • It may affect global code highlighting in its use of highlight.js (depending on the method other code in the page is highlighted). ◦ BTW Portal's code highlighting is so nice!

Daniel Slutsky 2024-01-27T22:19:59.587669Z

Clay version "2-alpha76" now uses a temporary build of Portal (till its next release), and the global effects on text colour and code highlighting seem to be solved. 🙏

🙏 1
Daniel Slutsky 2024-01-23T20:00:25.281019Z

At least one more Clay user has reported noticing the keybinding behaviour with embedded Portal: https://github.com/scicloj/clay/issues/40

👍 1
Daniel Slutsky 2024-01-23T22:10:25.599769Z

In the image shared at that Issue, we see some font colors affected by Portal (overriding the colors defined by the dark theme). This seems to be a separate effect from the code highlighting and backgound colors we discussed above.

Daniel Slutsky 2024-01-23T22:10:55.872829Z

Like the other things, I don't think this is so pressing. Just good to know for now.

Bastian 2024-01-24T10:04:53.992469Z

that was me with the issue, was searching for clay before posting and haven't seen this thread 🤦‍♂️thanks for responding!

🙏 1
🙃 1
Daniel Slutsky 2024-01-21T10:24:40.254389Z

Possibly, this fact about code highlighting can be viewed as a feature. thistle Some blogs may enjoy Portal's code highlighting. A couple of things could make this feature more convenient: • be able to consume Portal's highlight.js setup as a separate call to the standalone API, that would work even without embedding any Portal viewers in the page. • be able to select the Portal theme in standalone mode (which might be difficult to implement in the current workflow I guess?).

djblue 2024-01-21T22:29:42.575249Z

I think the embedded mode of Portal needs some more work. To me, it should avoid introducing behaviors and side effects outside of the portions of the dom it is mounted under. I'll look into improving this mode, thanks for pointing this out 🙏

djblue 2024-01-22T00:10:42.358389Z

https://github.com/djblue/portal/commit/0060083b22df3736e54f4e19b8086a920a4cfcf4 change should prevent Portal's highlight.js settings from leaking into other parts of the dom. Also, I added https://github.com/djblue/portal/commit/ae9017a10ccb39d01585d9880e1135534a4ad1bbto prevent setting the body background-color when embedded. You may not have experienced this clash if you have your OS preferences set to light mode.

djblue 2024-01-22T00:10:58.496979Z

I'm still looking into the keyboard shortcut issue 🤔

Daniel Slutsky 2024-01-22T05:40:36.764159Z

Amazing, thanks. I thought it would be more difficult to isolate with highlight.js. I don't think the keyboard behaviour is a pressing issue in terms of usability, just a tiny detail worth knowing about. Thanks for being so responsive.

djblue 2024-01-22T05:42:04.734309Z

For the keyboard issue, I think perhaps in embedded mode, the up/down/left/right shortcuts can be disabled unless a value is selected.

👍 1
djblue 2024-01-22T05:42:33.901609Z

Are there any other shortcuts you noticed conflicted in the embedded mode?

Daniel Slutsky 2024-01-22T05:44:25.592159Z

I don't know of anything like that. At some point I thought it was PgUp PgDn, but I cannot reproduce it now.

👍 1