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

Notification tray for displaying in-flight requests #12078

Open
wants to merge 48 commits into
base: develop
Choose a base branch
from

Conversation

somebody1234
Copy link
Contributor

Pull Request Description

Important Notes

  • This PR uses useIsMutating to find mutation state. It's possible to use useIsFetching to also display query state - however "list directory" background refetching would cause constant notifications.
  • UI is a placeholder - it does not need to be a notification tray, the important part of this PR is the new hook to return the state of all in-flight mutations.

Testing Instructions

  • Do all mutation types (delete, rename, copy, move, undelete, force delete, clear trash)
  • Open notification tray
  • Check for notification
    • The notification may have disappeared if the mutation has completed - this is intentional as the notifications are not meant to be permanent.

Further Improvements

  • Display red "unread notifications" badge when new notifications are in flight
  • Consider creating permanent notification objects instead, which include a timestamp, and are (possibly) preserved indefinitely
    • If the user is (e.g.) uploading or deleting a lot of assets though, it would clutter up the notification tray if/unless notifications caused by mutations are collapsed.
    • Notifications do not exist server side, so they are not preserved across sessions. This is fine, but we might want to have a log of mutations on the server side eventually.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

@somebody1234 somebody1234 added CI: No changelog needed Do not require a changelog entry for this PR. x-new-feature Type: new feature request g-dashboard labels Jan 19, 2025
Copy link

github-actions bot commented Jan 19, 2025

🧪 Storybook is successfully deployed!

📊 Dashboard:

@PabloBuchu
Copy link
Contributor

PabloBuchu commented Feb 5, 2025

  1. Styling issues? The + changed color
Screenshot 2025-02-05 at 10 24 24
  1. Upload image is completely broken. This is what I am getting when I drop a file
Screenshot 2025-02-05 at 10 25 02
  1. The notification try. Like that we can use that later for backend related stuff as well. I think maybe we should move it to the user context menu and display small number on the avatar indicating some unread messages? How can I trigger a message to appear in the tray?
Screenshot 2025-02-05 at 10 26 49
  1. Create >10 directories -> select them all -> hit delete -> accept dialog. The loader cursor appears for a fraction of time but when I am waiting for dirs to be removed I loader is not here (they are disabled yes) but it feels inconsistent.

@somebody1234
Copy link
Contributor Author

somebody1234 commented Feb 5, 2025

  1. ℹ️ out of scope
  2. ✅ Upload image is completely broken
    • fixed and pushed
  3. .
    • ℹ️ we can use that later for backend related stuff as well
      • yes, the idea is that it's just an array of objects that are shown by components. we should be able to nearly trivially query for a separate array from the backend and then merge the arrays together. ideally they should have timestamps so they can be sorted in the correct order
    • ⚠️ maybe we should move it to the user context menu and display small number on the avatar indicating some unread messages?
      • sounds reasonable, will look into it soon:tm:
    • ℹ️ How can I trigger a message to appear in the tray?
      • right now? no backend support, but batch copy, batch move, batch delete, batch undelete mutations are tracked
        • single copy/move/delete/undeletes also show up! because we recently made them use the batched methods for simplicity's sake
  4. ✅ Create >10 directories -> select them all -> hit delete -> accept dialog. The loader cursor appears for a fraction of time but when I am waiting for dirs to be removed I loader is not here
    • fixed and pushed

@somebody1234
Copy link
Contributor Author

@MrFlashAccount what was consensus on the solution to not wanting to display all of these temporary notifications btw?

  • delete after 5 min?
  • only show most recent?
  • keep for now and wait for feedback?
  • or maybe implement one of the two and add alternate modes behind feature flags?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. g-dashboard x-new-feature Type: new feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants