Plan elements: a palette that knows the rules¶
In the floor plan editor, people should not have to know how a door sits in a wall or how far a cupboard stands from it. A palette beside the plan holds elements to drag in. Each element type knows how it may be placed, and the plan shows that rule while dragging. Guiding question: what makes working with a floor plan easier for Mara and Renate? (Issues #164, #165; part of #139.)
Room first¶
The house outline usually comes from the address or a scan. What is missing is the inside. The editor therefore starts with rooms, not walls:
- Draw rooms: drag a rectangle and say what the room is. Its walls appear, shared with neighbours (#162).
- Divide rooms: one line across a room makes two (#163).
- Elements from the palette: doors, windows, passages, later furniture and fixtures (#164, #165).
- Single walls stay for fine work and for people who think in walls.
Placement rules¶
Every element type has exactly one placement rule. The rule decides where it snaps, what guides are drawn, and what the keyboard offers as targets.
| Rule | Meaning | Examples | Guides while placing |
|---|---|---|---|
| In a wall | Sits inside a wall, moves only along it, takes the wall's thickness | Door, window, passage | Snaps into the nearest wall; distance to both ends; swing arc |
| Free | Stands anywhere in a room, turns freely | Fireplace, table, sofa | Angle while turning, distance to walls |
| At a wall | Stands with its back to a wall, keeps a gap | Cupboard, kitchen unit, radiator | Snaps to the wall face; gap in cm |
| Under another | Fits below an element of a given height | Chair under a table, dishwasher under a worktop | Shows whether the height fits |
Openings: handing and swing¶
Doors and windows know which side the hinge is on (left or right) and which way they open (in or out). The plan draws the leaf and the swing arc, so a door that hits a wall or another door shows up at once. Flip buttons and the properties box change both; the arc is also described in words ("opens into the hallway, hinge on the left").
Finding an element¶
Once the palette holds more than a handful of elements, a search field sits on top. It matches names and synonyms in the user's language ("couch" finds the sofa, "Fenster" finds the window), groups results by kind, and shows recently used elements first. With the keyboard, typing in the field and pressing Enter arms the first match, so search is also the fastest way to place an element without a mouse.
Accessible by design¶
- Keyboard and screen reader: choose an element in the palette, then choose the target from a list (walls for "in a wall", rooms for "free"). Arrow keys move, a key turns or flips.
- Two channels: every guide is also a number or a sentence in the status line.
- No hidden gestures: drag and drop is one way; tap element, tap target is the other.
Later¶
Furniture with real sizes from an EAN code (#46), heights for "under another", and collision checks between elements. Each type is data (size, rule, optional height), so packages can add their own.