Not so many generations ago, siblings, and often entire families, shared a bedroom. Or, if the home was small, the bed, or beds, shared the living space.
Trundle beds solved part of the space problem. During the day, the child’s bed was pushed under the larger bed. At night, you simply pulled it out and claimed your space.
Another space-saver named the Murphy Bed arrived later. Tip the bed up in the morning, close the “closet doors” and use the floor space during the day.
Louisa, the heroine in the sweet romance, New Dreams, is furnished a narrow cot in the storeroom behind the bakery. For more about the book — check the blurb here: https://amzn.to/3vWydWE