Commit bbd6408d authored by Robert Knight's avatar Robert Knight

Don't clear filters when clearing selection

When focus filters are in use (eg. user / page filters) it is annoying if
clicking a highlight in the document and then clearing the selection has the
effect of disabling the focus filters. Instead the plan is to have the selection
temporarily replace filters when active.
parent 6191b3fe
......@@ -176,16 +176,6 @@ const reducers = {
focusActive,
};
},
// Actions defined in other modules
CLEAR_SELECTION() {
return {
filters: {},
focusActive: new Set<FilterKey>(),
query: null,
};
},
};
// Action creators
......
......@@ -179,22 +179,6 @@ describe('sidebar/store/modules/filters', () => {
assert.deepEqual(store.getFocusActive(), new Set(['user', 'page']));
});
});
describe('CLEAR_SELECTION', () => {
it('responds to CLEAR_SELECTION by clearing filters and focus', () => {
store.changeFocusModeUser({
username: 'testuser',
displayName: 'Test User',
});
store.toggleFocusMode({ active: true });
assert.deepEqual(store.getFocusActive(), new Set(['user']));
store.clearSelection();
assert.deepEqual(store.getFocusActive(), new Set());
});
});
});
describe('selectors', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment