Save AI explanations and Point Them to a Specific Area in the Code

Sometimes the AI will provide me detailed explanations of what it is doing in some of its suggested code. They are long and detailed explanations that are great for my own learning and potentially to other people looking at the code. But I don’t want to have huge blocks of greyed out comments across my whole code.

You know how in excel you can add a comment to a particular cell and when you hover over with the mouse a popup box appears with the comment? Would I be able to select portions of the explanations provided by the AI and save to some type of popup that appears when i hover over certain blocks of code? Perhaps in a discreet way so that the whole code doesn’t become unpleasant to navigate visually.

I often find myself learning things and new syntax from the AI which eventually get lost in the history of the chat and sometimes I think “oh what was it again that the AI had to say about this?” or “why was it again that I did the code this way?”, but I either closed that chat because it became to big or its too far behind and would take ages to scroll back and find it.

This would not only be a great learning tool for more junior devs, but also for other people looking at your code for the first time and trying to understand why things were done a certain way in certain places.

Thanks.