How about adding 2" to the depth of the shelf, and then a 1" high lip?
The added depth would not decrease legroom, since your legs don't go on the shelf. And while it would narrow the passage slightly (e.g. when exiting or climbing over another pax), the 2" would not make much difference for walking through, but would make a lot of difference for being able to store things on the shelf (e.g. Bose headphones, or a sweater, or a book larger than a supermarket romance novel).