I think you are thinking this is all there is. There is more. Yes current tasks are automatable. But what about future tasks? When we don't need to write code what can we do with our brains instead?? What can we learn about biology/chemistry/physics/engineering that we don't know now.
The same thing happened in the industrial revolution... This might be different than that but freeing up resources from menial tasks means we can work at a higher level.
AI might be able to do that too, and there will be a period of adjustment, but we as a whole need to change a and move forward together. Not just tech bros. Government and industry will also need to change to help society... Else we will have collapse.