Thankfully means fortunately, as one is glad to say. Thankfully, nobody was hurt, thankfully it was brief.
In this sense it comments on the whole sentence rather than on any verb, which purists once objected to and everybody now uses. The older sense means in a thankful manner, and that is what it still means when it follows the verb.
1adverbthankfullyFortunately, as one is glad to say.
“It rained all week, but thankfully the sun came out for the wedding.”
thankfully is a comment.
Old English thancfullice, from thankful plus -ly.
Old English
þancfullīċe
Middle English
thankfully
English, today
thankfully
From Middle English thankfully, thankefully, þonkfulliche, from Old English þancfullīċe, equivalent to thankful + ly.
Etymology from Wiktionary, CC BY-SA