优化偏好面板及表格按钮的实现指南
1. 优化偏好面板
在优化偏好面板时,有两个主要的改进方向,分别是让行删除操作更便捷以及处理相互依赖的收藏值问题。
1.1 让行删除更便捷
在之前的版本中,删除行的操作存在一些问题。比如,删除选中行后,总是会选中第一行,这并非我们想要的结果。而在当前版本中,情况变得更奇怪,会出现多个选中行的情况。
为了解决这些问题,我们可以编写测试用例来规范行删除的行为,具体如下:
context "removing a row"
should "remove the currently selected row from the table"
should "remove the currently selected row from the preferences"
should "do nothing if no row is selected"
should "remove multiple preferences if multiple rows selected"
should_eventually "select the next row, if there is one"
should_eventually "even select the next row if given a selected range"
should_eventually "even select next row if given a disjoint set"
should_eventually "select the last tab
超级会员免费看
订阅专栏 解锁全文
27

被折叠的 条评论
为什么被折叠?



