OK, my thoughts.
1) What does partner have in hearts?
Anything but the queen! If declarer had
♥AKxxx, he would surely have played on hearts right away.
2) If declarer is 5512, I'm only on lead once and might as well play a trump. (Maybe this analysis is flawed?)
3) If declarer is 5530 without either
♥A or
♥K, does he have any (realistic) chance? I think not, no matter my defense.
4) Is AKJxx, AKQxx, xxx, - possible for the bidding? I thought it might be. And since this is the critical hand, it decided to play for it.
5) Playing back a heart runs the risk of declarer inserting the 8. Either now, or as a safety play later, if I play a big one now.
So I played back a spade. When the diamond came, I played... huddle-small! I really hated myself! My plan was to play small, but suddenly I got second thoughts.
I live for being ready in situations like this. Making mistakes underway is ok, but not this, please

Did you do better? I think a low diamond is the indicated play, but it should be played smoothly!
Anyway, declarer put up the jack, ruffed a diamond and ran the
♥J to partner's ace. Down only 1.