¡Hola Henrik!
Thanks for your question!
The key thing to remember about el pretérito vs. el imperfecto is that el pretérito is used for actions that have a set start and a set finish in the past, while el imperfecto is used for actions that don't have this set start and finish — they were simply ongoing at some point. Another helpful thing to remember is that actions in el imperfecto are often background actions (like ones that set the scene in a story), while actions in el pretérito are often interrupting actions. As a result, actions that describe a state or condition (like estar “to be (temporary states),” which are commonly background actions, are rarely used in el pretérito.
Keeping all of this in mind, let's look again at the sentence from Lesson 12.8:
Usted es la mujer que estaba en el supermercado ayer.
“You are the woman who was at the supermarket yesterday.”
Here, the action of estar “to be (temporary states)” doesn't have a set beginning and end: as we say this sentence, we're not giving the impression that this woman started to be at the supermarket and then stopping being at the supermarket; instead, we're just saying that at the point of time that we're discussing, she simply was there. This is a background action, used to set the scene. You can tell because it could easily be interrupted by another action, like so:
La mujer estaba en el supermercado cuando la vi.
“The woman was at the supermarket when I saw her.”
As for the word ayer “yesterday”: it's true that it can be an indicator that you need to use el pretérito, because it shows that we're talking about the past. However, it can also be used with el imperfecto, since that's also a past tense. So try not to think of it specifically as a pretérito trigger; instead, it's best to think of it as a past tense trigger.
I hope that this has helped to clear everything up for you! It might be helpful to hop back to the section “Which Past Tense Should You Use?” in Lesson 10.6 “Action in the Past: 'El imperfecto'” if you'd like to get some more pretérito vs. imperfecto practice.
Let me know if you still have any questions!
Saludos,
Liss