Which is the longest and most detailed Tafseer of Quran ever written in Islamic history? By longest I mean most voluminous Tafseer.
The biggest tafssir I saw and consulted in a library that I know of -and it is certainly not the longest- is that of at-Taher ibn 'Ashur called at-Tahrir wa-Tanwir in over 30 Volumes. It is helpful when one wants to do linguistic research and in many cases ibn 'Ashur is able to find links to Torah and New Testament. He also discusses the qira'at, but often don't discuss hadith sources.
I've lately read and tried to download a tafssir of a scholar from 'Iraq -if I remember well- which is basically a summary of all -based on what he considered as a source- known tafssir books it should be big enough. Maybe I'll find it again.
Another (or the) modern "summary" was made or edited and published by 'Abdurrahman ibn Muhammad al-Qumash (or al-Qammash ...?) عبد الرحمن بن محمد القماش it is written in 840 volumes and 300.000 pages and called
الحاوي في تفسير القرآن الكريم (جنة المشتاق في تفسير كلام الملك الخلاق) Al-Hawi fi tafssir al-Qur'an al-Karim (or Jannat al-Mushtaq fi tafssir kalam al-Malik al-Khallaq.
The editor, scholar or sheikh is an imam and khatib in the mosque Burusly بُورُسْلي in the emirat of Ra's al-Khayma in the United Arab Emirates. Among the sources he toke was the tafssir of Mujahd, of at-Tabari, and many known or rather hardly (meaning only specialist may have knowledge about them) known sources.. he also used information from books on 'irab of al-Quran, the qira'at etc. I stopped counting sources at around 60 and felt like I didn't reach the middle of the list (see here in Arabic - there should be a download available). You may find a questioner criticizing this book in this fatwa on islamweb #274663 -in Arabic- which doesn't come to a clear conclusion.
There's a tafssir which is said to have been written in 300 volumes -according a statement of ibn 'Asakir- of a Mu'tazili scholar called Abu Yusuf abdu As-Salaam ibn Muhammad ibn Yusuf ibn Bindar al-Qazwini أبو يوسف عبد السلام بن محمد بن يوسف بن بندار القزويني his tafssir is called Hada'iq dhatu Bahja حدائق ذات بهجة . According to a Sheikh called Hamad al-Ansari and one of the Mubarkapuri's this book exists in a handwritten form (either in a German or Turkish library) but is not yet printed. (Source this thread and the Wikipedia article in Arabic)