widgets: add ids when we actually have them

Not the other way round. And test that.