Hi enquirer_2023June_HMRC,
If you qualify for split year then you only report any foreign income for the UK part of the year:
RDRM12000 - Residence: The SRT: Split year treatment: Contents.
If you do not qualify then you will need to report all your foreign income to the UK:
Tax on foreign income
The guidance at RDRM12150 at www.gov.uk will help you work out if split year treatment applies.
If this applies, then it is the dividends that you report. you will only have a capital gain when/if you sell.
Thank you.