Very nearly 0% of Americans will vote based on Pelosi's visit. Foreign policy in general doesn't matter to the vast majority of voters, even the minority who say that it does.
Democrats' fate in November will be a combination of the state of the economy, the fact that this is a midterm with Dems (somewhat) in power, and gerrymandering.
I think it would only be an issue due to backing down to Chinese pressure. I don’t think anyone would have cared if she never planned a visit or if she visited.