Hello!
I am trying to implement a plugin to provide an alternative diff view for a certain file types during pull requests. I am trying to achieve something similar to this BPMN model diffing | demo.bpmn.io. But I am stuck. My requirements are the following:
- As the alternative view is graphical, I need to have a large dialog window (close to full screen) or a full page for it.
- The graphical view requires several 3rd party css files and some custom javascript code.
- I need to be able to switch between the classical diff view and the new one.
- As there are not so many files of the type I need the alternative view for, I would like to show the views “toggle” button based on the currently reviewed file type.
I tried to use CSE for the purpose. First I went with the ModalExtension placing it at the only available extension point for the PR Diff page: bitbucket.ui.pullrequest.diff.toolbar. And I put my javascript code in modalApi.onMount(). It worked fine but there are two major problems: 1) I cannot figure how can I apply my css files to the dialog, 2) The maximum size of the dialog set with modalApi.setWidth(“x-large”); is way too small for my purpose, I need to have it much bigger.
The only other possible solution with CSE seams to be the PageExtension. But there is the same problem: I don’t understand how can one add some custom css to the page.
I looked at Plugin modules and have not found anything suitable for my purposes among them either.
Could someone point me to the right direction please?