This isn't cannon apparently, since Yuka and Hajime are both in separate classes during 2nd year of middle school.
Or this is during the very final days of first year of middle school, so they'd still be in the same class.
I think Shirosawa just drew this, not thinking about the later lore.