Skip to content

Commit

Permalink
feat(issue-views): Persist Page Filters to Issue Views (#84717)
Browse files Browse the repository at this point in the history
This PR makes a major refactor to issue views to support saving page
filters to views.

High level of all changes made: 

* All navigations have been updated to include page filters in the url
query
* Unsaved changes logic has been updated to trigger when the page
filters in the url query changes
* All usages of the page filter store have been removed. Issue Views is
now completely decoupled from global page filters.
* Tests have been updated to reflect new logic 

**This feature is gated behind a [feature
flag](https://github.com/getsentry/sentry/blob/bb871499b3399c44e60909c76041a6b5f9f3977b/static/app/views/issueList/overview.tsx#L1071)**
(`issue-views-page-filter`) Currently, only the Issues Team has access
to this flag (after [this
PR](getsentry/sentry-options-automator#3123)
lands). Let me know if you would like it enabled for you.


NOTE FOR TESTERS: You may notice some weird behavior if you flip the
feature flag on and off to test. Specifically, flipping the feature flag
off will reset all of the page filters you saved to your views. This is
expected behavior, your page filters aren't busted.
  • Loading branch information
MichaelSun48 authored Feb 10, 2025
1 parent 9f3cfe9 commit 50f64f4
Show file tree
Hide file tree
Showing 9 changed files with 506 additions and 238 deletions.
10 changes: 5 additions & 5 deletions static/app/components/draggableTabs/draggableTabListPF.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {motion, Reorder} from 'framer-motion';

import {Button} from 'sentry/components/button';
import {CompactSelect} from 'sentry/components/compactSelect';
import type {DraggableTabListProps} from 'sentry/components/draggableTabs/draggableTabList';
import DropdownButton from 'sentry/components/dropdownButton';
import {type BaseTabProps, Tab} from 'sentry/components/tabs/tab';
import {IconAdd, IconEllipsis} from 'sentry/icons';
Expand All @@ -34,14 +33,15 @@ import {useDimensions} from 'sentry/utils/useDimensions';
import {useDimensionsMultiple} from 'sentry/utils/useDimensionsMultiple';
import {useNavigate} from 'sentry/utils/useNavigate';
import useOrganization from 'sentry/utils/useOrganization';
import {IssueViewsPFContext} from 'sentry/views/issueList/issueViewsPF/issueViewsPF';
import {
IssueViewsPFContext,
TEMPORARY_TAB_KEY,
} from 'sentry/views/issueList/issueViewsPF/issueViewsPF';

import type {DraggableTabListItemProps} from './item';
import {Item} from './item';

export const TEMPORARY_TAB_KEY = 'temporary-tab';

interface BaseDraggableTabListProps extends DraggableTabListProps {
interface BaseDraggableTabListProps extends DraggableTabListPFProps {
items: DraggableTabListItemProps[];
}

Expand Down
2 changes: 1 addition & 1 deletion static/app/stores/pageFiltersStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {valueIsEqual} from 'sentry/utils/object/valueIsEqual';

import type {StrictStoreDefinition} from './types';

function datetimeHasSameValue(
export function datetimeHasSameValue(
a: PageFilters['datetime'],
b: PageFilters['datetime']
): boolean {
Expand Down
5 changes: 4 additions & 1 deletion static/app/views/issueList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ function IssueListContainer({children}: Props) {

return (
<SentryDocumentTitle title={t('Issues')} orgSlug={organization.slug}>
<PageFiltersContainer>
<PageFiltersContainer
skipLoadLastUsed={organization.features.includes('issue-views-page-filter')}
disablePersistence={organization.features.includes('issue-views-page-filter')}
>
<NoProjectMessage organization={organization}>{children}</NoProjectMessage>
</PageFiltersContainer>
</SentryDocumentTitle>
Expand Down
Loading

0 comments on commit 50f64f4

Please sign in to comment.