"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