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

Don't let toast elapse in background in some browsers #7741

Merged
merged 14 commits into from
Apr 15, 2024

Conversation

dieknolle3333
Copy link
Contributor

@dieknolle3333 dieknolle3333 commented Apr 9, 2024

URL of deployed dev instance (used for testing):

Steps to test:

  • Use Chrome or sth. Chromium based
  • Do anything that takes a bit of time and where toasts are shown in the process, such as:
    - upload a larger dataset and switch the tab
    - wait until the upload is done for a while
    - go back to the WK tab and make sure both toasts are shown at least for a very short time (there should be at least two toasts after switching back)
  • create scenarios where error toasts and warning toasts are shown. Make sure that their content is printed to the console, except if the toast content is a more complex react node (containing a link, for example).

Issues:


(Please delete unneeded items, merge only when none are left open)

@dieknolle3333 dieknolle3333 self-assigned this Apr 9, 2024
@dieknolle3333 dieknolle3333 changed the title [ci skip] WIP: try to not let toast elapse in background Don't let toast elapse in background in some browsers Apr 10, 2024
@@ -700,11 +700,11 @@ async function applyLayerState(stateByLayer: UrlStateByLayer) {
// The name of the layer could have changed if a volume tracing was created from a viewed annotation
effectiveLayerName = getLayerByName(dataset, layerName, true).name;
} catch (e) {
console.error(e);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In cases like this I didnt omit the separate log because Error not only has a message, but also a type, and I didnt want that to be omitted. Let me know if you think I should change that :)

@dieknolle3333 dieknolle3333 marked this pull request as ready for review April 10, 2024 13:59
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

nice :) I left two small suggestions.

frontend/javascripts/libs/toast.tsx Outdated Show resolved Hide resolved
frontend/javascripts/libs/toast.tsx Outdated Show resolved Hide resolved
frontend/javascripts/libs/toast.tsx Outdated Show resolved Hide resolved
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

sweet :)

@dieknolle3333 dieknolle3333 enabled auto-merge (squash) April 15, 2024 12:32
@dieknolle3333 dieknolle3333 merged commit ca2b052 into master Apr 15, 2024
2 checks passed
@dieknolle3333 dieknolle3333 deleted the timeout-tab-not-in-background branch April 15, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure toast timeout doesn't elapse when tab is in background
2 participants