Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popout does not work with new D&D 5e 3.0 #109

Open
corbin-lounsbury opened this issue Feb 2, 2024 · 29 comments
Open

Popout does not work with new D&D 5e 3.0 #109

corbin-lounsbury opened this issue Feb 2, 2024 · 29 comments

Comments

@corbin-lounsbury
Copy link

Tested the new 5e 3.0 release today. We noticed if we popped out a journal page the roll would not work. We didn't see a card in the game chat and there was no indication anywhere else it was waiting for our action.

Running core version 11.315 with PopOut! 2.14, Dice So Nice! 4.6.9, LibWrapper 1.12.13.3, and Phandelvar & Below 1.0 loaded.

@NeatoJiraffe
Copy link

Seconded with a new symptom:

New Dnd default character sheets (the new red ones) do not open correctly in PopOut!. There are sizing issues making it unreadable.

@Posnet
Copy link
Contributor

Posnet commented Feb 3, 2024

I am currently travelling, but will take a look tomorrow when I get home.
I'd also appreciate if you are seeing this issue if you would include the operating system and browser versions you are using.

@corbin-lounsbury
Copy link
Author

corbin-lounsbury commented Feb 3, 2024

I am currently travelling, but will take a look tomorrow when I get home.

I'd also appreciate if you are seeing this issue if you would include the operating system and browser versions you are using.

Certainly! For os, do you need client, server, or both?

@benvilhaven
Copy link

Am also experiencing the issue.
Windows 11 Pro,
Chrome Version 121.0.6167.87

@Posnet
Copy link
Contributor

Posnet commented Feb 3, 2024

I am currently travelling, but will take a look tomorrow when I get home.
I'd also appreciate if you are seeing this issue if you would include the operating system and browser versions you are using.

Certainly! For os, do you need client, server, or both?

The os of the client seeing the issue please

@MythicPalette
Copy link

Character Sheet v2 is also missing the tabs on the side so there is no way to navigate the sheet even if the page was aligned right.

@Posnet
Copy link
Contributor

Posnet commented Feb 6, 2024

I've done some investigation and the primary reason for the issue is the heavy use of web components by the new 5e character sheet. Unfortunately moving shadow doms between documents is even less reliable/well defined than moving normal nodes.

Specifically if a node uses constructed css via the adoptedStyleSheets API on shadow roots, it will fail when being migrated to the new window because the spec just says to fail. DOMException: Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Sharing constructed stylesheets in multiple documents is not allowed

I believe I have found a partial work around here. However it requires that every single shadow root being migrated be created in the open format. And handled individually (it will also slow down popouts, possibly by a human noticeable amount).
Unfortunately every use of the adoptedStyleSheets method in the 5e character sheet is created with a closed shadow dom.

I will play around a bit more, but at this stage I am fairly sure it is unfix-able from my end.

If someone either provides with me with a zip/build of dnd5e with the shadow roots set to open, I'd be happy to test a fix, or likewise if someone gets that changed upstream, I'll again try to fix it here.

On a more general level, the more extensive use of modern javascript features, such as private class member variables and web components or full blown frontend frameworks (i.e. react/vue etc), in foundry, will continue to break the popout module due to it's necessarily brittle design. I'll do what I can when I can, but some things (like how tooltips are now partially broken permanently) will not be fixable.

@Posnet
Copy link
Contributor

Posnet commented Feb 6, 2024

Further testing has convinced me that there is no way to support the use of constructed stylesheets from the popout side.
i.e. if someone is using constructed css they will have to implement support themselves.
I'll add more detailed instructions to the readme tomorrow, but the TL;DR is

  • implement the adoptedCallback for your custom web component
  • in this callback if you have created and CSSStyleSheets, re-create them using the new documents constructor.
  • specifically it can be accessed via new this.ownerDocument.defaultView.CSSStyleSheet() for explicitness.
    alternatively just always use new this.ownerDocument.defaultView.CSSStyleSheet() in the connectedCallback

@Posnet
Copy link
Contributor

Posnet commented Feb 6, 2024

A note to myself, I also need to make the bounding box algo for window size the default since the new 5e sheet has overhanging buttons.

@Posnet
Copy link
Contributor

Posnet commented Feb 6, 2024

also @corbin-lounsbury when you say "roll would not work", do you mean that for an roll link i.e. [[/r 1d20]] clicking it doesn't work? Because in that case it is working for me as expected.

@corbin-lounsbury
Copy link
Author

corbin-lounsbury commented Feb 6, 2024

Just tested on my end. Using Firefox 122 on Windows 11

With a popped out journal, clicking a DM note to prompt or request a roll does not work for me.

image

@lphillips
Copy link

