When signing another key (respective a UID of this key), all that gets included from your key is the key ID.
Thunderbird tries to resolve that key ID to the key's default UID, but this only works if the public key is in Thunderbird's keyring.
If you want to resolve the UID in your own software, you must pull the key's ID and look for a matching public key.
so My conclusion is Pgp Signature doesn't contain signer's user id. It contains only keyid. If you also have public key of signer then it try to get userid from that public key and show you.
Yep, that's the only way to do.