Quick Tags: Implement New XKit migration
Description
Along with https://github.com/new-xkit/XKit/pull/2135, this is one way of implementing a button that migrates data from New XKit to XKit Rewritten when pressed. It communicates via custom events from one extension's content script to the other.
Testing steps
- Load the corresponding New XKit PR, e.g. via the XKit editor.
- Create at least one unique New XKit tag bundle.
- Enable Quick Tags in XKit Rewritten.
- Press the button in the New XKit Quick Tags settings pane. Confirm that the tag bundle appears in XKit Rewritten.
Hm—now that I think about it, the success UI could be from XKit Rewritten and the failure UI could be from New XKit. No reason to do two prompts in a row.
The New XKit control panel has z-index: 21474836.
This is, you know. This is cool.
Worth noting that: a) Maybe we could do something more general—button in New XKit that shoves over everything? That may not be ideal, though (if we add more stuff that can be imported later, that's a mess. b) Maybe we could make the handler not inside the Quick Tags script itself, so that it could set Quick Tags to enabled when the user confirmed this import? That would be convenient for the "I am migrating from New XKit to this new thing" workflow, especially if we had more scripts with export functionality.
Any idea how to make a ul look good in otherwise-centered text?
Hmm, don't we have styles for <table> elements in modals already?
A single-column table would also serve as a fairly good list, I think.
Nevermind. I completely misremembered what our modal table styles looked like. Maybe not.
uhhh something something text-align: left; display: inline-block; margin: 0 auto;...?
I might need to play with it myself.
idea: ignore case/order in duplicate checking logic
edit: Nah, not worth it. People can deduplicate the things themselves.
Pushed some styles for lists within modals so that the entire element is shrunk and centred as possible, with the text within being left-aligned. Pretty happy with the result:
| Narrowest | Middling | Wrapping |
|---|---|---|
(No, this list isn't actually generated by the Quick Tags code, I just modified a Limit Checker modal to avoid needing to install New XKit again. Hence the lack of Cancel/Confirm buttons. Sorry.)
Every single time I check if this is off-center, and every single time it's correct. Maybe we should set a minimum width on the buttons so the gap between them centers in this case :D