Cut chicken into bite-sized pieces (about one inch each). Pat dry with paper towels. Chop shallot and garlic finely. Grate ginger using a microplane or box grater. For the salsa, dice pineapple into chunks slightly bigger than chicken pieces. Remove jalapeño seeds if desired for mild heat. Chop second shallot finely. Strip thyme leaves from stems.
In a glass jar or bowl, whisk together soy sauce, pineapple juice, brown sugar, and ketchup. Add chopped shallot, garlic, grated ginger, and red pepper flakes. Whisk until brown sugar completely dissolves and sauce looks glossy.
Remove one-third of the sauce and set aside in a small bowl. Pour remaining sauce over chicken pieces in a shallow dish or resealable bag. Toss to coat. Let marinate for at least 15 minutes at room temperature, or up to overnight in the fridge.
In a medium bowl, toss together pineapple chunks, chopped shallot, jalapeño, and thyme leaves. Squeeze in juice from one lime. Mix gently. Set aside at room temperature.
Pour coconut milk and water into a medium saucepan (shake coconut milk can well before opening). Heat over medium-high until it starts to gently boil. Add basmati rice and a pinch of salt. Stir once.
Cover with a tight-fitting lid and reduce heat to lowest setting. Do not lift the lid. Let cook for 10 minutes. After 10 minutes, turn off heat but keep lid on. Let sit for another 15-20 minutes. Fluff gently with a fork when ready to serve.
Heat sesame oil in a large skillet over medium-high heat until shimmering. Remove chicken from marinade, letting excess drip off. Discard used marinade. Lay chicken pieces in skillet in a single layer. Don't crowd the pan; cook in batches if needed.
Don't touch chicken for 3 minutes to develop golden crust. Flip each piece and cook for another 2 minutes. Reduce heat to medium. Pour in reserved sauce. Stir chicken to coat every piece.
Continue cooking for about 5 minutes, stirring occasionally, until sauce reduces and becomes glossy and syrupy. Chicken should reach 165°F internally. Remove from heat and stir in chopped cilantro.
Fluff coconut rice with a fork and divide between serving plates or bowls. Arrange glazed chicken over rice. Spoon any remaining sauce from skillet over the top. Pile pineapple salsa generously over chicken. Scatter diced avocado over everything. Squeeze extra lime if desired.