there is a direct object pronoun involved here, and when that occurs, the past participle takes an ending that matches the gender and number of the object referred to. In this case, the "a" at the end of "vista" tells you the object references is feminine and not masculine. Note--just to make things messier--the agreement between a past participle and a direct object pronoun is required for third person singular and plural, but is considered optional for first and second person singular and plural.
But if the direct object isn't a pronoun, e.g. "I saw the girl," would you not inflect the participle?
I believe there is agreement only if the object comes before the verb. Ho visto la ragazza v ho l'ho vista.
I thought that the participle (visto in this case) did not change when paired with avere; only when paired with essere. Why is this vista, not visto?
when a direct object (lo, la, l') stands before the verb form of "avere", the past participle takes the gender of that direct object - like in French
the contraction of "l'hai" makes more sense to me when i hear it. you don't pronounce the "h" in "hai" and la is the clitic pronoun, so it's almost like truncating it from "la ai" to "l'ai" but you throw in an h to spell it correctly.
In context, could it also mean "Where have you seen/did you see IT?" referring to a feminine noun, but not necessarily a female. I think so, but maybe someone knows for sure. Grazie.
Take a look at the answers from CreyB & BeatlesMusician above. Essentially it's because of the l' in "l'hai". It's a contraction for "la". And you can tell it's "la" (feminine) instead of "lo" (masculine) because of what happens to the verb "vista" as a direct response to the object since it comes before "avere" (hai). So, "vista" says the l' is la (her/it) instead of lo (him/it).
In my opinion, "where" implies a reference to the action in the past, not its consequence in the present, so "where did you see her?" is the only natural translation.
Funny that in some dialects in Spanish the exact same sentence when used as an exclamation (translated: "¡¿Dónde la viste?!) means something like "No way! I don't believe you".