Skip to content

Commit

Permalink
Don't clear filters when clearing selection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
robertknight committed Jan 19, 2024
1 parent 6191b3f commit bbd6408
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
10 changes: 0 additions & 10 deletions src/sidebar/store/modules/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,6 @@ const reducers = {
focusActive,
};
},

// Actions defined in other modules

CLEAR_SELECTION() {
return {
filters: {},
focusActive: new Set<FilterKey>(),
query: null,
};
},
};

// Action creators
Expand Down
16 changes: 0 additions & 16 deletions src/sidebar/store/modules/test/filters-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit bbd6408

Please sign in to comment.