Engine light is on because you have had ignition switched on with things disconnected (the TPS for sure and probably even the tank and air temp sensor I would bet at some point) - the light will go out - assuming you have resolved all the triggers that might set it to begin (& you probably have at this point) - after 3 complete warm-up/cool-down heat cycles of the engine - OR you can reset it with an OBD2 reader or TuneECU - if you plan to do any work on a Triumph EFI bike the latter is ESSENTIAL tool - would have saved you a lot of time & effort in diagnosing that TPS pretty much instantly.
The White connector is for an optional alarm - all Triumphs have this capability built-in - the bypass plug with the loop is to 'make' the (otherwise) immobilizer connection - without the bypass plug installed the bike will not run.
The Connector you identified is for the California-only fuel vapor emissions control equipment - in all other markets this would be unconnected (incidentally this is THE most asked question across these forums)
Idle speed - no manual adjustment - it is set by closed loop control by the ECU, adjusting the idle control valve position (& resultant air flow) to achieve the idle set-point - don't hold too much store in what the tach indicates, not that accurate down there. If idle is rough and appears low, you most likely need to balance the throttle bodies.
You will need a set of vacuum balance gauges to do that.
Relay on when battery connected:
The two headlight relays (one for high beam, one for low - incidentally these only apply to ONE of the lamps each [opposite lamps] - this is by design for markets that cannot have two lamps spaced next to each other, in which case relays are not installed in the sockets)
- these relays are NOT common or garden 'generic' automotive relays which are type B- they are supposed to be type A relays
The 86 & 30 terminals are transposed between types A & B;
If a type B relay is installed, it will appear
as if the headlight control is working normally, switching the lamp on & off with key-switch
However as you have found, the relay will remain energized even when the ignition is off (this is because the constant power which normally supplies the 30 terminal is connected to 86 of relay coil - but since the ignition power is now (incorrectly) connected to the 30, the light will be off when the key is off, even though the relay itself is actually energized!)
Those two relays in the view you show - next to the Turn Signal Relay - should be the same - you can see even in pic that the one with the white mark is NOT original compared to the one in the centre.