How to modify or develop Godot editor UI elements, and how to add new ones to a game?

Godot Version

Godot 4.51

Question

Hello all,
I’d like to understand how to develop new editor UI GUI elements. For example, new popup windows or a flowchart diagram in the main window (for instance). Also, if I want to build an in-game code editor, which isn’t a standard game UI element, how can I do this?

This is a good starting point.

From there you can build quite a lot just using gdscript.