On the court’s final day of decisions before a summer break, the justices dealt blows to efforts to combat the drawing of electoral districts for partisan gain and put a hold on a Trump administration effort to add a citizenship question to the 2020 census.