I actually think the ranks of middle managers will increase as more people work from home. Especially on the engineering side. The whole point of managers is to facilitate communication between people and teams. WFH certainly doesn't help communication problems. HR should pretty much drop to 0 though.
How exactly does it help to pass communications through a person (the manager) that, for the most part, does not understand the technical details of which they are speaking? We literally pay for slack for communication. No one needs an arbitrary human to act as a gatekeeping communication conduit.
I guess that's why you have multiple slack channels instead of one. You're trying to justify paying someone over 100 grand a year to be a worse form of communication than the software you're already paying for to communicate.
I don't think I'm trying to justify any San Francisco salaries, lol. The point I'm trying to make is that a single person can only have so much organizational knowledge overhead. Facilitating communication between the right people without spamming the wrong people is tough.
The github corporate move from a flat structure to a hierarchical is probably a good case study to read if you're interested: https://github.com/holman/ama/issues/800
Pretty much anything related to the work environment. This can include maintaining a safe work environment, accommodations for specific employee needs, handling employee disputes.
That's a fraction of what HR does. Compensation, benefits, hiring, wellness, training, performance reviews, etc, etc. I doubt that even 10% of what HR does is tightly related to a physical space.