Trying to understand "a refinement of the Peter–Weyl theorem" by Lusztig "A refinement of the Peter–Weyl theorem" is the title of Chapter 29 in Lusztig's "Introduction to quantum groups" (Birkhäuser 2010, reprint of the 1994 edition). This chapter is inside Part IV ("Canonical basis of $\dot{\mathbf U}$", chapters 23–30).
If I understand correctly, the said refinement occurs in Theorem 29.3.3. Here is what I was able to understand from this chapter.
Lusztig works with certain modification $\dot{\mathbf U}$ of the (generic?) quantum universal enveloping algebra $\mathbf U$ obtained by removing all the $K$ generators and the unit, and replacing them with the weight space; his motivation is that every $\mathbf U$-module with a weight decomposition can be viewed as an $\dot{\mathbf U}$-module.
Then he constructs a canonical basis $\dot{\mathbf B}$ of $\dot{\mathbf U}$ and partitions it into disjoint subsets $\dot{\mathbf B}[\lambda]$ by weights.
Then for each $\lambda$ he constructs two-sided ideals $\dot{\mathbf U}[{\geqslant\lambda}]\supseteq\dot{\mathbf U}[{>\lambda}]$ of $\dot{\mathbf U}$, such that the image $\pi(\dot{\mathbf B}[\lambda])$ of $\dot{\mathbf B}[\lambda]$ in $\dot{\mathbf U}[{\geqslant\lambda}]/\dot{\mathbf U}[{>\lambda}]$ is a basis.
He proves that the quotient $\dot{\mathbf U}[{\geqslant\lambda}]/\dot{\mathbf U}[{>\lambda}]$ has a unique direct sum decomposition into a bunch of simple left $\dot{\mathbf U}$-modules (call this bunch, say, $\mathscr L_\lambda$) and into another bunch of simple right $\dot{\mathbf U}$-modules (say, $\mathscr R_\lambda$).
And then he proves that for each $L\in\mathscr L_\lambda$ and each $R\in\mathscr R_\lambda$ the intersection $L\cap R$ is spanned by a unique element of the basis $\pi(\dot{\mathbf B}[\lambda])$ and this gives a bijection between $\mathscr L_\lambda\times\mathscr R_\lambda$ and the basis $\pi(\dot{\mathbf B}[\lambda])$.
There is some additional piece of valuable information which I omit, maybe it is still relevant?
I see that this is a beautiful theorem, and I see very vaguely connection with the Peter–Weyl theorem (which says that matrix elements of representations of a compact topological group $G$ are dense in $C(G)$).
Can you help me out? In what sense exactly is this a refinement of the Peter–Weyl theorem? For example (as a subquestion) does this require, as a step, to switch from the commutative noncocommutative function algebra $C(G)$ to (some version of) the cocommutative noncommutative group algebra, or the refinement works without that? Does it (another subquestion) also refine the analytic aspects like the key question whether matrix elements separate points, or is it confined to the purely algebraic version? Final subquestion — are you aware of any followup work on that?
Relevant previous questions (but I don't think they render this a duplicate; if somebody explains how some of them (or any others) do, I will happily close this one):
Peter-Weyl theorem (compact quantum groups)
Peter-Weyl vs. Schur-Weyl theorem
Canonical basis for the extended quantum enveloping algebras
Peter-Weyl theorem as proven in Cartier's Primer
Is there analogue of Peter-Weyl theorem for non-compact or quantum group
 A: For a complex reductive algebraic group $ G $, the Peter-Weyl theorem gives an isomorphism of $ G \times G $ representations
$$
\mathbb C[G] \cong \oplus_{\lambda} V(\lambda)^* \otimes V(\lambda)
$$
Here $ V(\lambda) $ is the irreducible representation with highest weight $\lambda $, $ \mathbb C[G] $ is the ring of regular functions on $ G $ and we have a map from the right to the left by forming matrix coefficients.
This is the direct analog of the Peter-Weyl theorem for compact groups.
Next, we have a $ G \times G$-equivariant perfect pairing $ U \mathfrak g \otimes \mathbb C[G] \rightarrow \mathbb C $, by regarding $ U \mathfrak g $ as differential operators at the origin.  This allows us to get a Peter-Weyl theorem for $ U \mathfrak g $ and a similar statement holds for the quantum group $ \mathbf U $.
I didn't look at the chapter in Lusztig's book, but I believe that his result is a refinement of this statement: his canonical basis of $ \mathbf U $ is compatible with this decomposition (at least after taking associated graded).
