The key to it is the verb
do. It's a pseudo-cleft-like construction, and it's normally in reverse order from the example given. If
do is given as an infinitive, the echo of it can be with or without
to; if as an
-ing, the echo must also be
-ing.
A nice thing to do is (to) party the night away.
A 'true' pseudo-cleft ( !? ) would be What you're doing is going off on a tangent.
The reversed form with a bare infinitive is unusual.
CJ