im confused so did the rapier superseded the lo longsword (or what we call a longsword)?
Sort of, but saying, “yes,” would be a little misleading.
You can draw a direct evolutionary line from the 11th century arming swords (also sometimes called the, “knightly sword”) (which, you might identify as a longsword) to the Spanish sideswords, to the rapier. This can get confusing, because you could be forgiven for mistaking a sidesword for a longsword. It’s a specific blade, intended for use as a sidearm, but, “it’s a sword,” and long enough that you could easily call it, “a longsword.”
By the same logic, you would not be (completely) wrong for identifying a rapier as a “long sword.” This is why things can be difficult to parse, especially if you think of a longsword as a specific weapon.
Modern historians break medieval straight swords down into, roughly, 12 categories, named after the late Ewart Oakeshott. (Technically, is, I think the total is 27, because some types have multiple variants.)
So, the the Oakeshott Type X evolved into the Oakeshott Type XIII sometime during The Crusades, which in turn would evolve into the Spanish Sideswords (which, as far as I know, don’t have a Oakeshott Type associated with them, though the XVIIId and Type XIX aren’t far off, and are from the right era.)
The issue is, an Oakeshott Type X, and a Type XVIIId are both swords. However, those swords were manufactured based on the technology and materials available, the skill of the smith, and the intended function.
The sidesword was intended to be used as both a cutting and thrusting blade. It was intended to be light, and easy to carry, as it was a backup weapon. The rapier accentuated those traits. A lightweight blade is desirable, it’s easier to carry. The thinner blade may be aesthetically appealing, but if you have the technology to make it, the result is lethal.
So, looping back to the beginning, the real mistake is thinking that the longsword is a standardized weapon. The Oakeshott Typology allows us to categorize them into different groups, and it’s useful for tracking the changes in the designs over time, however, it’s important to remember that Oakeshott’s work was retroactively categorizing these weapons into groups. There’s no single moment that a smith sat down, stopped making Type X blades, and started making Type XIIIs. That transition happened over time. (They also would have been completely unfamiliar with the terminology, as Oakeshott was publishing in the 20th century.)
It’s probably, slightly, more accurate to think of the rapier as the result of people tinkering with, refining, and improving the longsword over the course of 600 years. (Or, longer if we include first millennia swords, in which case, you’re looking at more like 800 years of European sword design.) The rapier did not supersede the longsword; the longsword became the rapier.
If there was a weapon which superseded the longsword in Europe, it was the saber. For an extremely abbreviated history, the saber first entered Europe sometime in the first millennia, and found a home among cavalry in Eastern Europe. They started gaining popularity in the 17th century (both the sabers and the Polish Hussars who wielded them), which would eventually lead to the saber becoming the dominant military blade in Europe. You can actually see a replication of some of the transformation which lead to the rapier in how Western European saber deigns favored thinner blades. Smiths (and by this point militaries) took a design they liked, and modified it to better suit their goals. Now, the other thing which changed was the transition to gunpowder infantry. Sabers still saw battlefield use (partially among cavalry) into the 19th century, but the combat role of a sword on the battlefield was rapidly coming to a close.
So, the short version is, no, the European longsword became the rapier, and then was eventually replaced by changing fashions.