WASHINGTON — In 2006 and again in 2013, Republican moderates joined Democrats in the Senate to pass sweeping overhauls of the nation’s immigration laws with a pathway to citizenship for millions of undocumented immigrants, only to see the compromises torpedoed by a wave of angry activism in the conservative news media and grass roots.

This time, as senators again search for a way forward on immigration, a revolt from the right has so far failed to materialize, in large part because of the intransigence of a different player: a man in the White House who has mostly satisfied immigration hard-liners.

President Trump’s gamble was risky. And at first his plan struck many conservatives as too generous because it would offer 1.8 million young immigrants who came to the United States illegally as children the opportunity to become citizens. But by coupling his offer with demands to sharply reduce legal immigration — a trade-off many Democrats say they cannot accept — then threatening to veto anything that does not meet those demands, the president has made a bipartisan compromise exceedingly difficult.

That may have been the point, as it sits just fine with many on the right who never wanted a deal in the first place.