I’m looking to use the card-from-url capability in a powerup and I’m a bit mystified by when the UI will and won’t trigger that callback. I am curious if I’m missing or misunderstanding something, or if there’s a way to work around this.
I’m testing using this simple code from the sample app:
TrelloPowerUp.initialize({
'card-from-url': function (t, options) {
return new Promise(function (resolve) {
resolve({
name: '💻 ' + options.url + ' 🤔',
desc: 'This Power-Up knows cool things about the attached url'
});
});
},
});
What I’d expect to happen is that this callback would be invoked any time Trello is about to proceed with creating a link card, which in this case will always cause the function to short-circuit the process and create a regular card with emojis instead. The behavior I’m seeing in practice is that in some situations this is invoked and other times Trello will never invoke the callback and go on to create a link card anyways.
Callback is invoked when:
- Dragging a URL (i.e. from a bookmark) onto a list or “Add a card” target
- Clicking “Add a card”, then tabbing to focus the “Add card” button and hitting Ctrl+V to paste a URL
Callback is not invoked and a link card is created when:
- Clicking “Add a card”, hitting Ctrl+V to paste a URL, and hitting Enter or clicking “Add card”
- Clicking “Add a card”, hitting Ctrl+V to paste a URL, and clicking outside of the list to change focus
Is this expected? It feels like building anything on top of this will lead to a confounding user experience.