Ignoring complications such as UK residence, US workdays, UK employer pensions, State filing obligations and assuming you qualify for the foreign earned income exclusion on the entire earned income, the the answer is quite straightforward (phew!):
1. The earnings get excluded from US tax.
2. There is no UK tax on the dividend income because the UK tax is notional, so does not actually ever get paid.
3. There is no UK tax on the capital gains because they fall below the annual capital gains tax exemption.
So you report the $10,000 (of which $5,000 goes into a passive 1116, although there is actually no passive tax paid), deduct your deductions and exemptions and pay US tax on what's left.
The treaty may help in getting the qualified rate on the dividends, depending on the time you held he stock. It will not eliminate US taxes entirely, nor will foreign tax credits because you'd not have paid any foreign taxes at all on the investment income.