My previous misunderstanding was exactly as you mentioned, to group commits on a file to file basis.
Now I have understood what a semantic change should be like, with your provided example.
You are not asking for much, your corrections help me a lot in my learning journey and I am very grateful for them.
Please feel free to point out any more such things in the future.

Shiva