Having to click on the link in the narrative to open the pop-up, then open the codex entry from the pop-up (as the pop-up is difficult to see without resizing), then click again to pin that entry to the side panel, and only getting one item pinned there is a lot of clickout of of flow state writing.
I suggest a dynamic codex side panel, where any codex entries that appear in the viewable portion of the screen automatically appear in the right (or left) side panel, not the full entries, but a version of it that shows the important content and lets you click into parent/child relation entries directly inside the side panel. The group of codex entries should be scrollable so if there are 5-10 items on the viewable screen, then they all cascade down the side panel in the order they appear in the text. Could limit it to the general paragraph or area where the cursor is, but I would argue that if I'm wrigin about certain codex contepts or characers or locations, I would like to see that content quickly and immediately on the side to reference.