I brought this issue to the attention of the developers of the dnd5e system to see if they are open to meeting in the middle to maintain compatibility with this module. PopOut is great functionality, and it would be sad to see D&D lose the ability to open character sheets in a new window.

@Posnet
Copy link
Contributor

Posnet commented Feb 14, 2024

@Posnet
Copy link
Contributor

Posnet commented Feb 14, 2024

@corbin-lounsbury can you please share the actual macro being used in that document? (i.e. edit the document and copy the underlying text link)

@corbin-lounsbury
Copy link
Author

[[/check skill=his dc=15]]

Looks like this in context
image

Another for the pile: I could not edit the sheet when popped out. I needed to pop it back in order to edit it

@Ator27
Copy link

Ator27 commented Feb 17, 2024

So when I first pop out the screen it looks like the picture. But when I modify the HP, the whole thing straightens out.
Capture

@noreaga
Copy link

noreaga commented Feb 25, 2024

So when I first pop out the screen it looks like the picture. But when I modify the HP, the whole thing straightens out. Capture

Can confirm, changing HP will fix this. Sorta. However, I noticed the Spell Slot buttons disappear when you do that. Would be nice to get a complete fix for this in general. Any updates?

@cube1us
Copy link

cube1us commented Feb 25, 2024

I tried changing HP, made now difference for me. Chrome, FVTT 11.13, DnD 5e 3.03, latest Popout 2.16

@Posnet
Copy link
Contributor

Posnet commented Mar 4, 2024

The primary compatibility issue has been fixed in DnD 5e 3.0.4
As stated before this only works in Chrome.

I am aware that some button clicks do not work on popped out journals, I'm still trying to work out if this is fixable.
Please let me know if you are seeing any other issues.

@cube1us
Copy link

cube1us commented Mar 4, 2024

DnD 5e 3.04 is an improvement - it is at least usable. However, an issue remains with casting spells. One can hover over the name or icon for the spell, and it brings up a description (it used to turn into a die) - and one clicks on it to cast the spell (it used to be clicking on the name brought up a description). With PopOut! under DND 5e 3.04, one gets a gray box with a "wait wheel" that does not move, but one can click on the gray box to cast the spell. (probably also affects inventory and features, I suppose). But there is now no apparent way to get the description when using a PopOut! window.

image

@benvilhaven
Copy link

I am also experiencing the above issue. Am willing to provide data or whatever else is needed to investigate. Thanks for the mod and the attention to this issue.

@Posnet
Copy link
Contributor

Posnet commented Mar 15, 2024

For those following I am aware of the ongoing issues, however I am currently traveling and am unable to replicate and debug issues. I am happy to review fixes or suggestions, but otherwise I won't be able to produce material fixes until the 28th.

@azarius74
Copy link

Chipping in that yes, the images have all been fixed but the issue with the descriptors not populating continue (just get the grey wheel of loading death) when the new default sheet is popped out. Thanks!

@briavers
Copy link

Hey @Posnet have you been able to look into the description/tooltip not populating? Before i try to take a look into it i wanted to reach out to make sure it would be helpful.

@briavers
Copy link

@Posnet i have started looking into it, the main issue is that the tooltip is now refferenced using uuid. i have started on a fix. this solves it already for compendium items (Skills for example). for spells etc it still struggles as it requires the global CONFIG wich is set in foundry.js (and is not included in the popout)

commons.js:2955 Uncaught (in promise) ReferenceError: CONFIG is not defined
    at Object.parseUuid (commons.js:2955:53)
    at TooltipManager.activate (game:211:79)
    at #onActivate (game:112:30)

https://github.com/briavers/fvtt-module-popout/tree/tooltip-fix

image

@Posnet
Copy link
Contributor

Posnet commented Apr 22, 2024

@briavers I have spent a fair amount of time trying to find work around for re-implementing the core Tooltip code a second time. But yeah like you've found it appears to be the only way. If you provide the implementation I'll happily merge it. But I'm also going to try and reach out to the foundry Devs to see if they'd be willing to un-private some of the functions.

@benvilhaven
Copy link

Any further word on this functionality? I don't mean to provide any pressure, at all, I know these things always take time, and sometimes just aren't possible, but just wondering if I should be looking at alternative options for my players with multi-scrreen setups, etc.

@MythicPalette
Copy link

Any further word on this functionality? I don't mean to provide any pressure, at all, I know these things always take time, and sometimes just aren't possible, but just wondering if I should be looking at alternative options for my players with multi-scrreen setups, etc.

Most of it works now but a workaround that I've used is just resize your browser window so that it fills both screens.

@Posnet
Copy link
Contributor

Posnet commented Jun 13, 2024

I have a long term fix planned for tooltips in 5e, but it is very involved, and I have very little time available to work on it. The basic sketch of the implementation in on #124 if someone wants to contribute. Otherwise I'll make progress when I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests