"My current laptop is an aging X1 Carbon generation 7... A few months ago a few keys of the keyboard stopped working. I decided it was time to look for a replacement."
Isn't that like deciding to replace your bike because some of the cables are rusted? Like a new set of cables, a new keyboard is a small expense compared to a whole new laptop.
Like replacing bike cables, swapping in a new Carbon X7 keyboard might be slightly challenging for an amateur. iFixit calls the keyboard replacement "moderate" in difficulty [1] taking about an hour with a new keyboard running about a hundred bucks. But it would be a simple job for a repair shop. So it seems hard to justify the expense of a whole new one rather than just the new part.
Of course, sometimes you just want a new laptop, because the bike analogy breaks down a little: unlike bikes, newer ones are inherently faster.
[1] https://www.ifixit.com/Guide/Lenovo+ThinkPad+X1+Carbon+7th+G...