Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(issue-views): Fold navigate behavior into issueViews context #82540

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

MichaelSun48
Copy link
Member

This PR refactors the issue views family of components by moving lots of the navigation logic into the IssueViews context created in this PR.

Many of the tab actions that were folded into the IssueViews context require changes to the query parameters, which is why it makes sense to combine these two actions in the reducer function. For example:

  • Duplicating a tab requires the newly created tab to be selected (change viewId parameter)
  • Discarding a tab's changes requires the query/sort to be reset to the original query/sort (change query/sort param

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 23, 2024
@MichaelSun48 MichaelSun48 marked this pull request as ready for review December 23, 2024 18:39
@MichaelSun48 MichaelSun48 requested a review from a team as a code owner December 23, 2024 18:39
if (action.type === 'SYNC_VIEWS_TO_BACKEND' || action.syncViews) {
debounceUpdateViews(newState.views);
}

if (action.updateQueryParams) {
queueMicrotask(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this queueMicrotask necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed to fix an error that would occur in tests (something about not being able to simultaneously update state in two components at once), though that never seemed to be an issue in the UI.

@MichaelSun48 MichaelSun48 merged commit 518b63d into master Dec 27, 2024
43 checks passed
@MichaelSun48 MichaelSun48 deleted the msun/issueViews/navLogicInContext branch December 27, 2024 16:07
andrewshie-sentry pushed a commit that referenced this pull request Jan 2, 2025
)

This PR refactors the issue views family of components by moving lots of
the navigation logic into the IssueViews context created in [this
PR](#82429).

Many of the tab actions that were folded into the IssueViews context
require changes to the query parameters, which is why it makes sense to
combine these two actions in the reducer function. For example:
* Duplicating a tab requires the newly created tab to be selected
(change viewId parameter)
* Discarding a tab's changes requires the query/sort to be reset to the
original query/sort (change query/sort param
@malwilley malwilley added the Trigger: Revert Add to a merged PR to revert it (skips CI) label Jan 3, 2025
@getsentry-bot
Copy link
Contributor

PR reverted: 520e316

getsentry-bot added a commit that referenced this pull request Jan 3, 2025
@malwilley
Copy link
Member

malwilley commented Jan 3, 2025

@MichaelSun48 reverting because we noticed a bug with this change:

  1. Go to issue stream with a temp view selected
  2. Click into an issue
  3. Go back to issue stream

This would often cause the issue stream to lock up or not navigate back at all

@MichaelSun48 MichaelSun48 restored the msun/issueViews/navLogicInContext branch January 3, 2025 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components Trigger: Revert Add to a merged PR to revert it (skips CI)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants