Cargo fire
So that's becoming clear then; it was a cargofire.
A fire starting in the cockpit is quite possible, in electronics or electric equipment, but apparently that was not the case here.
Meaning that keeping smoke out of the cockpit would have made a difference. At least in inside visibilty. No telling which systems would be affected after the fire spread.
Hopefully regulators will soon mandate some changes in how the cockpit is kept clear of smoke, to the extent possible.
And how to keep ignition sources out of the freight, although that would seem a more difficult task.