added row selection and logic to know if we are in single pane layout versus list/detail