“Allāh’s Messenger (salallāhu ‘alaihi wasallam) used to straighten our rows as if he was straightening an arrow…
Should we stand close to the person next to you (without causing discomfort) while maintaining the row (saf) is straight and aligned, or should we focus on joining feet in salah when in Jamaah (congregation), even if it is uncomfortable?

For 1400 years, this was not a major issue, but since the advent of 20th-century pseudo-Salafis, it has become one.
The 20th-century Pseudo-Salafis claim that we should join feet in Salah, and their evidence is the following:
Nuʿmān bin Bashīr (Allah be pleased with him) said:
فَرَأَيْتُ الرَّجُلَ يَلْزَقُ مَنْكِبَهُ بِمَنْكِبِ صَاحِبِهِ وَرُكْبَتَهُ بِرُكْبَةِ صَاحِبِهِ وَكَعْبَهُ بِكَعْبِهِ
“So I saw a person attach his shoulder to the shoulder of his companion, and his knee with his companion’s knee, and his ankle with his companion’s ankle.” (Reported by Abu Dawūd, under the chapter of ‘Straightening the Rows’, no. 622. Al-Albānī graded this hadīth as sahīh.)
Anas bin Mālik (Allah be pleased with him) said:
وَكَانَ أَحَدُنَا يُلْزِقُ مَنْكِبَهُ بِمَنْكِبِ صَاحِبِهِ وَقَدَمَهُ بِقَدَمِهِ
“Every one of us used to put his shoulder with the shoulder of his companion and his foot with the foot of his companion.” (Reported by al-Bukhārī, no. 725.) End.
If the Salafis want to follow the hadith, then why do they only mention a portion of the hadith, i.e., the joining of the feet part only? Why don’t they mention joining shoulders to shoulders and knees to knees…as the full hadith says? Because it’s not possible to join all 3 at the same time (that’s why), and the portion of the hadith that mentions the knees and shoulders, even the pseudo-Salafis do not act upon it.
The other point regarding the above 2 Hadiths is that they are not Marfu` Hadiths; i.e., nowhere in them does it say that our beloved Prophet Muhammad (PBUH) said, ‘Join your feet in Salah with the person next to you.’ ie the Sanad (the chain) does not reach our Prophet Muhammad (PBUH).
The above 2 hadiths are the sayings of Nuʿmān bin Bashīr (Allah be pleased with him) & Anas bin Mālik (Allah be pleased with him), but not of our Prophet Muhammad (PBUH).
What do the scholars of Hadith say about the above 2 hadiths?
The great Hadith scholar Ibn Hajar al-Asqalani (author of Fath al-Bari) sums it up:
The hadiths emphasize and imply strengthening the rows and straightening the lines (safs) by aligning shoulders to shoulders and feet to feet, rather than solely focusing on touching the feet, knees, and shoulders of the person next to you.
Touching Feet, Touching Knees and Touching Shoulders, (all at the same time) , of the person on the left and right side of YOU, is not possible, or would be very uncomfortable for everyone in the Jamaa’ah (if it was attempted)…
The Salah of a Believer should be, as Prophet Muhammad (PBUH) said, with khushu` (focus of mind and humility before Allah), not focused on TOUCHING.
Furthermore, the vast majority of hadiths regarding the rows (safs) in salah explicitly or implicitly mention and imply straightening the rows.
See below an example.
The Prophet ﷺ said: “Straighten your rows, stand shoulder to shoulder, close the gaps, be gentle with the hands of your brothers, and do not leave gaps for Shayṭān …”[Sunan Abū Dawūd 666]
“Allāh’s Messenger (salallāhu ‘alaihi wasallam) used to straighten our rows as if he was straightening an arrow…