Fix sidebar/list.js issues & add legend