[imp] better sidebar logic