A CONGRESSIONAL district in the Northern Virginia suburbs of Washington, DC was ill-disposed towards Donald Trump long before a bicyclist flashed the president the middle finger as his motorcade rolled toward his golf course last October. A photograph of the gesturing cyclist went viral.

This November, an enduring distaste for Mr Trump in the 10th District, where the golf club is located, could determine a closely watched contest between a nimble Republican incumbent, Barbara Comstock (pictured left), and her Democratic challenger, Jennifer Wexton (pictured right), a state senator and former prosecutor.

In the presidential election Hillary Clinton carried the district, which is fast turning blue. So is Virginia, the only Southern state not won by Mr Trump in 2016. The 10th hasn’t elected a Democrat to the House of Representatives for 36 years, but several polls show Mrs Wexton leading. This week a poll showed her ahead by 12 points.

Mrs Comstock, a top target of the Democratic Congressional Campaign Committee, won a second term in 2016, surviving the wave that tipped the district to Mrs Clinton by 10 percentage points. Mrs Comstock was helped by a weak opponent, a strong record of constituent service, but most notably, her gamble to run against Mr Trump. After a video surfaced of him boasting about molesting women, Mrs Comstock said Mr Trump was unfit for the presidency and should relinquish the nomination to his running mate, Mike Pence. Her manoeuvre transformed her image from reflexive partisan to high-minded independent.

But over the past two years, Mrs Comstock’s image has changed again, and she is now perceived as a Trump acolyte. She has voted with the president nearly 98% of the time, according to FiveThirtyEight, a data-journalism website, often siding with him on issues that shock voters in the fast-growing, increasingly multi-hued district. Mrs Comstock favours a wall on the border with Mexico, is an advocate of expanded gun rights and a near-total ban on abortion, and voted for the federal tax cut that could drive up already-high local tax bills.

She has broken with Mr. Trump on federal employment issues, opposing shutdowns and supporting pay raises. That is because the 10th is home to thousands of bureaucrats and many technology, defence and research firms fatted at the federal trough.

Brett Kavanaugh’s appointment by Mr Trump to the Supreme Court has constituted a problem for Mrs Comstock, whose support among women was lagging even before his confirmation fight in the Senate, according to one poll.

In a dilemma that is personal and political, Mrs Comstock has refused to say whether she supports Mr Kavanaugh, whose confirmation was imperilled by accusations of sexual assault. Mrs Comstock and Mr Kavanaugh are friends from the Bill and Hillary Clinton investigations. Mrs Comstock worked for the House committee that looked into campaign finance regularities by the Clintons, among other allegations. Mr Kavanaugh was on the staff of Kenneth Starr, the independent counsel who plumbed President Clinton’s affair with Monica Lewinsky.

Hoping to blunt retaliation over the Kavanaugh nomination, particularly by women, and still compete for their votes, Mrs Comstock is running a television commercial in which she is depicted as an advocate for women, sponsoring long-stalled legislation to end secret cash settlements over sexual harassment and other job-place misdeeds by lawmakers and congressional employees.

The ad is a reminder that Mrs Comstock—first as a state legislator and now as a member of Congress—can deftly split the difference on difficult issues. She has done so by controlling her public exposure. Mrs Comstock usually avoids reporters, relies heavily on social media and insists on private sessions with voters rather than open-to-all, town hall-style meetings.

This also means Mrs Comstock can be artful with facts. She has introduced a bill to ensure continued federal financing, at current levels, for Metro, the bus and subway network that serves Washington and its suburbs. But as a state legislator in 2013, Mrs Comstock opposed higher taxes to cover Virginia’s contribution to Metro. She still took credit for the funding, attending the ribbon-cutting for the opening of a new, $300m line through her district.

Furthermore, the National Republican Campaign Committee is running a commercial on Mrs Comstock’s behalf attacking Mrs Wexton for supporting the tax rise—even though it was proposed by a Republican governor and there was little the Democrat could do, not being a legislator at the time.

Republicans hope this narrative will stir the base, especially in the 10th District’s conservative, rural expanse near the Virginia-West Virginia border. It was from the right that Mrs Comstock, in June, was challenged for the nomination.

And though Mrs Comstock pulled more votes than Mrs Wexton did in her primary—28,000, compared to 22,000—the Democratic contest, with six candidates, generated a heavier total turnout, perhaps ensuring a head start for Mrs Wexton of some 7,000 votes.

Democrats attribute that largely to Mr. Trump, who, they note, has had another few weeks to anger even more voters.