“Thankfully” and “hopefully” are, in these uses, disjunct adverbs, meaning that they modify not any particular action in the sentence (as they would in, say, “she thankfully received the gift” or “he hopefully approached his boss for a raise”) but the overall mood of the speaker of the sentence (or simply the sentence itself).