01 - Heat olive oil in a large skillet over medium heat. Add sliced onion and pinch of salt. Cook, stirring frequently, until soft and golden brown, about 15 minutes. Stir in balsamic vinegar and cook 1–2 minutes more. Remove from heat and set aside.
02 - Butter one side of each bread slice. Place 4 slices, buttered side down, on a clean work surface.
03 - Layer each buttered bread slice with 1 slice of cheddar, distribute pear and apple slices evenly, add a spoonful of caramelized onions, then top with another cheddar slice. Optionally spread Dijon mustard on the inside of the remaining bread slices.
04 - Place remaining bread slices on top, buttered side facing up, to complete each sandwich.
05 - Heat a skillet or griddle over medium-low heat. Cook sandwiches until bread turns golden brown and cheese melts completely, approximately 4–5 minutes per side. Press gently with a spatula during cooking for even browning.
06 - Cut each sandwich in half diagonally. Sprinkle with fresh thyme leaves if using. Serve immediately while hot and cheese remains melted.