Brown the gnocchi: Heat 1 Tbsp olive oil in a deep skillet over medium heat. Add the gnocchi and sauté, uncovered, for 5–7 minutes until slightly browned and crisp on the outside.
Cook the spinach: Add spinach and continue cooking until wilted, about 2–3 minutes. Transfer gnocchi and spinach to a bowl and set aside.
Build the sauce: In the same pan, heat the remaining olive oil. Sauté the shallot until softened. Stir in sun-dried tomatoes, pasta sauce, and half-and-half (or coconut milk). Let the sauce simmer and thicken for 2–3 minutes.
Add protein: Stir in the cannellini beans, then return the gnocchi and spinach to the pan. Mix well to combine and heat through.
Finish and serve: Add lemon juice and a sprinkle of Parmesan if desired. Serve warm with extra basil, cheese, or a simple side salad.