Communists
did not disappear inside the United States. They were treated unfairly (fired from jobs, ostracized) but legally, they had the same rights to habeas corpus. At the
height of McCarthy hearing, ostracism and loss of a career was the worst that could happen to a communist. However, this is the same treatment that was accorded (just previously) to the Nazi sympathizers in the US. In fact, HUAC was created to go after Nazi sympathizers.
Of course communism had the appeal of being a non-racist ideology, so a lot more innocent (but extreme naive) people got tangled up when HUAC went after the communists. That being said, they're both totalitarian ideologies: I wouldn't want either Nazis or Communists holding public office in the United States, nor do I have any issues with private employers firing either (at least in employment-at-will states).
At that time China was going through Great Leap Forward (mass artificial starvation, with millions dying) and (in the 60s/70s, after HUAC has died down) cultural revolution. Again, a very blood period.
As for illegal detention, I am pretty squarely against it: either these people should be held as POWs or be tried as criminal defendants. Yet illegal detention that happens on the battlefield is much different from illegal detention of a political activist working within the system. If you want to compare apples to apples, I'd look at China's treatment of US prisoners during the Korean war or their treatment of their own Islamic extremists in Xianjing province (yes-- there are real Islamic extremists targeting civilians in China and no, they're not "freedom fighters").
That being said, it's a silly comparison to do irrespective: provided US was as flagrant about human rights as China, that doesn't justify China treating their citizens in the same fashion. Nor does China treating their citizens horribly justify human rights violations by the US. The original article did not claim anything along those lines. Arguing that "two wrongs make a right" is logically fallacious and morally bankrupt.