Place peeled and chopped potatoes into a large pot of boiling salted water. Cook until the potatoes are tender when pierced with a fork, about 15 minutes. Drain well and let cool slightly.
Mash the cooked potatoes thoroughly in a mixing bowl until smooth. Add the beaten egg and stir to combine. Gradually mix in the flour, folding until a soft dough forms that is slightly sticky but workable.
Turn the dough onto a floured surface and divide into four portions. Roll each portion into a long rope about ¾-inch in diameter. Cut into 1-inch pieces, then gently roll each piece over the tines of a fork to create ridges.
Bring a large pot of salted water to a boil. Drop the gnocchi in batches and cook until they float to the surface, about 2-3 minutes. Use a slotted spoon or tongs to remove and drain them.
Heat olive oil in a large skillet over medium heat. Add the minced garlic and rosemary sprigs, sauté until fragrant and the garlic begins to turn golden, about 1-2 minutes. Discard the rosemary sprigs.
Add the cooked gnocchi to the skillet and cook until golden brown and crispy on the edges, about 5-7 minutes. Add cherry tomatoes and chopped sun-dried tomatoes, stirring to combine. Cook until the tomatoes soften and release their juices, about 3-4 minutes. Season with salt and pepper to taste. Serve hot.